2008年10月17日星期五

在EmEditor录制了两个宏

最近搞试卷库,程序设计的,很多题目的选项,分号,引号等都不对,于是在EmEditor中进行替换

1. 程序分析和填空

document.selection.Replace(")",")",eeFindNext | eeReplaceAll);
document.selection.Replace("(","(",eeFindNext | eeReplaceAll);
document.selection.Replace("’","\x27",eeFindNext | eeReplaceAll);
document.selection.Replace("‘","\x27",eeFindNext | eeReplaceAll);
document.selection.Replace("”","\x22",eeFindNext | eeReplaceAll);
document.selection.Replace("“","\x22",eeFindNext | eeReplaceAll);
document.selection.Replace(",",",",eeFindNext | eeReplaceAll);
document.selection.Replace(";",";",eeFindNext | eeReplaceAll);
document.selection.Replace("_{2,}","____________________________",eeFindNext | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace("\\s{2,}"," ",eeFindNext | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace("\\t+"," ",eeFindNext | eeReplaceAll | eeFindReplaceRegExp);

2. 选择

document.selection.Replace("_{2,}","(  )",eeFindNext | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace("_{2,}","(  )",eeFindNext | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace(")",")",eeFindNext | eeReplaceAll);
document.selection.Replace("(","(",eeFindNext | eeReplaceAll);
document.selection.Replace("’","\x27",eeFindNext | eeReplaceAll);
document.selection.Replace("‘","\x27",eeFindNext | eeReplaceAll);
document.selection.Replace("”","\x22",eeFindNext | eeReplaceAll);
document.selection.Replace("“","\x22",eeFindNext | eeReplaceAll);
document.selection.Replace(",",",",eeFindNext | eeReplaceAll);
document.selection.Replace(";",";",eeFindNext | eeReplaceAll);
document.selection.Replace("([A-D])、","\\1. ",eeFindNext | eeFindReplaceCase | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace("([A-D])\\)","\\1.",eeFindNext | eeFindReplaceCase | eeReplaceAll | eeFindReplaceRegExp);

2008年10月10日星期五

锐捷S2026G交换机常用配置命令

Enable 进入特权模式

conf t 进入配置模式

vlan n  配置一个VLAN

int fa0/n 配置快速以太网端口n

int range fa0/n-m 配置一批快速以太网端口

sw mode trunk 将interface配置为trunk,这个和S1926里边的Tag Vlan不太一样,设置为trunk的默认是所有的VLAN的数据都可以通过,不像1926需要逐个设置

sw access vlan n 将一个端口划分到制定VLAN

write 将配置写入交换机的Flash Memory

2008年10月4日星期六

Eclipse下C/C++开发环境CDT的安装配置

1、从http://www.mingw.org/下载并安装MinGW,假设安装在D:\MinGW;安装完成之后将bin子目录中的mingw32-make.exe复制一份在同一目录,更名为make.exe,并从主页再下载gdb调试程序也放在bin目录下。

2、设置系统PATH环境变量,将D:\MinGW\bin加入到其中,其他环境变量不需要做设置。

3、从http://www.eclipse.org/cdt/下载CDT,并添加到Eclipse中。

4、启动Eclipse,新建C/C++工程,会根据环境变量自动设别出LIB和INCLUDE的位置。在工程中添加一个C源文件,输入代码并保存。

5、在编译之前,在工程上点击鼠标右键,选择Build Configurations,在Build下为其添加要编译的目标版本是Release还是Debug版本,或者全选。

6、编译工程,如果没有错误,会生成可执行的二进制文件。

鼠标点击Project,然后在Project->Build Project
最后找到exe文件,右键点击exe文件->Run As->Run Local C/C++ Application

7、也可以和Java一样,为C程序添加断点,用Debug功能进行调试。

参考文章:

How to setup the MinGW gcc tools for your Managed Make C Project in CDT 3.1 and Eclipse 3.2
HOW TO: Use CDT and MinGW for Eclipse (i.e. develop C/C++ applications in windows)
http://hi.baidu.com/billyboy/blog/item/e989b2a1eb231b8a471064d8.html
http://blog.csdn.net/goodfunman/archive/2005/08/31/468319.aspx

 

Technorati 标签: ,,

Eclipse下的反编译方案

方案一:JAD

http://www.kpdus.com/jad.html下载JAD,将可执行文件解压缩到Windows目录下(也可以是环境变量PATH所指定搜索路径的任意目录下);从http://jadclipse.sourceforge.net下载net.sf.jadclipse_3.3.0.jar,解压缩到Eclipse安装目录下的对应位置。

方案二:JD-GUI

http://java.decompiler.free.fr/下载jd-gui-0.2.5.windows.zip,将可执行文件解压缩到Windows目录下;感谢CCF论坛的Hanzac会员对上面的jadclipse插件做了修改,使它能和JD-GUI配合使用,下载地址:http://www.newdisk.cn/mypane.aspx?down=ok&filepath=hanzac/net.sf.hnindev.jdadaptor_3.3.1.jar。将其解压缩到Eclipse安装目录下的对应位置。

注意:上述两套方案中的Eclipse插件只能安装一个。

安装完成之后做如下配置:

选择菜单项 Window | Preferences .... ,定位到如下图所示位置,在文件类型中选择*.class

000

按下方的Add...按钮,打开对话框,选择JadClipse Class File Viewer,并按OK确认。

001

在对话框中按“default”按钮将刚才选择的Viewer设置为Class文件的默认查看程序。

004

从项目中选择一个Class双击,可看到其源代码。

005

【推荐】优秀的Java反编译软件 - JD-GUI

只有一个小小的EXE,运行后直接打开class file或者jar file就能反编译,效果也很不错。UI有Eclipse的风格,Find和Firefox的Find操作风格一致。
现在还在开发中,功能不是特别完善,应该会不断完善下去。

软件主页:http://java.decompiler.free.fr/

Main features

  • JD-Core and JD-GUI are written in C++. This allows an extremely fast decompilation and a display.
  • JD-Core does not require the Java runtime environment for its functioning, therefore no special setup is required.
  • JD-Core works with most current compilers including the following:
    • jdk1.1.8
    • jdk1.3.1
    • jdk1.4.2
    • jdk1.5.0
    • jdk1.6.0
    • jikes-1.22
    • harmony-jdk-r533500
    • Eclipse Java Compiler v_677_R32x, 3.2.1 release
    • jrockit90_150_06
  • JD-Core supports the following new features of Java 5:
    • Annotations
    • Generics
    • Type “enum”
  • JD-GUI supports Drag and Drop.
  • JD-GUI supports JAR files.
  • JD-GUI displays color coded Java source code.
  • JD-GUI allows you to browse the “class” files hierarchy.
  • JD-Core and JD-GUI use the excellent cross-platform wxWidgets toolkit.

 

Technorati 标签: ,

Aptana-JavaScript开发利器及其安装

一个JS的编辑调试工具 Aptana,功能不错,可以在Firefox下调试JS代码,具有很强的代码辅助功能,可以在代码辅助中添加第三方的类库。

它的特性包括:
*JavaScript,JavaScript函数,HTML,CSS语言的Code Assist功能。
*Outliner(大纲):显示JavaScript,HTML和CSS的代码结构。
*支持JavaScript,HTML,CSS代码提示,包括JavaScript自定函数。
*代码语法错误提示。
*支持Aptana UI自定义和扩展。
*支持跨平台。
*支持FTP/SFTP。
*调试JavaScript。
*支持流行AJAX框架的Code Assist功能:AFLAX,Dojo,JQuery,MochiKit,Prototype,Rico,script.aculo.us,Yahoo UI,Ext。
*Adobe AIR与iPhone开发工具

一般我使用的是Eclipse插件版本,安装的方法有两种。在 http://www.aptana.com/docs/index.php/Plugging_Aptana_into_an_existing_Eclipse_configuration#Introduction 上有详细的说明。

以前在用下载后安装的方法时出错,所以一直使用的是在线安装的方式,但是这个网站速度期满无比,安装过程需要重试n次才能完成,非常麻烦。这次重新安装机器,偶尔使用了下载再安装的方法,一点问题都没有。

下载的地址是 http://update.aptana.com/update/studio/3.2/aptana_update_015414.zip
推荐使用迅雷下载。

在IBM DeveloperWorks网站上还看到了一篇利用Aptana和AIR来开发桌面应用程序的文章:使用 Ext、Aptana 和 AIR 构建桌面应用程序

 

Technorati 标签: ,,

记性差了,还是要在这里多写写

最近计算机系统运行很慢,决定重新安装一次。也难怪,这个系统有2年半没有重新安装了。安装的过程中,发现一些开发工具,一些插件的安装方式都忘记了,决定还是在这里多记录一些东西。

年纪慢慢大了,记性就是不行了啊。