Matrixnull's profileMatrixnullPhotosBlogLists Tools Help
Photo 1 of 5
More albums (1)
No list items have been added yet.

Matrixnull

Enjoy Coding,Enjoy Life
December 14

OpenMP 线程化(Threading)基础(1)

或许你手头上有一些现成的代码,你想把它们线程化以便能都更好地运行在多核的系统(Multicore System)上。再开始动手操作之前你需要知道些什么呢?
  这篇文章将会告诉你如何通过使用openMP对你的代码进行线程化,并帮助你决定哪些地方进行线程化,还会向你展示如何测试更改后的代码。同时还会对一些典型的Win32 线程进行比较。  
  今天你已经可以开到内核数不断增长的多核处理器(Mulitcore Processors)。其结果就是,程序员们需要将线程的概念加入他们的代码中以便可以利用多核的优点,并且将性能敏感(Performance-Sensitive)的代码分离出来。然而,你的代码一定要测试好,因为相同的代码可能运行在单核(single-core),双核(dual-core),四核(quad-core)甚至更多核的机器上。这一章里,将更多的着眼于通用线程化技术,并使用OpenMP 线程化库,而且测试它们的性能。这些将会给你一些性能基线(Performance Baselines)做参考,你将学会如何线程化和测试你的代码。
  OpenMP是一个用来编写简单线程代码的函数库。常常用来在原有的单线程代码中加入线程代码。我假设你熟悉线程基本概念,但是不要求你使用过openMP或者有编写多线程代码的经验。
让我们先来看一些简单的代码,使用OpenMP 对其进行线程化,再看看代码在一台双核系统上的表现。这些将会让你对OpenMP是如何执行的有更好的理解,同时你也会学到如何修改你的代码和测试代码。为了做比较,Win32线程化也会有所展示。
  所有的代码都是用C++编写的,使用Intel C++ 9.0 编译器编译。在Windows XP SP2操作系统上进行测试。阅读附录有关测试平台配置的章节可以获得更详细的信息。 
   这里所列出的示例代码,如果强行执行在单线程上会有较小的性能降低。OpenMP 也拥有与Win32线程相似的开销。然而,循环启动的开销对于OpenMP和Win32线程来说都是比较高的。
   这就是说,这种机制实现的线程化对于循环较少或是性能敏感度较高的程序来说并不准确。这些情况需要运用其他机制实现线程化,比如线程池(Thread Pools)。
   未完待续......

August 22

