IAYM continues…

lecture room
The auditorium

Today is 23rd June 2009, the programme has almost reached to its end. The students have almost completed their preparations for their presentations.
Today, there was a small change in the schedule. Instead of the daily lectures of 9:30, students were shown an interesting movie, called ‘Flatland’. The movie was an animated & fantastic story of figures of dimensions. It showed the conflict between dimensions.
The motive behind the story wass ‘The things you cant see, doesn’t means that it do not exist’.

After that there was a  tea break, then there was supposed to be a lecture
by Prof. Sanjay Jain on ‘Origin of Life’ at 10:30, but due to some reasons it was postponed to 11:30. Prof. Jain is a physicist working at the National Physics Laboratory, New Delhi. Prof. Jain talked about the evolution of life on earth, that is the first single-celled organism. He talked about the internal structure and the chemical composition of a cell or a bacterial cell specifically. The lecture was very informative and interesting though it stretched a little lot.

After his lecture, their was the lunch break. From 1:30 students  followed their daily routine…

As the day followed a changed routine, the enthusiasm increased to a lot. Moreover, when the students left to their homes, they shall think, ‘Is there a 4th dimension?’- Flatland


To be continued….


IAYM(Inviting All Young Minds)

IAYM(Inviting All Young Minds), is an initiative and a summer internship programme undertaken by Mathematical Sciences Foundation, a non-profit organization, for the students of college and school level.MSF has been in existence from 1997, though it was formally established in year 2002.

Since then, the foundation have been working for the growth and development of Mathematics in the minds of people of each age-grade. IAYM though started informally in the month of April, it started formally on June 01, 2009, at DPS, R K Puram, New Delhi.

The programme invited students from all over the country. The Foundation recieved over 500 invitations from all over the country, but due to the arrangements possible only for few students. So, only 72 students were selected depending on their academic performance and their recommendations.

36 students from college, 36 students from school have been selected.

The outstation students have been provided with hostel facility. Moreover the students who are selected  will also be provided with the stipend of 5000/-, along with the certificates.

The course of the programme have been divided into five major projects, as listed:

  1. Chandrayaan
  2. Search Engine.
  3. Jantar Mantar
  4. Error Correction.
  5. Encryption.
  6. Circumference of Earth.

Depending on the choice and skills of the students, the projects have been allotted to the students. 12 students are working on each project, 6 from school, 6 from college. The programme has completed over two weeks. And the enthusiasm and excitement of the students is increasing day by day. The students are now enjoying the concept and style of teaching, by their lecturers. The students have felt and realized the meaning of true learning and knowledge earning, they have been shown the techniques and ways of learning things practically.

The summer programme is a great success and will yield positive and great results…..

To be continued……

For more information, you may visit : www.mathscifound.org

Games on Linux and How to install


America’s Army is a First Person Shooter (commonly called FPS) created by the United States Armed Forces. It is free to download and install.

It’s not too often you can say you are playing a game put out by the United States Government, but Americas Army is just that. This began not only as a game, but a tool to train future army recruits. The US Army probably didn’t expect the game to quickly explode into a popular online stature though.

The game follows a rather serious theme due to its original and current goals, but it’s also a blast for players who have no desire to join the army. Other similar games on the market cost money while AA is free. But there’s a catch. As of version 2.5, AA was discontinued for Linux and Mac OS X, although it doesn’t seem to affect the training missions or playing with other 2.5 clients. So, this makes it great for a Linux AA clan, or a LAN party.

The game is based on the Unreal 2.5 engine, so you can expect some great graphics and sound. If you have played Counter-Strike, then you already have a good feel of what AA is all about. It’s you, against the terrorist. There is no deathmatch mode, as that is not exactly the goal of the game 😉

Of course, moreso than Counter-Strike, there is a lot of strategy you must execute to be successful. The game is based off what could happen in real life, so it’s not going to be easy. Splinter Cell could be a name brought up, as the stealth in that game would prove useful here. As you can guess, the game is focused around realism, and so you cannot jump in and expect a Counter-Strike or Unreal Tournament gameplay. You must shoot accurately if you want to kill… spray and pray doesn’t really work well here.

This is a great game, no two ways about it. It’s just too bad the developers decided to halt Linux and OS X support.

Get the latest version for Linux from FileFront. Download armyops<version>-linux.run.

Run the file from where you have downloaded

sudo sh ./armyops<version>-linux.run
If Americas Army is already installed, an upgrade match may be available from FileFront. Download armyops-lnx-patch-<version>.run.

Run the file from where you have downloaded

