Sanakreon

All the things I like

The most common English mistake that Japanese make

Of course Japanese make many mistakes when they speak English, as English is not their native language. But among those Japanese that are fluent in English, this mistake is the most widespread.

Basically, the mistake is that they use singular form of nouns where they should be using plural form. I guess this is because this concept of singular and plural forms does not exist in Japanese language. In Japanese, all nouns have only one form, which is used as both singular and plural. I first noticed it when talking with my Japanese ex-girlfriend, who can speak English very well. When saying that she likes something, she would say, for example, “I like orange”, instead of “I like oranges”. When I pointed this out to her, she said that she believes that this is the correct way. I then pointed her to this video with correct usage, and even though she says that she got scared, it seems that she learned her lesson.

This mistake is also widespread in Japanese academic environment, look for example here, it is a website for the department of creative informatics in Tokyo University. Look at the “Research Fields” in the “Faculty and Labs” table; it seems that they made this mistake in almost all the places that they possibly could.

November 30th, 2011 at 12:05 am

Posted in Japan

Internet naiveness test

So I made an internet naiveness test for you guys )

Check it out.

October 3rd, 2011 at 5:04 pm

Posted in Internet

A subtle advantage that guys have over girls

If a girl wants to initiate relationship, should she approach the guy herself, or should she follow the common tradition and wait for the guy to approach her?

Apparently most girls follow the second way.

As for guys, the culture dictates that they follow the first way.

And this gives us advantage.

But lets formalize this.

Say we have ten guys, and ten girls. Each guy ranks all the girls from 1 to 10, rank 1 being the most desirable to him. Each girl does the same.

Now lets leave them on an isolated island, and wait till they all choose a partner for themselves, where each girl is dating one guy and vice versa.

Now, if we wait some more, after some switches of partners they will actually turn out to be in stable relationships. And by stable relationships I mean the following:

No girl or guy can find anyone they would rather be with, who would rather be with them.

So basically in stable relationships, nobody can switch partners, because their current partner is the best they can get given the preferences of all the other people.

In fact this situation has been mathematically analyzed, it is called “Stable Marriage Problem”.

It has been proven, that for any given set of pairs of guys and girls, and their preferences, there always exists at least one way in which everybody can be in stable relationship. But usually there is more than one, and this is where the guys’ advantage kicks in.

The following are the consequences of Gale-Shapley algorithm, which provides some solutions to this problem.

If only guys propose, and girls only choose between the guys who proposed to them, this situation will eventually lead into a stable relationship. But this stable relationship will favor the guys to the maximum. That is, if an average guy will date a girl which is Xth in his ranking, then average girl will date a guy which is worse than Xth in her ranking, in fact as worse as possible for any stable relationship.

So, if only guys propose, the girls will end up in the worst possible for them stable relationships.

But if only the girls propose, then they will end up in the best possible for them stable relationships, because it is a mirror situation.

So basically those who propose end up in the best situation possible after all the partner switching is done and everyone has settled down. Since guys are generally the ones who propose, we have been enjoying this advantage for many centuries.

Now you know the secret )

July 15th, 2011 at 12:17 am

Posted in Algorithms

Theme

In case you are wondering why my site looks so incredibly cool, well, that is because I use a slightly modified theme from a designer named Lucian Marin. I’ve been searching for minimalist themes, and I think this one looks the best. He seems to be interested in Japan too, so I hope one day he will make some minimalist themes with Japanese motifs as well.

June 5th, 2011 at 8:46 pm

Posted in Uncategorized

First 50 problems of projecteuler.net in python

I have been doing projecteuler.net challenges lately.

Here are my solutions in Python for the first 50 challenges. First 10 are in Python 2, others in Python 3. Each of them takes under 2 seconds to run. I can see how many of them could be optimized further, but they are already fast enough. About 1300 lines in total.

I have separated common functions into EulerLib library which is given at the end of the file.

June 3rd, 2011 at 1:49 pm

Posted in Programming

PySchools and CodingBat

As an effort to practice python, I have been doing CodingBat and PySchools challenges.