70个流行的AJAX应用的演示和源码下载 [转]

  1. Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell
  2. AJAX - microlink pattern tutorial : A microlink is a link that opens up content below it.
  3. Ajax BBC News RSS Reader : demo by Nigel Crawley
  4. AJAX Chat in Python with Dojo : at AquaAjax
  5. Ajax Chess : multiplayer chess
  6. Ajax examples at BackBase : examples demonstrating several aspects of the Backbase technology.
  7. Ajax examples at Rico : Inner HTML, JavaScript updater etc.
  8. Ajax examples using ColdFusionMX, SQLServer, SOAP : Contact Manager, NOAA 7 Day Forecast code and demos.
  9. Ajax Feed TV : News feed
  10. Ajax inline dictionary : Highlight any text on this site then right click. A tooltip containing the definition of the selected word should show up.
  11. Ajaxload : Ajax loading gif generator.
  12. Ajax Login Demo : Creating a secure login system using XMLHttpRequest
  13. Ajax Newsletter Signup : A newsletter signup form that shows Thank You on the same page.
  14. ajaxProject : Project Management applicaiton with rich UI
  15. Ajax Rater : A star rating system that uses Ajax.
  16. AJAX-S : An Ajax-based slideshow system.
  17. AJAX Spell Checker : spell check text / form content.
  18. Ajax Toolbox : Tools for the Ajax Developer
  19. Amazon Catalog Tree : Amazon Catalog Tree
  20. Amazon Zuggest : Amazon product suggestion (like google suggest)
  21. Askeet by symfony : Digg-like AJAX interactions; open source
  22. Backbase - Ajax Demos : Ajax demos at BackBase
  23. Basic Ajax Examples : Ping, track changes, drop down, Google suggest hack etc at Clearnova
  24. Behaviour : Fading lists, Sortable lists, Dropout boxen, Shaky lists
  25. chat.app : ajax chat
  26. Chihuahua Word Puzzle : daily word puzzles
  27. Coloir : Ajax Slideshow
  28. DHTML arcade/action games : a collection that demonstrate the power of DHTML
  29. DomAPI : Windows Desktop, Outlook-like, RSS Reader
  30. Drag and Drop Shopping Cart Demo : at CyberDummy
  31. Easy AJAX inline text edit 2.0 : edit a piece of text inline
  32. FileChucker : File upload and progress bar at Encodable.com
  33. Gmail Style Check Username AJAX Demo : at CyberDummy
  34. Google Web Toolkit Example Projects : Hello World, Dynamic Table, Desktop App Clone etc
  35. GreyBox : Pop up window using idea of light box.
  36. FiftyFourEleven: Ajax Examples
  37. IntuiCat - ajax Catalogue : Ajax-based Catalogue Demo
  38. jsLINB programming demos : LINB(Lazy INternet and Browser)
  39. JSlog : Ajax logging tool.
  40. JS/UIX Unix Shell : JS/UIX is an UN*X-like OS for standard web-browsers, written entirely in JavaScript.
  41. Lace : free web chat application
  42. Lightbox : simple, unobtrusive script used to overlay images on the current page.
  43. Leightbox : Light Box with inline div’s instead of AJAX calls.
  44. Live Quote Demo : Simple way of creating an updating stock quote table in ajax.
  45. Magnetic Poetry : drag and drop poetry
  46. Metatron Chat Engine : PHP/MySQL/JavaScript powered chat engine
  47. Monket Calendar : online calendar
  48. Multi List Drag Drop Demo : at CyberDummy
  49. NetDirector : open and extensible framework for managing configurations of common open source network services.
  50. nexImage : Image processing demo
  51. Opera Platform : Enabling AJAX applications on mobile phones
  52. Orbeon examples : various examples illustrating the capabilities of OPS, from the OPS Tutorial examples to XForms examples
  53. OVO Suite : Online Virtual Office : virtual office limited demo
  54. phpFreeChat : php Free Chat
  55. S5: A Simple Standards-Based Slide Show System : S5 is a slide show format based entirely on XHTML, CSS, and JavaScript.
  56. script.aculo.us Reflector : image reflector script that uses uses opacity-based fades
  57. Slider Bar Demo : at CyberDummy
  58. SmallestAjax : Smallest Ajax example in the world?
  59. Spell Check demo : by Primal Grasp
  60. Super Maryo World : Japanese game demo
  61. Tacos : Tacos provides a library of useful Tapestry components. This application provides some examples to get you started.
  62. theList : to-do list / bug-tracker
  63. ThickBox : ThickBox is a Lightbox than can show html pages as well as images.
  64. Tooltip.js : Tooltip.js is a simple class to make it possible to add tooltips to your page.
  65. Treehouse Chat : ajax chat
  66. Tudu Lists : open-source to-do lists
  67. WeBoggle : Ajax Boggle
  68. XHTML live Chat : ajax chat
  69. YahooSearchAsYouType : Yahoo search as you type
  70. ZK Demo : demo programs for various components
August 16

Google Analytics 服务试用

今天给空间加入了Google Analytics服务,试用一下看怎么样
August 10

程序员的Superman Returns--Turbo 产品回来了[转]

對於像我這樣年紀的IT人來說,Borland的Turbo系列幾乎是從學生時代就一直陪伴著我成長的朋友,我還記得大學2年級時我的第一個Data Structure and Algorithm的作業就是使用Turbo Pascal完成的。稍後學習C/C++時Borland的Turbo C/C++更是不能離手的工具,而我現在也仍然保留著Borland的Turbo Prolog 1.0,雖然磁片都已經發霉不能用了,不過Turbo Prolog當時帶給我的樂趣是現在我都忘不了的。
在Borland決定賣出開發工具產品線之後,其實也代表Borland把它的核心精神賣掉了,但是DevCo卻以繼承Borland原始精神的並且以持續發揚『寫程式的樂趣』為目標。許多人都在等著看DevCo如何能夠重新把Delphi/C++Builder/JBuilder帶回往日的盛況,雖然我還不確定DevCo能不能夠做到這點,但是至少現在我已經看到DevCo在具體行動了。Turbo產品系列是DevCo第一個在開發工具界的行動,我想DevCo把Turbo系列重新帶回來除了在市場,產品和收入的影響之外,更重要的意義是向全世界的開發人員宣示DevCo經營開發工具市場的決心。
在這次2006年的Turbo系列中,包含了Turbo Delphi for Win32, Turbo Delphi for .Net, Turbo C++ 以及 Turbo C#。每一個Turbo版本又分為Explorer和Professional版本,其中的Explorer版本是免費的,主要是為了讓教育界的人員或是想要學習程式設計的人使用的,DevCo特別強調希望把寫程式的樂趣藉由Turbo Explorer系列讓想進入軟體開發的人所充分的體驗到。
令許多人懷念的Turbo系列如今捲土重來
 
