May 27, 2009

IMAP protocol and server

I realized that IMAP is a really complex protocol with problems like support for concurrent command processing, aside from the extensive list of commands. So, command parser, session manager and request handler are necessary. For example,

LSUB "#news." "comp.mail.*"
A654 FETCH 2:4 (FLAGS BODY[HEADER.FIELDS (DATE FROM)])

Fortunately , There are some open source projects related with IMAP.

- Apache James, fully featured mail server
- Green Mail, mail server, supports SMTP, POP3, IMAP with SSL
- JIMAP, java based implementation of the IMAP protocol

According to Robert Burrell Donkin which is a member of ASF, "As far as James IMAP goes, the protocol handlers are fine. The Mailbox implementations need more work (but that's on my list for this week).".

May 19, 2009

The secrets of fast mental arithmetic

The 'Britain´s Got Talent' of south korea, 'Star King' introduced the expert of mental arithmetic. She did quick mental arithmetic to calculate large integer numbers in only a few seconds. For example, 258,785,412,354 + 125,465,871,235 + 954,125,487,965 - 845,123,658,792 * 542,136,587,212 ... = ?

I was very impressed. According to She, "I did calculate them with an imaginary abacus".



OK, The abacus-based mental calculation is the recipe. Generally, we learned to calculate multi-digit numbers from right to left, one digit at a time. It's a carry/serial calculation. But Her (abacus) algorithm is little different from us. It's the shift-up/parallel calculation.

May 14, 2009

Frobenius norm with Hama

Recently, The Frobenius norm was nicely implemented as below by Samuel, which is the one of Hama committers. The Frobenius norm is submultiplicative and is very useful for linear algebra. This norm is often easier to compute than induced norms.


/** Frobenius Norm Mapper */
public static class MatrixFrobeniusNormMapper extends MapReduceBase implements
MatrixNormMapper {
@Override
public void map(IntWritable key, MapWritable value,
OutputCollector output, Reporter reporter)
throws IOException {
double rowSqrtSum = 0;
for (Map.Entry e : value.entrySet()) {
double cellValue = ((DoubleEntry) e.getValue()).getValue();
rowSqrtSum += (cellValue * cellValue);
}

nValue.set(rowSqrtSum);
output.collect(nKey, nValue);
}
}

/** Frobenius Norm Combiner */
public static class MatrixFrobeniusNormCombiner extends MapReduceBase
implements MatrixNormReducer {
private double sqrtSum = 0;

@Override
public void reduce(IntWritable key, Iterator values,
OutputCollector output, Reporter reporter)
throws IOException {
while (values.hasNext()) {
sqrtSum += values.next().get();
}
// Note: Tricky here. As we known, we collect each row's sum with key(-1).
// the reduce will just iterate through one key (-1)
// so we collect the max sum-value here
nValue.set(sqrtSum);
output.collect(nKey, nValue);
}
}


You can see this performance on this page

Google support RDFa and Microformats

http://ebiquity.umbc.edu/blogger/2009/05/12/google-support-rdfa-and-microformats/

May 13, 2009

Meeting with the CTO of Sun Japan

I was in a meeting with the CTO of Sun Japan today. He visited me and wanted to know the possibility of Hama deployment into scientific/HPC computing area with Hadoop.

Since it's too early stage, there was not much talk/plan. but I felt sure that it'll really valuable if implemented. It was a delight to talk with him.

May 11, 2009

Psychologists Are Better Stockmarket Speculators Than Economists

Below report shows that the stock is not so much a science as a gamble. ;)

----
From: http://www.medicalnewstoday.com/articles/35953.php

Shareholders seem to be swayed by the buying pattern of other shareholders much less than has hitherto been assumed. This at least is the conclusion arrived at by economists of the Bank of England and the universities of Heidelberg and Bonn. Together with the corporate consultants McKinsey they scrutinised the share-buying behaviour of about 6,500 persons in an Internet experiment. They found no signs of ‘herd instinct’ during the experiment - on the contrary, some of the test subjects decided against buying those specific shares which had just been bought by so many other players. Psychologists, particularly, mistrusted those shares which they regarded as overvalued. This strategy benefited them enormously: on average they were markedly more successful in their speculation than physicists or mathematicians - or even economists.