Finally, today I finished all the challenges, totally there were more than 250 in these two combined. I don’t know how justified is that, but I am now in the first place of PySchools worldwide ranking )

The guy who made CodingBat is Nick Parlante, the same person who made the Google Python Class videos which were my gateway into learning python. He is making other cool things too, for example this.

May 22nd, 2011 at 7:25 am

Posted in Programming

Some interesting modern programming languages

There is a ton of various new programming languages nowadays, but here are the ones that I found interesting:

Clojure: LISP-like, compiles to JVM

XLR: very new, not famous at all. Concept-programming, syntax similar to  python, but even cleaner. Aims to make path from concept to implementation as short as possible. I really hope that this takes off.

Erlang: (distributed). Apparently it is easy to write parallel, distributed applications using Erlang. As far as i know, Facebook chat is written in Erlang.

Scala (scalable, compiles to JVM). Twitter was originally written in Ruby, but then they switched to Scala. So if you are the size of Twitter you should consider it ). Nowadays new startups like to use Scala because it makes them appear more scalable to venture funds. They also use NoSQL databases like Cassandra or MongoDB for the same reason.

Processing: graphical. As far as I understood, you get a plane and you can draw there algorithmically using processing programming language. This seems to be popular with designers.

HaXe: Syntax is similar to Javascript and ActionScript. The code written in HaXe can compile to C++, ActionScript, JavaScript, Flash, PHP, and soon hopefully even Java and C#. This “code once, deploy everywhere” idea is very nice, though I don’t like HaXe syntax much.

J: A descendant of APL but without all those non-ascii characters(which actually makes J even less readable than APL). J is write-only language ). It is easy to write programs, as you don’t need to type a lot. But it is damn hard to read others code. To mess with your brain even more, J is read from right to left.

Here is an example of J one-liner. You decide for yourself whether you like it or not )

quicksort=: (($:@(<#[) , (=#[) , $:@(>#[)) ({~ ?@#)) ^: (1<#)

May 17th, 2011 at 5:39 pm

Posted in Programming

How internet changed recently

Lately I’ve been wondering how did the internet landscape change in the last 2-3 years. So I wrote a short python script to compile a list of websites that are in top 5000 most popular websites this year, but were not in the top 200,000 most popular websites in 2008. So basically it is a list of popular websites that appeared (or became popular) in the last 2-3 years. Totally there are 821 such websites, and here is a list of them. Popularity data is taken as provided by alexa.com.

Some of these are adult websites(beware!), some of these are not in English language. But many are useful websites which existence you may not have known.

Popularity is measured by the number of connections to the website. These are not necessary when the user visits example.com, but may happen when the website that user visits connects to example.com, as in the case with googleusercontent.com.

First is popularity(alexa) rank(lower is better), then domain name.

The first 10 are:

5 blogspot.com

21 bing.com

32 googleusercontent.com

79 weibo.com

84 renren.com

95 fileserve.com

101 tmall.com

114 hotfile.com

119 imgur.com

127 stackoverflow.com

May 15th, 2011 at 11:15 pm

Posted in Data Mining

HostGator

Huge thanks to HostGator for migrating my site to their servers )

May 9th, 2011 at 1:33 am

Posted in Uncategorized

Building Expert Systems in Prolog

I found this interesting guide for building expert systems in Prolog: http://www.amzi.com/ExpertSystemsInProlog/

I will try to follow it, and hopefully make my first expert system from scratch. This way of building expert systems is probably the hardest way, but it will make me understand how does it really work. One of the much easier ways is to use tools for building expert systems like CLIPS, or if done in Python, then pyCLIPS: a Python module for CLIPS.

Why do I want to learn how to build expert systems? The reason is that expert systems are the best way to analyze and make conclusions based on large amounts of data. Nowadays there is a lot of open data, but people don’t know how to use it effectively. I think that data mining, building large databases, and then analyzing it with expert systems will yield a lot of very interesting and useful results.

August 12th, 2010 at 7:39 pm

Posted in AI