sudo sh ./armyops-lnx-patch-<version>.run
There are multiple ways to execute the program. You can click the application icon that will be in Applications ? Games ? armyops, or you can run it via the command line. Type the following into a Terminal:




A PyGame Working Example: Starting a Game

In PyGame for Game Development, I showed you the very basics of PyGame’s graphical side. However, creating a game with PyGame requires a bit more. All the concepts described before need to be glued together somehow, and new concepts will need to be introduced in order to create a functional game. In this article, we’ll do just that by tackling a working example of PyGame’s capabilities?a Python-powered game.

The Game Plan

Before we jump into Python code, we need to develop the idea behind our game. Nothing complex is needed for our game, since its purpose is just to reinforce the basics of PyGame and demonstrate how to put them to use. With that said, let’s move into the idea. The idea is to have the player at the bottom of the screen with the ability to move horizontally. Horizontal movement will be required to dodge incoming objects that will constantly be hurled at the player at fast speeds. Picture the player as a ship having to navigate at high speeds (which will be essentially an illusion, since the player will not be moving vertically; the incoming objects will) and dodge mines or enemy ships.

However, to give it an added degree of complexity and to make it more dynamic, levels will be stored as Python objects. Each level object will be responsible for loading the required images and laying them out in a layout list. The layout list will contain many more lists as elements that correspond to rows of objects. So, for example, picture a layout list as looking something like this:

[[0, 0, 0, 0],

 [1, 0, 1, 0],

 [1, 0, 1, 0],

 [1, 0, 1, 0],

 [0, 0, 0, 0]]

A zero would be mapped to a blank space, and a one would be mapped to an object of some sort. The result would look something like this, to draw a very rough sketch with gridlines for visibility:

The green block represents the player, and the red blocks represent the objects that the player is required to dodge. We would simply have to move the objects down and see if the player has collided with any of the objects.

Of course, since the levels would be generated by Python classes that determine what the images are and how they are positioned, levels would not be limited to the mine-dodging scenario I presented earlier. You could have a fish dodging sharks or a spaceship dodging asteroids if you felt inclined to do so.

Also, it’s possible to create random object layouts or images using this method. This way, levels could be different each time they are played.

 A PyGame Working Example: Starting a Game – Preparing a Level

Let’s start by making a level and building the game around it. The idea is to create the level out of an object that loads the required images and returns the layout list described in the last section. Before we do that, though, let’s create a class from which all level classes can be derived. That way, we can organize things a bit better:

class Level:

   def getPlayer(self):
   def getObjects(self):
   def getLayout(self):
   def getBackground(self):

Save the script as levelbase.py.

With the actual levels that come from the Level class, our game will be concerned with four methods: getPlayer, getObjects, getLayout and getBackround. The first method will be responsible for returning the player’s image. The second method will be responsible for returning a list of the images of the objects involved. The third method will be responsible for returning the layout list. The final method returns the background image, but it will also need to return the number of rows visible on the screen at a time. This way, we can divide up the background and figure out how long each space will be. The width of each space will be determined by measuring how big the first element (which will be a list itself, of course) is inside of the layout list.

Each element of the layout list will be a number. Zero will represent a blank space, and one and above will represent objects. These objects will be based on images obtained from getObjects, but since the list index will start at zero, we’ll have to subtract from each of the elements in getLayout to obtain the proper image. So, to express this in more basic terms, a value of 1 in getLayout would correspond to the first object in getObjects (0), and a value of 2 in getLayout would correspond to the second object in getObjects (1).

A PyGame Working Example: Starting a Game – Creating a Level

Now, we’re ready to create a level for our game. Name this asteroid.py:

import levelbase
import pygame

