a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
| t = {} | |
| meta = {__index = | |
| function(_, idx) | |
| return function(...) | |
| -- ... will be table type "arg" | |
| print(idx, arg[1]) | |
| end | |
| end} | |
| setmetatable(t, meta) |
| IEnumerable<string> strings = new List<string>(); | |
| if (strings is IEnumerable<object>) | |
| Console.WriteLine("True"); | |
| else | |
| Console.WriteLine("False"); | |
| /// why this is False?? | |
| if (strings is IList<object>) | |
| Console.WriteLine("True"); |
| #!/bin/bash | |
| PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin | |
| export PATH | |
| clear | |
| CUR_DIR=$(pwd) | |
| if [ $(id -u) != "0" ]; then | |
| printf "Error: You must be root to run this script!" | |
| exit 1 |
| #!/usr/bin/env lua | |
| -- | |
| -- lua2c.lua: Embedder of Lua scripts into C programs. | |
| -- | |
| -- Copyright (C)2010 Valeriu PaloÅŸ. All rights reserved! | |
| -- | |
| -- This program is an adapted version of the bin2c.lua script written | |
| -- by Mark Edgar. It is licensed the same as Lua, i.e. MIT license. A | |
| -- worthy mention to Leg (http://leg.luaforge.net) which provided the | |
| -- better heredoc string parsing grammar. |
| 1) 是否有语法错误,编译错误,编译警告。 | |
| 做法:下载最新代码,将编译警告级别提升到最高,检查output信息。 | |
| 2)是否符合需求,完成requirement文档要求的内容,不能多,也不能少。 | |
| 注意:即使发现有问题代码,如果与需求关联不大,不要涉及。 | |
| 应该让每次enhancement和bug fix最简洁,牵涉范围最小,影响到组件最少。 | |
| 3)是否符合编码规范: | |
| a) 注意等号前后,操作符前后的空格和tab,行尾不要有多余空白字符 |
| 目前网上有不少的实现QQ机器人的方法,都不太稳定甚至都已经失效了,而且我们还要冒着QQ号被盗用的风险。其实我们可以自己实现一个QQ自动应答的机器人,思路非常简单:通过模拟登录3G版QQ,来实现相关的操作: | |
| 一、首先我们得看看3GQQ的相关协议 | |
| 为此,我们需要一个支持WAP的浏览器,可以使用Firefox的wmlbrowser插件,打开FF后,访问地址:https://addons.mozilla.org/zh-CN/firefox/search/?q=wmlbrowser&cat=all&x=17&y=11 | |
| 二、进入3GQQ的进行协议分析 | |
| 3GQQ的地址是:http://pt.3g.qq.com/s?aid=nLogin3gqq 用安装了wmlbrowser插件的FF打开页面后,启用firebug,即可监视提交的数据。 | |
| 三、源代码 |
| local print = print | |
| function permgen (a, n) | |
| print ("-- permgen begin, n: " .. n) | |
| if n == 0 then | |
| printResult(a) | |
| else | |
| for i=1,n do | |
| [Serializable] | |
| private class SimpleMonitor : IDisposable | |
| { | |
| private int _busyCount; | |
| public bool Busy | |
| { | |
| get | |
| { | |
| return this._busyCount > 0; | |
| } |
| public static class CodeTimer | |
| { | |
| public static void Initialize() | |
| { | |
| Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High; | |
| Thread.CurrentThread.Priority = ThreadPriority.Highest; | |
| Time("", 1, () => { }); | |
| } | |
| public static void Time(string name, int iteration, Action action) |
a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!