Entries Tagged 'Programming' ↓
July 2nd, 2008 — Internet, Programming
I had the privilege of being introduced to the next generation of bleeding edge web development tools this weekend. This post is mainly about DivMod’s “Nevow” which is a web templating framework, running on Twisted Matrix’s Twisted Webserver and using DivMod’s “Athena” for asynchronous AJAX- and COMET-style browser communications.
If you are familiar with web dev, you may immediately develop a headache on the mentioning of AJAX, but believe me if I say that not only does Nevow not induce migraines, it gets you more and more excited as you realise its potential.
I really cannot properly express how nice it is to work with these tools here, so please take a moment to skim through this (very) short tutorial on creating an AJAX style chat server/client using Athena: http://divmod.org/users/oubiwann/howto/chattutorial/part01/index.html
As a first attempt, I created an AJAX style event notification system: A site is provided with two children: /alerts and /event . When an arbitrary child page of /event is visited, such as /event/anyrandomword, a new event is created with the name “anyrandomword”. Visiting /alerts will display a list of events as they are created IN REAL TIME (without a page refresh) by anybody visiting /event/NewEventName from anywhere.
I recommend you read the source from the bottom up, most of it should be self-explanatory. The python source is available here: myelement.tac.py (About 100 lines without comments). Also required is the javascript source for adding table rows and the nice background fade-in effect: mymodule.js and an xhtml template for the alert form: tabletemplate.html
Here is the complete package, better named, better structured, but without comments: firstattempt.tar
Further Reading:
http://divmod.org/trac/wiki/DivmodNevow/Tutorial
http://divmod.org/trac/wiki/DivmodNevow/Athena/Tutorials/LiveElement
http://open.thusa.co.za/enamel
June 17th, 2008 — Personal, Programming
I am really excited about my final year project. I wil be designing a wireless (802.11) enabled RFID scanner for class attendance register purposes. This may seem a little lame, but once developed the concept can easily be ported to a very nice access control system (think wireless enabled, RFID doorlocks). It will definately be superior to the crappy Saflok locks they recently installed for us. The link to the project blog is: Secure Attendance Register System.
January 6th, 2007 — Programming
 |
I coded a configurable xchat auto-op script in python, it is available here: xhat auto-op script. Please leave bug reports and feature requests on the script’s page. If there is enough interest, I will port it to C and create a native xchat plugin, so also leave a message if you are looking for a native plugin. |
The script is pretty straight-forward. The biggest issue was figuring out the regular expressions to use for hostmask matching.
As a matter of interest, I determine a valid hostmask with this regex:
IRC_HOSTMASK_REGEX = r’^([a-zA-Z0-9\[\]\\^_-{|}*]+)!([a-zA-Z0-9\[\]\\^_-{|}~*]+)@([a-zA-Z0-9*.-]+)$’
Valid nick characters are: a-z A-Z 0-9 [ \ ] ^ _ - { | } [UnrealIRCD documentation]
Channel prefixes are: ["#","&","!"]
Operator prefixes are: ["~","&","@"]
The biggest issue porting this to C would be regex matching, since there are no standard regex libraries included with distributions of C compilers for windows. I will have to use MinGW ,using the GNU regex library in linux and compile the source to a dll.
Please leave a comment or a message on the site so I can determine the level of interest.
December 21st, 2006 — Programming
For some mad reason I decided to try and see how efficient I could code a binary counter. Assume you have n LEDs, which are represented as ints: 0 = off, 1 = on. You also have a counter variable: int counter; I ended up with a few bitshifts, addition and logic ANDs. Here is my code:
LED1 = (counter >> 0) & 1;
LED2 = (counter >> 1) & 1;
…
LEDn = (counter >> (n-1)) & 1;
/* Equivalent to: counter = (counter+1) % pow(2,n) */
counter = (++counter) & ((1 < < n)-1)
October 15th, 2006 — Internet, Programming
 |
I am currently working on Labyrinth (http://labyrinth.za.net), a program that tunnels data via DNS queries and replies. It is being coded in python, and at time of writing I have a working proof of concept that can only transmit about 32 characters at a time. (Update: labyrinth uses openVPN’s tap-win32 driver for packet tunneling.) |
Continue reading →
November 25th, 2005 — Programming
One of my favorite tools under windows OS is Servant Salamander - a two-pane file manager, network client, archive manager, etc, etc. I definitely recommend you have a look, it is like the swiss army knife of file handling. The closest linux alternative I’ve seen so far is krusader.
However, the latest version at time of writing is 2.5 beta10a, which includes an annoying 3-second splash screen on startup, as well as an even more annoying 30-second splash screen once it has expired.
So, armed with my knowledge from the hackr.org challenges I did in an obsessive haze after seeing the link on karnaugh.za.net and getting hooked, I tried my hand at removing the splash screens.
The end result is available here: Servant Salamander 2.5 beta10a no-splash exe
(edit)
I decided against sharing the “cracking” method, since I don’t want it to be distributed on a large scale. Basicly, I used a debugger to skip the function that creates the annoying splash-screen dialogues.
Also, in my opinion it is much better than total commander (as krusader is better than midnight commander). Almost not comparable.
And in case you were wondering, I have a legally licensed version of Servant Salamander.