class Level(levelbase.Level):

   def getPlayer(self):
      return pygame.image.load(‘ship.gif’)
   def getObjects(self):
      return [pygame.image.load(‘asteroid.gif’)]
   def getLayout(self):
      return [[1, 1, 1, 1, 0, 0, 1, 1, 1, 1],\
              [0, 1, 1, 0, 0, 0, 0, 1, 1, 0],\
              [1, 0, 0, 0, 0, 0, 0, 0, 0, 1],\
              [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\
              [0, 0, 0, 0, 1, 1, 0, 0, 0, 0],\
              [1, 1, 0, 0, 0, 0, 0, 0, 0, 0],\
              [1, 1, 1, 0, 0, 0, 1, 1, 0, 0],\
              [0, 0, 0, 0, 1, 0, 0, 0, 0, 1],\
              [0, 0, 0, 0, 1, 0, 0, 0, 0, 0],\
              [1, 1, 0, 0, 0, 0, 1, 0, 0, 0],\
              [1, 1, 1, 0, 0, 0, 0, 0, 0, 0]]
   def getBackground(self):
      return pygame.image.load(‘background.gif’), 5

As you can see, we simply return the required images, along with the layout list and the number of rows that will be visible at once. This particular level goes with one of the ideas I described above: a spaceship dodging asteroids. the images that the level references could be got from the full download.

Notice how the background is not solid, but, rather, it’s an image. Because of this, we can’t simply erase a sprite by drawing a solid-colored Surface object over it. Instead, we have to get the original background image that the sprite replaced and then draw it over the sprite. Thankfully, this is very simple, and we’ll look at how it’s done later on.

A PyGame Working Example: Starting a Game – Sprite Definitions

Next, we’ll need to define the classes for player sprites as well as object sprites. Since the player sprite has no ability to move vertically, it will only have to be moved by its x-position. So, the player class’s update method will only need to accept the amount its x-position needs to move. Likewise, because objects will have a static x-position, the object class’s update method will only need to accept the amount to update the y-position. Also, our game will move objects by their center positions, not by their upper-left corners. We’ll use centerx and centery rather than x and y.

import pygame

class Player(pygame.sprite.Sprite):

   def __init__(self, image, xCenter, yCenter):


      self.screen = pygame.display.get_surface().get_rect()
      self.image = image
      self.rect = self.image.get_rect()
      self.rect.centerx = xCenter
      self.rect.centery = yCenter

   def update(self, xAmount):

      self.rect = self.rect.move([xAmount, 0])

      # Check to see if we have gone offscreen
      if (self.rect.x < 0) or (self.rect.x >= self.screen.width):
         self.rect = self.rect.move([-xAmount, 0])

class Object(pygame.sprite.Sprite):

   def __init__(self, image, xCenter):


      self.image = image
      self.rect = self.image.get_rect()
      self.rect.centerx = xCenter

   def update(self, yAmount):

      self.rect = self.rect.move([0, yAmount])

Save the script as gamesprites.py. We’ll import it as a module when we need to create the sprites for our game. The Player class accepts three arguments when it is initialized: the player image, its center x-position and its center y-position. Note that the player image will already be loaded onto a Surface object by the level, so there’s no need to load it again. The Object class only accepts two arguments, the object’s image and the center x-position. Since all objects will start at the top of the screen, there’s no need to accept any y-position. The update methods simply accept the amount the sprites need to move, with each class moving in a different direction, as described before. Additionally, the Player class checks to see if the sprite has gone off the screen. If it has, we undo any movement to put it back on the screen.

The Internals

The functional code of the game will make up its own module, and related Python instructions will be grouped into the module’s methods. This is so we can customize the game later on by importing the module, calling whatever methods we need to call, and passing whatever level we want to play rather than modifying the internals of the game. Using this method of organizing the game, it’s possible to add extra features such as a menu rather than limiting it to one game. This also allows us to create custom “Game Over” or success screens rather than relying on a generic one or modifying the internals to create a more specific one. We could also create either a linear or semi-dynamic campaign by going this route.

 Click here to download the document.———-  A PyGame Working Example

inter-connectivity problem in ubuntu

I got an Internet connection from BSNL  i.e a WLL connection..

and this was the steps which i  should perform to connect to internet in ubuntu 8.04


Prerequisites: A BSNL Fixed Wireless Phone with a serial to USB cable, with internet access enabled on that phone. Install the wvdial and pppd packages if they are not already installed.
General Information: With the above mentioned phone, current package available for internet access is Rs. 250 per month for unlimited access (March 2008), however, the phone is blocked while internet is used. It is a good idea to be as close to the BSNL tower/exchange to get good data transfer speeds.
Actual Configuration:
1.Plug the USB cable in to one of the USB sockets of the computer. Remember which socket the cable was plugged into.
2.Run the command

sudo wvdialconf

3.Edit /etc/wvdial.conf (with sudo) to look like the following file:

[Dialer Defaults]

Init1 = ATZ

Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

Init3 = at+crm=1;+cmux=1;+cps=33;+cta=0

Modem Type = Analog Modem

Baud = 115200

New PPPD = yes

Modem = /dev/ttyUSB0

Idle Seconds = 90

Auto Reconnect = off

ISDN = 0

Phone = #777



4.Please see to it that the settings in the AirTone800 phone are also for 115200 baud, if they are not, then no connections will be made.

5.Please add in the /etc/sudoers file in the section a line like

# User privilege specification

username machine_name = NOPASSWD: /usr/bin/wvdial, /usr/bin/killall

on my machine, this line looks like:

moz t64c = NOPASSWD: /usr/bin/wvdial, /usr/bin/killall

The above line allows the use of wvdial and killall commands as sudo without asking for a password.

6.At a command prompt, type wvdial to connect to the internet. You should see an output like the following. Please note that “Caught signal 2: Attempting to exit gracefully…” line comes after pressing Ctrl+C to disconnect from the internet.

moz@t64c:~$ wvdial

WvDial<*1>: WvDial: Internet dialer version 1.56

WvModem<*1>: Cannot get information for serial port.

WvDial<*1>: Initializing modem.

WvDial<*1>: Sending: ATZ

WvDial Modem<*1>: ATZ

WvDial Modem<*1>: OK

WvDial<*1>: Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

WvDial Modem<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

WvDial Modem<*1>: OK

WvDial<*1>: Sending: at+crm=1;+cmux=1;+cps=33;+cta=0

WvDial Modem<*1>: at+crm=1;+cmux=1;+cps=33;+cta=0

WvDial Modem<*1>: OK

WvDial<*1>: Modem initialized.

WvDial<*1>: Sending: ATDT#777

WvDial<*1>: Waiting for carrier.

WvDial Modem<*1>: ATDT#777

WvDial Modem<*1>: CONNECT

WvDial<*1>: Carrier detected. Waiting for prompt.

WvDial Modem<*1>: ~[7f]}#@!}!/} }3}”}&} } } } }#}%B#}%}’}”}(}”g}(~

