Tuesday, November 29, 2011

Run UT2004 on Ubuntu with Wine...

Finally I dumped windows giving a 20gb of disk space just for the sake of it..and living completely on Ubuntu... and working on much more... I started experimenting on wine to run windows application, mainly games.. here is a posted which i compiled for any one unable to run.
  • First install wine windows program loader 1.3 from Ubuntu software center or the synaptic package manager. 
  • load the CD/DVD (and/or) right click on the installation file and Open with> wine windows program loader.
  • continue installation as you do on windows.
  • and to patch up or crack the game installation, the C drive is available in the /home/UserName/.wine folder. 
  • and click on the .exe file to play the game.. sometimes I get this when I start the game.. which is really annoying. 
  • so what i did is, I opened configure wine. Under application > application settings choose add application select the .exe file. which will be UT2004.exe to play Unreal tournament 2004.
  • choose windows version Windows 7.
Exit configure wine and play. this works for me all the time. Counter strike played flawlessly well. Now I am going to experiment on other games, crysis 2 has some problems with my graphic card.

Friday, October 14, 2011

Ubuntu 11.10 booting bug - partial solution


After updating from the natty narwhal (11.04) to oneiric ocelot (11.10)  a serious bug has been encountered. the Ubuntu stops booting in the middle and displays an error message as follows..

waiting for network configuration

*then after sometime...*

waiting an additional 60 seconds for network configuration

*then after sometime...*

Booting system without full network configuration

I hardly know how to handle bugs.. but one suggestion found in the forums was to hit in some commands in the terminal and restart should do the job, that how I could slove it, but keying the entire thing was a pain... so why not write a shell script and run it.

