lundi 14 mars 2011

Configuring the Eclipse Java IDE to use CPLEX libraries

Question

How do I configure the Eclipse Java IDE to use CPLEX libraries?

Cause

To specify the configuration details required to connect the Eclipse Java IDE with CPLEX libraries.

Answer

Perform the following steps to configure Eclipse with CPLEX:
1. If you are creating a new Java project
File -> New -> Java project
Else, import the existing project into your workspace
File -> Import -> Expand on 'General' -> Select 'Existing Projects into Workspace'

2. Create source (class) files as needed. To add a new class to the project,
Right click on the source folder (src) -> New -> Class, specify a name, change the
properties like package, modifiers, automatic stubs etc as required, and then click 'Finish'.
To add an existing java file to the project, simply drag and drop the .java file into the 'src'
folder of the project. Sample java programs can be found under <cplex>\examples\src\java
directory.

3. Include the CPLEX jar in the project
a) Project -> Properties -> Java Build Path -> Libraries tab ->
b) Click the 'Add External JARs ...' button and point to cplex.jar
file (found under the <CPLEX>/lib directory)

4. Run Configuration setup
a) Run -> Run Configurations ... -> Java Application
b) Right click to select 'New' if no Run Configuration exists or select the one
which you would like to configure.
c) On the 'Main' tab select your main class (the class containing
the main() function that you want to run).
d) On the 'Arguments' tab add the following to 'VM arguments' section
-Djava.library.path=<path_to_so_or_dll>
where <path_to_so_or_dll> is the directory that contains the
libcplex<version>.so (Linux) or cplex<version>.dll (Windows) file found
by default under the <CPLEX_installation_dir>/bin/<port> directory.
e) If the PATH environment variable is globally defined and includes CPLEX's
.dll or .so (platform dependant) files, then the previous step is not required.
f) This step is required only if you are using CPLEX 12.1 or an earlier version.
If CPLEX's license path is not globally defined under the ILOG_LICENSE_FILE
environment variable, then you can do so in the 'Environment' tab. Click 'New'
and enter ILOG_LICENSE_FILE as the Name and <license_file_location> as the
Value. The <license_file_location> needs to specify the license file name as well and not
just the directory it is present under.

5. You should now be able to run the program.

original link: http://www-01.ibm.com/support/docview.wss?uid=swg21449776

mercredi 2 mars 2011

use iChat to Sychronize sina twitter

申请一个gmail 打开ichat 登入ichat  账户类型选googletalk

然后在sina的微博里面在工具里面选择绑定gtalk 然后ichat 会叫你加机器人好友 然后你加就可以了 以后想发博客直接发给机器人就可以了

机器人指令说明(你可以用下面的指令让新浪微博小助手来做一些事情)
关闭 所有用户新微博提醒:/toff
开启 所有用户新微博提醒:/ton
关闭 某个用户的微博提醒:/toff 用户昵称
开启 某个用户的微博提醒:/ton 用户昵称
关闭 新评论提醒:/poff
开启 新评论提醒:/pon
关闭 新私信提醒:/moff
开启 新私信提醒:/mon
关闭 新粉丝提醒:/foff
开启 新粉丝提醒:/fon
关闭以上所有消息接收:/off
开启以上所有消息接收:/on
发私信:/d 粉丝昵称 私信内容(例如给张三发私信:/d 张三 你吃饭不?)
忘记了以上指令?没关系,直接发送:/help

mercredi 26 janvier 2011

how to change your mac address in Ubuntu

1: Temporary Modification:
Step 1: check your Mac address.


sudo inconfig


and then, you will see the following lines in your terminal:



eth0      Link encap:Ethernet  HWaddr 00:16:41:e5:7f:1d  
          inet addr:192.168.1.50  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::216:41ff:fee5:7f1d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:92 errors:0 dropped:0 overruns:0 frame:0
          TX packets:92 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:14966 (14.9 KB)  TX bytes:11325 (11.3 KB)
          Memory:ee000000-ee020000 
lo        Link encap:Local Loopback
...


