易截截图软件、单文件、免安装、纯绿色、仅160KB

ruby和MinGW的一次融合

我们在使用C编程时会遇到一个问题,比如头文件的一个函数包含在一个lib中,但是
在实际连接中我们不知道它在哪个库中。也许可行的一种办法是直接上网查询某个
函数的依赖条件,这对于常用函数是没问题的!但是对于复杂而又缺少文档的第三方
lib来说,无异于大海捞针。
自此通过2种办法来尝试解决这个问题,我们先看第一种:
在Windows下使用批处理语言来查找指定的函数符号:
crt.bat:
@echo off
set gccpath=d:\downloadsvr\mingwstudio\mingw
dir %gccpath%\lib /b>files.txt
if not exist files md files
for /f %%i in (files.txt) DO (
    set fprefix=%%i
    %gccpath%\bin\nm.exe -s -D %gccpath%\lib\%%i>files\%%i.txt
    for %%a in (files\%%i.txt) do (
        if %%~za equ 0 del %%a
    )
)
del files.txt
@echo ######## Create Names Database Successed!!! #########
pause
;#################################################################
fnd.bat:
@echo off
dir files\ /b >tmp.txt
for /f %%i in (tmp.txt) DO (
    find /i /n "%1" files\%%i
)
del tmp.txt
以上有2个bat文件,crt.bat是生成对应lib文件夹中的所有lib的符号,分别放在若干个文本
文件中。只要lib不发生变动,那么只要生成一次即可!然后使用fnd.bat来查询某个符号。
that's all!!!
那么使用ruby能否完成这一功能呢?答案是肯定的:
class LibSyms
attr_accessor :libs

def save_syms(fname="cache_syms.dat")
data = Marshal.dump(@syms)
File.open(fname,"w+b") {|f|f.puts data}
end

def load_syms(fname="cache_syms.dat")
data=nil
File.open(fname,"r+b"){|f|data=f.read}
@syms=Marshal.load(data)
end

def enum_syms
@syms={}
@libs = []
`dir \"#{@path}\\lib\" /b`.lines {|line|@libs<<@path+"\\lib\\"+line.chomp}

@libs.each do |fname|
tmp=`\"#{@path}\\bin\\nm.exe\" -s -D \"#{fname}\"`.split("\n")
@syms[fname]=tmp
end
end

def initial


相关文档:

phpRPC + Ruby + Arduino = 远程控制

phpRPC + Ruby + Arduino = 遠程控制LED開關(?)
嗯,我知道這是個很無聊的Sample :P
關於phpRPC與Arduino請自行Google
觀看此demo之前請先安裝另外一篇所提到的serialport
與另外一個Gem
套件:phprpc
在這個ļ ......

菜鸟和RMXP和Ruby语言

      喜欢玩阿月系列RPG游戏的我,跟不少童鞋一样下了RPGMakerXP来瞻仰一下。当时觉得这个软件太方便了,用鼠标随便点点就能弄出来个有趣的小游戏。因为里面不仅自带不少地图和人物行走图等素材,容易上手的操作方式也让自己大有成就感……可是游戏毕竟是离不开编程,解开游戏包,看 ......

Install Cassandra with Ruby 1.9.1 on Windows

To get it done is not easy. I spent a whole day to figure out the various compatibility issues along the way out.
Now there still might be potential issues, but it works by my rough test.
Step 1: Install Apache Cassandra
  You may know that the Ruby gem cassandra will do it for you.
  ......

用ruby写的web抓取小工具

最近由于学习使用linux下的C开发,需要查询Linux C函数参考,就经常上http://man.chinaunix.net/develop/c&c++/linux_c/default.htm查看,描述得比较详细而且还有例子。
网上还有许多各种技术的网页格式的参考材料都非常强大,可惜很多时候都没有网。于是就想写个脚本可以把文档下载,像android开发者文档一样弄到本地 ......

Ruby watir 测试框架

转自 http://www.advidea.cn/biancheng/200943135232.html 
Ruby watir 测试框架
大多数人都会安装 ruby,
也通过Ruby 安装 gem,
也安装了ruby IDE开发工具:netbeans,
但就是不能跑watir环境,狂晕加吐中。。。
错误如下:
in `require': no such file to load -- watir (LoadError)
反正就是找不到watir,这里 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号