sudo mkdir /run
sudo mkdir /run/lock
sudo mv /var/run/* /run
sudo mv /var/lock/* /run/lock
sudo rm -rf /var/run
sudo rm -rf /var/lock
sudo rm -rf /run/dbus/*
ln -s /run /var/run
ln -s /run/lock /var/lock
sudo reboot

make a file <aNameOfYours>.sh and save it anywhere u can access it easily.. now just go to that directory where the file is located and type...

 ./<aNameOfYours>.sh 

Ubuntu reboots and ready....

Saturday, September 17, 2011

GTK 2.0 with Eclipse IDE in Ubuntu

Started to experiment with GTK programming few days ago after submitting my dissertation. I began with the 'sweet pair' gedit and terminal and ended up referring functions and define in the libraries. eclipse was always good when I used Java, now for more libraries I wanted an IDE to suggest function names. I've worked it out from various blogs and googling, and finally wanted to blog it up.

1. Obvious pre-requisite. you need to have the GTK libraries, and the other dependancies to work it out.
2. Install Eclipse IDE, you can download everything from the Synaptic PM (or) Ubuntu software center.
3. Open project Properties > C/C++ Build > Settings. Under Tool settings - GCC C++ Compiler - directories, Add the following include directory path from files system.

/usr/include/gtk-2.0
/usr/include/glib-2.0
/usr/include/glib-2.0/glib

4. If you are programming in C you could add the above directories in the GCC C Compiler
5. Add the following line in Expert settings - command line parameters under GCC C++ Compiler

`pkg-config --cflags --libs gtk+-2.0`

5. Finally, add the following line in the  GCC C++ Linker - Libraries

/usr/lib/gtk-2.0
/usr/lib32/glib-2.0

Build, Run and start writing programs..

Friday, May 20, 2011

Unreal tournament setup using LAN/ WLAN/ VPN

I know this post is really lame to everyone, but I hope this could be helpful to any noob or a confused guy who wants to setup unreal tournament for multiplayer. I dunno, But i found the options quite confusing. but here are a few steps to help.
  • If u are already in LAN / WLAN, then very good, or else
  • Just install Hamachi for windows XP/Vista/7
  • create / join a network, use password to make it secure.
  • start Unreal tournament, for hosting and playing the game, pick up a good computer among the players.
  • Choose the game type > set the required setting > click on listen.
  • for only hosting the game click on dedicate, this will only start a server and other players can log in.
  • for joining the game, click on join game. select the LAN, this will work if the LAN is setup properly. you can find the dedicated server name on the list, click and enjoy.

Wednesday, March 9, 2011

Writing neat code!

Hey guys.. this post shows or tells how to write a neat piece of code! neat as not in optimisation or fast blah blah.. its about the code looks on the IDE and quite understandable to everyone whoever reads!
  • the IDE (integrated development environment) plays a major role. that's what helps you in present a great code great! i always used JFE (jen's file editor), now in my MSc i need to use Visual Studio 2010 or 2008. i loved the unique feature of visual studio. just copy and paste the entire source code in your documentation file like .doc or .docx it gives a good syntax highlighted format.

  • use specific tab spaces। like 2 ,4 ,8 depending on the length of code. and specify them neatly.

  • use good indentation style. i would prefer BSD KNF style. saves line over silly "{", but i need to add comment at the end of closing braces like "}// end if". and using indentation tabs to 4 or 2 looks pretty good.

  • use good variable-names function-names. the way i prefer variable names is my-Purpose-number-data direction-features example: sonarIn1; crispOutLeft; for small loops u could use a,b,c,d... which are really negligible. : wow.. looks quite long right! yea, i too felt this way when i started programming writing silly a=0, b=0; but writing huge code for 500-1000000 lines. u will need this. and practice this right now.
  • for functions i would prefer something like this.. the first set describes what the function is doing, next describe where is it doing. describing the function name well will give quite an understanding! some times i even prefer the word my this can differentiate easily whats an in-built function and your function. like myprintf() .. this can easily explain things.. as u know the printf function, u could understand what myprintf does. Eg: getSonarReading(), doDefuzzification(), getDOMSingleton().
  • follow the requirement specification for code. different people will need different styles of coding. in one such assignment (case), i was needed to have max limit of 80 characters in a line, which i could do quite well with indentation tabs or 4 or 2.

  • // good comments. the most key part for understanding a code. software engineers say 75% of your source code file should be filled with comments! and rest the code.

  • specify everything in your comment. leave a big green patch over every source code you write. detailing about every single bit you've used from compilers to library, revision version, date, improvements, how to compile, how to run, indentation style, resources,... so on! make sure than any monkey with your code can compile and run it.

some examples of my comments! i feel they r OK!


Saturday, March 5, 2011

Basic debugging hints



Okay, getting to know what your embedded device or program is doing is very much important when debugging. i went through ups and downs to get a good debugging etiquette. in windows or UNIX programming printf() helps really well,
what if there is a while loop and you need to check every point step by step. there another one such thing called the getche(). these functions come really handy when debugging embedded stuff and look into the problem step by step.
  • printf() can really come handy. but while debugging a huge set of inputs its quite hassle to get all the input shooting over the screen. rather than using printf("blah blah ... \n"); you could replace \n with a neat \r. it simple returns the character blinky thing to the start position. voila things look pretty neat now! Some of my screen shots here.

[top] pretty bad stuff.. this could ruin the computational speed of the program. I suffered quite with this. the simulated robot was all going slow.


[top] with the replacement of \n to \r made things look pretty well.
  • even the \a "alarm bell" helps a lot to observe minute things. it never worked in Visual Studio 2010. but works well for UNIX systems.
the getche() is also useful. the functions just sits until the user presses a key. if you could add put these here and there when you are debugging. the actual break point can be observed.


P.S: you will need to #include for getche()

Friday, February 25, 2011

mbed board

I remember those days struggling to write a piece of software on an embedded system, holding a balance scale between cost and hardware experimentation. a microcontroller on a bread board, a programmer which could burn my code, a perfect piece of compiler-linker-programmer. Now things have changed. better prototyping boards are on the loose, one such is the mbed prototyping board, I've loved it since the first I've used it, the best part is you don't have to worry about having a programmer and hit your head to build stuff. Simple stuff. copy and paste the code, you are done!
Having a couple of these at home makes stuff easier.

Sunday, February 20, 2011

begins!

Okay.. Hopefully, i am going to start feeding this blog during my Group project and dissertation as well! Oops, plagiarism! okay lets see! anyways, i can avoid that. the first post will be about flocking a group of robots, we're using the LEGO NXT 2.0 bots, interfaced and programmed in Java. things get more worse, when we use the Vicon system. and My dissertation is about the Fire fighting home robot.

Thursday, February 3, 2011

Lego NXT and leJOS

I've always loved the Logo kits in my childhood.. now they are back with a bang with LEGO NXT, all they have is a 32-bit micrprocesssor, huge memory, 3 servos and loads of sensors to play around. but the programming interface is really child-like with drag n drop, and people are not gonna sit around with that, there comes a new hack, the lego software is replaced by a Java virtual machine firm ware and the code can be written in Java. "leJOS".