随笔- 41  文章- 0  评论- 61 
2007年11月3日
最近开始玩linux,社区对Ubuntu的评价很高,就下载了最新的7.10装在我的本本上,用了两天发现的确不错,可是要在桌面系统打败微软还得多多努力呀。  今天我碰到一个问题就是默认播放器无法播放rmvb文件,大虾们都推荐mplayer,下载,安装,然后又下载了win32 codec,并且放到/usr/lib/win32目录下,结果运行mplayer还是报错说“Error opening/initializing the selected video_out device”,如果你在ternimal里运行mplayer,发现如下的错误信息,

Error: libstdc++.so.5: cannot open shared object file: No such file or directory
Win32 LoadLibrary failed to load: drvc.so, /usr/lib/codecs/drvc.so, /usr/lib/win32/drvc.so, /usr/local/lib/win32/drvc.so
Error loading dll
ERROR: Could not open required DirectShow codec drvc.so.


那么试试看到软件包管理器里安装libstdc++5,应该可以解决这个问题。





posted @ 2007-11-03 16:44 CrazyCoder 阅读(1471) | 评论 (0)编辑
2007年10月17日

现在手上的项目中使用了ClickOnce技术来部署客户端,客户端有时需要从服务器传一些参数,对于ClickOnce部署的程序来说我们可以在launch的URL中使用query strings来达到这一目的。参照MSDN上的文章,很快就写完了代码。好了,试试看。部署,从服务器launch客户端,似乎一切正常,所有参数的值都顺利得到了。

可还没等Check-in代码,一个测试就失败了。Debug了半天才发现原来是一个参数值中又加号:+。在使用HttpUtility.ParseQueryString分析query string后参数值中的加号变成了空格,以前似乎没遇到过这样的现象。Google了一下才知道原来加号在query string是保留用来代表空格的,要在query string中传这些保留字符必须对query string进行编码。

修改了服务端的代码,想当然的在客户端加了decode的方法,没想到结果还是不对。查了MSDN关于HttpUtility.ParseQueryString方法的帮助才知道原来这个方法内置会对query string进行解码(decode)并返回包含结果的NameValueCollection。

忙了半天最后终于搞定了。

 

总结一下:

1)安全起见query string一定要encode

2)HttpUtility.ParseQueryString会自动做decode,不要画蛇添足。

 

happy coding!

~ Crazy

posted @ 2007-10-17 23:26 CrazyCoder 阅读(295) | 评论 (0)编辑
2007年9月18日

从谷歌黑板报看到的,试了一下,功能和PowerPoint没法比,目前还很简陋。比较适合在线演示使用。

截图

1、编辑presentation

image

2、演示在新窗口进行

image

F11可以切换为全屏,同时还可以和听众聊天。Cool

posted @ 2007-09-18 21:45 CrazyCoder 阅读(219) | 评论 (1)编辑
2007年8月21日

到下面这个网站测测看,仅供娱乐哈。 Open-mouthed

What’s your Programmer Personality Type?

 

一共十二道选择题,很快就可以搞定。

IMG_2531

我的测试结果

Your programmer personality type is:
DLTC

You're a Doer.
You are very quick at getting tasks done. You believe the outcome is the most important part of a task and the faster you can reach that outcome the better. After all, time is money.
You like coding at a Low level.
You're from the old school of programming and believe that you should have an intimate relationship with the computer. You don't mind juggling registers around and spending hours getting a 5% performance increase in an algorithm.
You work best in a Team.
A good group is better than the sum of it's parts. The only thing better than a genius programmer is a cohesive group of genius programmers.
You are a Conservative programmer.
The less code you write, the less chance there is of it containing a bug. You write short and to the point code that gets the job done efficiently.

posted @ 2007-08-21 23:18 CrazyCoder 阅读(241) | 评论 (2)编辑

当你在这个行业做了几年,有了一些积累以后,你也许会希望寻求新的发展空间,来到一个新的公司(或者同一个公司的不同部门)。你迫切希望向新的同事们展现你的知识、经验以及领导能力,但却向下面这个例子中的家伙一样处处碰壁,为什么?让我们先看看这个New Guy先生的心声吧。

I recently took a new software development job, and I've been experiencing a lot of ill will from coworkers and peers. It's really been killing my job satisfaction.

To explain, I was recently brought in to help a software team get a product out the door, with a mandate of helping with some web app code. I've been trying my best to integrate with the team, trying to earn some credibility and respect by making myself useful.

I've been forwarding various Joel On Software essays to All, recommending that the office stock up on Code Complete, Peopleware, and the Mythical Man Month, and I make an effort to point out everything I believe could be done better. I regularly browse through the source repository to find ways that other members could be working better.

When other developers ask for my help, I try to maximize my input by broadening my assistance to cover the way they're developing, how they could improve their typing form, what naming standard they use, to advocate a better code editing tool, and to give my educated final word regarding the whole stored procedure/dynamic SQL debate.

Despite all of this, I keep facing resistance, and I don't think the team likes me very much. Many of my suggestions aren't adopted, and several people have replied with what I suspect is thinly veiled sarcasm.

What's going wrong?

Are these developers just afraid of change? Are they so stuck in their ways? Do they simply LIKE doing things the wrong way?

