Archive for the ‘Programming’ Category

Cool programs

May 7, 2008

Here are some cool programs everyone reading this blog should try out:

Aptana Studio

Best free program to write sites with html, css, php, ruby on rails and even iphone applications

Webots

Best robot simulator. The full program costs around $3000 but there is a free version for the Rat’s life robot programming contest

Robotc

This is the best way to program a lego NXT robot. This is unmodified c with a straight forward interface to inputs and outputs. This is the only program that’s not free (1 month trial) and it’s only $30

Dev C++

The best free all platform program to write c and c++ code

Autostitch

Best (free program) for making panoramic pictures from a group of pictures

Linux command shortcuts

November 28, 2007

After a lot of searching online I finally found a way to type a long command (or a series of them) on linux without actually typing it; you just type what you want to do like compile <program name> . What you do is this:

alias <theCommandNameYouWant>=”<TheCommand>”

If you want to add more commands to run at once use a ; sign in between the commands after the equal sign. More information is given in: How to use the alias command

CAUTION: don’t overuse the alias command because you might forget the real commands and try not to use relative addressing unless you have copies of different folders and the stuff in the folders is similar (in that case it is more convenient to go into the folder you want to compile for example and then run the aliased command there).

UPDATE: I tried doing what I said in the article and it worked as long as I don’t shutdown my computer. For some reason it doesn’t remember the alias. What you have to do is get to the .bashrc file in your user folder and type it there. In Red Hat Linux the file is in the user folder but it’s hidden so you have to “unhide it” before being able to see it. If anyone has any information about why linux doesn’t remember the alias or where to find the .bashrc file in other linux versions please write it down in the comments.

Getting address of variable in class

November 3, 2007

Today I tried to find out what was the problem with a CA program I was writing in c++ after the compiler gave me the following message: caArray is undefined. I was trying to pass the address of an entry in the caArray as a return value for a function. Other classes that modified the caArray didn’t give the error so I wasn’t sure what was happening. After some time I checked the definition and it was written just like the equivalent c definition but with the class name in front:

int <class name>::*<function name> 

But it should be defined like:

int *<class name>::<function name>

I know this seems like a stupid mistake for a c++ programmer but it might be a problem for someone starting with c++ from c, especially with the fact that the error message doesn’t say the definition is wrong.

Google’s top ten videos

September 27, 2007

Here is a list of the ten google videos of 2006 chosen by Google’s Research blog.

Scientific linux

September 25, 2007

After being recommended to use scientific linux I decided to find out more about it. After looking for it in wikipedia I found out that it is based on Red Hat Enterprise Linux, so I’m pretty sure it’s going to work when compiling avida as described in my previous post. Another good thing about it is that it’s free and it has the same windows like interface as Red Hat Enterprise. If you are not into c++ developing or hacking I recommend Ubuntu Feisty Fawn. They mail you the installation CD for free and the CD has “a lot” of rpm packages (like intall programs in windows). If you download a package and you need dependancies, just put the CD in and it downloads the dependancies for you! You don’t have to download them from the internet.

You can find more about Scientific Linux at:

https://www.scientificlinux.org/

Compiling Avida in windows (sort of)

September 23, 2007

I’m actually using Linux Red Hat Enterprise 5, running inside the program VMware running in windows.

Here is some info about Avida.

What you’ll need: any of the vmware versions (they have free ones on their website), a version of red hat linux that is higher than Red hat 5.2, the file avida-1.3.1 from this site and the file gcc-2.95.3.tar.gz from one (any) of the mirror sites in this site.

Instructions: install vmware and then install red hat linux in it. There are lots of tutorials on how to do it and it’s not that hard. The version of linux that you can use has to be from Red Hat or something really close to it like Fedora and scientific Linux (I haven’t tried the last two) because we are just going to change the version of the compiler  so the rest of the c, c++ in the linux version you are using has to be close to what they used originally in Red Hat 5.2.  I used Red Hat Enterprise 5. After installing go to this site (the same one as in my previous post) and follow their instructions up to and including section 4.2. After that save the avida-1.3.1 folder (untarred) in a folder of your choice, go to it in the shell window, go to the source folder and type:

PATH=/opt/gcc-2.95.3/bin:$PATH [space]

CC=/opt/gcc-2.95.3/bin/gcc ./configure

If you got a permission denied error even if you are signed in as root, type the following line and then try again:

chmod -x configure  

Then type:

PATH=/opt/gcc-2.95.3/bin:$PATH [space]

CC=/opt/gcc-2.95.3/bin/gcc make

After that although the installation instructions in the folder say that you have to type make install, all you need to type is: ./avida in the source folder to run the program. That’s all there is to it.

 

Success!

Rare site about hacking and alife

September 21, 2007

www.romanpoet.org is a great website about hacking and other questionable activities including: the “where do you fit in?” diagram and a “data mining” presentation. There is also some hard to find papers by Tom Ray and others. Those rowdy teenagers are at it again!  

Google’s extra search syntax

September 21, 2007

A week ago I went to a talk by Robert Zubrin about his Mars Direct Plan. It was a great talk and I wanted to look at the powerpoint slides again after the talk. So I searched in google something like: robert zubrin presentation and as expected I didn’t find any results. But this week I started reading the book Google Hacks and after 20 pages into it I tried searching for the slides again by typing: “mars direct” “robert zubrin” filetype:ppt. This time I got four sites and the slides were in the third site! And that was just reading 20 pages of this book. I highly recommend it.

Using older versions of gcc

September 19, 2007

Here are some good websites describing how to compile programs using older versions of gcc:

The website below describes how to compile mplayer using gcc 2.96

http://lists.mplayerhq.hu/pipermail/mplayer-users/2001-September/004444.html

Good website about coding in c++ in linux and how to change the gcc to version 2.95.3

http://xlife.zuavra.net/columns/20020316/

I see some other people has problems with newer versions …