WvDial<*1>: PPP negotiation detected.

WvDial<Notice>: Starting pppd at Sun Mar 23 10:14:55 2008

WvDial<Err>: Warning: Could not modify /etc/ppp/pap-secrets: Permission denied

WvDial<Err>: –> PAP (Password Authentication Protocol) may be flaky.

WvDial<Err>: Warning: Could not modify /etc/ppp/chap-secrets: Permission denied

WvDial<Err>: –> CHAP (Challenge Handshake) may be flaky.

WvDial<Notice>: Pid of pppd: 6006

WvDial<*1>: Using interface ppp0

WvDial<*1>: local IP address

WvDial<*1>: remote IP address

WvDial<*1>: primary DNS address

WvDial<*1>: secondary DNS address

Caught signal 2: Attempting to exit gracefully…

WvDial<*1>: Terminating on signal 15

WvDial<*1>: Connect time 5.8 minutes.

WvDial<*1>: Disconnecting at Sun Mar 23 10:20:51 2008

7.If you would have another shell prompt open where you run the tail -f /var/log/messages command, then you should see an output similar to:

moz@t64c:~$ tail -f /var/log/messages

Mar 23 10:14:55 t64c pppd[6006]: pppd 2.4.4 started by michael, uid 1000

Mar 23 10:14:55 t64c kernel: [ 428.560949] PPP generic driver version 2.4.2

Mar 23 10:14:55 t64c pppd[6006]: Using interface ppp0

Mar 23 10:14:55 t64c pppd[6006]: Connect: ppp0 <–> /dev/ttyUSB0

Mar 23 10:14:59 t64c pppd[6006]: CHAP authentication succeeded

Mar 23 10:14:59 t64c pppd[6006]: CHAP authentication succeeded

Mar 23 10:14:59 t64c kernel: [ 432.128610] PPP BSD Compression module registered

Mar 23 10:14:59 t64c kernel: [ 432.175440] PPP Deflate Compression module registered

Mar 23 10:15:03 t64c pppd[6006]: Could not determine remote IP address: defaulting to

Mar 23 10:15:03 t64c pppd[6006]: local IP address

Mar 23 10:15:03 t64c pppd[6006]: remote IP address

Mar 23 10:15:03 t64c pppd[6006]: primary DNS address

Mar 23 10:15:03 t64c pppd[6006]: secondary DNS address

Mar 23 10:20:51 t64c pppd[6006]: Terminating on signal 15

Mar 23 10:20:51 t64c pppd[6006]: Connect time 5.8 minutes.

Mar 23 10:20:51 t64c pppd[6006]: Sent 134918 bytes, received 511250 bytes.



the problem which i faced was..

ahmed@ahmed-desktop:~$ wvdial
–> WvDial: Internet dialer version 1.60
–> Cannot open /dev/usbdev2.1_ep00: Permission denied
–> Cannot open /dev/usbdev2.1_ep00: Permission denied
–> Cannot open /dev/usbdev2.1_ep00: Permission denied


please help me in this…

 i m not getting the way, how to detect the specific usb port.. and how read the data interface through that…!!!