Διορθώστε το χρώμα της tab bar στον Chromium
Ο Chromium (όπως και ο Chrome) σε πολλές περιπτώσεις δεν χρησιμοποιούν το κατάλληλο χρώμα ώστε η tab bar να μοιάζει ως συνέχεια του πλαισίου του παραθύρου (όταν βέβαια έχουμε επιλέξει να γίνεται χρήση του GTK theme και των πλαισίων παραθύρων του συστήματος).
Για να το διορθώσουμε αυτό, πρέπει να επέμβουμε στο αρχείο .gtkrc του θέματος που χρησιμοποιούμε.
A simple weather program in Python
The following program fetches an XML file from http://weather.yahooapis.com and displays the current weather information the file contains.
I wrote this program in order to use it in combination with conky. The result looks like this:
Basic HTTP Authentication in Python using API keys
Python’s standard library provides a great and simple way – via PasswordMgr and HTTPBasicAuthHandler – to provide credentials used for basic HTTP authentication, but (at least as far as I know) it can be used only for username-password pairs.
The problem is that sometimes – for example if you want to retrieve an xml file from gnome-look.org – you want to use an API key for authentication. To achieve that all we have to do is encode the API key with the Base64 algorith and then send it along with our HTTP request included in a basic authentication header (Note: For some reason the encoded string that I got using Python’s Base64 implementation included a line break that messed things up, so it might be wise to encode the API key by hand and then insert it to your code):
def download_file(url, API_KEY_BASE_64): req = urllib2.Request(url) req.add_header("Authorization", "Basic "+API_KEY_BASE_64) return urllib2.urlopen(req)
Of course you will have to import urllib2 (urllib in Python3).
Γράφοντας ένα Lexer με το SableCC 3.2 (μέρος 2/2)
Στο προηγούμενο μέρος δημιουργήσαμε ένα λεκτικό αναλυτή (βασικά τις απαραίτητες τάξεις για τη λεκτική ανάλυση) για ένα μικρό υποσύνολο της QBasic.
Τώρα μένει να κατασκευάσουμε μία εφαρμογή που θα παίρνει ως είσοδο ένα αρχείο με κώδικα γραμμένο στη γλώσσα που περιγράψαμε και θα παράγει ένα αρχείο html με την κατάλληλη μορφοποίηση.
Αρχικά δημιουργούμε ένα νέο κενό αρχείο με το όνομα
SubBasic2Html.java