In this case, your mac address is 00:16:41:e5:7f:1d.


Step 2: Set the Mac address as you wish.


sudo ifconfig eth0 hw ether 00:00:00:00:01:01


Of course, you can use other mac address you want here. Then, enter your password. Afterwards, check the Mac address again, you will see the following in your terminal:



chen@chen-IBM-UBUNTU:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:00:00:00:01:01  
          inet addr:192.168.1.50  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::216:41ff:fee5:7f1d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4150 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3660 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:4323076 (4.3 MB)  TX bytes:758494 (758.4 KB)
          Memory:ee000000-ee020000 


lo        Link encap:Local Loopback  


To reset/restore your Mac address, you can restart your machine and login again.
DONE.


mercredi 27 octobre 2010

lundi 25 octobre 2010

【转】如何正确内置CUE文件

发现很少有人注意这个问题,所以提出来大家参考。大家应该知道在foobar的媒体库设置里提供有限制类型和排除文件类型的选项。比较旧的foobar 版本里这里的设置默认为空,而最新的版本比如v0.9.5.6里默认为排除cue文件。所以有人升级foobar后发现播放列表里只有一个个的ape文 件,没有具体曲目信息。可能大家已经习惯了,右边的分类播放列表里有一个ape文件和对应的cue文件提供的曲目信息。这样多少有点“重复”的意思。有人 问过如何去掉那个ape文件,让播放列表里只有cue曲目信息。这里我提供的建议是,大家保留媒体库里的排除cue文件设置,同时将cue文件内置到 ape文件里。如何内置呢?其实很简单。在最新的foobar播放界面右键点击一个ape文件,选择工具-编辑cue sheet,在弹出的界面中勾选“启用文件里内嵌的cue sheet”,然后点击“载入……”,找到这个ape文件对应的cue文件,确定就可以了。 当内置cue文件成功后,重新扫描媒体库就可以了。播放列表里就没有多余的ape文件了,而cue文件也可以放到回收站了。建议你保留,因为你已经在媒 体库里排除了cue文件,万一以后要用到呢。呵呵! 下面几点很重要,因为我们有时并不能成功内置cue文件,即使成功了也会发现播放列表显示不正确。需要注意的是以下几点: 1,确保cue文件格式正确。至于这点请查看置顶帖。 2,在进行操作前不能播放当前ape文件里的歌曲,否则会弹出出错提示框。 3,如果cue文件正确,载入成功,重启foobar后发现列表里多余的ape文件也没有了,但是歌曲的标题不正常,并不是cue文件提供的歌曲标题,或 许全部显示为专辑的标题。至于这点请这样做:全选右边播放列表里那个ape文件包含的所有曲目文件,右键选择属性,将元数据栏里的艺术家,标题和专辑的值 全部清空,然后重新内置cue文件,一般就可以解决了。

*原文转自:http://www.foobar2000.com.cn/archiver/showtopic-5705.html

jeudi 21 octobre 2010

[转] Ubuntu 10.04 LTS 安装 sun-java6-jdk

今天需要用到sun的jdk,但找了半天就是找不到,只有openjdk,后来才知道,是10.04中弄走了sun-java6-jdk,官方的release notes 中看
到如下一段:

Sun Java moved to the Partner repository

For Ubuntu 10.04 LTS, the sun-java6 packages have been dropped from the Multiverse section of the Ubuntu archive. It is recommended that you use openjdk-6 instead.
If you can not switch from the proprietary Sun JDK/JRE to OpenJDK, you can install sun-java6 packages from the Canonical Partner Repository. You can configure your system to use this repository via command-line:
add-apt-repository "deb http://archive.canonical.com/ lucid partner"



于是,添加上面的源后再



sudo apt-get update



sudo apt-get install sun-java6-jdk

*原文转自:http://blog.csdn.net/cangzhubai/archive/2010/06/25/5693021.aspx

mardi 19 octobre 2010

alias mysql=/usr/local/mysql/bin/mysql

mysql --user=chen --password=cwang mysql

前提:MySQL 已经打开;