16 Ağustos 2009 Pazar

Gsoc 2009 is almost over !

As some of you may know the GSOC 2009 is going to be over. The code writing is over and some little formal things are remaining to pull the final trigger. As i posted in my previous posts i contributed to Func project this year as i did last year. Here are some of the items i added to Func that year :

  • Facts Framework - a different way to query more things on minions at once
  • Groups Api - new pluggable func groups api
  • Grep Modules - Query modules for a proper pattern
  • Real Time Output - Watch your minions output while they do their jobs.
  • Progress Report - Get progress report of your minions easily.
  • And many other small fixes and additions.
It was a great experience for me, thanks Func and of course many thanks to Google :) Probably that was my last GSOC and it was really fun to work on Open Source projects and get payed.

30 Nisan 2009 Perşembe

Using GWT with Django

Well i tried GWT a few days ago and liked it very much. I'm not a js expert and for that reason dont use it too much in my web applications. But from time to time i need some fancy client-side apps to do ajaxian stuff easily. I had written an Independent Django app which was an ajax-driven event calendar. Therefore i did most of the work remotely via Django. I used jquey for ajaxian calls. But if i were a better js programmer i would do that job with less remote calls. But the Magic in GWT is cool you create your application with Java ; a very cool and easy language and it converts the written code into javascript which is compatible with most of the browsers. Therefore you dont bother with strange behaviour of the js and dont bother about if your code will run on BrowserA or BrowserX.

I followed the tutorial in GWT site and had a running application (StockWather). To complete that tutorial you probbaly would need to complete the StockWatcher firstly and then go on from here or you can just pull the code i wrote for that purpose from here[1] and just inspect it.

For communication of both ends i used XML,if you're not a fan of it you can use JSON also. I didnt use JSON because of the JSNI usage in Java code. I dont like hybrid codes like that...

  1. First create the server side code in Django :LINK
  2. You need to build a GET request in you JAVA code so u do that from here: LINK
  3. Parse the incoming XML string from Django and convert it to JAVA objects: LINK
  4. Write unittests for your client side code (GWT) because if you have errors u will get some strange JS errors which are not so decsriptive. : LINK
  5. Put GWT application in your media and put the generated HTML file in your templates directory.

Well that is all,it took some time to glue both of them (Django and GWT) but we have here a happy end :) GWT is cool but it has some little weird stuffs i dont understand yet. One of them is Designing the applications.I should find
an easy way to explain it to my designer :)

[1]: GWT-Django app

21 Nisan 2009 Salı

GSOC 2009 Again

Well i'm again in the Game :) That summer i will be working on my last year GSOC project FUNC again.Big Thanks to Adrian Alikins(my mentor) for choosing me again. And Bigger thanks to GOOGLE for paying us to do open source programming. If you hear for the first time FUNC,it is a great Remote management Framework for doing things reamotely easier. You can even open your shell and do management by playing with its Python API. My aim that time is to make that cool API even more cooler.Here is the list with ideas :
  • Implementing Func Facts : Wouldnt it be cool to say func update machines that are ">f9" or list the machines with dual core cpus. That is what func facts claims to be an ORM like remote querying system.
  • Implementing a Pluggable Connection Manager for Func :Well that is kind of hard one, currently he FUNC is using XML-RPC over SSL. The aim of that item is to make Func to support different connections by reading its conf files. The first connection to be implemented seems to be qpid/AMQP/qmf. After having the pluggable structure it will be easier to add different connections i hope.
  • Structuring the Results : Currently FUNC recieves different kind of results in different formats. Having a way to query and process that result without too much loops will be realy great.
  • Funcweb Development : Func has a Web interface fo doing all the stuff visually,so new features should be added to that cool app.

I hope to finish all the stuff succesfully again like last year. (INSH ;))

17 Mart 2009 Salı

Ajaxian Even Calendar on Django

That is an independent small app that can be useful for others that need some calendar and want to show some events on it. I couldnt find any django calendars which are ajaxian out there. Therefore if you need something like that use it, it is completely free. Let me know if you have any trouble with it.

Features are:
- Showing every month with events
- Small and big(excel like) versions
- Adding same event for a couple of days
- Adding lots of events on same day
- Facebox display of events
- Dual language arabic/english

Demo small : Link (on the left)
Demo Big : Link
Source : Link
Static directory : Link

For instalation look at README file in the source.
Have FUN and thanks to ADK for his design help ...

11 Şubat 2009 Çarşamba

Open Source Motivation

