GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Home
  • About

This view

  • Original page
  • New address

GeezerVison is showing codebright.wordpress.com — codebright

Author Archives: codebright

← Older posts

Linear Algebra Review and numpy

Posted on October 7, 2011 by codebright

I’ve signed up for the Machine Learning course from Stanford. One of the first week’s subject areas is a Linear Algebra Review, and the recommended software is GNU Octave. However, I’d prefer to use numpy and Python. Here’s my notes … Continue reading →

Posted in Python | 5 Comments

Tuple Trivia

Posted on July 5, 2011 by codebright

A couple of minor points regarding tuples. When you take a slice of a tuple, there are 3 parameters: – the start index – the end index – the step which produces: It doesn’t matter that, in the second instance, … Continue reading →

Posted in Python, Software | Leave a comment

globals and __main__: a Python gotcha

Posted on June 15, 2011 by codebright

One of the good features is the lack of gotchas. I define gotchas as traps for the unwary programmer, where something unexpected happens. Thankfully these are rare in Python. But the following is one that is worth knowing about. Consider … Continue reading →

Posted in Python, Software | Leave a comment

Edge case for split / explode

Posted on April 1, 2011 by codebright

During recent coding, using PHP, I found that the explode function behaves in a non-ideal way (for me) when trying to split an empty string: produces: I was expecting (needing?) an empty array. After thinking about it a bit more, … Continue reading →

Posted in Python, Software | Leave a comment

Reading gzip files in Python – fast!

Posted on March 25, 2011 by codebright

I have been doing lots of parsing of Apache log files recently with Python. Speed is of the essence, so I was interested to know if the speed issues mentioned in http://bugs.python.org/issue7471 are still relevant. So I set out to … Continue reading →

Posted in Python, Software | 7 Comments

Python Standard Library

Posted on March 13, 2011 by codebright

There are some gems in the Python standard library which, once found, get regular use – at least by me. Here are some of them. 1. enumerate A built-in function, which allows you to replace code like this: with the … Continue reading →

Posted in Python, Software | Leave a comment

Python regular expression surprise

Posted on February 19, 2011 by codebright

I came across this regular expression anomaly recently in Python. The regular expression was more complex, but this example illustrates the idea. Try and predict the outcome (should work with Python 2.5 – Python 3.1) This produces: a, bc, d … Continue reading →

Posted in Python, Software | 1 Comment

PHP and Python

Posted on October 20, 2010 by codebright

My new job involves a lot more PHP, which seems closely related to Perl. There are a number of observations that I would make in the comparison between PHP and Python. 1. PHP is more verbose. In particular, PHP requires … Continue reading →

Posted in Python, Uncategorized | Leave a comment

SendKeys in Linux

Posted on June 27, 2010 by codebright

SendKeys is a useful function in the Windows API which enables a program to send keystrokes. I was looking for an equivalent in Linux, first in Ubuntu at home, and then in Fedora 13 at work. For Ubuntu (Hardy Heron, … Continue reading →

Posted in Software | 1 Comment

Strange behaviour using ctypes in IronPython

Posted on June 23, 2010 by codebright

I came across some slightly unexpected behaviour with ctypes in IronPython. Maybe this is the wrong way to look at it – I should be amazed that ctypes works at all in IronPython. But I thought I would document it … Continue reading →

Posted in Python, Uncategorized | Leave a comment
← Older posts
  • Recent Posts

    • Linear Algebra Review and numpy
    • Tuple Trivia
    • globals and __main__: a Python gotcha
    • Edge case for split / explode
    • Reading gzip files in Python – fast!
  • Recent Comments

    Leszek Pryszcz's avatarLeszek Pryszcz on Reading gzip files in Python…
    devboell's avatardevboell on Reading gzip files in Python…
    How to test a direct… on Reading gzip files in Python…
    Tommy Carstensen's avatarTommy Carstensen on Reading gzip files in Python…
    Tommy Carstensen's avatarTommy Carstensen on Reading gzip files in Python…
  • Archives

    • October 2011
    • July 2011
    • June 2011
    • April 2011
    • March 2011
    • February 2011
    • October 2010
    • June 2010
    • May 2010
  • Categories

    • Python
    • Software
    • Uncategorized
  • Meta

    • Create account
    • Log in
    • Entries feed
    • Comments feed
    • WordPress.com
Codebright's Blog
Create a free website or blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
  • Codebright's Blog
    View site in Reader
    Manage subscriptionsSign upLog in
    Report this content
    Collapse this bar
Loading Comments...
Create your own website, free on WordPress.com.Create your own website.
Start free
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.