谦卑的程序员

静水流深

GOF的《设计模式》一书本身虽然经典,但并不易于学习。因此市场上也陆续推出了在此基础上针对特定的编程语言,对设计模式进行详解的书籍。在此类书籍中O’Reilly的《Head First设计模式》可以说是独树一帜。

该系列以我偏好的讲故事的方式进行编写,图文并茂,结构编排有序,行文生动流畅,在阅读的过程中能形成良好的互动,避免了初学者被枯燥的概念所累而打退堂鼓。 代码部分虽然以Java表述,但对于有C++和C#基础的读者来说不成问题。结合具体的案例,在讲述模式的过程中还穿插了对OO设计原则的讲解,非常适合自学者入门。

drupal core already provided Upload module to allow users to upload and attach files to content, but Attachment + Filemanager do a better Job.

Attachment module is an alternative to Drupal’s included upload module. Filemanager module provides file management API for attachment module to use. Attachment module uses the filemanager module to allow a unique namespace per node and support large number of files. In addition this module allows you to give each attachment a title and description.

Installation steps:

1. Upload Filemanager and Attachment module, enable them and disable upload module. 2. Go to /admin/settings/filemanager , specify Public/Private file system path, and create folder on the server. 3. Go to /admin/settings/attachment , config attachment module, I didn’t check the ‘Private files’ option, I prefer to stay public. 4. Go to /admin/content/types/[type] to enable attachments. 5. Go to /admin/user/access , give ‘add attachments’ permission to a role you prefer. 6. Create a node, you will see the attachments section, done.

known issue is the module can’t be compatible with double byte character like Chinese. It will lose the file name after uploaded the file.

继承是OO中最让人见猎心喜的一个元素。当我们初步掌握之后,会很轻易地使用其来归并同类项,创建Super Class,减少代码的重复。(是否真的如此,取决于你对重复的定义。) 比如本书中提到的模拟玩具鸭的例子。创建一个名为Duck的Super Class,包含了quack、swim、fly等方法,继承该Super Class的Sub Class可以轻松地继承这些方法,而不需要再一次地在Sub Class中去编码实现。这是一种形式上的减少重复。 当然我们很快会发现鸭子的叫声也许各不相同,有的鸭子会飞,有的则不会。因此在继承了Super Class后,各个Sub Class可能还需要用到重载、覆盖、隐藏等继承元素。 问题出现了。每当规格改变,出现新的玩具鸭品种,继承了Super Class之后,我们都必须要重新检查Sub Class的quack、swim、fly等各个方法,以确定是否要将其重载、覆盖还是隐藏。而如果Super Class中的各个方法的实现有所变化…。OO的继承多态在实际的应用中,是我们需要努力避免的。

现在我们开始意识到继承可能不是答案。在找到新的解决方案之前,先列出继承可能导致的 缺点 : A 代码在多个Sub Class中重复 (当代码编译时,继承的代码确实重复创建于Sub Class的内存空间,所谓的减少重复只是减少了编码人员手工输入的重复) B 运行时的行为不容易改变 (因为行为的代码在编译时已经生成,而非在运行时动态加载) C 很难知道所有鸭子的全部行为 D 改变会牵一发动全身,造成其他鸭子不想要的改变

(more…)

After you published your website, Submit your website to search engine is a good idea to help your visitor find you. Firstly, of course my favorite Google.

Through this url , you can submit the URL of your website to Google search engine, and then the GoogleBot will index the entire website. But that’s not enough, Through Webmaster Tools , you can submit a XML Sitemap of your website and use tools to increase your site’s visibility on Google. Why? Read <What is a Sitemap file and why should I have one>

How? Manually create a sitemap file for a dynamic cms system like drupal is impossible, a mature cms always has its solution: XML Sitemap module (replaced the old Google Sitemap from Drupal 5), can automatically create a site map which support Google, Yahoo, Windows Live, Ask engines.

After installed and enabled this module, fill the location of the Sitemap file in Webmaster Tools like http://{hostname}/ sitemap.xml , Done.

Want to track visitors and traffic of your website? Try Google Analytics , It’s free, and it can do more .

