DeveloperHell | Languages: All | PHP | Python | .NET | Java | CSS | Ruby   Site: Statistics
want to join us? register, it's easy | help
category icon

A Lightweight Approach to Aspect-Oriented Programming in Python

in Python added by admin, 3 weeks ago aspect-oriented intermediate

aspects.py library provides means to intercept function calls. Functions and methods (also in Python standard library and third party code) can be wrapped so that when they are called, the wrap is invoked first. Depending on the wrap, the execution of the original function can be omitted, or the function can be called arbitrarily many times. Wraps are able to modify the arguments and the return value of the original function. In the terminology of aspect-oriented programming, the library allows applying advices (wraps) to call join points of methods and functions in around fashion.

comment save report
category icon

Using Pyke, the Python knowledge engine

in Python added by admin, on 22/3/2008 intermediate knowledge engine

This describes how to use pyke from within your python program.

comment save report
category icon

Learning Python Programming Language Through Video Lectures

in Python added by admin, on 8/3/2008 beginner tutorials video lectures

One of the upcoming projects I am doing (I will reveal it in one of the next blog post) is going to be written entirely in Python. I have a good understanding of Python but, same as I had with JavaScript, I have little experience doing projects from the ground up in it. Before diving into the project I decided to take a look at a few Python video lectures to learn language idioms and features which I might have not heard of.

comment save report
category icon

The state of Python profilers in two words. Use cProfile.

in Python added by admin, on 1/3/2008 intermediate profiling

This is for people who still wonder what they should use every time. cProfile was added in Python 2.5 after much discussion about the downsides of existing profilers.

comment save report
category icon

Python - 15 Line HTTP Server - Web Interface For Your Tools

in Python added by admin, on 14/2/2008 intermediate oo programming web server

I write a lot of command line tools and scripts in Python. Sometimes I need to kick them off remotely. A simple way to do this is to launch a tiny web server that listens for a specific request to start the script.

comment save report
category icon

Python as Config Language -- Forget XML and INI files

in Python added by admin, on 12/1/2008 configuration-file

A programming language has all the advantages as a language for encoding parameters. I see why it's rare -- too many programmers have spent too much time with MS's abominable INI files and think it's "normal".

comment save report
category icon

Using raw SQL in django

in Python added by admin, on 3/1/2008 django framework intermediate sql

For a django project I'm working on, I need to run a simple query with COUNT and GROUP BY statements to collect some summary data. I tried working with the model API, and eventually fell back to using raw SQL instead.

comment save report
category icon

Human-Readable Encryption Keys

in Python added by admin, on 29/12/2007 cryptography intermediate

Somehow, we have to present these random 128-bit keys to the user, and I think I've found a pretty good way. We use RFC 1751, which defines a 'Convention for Human-Readable 128-bit Keys' - basically just a mapping of blocks of bits to strings of English words.

comment save report
category icon

Python: Some Concurrency Tricks

in Python added by admin, on 27/12/2007 concurrency intermediate

Here are a few concurrency tricks if you're stuck using threads. I used these tricks years ago to write a Swing application in Jython, and I found them to be helpful enough to warrant a blog post, albeit a few years delayed.

comment save report
category icon

Real World Performance On Boxing Day

in Python added by admin, on 26/12/2007 benchmark jruby

Well, Ruby 1.9.0 landed yesterday, as expected. I’d be remiss if I didn’t start out by thanking matz, ko1, and all the other hackers involved in getting this milestone release out the door. It’s a great step for Ruby, and one that we’ve been waiting a long time for.

comment save report
category icon

Damn Cool Algorithms, Part 3: Anagram Trees

in Python added by admin, on 24/12/2007 algorithm general intermediate search tree

When it comes to finding anagrams of words, a frequent approach is to use an anagram dictionary - simply put, sort the letters in your word to provide a unique key that all anagrams of a word have in common. Another approach is to generate a letter-frequency histogram for each letter in your word. (Both these approaches are more or less equivalent, in fact.) These approaches make the problem of finding exact single-word anagrams for strings very efficient - O(1) if you use a hashtable.

comment save report
category icon

Python: asserting code runs in specific thread

in Python added by admin, on 23/12/2007 intermediate threads

My buddy JJ's post to the BayPiggies mailing list reminded me of a little snippet I wrote a while back that others might find useful as well. Personally, I avoid threads like the plague, but if you are forced to use them it is generally handy to keep accurate tabs on how you use them.

comment save report
category icon

Does Pylons have 'Conceptual Integrity'?

in Python added by admin, on 19/12/2007 blog thoughts

On the Internet, I frequently see terms misapplied to other contexts. Whether its a basic definition misapplied to a different realm, or an analogy grossly misapplied to a context that is not in fact similar. Since this particular term ‘conceptual integrity’ however was used as a beating stick on Pylons, I felt it’s something worth discussing.

comment save report
category icon

Python LDAP Applications: Part 1

in Python added by admin, on 15/12/2007 advanced ldap

This article mini-series by Matt Butcher will look at the Python application programmers interface (API) for the LDAP libraries, and using this API, we will connect to our OpenLDAP server and manipulate the directory information tree.

comment save report
category icon

A Byte of Python

in Python added by admin, on 6/12/2007 beginner tutorials book

'A Byte of Python' is a book on programming using the Python language. It serves as a tutorial or guide to the Python language for a beginner audience. If all you know about computers is how to save text files, then this is the book for you.

comment save report