Archive for the ‘python’ Category

PekWM, its whats for breakfast!

Thursday, October 12th, 2006

I have been trying to get a package built for fedora for pekwm. PekWM is a nice light weight window manager for X-11. I decided to give it a shot using it because it supported dynamic menus. I built a package and filed a bug report so it could be included in fedora extras. After my first couple of comments it was suggested to me to create something more fedora friendly for my package. As it is the default menu provided by pekwm has a lot of apps in it. I didnt even have 1/2 of them my self. This was a minor problem to provide a package to a user who in turn cant use 1/2 of whats in the menu. It doesnt take an expert to figure out that bugs would be filed about things “not working”. I decided to take the code from fluxbox-xdg-menu and fork it to work for pekwm. After about an hour or so of hacking I removed all the unneeded stuff from its code base and had a fully functional dynamic menu generator using standards. Tonight I plan to repackage pekwm and post an updated .spec file and src rpm. I hope that by the first of next week I will be commiting pekwm to fedora extras cvs.

Google hosting for t3h win!!

Wednesday, September 27th, 2006

Many of you may not know that google is now offering project hosting. This is great. I have been needing svn access for a project I work on, and this made it simple. I just went and filled out a short form and started using the service. Thanks google 🙂

Making a button inactive using PYGTK + GLADE

Sunday, October 2nd, 2005

I have been working on a little app in my spare time. It is for calculating your GPA. Its nothing special, I have even made a similar app in Java as an assignment in class. This app has (at the time of this writting) only 3 buttons. An “add” button, a “calculate” button, and a “quit” button. I decided I wanted to make it so once you hit calculate you could not press add or calculate again, this will prevent you from adding the same info to the display once it has been calculated (with out selecting something from the file menu to reset the form). I searched all over the net and couldnt find anything on how to make this happen but some of the wonderful people in #pygtk were able to help me so I thought I would pass that info along for anyone else.

I made a really simple example to show how this is done with pygtk and glade2. You can d/l the example here. If you have any questions, comments, or suggestions on how I could/should/needed to do this please feel free to comment. I do have moderation enabled for comments so it might take a day or so for it to show but I will allow (and will be open to) any comments that are not spam.

Commenting your code

Thursday, September 29th, 2005

Ok I have been reading and writting a lot of code lately, and one thing that is really pissing me off when I start reading other peoples code is the massive lack of commenting that is going on. It really drives me insane. Whats wrong with taking 1 min of your time as you are writting code to pause and

// this is a comment
/* or maybe this is a comment */
# and maybe this is a comment…
! Maybe even this. Whats it take to get people to comment!?!?!

It doesnt make you cool to not add comments to your code, no one thinks youre a great programmer because you managed to write 1200 lines and not 1 comment in it, it makes you a bit of an a-hole. Im not talking to any one person out there, and if you do comment your code good woot for you, keep it up.

I have been running into a whole mess of uncommented code in the UT2004 video game. It has all this open source stuff where you can make mods etc etc, and thats great and all, but when youre doing code for public projects such as a game mod like this; even if you dont think anyone will look at the code; better guess again, we will reverse compile your code and look what you did to see how it happened so we can make a mod thats similar or maybe even fix a bug in your mod (yep you might have a bug in your mod I know its hard to believe) and reading through 1261 lines of code to find 10 lines that have a comment on them and then only 4 of those 10 are even the slightest bit like a comment (the others are who evers name and date etc) makes it harder to fix your code, or see what youre doing/trying to do. Moral of this rant is to comment your code no matter what your doing!!!!!