Virgin is inept.

posted by ben on 09.06.11 at 11:01, null, null, London, Leave a comment Permalink

Virgin media disconnected my brand new fiber line for non-payment of my bill after 1 day of connectivity. My bill wasn't paid because Virgin put a "credit limit" on the account. This limit prevented them from taking the connection fee out of my bank account, despite the bank account itself having plenty of money. Now my access is going to be down for a day.

I pay for the downtime as well, since in their view this is my fault. You know, for being a foreigner.

The happy path worked!

posted by ben on 09.05.04 at 16:04, null, null, ben tries to beat Livermore, Leave a comment Permalink

Classification done at 2009-05-04T00:00:11.602436
The best symbol is HBC.
Scheduling trades for today.
Opening positions at 2009-05-04T09:29:30.100081
I am going to trade today.
action=buy~quantity=772~symbol=HBC~ordtype=Limit~price=36.65~expire=day~accountid=xxx
Waiting for order to fill...
772.0 shares filled at 36.65
action=sell~quantity=772.0~symbol=HBC~ordtype=Limit~price=37.38~expire=day~accountid=xxx
Closing positions at 2009-05-04T15:57:00.100089
We won today! All closed out.

Lack of Privacy

posted by ben on 09.04.17 at 14:50, null, boulder, Leave a comment Permalink

The arrow's pointing to Gene.

Or, see the original here. Graham pointed this out.

The guy in the foreground with his head blurred out, wearing the white linen, is always reading A Course in Miracles and that sort of thing. I can't remember his name.

Let's go fly a kite...

posted by collin on 09.03.22 at 16:33, null, null, boston, sport, Leave a comment Permalink

Aiden Byrne Podcasts

posted by ben on 09.03.22 at 16:15, null, food, London, Leave a comment Permalink

here and here

Council Tax

posted by ben on 09.03.22 at 15:53, null, London, Leave a comment Permalink

Here's where it goes. I'd assumed a lot more went to schools... not really thrilled about paying for the projects.

In Soviet England...

posted by ben on 09.03.22 at 15:51, null, London, Leave a comment Permalink

I tried to buy hangers at Argos today. You poke through a phone book sized catalog, pick numbers of items you want and then a clerk gets them for you. The conversation went something like this:

Ben: I don't see any hangers in your catalog, but you sell them right?

Clerk: Yes. Let's see... page 143. But, they usually sell out as soon as we get them in. I'll check if we have any. No. Let me see if any of the surrounding stores have any... No.

Ben: When will you get more in?

Clerk: I don't know.

Ben: Is there anywhere else I can get hangers around here?

Clerk: I don't know.

Ben: Thanks anyway.

Demand > Supply -> Order more hangers. Right? What's next, toilet paper shortages?

Big Brother on Brick Lane

posted by ben on 09.03.22 at 09:27, null, pictures, London, Leave a comment Permalink

Trade Lifecycle

posted by ben on 09.03.22 at 07:13, null, null, ben tries to beat Livermore, Leave a comment Permalink

I'm a fair way along writing the trade engine for arbit (what I call my statistical arbitrage program that's something like 2.5 years in the making (the name of which still makes me think of these)). I've started to realize that I'm writing a finite state machine, one which looks alarmingly like the one in TIBCO BusinessEvents (BE).

So, out of curiosity, I built up the state model using BE. I'm now thinking BE makes lot of sense for trade life cycle. I've pitched the idea before, but I think trying to write a trade engine from scratch has made it really obvious how valuable this is.

Now I just have to figure out how to do this in Python. I'm thinking for each trading day I create a new object and then progress it through with a bunch of flags. Yay for non scalable approaches!

I'm also starting to wonder if my one language to rule them all approach is a good idea. I use Python for most everything, with occasional calls into C for a couple libraries I need that don't exist in Python. Python interoperates natively with C, so this isn't a big deal. That said, it'd be nice to be able to call something mathy (Matlab, R, S+, even Mathematica), and there are about a billion things in Java that'd be nice to have.

