Posted on January 27, 2010 in Computers by seadog2 Comments »

Συνεχίζοντας την ωραία δουλειά που κάναμε με τον Μάνο για την δημιουργία playlist του eradio.gr, έκανα μεταφορά του προγράμματος με ελαφρές τροποποιήσεις στο maemo 5 για το nokia n900.

Κατεβάζοντας το greekiradio από τα devel repositories και πατώντας το update ενημερώσετε την λίστα του ενσωματωμένου media player με τους σταθμούς που προσφέρει το eradio.gr. Η λίστα δημιουργείται την στιγμή που πατάτε το update ώστε να μπορείτε να την ενημερώνετε κατά βούληση με νέους σταθμούς και ανανεωμένα feed για τους ήδη υπάρχοντες.

Πληροφορίες για το πως μπορείτε να επεξεργαστείτε την λίστα ραδιοφώνων του media player του maemo 5 θα βρείτε στο σχετικό post στο maemo.org

Posted on January 15, 2010 in Computers by seadogNo Comments »

Ο Emnik έφτιαξε μία νέα λίστα για το eradio.gr αφού οι δικές μου (εδώ και εδώ) είχαν πάψει να λειτουργούν εδώ και καιρό. Χρήσιμο script από ένα νέο site με pythonικές τάσεις!

Posted on December 2, 2009 in Computers, maemo planet by seadog1 Comment »

Screenshot-20091202-122510Yeah! I just got accepted to upload my first maemo 5 application to maemo extras-testing repository. A simple, working stopwatch and a wannabe countdown timer with rotation support.

Build using python and the nice pluthon eclipse based ide. The tutorials on maemo.org for PyMaemo are really good and you can always use source code from other applications for tips and tricks. This is my first gtk / maemo application and looks like is pretty easy to get started with maemo development.

Now go on, enable the extras-devel repository on your n900 and install stopwatch!

launchpad.net repository for stopwatch

Posted on September 3, 2009 in Computers by seadogNo Comments »

icalLast.fm provides an upcoming events listing service which proves really useful when you need to fill an empty Saturday's night. They kindly filter out the events based on the location you choose and even a distance parameter when using the advanced search dialog.

Strangely enough they don't provide an RSS or iCal interface to that service. You can only iCal subscribe to a specific artist's calendar and not to a city's or country's calendar. I'm using evolution for my calendar needs so I spent a couple of days hacking an iCal calendar generation script for the Last.fm events.

The script, coded as always in python, accesses the event list of an area through audioscrobbler's public API, parses the input using XMLObject package and finally creates the iCalendar file using the iCalendar package.

The calendar is accessible through

webcal://www.sealabs.net/music-events/?area=Rotterdam

Of course you can replace 'Rotterdam' with the area, city or country, you are interested in.

You can also set the maximum distance from the area you specified (defauls to 50km) and the maximum number of events to be returned (defaults to 300) using the 'distance' and 'events' parameters accordingly.

Examples:

webcal://www.sealabs.net/music-events/?area=Rotterdam&distance=300

returns 300 events in Rotterdam in a maximum distance of 300km.

webcal://www.sealabs.net/music-events/?area=Rotterdam&events=500

returns 500 events in Rotterdam

webcal://www.sealabs.net/music-events/?area=Rotterdam&events=500&distance=300

return 500 events in Rotterdam in a maximum distance of 500km.

You can use the webcal address with your favorite calendar application, such as evolution and sunbird or with Google Calendar

Note: First use Last.fm's web interface to check if the area / city you are looking for is available. Last.fm seems not to be using official latin city names so some cities exist under 'strange' names. For example Thessaloniki is Thessaloníki on Last.fm therefore the ical address is

webcal://www.sealabs.net/music-events/?area=Thessaloníki

Note²: Actually this functionally is available from last.fm  (RTFM!) but it doesn't work with Google Calendar (but maybe it's google's problem) and anyway mine has more features :)

Posted on May 12, 2009 in Computers by seadog1 Comment »

gedit-regexΤο gedit είναι ανοιχτό στο desktop μου σχεδόν το 100% του χρόνου. Είτε θέλω να γράψω μία αναφορά, ένα blog spot, μία γρήγορη σημείωση ή κώδικα θα χρησιμοποιήσω gedit. Είναι γρήγορος, έχει αρκετές δυνατότητες (όχι δεν κάνει τα χιλιάδες "κόλπα" ενός πραγματικού IDE. και τι έγινε;) και υποστηρίζει python plugins για όσα δεν κάνει από μόνος του!

Κατά το porting ενός jpeg decoder σε μία ενσωματωμένη πλατφόρμα χρειάστηκα να σβήσω όλα τα printf statements, γιατί πολύ απλά δεν υποστηρίζονται. Με το Regular Expressions plugin για το gedit η δουλειά γίνεται αμέσως. Κατεβάζω, αποσυμπιέζω στο ~/.gnome/gedit/plugins και το ενεργοποιώ από την plugins λίστα του gedit. Done.

