July 2010
1 post
2 tags
Create a web service in Clojure without...
This is a cross-post from SocialCaddy The problem using Jetty (or Netty or Ring) is that after you start the process, your beloved REPL is “binded” to the server thus forcing you to kill the service, make a change, start the process again, refresh and do it again. Not fun at all. It’s easy to run the process “in the background” and have the REPL available to make...
Jul 19th
May 2010
1 post
“Having a developer write his own unit tests is like asking a crazy man if...”
– reddit
May 26th
January 2010
3 posts
4 tags
Activerecord in Python: Do it like Rails!
I’ve searched around the net for a nice, clean implementation of activerecord in Python but I found none. There are many better libraries for database abstraction out there in Python but I think that Rails’ “activerecord” way is a breeze and a fun way to access a database. So, my weekend project was to see whether I could hack together a small activerecord for Python. The...
Jan 17th
1 tag
Nimbuzz, Android and Skype: Put your headphones...
I love Nimbuzz (loving it since I first learn about it when I was at the Erlang Factory in London and spoke with a guy from Nimbuzz) ‘cause it was running smoothly on my Symbian and allowing me to connect with Skype. So when I got my HTC Hero, it was the first app I was going to install. But Skype(to Skype) didn’t seem to work (couldn’t speak, couldn’t hear). I tried Fring...
Jan 6th
1 note
2 tags
Facebook Connect for web2py
Even though web2py has support for building facebook applications, we didn’t have a way to use Facebook Connect. I’ve studied many ways (like Facebook’s Javascript API) and checked other frameworks (Rails and Django) and after 4 hours I made a patch to facebook.py that enables web2py (and I’m sure that other python frameworks can use - like webpy) to use Facebook Connect...
Jan 5th
December 2009
2 posts
Implementing a Rails-like scaffolding in web2py...
Sometimes I want to create a better administration panel for our clients. With this hack you can create an add/edit/delete panel for every table you like and extend it easily. in order to use it you just go inside the controllers and add: @scaffold(None) def authors(): pass this will create an admin page (authors) that has all the properties from the table “authors”. if you have...
Dec 26th
Uploading files using CKEditor in web2py
This is the second part of integrating CKEditor in web2py. I should warn you that quotes are messed up in the blog so you can check at web2pyslices for the updated (and ready for copy-paste) version. What it needs to be done in order to have ckeditor uploading works. First, it needs a “file browser” url. That’s just a form with an upload field where we can use to find and upload...
Dec 18th
November 2009
1 post
Creating unicode permalinks in Python (even from...
Optimizing this blog post, which shows you how to create a greek to greeklish “translator”, I’ve created a permalink function that creates urls from greek titles (but you can use your language). Enjoy! def create_permalink(s): “”“ Create greeklish permalinks. Also works for english. “”“ import string import re input_string =...
Nov 18th
October 2009
2 posts
Using widgets in web2py (integrating CKEditor)
Although web2py comes with an integrated editor, I really like ckeditor and using it for a text field is trivial using widgets! First, install ckeditor (put the ckeditor inside a js/ckeditor file in your static folder and include it) : <script type=”text/javascript”...
Oct 30th
Creating a dropdown with country names in web2py
There are many ways to create a dropdown that includes all countries in web2py but the most pythonic way goes like this: Create a module (let’s name it countries.py) and put a list of countries : COUNTRIES=(‘United States’, ‘Afghanistan’, ‘Albania’, ‘Algeria’, ‘Andorra’, ‘Angola’, ‘Antigua and Barbuda’,...
Oct 7th
September 2009
3 posts
Adding your .emacs to Mercurial / Git
Having my favorite .emacs settings available, in the tip of my “hg clone” command is precious. No more backups and no more “oh no, I have an older version in my usb stick”. And it’s easy! First of all, you need a mercurial server. Or an account at http://bitbucket.org/. Of course the same procedure stands for git. Then you create a new repository (let’s call...
Sep 28th
First review - Karmic Ubuntu Moblin Remix
No one has posted a review of the upcoming Ubuntu remix, so here we go! First of all, I installed it via usb-creator on a 64gb USB (you need more than 1gb usb for installation via usb - even a 2gb will do) with no problem at all. The boot stage is identical to the Ubuntu 9.10 and way slower than Moblin’s boot stage (+10secs). After that, the environment seems the same, but now we have...
Sep 19th
Ubuntu Moblin Remix is out!
It seems that I am the first one the found that Canonical released an iso image of Ubuntu Moblin Remix (UMR), four months after the official announcement that Moblin v2 will be supported and a couple of months after the announcement that they are working on Ubuntu Moblin Remix. That means that the sexy interface of Moblin v2, will be included at the ubuntu repositories (and it will be supported by...
Sep 16th
August 2009
2 posts
How to setup Emacs 23.1 and slime for Ubuntu
After searching and patching around this is what you have to do: First, install emacs23 (emacs-snapshot) from here https://launchpad.net/~ubuntu-elisp/+archive/ppa. Choose your distro, add the entries to your sources.list, install and you have emacs 23.1. Now, add slime and sbcl from ubuntu repositories and add this to your .emacs file: ;; Lisp (setq inferior-lisp-program “sbcl”)...
Aug 27th
OpenShare :: The First OpenSource Ad network!
This started as a project for a company that wanted an ultra fast advertising server to use for their “ring of sites”. After the project finished, I kept thinking that the OpenSource community could benefit from a “Banner Exchange” service that is free, fast and reliable. So, I started hacking one in web2py running on Google App Engine (no, it has nothing to do with the...
Aug 24th
July 2009
1 post
4 tags
Using your mobile as a Bluetooth modem for Ubuntu...
I have free GPRS on my mobile and sometimes I just need my daily dose of Internet even when I am at places with no Internet connection (island / mountain). I know there are many good solutions but sadly many of them are missing some important stuff. So, here is my take: 1. Download bluez-passkey-gnome $ sudo apt-get install bluez-passkey-gnome 2. Run bluetooth-applet (you’ll see why in...
Jul 17th
June 2009
2 posts
Erlang Factory and RainUp Project - Phase I
All I can say is: I am AMAZED by the Erlang community! Sadly here in Greece there isn’t an active Erlang community (but if your are interested in starting one, give me tweet at jonromero) even though there are some crazy Erlang projects (tidier/HiPE/Dialyzer) and some crazy researchers/developers. All the presentations were inspiring (and most of them uplifting) but what was very strange...
Jun 30th
A quick hack for random numbers in Erlang
It seems that you can’t get random numbers in Erlang when you are in different processes. I am building a distributed Monte Carlo simulation and I wanted two random numbers for the x and y (of the dart). So, the only way to do it (if you want it to run in a cluster) is this (at least that’s what I’ve found). {Seed1, Seed2, Seed3} = erlang:now(), X = random:uniform(), ...
Jun 11th
April 2009
1 post
“Awesomeness : Looking at your own code after a couple of days and thinking:...”
– By me
Apr 10th
March 2009
4 posts
Between Erlang/Reia/LFE with Joe Armstrong -...
I love Erlang but for a couple of months I was wondering whether using LFE or Reia could speed up development (so other developers could jump in easily on an OpenSource project I am working on - read on for more about the project). Even though that Erlang is very powerful, it’s syntax is a deal-breaker for a lot of people. So, I thought that bringing developers from the world of lisp and...
Mar 17th
“Only wimps use backup: _real_ men just upload their important stuff on git, and...”
– paraphrasing Linus Torvalds
Mar 17th
MetroFinder for your mobile!
Due to my new house location near at a Metro Station, I am using the public transportation a lot more than I used to. And because I am (as always) a little bit into my (own very special) world, I tend to miss bus stops, metro stops etc. And of course due to my very short memory that refuses to hold any non-critical information, I don’t remember (or at least I don’t make any effort)...
Mar 2nd
Time your pet projects!
The most interesting part in programming is creating stuff that to you seem like the most awesome stuff but to others seem like “yeah, cool” or “why did you spent your time building this useless thing?”. That might be the reason why many of our pet projects don’t get published/released (all creators denounce their creations). Our maybe that’s not the reason....
Mar 1st
1 note
February 2009
1 post
What is emotionull?
Emotionull is a word that combines emotion and null (that’s how we geeks say nothing or undefined - depending on the programming language you love). You’ve heard it first time here and you can’t unhear it now! So, what we really are? Consider a show (hopefully not a freak show!) with many high-star guests. Now, instead of “show”, put “software” and...
Feb 27th