Stuckness shouldn't be avoided. It's the psychic predecessor of all real understanding. An egoless acceptance of stuckness is a key to an understanding of Quality, in mechanical work as in other endeavors. It's this understanding of Quality as revealed by stuckness which so often makes self-taught mechanics so superior to institute-trained men who have learned how to handle everything except a new situation. - Robert Pirsig, Zen and the Art of Motorcycle Maintenance
Tuesday, October 27, 2009
Turning Off the Annoying Windows Beep (on Server 2003)
Monday, October 26, 2009
Installing Hudson as a Service on Vista
http://www.mikebosch.com/?p=137
Doxygen Doxyfile Changes I Usually Do (To the Default Generated File)
EXTRACT_ALL = YES
REFERENCES_RELATION = YES
REFERENCED_BY_RELATION = YES
the following for browsing through sources:
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
for collaboration diagrams:
HAVE_DOT =YES
Sunday, October 25, 2009
Mediawiki SMTP Setup On Windows
Tuesday, October 20, 2009
Installing Secure SVN Server on Windows
I started out with setting svn server as per http://www.codinghorror.com/blog/archives/001093.html. Then I followed http://turnleft.inetsolution.com/2007/07/how_to_setup_subversion_apache_1.html.
In the middle I got stuck with htpasswd command as it would not execute, saying "Illegal character :". Something to do with the file path. So I installed cygwin, including openssl (followed http://daveonsoftware.blogspot.com/2007/06/installing-cygwin-with-openssl-package.html). After this the htpasswd command worked fine.
Then, as per http://raibledesigns.com/wiki/Wiki.jsp?page=ApacheSSL I set up apache with ssl.
I tried to start Apache, but won't. In Event Viewer I saw it returned error code 1. As per http://www.issociate.de/board/post/474531/2.2.6_won%27t_start_-_The_Apache2.2_service_terminated_with_service-specific_error_1_%280x1%29..html I debugged httpd.exe using command line. It said "DAV is not allowed here". The following configuration (amendment over the "turnleft" solution above) worked (I have replaced SVNParentPath by SVNPath too):
<location /svn>
DAV svn
SVNPath C:/svn/repository
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile conf/svn-passwd.pass
AuthzSVNAccessFile conf/svn-authz.conf
Require valid-user
</location>
Creating a service under windows
sc create svnserver binpath= "c:\svn\bin\svnserve.exe --service -r c:\svn\repository" displayname= "Subversion" depend= Tcpip start= auto
sc config binpath = ...
Thursday, October 15, 2009
Latex Figure Numbering Incorrect
Tuesday, October 13, 2009
Useful Synchronized Notes
Thursday, October 8, 2009
Using Xterm on Ubuntu
My simple .Xdefaults file:
! you should run> xrdb < ~/.Xdefaults
xterm*font: -*-lucidatypewriter-medium-r-*-*-12-*-*-*-*-71-iso8859-*
xterm.vt100.background:black
xterm.vt100.foreground:grey
Wednesday, October 7, 2009
VMWare Player with Ubuntu on Windows Vista
Probably a more straightforward way is to download from http://www.vmware.com/appliances/
Saturday, October 3, 2009
Trying out Medical on Ubuntu 9.04
Wednesday, September 30, 2009
Hudson: Memory Leaks and Other Issues
Out of Memory
The memory usage of Hudson build system rose to 800MB or so after I left it to run for a couple of weeks. Some component seems to be causing leaks. There have been earlier complaints about memory leaks in Hudson, for example, http://www.nabble.com/hudson-memory-leak-td23221034.html but not sure whether these issues were confirmed and/or solved. As per Hudson "Memory Leak Document" at http://wiki.hudson-ci.org/display/HUDSON/I%27m+getting+OutOfMemoryError, I have restarted JVM with the suggested option of "-XX:+HeapDumpOnOutOfMemoryError". I am not running Hudson under distributed build. It is possible that some plugin is eating the memory.
Doxygen Plugin
With doxygen plugin I get:
FATAL: error
hudson.AbortException: The directory 'C:\Users\g0700201\.hudson\jobs\
at hudson.plugins.doxygen.DoxygenDirectoryParser.retrieveDoxygenDirectoryFromDoxyfile(DoxygenDirectoryParser.java:278)
CCCC Plugin
I dont know how anybody ever got this plugin to work. Will cccc I get:
Parsing cccc results
hudson.AbortException: Parsing file error
at com.thalesgroup.hudson.plugins.cccc.CccccParser.invoke(CccccParser.java:76)
at com.thalesgroup.hudson.plugins.cccc.CccccParser.invoke(CccccParser.java:50)
Saturday, September 19, 2009
Using Thunderbird within NUS / Setting up LDAP
- Choose Add Dir.
- For ldap-server, enter ldapstf.nus.edu.sg (for staff address book) or ldapstu.nus.edu.sg (for student address book)
- For search-base, enter DC=stf,DC=nus,DC=edu,Dc=sg (for staff address book) or DC=stf,DC=nus,DC=edu,Dc=sg (for student address book) Set use-implicitly-from-compose and Pine will lookup names you type in the To: line while composing messages in the directory. If there are multiple names that match you will be prompted to select from a list of matching entries.
I had setup thunderbird with IMAP. I installed the add-on "Email Address Crawler" https://addons.mozilla.org/en-US/thunderbird/addon/9995 which crawls all mails and reads addresses into the address book. Then I ran the crawler on my Inbox and Sent Mail. This was enough for all the email addresses I usually use.
I also checked the option: "Preferences > Composition > Addressing > Automatically Add Outgoing Email Addresses to My: ".
Monday, September 14, 2009
Hudson Too Has Problems (Subversion Update Mode)
I was wishing that hudson would not have many bugs, as its GUI is quite sleek. But turns out it is not so. I'm facing a curious problem: although I've set to "svn update", hudson always tries to delete the workspace at the end of the build, and always fails. This problem has been reported before here: https://hudson.dev.java.net/issues/show_bug.cgi?id=86&historysort=new.
The bug report says the issue is already fixed, but I am facing the same problem even now. It may be triggered because I am using "local directory" option to check out svn code into a particular subdirectory in the workspace (then it is an another bug).
On a side note: The fix of the above bug report is scary -- just a "/" can cause such a mess -- this probably means the code is not too well written; that's why I'm facing a similar bug.
Update: Sept 22, 2009
I am quite happy with hudson so far, although I had trouble here and there. In summary I face the following troubles currently:
- Hudson deletes the svn checked out code (using CMakebuilder), even when "use svn update" is marked. To work around, I've reverted to clean build, and reduced the frequency of checkout. Update: It turns out the problem was due to CMakebuilder plugin, which cleaned up the directory, not hudson.
- I'm not sure how to use Hudson CMakebuilder plugin on windows. To work around, I modified the shell script provided at http://schneide.wordpress.com/2009/04/07/cmake-builder-plugin-for-hudson/. Then Hudson complained that it can't execute sh, so I installed cygwin and appended its bin directory into my PATH environment variable. I don't have time to try cmakebuilder again after installing cygwin, but that might also work fine. I believe that the CMakebuilder plugin has created more problems for me than it solved. It needs to be rewritten. I will try to do it next week.
- I can't install Hudson as a Windows Service through the dashboard. I'm getting AccessDenied error as below, even though the current user has Admin privileges.
WMI.WmiException: AccessDenied
at WMI.WmiRoot.BaseHandler.CheckError(ManagementBaseObject result) at WMI.WmiRoot.ClassHandler.Invoke(Object proxy, MethodInfo method, Object[] args) at WMI.Win32ServicesProxy.Create(String , String , String , ServiceType , ErrorControl , StartMode , Boolean , String[] ) at winsw.WrapperService.Run(String[] args) at winsw.WrapperService.Main(String[] args)
Sunday, September 13, 2009
Installing CDash
Warning: Read Conclusion at the end of this post now.
* download Apache and PHP as described at http://public.kitware.com/Wiki/CDash:Installation. Make sure you enable the PHP modules as listed on the Kitware link.
* configure PHP and Apache as described at "Configuring PHP" and
"Running PHP 5 as an Apache Module" respectively on this page: http://www.thesitewizard.com/php/install-php-5-apache-windows.shtml
* Download CDash and copy to apache htdocs directory (remove the CDash version number if any)
*Create cdash/config.local.php as on the Kitware link.
* Now I tried to open http://localhost/CDash/login.php in my web browser. This returned "Fatal error: Allowed memory size of 134217728 bytes exhausted" at line 180 of config.local.php. Reading this file revealed that the file recursively included itself. So I commented out the lines as follows:
//$localConfig = dirname(__FILE__).'/config.local.php';
//if ( file_exists($localConfig) )
// {
// include($localConfig);
// }
After this change, the url opened file. The only remaining thing now is to set up the database.
* I installed MySQL as at Kitware link. During installation I set an administrator account called 'root'. I use this account to login into MySQL. Then I run:
mysql> create database cdash;
mysql> create user 'cdash'@'localhost' identified by 'passwd';
mysql> grant all privileges on cdash.* to 'cdash'@'localhost' with grant option;
I make the corresponding changes in cdash/config.local.php to set the:
// Hostname of the database server
$CDASH_DB_HOST = 'localhost';
// Login for database access
$CDASH_DB_LOGIN = 'cdash';
// Password for database access
$CDASH_DB_PASS = 'passwd';
// Name of the database
$CDASH_DB_NAME = 'cdash';
// Database type (empty means mysql)
$CDASH_DB_TYPE = 'mysql';
There were errors even now, as I tried to register a new user. Then I tried to open http://localhost/CDash/install.php -- this indicated:
| Database Type: | mysql |
| Database Hostname: | mysql |
| Database Login: | cdash |
| Database Name: | cdash |
Admin Email: __________
Admin Password: ______
This is different from what I wanted -- I wanted the Database hostname to be "localhost". I could not figure out how CDash set it to mysql (I think this is a bug; which does not augur well for CDash. Probably it has a lot of bugs). Anyway, I proceeded with creating an Admin by filling Email and Password. This worked.
There is still some problem with opening http://localhost/CDash/index.php. This just shows some php script -- so the PHP script is probably malformed.
Conclusion: I think it would be too much effort to work with CDash as even installation is so tedious. I'll move to using Hudson for now, which from my limited previous experience was rather user-friendly.
Friday, August 28, 2009
Second Interaction with Tesseract OCR
After this I tried running
tesseract phototest.tif test1 segdemo interas per their instructions, but it would not work. I realized this is because of missing file at /usr/local/share/tessdata. Therefore, I did:
sudo cp -R
But this undid the change done previously (in the first installment) for english recognition. Therefore I had to copy the eng data files again:
sudo cp -R
After this I ran the viewer on my own image. It worked but it kept on saying
ScrollView: Waiting for server...
ScrollView: Waiting for server...
ScrollView: Waiting for server...
ScrollView: Waiting for server...
Some problem with starting the server. I retried with the image they provide in
Sometimes I had to manually kill the previous java GUI as it would not allow the GUI to start the next time.
I still have not not been able to run the viewer with my own images. Some catch there.
Thursday, August 27, 2009
Rdesktop woes: Connecting from Linux to Windows Vista
I also installed "GRDC" Gnome RDC client, which works quite well (as well as windows rdesktop client).
Still in lookout for a better solution to connect to Vista, without the freezes.
Excluding Multiple Directories using Doxygen EXCLUDE tag
EXCLUDE =
Doxygen is such a nifty tool. The pleasure would have been additional if the config files contained very simple format examples.
Default Doxyfile for Code Understanding
28c28
< project_name =" ---"> PROJECT_NAME = project_name
300c300
< extract_all =" NO"> EXTRACT_ALL = YES
305c305
< extract_private =" NO"> EXTRACT_PRIVATE = YES
310c310
< extract_static =" NO"> EXTRACT_STATIC = YES
473c473
< show_directories =" NO"> SHOW_DIRECTORIES = YES
590c590
< recursive =" NO"> RECURSIVE = YES
683c683
< source_browser =" NO"> SOURCE_BROWSER = YES
688c688
< inline_sources =" NO"> INLINE_SOURCES = YES
700c700
< referenced_by_relation =" NO"> REFERENCED_BY_RELATION = YES
706c706
< references_relation =" NO"> REFERENCES_RELATION = YES
738c738
< alphabetical_index =" NO"> ALPHABETICAL_INDEX = YES
977c977
< generate_latex =" YES"> GENERATE_LATEX = NO
1342c1342
< have_dot =" NO"> HAVE_DOT = YES
1390c1390
< uml_look =" NO"> UML_LOOK = YES
1482c1482
< dot_transparent =" NO"> DOT_TRANSPARENT = YES
First Interactions with Tesseract OCR on Ubuntu Linux
$> tesseract text_image.jpg result
Unable to load unicharset file /usr/local/share/tessdata/eng.unicharset
I made the changes as per comment by caitifty on Feb 28, 2009 (sigh, there is no permalink) at http://code.google.com/p/tesseract-ocr/wiki/ReadMe . The change is to replace/add the tessdata directory at /usr/local/share/tessdata . After this, I get
$> tesseract text_image.jpg result
Tesseract Open Source OCR Engine
name_to_image_type:Error:Unrecognized image type:text_image.jpg
IMAGE::read_header:Error:Can't read this image type:text_image.jpg
tesseract:Error:Read of file failed:text_image.jpg
Segmentation fault
It appears that it does not recognize jpg file input. So I use imagemagick's "convert" tool to convert to tif format that tesseract seems to recognize.
$> convert text_image.jpg text_image.tif
and then
$> tesseract text_image.tif result
Tesseract Open Source OCR Engine
Image has 8 * 3 bits per pixel, and size (1000,171)
Resolution=200
$> cat result.txt
The last command produced the recognized text. The results were quite good.
Wednesday, August 19, 2009
Sourceforge: Recovering Wikispaces Dump after Migration to Mediawiki
Don't be. It is easy. I did this (as described at https://sourceforge.net/apps/trac/sourceforge/wiki/SFTP):
:~$ sftp
Connecting to frs.sourceforge.net...
The authenticity of host 'frs.sourceforge.net (216.34.181.57)' can't be established.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'frs.sourceforge.net,216.34.181.57' (RSA) to the list of known hosts.
sftp> help
sftp> cd /home/groups/c/cr/crackpot
sftp> ls
cgi-bin htdocs persistent wikispaces-dump.zip
sftp> get wikispaces-dump.zip
Fetching /home/groups/c/cr/crackpot/wikispaces-dump.zip to wikispaces-dump.zip
/home/groups/c/cr/crackpot/wikispaces-dump.zip 100% 648KB 49.8KB/s 00:13
sftp> quit
Monday, August 10, 2009
Flickr with Linux (Aug 10, 2009)
* Postr
* Fireuploader (firefox plugin)
* jUploader
Postr and Fireuploader appear buggy and have a somewhat unintuitive interface. I struggled with them a lot. Finally I read somewhere on the net about jUploader.
I downloaded jUploader (not present in Synaptic Package Manager on my ubuntu). After authentication, the first problem I faced is that it does not recognize "JPG" (uppercase) extension. So I had to change all my filenames to lowercase using
rename 'y/A-Z/a-z/' *
I also changed the default permission on upload from public to private from its menu. Then I just dragged and dropped my photos onto jUploader, selected all photos, added to photoset and clicked on upload. It worked just fine after this. Although not perfect, jUploader was close.
Note: I faced the problem of "I don't recognize this file format" because there was no privilege to read the image file as my current user.
I installed the flock browser, which also worked just fine (or should I say marvellously fine).
Friday, July 31, 2009
Rotating Wallpaper/Desktop Background in Ubuntu
Thursday, June 18, 2009
Some Refactoring Notes
Used to indent code:
find . \( -name "*.hpp" -or -name "*.cpp" \) | xargs astyle --indent=spaces=4 --brackets=block --indent-labels --pad=oper --one-line=keep-statements --convert-tabs --indent-preprocessor
Generating Code::Blocks Project using Cmake:
cmake -G "CodeBlocks - Unix Makefiles" ..
Regular Expressions used during refactoring using Code::Blocks:
search replace
utility::shared_ptr<([\w ]*)> \1\&
What Sucked
There is no machine learning in the editors. Therefore, every task has become repetitive.
Wednesday, June 17, 2009
Understanding boost::ptr_container
For example, you would probably expect from a vector of pointers to return a pointer when you perform indirection:
std::vector
int* p = v[i]; // ok
But ptr_vector returns a reference:
std::vector
int* p = v[i] ; // error: does not compile
int& p = v[i]; // ok
But the interface of ptr_vector is suited to work with algorithms:
find(v.begin(), v.end(), 3); // works only with ptr_vector
Transform Iterators
The transform_iterator can used with maps to traverse over just the keys or just the values contained in the map. An adaptor can be written to convert a usual iterator of a map into an iterator that traverses only over the value. This adaptor would have to be rewritten for ptr_map and its relatives because of its different interface.
Erasing An Element Using auto_type
typedef boost::ptr_set
S s;
int* j = new int(3);
s.insert(j);
s.insert(new int(5));
s.insert(new int(7));
S::iterator it = s.find(3);
s.release(it);
std::cout << *j << std::endl; // produces 0xfeeefeee using VS
If the second last line is changed to
S::auto_type r =s.release(it);
the correct value 3 is printed. r acts just like auto_ptr: it holds a reference to the object and thus prevents it from destruction. The user has the responsibility to destroy r when the object is no longer needed. r can also be dereferenced:
and the pointer can be released using r.release().
Currently, you also cannot store a pointer to a const inside the ptr_container.
Comparison with std container of pointers
TODO
Comparison with std container of shared pointers
TODO
Conclusion
The different interface of ptr_containers can be frustrating for new users but hopefully not so much after reading this article. The newer interface makes clear that the ptr_container has exclusive ownership and thus reduces bugs when compared to using a standard container of pointers.
Wednesday, June 10, 2009
Latex Image
jpeg2ps -h -r 600 image.jpg > image.eps
Thursday, May 28, 2009
Connecting to Wired Connection on Linux, Else to Wireless
Wicd connects to a wired connection if there is any, else allows you to connect to a wireless. It works just fine, but does not connect to the wireless automatically (not sure though, probably only sometimes). But I what I needed works just fine with wicd and I am totally satisfied.
Thursday, May 7, 2009
Upgrading to Jackalope
Wednesday, May 6, 2009
Back to Wired Connection
Friday, April 17, 2009
Beamer Font Problem
LaTeX Font Warning: Font shape `OT1/cmss/m/n' in size <4> not available
(Font) size <5> substituted on input line 87.
Further, in the dvi output the headings did not appear well. Compiling with another example from http://www.math.utah.edu/~smith/Beamer showed the same problem.
This was a RED HERRING. Finally, when I built the ps from the dvi, all worked just fine.
Thursday, March 26, 2009
Python
One good way to install is using easy_install, but it looks not possible for python 2.6. Finally I gave up on easy_install. I downloaded the matplotlib library (for python 2.5 as there is none corresponding to 2.6).
Finally I concluded that there is little support for python 2.6 and I uninstalled the 2.6 version and installed the 2.5 version.
Wednesday, March 25, 2009
Installing Mingw
First, you have to make sure the directory where you are installing has no space character in its name. Next, they "recommend" installing in C:\Mingw.
Third, when I tried a custom install with g++ and mingw-make included, there was a problem: the link connection to mingw-make download site never worked. This lead to problems during installation. I retried the installation (giving the same installation path), but the same problem occurred again and again. Finally I did a standard installation, which worked just fine.
I will retry installing the mingw-make by updating mingw later on (right now the connection breaks).
Saturday, February 7, 2009
Skype with Ubuntu Woes
http://tips4nongeeks.blogspot.com/2009/01/skype-sound-problem-in-ubuntu.html#comment-form
I'd encourage you to "try" this - I don't have much technical insight into why this works, so it might not work for your case. For mine it did. I am using Acer Aspire laptop.
Hello friends,
after messing with commands and stuff around to try to
solve the famous skype echo, I finally solved this pain in the ass!!
for intrepid ibex ubuntu.
If you follow this step by step your skype should work, at least I garantee that you will learn something.
so first of all don’t use the commands to remove any package
from your ubuntu specially pulseaudio, is useless and you will have an other pain in the ass trying to find what package to install:
1) for the audio playback echo (when trying to make a call),
-go to the small skype logo located in the bottom left corner
when you are loged in skype-> go to options-> sound devices
- change all default options to “pulse”.
Now you should be able to make a call test without the message
‘audio playback problem’ or stuff like that.
And you will have the next typical echo that your microphone
will not be working.
2) for the microphone echo (im using a headset):
-go to the upper panel in your window where is all the application-places-system options, in the right upper corner you will find a small speaker icon-> right click with the mouse-> open volume control-> preferences-> select all options specially those like headset- capture-capture1-capture2- input source- etc. those are not working !!!!
-now in the volume control ->label “options”-> change default options for “Mic” and “Digital Mic1″.
-in the next label “recording”-> maximum volume for all the stuff.
- The device should be “HDA alsa mixer”
-finally confirm in ->system-> preferences-> sound preferences, that the sound capture is set to “HDA analog (ALSA)” similar to the previous point.
Now you can try to record something with the ’sound recorder program’
it should work.
And the best Skype should work, no shity messages no shity problems (although when I use the inbuild mic instead of my headset the sound is so so).
I hope my suggestions are useful.
best of luck,
bye.
Friday, January 9, 2009
Refactoring my c++ code using bash
find . \( -name "*.h" -or -name "*.cpp" \) | xargs grep -i ActionResource -l | sort | uniq | xargs sed -i 's/ActionResource/Actuator/g'
and similarly for actionResource, ACTIONRESOURCE, ACTION_RESOURCE
find . | grep -v ".svn" | xargs grep -l TemporalInterval | xargs sed -i 's/TemporalInterval/TimeInterval/g' <-- this is for CMakeLists.
Renaming files
find . \( -name "*.h" -or -name "*.cpp" \) | sed 's/\(.*\)ActionResource\(.*\)$/mv "&" "\1Actuator\2"/'| grep ^mv | sh
Deleting ! files from svn
svn stat | grep ! | cut -f 3- -d " " | xargs svn del
Sunday, December 21, 2008
Setting Up Gnizr
Mysql setup commands:
mysql -u root -p
create database gnizr_test;
create user gnizr;
update mysql.user set password=PASSWORD('gnizr') WHERE Host = '%' AND User = 'gnizr';
GRANT ALL PRIVILEGES ON *.* TO 'gnizr'@'localhost' IDENTIFIED BY 'gnizr' WITH GRANT OPTION;
Next moved on to set up eclipse and tomcat.
There were lots of problems as things wont work the first time or the second time or even a third time. Tomcat tips: http://www.onjava.com/pub/a/onjava/2003/06/25/tomcat_tips.html too didn't help. I was getting an error: "SEVERE: Error listenerStart". Now the logs do not show the details about the exact problem. Being new to Tomcat, I didn't know how to enable more detailed logs.
After several attempts I uninstalled tomcat 5.5 and installed tomcat 6. This helped. Tomcat 6 comes with a good interface to deploy applications. Also, the logs found at /var/lib/tomcat6/logs also contained the details of the problem with listenerStart. I fixed a few issues then.
I tried to then run tomcat from eclipse. The problem was as a unprivileged user, I could not access tomcat-users.conf. I changed the permissions of tomcat-users.conf and of /var/cache/tomcat6 to enable this (Not to mention, this should not be done on production machines).
Saturday, October 4, 2008
Skype on Ubuntu Linux Automatically Starts - Too Bad
http://forum.skype.com/index.php?showtopic=39775
Monday, September 22, 2008
Executing after linking with DLL file on Windows using Visual Studio
As shown at http://stackoverflow.com/questions/45769/managingusing-libraries-with-debug-builds-vs-release-builds#46120 one can add a custom build step that copies the dll to the directory with the executable.
Friday, September 19, 2008
Comparing Two Folders on Windows/Linux/Whatever
Latex Problem with Using Bibliography
! LaTeX Error: Lonely \item--perhaps a missing list environment.
See the LaTeX manual or LaTeX Companion for explanation.
Type H
...
l.46 \bibitem{mcconnell04}
Try typing
Compiling Java Code from JSHOPGUI
downloaded JSHOPGUI
In src directory
----------------
javac -classpath ..\antlr.jar;..\bin.build\JSHOP2.jar;JSHOP2;JSHOP2\*.java -d ..\bin.build\
In examples\logistics
---------------------
javac *.java -classpath ..\..\antlr.jar;..\..\bin.build;..\foralltest
In examples\logistics
----------------------
java -classpath ..\..\antlr.jar;..\..\bin.build;..\foralltest gui
The correct way was to look at the Makefile and run the commands as per Makefile (including the classpath as above).
Friday, September 12, 2008
Set Up Thunderbird for NUS Email on Ubuntu Linux
> Install Thunderbird through Synaptic Package Manager
> Configure IMAP (if you want to use IMAP; an alternative protocol is POP: check here) with details as here.
> Put your username as NUSSTU\
and that's it!
Thursday, June 5, 2008
Getting Used to NUS SVU
Finding Properties of the Machine
After logging in, one can run the dmesg command to find what kind of CPU, memory etc is on the machine. For example, on atlas4-c01 I wanted to confirm that it has Intel Xeon Processor as said at the SVU list of hosts and queues. So I ran on the command prompt:
dmesg | grep -i intel -C 1 | less
and received output:
CPU0: Initial APIC ID: 0
CPU0: Intel(R) Xeon(R) CPU E5430 @ 2.66GHz stepping 06
per-CPU timeslice cutoff: 6145.14 usecs.
--
CPU1: Initial APIC ID: 4
Intel(R) Xeon(R) CPU E5430 @ 2.66GHz stepping 06
Booting processor 2/2 rip 6000 rsp 100cfe1df58
--
CPU2: Initial APIC ID: 2
Intel(R) Xeon(R) CPU E5430 @ 2.66GHz stepping 06
Booting processor 3/6 rip 6000 rsp 10037e13f58
--
CPU3: Initial APIC ID: 6
Intel(R) Xeon(R) CPU E5430 @ 2.66GHz stepping 06
Booting processor 4/1 rip 6000 rsp 10006989f58
--
CPU4: Initial APIC ID: 1
Intel(R) Xeon(R) CPU E5430 @ 2.66GHz stepping 06
Booting processor 5/5 rip 6000 rsp 100069c1f58
--
CPU5: Initial APIC ID: 5
Intel(R) Xeon(R) CPU E5430 @ 2.66GHz stepping 06
Booting processor 6/3 rip 6000 rsp 100069f7f58
--
CPU6: Initial APIC ID: 3
Intel(R) Xeon(R) CPU E5430 @ 2.66GHz stepping 06
Booting processor 7/7 rip 6000 rsp 1042142df58
--
CPU7: Initial APIC ID: 7
Intel(R) Xeon(R) CPU E5430 @ 2.66GHz stepping 06
Total of 8 processors activated (42672.12 BogoMIPS).
So this machine has 8 processors. On Intel site I found that E5430 has L2 cache size of 12 MB, which is more than the 8MB in my office desktop Intel Core 2 Quad with 4 processors.
dmesg command didn't work on cougar1 and cougar2 when I tried.
Updated on Feb 5, 2011: To find the architecture of your machine, use "uname -i".
Useful Commands To Submit Jobs
Following are some useful commands:
bsub -q mcore_parallel_test -m multicore -n2 "./a.out > a.output"
bjobs
bpeek
bqeueues -l
Further links on the b commands: www.cisl.ucar.edu/docs/lightning/lsf.usage.ppt http://www.nus.edu.sg/comcen/svu/techinfo/unixcom.pdf
Running your executables on SVU machines
I tried running some executables built on my machines on SVU machines. Unfortunately since the versions of libraries on SVU are different from those on the built machine, I faced problems. First, the version of python I used on my machine is different from that on the SVU machine "atlas3". It had no "subprocess" module which I was using for forking a process.
I am currently stuck with "/lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by ./libtbb.so)". Lets see how it turns out.
Installing Subversion (svn) on Linux without Root Privileges
I went to a number of searches on this topic, but finally the following worked for me:
1. download the latest subversion source from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260&expandFolder=74
2. also download the deps (dependencies) source
3. untar both these using tar -zvxf in the same directory
4. run ./configure --with-ssl --enable-shared
The last option is needed, otherwise your build will fail (for more details see http://subversion.tigris.org/faq.html#relocation-against-local-symbol)
5. make
and now the subversion binary is ready. You can run it from bin directory. Set your PATH environment variable accordingly in .bashrc.
Friday, May 16, 2008
Improve your code by using boost::transform_iterator with STL map and multimap
No worry, you can return a boost::transform_iterator. boost::transform_iterator is a useful tool to transform the value of the iterator while dereferencing it. The most common use of boost::transform_iterator is in the situation described above, although it is more general. For using boost::transform_iterator as above, you will need functions select_first and select_second as implemented here.
Always cheers while coding in C++!
Tuesday, April 29, 2008
Fixing Some Vista Woes
I login as an Administrator, go to Control Panel > Administrative Tools > Event Viewer. Event Viewer > Application shows several errors - most related to vmware. Event Viewer > System also shows some errors. I will need to track these errors from now on.
To my surprise Event Viewer > System shows several error events (to view just error events, Menu > Action > Filter Current Log) which could be significant:
- The file system structure on the disk is corrupt and unusable. Please run the chkdsk utility on the volume OS. Such events were raised at 2 AM (probably after some system process executed) on 30 April 2008.
- The device, \Device\Ide\iaStor0, did not respond within the timeout period.
So I took the following steps:
- I ran chkdsk on my disks. As I expected there are no errors detected.
- For the iaStor0 issue, saw http://www.intel.com/support/chipsets/imsm/sb/cs-025783.htm. I am wary of installing new things unless needed. So I will wait for Vista to hang again before I try to fix the issue.
Wednesday, April 23, 2008
How I Formed an Excel Sheet of Students in the Course I am Tutoring
1. Go to IVLE to get the list of students in one page. Save this page.
2. Clear out the irrelevant lines.
3. With vim, query replace the ";" with "\r" newline, or whatever else to get "name, Metric No" list. The useful commands are:
%s/ /\r/gc
%s/.*userID=\(.*\)' , 800 , 600)">\(.*\).*/\1,\2\r/gc
:%s/.*t.*/\r/gc
:%s/^\n//gc
4. Import this data into excel.
Thursday, April 3, 2008
Ubuntu: Get Wireless Working After Hibernate
sudo /etc/init.d/networking restart didnt work for me.
Later I found that:
sudo /etc/init.d/dbus restart worked. But I am afraid it might be risky to do it everytime since it restarts a very low level process (though I am not an expert on this, and have no right to say it might be risky or not).
So as stated in this forum I edited the services that are shut down on hibernation. Have to see how it works out!
Wednesday, March 19, 2008
Eclipse does not use User's Environment Variables on Linux
Getaround tried - I changed the eclipse driver file in the same way as firefox uses firefox-bin.
amit@ubuntu:~$ cd /usr/bin
amit@ubuntu:/usr/bin$ sudo mv eclipse eclipse-bin
Password:
amit@ubuntu:/usr/bin$ sudo vim eclipse
amit@ubuntu:/usr/bin$ sudo chmod 755 eclipse
BUT IT DID NOT WORK.
Finally I had to enter environment variables manually into the eclipse CDT dialog.
Saturday, February 9, 2008
C++: Forward Declarations and Typedef
A.h:
class FwdDeclared;
----
B.h:
class Defined {
...
};
typedef Defined FwdDeclared;
----
This is not allowed in C++ [see GOTW: 034]. The GCC compiler complains: "error: Conflicting declaration". I need to look for the rationale for this language behavior. The workaround is to use "typedef Defined FwdDeclared" in A.h too - which means you're not forward declaring the typedefed class at all. I am looking for a better way to do this.
Tuesday, February 5, 2008
Installing MPICH2
mpiexec.exe -n 1 MPICircuitSAT.exe
would not run complaining "Unable to connect to port 8676 ... No connection could be made because the target machine actively refused it." Update: Later I figured this is the error when smpd.exe is not running. Start smpd.exe using
smpd.exe -start
I then did
smpd.exe -install
in
"Aborting: Unable to connect ..."
Thursday, January 31, 2008
WxWidget Linking Woes
Link errors while using WxWidgets were resolved using stuff at: http://www.soe.ucsc.edu/~agames/wxogl.htm
Some other link errors are still left :(
Updated on Feb 8, 2008:
The link errors I was getting were related to unresolved symbols:
- wxFrameNameStr
- wxApp::Initialize
I was able to fix these today after much hue and cry, after I built the sample projects in the wxWidgets/samples directory. I copied the VC++ settings from these samples to my project. Indeed my settings were quite a lot different from that used in samples - preprocessor definitions, system type: (I was using console in place of windows), linked library names.
Anyway, all is well that ends well. Lesson learnt: Look for samples of compilation using a downloaded open source library first, before getting stuck with a compilation problem.