Just read the article of Lior Kaplan which is about the things that make us to use or develop opensource projects. Link:

I think these are mine reasons about doing that ;)

- Help other people that may have the same problem as you, so you make your code public or help via ML,IRC and etc.
- Opportunity to learn new things and finding areas to apply them.
- Coding about what you like,the topics you are interested.
- Having the feeling that more can do it better than single, so copy everything that is usable for you and continue from there (DRY).
- Becoming expert in area you like without thinking about it.
- Having a good CV(background) about things you have done, talks is cheap i'm showing the code.
- Having the opportunity to start own business without paying anything, you just need the idea
- Working together than alone is more fun.

Btw, i think people who are payed to work on opensource projects are really lucky :) Hope to be one of them ...

29 Ocak 2009 Perşembe

I wrote one use mine !

That is the story about a little and probably useless software i wrote. Everything began in 2007 during my internship in Pardus. Pardus uses pisi (a Python based package manager) and pisi doesnt have any sign/verify mechanism (still doesnt have) to secure package transmission. Well we all decided it would be cool to make the verification process via X.509 certificates so we can have more info about signer and etc. And everything began, i started designing the app. The idea was simple we have a package we sign it via X.509 and put the signature in package an send to users for installation. User has on other site a db with trusted certificates, he/she extracts the signature checks if the cert is trusted. If the cert is good to use user computes the hash of all files in package and compares with hash that is in the signature. Simple yes ...

The implementation part was not so easy for me. I heard that there is a Python package for handling SSL things called Python OPenSSL. I was excited it was my first Open Source program but pyOpenSSL didnt have all my needed classes for certification handling, signing and verification parts (if has man i dont know). Than i found M2Crypto it had some ugly Python code and bad exception handling but had all the cool features i needed. And the 'imzaci' was there an alpha verison maybe, it didnt have a code base i was proud of. The application was not accepted by Pardus members and none asked me about it to make it better or to fix sth. Everyone was silent , man probably i wrote the ugliest program in the world if none says sth :)

I thought it was the way how Open Source works. (People can think about things they have experinced) Well Open Source code development doesnt work like that believe me. People discuss,fight,share,apply patches that is the world i was imaging from the beginning. However i didnt make a good start :) The GSOC2008 and FUNC project showed me that secret and cool Opensource World.

Well lets return to our little useless application, after GSOC2008 i have rewritten most of the code maybe better maybe worse i dont know. I changed its name it is not imzaci anymore it is pysign and it is an independent (no written for specific distro) application. Why i have rewritten the program ? I wondered if i became better after those years. Well the code is here [1] and you know what it was not fun to write it. If someone is going to write an app similar to that one please look at my code maybe you can grap some part of it. I wrote it once dont do it again :)

Ok what is the point :) The point ;is it is very very very important to choose community you are going to contribute. Please before you join look at mail listing conversations, look at documentation of project or community has. The start is very important and if you have luck you will be in a place where people respect every bit of your code. That is the Open Source world i was looking for and found at the end :)

There are two kind of programmers, good programmer gets the old code fixes it (if possible) and completes the job in less time, bad programmer writes all the code from scratch (maybe worse than first programmer). Be the good programmer i wrote it dont repeat yourself :)

[1] http://github.com/makkalot/pysign/tree/master

20 Ocak 2009 Salı

Django Admin ManyToMAny Behaviour

In that post want to share an experience with a Django behaviour that took all my day to solve it. In nowadays , i'm working on a freelance project and trying to finish project due to deadline (hate deadlines). Here is the small part of models i'm using

class SchoolSection(models.Model):

class GalleryItem(models.Model):
school_section = models.ManyToManyField(SchoolSection)

A pretty easy structure , the problem occurred when i connected the post_save signal to a method which was using the models above. When a new GalleryItem was saved i wanted to pre-populate some xml files according to new commers. Here is the simple code that was pulling the gallery items :

gi = GalleryItem.objects.filter(school_section = sc[0])

When i save an object i was not able to see the new added in query above. When i saved the object second time (edit->save) the new entry appeared. In a moment when i was going go crazy someone from #django channel told me that Django doesnt save the m2m relationships immediately due to performance issues. Therefore the solution was to override a method in admin part , here is the solution :

class GalleryItemAdmin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
super(GalleryItemAdmin, self).save_model(request, obj, form, change)

That is all, hope to help someone who has the same problem :)

4 Ocak 2009 Pazar

import makkalot

Hello planet and thanks for adding me.