Saturday 24 July 2010

Chinese chip flavours

Something I find myself noticing in different countries, is the range of potato chip flavours available there. Iceland had paprika flavour, and salt and pepper flavour. The United States had.. well, I don't remember, but I remember them not tasting very flavourful. Now in China, they pull out all the stops.

Hot & Sour Fish Soup Flavor.

2010-07-05 - Hot and sour fish soup - 01 - Bag

This didn't taste especially worthwhile. In fact, the sweet aspect of the flavour was unpleasant. Sweet fruit flavours for chips are actually popular. I think lime and kiwifruit were some I recall seeing and passing up.

Numb & Spicy Hot Pot Flavor.

2010-07-05 - Numb and spicy chips - 01 - Bag

These were okay. However, they were neither especially numbing or especially spicy. There are a lot of biscuits or chips I try these days that I find unspectacular and end up throwing out. These weren't mediocre like that, and I finished the packet.

Scaffolding China style

Back home the scaffolding would be metal poles probably holding up metal grates, with copious rails. Maybe even some netting around the outside, to prevent people falling out. None of that shit in China, or at least Shanghai. Every building I have seen under construction here has a few bamboo poles tied around it for the workers to climb on.

2010-07-18 - Chinese scaffolding - 01 - Building

Qibao Ancient Town

Decided to see some sights with a friend, so we googled for interesting places to see in Shanghai. One of the recommended locations was Qibao, which is supposed to be some river town or something.

Anyway, there was a river and it had boats that middle-aged women worked as gondeliers on. We took a ride on one, for 10 yuan. A short trip down one direction, then back under the bridge in the other.. and that was it. Definitely worth it, even if only to sit down somewhere cool away from the crowds and enjoy the view. Got asked to take a photo of some asian couple, don't know why they had to ask me as I can barely operate my own camera let alone random other models belonging to other people.

A view from the boat.. of another boat.

2010-07-19 - Qibao Ancient Town - 10 - Another boat

The canal bridge looked uncrowded as we passed under it.

2010-07-19 - Qibao Ancient Town - 09 - Canal bridge

In order to get to the river, you walk down narrow alleyways on the sides of which are shops that sell clothing and knick-nacks. Then you cross over a bridge to more alleyways where the shops sell food.

I don't know what this dude is selling.

2010-07-19 - Qibao Ancient Town - 01 - Miscellaneous food

This shop solds various meats on a stick, including birds. We weren't game enough to try them.

2010-07-19 - Qibao Ancient Town - 02 - Meat on a stick

I bought two different things. The first was some kind of pancake, which was egg and other stuff mixed with vegetables. There was also red chilli pepper in it. Delicious. Accidentally deleted that photo, so have a picture of disappointing pork bread thing that I threw out the rest of.

2010-07-19 - Qibao Ancient Town - 04 - Meat bread

Observe the amount of pork inside it.

2010-07-19 - Qibao Ancient Town - 05 - Meat bread meat deficient

Here's the place where we bought the food, which was a little less crowded than the alleyways which led there. Although this one was almost twice as wide. As you see here, people use umbrellas on a hot day to shelter from the sun. Was talking to a chinese guy at work and he said his wife went to university in NZ and she thought the sun was to strong there. Walking around as we did in Qibao without sunscreen, I am pretty sure on an equally sunny day back in New Zealand we would have been sunburnt. Anyway.. you can see people walking with umbrellas here on a sunny day, that's my point.

2010-07-19 - Qibao Ancient Town - 08 - Crowds

One interesting looking food we saw, were these pies. At least I think they were pies. They oozed this tar like grease, or at least that's what they looked like they were doing. People were buying them, so they must have been okay. Really we should have bought one, simply because the point of going to places like this is to eat fucked up looking shit.

2010-07-19 - Qibao Ancient Town - 06 - It looks like a meat pie

This shop was selling fried pancakes or something.

2010-07-19 - Qibao Ancient Town - 07 - Fried foods

While it was definitely worth taking the long subway ride out to see it, the experience lacked authenticity. It felt like a tourist attraction, rather than an actual place you go and see where people go about their business. But I guess, if it wasn't the latter then it wouldn't exist any more. Reading wikipedia now, I see that the specialty of the place is crickets. My only regret about the place now, is that I didn't know it then so I could look for and try some. I think I can live with not eating bird on a stick. Especially after going to a restaurant on Tuesday and choking on a wishbone.

Apartment view

The serviced apartment I am staying in has a great balcony, where the warm temperatures here are made more comfortable by the wind you get at this height.

The view forwards and right respectively, at the end of the day:

2010-07-19 - Apartment - 01 - View 2010-07-19 - Apartment - 02 - View

While for the first week there were gray skies, and there have been two or three days with downpours, pretty much every other day so far has been warm with blue skies.

Tuesday 20 July 2010

Object memory use in Python

There's a number of libraries and tips for working out how much memory a Python object is using. Some solutions seem to try and analyse what data structures are used within the object, and calculate based on that. Others attempt rough approximation, like just going by the size of the pickled representation of an object.

This is how I used to be able to do it:

def GetMemoryUsage(ob):
s = cPickle.dumps(ob)
memUsed = sys.getpymemalloced()
ob2 = cPickle.loads(s)
return sys.getpymemalloced() - memUsed
Of course, there is no getpymemalloced method in the sys module that comes with a Python installation. This was a custom method provided by a patched version of Python that did the required calculations based on the internal memory allocation structures.

There isn't even an API function that can be abused to do this, with this custom function absent. Well, there is one, but it generates a block of text which includes this information for debug builds.

Downloading Python from China (or not)

  1. Browse to www.python.org.
  2. Click on DOWNLOAD.
  3. Get a blank page.
I wonder why this page is not accessible through the great firewall of China? I've tried this both at work, and at home, through two different connections.

Getting the download link, and manually entering that as a URL in firefox does not suffer from the same problem. Which is just as well, as downloading through a VPN is rather slow.