Steps: 1. Use your google account to login to Analytics 2. Click on Add Website Profile, A form displays 3. Select Add a Profile for a New Domain 4. Enter the URL of your site 5. Select your country and time zone. Click Finish 6. Analytics provides you two code blocks (the old one urchin.js and the new one ga.js ) – to add to your site’s pages. 7. Copy the code block ( ga.js ) to every page you want to add Analytics as below: <body> (Google Analytics Code Block is going to go here!!!) </body>

Copy and paste the code block one by one? Don’t tell me you website doesn’t have a template. Today more and more people use content management system like Drupal , Joomla , Wordpress to publish their website and blog, some Web Hosts even provide 1-click installation, and you also can find one by youself at Open Source CMS . Once you walk on this way, things become quite easy. Basically, there will be a module/plugin which can be easily configurated. For example, i am using Durpal and this site are built by Drupal, all i need to do is go to the website, find the Google Analytics module, install it, configuration, fill a Goolge Analytics account number(in the code block, UA-xxxx-x), finish. and then DONE.

Google Analytics need 24 hours to gether data, after one day, you can read the report.

Recently i am finding a UML modeling tool, actually a replacement of Rational Rose. In China, we can easily get commercial softwares freely, but it doesn’t mean i have to use it. And we should know it’s not the only choice in the world. Rational Rose is cool, especially when you wrote on your resume “experiences of Rational Rose”. But it’s not free, and it’s big. What if i just want to draw a class diagram, i guess it’s most of people use Rational Rose to do. Why don’t us choose a smaller one and get things done? Because the employer won’t hire a person don’t USE Rational Rose? You CREATE the UML Diagrams or just USE Rational Rose? And, You Design or just Create Diagrams ? You Develop or just Design ? This kind of stupid things happened repeatedly. finally i get tired of it. If there is a rule specified a tool, you abide by the rule. if no, just choose the most suitable one to GET THINGS DONE .

It’s not only about your choice of tools, it also show how you do your job, in a way it does work or in a way it looks good.

As a relatively early computer user, I start my adventure from MS-DOS. About DOS, there is a kind of feeling mixed with love and hate, I love the command line, but remember the Config.sys and Autoexec.bat? remember the Emm386.exe? remember ‘DOS = High, Umb’? remember everything we did for one more kb additional memory to run a … Turbo C compiler? OK, that’s not true, I seldom run it now, that was what I usually do when I was in university. Currently I only use DOS to run the old games only support DOS. You may say i am going farther from the programming things. But the command line, the config files (and Quick Basic) could be the beginning of a programmer.

How about you? Still have a old DOS installation on your disk? Or, have a virtual machine of DOS? As a programmer, you did better. But may I ask a question? Do you still have a floppy driver and How can you find the damn installation floppy? You use image files and floppy simulator? Yes you do it better and better. If you want to go through this way, you can get FreeDOS , a open source, free DOS-compatible operating system for IBM-PC compatible systems. You can install in on you hard disk, or use a PC emulator (Virtual Machine software) to install FreeDOS. You can find PC emulators for all computer platforms (Windows, Linux, Mac.) You can even run FreeDOS using a PC emulator written in Java : JPC , right in your web browser! Cool, we will talk about it later.

Now let’s get back to the point. Don’t you think it’s troublesome? Try DOSBox , It support Windows, Linux, Mac. You can easily install it as a programe on you desktop, get a command line window after ran it, and then run the game in the window, don’t need to care about the memory things any more. You can get a portable release at PortableApps.com .

I even have DOSBox installed on my PSP Slim (PSP 2000), It means I can play old DOS game on my PSP. Someone even installed the Win 3 and Win9x on the DOSBox hosted at PSP Slim. I guess I used too many EVEN. Do some search work you can find the informations.

Recently i am finding a suitable UML modeling tool, a replacement of Rational Rose. The final result is ArgoUML . ArgoUML is open source, includes support for all standard UML 1.4 diagrams. It runs on any Java platform and is available in ten languages . It means ArgoUML is portable (need JDK installed ) and cross platform . recently Portable became a more and more important requirement for me to choose a software.

