`
文章列表
见附件
除了nil和false,其他的对象值都是true if(null) ===> return false if(false) ===> return false if (0) ===> return true if("") ===> return true   还可以是直接用1.nil?来测试返回值

[转]Ruby Best practice

    博客分类:
  • Ruby
If you’ve worked with Ruby for at least a little while, you might already know that classes in Ruby are objects themselves, in particular, instances of Class. Before I get into the fun stuff, let’s quickly recap what that means. Here’s the ordinary way we define classes, as you all have seen. ...
A Windows DLL (i.e. a Native Java Library, such as chilkat.dll) may be loaded at runtime by calling System.loadLibrary( dllFilename ), or System.load( dllFilePath ). For example: try { System.loadLibrary("chilkat"); } catch (UnsatisfiedLinkError e) { System.err.pr ...
大家都知道JavaScript很强大,但也有很多的问题。 用好了,是Web前端开发的利器。用不好呢,那就是梦魇。 所以空下来的时候就在有没有替代品: 下面列出一些可选项 CoffeeScript 语法非常漂亮且支持类。我认为CoffeeScript并未结束,只不过是刚刚华丽地开启。 TypeScript 一种编译到JavaScript的语言,可以在JavaScript中构建并且添加了静态类型。个人而言,我是它的大粉丝。正如Mohamed Mansour 和Dave Hodder在评论中指出的那样,TypeScript正在进一步实施ECMAScript的一些建议,也 ...
今天在nodejs中装了grunt工具,但是在命令行运行·grunt·的时候总是报错。 http://stackoverflow.com/questions/12784042/multiple-issues-running-grunt-cmd-on-windows   后来看了npm_module里的定义才想到用`grunt.cmd`试一试。果然就可以用了。有点晕。  
Java自定义范型的应用技巧 发布时间: 2012-2-21 09:41    作者: yue7603835    来源: 51Testing软件测试网采编 字体:  小   中   大   | 上一篇 下一篇 | 打印   | 我要投稿   | 推荐标签: 软件开发 java   我们在JAVA 中处处都用到了范型,JAVA中的范型是从C++模板继承来的,不过JAVA的范型的功能远远没有C++那么强大。   我们知道在C++中模板可以很方便的代替任意类型的数据如下; template<class T> voi ...
线性表,链表,哈希表是常用的数据结构,在进行Java开发时,JDK已经为我们提供了一系列相应的类来实现基本的数据结构。这些类均在java.util包中。本文试图通过简单的描述,向读者阐述各个类的作用以及如何正确使用这些类。 Collection ├List │├LinkedList │├ArrayList │└Vector │ └Stack └Set Map ├Hashtable ├HashMap └WeakHashMap Collection接口   Collection是最基本的集合接口,一个Collection代表一组Object,即Collection的元素( ...

Mockito入门

    博客分类:
  • Java
  简介   InfoQ-使用Mockito 1.5监视普通对象 写道 Mockito是一个针对Java的mocking框架。它与EasyMock和jMock很相似,但是通过在执行后校验什么已经被调用,它消除了对期望行为(expectations)的需要。其它的mocking库需要你在执行前记录期望行为(expectations),而这导致了丑陋的初始化代码。    更多信息请参考如下位置,  原文链接:http://www.infoq.com/cn/news/2008/09/mockito-1.5  官方网站:http://code.google.com/p/mockito/ ...
  vim 常用插件 WinManager 文件管理器 2007-08-26 00:22 在VIM中你是不是常常觉得VIM在编缉文件方面不太方便啊比如文件打开,切换等,你可以试试这个插件安装完后,运行:WMToggle,就可以调出winmanager,使用Ctrl-WW,可以转换窗口, ...
http://www.tutorialspoint.com/ruby/ruby_environment_variables.htm    How to use Ruby to access Envrionment variables?
#print some environment variables puts ENV["PATH"] puts ENV["EDITOR"]  
Environment variables are variables passed to programs by the command line or the graphical shell. Though there are a number of environment variables that only affect the command line or graphical shell itself (such as PATH or HOME), there are also several that directly affect how Ruby scr ...
Man, I’m such an impatient guy. I cringe whenever I see somebody squint and frown, looking for a JSP file in Eclipse by browsing painfully through the gazillion JSPs in multiple folders in the Package Explorer. I squirm whenever I see somebody looking for a Java class by clicking through packages ...
  from subprocess import call call(["ls", "-l"])
Global site tag (gtag.js) - Google Analytics