inicio mail me! sindicaci;ón

Archive for December, 2005

Atom.NET is no longer mine

I write this post to notice that Atom.NET is no longer mine. It’s property of Toolbutton, Inc. in Edmonton, Canada.

If you have any kind of requests about the library, ask to the support service of Toolbutton, Inc.

Learning Prolog On Christmas Eve

I don’t know if I’m crazy or too much geek but I spent today learning the basics of Prolog. It’s cool, not my language of choice but I like learning a totally new paradigm.

Emacs + SWI-Prolog + Prolog mode rock!

….Merry Christmas everybody! :)

Hypelocate

I wrote a small app called hypelocate to test hype, it’s a clone of unix “locate” tool. You must install hype and my patch (the first, not the second one) to the hype source tree to use it.

You can find the whole app here: http://www.oluyede.org/files/hypelocate-0.5.tar.gz

You can find more informations about hyper in my older post: Hype, the Python indexer

Read the rest of this entry »

FTP Uploader (.NET vs Python)

Michele Bersani showed a very simple example of FTP uploader using a third party library (in .NET 1.1 you don’t have any FTP support at all) and hence I wrote a Python version.

Here is his script: Read the rest of this entry »

HttpListener (.NET) vs BaseHTTPServer (Python)

06 Dec 05 - UPDATE: with this post I start a series of posts comparing scripts in .NET (C# or so) and Python (CPython)

Michele Bersani of the local .NET user group wrote a basic use case of .NET 2.0 HttpListener class but he states in his post that (I translate from italian) it works “only under Windows XP SP2 or Windows Server 2003“. What a pity!

Hence I wrote a Python similar version that runs on quite all platforms (Windows, Linux and so on).

  1. from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
  2. import webbrowser
  3.  
  4. class RequestHandler(BaseHTTPRequestHandler):
  5.     def _writeheaders(self):
  6.         self.send_response(200)
  7.         self.send_header(‘Content-type’, ‘text/html’)
  8.         self.end_headers()
  9.  
  10.     def do_HEAD(self):
  11.         self._writeheaders()
  12.  
  13.     def do_GET(self):
  14.         self._writeheaders()
  15.         self.wfile.write(
  16.             “”“<html><body><h1>This is the HTML body</h1></body></html>”“”)
  17.        
  18. address = (‘localhost’, 8765)
  19. print “Connected on: %s:%s” % address
  20. server = HTTPServer(address, RequestHandler)
  21.  
  22. webbrowser.browser = “iexplore.exe”
  23. webbrowser.open(“http://%s:%d” % address)
  24.  
  25. server.serve_forever()

Just tweak the webbrowser part for make it work under all browsers.

06 Dec 05 - UPDATE: Valentino Volonghi wrote a version using the Twisted Matrix framework: A Web server in Twisted

Writing a Widget Using Cairo and PyGTK 2.8

I wrote a Python version of this C-based article.

http://www.oluyede.org/blog/writing-a-widget-using-cairo-and-pygtk-28/