Wednesday, December 28, 2005

More firefox goodies

Hi there.

So, lately, with the release of Firefox 1.5 some fresh and neat extensions popped up. These two I found out to be very useful:

Performancing - a sweet in-browser blogging platform. How cool is that? If I had it 2 years back, I would'nt have even started to write PyQLogger. It is small, fast, right-where-you-need-it tool, and I am posting this entry with it! Highly recommended.

Foxmarks - a long-awaited bookmarks syncing extension. I use Firefox in 3 places - Work, Home (WinXP), Home (Linux). And in each one I add or remove bookmarks. Keeping them in-sync is essential. And that's what this extension does. It provides with some ftp space to store the bookmarks and syncs/merges/updates the bookmarks. Sweet!

And couple of new sweets from the Greasemonkey front, from persistent.info site, including Color-Coding for labels (very usefull) and more keyboard macros, like 't' for trashing the mail, 'r' for marking mails as read. Nifty!

Firefox still proves to be THE web-platform.
Kudos!

Friday, December 23, 2005

GMail SPAM

This is getting annoying... So far my GMail account was rather spam-free, I was getting around 10 spam a day, and it was all blocked. But lately, this is gone WAY downhill. Each day I find this in my Inbox:

WTF? C`mon Google... With all that brain power... Can't you do something?

Thursday, August 11, 2005

It's alive!

Beleive it or not - the blog is still alive :) The times have been weird lately at my job, and it affects my hobby patterns. But never mind that, let's see what I've been up to...


I'm always trying to keep my finger on the pulse when it comes to fresh technologies and software terms. So when half of the blogosphere started talking about Ruby-On-Rails and AJAX, I had to check it out. All I gathered from the posts is that it's some cool way to create snappy blog engines, and since I was going to work on a project involving web-interace, I decided to give it a spin, and see what's the buzz all about.


First of all - I didn't know Ruby. Basicly, Ruby is another P language, as in Perl/Python/PHP. Less of the PHP, more of Perl, with OO from Python, that's the way I see it. It's a really sweet language, a bit too Perlish for my taste, since I became quite fond of Python's code clarity, but still rather slick. Let's say, if I had to choose from Perl and Ruby a language for some new project, I think I'd choose Ruby. I've browsed through Programming Ruby book, which is awesome, it gives you just the same boos as the Dive Into Python (which actually got me hooked), gathered the basic understanding and moved to Rails.


Apparently Rails is a very neat idea. It's a set of scripts and a library of code, that allows you in minutes (literally!) link your database model and content to code, and display it all very neatly in a browser. It provides a full Model/Controller system, where you stuff all the 'actions' inside the controller, and define table relations in the model. It's all very clean and easy on the typing, and it does save you a lot of time when working on CRUD(CReate/Update/Delete) which is the most tedious task in all DB backended apps.


If you think on taking Ruby On Rails for a spin, I suggest you watch the 10 minute video from Rails Academy, it will really wet your appetite. Unfortunatly amount of time that I had for this project quickly went to shit, and I had to put it in the back burner for now...


What I plan to tackle with next, is my arch-nemesis - JAVA. The language I fear more than death itself. I exagurate ofcourse, but so far, my experience with Java is the same as I have with Physics: we don't like each other. We'll see how it goes...


Wednesday, July 13, 2005

Pyrex Rocks!

In the project I am writing now I need to interface to F-Secure daemon, to scan files for viruses. They provide a very nice SDK to be used with C/C++, but ofcourse nothing for Python.

Here's where I come in :) When you hear words 'SDK', 'library' and 'Python' in the same sentance, the next thing you should immidiately think of - Pyrex
It's a nifty tool that provides you a very Pythonic way to write glue code to different libraries. You define what you want to import from the library, define the API of the exported functions, then create a wrapper class to access those, and it compiles it into a nifty Python extension! All you are left to do afterwards, is 'import my_ext' and use the class from it!
Since in the past I was messing with Perl and XS, I can truly appriciate the beauty of this approch!

Tomorrow I think I'll document the code, make a package and post it to PyPi. Stay Tuned.

Tuesday, July 12, 2005

Python Locks

In the project I am developing right now there is a lot of threading done, and therefor some of the code needs to be protected by Mutexes. So, to save my self from finger-breaking, repetative task of lock aquiring and releasing, I wrote a small decorator (python 2.4) to help me out:
def lock_on(lock):
    def decorator(f):
        def wrapper(*args, **kwargs):
            lock.acquire()
            try:
                result = f(*args, **kwargs)
            finally:
                lock.release()
            return result
        return wrapper
    return decorator

Somewhere globally I have a hash of different mutexes, and when I need to create a critical section around some function, now all i have to do is this:
@locked_on(locks["some_mutex"])
def my_func(self):
    pass
Nifty!

Saturday, July 09, 2005

Unfreezing the blog

Hi there. I think I will be slowly unfreezing the blog now.
The pressure of the exams is dying down, I have some interesting project ideas, and basicly the mood is back :)
Due to the last changes in Blogger API, PyQLogger is broken and will not work (authentication problems). One day I will get to it.


Qt 4 is out now, and it's open source even on Windows. Many great, and appealing additions were made to it, so as soon as the nice folks at RiverBank will get to make PyQt4, i'll rewrite PyQLogger for it.
i've stumbled upon this gem today, and just had to share it. Man I love Python!

# Mandelbrot set
print (lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y,
Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,Sy=Sy,L=lambda yc,Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,i=IM,
Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,
i=i,Sx=Sx,F=lambda xc,yc,x,y,k,f=lambda xc,yc,x,y,k,f:(k<=0)or (x*x+y*y
>=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr(
64+F(Ru+x*(Ro-Ru)/Sx,yc,0,0,i)),range(Sx))):L(Iu+y*(Io-Iu)/Sy),range(Sy
))))(-2.1, 0.7, -1.2, 1.2, 30, 80, 24)
#    \___ ___  \___ ___  |   |   |__ lines on screen
#        V          V      |   |______ columns on screen
#        |          |      |__________ maximum of "iterations"
#        |          |_________________ range on y axis
#        |____________________________ range on x axis

Don't try this at home, kids!


Well, stay tuned, more posts are coming up!

Tuesday, March 01, 2005

Some muttering

I've been off-blog. I know.

Main reason for this: I'm bored. There are several modes for being bored. Sometimes you have nothing to do and no inspiration to do anything. That's really bad. And sometimes, the sheer amount of work you do is so un-interesting, that you still stay bored, although very busy.
That's the state I'm in right now.

PyQLogger had reached the state, where all the fun coding ended, and now the dreadful ton of bugfixing is on my back. But since the interest in the project from outside has went down hill, Xander and me are busy with Real Life (tm) stuff, it just doesn't seem like I'll be able to wrap it up nicely. I know I should, but it became a large project, and handling it alone, with lack of time is really hard.

On other topics:
Lately I've been needing some clone of Google's Desktop Search for Linux. The most serious one seems to be Beagle, and it's REALLY impressive from their demos. Unfortunatly, it works by using DBUS and I haven't been successful in setting it up. That was very discouraging, so I've went to look around and may be try to write my own.
I've took LuPy, which is a partial port of Lucene search engine to Python, and wrapped some classes together. Now I have a full text, fast indexer for my python files. Very nice.
It still looked kinda clumsy to me, so I kept looking around and found this:
Pixies Desktop Search by Matteo Merli. Looks very promising. And although author decided to rewrite the indexer engine (which is very admirable, though hard), it looks like a project that I would be interested to take part in.
I've exchange two mails with the author, and I think i'll get contributing soon.


Yeah. And I love python. Why? Because of this:
Mini TCP server for plain text protocol:

from SocketServer import ThreadingTCPServer, StreamRequestHandler
class ClientHandler ( StreamRequestHandler ):
    def handle(self):
        print "got this from socket: %s"%self.rfile.readline()

server = ThreadingTCPServer ( ('', 7777) , ClientHandler )
server.daemon_threads = True
server.serve_forever()

Now that ROCKS!
Oh. And one last thing, I came across this very nifty Firefox extension called ScrapBook
ScrapBook is a Mozilla / Firefox extension, which helps you to save Web pages and easily manage collections. Key features are lightness, speed, accuracy and multi-language support. Major features are:

  • Save Web page
  • Save snippet of Web page
  • Save linked Web page
  • Organize the collection in the same way as Bookmarks tree
  • Full text search and quick filtering search of the collection
  • Simple Editing of the collected Web page
  • Text/HTML edit feature resembling Opera's Notes

I highly recommend it.

Friday, February 18, 2005

Some crap from college

Ok. Here's something completely unrelated to things I usually write here :)

For one course at my college I was required to write so odd-ass code, and I thought someone would be interested to take a look.
The first thingie is a primitive digital signaturing tool for executable files. It works by scanning the compiled code for a free segment and writes a RSA signed key part that can be verified later, if needed.
The code is on Python script that patches the original program for watermarking, and creates a new script that can be used to verify the watermark. It was an interesting experiment with public-key cryptography and RSA, and was rather entertaining.
Anyway, here's the code. [link]


The second thing is an alternative for GNU's Gettext program. It scans the source code of C/C++ program and extracts all the strings, and prepares the source code for automatic translation. There were 3 versions of this program.
First was a fun one, coded in Python, where I used Finite State Machine method. It worked flawlessly but was immensly slow because I used char-by-char processing of the text, which was totally un-efficient.
Here's the [code].
Here's the FSM's [code].
Here's the diagram of the FSM: [picture].

Second was a rewrite, without any FSM, using regular expression. This one was extremly fast, but later found out that Python's regex engine is very weak, and crashes horribly on deep recursions in the expression. That was very discouraging, since I became a real Python fanatic and that was disappointing.
Here's the [code].

The last version was rewritten in Perl with basicly the same code - but it worked twise as fast and didn't crash at all! Odd stuff...
Here's the [code] :)


All this was probably a total waste of your reading time... But it's my blog so... Stuff it! ;)

Tuesday, February 08, 2005

New centralized logging

Ok, this was due for quite a while now... Anyhow, as you can see on the screenshot, we now have a foldable panel with all log messages from the program. The debug message level can be controled from the settings dialog.



Oh, and btw, this concludes my list of TODOs! And this means one thing - I'm wrapping things up. Time to get this baby polished and shrink-wrapped.

Monday, February 07, 2005

PyQLogger update dose

New UI for main screen


Here button text is not shown, and you can see the status bar.

Now apparently, some people like text under buttons, so now it's possible to enable it as well:

Here you can see the text under the buttons, the status bar is hidden, together with the panel with the posts (it's collapsed to left side)

I'm still not quite sure I like this new design, but i'm getting used to it. In other news, three new plug-ins were created:

  1. Code paste plug-in. Using code2html program, you can now paste colored source code
  2. reST plug-in. Since it's a python program, and there are lots of Python freaks who like blogging in reStructuredText format, I've whipped a quick plug-in that works with it as-well.
  3. Textile tags plug-in. As a test for 'Menu plug-in' type, i've made this puppy, which helps me write Textile text by providing almost the same functions as the main toolbar.

Wednesday, February 02, 2005

Choose Python

Ok. Being a Python fan. And being a Trainspotting fan, when I came across this I had to post a link. Awesome:

Word!

Random bla bla.

Hmm... This mo rning I went to my GMail box to check for new mail, and was surprised to find there 50 new invites! WTF? Well, anyhow, if anyone needs one - drop me a note here. Although, these days, everyone who's at least a bit geeky has account there...


In the totally unrelated news:
I am nerdier than 94% of all people. Are you nerdier? Click here to find out!
Dunno how the heck did that happen :-S

And now some stuff from the PyQLogger front:

  • I'm writing this post with 2.0 version, having it spell-checked on-line , with all the plug-ins working just great.
  • I've made a new plug-in that's called Templates. It allows you to store a set of pre-defined text blocks with keywords and then just press Ctrl-J while editing, select the needed template from list and it pastes the code! Very handy.
  • I've kicked old post editor out of the window, now the only possible editor is Scintilla. I think it's the right way (and since it's ALWAYS installed with PyQt, availability is not an issue here)
  • The progress is really good these days, and I'm hoping to get closer to some sort of a beta next week or so. No promises though.

Saturday, January 29, 2005

Look what the cat dragged in!

Lookie, lookie. What's that?



Oh yeah, we have an online spell checker now! Works really smooth, btw ;)

It was quite a pain making Scintilla do what I wanted it to do, but in the end - very rewarding. Anyhow, because I think it's a rather usefull feature, I'll make it permanent in the code, not a plugin. Plus we'll bundle the ASpell bindings with PyQLogger. (it should also work on windows, btw)


Oh, and btw, since I was very impressed with some Flash demos I've been seeing lately, I plan to use VNC2SWF to create some introductionary shows of PyQLogger. It should be ready before the 2.0 release.

Thursday, January 27, 2005

Plugins commited!

Ok. Let's see what I've got for you today... Tons of commits today, lots of code went in... Plugins are in! Take a look at the screenshots (click to zoom):

This is the Plugins tab in Settings dialog. Plugins can be enabled/disabled and configured.
Here's how the usual configuration for plugin would look like:


Now here's the tricky part. The stuff that you see as Plugin Properties is actually generated when the dialog is shown, based on plugin's internal structure. Each plugin defines what types of options it want's to use. Then all the settings are stored in central XML file in ~/.pyqlogger

Next step - rewrite the ToolbarManager to load the default buttons, so we'll get all the basic functionality in place.

Anyhow, it's going rather well, hope I'll be able to finish it before my next semester...

Wednesday, January 26, 2005

WiKi Redesigned

Today I've decided that pyqlogger's wiki is designed rather poorly. Plus it missed the main point - to draw attention to the program.

So i've redesigned it. All the main sections can be reached from navigation bar at the side, and at the main page you'll get all the new developments from PyQLogger front. Enjoy.

oh, and i dunno if i've mentioned this before, but Livejournal support is completly functional in the trunk! Yeppie.

And one last thing. The nice folk over at WingWare granted me a free license for their excelent WingIDE Pro. Huge thanks to you, guys!

This logo can now be seen at the Wiki

Thursday, January 13, 2005

Some slow progress

Howdy y'all. Today I'll treat you to some screenshots of new dialogs from PyQLogger 2.0. Yes there is such a beast! And the first drafts are coming along quite nicely. First of all, here's the login dialog (notice the new logo, made by Xander):

Here the user can select different accounts for different blog providers (Blogger/LJ/MT and etc)

Now we have the first draft of the settings dialog:

For this dialog, user can add more account, or modify existing ones, load/unload/configure plugins and control the way GUI behaves.


And a little something for the end, Account Settings dialog:
I think it's rather self explaining.
Now about the design of the 2.0 version.

  1. It's not AtomAPI only client anymore. Other backend will be available.
  2. At first I plan to implement MetaWeblog protocol (over XMLRPC) and LiveJournal
  3. The configuration is moved to XML, in the most dynamic way - XMLObject. Now the classes serialize them selves. Very modern :)
  4. The approach of subclassing is thrown away. Now I work with QWidgetFactory. As a result - size of code slashed in half (since we don't supply generated .py stub classes, but just .ui xml descriptions) and loading times are much better. Plus the development cycle is shorter. And if you are a real freak, you can open .ui in Qt Designer and move the buttons around, change the UI to the way you like it.
  5. There are many more ideas for the new version. Take a look at the TODO page in the WiKi and tell us what you think!

Sunday, January 09, 2005

A Major slowdown.

Good day, all.

Sorry for complete lack of updates, but things have been really with Real Life™.
There was a version cut-off at work, and I’ve been working on it 12 hours a day, which leaves me with very little time for PyQLogger. But the designes for the new version are almost done, and I will publish the UML‘s on the WiKi as soon as possible.

That’s it for now,
Keep it real.

Oh yes, almost forgot. If any of my reader is in touch with packagers of Linux distro's, I would be very interested in getting PyQLogger shipped with them. Because I don't really know how the whole process of getting accepted in the distor works, I'm kinda clueless here, but I do think that having PyQLogger shipped with some major linux distro would bring much more attention to the program. For example, I've looked at the state of the Drivel which is considered a serious GTK client for Blogging... And what can I say... Without bragging, Drivel has NOTHING on PyQLogger. Seriously... And i really wish more people would see that.