<?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-8168049245789156620</id><updated>2012-02-16T11:07:04.584-08:00</updated><title type='text'>Chamila Ruwanjith Piyasena</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://chamilar.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://chamilar.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Chamila Ruwanjith Piyasena</name><uri>http://www.blogger.com/profile/01668832177553429309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp0.blogger.com/_0vEtdezoWWI/R58GQySAHnI/AAAAAAAAA04/jrlwozwzeTA/S220/Cka.lr259966-02.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8168049245789156620.post-8821831156303848818</id><published>2008-09-03T04:03:00.000-07:00</published><updated>2008-09-03T04:12:13.893-07:00</updated><title type='text'></title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="line-height: 115%;font-size:14;" &gt;gen_tcp {packet, http}  mode  -  Erlang &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This is a very useful undocumented feature in Erlang and very soon they are going to make it official.  But there is nothing  to refer in erlang documentation yet, So i thought of writing someting about this. Yaws uses this mode very largely and also, &lt;a href="http://www.trapexit.org/A_fast_web_server_demonstrating_some_undocumented_Erlang_features" target="_blank"&gt;&lt;span class="nfakpe"&gt;&lt;span style="text-decoration: none;"&gt;http&lt;/span&gt;&lt;/span&gt;://www.trapexit.org/A_&lt;wbr&gt;fast_web_server_demonstrating_&lt;wbr&gt;some_undocumented_Erlang_&lt;wbr&gt;features&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;is a good resource for the people who are further interested in about this mode. &lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;In this  mode the http header lines are comming line by line and in a  format which is very easy to decode and use.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="line-height: 115%;font-size:12;" &gt;Passive mode:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;You can turn your socket in to passive mode by setting the option {active, false}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Request &lt;span style=""&gt; &lt;/span&gt;line:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;{ok, {http_request, Method, { absoluteURI, http, URL, undefined, Rest}, {Maj, Min}}}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Method – GET, POST, etc&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Keep in mind the full PATH you want to get is:&lt;span style=""&gt;  &lt;/span&gt;URL ++ Rest&lt;/p&gt;  &lt;p class="MsoNormal"&gt;{Maj, MIN} is the digits of the http version (i.e: {1, 1} for HTTP/1.1, {1, 0} for HTTP/1.0) , Maj-Min-integer&lt;/p&gt;  &lt;p class="MsoNormal"&gt;A sample request line is given below,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;{ok,{http_request,'GET',{absoluteURI,http,"www.google.com",undefined,&lt;/p&gt;&lt;p class="MsoNormal"&gt;"/"},{1,0}}}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Header lines:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;{ok, {http_header,&lt;span style=""&gt;  &lt;/span&gt;_Num, &lt;span style=""&gt; &lt;/span&gt;Header_Name, &lt;span style=""&gt; &lt;/span&gt;undefined, Value}}&lt;span style=""&gt;  &lt;/span&gt;- This is common for both request and response. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Header_Name - name of the header usually an atom but for user defined headers it can be a string.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Value - value of the header (string)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;End of header:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;{ok, http _eoh} – This is common for both request and response.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Response Line:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;{ok, {http_response,&lt;span style=""&gt;  &lt;/span&gt;{Maj, Min}, Code, ResContent}}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;{Maj, Min} – Same as in Request line. &lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Code – http status code (e.g: 100, 200) - integer&lt;/p&gt;  &lt;p class="MsoNormal"&gt;ResContent – the status code description. (e.g: OK, Moved temporary) - string&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="line-height: 115%;font-size:12;" &gt;Active mode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;tuples like this in active mode:&lt;br /&gt;&lt;br /&gt;{http_request, Socket, ...}&lt;br /&gt;{http_response, Socket, ...}&lt;br /&gt;{http_header, Socket, ...}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The other fields will be same as the passive mode. But in future they are going to change this to the following,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;{&lt;span class="nfakpe"&gt;http&lt;/span&gt;, Socket, {http_request, ...}}&lt;br /&gt;{&lt;span class="nfakpe"&gt;http&lt;/span&gt;, Socket, {http_response, ...}}&lt;br /&gt;{&lt;span class="nfakpe"&gt;http&lt;/span&gt;, Socket, {http_header, ...}}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The purpose is to make the inner tuples look the same regardless of how they were received.&lt;b style=""&gt;&lt;span style="line-height: 115%;font-size:12;" &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8168049245789156620-8821831156303848818?l=chamilar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chamilar.blogspot.com/feeds/8821831156303848818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8168049245789156620&amp;postID=8821831156303848818' title='34 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/8821831156303848818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/8821831156303848818'/><link rel='alternate' type='text/html' href='http://chamilar.blogspot.com/2008/09/gentcp-packet-http-mode-erlang-this-is.html' title=''/><author><name>Chamila Ruwanjith Piyasena</name><uri>http://www.blogger.com/profile/01668832177553429309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp0.blogger.com/_0vEtdezoWWI/R58GQySAHnI/AAAAAAAAA04/jrlwozwzeTA/S220/Cka.lr259966-02.jpg'/></author><thr:total>34</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8168049245789156620.post-2485688566084939214</id><published>2008-05-14T04:18:00.000-07:00</published><updated>2008-05-14T04:32:48.277-07:00</updated><title type='text'>Five Reasons why you should learn Erlang</title><content type='html'>Here are the 5 resons why you should learn Erlang according to Joe Armstrong who is also the creator of Erlang&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;• You want to write programs that run faster when you run them on&lt;br /&gt;a multicore computer.&lt;br /&gt;• You want to write fault-tolerant applications that can be modified&lt;br /&gt;without taking them out of service.&lt;br /&gt;• You’ve heard about “functional programming” and you’re wondering&lt;br /&gt;whether the techniques really work.&lt;br /&gt;• You want to use a language that has been battle tested in real&lt;br /&gt;large-scale industrial products that has great libraries and an&lt;br /&gt;active user community.&lt;br /&gt;• You don’t want to wear your fingers out by typing lots of lines of&lt;br /&gt;code.&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/8168049245789156620-2485688566084939214?l=chamilar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chamilar.blogspot.com/feeds/2485688566084939214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8168049245789156620&amp;postID=2485688566084939214' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/2485688566084939214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/2485688566084939214'/><link rel='alternate' type='text/html' href='http://chamilar.blogspot.com/2008/05/five-reasons-why-you-should-learn.html' title='Five Reasons why you should learn Erlang'/><author><name>Chamila Ruwanjith Piyasena</name><uri>http://www.blogger.com/profile/01668832177553429309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp0.blogger.com/_0vEtdezoWWI/R58GQySAHnI/AAAAAAAAA04/jrlwozwzeTA/S220/Cka.lr259966-02.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8168049245789156620.post-5245347810003270172</id><published>2008-05-08T08:13:00.000-07:00</published><updated>2008-05-12T02:21:14.345-07:00</updated><title type='text'>What a DREAM it was!!!!!!!!</title><content type='html'>&lt;div style="text-align: justify;"&gt;Today is  the last day that we all are being in our University. After to day it's all over. What a memorable period it was. Full of joys. I couldn't believe that   there is no longer shouting, screaming, joking at the final year lab. The most beautiful period of life is going to over this way. How  can we forget this wonderful period with all the  brothers and sisters. It will be safe in our hearts through out our life.&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/8168049245789156620-5245347810003270172?l=chamilar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chamilar.blogspot.com/feeds/5245347810003270172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8168049245789156620&amp;postID=5245347810003270172' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/5245347810003270172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/5245347810003270172'/><link rel='alternate' type='text/html' href='http://chamilar.blogspot.com/2008/05/what-dream-it-was.html' title='What a DREAM it was!!!!!!!!'/><author><name>Chamila Ruwanjith Piyasena</name><uri>http://www.blogger.com/profile/01668832177553429309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp0.blogger.com/_0vEtdezoWWI/R58GQySAHnI/AAAAAAAAA04/jrlwozwzeTA/S220/Cka.lr259966-02.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8168049245789156620.post-1404309964244132152</id><published>2008-03-27T22:02:00.000-07:00</published><updated>2008-03-27T22:25:21.544-07:00</updated><title type='text'>Trip to Kanneliya</title><content type='html'>&lt;div style="text-align: justify;"&gt;Last two days me and my friends at the university went on a trip to Kanneliya (a biological park nere Galle). Probably it will be the last trip that we are going during our stay at the university. We all had a very nice time with each other. Thank you Asiri and Saminda for providing us meals. And Moththe(Sameera) for the Tea.  Ah,  Dont forget leva and Sura ,  the fun they gave @ nite hi hi :) . &lt;br /&gt;&lt;br /&gt;I think the most important event is providing the gifts of appreciation  to  Asiri,  Saliya  and Saminda who had helped us a lot for the exams (By doing "kuppi") through whole four years. The commitment they put can not be measured by the awards we gave. Thank you very much Asiri, Saliya and saminda for all those things you had done for us.  Also thank you Amila for arranging such an event.&lt;br /&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/8168049245789156620-1404309964244132152?l=chamilar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chamilar.blogspot.com/feeds/1404309964244132152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8168049245789156620&amp;postID=1404309964244132152' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/1404309964244132152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/1404309964244132152'/><link rel='alternate' type='text/html' href='http://chamilar.blogspot.com/2008/03/trip-to-kanneliya.html' title='Trip to Kanneliya'/><author><name>Chamila Ruwanjith Piyasena</name><uri>http://www.blogger.com/profile/01668832177553429309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp0.blogger.com/_0vEtdezoWWI/R58GQySAHnI/AAAAAAAAA04/jrlwozwzeTA/S220/Cka.lr259966-02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8168049245789156620.post-8820041017992425496</id><published>2008-03-04T22:59:00.000-08:00</published><updated>2008-03-04T23:40:53.762-08:00</updated><title type='text'>End of a sweetest episod of life</title><content type='html'>&lt;div style="text-align: justify;"&gt; Now its the last few months at the university. Its really hard to believe that it has now come down to the wire. A four years of sweet memories with my friends. We had  Lots of joyful moments,  thank you dear friend for all those memories.   The best part of it is,  now I'm certain that there are bunch of friends who will never let me down, who will be with me for joy and sorrow. Thats the kind of relationship  each other had  in the university life. Any way thats the life is all about. There is a huge future ahead and I think experience gained here will be very important to deal with it. So dear friends  may success will be with you in every part of your life. Hope &lt;span style="font-weight: bold;"&gt;this is GOOD NITE &amp;amp; not GOOD BYE.&lt;/span&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/8168049245789156620-8820041017992425496?l=chamilar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chamilar.blogspot.com/feeds/8820041017992425496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8168049245789156620&amp;postID=8820041017992425496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/8820041017992425496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/8820041017992425496'/><link rel='alternate' type='text/html' href='http://chamilar.blogspot.com/2008/03/end-of-sweetest-episod-of-life.html' title='End of a sweetest episod of life'/><author><name>Chamila Ruwanjith Piyasena</name><uri>http://www.blogger.com/profile/01668832177553429309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp0.blogger.com/_0vEtdezoWWI/R58GQySAHnI/AAAAAAAAA04/jrlwozwzeTA/S220/Cka.lr259966-02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8168049245789156620.post-3849989700156978237</id><published>2008-02-25T00:43:00.000-08:00</published><updated>2008-02-25T01:06:59.019-08:00</updated><title type='text'>Accesing a veriable defined in another file in C++</title><content type='html'>&lt;div style="text-align: justify;"&gt;This might be a very simple thing to most of the programmers. But I thought of writing this in my blog as I spent half a day finding a way to access a variable in  .cpp from another .cpp(without importing the .h or defining as public inside a class.)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;suppose the variable we want to access is  defined as follows in the original file,&lt;br /&gt;&lt;br /&gt;bool flag;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;if you want to access this from another .cpp simply you have to do is define it with extern key word in that file,&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;i.e   extern bool flag;&lt;br /&gt;&lt;br /&gt;both declarations refer to the same variable "flag".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8168049245789156620-3849989700156978237?l=chamilar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chamilar.blogspot.com/feeds/3849989700156978237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8168049245789156620&amp;postID=3849989700156978237' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/3849989700156978237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/3849989700156978237'/><link rel='alternate' type='text/html' href='http://chamilar.blogspot.com/2008/02/accesing-veriable-defined-in-another.html' title='Accesing a veriable defined in another file in C++'/><author><name>Chamila Ruwanjith Piyasena</name><uri>http://www.blogger.com/profile/01668832177553429309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp0.blogger.com/_0vEtdezoWWI/R58GQySAHnI/AAAAAAAAA04/jrlwozwzeTA/S220/Cka.lr259966-02.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8168049245789156620.post-6570408492715545718</id><published>2008-02-22T04:09:00.000-08:00</published><updated>2008-02-22T04:24:53.113-08:00</updated><title type='text'>C++ threading in windows</title><content type='html'>&lt;div style="text-align: justify;"&gt;Any one had trouble in implementing threading in C++(well, I had, as C++ directly not providing threading) . We have to  use the treading support in the windows API.  But it is bit difficult to directly code to the windows API using "windows.h". while I 'm searching I found the  article "C++ And Threads, by Randy Charles Morin" which has implemented the threading in C++ very effectively. If you are interested I recommend you to go through it.  here is the link&lt;br /&gt;&lt;/div&gt;&lt;a href="http://www.kbcafe.com/articles/HowTo.Thread.pdf"&gt;&lt;br /&gt;http://www.kbcafe.com/articles/HowTo.Thread.pdf&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8168049245789156620-6570408492715545718?l=chamilar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chamilar.blogspot.com/feeds/6570408492715545718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8168049245789156620&amp;postID=6570408492715545718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/6570408492715545718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/6570408492715545718'/><link rel='alternate' type='text/html' href='http://chamilar.blogspot.com/2008/02/c-threading-in-windows.html' title='C++ threading in windows'/><author><name>Chamila Ruwanjith Piyasena</name><uri>http://www.blogger.com/profile/01668832177553429309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp0.blogger.com/_0vEtdezoWWI/R58GQySAHnI/AAAAAAAAA04/jrlwozwzeTA/S220/Cka.lr259966-02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8168049245789156620.post-1967677905263253700</id><published>2008-02-21T06:07:00.000-08:00</published><updated>2008-02-21T06:15:01.533-08:00</updated><title type='text'>Bug in OpenCV</title><content type='html'>&lt;div style="text-align: justify;"&gt;I wanted to capture an image from the web cam and convert that to gray scale  in my application. I use openCV to do that. But when I directly convert the captured image to gray scale   it returned a horizontally flip gray image  of the original. but if I load an image using cvLoadImage() and then convert it to gray scale there was no problem. No flipping is involved. I think this was a bug in openCV. Correct me if I am wrong.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;here is the code that cause the flipping,&lt;br /&gt;&lt;br /&gt;CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );&lt;br /&gt;   IplImage* frame = cvQueryFrame( capture );&lt;br /&gt;&lt;br /&gt;       IplImage* gray = cvCreateImage( cvGetSize(frame), 8, 1 );&lt;br /&gt;       cvCvtColor( frame, gray, CV_BGR2GRAY );&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8168049245789156620-1967677905263253700?l=chamilar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chamilar.blogspot.com/feeds/1967677905263253700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8168049245789156620&amp;postID=1967677905263253700' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/1967677905263253700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/1967677905263253700'/><link rel='alternate' type='text/html' href='http://chamilar.blogspot.com/2008/02/bug-in-opencv.html' title='Bug in OpenCV'/><author><name>Chamila Ruwanjith Piyasena</name><uri>http://www.blogger.com/profile/01668832177553429309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp0.blogger.com/_0vEtdezoWWI/R58GQySAHnI/AAAAAAAAA04/jrlwozwzeTA/S220/Cka.lr259966-02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8168049245789156620.post-7520073835610922672</id><published>2008-02-03T06:58:00.000-08:00</published><updated>2008-02-03T07:38:50.586-08:00</updated><title type='text'>Einstein's Challenge</title><content type='html'>&lt;div style="text-align: justify; color: rgb(0, 0, 0);"&gt;Would you like some &lt;span style="font-weight: bold;"&gt;brainstorming&lt;/span&gt; challenge. Here it is. It is often called "Einstein's Puzzle" or "Einstein's Riddle" because it is said to have been invented by Albert Einstein as a boy. Some claim that Einstein said "only 2 percent of the world's population can solve it". But I believe it should be more than 2% if they given sufficient time. so here it is, ENJOY !!!!!!!!!!!!!!!&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:Arial;font-size:100%;"  &gt; There are 5 houses in 5 different colors.  In each house lives a person with a different nationality.  The 5 owners drink a certain type of beverage, smoke a certain brand of cigar, and keep a certain pet.  No owners have the same pet, smoke the same brand of cigar, or drink the same beverage.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify; color: rgb(0, 0, 0);"&gt;&lt;li&gt;The British lives in the red house.&lt;/li&gt;&lt;li&gt;The Swedish keeps dogs as pets.&lt;/li&gt;&lt;li&gt;The Danish drinks tea.&lt;/li&gt;&lt;li&gt;The green house is on the left of the white house.&lt;/li&gt;&lt;li&gt;The green homeowner drinks coffee.&lt;/li&gt;&lt;li&gt;The person who smokes Pall Mall rears birds.&lt;/li&gt;&lt;li&gt;The owner of the yellow house smokes Dunhill.&lt;/li&gt;&lt;li&gt;The man living in the center house drinks milk.&lt;/li&gt;&lt;li&gt;The Norwegian lives in the first house.&lt;/li&gt;&lt;li&gt;The man who smokes Blend lives next to the one who keeps cats.&lt;/li&gt;&lt;li&gt;The man who keeps the horse lives next to the man who smokes Dunhill.&lt;/li&gt;&lt;li&gt;The owner who smokes Bluemaster drinks beer.&lt;/li&gt;&lt;li&gt;The German smokes prince.&lt;/li&gt;&lt;li&gt;The Norwegian lives next to the blue house.&lt;/li&gt;&lt;li&gt;The man who smokes Blend has a neighbor who drinks water.&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;the question is ,  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;font-size:130%;" &gt;Who owns the fish?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: justify; color: rgb(0, 0, 0);"&gt;try it your self, it's fun. Here is the answer..........................&lt;br /&gt;&lt;br /&gt;But &lt;span style="font-weight: bold;"&gt;don't look&lt;/span&gt; at it till you finished.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table class="MsoNormalTable" style="width: 427px; height: 184px;" border="1" cellpadding="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 1.5pt; width: 64.5pt;" width="86"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt; &lt;br /&gt;&lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 66pt;" width="88"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;House 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 51pt;" width="68"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;House 2&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 51pt;" width="68"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;House 3&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 48.75pt;" width="65"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;House 4&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 54.75pt;" width="73"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;House 5&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 1.5pt; width: 64.5pt;" width="86"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Nationality&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 66pt;" width="88"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Norwegian&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 51pt;" width="68"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Dane&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 51pt;" width="68"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Brit&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 48.75pt;" width="65"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;German&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 54.75pt;" width="73"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Swede&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 1.5pt; width: 64.5pt;" width="86"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Color&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 66pt;" width="88"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Yellow&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 51pt;" width="68"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Blue&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 51pt;" width="68"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Red&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 48.75pt;" width="65"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Green&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 54.75pt;" width="73"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;White&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 1.5pt; width: 64.5pt;" width="86"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Pet&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 66pt;" width="88"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Cats&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 51pt;" width="68"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Horses&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 51pt;" width="68"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Birds&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 48.75pt;" width="65"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Fish&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 54.75pt;" width="73"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Dog&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 1.5pt; width: 64.5pt;" width="86"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Beverage&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 66pt;" width="88"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Water&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 51pt;" width="68"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Tea&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 51pt;" width="68"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Milk&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 48.75pt;" width="65"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Coffee&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 54.75pt;" width="73"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Beer&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 1.5pt; width: 64.5pt;" width="86"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Cigarettes&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 66pt;" width="88"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Dunhill&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 51pt;" width="68"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Blend&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 51pt;" width="68"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;st1:place st="on"&gt;Pall Mall&lt;/st1:place&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 48.75pt;" width="65"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Prince&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 1.5pt; width: 54.75pt;" width="73"&gt;   &lt;p class="MsoNormal" style="text-align: justify;"&gt;Blue Mstr&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;br /&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/8168049245789156620-7520073835610922672?l=chamilar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chamilar.blogspot.com/feeds/7520073835610922672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8168049245789156620&amp;postID=7520073835610922672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/7520073835610922672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/7520073835610922672'/><link rel='alternate' type='text/html' href='http://chamilar.blogspot.com/2008/02/einsteins-challenge.html' title='Einstein&apos;s Challenge'/><author><name>Chamila Ruwanjith Piyasena</name><uri>http://www.blogger.com/profile/01668832177553429309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp0.blogger.com/_0vEtdezoWWI/R58GQySAHnI/AAAAAAAAA04/jrlwozwzeTA/S220/Cka.lr259966-02.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8168049245789156620.post-1086375507276340670</id><published>2008-01-31T05:08:00.000-08:00</published><updated>2008-01-31T05:16:56.292-08:00</updated><title type='text'>Inter department tournament</title><content type='html'>&lt;div style="text-align: justify;"&gt;Today we have participated to our inter department cricket tournament.  As we are now in our final year this is the last tournament we are competing in the university. Though our team couldn't make it to the finals, it's a great pleasure to took part in such an event as all the batch mates from different departments  had the opportunity have a good time with their friends from other departments. Department of Civil Engineering  won the trophy and Department of Mechanical engineering was the runners up.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8168049245789156620-1086375507276340670?l=chamilar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chamilar.blogspot.com/feeds/1086375507276340670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8168049245789156620&amp;postID=1086375507276340670' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/1086375507276340670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/1086375507276340670'/><link rel='alternate' type='text/html' href='http://chamilar.blogspot.com/2008/01/inter-department-tournament.html' title='Inter department tournament'/><author><name>Chamila Ruwanjith Piyasena</name><uri>http://www.blogger.com/profile/01668832177553429309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp0.blogger.com/_0vEtdezoWWI/R58GQySAHnI/AAAAAAAAA04/jrlwozwzeTA/S220/Cka.lr259966-02.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8168049245789156620.post-2738065417938241243</id><published>2008-01-30T06:04:00.000-08:00</published><updated>2008-02-05T04:05:36.374-08:00</updated><title type='text'>Erlang Rocks</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;b style="color: rgb(0, 0, 0);"&gt;Erlang&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; is a general-purpose&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;concurrent programming language. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; It was designed by Ericsson&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; to support distributed, fault-tolerant, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; soft-real-time&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, non-stop applications. It supports hot swapping&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; so code can be changed without stopping a system. &lt;/span&gt;One of the main reasons for using Erlang instead of other functional languages is Erlang's ability to handle concurrency and distributed programming.  So why don't you try this. believe me you'll love it . &lt;/div&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8168049245789156620-2738065417938241243?l=chamilar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chamilar.blogspot.com/feeds/2738065417938241243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8168049245789156620&amp;postID=2738065417938241243' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/2738065417938241243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8168049245789156620/posts/default/2738065417938241243'/><link rel='alternate' type='text/html' href='http://chamilar.blogspot.com/2008/01/erlang-rocks.html' title='Erlang Rocks'/><author><name>Chamila Ruwanjith Piyasena</name><uri>http://www.blogger.com/profile/01668832177553429309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp0.blogger.com/_0vEtdezoWWI/R58GQySAHnI/AAAAAAAAA04/jrlwozwzeTA/S220/Cka.lr259966-02.jpg'/></author><thr:total>3</thr:total></entry></feed>