I don't want to use Jython because I'm not convinced it has a future. The integration to the Ameritrade API is already as much code as my entire arbitrage program. Likewise, the cluster code is easily 3x the size of the arbitrage code. Then there's the market data scraper which is probably 5x the arbitrage code. Integration is hard... That said, I really like the idea of keeping it all in Python so this problem doesn't get worse.

I finally built a closet.

posted by ben on 09.03.21 at 12:19, null, London, 2 comments Permalink
Comment from: graham [Member] · http://nonplatonic.com/graham.php
So how did you end up building it? I'm a little disappointed that it's not 15 feet long.
Permalink 04/20/09 @ 11:15
Comment from: ben [Member] · http://ben.nonplatonic.com
I build everything. I'm awesome. Yay shit drills and 2x4s!
Permalink 04/20/09 @ 15:25

posted by ben on 09.03.20 at 18:30, null, null, books, Leave a comment Permalink

I've read the book. I love it. If there is some hint of how to find you in it, I've missed it. As GK Ashe probably isn't available, let's go get dinner some other ridiculous place!

?

posted by ben on 09.03.19 at 14:30, null, null, books, Leave a comment Permalink

The Road Home by Rose Tremain is to Strawberry Fields by Marina Lewycka
as
House of Meetings by Martin Amis is to Russian Debutante's Handbook by Gary Shteyngart

posted by ben on 09.03.18 at 13:53, null, null, Leave a comment Permalink
I wish I'd had the self control to not argue with PETA in the comments... to not immortalize myself with an improperly conjugated verb. Sigh.
posted by ben on 09.03.15 at 15:26, null, null, Leave a comment Permalink

In related flawed reasoning, there are trillions in outstanding lottery tickets. Every time a person buys a lottery ticket, the state is potentially obligated to pay millions of dollars. It's only a matter of time before everyone wins the lottery at once and the state is required to pay out millions to each of millions of lottery players.

End the lottery! It may seem like a boon to public resources now, but soon the bubble will burst and this house of cards will come tumbling down!

--------------------

"2. Derivatives are unregulated, not traded on any public exchange, without universal standards, dealt with by private agreement, not transparent, have no open bid/ask market, are unguaranteed, have no central clearing house, and are just not really tangible."

Um, no. Anyone heard of CBOE?

Photo from Chamonix...

posted by ben on 09.03.08 at 08:01, null, pictures, places, Leave a comment Permalink

Seems strangely familiar.

python: xml to dict, bow to my recursive genius

import xml.dom.minidom

def xmltodict(xmlstring):
	doc = xml.dom.minidom.parseString(xmlstring)
	return elementtodict(doc.documentElement)

def elementtodict(parent):
	child = parent.firstChild
	if (child.nodeType == xml.dom.minidom.Node.TEXT_NODE):
		return child.nodeValue

	d={}
	while child is not None:
		if (child.nodeType == xml.dom.minidom.Node.ELEMENT_NODE):
			try:
				d[child.tagName]
			except KeyError:
				d[child.tagName]=[]
			d[child.tagName].append(elementtodict(child))
		child = child.nextSibling
	return d

Updated: Fixed a bug that didn't like null nodes and another about whitespace, though I stole some code from an O'Reilly book for that.

import xml.dom.minidom

def xmltodict(xmlstring):
	doc = xml.dom.minidom.parseString(xmlstring)
	remove_whilespace_nodes(doc.documentElement)
	return elementtodict(doc.documentElement)

def elementtodict(parent):
	child = parent.firstChild
	if (not child):
		return None
	elif (child.nodeType == xml.dom.minidom.Node.TEXT_NODE):
		return child.nodeValue
	
	d={}
	while child is not None:
		if (child.nodeType == xml.dom.minidom.Node.ELEMENT_NODE):
			try:
				d[child.tagName]
			except KeyError:
				d[child.tagName]=[]
			d[child.tagName].append(elementtodict(child))
		child = child.nextSibling
	return d