Posted on May 10, 2009 in Computers by seadog4 Comments »

eortologio-logoΤο εορτολόγιο στο twitter έχει φτάσει αισίως του 53 ακόλουθους και στο identi.ca τους 9. Έχω αλλάξει εδώ και καιρό την πηγή των γιορτών, αφού το εορτολόγιο από το GrBytes δεν ήταν ολοκληρωμένο. Ανταυτού, παίρνω πλέον την πληροφορία καθημερινά από το site του eshop.

Ο κώδικας του εορτολογίου

http://www.identi.ca/eortologio

http://www.twitter.com/eortologio

Posted on May 7, 2009 in Computers by seadogNo Comments »

Use the bisect module:

import bisect
i = [1,2,3, 6]
bisect.insort(i, 5)

A more detailed example

import bisect
import random
 
# Use a constant seed to ensure that we see
# the same pseudo-random numbers each time
# we run the loop.
random.seed(1)
 
# Generate 20 random numbers and
# insert them into a list in sorted
# order.
l = []
for i in range(1, 20):
	r = random.randint(1, 100)
	position = bisect.bisect(l, r)
	bisect.insort(l, r)
	print '%2d %2d' % (r, position), l

[Via]

Posted on February 18, 2009 in Computers by seadogNo Comments »

This is the fourth release of the Grub NG Python Client. This release closes critical bug, so update your clients!

What is Grub?

Grub started back in 2000 with a simple concept of distributing part of the search process pipeline: crawling. In a way, we were a bit ahead of our time, but our intention then was what it is now. We want to help fix search.

Learn more at http://www.grub.org

This release features:

  • Support for the new workunits format, featuring more HTTP headers per request.
  • Added Uploading thread. Now all ARC uploads are executed by a single thread, to prevent server hammering. Features like upload bandwidth limit will be added in the future.
  • ...full changelog

Direct Download

Posted on February 17, 2009 in Computers by seadogNo Comments »

Το τελευταίο δημιούργημα της ΑΜΑΝ teleshopping, μετά το επιτυχημένο twitter / identi.ca εορτολόγιο, είναι ο barbabel. Παίρνει το όνομά του από το 'μπάρμπας' και τον πύργο της Βαβέλ, ο barbabel είναι ένα ελληνικό-αγγλικό και αγγλο-ελληνικό λεξικό βασισμένο σε γνωστό web λεξικό που μπορεί να γίνει φίλος σας άμεσα!

Όσοι έχετε Jabber (ή XMPP ή Gtalk πείτε το όπως θέλετε το ίδιο είναι ;) ) λογαριασμό για συνομιλίες μπορείτε να αποκτήσετε αυτό τον μαγευτικό φίλο μόνο με $0,01 στέλνοντας απλά μια πρόσκληση ομιλίας στη διεύθυνση barbabel@jabber.org .

Ο barbabel χρησιμοποιεί python, το twisted python networking engine και μία βιβλιοθήκη XMPP που είχα φτιάξει παλαιότερα (ελαφρώς βελτιωμένη). High end features είναι το caching των λέξεων για να μειώσουμε τα http requests και η καταγραφή στατιστικών (όποιος βρει τις admin εντολές κερδίζει αγγλο-ολλανδικό λεξικό :P ). Τα high end featues υλοποιούνται με την βοήθεια του python elixir και της sqlalchemy (20' για database build και ενσωμάτωση! sweet python ;) ).

Απολαύστε την υπέροχη εμπειρία της άμεσης μετάφρασης, χωρίς να χρειάζεται να φορτώνετε σελίδες ~400kbyte με πληροφορίες για το χρηματιστήριο και τα ζώδια!

(BTW: εάν κάποιος ξέρει λεξικό που να του δίνεις τον πληθυντικό (ή αόριστο κτλ) της λέξης και να καταλαβαίνει για ποιο πράγμα μιλάς, για όνομα του Δία, ας το γράψει σε comment!)

Posted on January 23, 2009 in Computers by seadogNo Comments »

Άλλαξα την πηγή των γιορτών για το twitter εορτολόγιο που έχω κάνει γιατί δεν μου φάνηκε πολύ πλήρης η λίστα που χρησιμοποίησα. Τώρα παίρνω την πληροφορία από ένα γνωστό website, διαβάζοντας την πρώτη σελίδα του, η οποία φυσικά είναι HTML.

Με αυτόν τον κώδικα μπορούμε πολύ εύκολα να κρατήσουμε μόνο τo κείμενο και να αφαιρέσουμε όλα τα HTML tags, που αρχίζουν με < και τελειώνουν με >, όπως και τα spaces &nbsp;.

 
def remove_html_tags(data):
    p = re.compile(r'<.*?>|&nbsp;')
    return p.sub('', data)
 

Ελαφρώς τροποποιημένος από τo site "Life is short - you need Python" ;)

Next Page »