如果您對DevCo的Turbo系列有興趣,您可以在下面的URL找到更多的資訊:
 
還記得您第一次寫程式所得到的樂趣嗎? 希望DevCo能夠把那些令人懷念又愉快的感覺再找回來。
July 09

Don't push me

I’m a love ‘em and leave ‘em
Touch and tease ‘em kinda girl
I’m the perfect type
For one wild night

Yeah, I suffocate quick
Does that make me a *****?
I don’t really care, no

Well your roses were sweet
Really swept me off my feet
But I start to choke
When you say let’s elope

Yeah, I suffocate quick
Does that make me a *****
I don’t really care, no, no, no…

Don’t push me so hard, don’t push me so far
Don’t cage me in, don’t tie me down
Don’t push me so hard, don’t push me so far
Don’t cage me in, don’t tie me down

Can we take a bubble bath have a drink and a laugh
Enjoy what we have and then leave it to the past

‘Cause I don’t give a damn
Maybe you’re the perfect man
That’s not how this story goes

You can write me fat checks or buy diamonds for my neck
Buy a big fat ring I prefer Tiffany’s

‘Cause I don’t give a damn
Maybe you’re the perfect man
That’s not how this story goes

No, no…

Don’t push, push me so hard
Don’t push me so far…no… (2x)

And I’m not trying to be giving you a bitter pill, no I…
And I don’t wanna make you promises I can’t fulfill, no I…

Don’t push me, don’t push me, don’t push me, don’t push me down
Don’t cage me in…oh…
Don’t push me – I don’t wanna be tied down
Don’t push me so hard, yeah, don’t push me so far, no, no
Don’t cage me in, come on, don’t tie me down
June 10

炎热

 坐在图书馆里,被冷气吹着,还有那么一点点的凉。走出图书馆热浪便扑面而来,身上顿时冒出汗来。武汉的天气真是够呛的,一天要冲好及遍凉。没来武汉上学之前,我是没洗过凉水澡的,我们那里即使夏天再热,也是要用热水洗的。大一那会儿,拎着东西去澡堂,发现大门紧闭,门板上用粉笔字写着“下半年再来”。问过一圈人后,获知冲凉水是武汉的传统。之后也作模作样地冲起凉来,起初还不习惯,一冲就上火,慢慢地也就习惯了。现在我每天早上起床就先从头到脚冲个痛快,夏天就得这样。
  武汉的印象真的很少,来武汉两年了,也没去过多少地方。虽说武汉可能在中国省会城市前十名都谈不上,再我眼中却冲满生机。命运明明之中将我安排到了这里,也是机缘,又让我认识了这些人,去理会些道理,去思考些问题,有的我已经找到了答案,有的还没露端倪。我是在小地方生活了很多年的井底之蛙,武汉的马路拥挤且危险,楼房华丽让人向往,不一样的气息,不一样的文化,不一样的语言。墨守陈规,寻规导矩,却又对新事物充满向往之情,陌生的城市无疑对我充满了诱惑,可我又保持着以前的生活方式,融不进去周围的环境。以前遇到武汉的中学生,十几岁的模样,也让我回忆起我十几岁的光景,相比之下,就一种感觉“傻”。我们那帮子同龄人,大抵分两种:要么是混的,要么就是学的。中间也没过渡层。看到那些武汉初高中生,觉得他们好鲜活,不一样的成长环境造就的因素,说实话很是羡慕城市里长大的孩子。
  快要接近午夜了,燥热的空气丝毫没有减弱的架式。我坐在电脑前敲击着键盘,夜还在继续......
 

Matrixnull