Restaurants, immigrants, and the popularity of various cuisines

A little off-topic exercise conducted in the “eye of the storm”, when Ilenia and Helen were still in the hospital:

A post on Seth Robert’s blog brings up the idea that many Chinese restaurants were opened as a way to go into business without competing with native male workers. The post made the rounds of several other online journals.

That was the push I needed to get up and go collect a few statistics of my own, regarding an idea I’ve been kicking around for a while. My theory is that the number of restaurants of a given type, divided by the number of immigrants from that country might be an interesting way of guaging the popularity of the cuisine in question.

In order to simplify things just a bit, I actually used data from Italy, for the following reasons:

  • Most immigration to Italy is pretty recent, so it’s not necessary to account for the length of time different immigrant groups have been present, and the effects that may have had on the diffusion of a given cuisine.

  • Immigration statistics were readily available: http://demo.istat.it/str2006/index.html

  • Italian the language almost completely corresponds to Italy the country (outside of a chunk of Switzerland, San Marino, and the Vatican), something that makes things that much easier.

  • I speak Italian, so it was easy to find out all the information I needed

Unfortunately, finding out the number of restaurants of various types is far from an exact measurement, and since this is a quick fun project, I just went for Yahoo search (they deserve credit for keeping their search API open when Google’s was closed) results on terms like “Ristorante Turco” (Turkish), “Ristorante Messicano” (Mexican), and so on. This was the most expedient means of gathering information quickly, but this approach does present a number of obvious problems, listed here in the hope that someone without diapers to change and a business to run might come up with some good answers:

  • Some hits likely come from people talking about a restaurant that happens to be in a country, like “ristorante americano”. “Nel tipico ristorante americano, ….” or in other words, “In a typical American restaurant”, rather than an American-style restaurant in Italy, which is what we were looking for in the first place. This is probably also true of countries close to Italy, where people go on vacation and thus have occasion to write about their experiences in a “ristorante tedesco” (German), rather than going to eat in a German restaurant in Italy. Perhaps the search query could be improved in an attempt to eliminate this sort of false positive.

  • Some restaurants probably are not known as, nor brand themselves with a country name, but instead utilize titles like “Middle Eastern”, “Arab”, “South American”, “African”, or others that do not correspond with any one country in particular. It would be possible to group countries together with other adjectives, and get statistics for these clusters as well.

  • Measuring hits is measuring what people are talking about, rather than simply restaurants that exist, so if restaurants from a certain country are more talked about than others, that would muddy the statistics a bit. However, it seems reasonable that people would mostly talk about restaurants in proportion to their popularity, and I don’t see a particular reason why there would be more talk of Vietnamese restaurants, say, than Thai restaurants, compared to the actual numbers.

That said, for a quick project, this approach seemed to work out ok, and the results appear credible. Obviously, the results also reflect people discussing certain cuisines, rather than an actual number of restaurants, but since it does reflect interest, we’ll use the number in any case.

Since the number of restaurants/interest in a type of restaurant was clearly not correlated directly with the number of immigrants, other factors must come into play. For instance, “ristorante giapponese” turns up 125,000 hits, but the stats say only 6873 Japanese nationals live in Italy. As above, hits don’t mean actual restaurants, but clearly Japanese cuisine is not being popularized through immigration.

Here’s my guess: these statistics show, to some degree, what people in the host country actually like to eat. Food that tastes good means more restaurants. Things that aren’t that popular mean few restaurants, even if there are many immigrants. To pick on one country, there are many Philippino immigrants in Italy, but very few search hits – and anecdotally, I’ve never seen a Philippino restaurant in Italy either, whereas even smaller towns like Padova have Chinese, Mexican (well, it’s called that, even if it’s a shadow of the real thing), Japanese, various Arab and middle eastern restaurants, and even a few less common things like Eritrean. And I know that many native and foreign restaurants employ Philippino cooks.

Below is the chart I whipped up showing the number of Yahoo hits per immigrant. The Italian names shouldn’t be too hard to figure out. A few tricky ones: Giordano-Jordanian, Giamaicano-Jamaican, Spagnolo-Spanish. If you’re interested in numbers or source code, contact me.