On average the psychologists earned three times as much as economists and physicists in the stock exchange game. ‘They tended to decide against buying shares precisely when a lot of other players had bought them,’ Dr. Andreas Roider of the University of Bonn’s Economics Department explains. Many discussions up to now have assumed the opposite: investors, it was thought, behave like lemmings. They always buy those shares which are most in demand at a particular time, thereby pushing the share prices too high (or too low). Hardly any explanation of the turbulences on the financial markets are without some reference to the marked predisposition to the herd instinct which allegedly investors show. Yet it might also be the case that each investor has decided in favour of buying independently of the behaviour of other investors - for example, because information has become available about a particular share which argues in favour of buying. Whether shareholders really are influenced by the ‘herd instinct’ is therefore hard to determine in practice.

An economic experiment under controlled conditions was meant to help clarify this issue. Together with corporate consultants McKinsey Professor Jörg Oechssler of the University of Heidelberg with his co-authors Dr. Andreas Roider and Dr. Matthias Drehmann of the Bank of England carried out a financial markets game via the Internet. In it just under 6,500 participants were able to deal in different stocks and shares. Prizes amounting to over 11,000 euros ensured that the game was taken seriously.

‘The players were able to decide in favour of two fictitious shares A and B,’ Dr. Roider explains. ‘Only one share turned up a profit at the end of the game, the other being a dud.’ Before making a decision to buy each participant was given a tip by their investment banker, e.g. ‘Share A is a winner.’ However, these tips were only true in two out of three cases - even investment bankers can make mistakes. As soon as a player had decided in favour of a specific share, the share rose in price. ‘The players could now buy their shares consecutively,’ Dr. Roider says. ‘The first one was only able to rely on the investment banker’s tip. The subsequent buyers, by contrast, were also able to see from the share index what shares their predecessors had chosen.

One million flies can’t be wrong

In a situation like this even a ‘bad’ share can soar dramatically in price - simply because a lot of people choose it. Assuming the first two players get the tip to buy share A from their investment banker, even if player 3 then gets a tip to choose share B, that player may decide in favour of A - after all, his predecessors have apparently been tipped off to choose this share. Player 4, taking as a motto ‘one million flies can’t be wrong’, will find it very difficult to buck the trend and choose share B. The result is that the herd instinct sends the value of share A up to dizzying - and ultimately irrational - heights.

In the experiment, however, those involved by no means followed blindly the behaviour of previous investors. - quite the contrary. As a rule the participants mainly allowed themselves to be influenced in their choice of share by their adviser’s tip. In fact, many investors made a conscious decision to buck the trend, thereby contributing to a stabilisation of the share prices. ‘This can of course be perfectly sensible if you think that the share is currently overpriced and that this is partly due to the irrational behaviour of earlier investors,’ says Dr. Roider. The psychologists, particularly, seemed to ascribe share prices to these sorts of ‘psychological’ effects. Their intuition about the possibly irrational behaviour of other investors meant that they made bigger profits. By contrast, players who had studied Physics seemed to rely on the cool rationality of other participants - and thus fared worse.

Dr. Andreas Roider
roider@uni-bonn.de
University of Bonn
http://www.uni-bonn.de

May 10, 2009

The spammer is a potential advertiser?

I have once thought that the spammer is a potential advertiser, fighting with spammers. Basically, they want to advertise on mail infra-. Should we only block them? Is there a way to convert them to advertiser?

May 7, 2009

Be distressed by excessive work

Commonly I make up my mind easily. I'm not on the horns of a dilemma very often. But, I'm not right now. Lately, I've been considering of going back to school (Or other nice company which could provide me some time for my research) since the lack of time for my open source works / researches and my free time distresses me deeply.

By far, workers in South Korea have the longest work hours among OECD countries. The average South Korean works 2,390 hours each year, according to the OECD. This is over 400 hours longer than the next longest-working country and 34% more hours than the average in the United States.

NHN, corp. is good company, but do you know that NHN, corp. is in Korea? ;(

May 3, 2009

Movie: The Happening 2008

Today, I watched this movie and personally I think it's not bad.




The film opens in New York. People start to get confused in Central Park, repeating their words, standing still and sometimes walking backwards. We hear a few screams. A woman reading on a bench takes her silver chopstick-style hair pin out of her hair and stabs herself in the neck with it.

The plant's chemical defenses were the culprit. That insight seems based on 'New Study Sheds Light on Plants’ Nighttime Defense'.