Yours truly,
The New Guy

上面这个故事摘自yafla的这篇blog

 IMG_3107

很明显,这个New Guy陷入了一种很尴尬的境地,如何改善,如何建立自己在团队中的领导力?yafla给出了这样一些建议:

  • 要谦虚
  • 要注意工作方式
  • 做出成绩
  • 不要过于迷信自己的经验

其实都是很简单的道理,但是当一个人有了能力和自信之后能否依然坚持这些细节,决定了一个人是否具有真正的领导能力。这些建议中,做出成绩,也就是以身作则可能是最重要的建议。往往有领导能力的人并不一定需要很好的口才,但是绝对需要有真材实料,做出过很好的成绩,并且始终能够身体力行,言行一致,这样的人的领导能力就像一个强磁场,自然的发散出来,吸引和影响着身边的很多人。

posted @ 2007-08-21 23:06 CrazyCoder 阅读(159) | 评论 (0)编辑

一直以来ROR在国外不断开花结果,在国内却始终有些曲高和寡,除了JavaEye,我很少听到国内ROR的成功故事。几天在InfoQ中文站点上看到一则Jeff Xiong发布的一片新闻,介绍了几个国内正在使用ROR提供服务的团队以及产品,看了看,觉得很有意思。特别是1sters的几个产品很有新意。虽然不是多么了不起的创意,但是他们毕竟已经行驶在自己选择的道路上了。

我想所谓敏捷的精神,很重要的意见就是想到一定程度之后就要开始实施,然后不断得到反馈,不断思考,不断改进,知道达到一个比较理想的状态。这样的最大好处就是能够使团队最大限度的保持激情,我们都知道有激情的团队是最有效率和创造力的,这也许是敏捷方法和ROR得到越来越多认可的原因之一吧。

小团队+高效开发工具和框架+敏捷方法+定制服务,这将是未来软件开发队伍中一只无法被忽视的力量。

posted @ 2007-08-21 01:06 CrazyCoder 阅读(261) | 评论 (1)编辑
2007年8月9日
记得一直对这个问题没有一个很清晰的答案,今天看到Martin Fowler的一段文字,觉得很有道理,记录一下。

Inversion of Control is a key part of what makes a framework different to a library. A library is essentially a set of functions that you can call, these days usually organized into classes. Each call does some work and returns control to the client.

A framework embodies some abstract design, with more behavior built in. In order to use it you need to insert your behavior into various places in the framework either by subclassing or by plugging in your own classes. The framework's code then calls your code at these points.

摘自:http://martinfowler.com/bliki/InversionOfControl.html



posted @ 2007-08-09 23:46 CrazyCoder 阅读(194) | 评论 (0)编辑
2007年4月26日
source: http://st-www.cs.uiuc.edu/users/smarch/st-docs/mvc.html

Basic Concepts:
In the MVC paradigm the user input, the modeling of the external world, and the visual feedback to the user are explicitly separated and handled by three types of object, each specialized for its task. The view manages the graphical and/or textual output to the portion of the bitmapped display that is allocated to its application. The controller interprets the mouse and keyboard inputs from the user, commanding the model and/or the view to change as appropriate. Finally, the model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).


Powered by ScribeFire.

posted @ 2007-04-26 10:07 CrazyCoder 阅读(137) | 评论 (0)编辑
2007年4月17日

Handling popup window in testing browser based applications is always an annoying problem. Watir provides a good solution for this, here is what I learned from the Watir mail list and share it here to everyone else.


You will need newest Watir (build late than 1.5.1.1079) to do it.

Here is the ruby scripts to handle popup windows:  

#includes
require 'watir'   # the controller
require 'watir\contrib\enabled_popup'
include Watir

#test::unit includes
require 'test/unit'

class TC_dimensionnet_login < Test::Unit::TestCase

  def test_window_popup
 
    testSite = "http://localhost/test.htm"
   
    $ie = Watir::IE.new
   
    $ie.goto(testSite)
   
    $ie.button(:id,"btnPopup").click
    startClicker("OK", 5)
  end
 
  # function click buttons on a popup window
  def startClicker( button , waitTime=9, user_input=nil )

     hwnd = $ie.enabled_popup(waitTime)  # get a handle if one exists
    
     if (hwnd)  # yes there is a popup
     puts hwnd
       w = WinClicker.new

       if ( user_input )
         w.setTextValueForFileNameField( hwnd, "#{user_input}" )
       end

       sleep 3  # I put this in to see the text being input it is not necessary to work
       w.clickWindowsButton_hwnd( hwnd, "#{button}" )  # "OK" or whatever the name on the button is
       w=nil    # this is just cleanup

     end

   end
  
end



Powered by ScribeFire.

posted @ 2007-04-17 18:44 CrazyCoder 阅读(759) | 评论 (2)编辑
2007年4月2日
我最喜欢读的blog之一,这一篇虽然不是原创,但是值得每一个喜欢做软件的人一读。


Coding Horror: Top 6 List of Programming Top 10 Lists

Powered by ScribeFire.

posted @ 2007-04-02 22:57 CrazyCoder 阅读(176) | 评论 (0)编辑