Immigrants and Restaurants

LangPop.com – programming language popularity – update

These few days when Ilenia and Helen are still in the hospital are the eye of the storm for me. It’s quiet at home and I actually have a few free hours when I’m not allowed to be in the hospital, or when they need to get some rest.

One of the things I managed to do recently was some Javascript hacking in order to create a timeline for LangPop.com: http://www.langpop.com/timeline.html. It was fun, because most of the “heavy lifting” is done by Timeplot, and I just had to push the data into place. Of course, there isn’t much interesting there because the site is relatively new, but it should be interesting to see how languages fare over time.

I did some hacking on Timeplot to make it easier to host it on my own server, and to load a bit faster by stuffing it into one big ugly blob of Javascript. When I get a bit of time, I’ll make my changes public, as I think they’re fairly useful for anyone who wants to fiddle around with Timeplot some, and thus host it themselves.

The other thing I did with the site was switch the X and Y axis of the charts, because that works out better in terms of screen space for the labels, with so many languages to keep track of.

Hypothetical Hecl

I did some ‘playing’ with Hecl the other day, to see what it might look like if implemented in a slightly different way, and I thought I’d share what I was thinking about. Keep in mind that

  1. I haven’t thought this through completely:-)

  2. It’s not something I’m going to just rush out and do in the near future. It’s definitely a Hecl 2.0 sort of idea.

My notion was to make use of the ClassCommand feature to have at least simple types be hooked directly to the relevant Java types, and dealt with through methods, rather than commands. For instance:

$i + 10

instead of

+ $i 10

Where $i is, in the first case, a Java Integer, rather than a Hecl type.

What it would be doing internally is something like this:

  1. $i is recognized as the object to act on.

  2. It’s an Integer, so the corresponding ClassCommand is looked up and executed with + and 10 as arguments.

  3. The classcommand for Integer has a + method that accepts an argument, in this case, 10, which is added to the value of $i, and returned as a new Integer.

Without a “real” (where real also means bloated, memory and space hungry) parser, Hecl is never going to have a C-like syntax – you still wouldn’t be able to do foo = 1 + 2 + 3 – but this just might make a significant amount of people more comfortable with Hecl, which would be a good thing. You could do something like this:

set i 1

while { $i < 1000000 } {
    set i [$i + 1]
}

instead of

set i 1

while { < $i 1000000 } {
    set i [+ $i 1]
}

I actually built a really simple HeclInteger class that implements <
and + as methods to Integer ObjectThings, in order to test out this idea, and it seems to run about as fast as the regular Hecl version.

I welcome any thoughts or comments on the idea.

Sometimes I’m reminded just how cool the internet is

I’m just old enough to have only discovered the internet at about the time I graduated from high school, and have been using it for about 15 years. Every once in a while though, it comes back and hits me just how cool the whole thing is. Not “yeah, neat”, but a serious wow at just how amazing it is to be able to communicate with people the world over. I think the first time that happened was when I had been exploring some of the early nineties internet – gopher and the web with lynx. Which was neat, but not in the “wow” sense. Then I stumbled on to IRC somehow, and since at the time I’d already started taking Italian courses, I thought I’d see if there was an Italian channel. There was, and I think the conversation went something like this:

me: so, where are you guys?

someone: Italy, and you?

me: Oregon, but, no, seriously, where are you?

someone: Italy!

me: Seriously?!

It was a very concrete demonstration of the fact, that, thanks to this new thing, I could talk to people all over the world, for free!

Of course I’ve grown used to this, and take for granted that I can call my parents in Oregon via Skype for free, and a lot of other cool things, but once in a while something makes me take a step back and say “cool!”.

Most recently, a web site I follow that I follow has had an interesting back and forth between Paul Graham and David Heinemeier Hansson, with additional comments by the likes of Paul Buchheit, which, agree or disagree with their modus operandi, is an impressive cast of characters to be able to interact with, and learn from, without moving from my perch up here in the middle of the Tyrolean Alps.

XML handling for Hecl

We received an interesting contribution to Hecl recently: Martin Mainusch put together a Hecl interface to kxml, and also sent in some demo code that fetches and parses weather forecast information. I thought it was pretty cool:

Hecl Weather Forecast

Note that it’s not compiled into the default build, so you have to change a property from 0 to 1 and recompile, and…being new there might be some issues, but still, it’s nice to have that to let people play around with simple “web service” type things that use XML. Of course, another strategy might be to have a ‘proxy’ server that fetches the actual XML, and returns a tagged Hecl list so that Hecl can parse it directly, but that requires a server and has more overhead.

To a good home: Linux Incompatibility List

I originally had the idea for a list to keep track of stuff that doesn’t work with Linux something like 12 years ago. I built an initial version, that proved reasonably popular at the time, but then the place it was hosted had some problems, and I was busy with other things. I finally got around to building a new version four or five years ago, and it’s been doing ok since then, but with a baby on the way, I’ve been thinking of things to get rid of, and this is not something I do active work on, so maybe it would be best to find a new home for the site, located at http://www.leenooks.com.

Here’s the catch:

  • Whoever gets it has to promise to maintain it as essentially what it is today – you have to continue to provide information about hardware that does not function with Linux, or only functions with proprietary drivers.

  • It does generate some money, that I put towards the server where it’s hosted. I wouldn’t mind selling it for something, which will hopefully encourage only those truly interested to apply. It could probably generate more money if it were plastered with a bunch of ugly ads, or, hopefully, if more time and effort were put into it than I have at the moment.

It currently runs on my own server, and uses DedaWiki, an open source, Rails-based Wiki, as well as PostgreSQL. You would have to relocate it to your own server.

So, if you’re interested, contact me: davidw@dedasys.com.

If I don’t find the right person, no worries; I’ll keep maintaining it for a while yet.

“Open Source” Akismet or Defensio?

I have a bad habit of getting caught up in side projects – I love to build stuff, and open see opportunities to engage in this hobby. A site I’ve run for a while is the Linux Incompatibility List, which also led me to create my own Rails based wiki for it, DedaWiki, which is of course open source (and could use some more attention).

However, things are getting badly on the spam front, and it’s time to find a better solution than hacking at my own anti-spam code. Two systems that look good are Akismet, which I use successfully for this journal, and Defensio. However, being the impractical guy that I am, I am also curious if there are what we might call ‘open source’ efforts in this area. I’m not sure what that would look like, since there’s probably strength in numbers, and a hosted solution is certainly easier. Also, it seems the incentives in an arms race like anti-spam are in favor of the quick turnaround that a small, smart, dedicated team can provide. Also… a bit of security through obscurity in an arms race type situation probably doesn’t hurt, since there’s often going to be a way around anything that’s not locked down (and part of the value of a journal like this is in the comments), and letting people see exactly what numbers and ratios and metrics are being used is going to help the bad guys.

Anyone able to point me to something that proves me wrong?

Hecl Jacta Est

I don’t know if androids dream of electric sheep, but I’ve certainly been losing a lot of sleep over Google’s Android, and am glad that the Android Developer Challenge is winding up, as I’ve been doing all Android, all the time for the past month or so.

I have greatly enjoyed working with Android, as it’s much more capable than Java ME. It’s still very much a work in progress, and only time will tell if Google and their partners are able to best current mobile programming systems… or if the web will simply obviate the whole thing, as it’s doing in many other areas. Win or lose, I will continue to support Android as a platform that Hecl runs on, but in the meantime, I hope to go back and look at some less future-oriented code and get back to some Java ME work. More on that soon…

In any case, here’s hoping that the contest judges see the value in bringing a scripting language to mobile phones! I also hope to see actual hardware soon, as I’m really looking forward to getting my own Android phone.

Google App Engine as Ford?

A passing thought:

Would it be fair to compare Google’s App Engine to Ford’s assembly line, in a roundabout sort of way? Ford’s mass produced cars put cars within reach of many more people, and over time, put paid to the many custom car producers who didn’t adapt. Google’s App Engine is a way for people to easily scale their web applications in a way that wasn’t possible until now. No fiddling with EC2 images, or hosting, or a bunch of other stuff that, for the time being will still drive people to want to control their own infrastructure, but the prospect of very cheap hosting and very easy scaling is potentially something that will change things significantly.