Skip to main content

Posts

Showing posts from July, 2012

An open letter to Kiwibank

Dear Kiwibank, My suggestion isn't actually sensitive hence posting it on my blog. This could be a game changer for Kiwibank though. I want support for requesting payments. I've run into "POLi" before, and it's rubbish - the fact it requires a particular operating system and browser, requires letting untrusted third-party code log into the user's bank account and "take control". Terrible for an untrusting geek like myself who wants to pay for a flight... I realize POLi isn't the problem, or a Kiwibank product, but it is the current best solution because no bank is willing to lead and create a proper (and secure) solution to real time paying with online banking. It would be a great benefit to many people, including trademe users, and small businesses who might need to take payments and deposits online. Heres how I imagine it could work: People wanting paid would be able to go to kiwibank.co.nz set up and email their payment request/invo

Socks

There is certainly some confusion with sockets, as my flatmate put it; sockets connect stuff together right? Wikipedia puts it a little clearer with: sockets are inter-process communication endpoints That sounds pretty boring but I promise you can do some fairly interesting things with them. Sockets are a core part of the operating system, and a socket API is used to direct how the operating system should use sockets. So the hello world of sockets would have to be an echo server. Let's create a basic Python3 socket server that will listen on IPv6 and repeat what it hears. The Python Howto guide for sockets starts with this: Sockets are used nearly everywhere, but are one of the most severely misunderstood technologies around. On the server side, you follow these steps: Create a socket (possibly after querying the system for information) Bind the socket, which assigns the socket to an address Listen prepares it for incoming connections Accept an incoming connec

Learning by doing

About a year ago I read a programming post by Peter Norvig: (How to Write a (Lisp) Interpreter (in Python)) , being a Python programmer, of course I had to try write my own Lisp interpreter as a way to learn lisp. My implementation is relatively short, but can do some surprisingly complex things like this Y Combinatorial Factorial from wikipedia (which is one of my unittests): ( begin ( define Y ( lambda ( f ) (( lambda ( x ) ( f ( lambda ( v ) (( x x ) v )))) ( lambda ( x ) ( f ( lambda ( v ) (( x x ) v ))))))) ( define fact ( Y ( lambda ( f ) ( lambda ( n ) ( if ( = n 0 ) 1 (* n ( f (- n 1 )))))))) ( fact 10 ) ) I've recently dug up the files, rinsed them off, and put them on my bitbucket account. The reason I took another look at this project was my desire to translate it with Pypy . After having to battle just to get the tokeniser into valid RPython to translate I'v