def remove_whilespace_nodes(node, unlink=True):
	remove_list = []
	for child in node.childNodes:
		if child.nodeType == xml.dom.Node.TEXT_NODE and not child.data.strip():
			remove_list.append(child)
		elif child.hasChildNodes():
			remove_whilespace_nodes(child, unlink)
	for node in remove_list:
		node.parentNode.removeChild(node)
		if unlink:
			node.unlink()

Update 2: Someone already did this in the 2nd edition of the Python Cookbook. There's another one here too: http://code.activestate.com/recipes/116539/. So much for there only being one way to do something in Python...

Crumpets Royale

posted by ben on 09.02.01 at 16:33, null, null, food, pictures, Leave a comment Permalink

Program Trading

posted by ben on 09.02.01 at 14:29, null, null, ben tries to beat Livermore, 1 comment Permalink

It turns out there are more reasonable options between professional brokers and scraping yahoo, google, and Ameritrade pages:

http://www.interactivebrokers.com/ibg/main.php
http://www.tdameritrade.com/tradingtools/partnertools/api_dev.html

Comment from: JOHNNY JOHNNY [Visitor]
used to use IB.. they are not bad
Permalink 06/12/09 @ 04:28

Learning to Program - A letter to a post

If you want to make GUIs (Graphical User Interfaces), I think .NET is the best choice. Of course it restricts you to PCs. Java is a close second, and will work on a Mac.

For .NET, you'd want a copy of Visual Studio. The free express edition is available here: http://www.microsoft.com/Express/
For Java, go with Eclipse: http://www.eclipse.org/

If you want to make lots of little graphs and such, then I think you would be best off with Matlab, though Mathematica and R are close seconds. R is free, the other two are not. http://www.r-project.org/

Finally, if you just want to crunch numbers, manipulate things and generally understand how to program, I think Python is the answer. Python is going to be the easiest of all these to get started with. So you could try it and then switch to something else if you run into a wall. http://wiki.python.org/moin/BeginnersGuide/NonProgrammers

-----begin diatribe --------

You will see lots of this sort of thing in the programming community...

I'd avoid C, C++, JavaScript, Visual Basic, Excel, Objective C, Lisp, Scheme, Haskell, Ruby, any type of assembly, machine code, PHP, Perl, Pascal, and the people who will try to push them on you for a whole bunch of other ones for various reasons.

All that said, if you want to jump into Linux land for some reason, you are going to be forced to learn C. In fact, if you have a Mac you are already trapped in UNIX land, which is pretty similar to Linux land. If that's the case, maybe start with Python then and move over to C once you notice the limitations. This book is the best way to learn C.

Stay away from anything written by Bruce Eckel. His books will be confusing until well after you've learned to program.

last photo

posted by ben on 09.01.08 at 10:40, null, null, pictures, Leave a comment Permalink

I was going to document my crappy little studio in encruciating detail. However, my camera died after the first picture. It now takes very blue pictures:

Adjusting the contrast (in Photoshop) makes it look kind of neat (Why yes, I am bored. Thanks for asking.):

This blog seems to be all about navel gazing. I really don't like that phrase... or the sound of that sentence. Here's the post from the night I got the camera. If I remember correctly, I was staying at Austin's. Changes.

My poor camera was a Canon Elph SD110. 3.2 megapixels! It was a big step up from the junk Fuji I had before. I think that was 1.something. It didn't have a zoom, so you could turn it on very quickly and snap photos. I liked that.

From the file names, I know I took 1108 pictures with the Elph. Assuming it cost something like $200, that's about $0.18 per picture, or $6.50 for 36.

I also feel compelled to point out that I'm a little odd in the way I use digital cameras. I don't tend to take photos indiscriminently. The Elph has an intentionally tiny memory card, which forced me to use my precious 10 photos carefully. I like that, somehow.

When I try to load the camera application on my BlackBerry Curve I get an out of memory error. So, these are probably the last photos for a while.