Here are other candidates: Dia : an Open source, ‘Visio’ like, gtk+ based diagram creation program for Linux, Unix and Windows . It can be used to draw many different kinds of diagrams, not only the UML diagrams. StarUML : an open source, UML/MDA modeling tool running on Win32 platform .

Some commercial providers also release free, community edtion. Such as MagicDral UML .

Search for:

订阅 FeedBurner订阅

FeedBurner订阅

目录 1.程序那点事 (24) 1.2 Web开发 (16) Wordpress (mu) (7) 1.9 操作系统 (8) 2.超越技术? (2) 需求分析 (1) 3.管理之道 (1) 个人管理 (1) 4.Eric谈软件 (3) B.藏经阁 (1) T.兵器谱 (5) 未分类 (6)

1.程序那点事 (24) 1.2 Web开发 (16) Wordpress (mu) (7) 1.9 操作系统 (8)

1.2 Web开发 (16) Wordpress (mu) (7)

Wordpress (mu) (7)

1.9 操作系统 (8)

2.超越技术? (2) 需求分析 (1)

需求分析 (1)

3.管理之道 (1) 个人管理 (1)

个人管理 (1)

4.Eric谈软件 (3)

B.藏经阁 (1)

T.兵器谱 (5)

未分类 (6)

日历 June 2008 M T W T F S S « May Jul » 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

« May

Jul »

最近更新 怎样在Visual Studio 2005中调试WSH脚本 程序员笑话之磨叽 ASP.Net的Web服务器控件、Html服务器控件和Html控件 Wordpress MU插件概述 为WPMU更换主题模板

怎样在Visual Studio 2005中调试WSH脚本

程序员笑话之磨叽

ASP.Net的Web服务器控件、Html服务器控件和Html控件

Wordpress MU插件概述

为WPMU更换主题模板

最近评论 花心虫子 » Blog Archive » WordPress MU插件资料大全 on Wordpress mu的reCAPTCHA插件 花心虫子 » Blog Archive » WordPress MU插件资料大全 on Wordpress mu的Google Sitemap插件 WordPress MU插件资源飞龙收集 | 蜕变 on Wordpress mu的reCAPTCHA插件 WordPress MU插件资源飞龙收集 | 蜕变 on Wordpress mu的Google Sitemap插件 申佳明 on Wordpress mu的Google Analytics插件

花心虫子 » Blog Archive » WordPress MU插件资料大全 on Wordpress mu的reCAPTCHA插件

花心虫子 » Blog Archive » WordPress MU插件资料大全 on Wordpress mu的Google Sitemap插件

WordPress MU插件资源飞龙收集 | 蜕变 on Wordpress mu的reCAPTCHA插件

WordPress MU插件资源飞龙收集 | 蜕变 on Wordpress mu的Google Sitemap插件

申佳明 on Wordpress mu的Google Analytics插件

标签 Anti-spam Bart PE bot Bug captcha CodeSmith DOS drupal Fedora Freemind Google Analytics Gtalk IMified Linux Mind Map Portable PortableApps reCAPTCHA SA SEO sitemap Sudo Ubuntu VMWare Windows WinPE Win PE Wordpress (mu) XMind 个人管理 书评 工具 开源 思维导图 插件 时间管理 案例 用例 用户故事 盗版 管理 网络 虚拟化 软件 需求分析

存档 August 2009 (2) June 2009 (2) May 2009 (3) April 2009 (1) March 2009 (2) February 2009 (4) January 2009 (1) December 2008 (7) November 2008 (5) September 2008 (1) August 2008 (1) July 2008 (3) June 2008 (8) May 2008 (2)

August 2009 (2)

June 2009 (2)

May 2009 (3)

April 2009 (1)

March 2009 (2)

February 2009 (4)

January 2009 (1)

December 2008 (7)

November 2008 (5)

September 2008 (1)

August 2008 (1)

July 2008 (3)

June 2008 (8)

May 2008 (2)

WPMU Theme pack by WPMU-DEV .