An example of extension method & generic method in c#

Posted on Thu 14 August 2014 in miscLeave a comment

Extension methods are defined as static methods but are called by using instance method syntax. Their first parameter specifies which type the method operates on, and the parameter is preceded by the this modifier. Extension methods are only in scope when you explicitly import the namespace into your source code ...

Continue reading

How to install ROR on ubuntu

Posted on Mon 11 August 2014 in miscLeave a comment

  • sudo apt-get install build-essential
  • - This command is to install essential tools for building codes
  • sudo apt-get install ruby 
  • - This command is to install ruby
  • sudo apt-get install ruby-dev 
  • - This command is to install ruby dev, which can solve "`ERROR: Failed to build gem native extension"`
  • `sudo apt-get install rdoc`
  • - `This ...
Continue reading

Privacy policy for our products

Posted on Sun 12 May 2013 in miscLeave a comment

Our products will not use your any information for any purpose! Please feel free to use our products.\ Thanks.

Continue reading

Html Agility Pack使用实例

Posted on Wed 03 April 2013 in miscLeave a comment

Html Agility Pack是C#语言下一个非常实用的html解析库(官方网址:http://htmlagilitypack.codeplex.com/)。以下Html Agility Pack的使用实例:

Continue reading

打包python运行环境

Posted on Sun 31 March 2013 in miscLeave a comment

1.准备以下文件:\       python.exe(python安装目录下)\       python27.dll(python安装目录下或System32目录下)\       DLLs目录(python安装目录下)\       libs目录(python安装目录下)\       Lib.zip(python安装目录下的Lib目录,将其打包为zip文件,可以减少文件数目)\       main.py(需要运行的文件)\ 2.创建run.bat文件\ ---------------------------------------------------------------------\      set PYTHONPATH=".;.\Lib.zip;.\DLLs;.\libs"\      .\python.exe main.py %*\ ---------------------------------------------------------------------\ 3.使用run.bat就可以直接运行main.py文件,并可以传递参数。

Continue reading

Windows Server 2012 远程桌面无声音

Posted on Sat 16 March 2013 in miscLeave a comment

解决方法:\ 1.查看远程桌面连接本地客户端中“Options(选项) => Local Resource(本地资源) => Remote audio(远程音频) => Play on this computer(在当前电脑播放)"是否被选中。\ 2.查看windows server 2012是否开启windows audio service. 可以直接在搜索框中搜索service,打开service管理界面并找到windows audio服务,确认服务是否开启。

Continue reading

茶叶现象

Posted on Thu 14 March 2013 in miscLeave a comment

        公司有提供茶叶让员工来泡茶。茶叶存放在一个玻璃罐子中,每天会有阿姨负责将罐子填满。有一天下午我去泡茶,罐子几乎见底,这时突然想到,如果茶叶每天都会剩下,而且阿姨只是把新鲜的茶叶放到上面,那么接近罐子底部的茶叶可能就永远得不到更新。也就是说像我这种来的晚的人,只能喝不新鲜茶叶泡的茶。That's too bad! 
         也许阿姨每天都将剩余的茶叶倒掉了;也许阿姨会把前一天剩下的放到最上面来。
Continue reading

老外用图片总结的程序员生活

Posted on Tue 12 March 2013 in miscLeave a comment

链接地址:\ http://martinvalasek.com/blog/pictures-from-a-developers-life

Continue reading

矩阵转置问题

Posted on Wed 13 July 2011 in miscLeave a comment

如果可以使用额外空间,编程实现矩阵转置是十分简单的,这里就不再做过多的讨论。如何在不使用额外空间的条件下转置矩阵呢?下面会分两种情况来进行讨论。\ 1.方阵的转置\ 方阵是N*N的矩阵,通过交换m[i][j]与m[j][i]的值,就可以实现方阵的转置。\ 2.非方阵的转置\ 假设有N*M的矩阵,其中N!=M,怎么来实现in-place的transposition呢?\ 考虑有如下的矩阵\ |1,2|\ |3,4|\ |5,6|\ 该矩阵在内存中是按[1,2,3,4,5,6]的顺序存放。\ 转置之后则有\ |1,3,5|\ |2,4,6|\ 该矩阵在内存中是按[1 ...

Continue reading

购入一kindle 3

Posted on Fri 18 February 2011 in miscLeave a comment

兔年考虑购入一台电纸书,经过一段时间的比较,最终选择了kindle 3(觉得其性价比很高,相比国内产品价格也不存在劣势)。在淘宝上找的商家,去现场提的货,就在鼎好二期地下一层。\ btw:那个商家的销售小姐很漂亮。\ kindle
3\

货拿到手后,迫不及待地开始使用。kindle十分轻薄,e-ink屏幕很有纸张的感觉,看起来十分舒服。略感遗憾的是kindle3的屏幕较小,影响pdf的阅读。中文在kindle原生的系统上经常出现“口”,十分影响阅读。为了让kindle更好地支持中文,安装了“多看”系统。“多看”系统不仅可以更好地支持中文,还提供了许多实用的功能,并且与原生系统互不影响。以后有时间研究下“多看”系统,看其是如何对kindle进行破解的。上周Amazon出了kindle ...

Continue reading