Category — Code
Father arrives…..
My father came two days ago from Lagos. After the ceremonial procedures, I got him to show me the state of the site he was working on and the pictures of Amsterdam - he was there for a few days before he came here. My dad gave me his Sony Cybershot camera and also the domain http://shriphani.com . Hence my blog’s residence is here.
I’ve almost finished my essays etc. I think I will be free to work on my web application after that.
I got a mail from Pavithran S. recently. He says that there will be a mukt.in meeting on the 30th at Osmania University’s Astronomy building and I have to make myself visible there. From what I gather on iLugHyd’s forums, there is a meeting on the 30th as well. And the topic….. Rapid Web Applications with Ruby on Rails !!! This will give me the chance to learn more about Ruby and the Rails framework which seemingly is undergoing drastic changes in the soon-to-be released version 2. I tried ROR myself some time back and found that scaffolds don’t work with rails 1.99. Open source software’s biggest drawback is the lack of backward compatibility. I supposed developers have to take backward compatibility seriously. Entire applications need to be rewritten thanks to these huge changes that are incorporated into the new releases.
Dad has a few problems looking at pdf files on his Treo. Seemingly files over 1 MB in size do not appear in full resolution. I have a solution with me right now and I shall put it here in the next post.
I wrote this post right after I woke up and hence my grammar/spelling/ might not be correct.
December 23, 2007 No Comments
NIPL URMS
Well, argo is closed and the URMS that was made on it is pretty much of no use now. I have hence planned to host it on google code. I feel bad whenever I look the work I did on Argo. Well here’s the application I made.
December 12, 2007 No Comments
Filerfox is now hosted on google code
I made a post about my own file manager extension for firefox that would make uploading things easy. I think I am done with the basic UI. Here is the link. I am going to make a new blog for this.
November 9, 2007 No Comments
Poparse
Poparse is a lame attempt to do what gettext does. The reasons why I made gettext are:
1. Getting to know about the gdbm database routine
2. Trying to compete with popular open source software (I won’t do this again).
3. Trying to improve my skills (the most important requirement)
Gdbm is a database routine that allows you to use dictionary methods. I found it after I was pondering about using sqlite3 for this very script (project). I am not too sure if I will continue working on this. Anyway, have a loo:
#import the needed modules
import shlex
import gdbm
dictionary = gdbm.open('dictionary','c')
def voraciousEater(filename):
"""This function saves the msgstrs corresponding to the msgids in a gdbm database
routine named `dictionary`."""
po_file = open(filename, 'r')
po_file_text = po_file.readlines() #We obtain a list of the lines in the po file.
for line in po_file_text:
if line.find("msgid") != -1:
number = po_file_text.index(line)
message_id = shlex.split(line)[1]
value_of_msg_id = shlex.split(po_file_text[number + 1])[1]
dictionary[message_id] = value_of_msg_id
def efficientFiller(filename):
"""This function creates a new po file and fills it using entries saved previously ."""
pot_file = open(filename,'r')
pot_file_text = pot_file.readlines()
for line in pot_file_text:
if line.find("msgid") != -1:
message_id = shlex.split(line)[1]
if dictionary.has_key(message_id):
number = pot_file_text.index(line)
corresponding_crap = dictionary[message_id]
final_string = 'msgstr' + " " + '"' + corresponding_crap + '"' + '\n'
pot_file_text[number+1] = final_string
yield pot_file_text #a very huge output of lists is generated
pot_file.close()
def writer(filename):
output_file = filename[:-1] #create the pot file
outfile = open(output_file,'w')
efficient_filler = efficientFiller(filename)
try:
new_list = list(efficient_filler)[-1] #picking the last list that the yield statement generates.
except IndexError:
pass
for line in new_list:
outfile.writelines(line)
outfile.close
filename = raw_input("Give me the pot file or the po file and I will do the rest: ")
if filename.endswith(".pot"):
writer(filename)
elif filename.endswith(".po"):
voraciousEater(filename)
else:
print "File type not recognised. Ensure that the file ends in .po or .pot"
October 14, 2007 No Comments
Yes.. I am back in action.
I suppose whoever is wasting their time reading this blog must have gotten tired of that very line. Anyway I am working hard on my coordinate geometry script. I also got myself a HP 50g calculator. It rocks to the core. It is amazing. I got it to draw a lot of graphs for me. It comes with minesweeper too !
By the way, I had a look at useless python’s source code page and I could see my name there. Stumped! It is the same script I used to solve that feisty trouble (1st post or 2nd post). As per useless python’s website, I am truly useless
I am working on creating a Pi file filler and a Pot file reader and I have decided to go with sqlite3 to store the msgids. Anyway, more on this later.
September 17, 2007 No Comments


