<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LJ&#039;s life in US &#187; Study</title>
	<atom:link href="http://www.zh-cn.org/category/study/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zh-cn.org</link>
	<description>No Theme</description>
	<lastBuildDate>Sat, 21 Apr 2012 21:41:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Tips on compiling ipopt and pyipopt</title>
		<link>http://www.zh-cn.org/en/2012/01/26/english-tips-on-compiling-ipopt-and-pyipopt/</link>
		<comments>http://www.zh-cn.org/en/2012/01/26/english-tips-on-compiling-ipopt-and-pyipopt/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 23:37:33 +0000</pubDate>
		<dc:creator>L.J.</dc:creator>
				<category><![CDATA[Study]]></category>
		<category><![CDATA[ipopt]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[pyipopt]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.zh-cn.org/?p=601</guid>
		<description><![CDATA[This post describes some tips on building the ipopt package and pyipopt package from source. IPOPT is part of the coin-or project, and pyipopt provides an interface of ipopt to python. Thanks to the author of pyipot, Eric You Xu, for providing me some insightful hint. The reason for me to build these packages is to use them in openopt, which I [...]]]></description>
			<content:encoded><![CDATA[<p>This post describes some tips on building the ipopt package and pyipopt package from source. <a title="IPOPT" href="https://projects.coin-or.org/Ipopt">IPOPT</a> is part of the coin-or project, and <a href="https://github.com/xuy/pyipopt">pyipopt</a> provides an interface of ipopt to <a title="Python" href="http://www.python.org">python</a>. Thanks to the author of pyipot, <a title="徐宥" href="http://blog.youxu.info/">Eric You Xu</a>, for providing me some insightful hint. The reason for me to build these packages is to use them in <a title="Openopt" href="http://openopt.org">openopt</a>, which I may write another post to describe.</p>
<p>The current version of ipopt is 3.10.1, and the current version of pyipopt is 0.8. The author of openopt Dmitrey claims that recent versions of ipopt does not work well together with openopt, and he uses version 3.8.3. Anyway, the focus of this post is to build ipopt and pyipopt. I use ubuntu 11.10 within a vmware virtual machine. There is a 3.9 version ipopt in ubuntu repository, however that one does not work well when compiling pyipopt, which motivated me to build by myself.</p>
<p>The document of ipopt is fabulous. However, there are so many steps that you may easily miss some. <strong>This post is by no means a replacement of the original document.</strong> So before you have any questions, make sure you have read the original document carefully.</p>
<h1>Tip 1, remove existing ipopt</h1>
<p>I had ipopt 3.9.1 from the ubuntu repository installed, but I did not check that. So I had everything built successfully, but bunches of errors when trying to import pyipopt in python. Thus, remember to uninstall existing ipopt before you start.</p>
<h1>Tip 2, BLAS</h1>
<p>ubuntu has a pre-compiled BLAS library, or if you have MKL, you may have your own BLAS. So I thought I could supply these library without downloading the source of BLAS. Everything worked well at ipopt side. However, when it comes to pyipopt, you will find yourself missing all kinds of symbols. So, even you have BLAS installed, do not supply it use the &#8211;with-BLAS options. Remember to download BLAS and LAPACK source. Refer to the Thirdparty directory of the ipopt source package for detailed information. By the end, you will get libcoinblas.so, libcoinlapack.so, which are useful to build pyipopt. If you don&#8217;t do this, very possibly you will get an error when importing pyipopt stating certain symbols are not defined.</p>
<h1>Tip 3, HSL</h1>
<p>Well, this maybe not a tip, but a work around.  The files I downloaded from HSL website have different names as described in ipopt document. Thus, in order to use MA57 and MC19, I have to build them separately and supply them as pre-compiled library using the &#8211;with-hsl option. Read the help file came with MA57 to detailed information of compiling them.</p>
<h1>Tip 4, Modify the configuration files</h1>
<p>You actually do not need to modify anything for the ipopt configuration file. However, for pyipopt, make sure you modify the makefile and setup.py file to reflect the environment of your <strong>own</strong> machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zh-cn.org/en/2012/01/26/english-tips-on-compiling-ipopt-and-pyipopt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choice of optimization tools</title>
		<link>http://www.zh-cn.org/en/2011/10/08/english-choice-of-optimization-tools/</link>
		<comments>http://www.zh-cn.org/en/2011/10/08/english-choice-of-optimization-tools/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 09:55:56 +0000</pubDate>
		<dc:creator>L.J.</dc:creator>
				<category><![CDATA[Study]]></category>
		<category><![CDATA[ampl]]></category>
		<category><![CDATA[cplex]]></category>
		<category><![CDATA[gurobi]]></category>
		<category><![CDATA[modeling]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[optimJ]]></category>
		<category><![CDATA[pulp]]></category>
		<category><![CDATA[tomlab]]></category>

		<guid isPermaLink="false">http://www.zh-cn.org/?p=586</guid>
		<description><![CDATA[Recently, my lab mates asked me to recommend some tools for mathematical programming. I would like to share some of my experience on this. My first optimization related project dates back 5 years ago, when I needed to improve some models built by some other senior students. Those models were written in AMPL, using cplex [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, my lab mates asked me to recommend some tools for mathematical programming. I would like to share some of my experience on this.</p>
<p>My first optimization related project dates back 5 years ago, when I needed to improve some models built by some other senior students. Those models were written in AMPL, using cplex as a solver. My preferred computation tool was Matlab at that time, but cplex did not support Matlab yet. What I did was some thing really dirty. I wrote script to generate AMPL data files in Matlab,  parse the screen print out of AMPL and then send back to Matlab. Until recently, I got to know that <a href="http://tomopt.com/tomlab/products/ampl/">TOMLAB</a> provides an interface between AMPL and Matlab. Actually, if you use Matlab a lot, there are more interfaces provided by TOMLAB.</p>
<p>Later I need to use column generation to solve a problem, and by then I started to use the C++/Concert/Cplex tool chain. Honestly, it is more time-consuming to learn this, and less efficient to write models. However, it does offer more control to the solve engine. I would be satisfied with this solution, until <a href="http://www.gurobi.com/">Gurobi</a> came out. Then I think, maybe I want to switch among solvers to see which one fits my problem best. However, if you have your model written with C++ and concert, basically it means to rewrite the model again with Gurobi API again if you really want to use Gurobi. At this time, I would really appreciate AMPL, which has interface to many mainstream solvers.</p>
<p>The story did not stop here. Later on, I started a new project, where optimization was just part of the problem, statistical modeling was another part. At that time, I suddenly got some interests on <a href="http://python.org/">Python</a>, and switched almost everything to Python and <a href="http://www.r-project.org/">R</a>. When cplex 12 came out, it started to provide a Python API. Same problem, I wanted to try different solvers,  but there is no interface between Python and AMPL. This time, I tried to have a better solution rather than parsing screen output. I heard about <a href="https://software.sandia.gov/trac/coopr/wiki/Pyomo">Pyomo</a> in <a href="http://informs.org/">INFORMS</a> southwest regional meeting. I liked this idea very much, but there was not much document available. After googling around, I found a similar tool, <a href="http://code.google.com/p/pulp-or/">pulp</a>, which gives similar functionality as AMPL, but within Python. I finished one project with pulp, and it did quite good job, except that it does not support 64 bit cplex, either in Windows or Linux. Pulp has relatively better documentation than Pyomo, but most of the time you need to reply on their examples to figure out how to use it.</p>
<p>Finally, I would suggest to put a middle layer between modeling and the actual solve engine for two reasons:</p>
<ul>
<li>A modeling language usually provide better readability of the models and easier to writer models.</li>
<li>A modeling middle layer enables you to switch among different solvers much easier.</li>
</ul>
<p>AMPL is good, but it is really hard to interact with other languages. IBM OPL is another choice, but it only supports solvers from IBM, i.e. cplex and cp. In python, you could choose pulp or Pyomo. There is also a package called <a href="http://www.ateji.com/optimj/index.html">optimJ</a>, which provides same functionality as pulp, but within JAVA. I haven&#8217;t tried this out yet, but it looks promising.</p>
<p>As a student, pricing of the tools also concerns me. For your information, I made the following list</p>
<p>AMPL: usually not free, may be available from your department if you are in an IE or OR department</p>
<p>cplex studio: free for academia use. Includes OPL, cplex, cp</p>
<p>Gurobi: free for academia use</p>
<p>TOMLAB: commercial</p>
<p>optimJ: The company is close, the products are free~~~</p>
<p>pulp: MIT license</p>
<p>Pyomo: BSD license</p>
<p>There are some open source solvers I did not mention in this post just because I did not use them. For example, lp_solver, cvxopt. Non linear solvers are not covered as well. For a complete guide of solver choice, I suggest you go to Dr. Mittelmann&#8217;s website: <a href="http://plato.asu.edu/guide.html">http://plato.asu.edu/guide.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zh-cn.org/en/2011/10/08/english-choice-of-optimization-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SETTING UP A RAPACHE ENVIRONMENT</title>
		<link>http://www.zh-cn.org/en/2011/05/19/english-setting-up-a-rapache-environment/</link>
		<comments>http://www.zh-cn.org/en/2011/05/19/english-setting-up-a-rapache-environment/#comments</comments>
		<pubDate>Fri, 20 May 2011 00:15:48 +0000</pubDate>
		<dc:creator>L.J.</dc:creator>
				<category><![CDATA[Study]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[rapache]]></category>

		<guid isPermaLink="false">http://www.zh-cn.org/?p=554</guid>
		<description><![CDATA[Caution: RApache has changed significantly recently, but I didn&#8217;t follow up as I am not working on this any more. The instruction in this post may have been out dated. STEP 1 SET UP THE OPERATING SYSTEM Get a Linux box, if you don’t have a spare machine, virtual machine is a good choice. There [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>Caution: RApache has changed significantly recently, but I didn&#8217;t follow up as I am not working on this any more. The instruction in this post may have been out dated.</strong></span></p>
<h1>STEP 1 SET UP THE OPERATING SYSTEM</h1>
<div>Get a Linux box, if you don’t have a spare machine, virtual machine is a good choice. There are different choices for virtualization. Make sure you have a modern CPU that supports virtualization. In this example, I use vmware workstation; other choices include <a href="http://www.virtualbox.org/">virtual box</a> and virtual pc from Microsoft. Install the system in normal way. Since I am using the virtual machine as a developer machine, I chose desktop edition rather than server edition of Ubuntu 11.04.</div>
<h1>STEP 2 INSTALL RAPACHE</h1>
<div>
<p>Note that here is the installation, rather than configuration. Follow the manual from Rapache website, you can run the following commands:</p>
<pre>
<pre class="brush: bash; title: ; notranslate">
apt-get install r-base-dev apache2-mpm-prefork apache2-prefork-dev
wget http://biostat.mc.vanderbilt.edu/rapache/files/rapache-latest.tar.gz
rapachedir=`tar tzf rapache-latest.tar.gz | head -1`
tar xzvf rapache-latest.tar.gz
cd $rapachedir
./configure
make
sudo make install
</pre>
</pre>
<p></p>
<p>You may need to provide administrator password for the last command. By doing so, you have R, Apache and Rapache installed.</p>
</div>
<h1>STEP 3 SET UP R</h1>
<div>
<p>Install all the necessary packages you need. Try to install the package via Ubuntu package manager first, as it will install the package to the site library directly. If it is not there, use the</p>
<pre>
<pre class="brush: r; title: ; notranslate">install.packages() </pre>
</pre>
<p></p>
<p>command inside R to install. Open a terminal (Alt+F2, type terminal), and run R with <strong>sudo</strong>.</p>
<pre>
<pre class="brush: bash; title: ; notranslate"> sudo R</pre>
</pre>
<p>This is because we want to install the R package into site library.</p>
</div>
<div>
<p>Check the library paths by</p>
<pre>
<pre class="brush: r; title: ; notranslate">
.libPaths()
[1] &quot;/usr/local/lib/R/site-library&quot; &quot;/usr/lib/R/site-library&quot;
[3] &quot;/usr/lib/R/library&quot;
</pre>
</pre>
<p></p>
<p>Don’t forget the <strong>.</strong> in front of the command. When installing the package, specify the lib. For example, if you want to install the package called “qcc”, type</p>
<pre>
<pre class="brush: r; title: ; notranslate">
install.pacakages(‘qcc’,lib=&quot;/usr/local/lib/R/site-library&quot;)
</pre>
</pre>
<p></p>
<p>This is important!! otherwise the R initialize by Rapache may not be able to find the library.</p>
</div>
<h1>STEP 4 CONFIGURE A RAPACHE ENABLED SITE</h1>
<div>Now we start to configure the site. Suppose your home directory is /home/ilpil and you want to create site that hold all the files under /home/ilpil/www/ Create a configure file under /etc/apache2/sites-available. Let’s name it rapache, well, you can name whatever name you like. Here is the content of my configuration file, modified according to the Rapache manual and based on the configuration file inside the Rapache installation package.</div>
<pre>
<pre class="brush: bash; title: ; notranslate">
&lt;VirtualHost *:80&gt;
	ServerAdmin LJ@localhost
	LoadModule R_module /usr/lib/apache2/modules/mod_R.so
	# Place this in the config file to turn error messages into HTML which
	# are printed in the browser. Without this, all warning and error messages
	# are printed to the Apache error log file.
	ROutputErrors 

	DocumentRoot &quot;/home/ilpil/www&quot;
	REvalOnStartup &quot;setwd('/home/ilpil/www/') &quot;
	RSourceOnStartup &quot;./R/startup.r&quot;
	&lt;Directory /&gt;
		Options FollowSymLinks
		AllowOverride None
		# Order allow,deny
		# Allow from all
	&lt;/Directory&gt;
	&lt;Location /RApacheInfo&gt;
		SetHandler r-info
	&lt;/Location&gt;

	&lt;Location /hello&gt;
		SetHandler r-handler
		RFileHandler /home/ilpil/www/helloworld.r
	&lt;/Location&gt;

	&lt;Location /sendBin&gt;
		SetHandler r-handler
		RFileHandler /home/ilpil/www/sendBin.r
	&lt;/Location&gt;

	&lt;Directory /home/ilpil/www/brew&gt;
		SetHandler r-script
		RHandler brew::brew
	&lt;/Directory&gt;

	&lt;Location /R&gt;
		SetHandler r-handler
		RFileHandler /home/ilpil/www/test.R
	&lt;/Location&gt;

	&lt;Location /Rblah&gt;
		SetHandler r-handler
		RFileHandler /home/ilpil/www/test.R::main
	&lt;/Location&gt;

	# Prints out a nice report about R running within Apache

	&lt;Directory /&gt;
		Options FollowSymLinks
		AllowOverride None
	&lt;/Directory&gt;

	&lt;Directory /home/ilpil/www/&gt;
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	&lt;/Directory&gt;

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	&lt;Directory &quot;/usr/lib/cgi-bin&quot;&gt;
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	&lt;/Directory&gt;

	ErrorLog ${APACHE_LOG_DIR}/error.log
	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn 

	CustomLog ${APACHE_LOG_DIR}/access.log combined 

	Alias /doc/ &quot;/usr/share/doc/&quot;
	&lt;Directory &quot;/usr/share/doc/&quot;&gt;
		Options Indexes MultiViews FollowSymLinks
		AllowOverride None
		Order deny,allow
		Deny from all
		Allow from 127.0.0.0/255.0.0.0 ::1/128
	&lt;/Directory&gt;
&lt;/VirtualHost&gt;
</pre>
</pre>
<div>
<p>After creating this configuration file, go back to the terminal. Run the following code to enable the site</p>
<pre>
<pre class="brush: bash; title: ; notranslate">
sudo a2dissite default
sudo a2ensite Rapache
sudo /etc/init.d/apache2 reload
</pre>
</pre>
<p></p>
<p>So far, everything should be fine. You can test it by visiting <strong>http://localhost/RApacheInfo</strong> from your own machine to see if everything is working well.</p>
</div>
<h1>STEP 5 THE USER2007 EXAMPLE</h1>
<div>Now we come to the setting of useR2007 example. Copy all the files in test directory inside the installation package to /home/ilpil/www Open useR2007.rhtml with an editor and change the external files to the right position. For example,</p>
<pre>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;plot&quot;&gt;&lt;% brew('test/brew/useR2007plot.rhtml') %&gt; &lt;/div&gt;
</pre>
</pre>
<p>should be changed to</p>
<pre>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;plot&quot;&gt;&lt;% brew('/brew/useR2007plot.rhtml') %&gt;&lt;/div&gt;
</pre>
</pre>
<p>Similar changes should be made in the useR2007.js, useR2007plot.rhtml and other files. I did not check all the files. When you have any wired problem, remember to check back if the links are pointing to the right place.To have this example run, you need to install extra packages Hmisc and Cairo. In order to install Cairo, you need to have <strong>libxt</strong> installed in your system. I installed X11 dev packages before I did this, so I am not sure if X11 dev packages are necessary for Cairo.</p>
</div>
<h1>LAST CAUTION</h1>
<div>This setting is meant to be a developer machine, which did not consider any security issue, as I do not know much about it. Ask a security specialist before you making anything online public. There is one flaw that the sendbin example doesn&#8217;t work. However, if I change the file name to helloworld.r and run it as localhost/hello, it actually works. So I suspect my Apache configuration file contains some mistakes. Anyway, this pretty much made the useR2007 example work.</div>
<p></br>
<div>BTW: If you happened to see this page, would you mind to know that I am looking for an analytic job? Here is my linkedin profile: <a href="http://www.linkedin.com/in/ljxue" target="_blank">http://www.linkedin.com/in/ljxue </a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.zh-cn.org/en/2011/05/19/english-setting-up-a-rapache-environment/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setting CPLEX and Eclipse in Linux</title>
		<link>http://www.zh-cn.org/en/2008/07/08/set-eclipse-to-work-with-cplex-under-linux/</link>
		<comments>http://www.zh-cn.org/en/2008/07/08/set-eclipse-to-work-with-cplex-under-linux/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 20:36:48 +0000</pubDate>
		<dc:creator>L.J.</dc:creator>
				<category><![CDATA[Study]]></category>

		<guid isPermaLink="false">http://www.zh-cn.org/?p=143</guid>
		<description><![CDATA[for my own documentary and for those who need this. Something Unrelated: I used to use AMPL as my modeling language and solve the problem with CPLEX. However, later I realized that AMPL is just a modeling language, but not a generic programming language, which makes it incapable to handle my problem since I have [...]]]></description>
			<content:encoded><![CDATA[<p><em>for my own documentary and for those who need this.</em></p>
<p><strong>Something Unrelated:</strong></p>
<p>I used to use AMPL as my modeling language and solve the problem with CPLEX. However, later I realized that AMPL is just a modeling language, but not a generic programming language, which makes it incapable to handle my problem since I have to customize some parts of the algorithm. Then I started to use CONCERT from ILOG. At the same time, a &#8220;fancy friend&#8221; introduced me to use Python. I do not know for what reason I switched to LINUX, maybe because of the powerful command line. I got cplex set up, I got ampl set up and I got gcc set up, and then I need an IDE. I chose the popular one, eclipse. However, annoying things happened, I cannot compile my programs inside the IDE, while I can compile it with a self written make file. I need IDE because I want to make the debug easier. During that time, I need to reboot my computer many times to switch between windows and Linux, (I was thinking to use a virtual machine, but I did not do that). Fortunately, I got eclipse to work with cplex. It maybe not the best solution, but good enough to me, a newbie of Linux, programming, eclipse and cplex. <img src='http://www.zh-cn.org/WP/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  There was another story of installing Linux in my thinkpad T60, and make everything run smoothly.</p>
<p><img title="More..." src="http://www.zh-cn.org/WP/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<p><strong>Something Related:</strong></p>
<p>OK, first thing is to install eclipse and CDT. There are lots of tutorials on this, so I will not cover this. Suppose you have CPLEX installed in the default directory: /usr/ilog/ . The setting is really nothing but putting the correct path into the correct place. As an old Chinese saying goes, a picture is better than thousands of words, I will put the screen shots below.</p>
<p>&nbsp;</p>
<div><a href="http://www.zh-cn.org/WP/wp-content/uploads/2008/07/screenshot-properties-for-dmw1_1.png" rel="lightbox[143]" title="Image 1 eclipse cplex"><img title="Image 1 eclipse cplex" src="http://www.zh-cn.org/WP/wp-content/uploads/2008/07/screenshot-properties-for-dmw1_1-300x248.png" alt="C++ compiler setting" width="300" height="248" /></a></div>
<div><a href="http://www.zh-cn.org/WP/wp-content/uploads/2008/07/screenshot-properties-for-dmw1-_2.png" rel="lightbox[143]" title="Image 2 eclipse cplex"><img title="Image 2 eclipse cplex" src="http://www.zh-cn.org/WP/wp-content/uploads/2008/07/screenshot-properties-for-dmw1-_2-300x248.png" alt="Directories" width="300" height="248" /></a></div>
<div><a href="http://www.zh-cn.org/WP/wp-content/uploads/2008/07/screenshot-properties-for-dmw1_3.png" rel="lightbox[143]" title="Image 3 eclipse cplex"><img title="Image 3 eclipse cplex" src="http://www.zh-cn.org/WP/wp-content/uploads/2008/07/screenshot-properties-for-dmw1_3-300x248.png" alt="miscellaneous setting" width="300" height="248" /> </a></div>
<div><a href="http://www.zh-cn.org/WP/wp-content/uploads/2008/07/screenshot-properties-for-dmw1_4.png" rel="lightbox[143]" title="image4 eclipse cplex"><img title="image4 eclipse cplex" src="http://www.zh-cn.org/WP/wp-content/uploads/2008/07/screenshot-properties-for-dmw1_4-300x248.png" alt="Linker setting" width="300" height="248" /></a></div>
<p>@@update June 5, 2010:</p>
<p>I wrote this post two years ago, and I was using cplex 10.0. I don&#8217;t have a chance to try the new versions yet.</p>
<p>@@ update Nov 23,2010:</p>
<p>Thanks Yuan provided the setting for CPLEX 12</p>
<p><a href="http://www4.ncsu.edu/~yzhang13/eclipse-cplex-linux2.html" rel="nofollow">http://www4.ncsu.edu/~yzhang13/eclipse-cplex-linux2.html</a></p>
<p>BTW: If you happened to read this, would you mind to know that I am looking for a analytic job? Here is my linkedin profile: <a title="View public profile" name="webProfileURL" href="http://www.linkedin.com/in/ljxue"></a><a href="http://www.linkedin.com/in/ljxue" target="_blank">http://www.linkedin.com/in/ljxue </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zh-cn.org/en/2008/07/08/set-eclipse-to-work-with-cplex-under-linux/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>(English) The wireless issue of thinkpad T60 with Ubuntu</title>
		<link>http://www.zh-cn.org/en/2008/02/07/the-wireless-issue-of-thinkpad-t60-with-ubuntu/</link>
		<comments>http://www.zh-cn.org/en/2008/02/07/the-wireless-issue-of-thinkpad-t60-with-ubuntu/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 06:39:27 +0000</pubDate>
		<dc:creator>L.J.</dc:creator>
				<category><![CDATA[Study]]></category>
		<category><![CDATA[thinkpad wireless driver madwifi]]></category>

		<guid isPermaLink="false">http://www.zh-cn.org/?p=116</guid>
		<description><![CDATA[I was troubled by the wireless card driver for a long time since the first time I install Ubuntu in my Thinkpad T60. Finally, I solved this problem today, the Chinese New Year. My wireless card is not the Intel one, but the thinkpad 802.11 abg card. The chip set is from Atheros. Actually, the [...]]]></description>
			<content:encoded><![CDATA[<p>I was troubled by the wireless card driver for a long time since the first time I install Ubuntu in my Thinkpad T60. Finally, I solved this problem today, the Chinese New Year. My wireless card is not the Intel one, but the thinkpad 802.11 abg card. The chip set is from Atheros. Actually, the solution is rather easy, just check out the the source code of the madwifi from its website <a title="Madwifi" href="http://madwifi.org" target="_blank">http://madwifi.org </a>, and then build it by yourself. The website has instruction on how to check out the source code, so I will not repeat it here. Just download, unpack, type &#8220;make install&#8221;, restart your computer, it will be done. Normally this will work, if not, Google again. <img src='http://www.zh-cn.org/WP/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>update: April 1, 2009</p>
<p>I found a lot people googled and got here. The above mentioned method doesn&#8217;t work anymore since I upgrade to ubuntu 8.04. Also, I found changing your wireless card  may help. I did nothing to the software, but changed my wireless card, and it is working smoothly now.  BTW, I am using the driver from the repository now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zh-cn.org/en/2008/02/07/the-wireless-issue-of-thinkpad-t60-with-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LJ&#039;s Matlab tips (1)</title>
		<link>http://www.zh-cn.org/en/2007/06/01/ljs-matlab-cookbook-1/</link>
		<comments>http://www.zh-cn.org/en/2007/06/01/ljs-matlab-cookbook-1/#comments</comments>
		<pubDate>Fri, 01 Jun 2007 14:50:56 +0000</pubDate>
		<dc:creator>L.J.</dc:creator>
				<category><![CDATA[Study]]></category>

		<guid isPermaLink="false">http://www.zh-cn.org/?p=67</guid>
		<description><![CDATA[As I promised to Starfish, I will write something about how to read and write files in matlab. Since I just picked up this part recently, there maybe some mistakes. Frankly speaking, I write this half for some one who may need it, half for myself, because I may forget them in the future, haha. [...]]]></description>
			<content:encoded><![CDATA[<p>As I promised to Starfish, I will write something about how to read and write files in matlab. Since I just picked up this part recently, there maybe some mistakes. Frankly speaking, I write this half for some one who may need it, half for myself, because I may forget them in the future, haha. My principle is if there is an easy way, no matter how ugly it is, never use a fancy but complicate one, so some code may look very naive. <img src='http://www.zh-cn.org/WP/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I am currently using matlab 2006b, all components are from the initial release.</p>
<p>Matlab provides many GUIes to do many operations. If you do not have many file to import, just use those tools. Also those tools can generate code to do similar work with slightly modification.</p>
<p><span style="color: #ff0000">Important: I only put the most common usage here, please refer to the matlab help file for detail usage.</span></p>
<ol>
<li>write &amp; read EXCEL file.<strong>read:</strong><br />
<code>num=xlsread(filename,sheetname,range)</code>e.g.:<br />
<code>num=xlsread('datafile.xls','sheet3','B2:F11')</code></p>
<p>read from file <strong>datafile.xls</strong> <strong>sheet3</strong>, cell range from B2 to F11, and assign the value to <em>num</em></p>
<p>PS: this style only read numeric data, if you have text data, the left side should change to be <code>[num,txtdata]</code></p>
<p>PS2:only <code>num=xlsread(filename)</code>will read from the first sheet range from the up left cell</p>
<p><strong>Write:<br />
</strong><code>xlswrite(filename,data,sheetname,range)</code></p>
<p>e.g.:<br />
<code>xlswrite('outputfile.xls',data,'sheet1','B2')</code></p>
<p>PS: range here only means the start cell. others are the same to read</li>
<li>wav file (Thanks to Starfish)<strong>read:</strong><br />
<code>[y,Fs,bits] = wavread('filename')<br />
</code>e.g.:<br />
<code>[data,Fs,bits]=wavread('sample.wav');</code></p>
<p>This command returns the sample rate (Fs) in Hertz and the number of bits per sample (bits) used to encode the data in the file</p>
<p><strong>Write:<br />
</strong><code>wavwrite(y,Fs,'filename')<br />
</code>e.g.:<br />
<code>wavwrite(firmat,Fs,'samplefilted.wav');</code></p>
<p>This command write the data of firmat into &#8216;samplefilted.wav&#8217; with Fs frequency.<br />
My current work does not need to read wav file. I remember I used this when I was taking the DSP class.</li>
<li>txt files</li>
<li style="list-style-type: none">
<ol>
<li>Read ASCII-delimited file of <strong>numeric</strong> data into matrix<strong>read:</strong><br />
<code>M = dlmread(filename, delimiter)<br />
</code>e.g.:<br />
<code>M = dlmread('data.txt', ' ');</code></p>
<p>This command read the numeric data from data.txt, the delimiter is space(&#8216; &#8216;). If delimiter is omitted, comma (,) is the default delimiter. Reading a specific range is also possible, refer to the matlab help file for detail.</p>
<p><strong>Write:<br />
</strong><code>dlmwrite(filename, M, 'D')<br />
</code>e.g.:<br />
<code>dlmwrite('output.txt', M, ' ')</code></p>
<p>Write the data M into file output.txt, delimitted by space(&#8216; &#8216;). A comma(,) is the default delimiter. Writing range is also available, refer to the matlab help file.</li>
<li>ordinary txt fileto be continued.</li>
</ol>
</li>
</ol>
<p>To be continued. I will write others in the next few days. I am sleepy these days~~~</p>
<p>I will only write how to read txt file in the future. I won&#8217;t write how to read image file and sound file.</p>
<p>PS: A little update can be found <a href="http://tips.zh-cn.org/?p=18">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zh-cn.org/en/2007/06/01/ljs-matlab-cookbook-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>(English) some usefule site for Fleury&#039;s Algorithm</title>
		<link>http://www.zh-cn.org/en/2007/04/29/some-usefule-site-for-fleurys-algorithm/</link>
		<comments>http://www.zh-cn.org/en/2007/04/29/some-usefule-site-for-fleurys-algorithm/#comments</comments>
		<pubDate>Mon, 30 Apr 2007 05:27:50 +0000</pubDate>
		<dc:creator>L.J.</dc:creator>
				<category><![CDATA[Study]]></category>

		<guid isPermaLink="false">http://www.zh-cn.org/?p=60</guid>
		<description><![CDATA[http://www2.austin.cc.tx.us/powens/+Topics/HTML/05-6/05-6.html http://planetmath.org/encyclopedia/FleurysAlgorithm.html http://www.ctl.ua.edu/math103/euler/ifagraph.htm I prefer the first one because there is an example. Fleury&#8217;s Algorithm is used to find the Eulerian Cycle (if there is one) or the Eulerian Path (if there is no Eulerian Cycle). The computation complexity is O(n^4). There is another O(n+e) algorithm which uses the cycles.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www2.austin.cc.tx.us/powens/+Topics/HTML/05-6/05-6.html">http://www2.austin.cc.tx.us/powens/+Topics/HTML/05-6/05-6.html</a></p>
<p><a href="http://planetmath.org/encyclopedia/FleurysAlgorithm.html">http://planetmath.org/encyclopedia/FleurysAlgorithm.html</a></p>
<p><a href="http://www.ctl.ua.edu/math103/euler/ifagraph.htm">http://www.ctl.ua.edu/math103/euler/ifagraph.htm</a></p>
<p>I prefer the first one because there is an example.</p>
<p>Fleury&#8217;s Algorithm is used to find  the Eulerian Cycle (if there is one) or the Eulerian Path (if there is no Eulerian Cycle).</p>
<p>The computation complexity is O(n^4). There is another O(n+e) algorithm which uses the cycles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zh-cn.org/en/2007/04/29/some-usefule-site-for-fleurys-algorithm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

