tag:blogger.com,1999:blog-166156352008-07-23T20:37:03.187-04:00<Eran_Chinthaka's_core_dump/>Eran Chinthakanoreply@blogger.comBlogger44125tag:blogger.com,1999:blog-16615635.post-85785749286844316162008-07-20T02:42:00.004-04:002008-07-23T20:37:03.275-04:00What is eScience ?<span style="font-family:verdana;">(This will be helpful for me to explain my friends what I am working on currently ;) )<br /><br /><span style="font-style: italic; color: rgb(255, 0, 0);">Disclaimer : this will be a basic introduction and might not be sophisticated enough to Achilles in the field. </span><br /><br />In simple terms, eScience is where computer scientists blends with scientists from other science fields to solve their problems efficiently. In my view there are two things that are being referred to as eScience these days.<br /><br />1. Computer scientists apply their algorithms and knowledge on to other science fields. For example, one could use algorithms and methods like neural nets, machine learning, etc., to medical field to efficiently device solutions to those areas.<br />Even though most of people don't see this as part of eScience, having being to a talk from <a href="http://research.microsoft.com/%7Eheckerman/">David Heckerman</a>, I also agree with him.<br /><br />2. There are algorithms that require large amount of computational power and time to compute something or they act on large amount of data. For these algorithms to work or these tera bytes of data to be mined, one might need the help of super computers.<br /><br />- Handling these large amount of data<br />- executing those algorithms on these data<br />- enabling scientists to work these data, thru GUIs or workflow engines etc., is also regarded as eScience.<br /><br />This is what emphasized by most people and <a href="http://en.wikipedia.org/wiki/E-Science">wikipedia</a> as well.<br /><br />I think I am also more in to the second area, so I will explain a bit more on that.<br /><br />Think about the following scenario, related to meteorology, to understand the use case.<br /><br />A country might have a large number of weather stations reporting various weather conditions to a central location. In case of US, IIRC, there are about 144 weather stations. Each weather station sends data, say once in a hour. If the size of a file sent by each weather station is about, say 1GB (this value will depend on the resolution of measurements), then we will get about 150GB per hour. There are algorithms to go through this data and mine them to find out interesting weather stations. For example, one algorithm will find out, say a set of storms using those data. Since the first phase will act on these data separately, there has to be another algorithm to aggregate the results. If first algorithms shows 5 storms, it can be few of them are related to the same one. Likewise there are different algorithms that can be run on top of this data.<br />Scientists can either run their algorithms on these data alone, or they can define workflows to run on these data. For example, they can design a workflow which will<br /></span><ol><li><span style="font-family:verdana;">first mine these data, find interesting conditions</span></li><li><span style="font-family:verdana;">cluster them to identify unique conditions</span></li><li><span style="font-family:verdana;">talk to individual weather stations to get more data, if needed<br /></span></li><li><span style="font-family:verdana;">come up with a scenario explaining the current conditions</span></li><li><span style="font-family:verdana;">predict on the path of the storm or behaviour</span></li></ol><span style="font-family:verdana;">Since all these have to be carried out in a timely manner </span><span style="font-family:verdana;">(You don't want to get today's weather forecast tomorrow, right ;) )</span><span style="font-family:verdana;">, and the data sets involved are large, it is required to use high performance computers for these . </span><br /><br /><span style="font-family:verdana;">To peform the above mentioned tasks, there has to be some infrastructure which can enable the users to</span><br /><ol style="font-family: verdana;"><li>design, execute, monitor workflows</li><li>perform data movements from/to computing resources. These movements will not be easy as it will not only invlove large amounts of data, but also involves working with super computers, data centers, etc.,<br /></li><li>schedule and monitor jobs in high performance computing environments like clusters, grids, etc.,<br /></li></ol><span style="font-family:verdana;">This whole environment can be regarded as an eScience environment. This is just one examlpe and there are lots of problems like this in bio-science, neuro-science, aerospace, etc.,</span>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-84836365730698769472008-07-18T02:40:00.005-04:002008-07-19T03:21:55.973-04:00Places to visit in Washington State - Mt St Helens<span style="FONT-WEIGHT: bold">Location </span>: Johnston Ridge Observatory, At the end of Spirit Lake Memorial Highway, WA<br /><br /><span style="FONT-WEIGHT: bold">Directions</span> : <span style="TEXT-DECORATION: underline"></span><a href="http://maps.google.com/maps?f=d&hl=en&geocode=7293208478088111098,46.276258,-122.216721&saddr=Bellevue,+WA&daddr=Johnston+Ridge+%4046.276258,-122.216721&mra=pi&mrcr=0&doflg=ptm&sll=46.606054,-122.148743&sspn=0.862314,2.535095&ie=UTF8&t=h&z=8">Google Maps</a>, About 3 hrs from Bellevue, WA<br /><br /><span style="FONT-WEIGHT: bold">For GPS : 46.276258,-122.216721</span><span style="font-family:Tahoma;"><br /><br /><span style="FONT-WEIGHT: bold">Link : </span></span><span class="a">en.wikipedia.org/wiki/Mount_St._Helens</span><br /><br />This was one of the interesting trips I went, with my family. The road to Mt St Helens was full of fascinating scenaries.<br />After we exit from I-5, the road goes through a small town and after that the road will be full of sharp turns. At one time there was a sign saying, it was the last place to get gas. It was 37 files from that point, but I didn't realize we will be gaining elevation and my car will have to do extra work. (Thanks to Corolla's fuel efficiency I didn't run out of gas :) )<br />There are couple of view points on the way and most of them were gorgeous. There was one place where you can see the path of mud and lava flow.<br />When we got to Johnston Ridge Visitor Center, the view was great. Since it was a sunny day we could see the whole mountain without any trouble. There are couple of trails lead by some rangers and one of them was going towards spirit lake. Visitor center also had some movies being played inside a theater.<br /><br /><p></p><p align="center"><a href="http://lh3.ggpht.com/eran.chinthaka/SIGPUbUo0QI/AAAAAAAAB8k/LUlvCu6VWbc/mt-helens.jpg"><img style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://lh3.ggpht.com/eran.chinthaka/SIGPUbUo0QI/AAAAAAAAB8k/LUlvCu6VWbc/mt-helens.jpg" border="0" /></a></p><div align="center">This is a combination of three photos, showing the mighty Mt St Helens and the living crater.<br /><a href="http://www.blogger.com/"></a><br /><br /></div><p align="center"><a href="http://lh3.ggpht.com/eran.chinthaka/SIGPWB89G7I/AAAAAAAAB8s/5sxjblq7ww4/mt-helens-2.jpg"><img style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://lh3.ggpht.com/eran.chinthaka/SIGPWB89G7I/AAAAAAAAB8s/5sxjblq7ww4/mt-helens-2.jpg" border="0" /></a></p><p align="center">Mt St Helens and the lava and mud flow path</p><br /><br /><p align="center"><a href="http://lh3.ggpht.com/eran.chinthaka/SIGPWpCn7QI/AAAAAAAAB80/zpDedOjy40w/mt-helens-360.jpg"><img style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://lh3.ggpht.com/eran.chinthaka/SIGPWpCn7QI/AAAAAAAAB80/zpDedOjy40w/mt-helens-360.jpg" border="0" /></a></p><p align="center">360' view around the Mt St Helens area. If you look at the surrounding mountains, you can still see some burnt trees</p><p align="center"><br /> </p>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-16914432266943968402008-07-14T18:05:00.005-04:002008-07-14T18:26:21.682-04:00Google thinks I am a "virus"I was searching for a grocery store in my area, in google, and this is what the result was.<br /><br />"We're sorry .. but your query looks similar to automated requests from a computer virus or spyware application. .... "<br /><br />Seems some one had messed up automatic spyware detection. Can this be due to an error in IE?<br /><br /><a href="http://bp0.blogger.com/_i-a8GfjGfM0/SHvOAtFFJ0I/AAAAAAAAB7Y/CcpmRop57vA/s1600-h/google-error.jpg"><img id="BLOGGER_PHOTO_ID_5222994704362448706" style="margin: 0px auto 10px; display: block; text-align: center;" alt="" src="http://bp0.blogger.com/_i-a8GfjGfM0/SHvOAtFFJ0I/AAAAAAAAB7Y/CcpmRop57vA/s400/google-error.jpg" border="0" /></a>Update : I just checked couple of more queries, now using firefox, and I got the same error. So it is some thing happening beyond my machine. Can be internal network or google is messing up.<br /><div><a href="http://bp2.blogger.com/_i-a8GfjGfM0/SHvN4mi_boI/AAAAAAAAB7Q/8ND0nf7MACQ/s1600-h/google-error.jpg"></a><br /><br /><div></div></div>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-49287264156329610692008-07-08T03:07:00.002-04:002008-07-08T03:20:42.026-04:00Open-source vs source-open<span style="font-family: verdana;">I asked from one of my friends, what opensource means to him. He said, if he has source then he is good with it. Is this the meaning of opensource software? Where is the community component?<br /><br />If some one builds a software, in-house, and put it out with the source, is this opensource? I personally think there is something missing.<br /><br />There seems to be a trend in larger projects, that the customers demand for source. Especially large clients (like governments) in Europe tend to lean towards opensource software. So most of the companies are trying to exploit this by putting something out as their source.<br /><br />What is the meaning of this? In my personal opinion, people should like opensource, because it is/was a community effort and not by a single company. In these sorts of projects, if one contributing company goes out, then the clients have more options. Also there will be competition and better code/product through synergy and open discussions. Since users are also involved in this process, the ultimate product will be what users need.<br />If company A can not afford to build a software alone, they can create a community around it and build a software. This will benefit the company and also benefit other people as well.<br /><br />But if you write your code internally, make all your decisions and put it, it is just like the automotive industry in 1970s. Customers get what a company wants and not what they want. Even if the clients get the source, it will be crappy most of the time :)<br /><br />Apache has this nice rule where a project needs at least 3 different players to be recognized as a project within Apache. One of the reasons for this is to make sure, companies won't dump any code and then claim those are opensource.<br /></span>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-55085499026163800842008-07-07T13:48:00.002-04:002008-07-07T14:09:16.859-04:00What is Open source software (to me)<span style="font-family:verdana;">(Warning I might be biased towards my experience in different Apache projects)</span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:verdana;">I was doing some background work on this for a while, asking from different people and searching the web to understand what people really expects. I was some what pissed-off by this definition <a href="http://www.onlamp.com/pub/a/onlamp/2005/09/15/what-is-opensource.html">here</a>. </span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">Why do we contribute to opensource projects? Do we need something in return other than the satisfaction (some times the visibility is what really matters when you apply for higher studies or jobs, but those are secondary). </span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">I was really happy to see thousands of users posting questions in axis-dev, commons-dev and other mailing lists in my projects in Apache. We have done something for the betterment of their progress and to the world. Do we need to restrict them? Why do we wanna say if you use this, you need to make your stuff also open source or in other words "dance to my rhythm"? Bull shit !!</span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">Are we trying to make the whole world open source, and by doing so create a different and completely secluded camp? What is the point there? We have to be practical and give something to the people out there.</span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">Why do we wanna enforce viral licenses? My main idea is satisfaction out of it. I am so happy to see the code I've written being used by so many people around the world, without any geographical or language barriers. When I introduce myself as a developer from XX project, people really like to talk with me and my colleagues. Do we need anything else from our contributions?</span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">It is true that I was supported by some organization when I was contributing to those projects, but those organizations had better and far more efficient models to earn money, rather than restricting others, from our contributions. </span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">There are some organizations, which are fully closed source, but use lots of opensource software. For their business, GPL like licenses are not healthy. Do we wanna restrict them too? Why? Yes they earn money from our efforts, so what? Those companies are just some set of users from my point of view. Sometimes they give credit to the opensource projects that they have used. Isn't that enough. </span><br /><span style="font-family:Verdana;">Think about the university research groups using our open source software. They are researching for the betterment of the world. They also try to optimize their funding to do something to the world. Do we wanna add barriers to them?</span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">Apache style licenses add no barriers to the end users of those software. You can do whatever you want with it. Isn't it cool? Isn't it the success behind opensource?</span><br /><span style="font-family:Verdana;"></span><br /><span style="font-family:Verdana;">There is also another category which I refer as "source-open", rather than open-source, which I need to research a bit. </span><br /><span style="font-family:Verdana;"></span>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-19927088213577747652008-06-30T02:46:00.004-04:002008-06-30T03:24:16.306-04:00Our boat over-turned ... It was close<div align="center"><br /></div><span style="font-family:verdana;">This should have been a continuation of my "Place to visit in Seattle" series, but this was much more than that.</span><br /><br /><span style="font-family:Verdana;">Couple of my friends working together in the same block within MSR, decided to go on canoeing in Lake Washington. We hired canoes from UW recreation center. Me and David Koop were on the same canoe. I was bit reluctant to take my camera, but I really wanted to take a panorama shot of <a href="http://en.wikipedia.org/wiki/Evergreen_Point_Floating_Bridge">520 bridge</a>, (one of??) the longest floating bridges. </span><br /><br /><span style="font-family:Verdana;">We went towards the bridge and crossed the shipping lines to go underneath the bridge. We had to face waves coming up about 3-4 feets high, but all of us managed to get through. Then we went to <a href="http://depts.washington.edu/wpa/general.htm">Arboretum </a>and had some rest. </span><br /><br /><span style="font-family:Verdana;">Since it seemed much safer, I removed my life jacket also. </span><br /><br /><span style="font-family:Verdana;">Then we head back to UW rental center. Both me and David leaned towards the same side of the boat, at the same time, and that over-turned the boat. I had no option but to jumb in to the deep water, and I thought I had the life jacket, but it was not. Some how I came up and my head then hit against the boat, as David was trying to get the boat to proper side. (I think I went down once again). Some how we figured we can not turn the boat and we swimmed about 10-15 meters, pulling the boat also to the shore. At that point only I took out my camera. </span><br /><br /><span style="font-family:Verdana;">My camera is still not working but we were saved (I think it was too close). I dried it, but some water seemed to be leaked in to the lenses. </span><br /><br /><span style="font-family:Verdana;">These some of the last photos I took from my camera. </span><span style="font-family:Verdana;"></span><br /><br /><img id="BLOGGER_PHOTO_ID_5217571387529419730" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://bp0.blogger.com/_i-a8GfjGfM0/SGiJiHfu29I/AAAAAAAAB54/ZZokT3Up3l0/s400/520.JPG" border="0" /> <p align="center">Panoramic view of 520 bridge<br /></p><img id="BLOGGER_PHOTO_ID_5217571385697097858" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://bp1.blogger.com/_i-a8GfjGfM0/SGiJiAq32II/AAAAAAAAB6A/IdxDeNXLIQc/s400/IMG_6655.JPG" border="0" /> <p align="center">View of Mt. Rainier from with 520 bridge</p><p align="center"><img id="BLOGGER_PHOTO_ID_5217570517352660514" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://bp2.blogger.com/_i-a8GfjGfM0/SGiIvd1bPiI/AAAAAAAAB5g/TbmvIf4zNRo/s400/IMG_6684.JPG" border="0" /> View of Mt. Rainier from Lake Washington </p><br /><p><img id="BLOGGER_PHOTO_ID_5217570516972384866" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://bp3.blogger.com/_i-a8GfjGfM0/SGiIvcawsmI/AAAAAAAAB5o/aVk0U-2C5vA/s400/IMG_6707.JPG" border="0" /> </p><p align="center">Me and David in the unlucky canoe</p><p align="center"><br /></p><span style="font-family:Verdana;"><img id="BLOGGER_PHOTO_ID_5217570519903761058" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://bp1.blogger.com/_i-a8GfjGfM0/SGiIvnVp8qI/AAAAAAAAB5w/Va3jbb0B7tA/s400/IMG_6708.JPG" border="0" /> <p align="center"> </span>The canoing gang</p>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-53408153037090015052008-06-21T21:43:00.004-04:002008-06-21T22:02:48.626-04:00Places to visit in Washington State - Snoqualmie Falls<span style="font-weight: bold;">Location </span>: Snoqualmie Falls, WA<br /><br /><span style="font-weight: bold;">Directions</span> : <a href="http://maps.google.com/maps?f=d&hl=en&geocode=&saddr=Bellevue,+WA&daddr=Snoqualmie+Falls,+Uninc+King+County,+WA&sll=47.55502,-122.06751&sspn=0.227067,0.598755&ie=UTF8&ll=47.559847,-121.998367&spn=0.227047,0.598755&z=11">Google Maps</a>. About 30 mins from Bellevue, WA<br /><br /><span style="font-weight: bold;">For GPS : </span><span style="font-family:Tahoma;">6501 Railroad Ave Se, 98065 (closest Address)<br /><br /><span style="font-weight: bold;">Link : </span>http://www.snoqualmiefalls.com/<br /><br />This is one of the spectacular waterfalls, I have ever seen. Due to the melting of ice these days, on the mountains, the waterfalls is full of water. I think this is one of the easiest to see, with about 100 feet walk.<br />But going down the trail, for about 3/4 mile, you will be able to goto the base of the waterfall.<br />One of the amazing things in this waterfall is that, there is a hydro-power plant at the top of the falls. And the water coming out from that plant, is going through a the rock, through a man made hole, and comes out at the base the waterfall. According to a veteran I met, this was done prior to World war II.<br />The beauty of the waterfall and the view of the surrounding area is great. If I were to recommend the best places to visit, Snoqualmie falls will be one of them for sure.<br /><br />If you have time, don't forget to visit the factory outlets in North Bend, which is like 15 mins away.<br /><br /></span><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_i-a8GfjGfM0/SF2yJFs7TeI/AAAAAAAAB2c/U2xmN021ECs/s1600-h/snoqualmie-falls.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_i-a8GfjGfM0/SF2yJFs7TeI/AAAAAAAAB2c/U2xmN021ECs/s400/snoqualmie-falls.JPG" alt="" id="BLOGGER_PHOTO_ID_5214519812784082402" border="0" /></a>Panoramic View of the waterfall<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_i-a8GfjGfM0/SF2yJd7SUQI/AAAAAAAAB2k/fQknGgEsgp4/s1600-h/IMG_5912.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_i-a8GfjGfM0/SF2yJd7SUQI/AAAAAAAAB2k/fQknGgEsgp4/s400/IMG_5912.JPG" alt="" id="BLOGGER_PHOTO_ID_5214519819286761730" border="0" /></a>View of the waterfall from the top<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_i-a8GfjGfM0/SF2yKIt9wiI/AAAAAAAAB28/56P8Mh4cuLw/s1600-h/IMG_5946.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_i-a8GfjGfM0/SF2yKIt9wiI/AAAAAAAAB28/56P8Mh4cuLw/s400/IMG_5946.JPG" alt="" id="BLOGGER_PHOTO_ID_5214519830773613090" border="0" /></a>View of the waterfall from the base<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_i-a8GfjGfM0/SF2yJkAYKbI/AAAAAAAAB2s/QFnBJzwBXX4/s1600-h/IMG_5928.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_i-a8GfjGfM0/SF2yJkAYKbI/AAAAAAAAB2s/QFnBJzwBXX4/s400/IMG_5928.JPG" alt="" id="BLOGGER_PHOTO_ID_5214519820918729138" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_i-a8GfjGfM0/SF2yJ-6pyEI/AAAAAAAAB20/3FYyjVdxrVI/s1600-h/IMG_5939.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_i-a8GfjGfM0/SF2yJ-6pyEI/AAAAAAAAB20/3FYyjVdxrVI/s400/IMG_5939.JPG" alt="" id="BLOGGER_PHOTO_ID_5214519828142475330" border="0" /></a><br /></div>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-81104887132268408472008-06-21T20:45:00.008-04:002008-06-21T22:03:20.511-04:00Places to visit in Washington State - Little Si Hike<span style="font-weight: bold;">Location</span> : Little Si, North Bend, WA<br /><br /><span style="font-weight: bold;">Directions</span> : Take I-90 and take exit 31. You will get in to Bendigo Blvd. Go straight till you find SE North Bend way and you wanna take a right when you meet North Bend Way. Go till you find Mount Si Road and turn left. Once you pass the bridge over Snoqualmie river, turn right and follow the directions for Little Si parking lot.<br /><br /><span style="font-weight: bold;">For GPS</span> : 47.49867, -121.756228 or 434th Avenue SE and SE Mt Si Road, North Bend, WA.<br /><br /><span style="font-weight: bold;">Links</span> : http://www.mountsi.com/<br /><br />We went on a hike today to <a href="http://en.wikipedia.org/wiki/Little_Si">Little Si</a> (North Bend, WA) with my friends in MSR. It was like 30 mins drive from Bellevue through I-90 and getting there was pretty easy.<br /><br />The hike was abt 5 miles (round-trip) to about 1600 feet. I took my 22 months old kid with me, and it was hard, but was doable. It was just that my body resisted for a hard workout after a long time.<br />We were passing a nice forest on the way and it was nice to see all those rock climbers working hard to get to the summit. When we reached to the peak, we could see the fascinating view of Snoqualmie river and North Bend area.<br /><br /><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_i-a8GfjGfM0/SF2rXe09ImI/AAAAAAAAB2M/s9n1a2QlBxs/s1600-h/Mt-Si-1.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_i-a8GfjGfM0/SF2rXe09ImI/AAAAAAAAB2M/s9n1a2QlBxs/s400/Mt-Si-1.JPG" alt="" id="BLOGGER_PHOTO_ID_5214512363465417314" border="0" /></a>Panoramic view of the cascades, from the middle of little Si<br /></div><br /><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_i-a8GfjGfM0/SF2rXSGkxJI/AAAAAAAAB2U/CXdrURuyBPE/s1600-h/Mt-Si-2.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_i-a8GfjGfM0/SF2rXSGkxJI/AAAAAAAAB2U/CXdrURuyBPE/s400/Mt-Si-2.JPG" alt="" id="BLOGGER_PHOTO_ID_5214512360049656978" border="0" /></a>Panoramic view from the peak of Little Si<br /></div><div style="text-align: center;"><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_i-a8GfjGfM0/SF2pxOhZllI/AAAAAAAAB1s/yXsIMSeeOck/s1600-h/IMG_6456.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_i-a8GfjGfM0/SF2pxOhZllI/AAAAAAAAB1s/yXsIMSeeOck/s320/IMG_6456.JPG" alt="" id="BLOGGER_PHOTO_ID_5214510606741771858" border="0" /></a>View of Mount Si and Little Si from I-90<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_i-a8GfjGfM0/SF2pxKukP6I/AAAAAAAAB10/ah1m7_mMPcM/s1600-h/IMG_6459.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_i-a8GfjGfM0/SF2pxKukP6I/AAAAAAAAB10/ah1m7_mMPcM/s320/IMG_6459.JPG" alt="" id="BLOGGER_PHOTO_ID_5214510605723254690" border="0" /></a>Tough Hike, Ha ...!!<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_i-a8GfjGfM0/SF2pxZlsQYI/AAAAAAAAB18/8gjizQZq8bs/s1600-h/IMG_6500.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_i-a8GfjGfM0/SF2pxZlsQYI/AAAAAAAAB18/8gjizQZq8bs/s320/IMG_6500.JPG" alt="" id="BLOGGER_PHOTO_ID_5214510609712562562" border="0" /></a>The Gang<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_i-a8GfjGfM0/SF2pxXkXtzI/AAAAAAAAB2E/LLmzj6386GA/s1600-h/IMG_6501.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_i-a8GfjGfM0/SF2pxXkXtzI/AAAAAAAAB2E/LLmzj6386GA/s320/IMG_6501.JPG" alt="" id="BLOGGER_PHOTO_ID_5214510609170151218" border="0" /></a><br /></div>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-49054817017017254782008-06-17T17:42:00.005-04:002008-06-17T17:58:55.621-04:00Uploading Files with JSPI was fed up with some of the resources available on the net to do this.<br /><br />This is how I got this done.<br /><br />1. Enable your html to upload files<br /><code><form action="http://www.mysite.org/fileUpload.jsp" enctype="multipart/form-data" method="post"><br /><p><br />Please specify a file, or a set of files:<br /><br /><input name="datafile" size="40" type="file"><br /></p><br /><div><br /><input value="Send" type="submit"><br /></div><br /></form></code><br /><br />2. Use commons file upload<br /><br />Then follow <a href="http://commons.apache.org/fileupload/using.html">Apache commons file upload article</a> to handle the file within your jsp. This is the code snippet to do that, extracted from commons file upload user guide.<br /><br /><code><br />// Check that we have a file upload request<br />boolean isMultipart = ServletFileUpload.isMultipartContent(request);<br /></code><pre>// Create a factory for disk-based file items<br />DiskFileItemFactory factory = new DiskFileItemFactory();<br /><br />// Set factory constraints<br />factory.setSizeThreshold(yourMaxMemorySize);<br />factory.setRepository(yourTempDirectory);<br /><br />// Create a new file upload handler<br />ServletFileUpload upload = new ServletFileUpload(factory);<br /><br />// Set overall request size constraint<br />upload.setSizeMax(yourMaxRequestSize);<br /><br />// Parse the request<br />List /* FileItem */ items = upload.parseRequest(request);</pre><pre>// Process the uploaded items<br />Iterator iter = items.iterator();<br />while (iter.hasNext()) {<br />FileItem item = (FileItem) iter.next();<br /><br />if (!item.isFormField()) {<br /><br /> // Process a file upload<br /> if (writeToFile) {<br /> File uploadedFile = new File(...);<br /> item.write(uploadedFile);<br /> } else {<br /> InputStream uploadedStream = item.getInputStream();<br /> ...<br /> uploadedStream.close();<br /> }<br />}<br />}<br /><br /><br /><span style="font-family:Georgia,serif;">For more information on commons file upload, use the their <a href="http://commons.apache.org/fileupload/using.html">user guide</a>. </span></pre>References<br /><ul><li>http://www.cs.tut.fi/~jkorpela/forms/file.html</li><li>http://commons.apache.org/fileupload/using.html<br /></li></ul>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-28695459804476944502008-06-17T17:33:00.002-04:002008-06-17T17:36:19.197-04:00Multi Language ReferenceI was <a href="http://blog.chinthaka.org/2008/04/java-examples.html">searching</a> for a programming language for some time, for languages other than Java.<br /><br />I started using <a href="http://www.java2s.com/">java2s.com</a> for my <a href="http://www.java2s.com/Code/CSharp/CatalogCSharp.htm">C#</a> needs and it is pretty good too. The interesting thing with that is, it has code snippets for other languages as well. Pretty neat for me.Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-88372489649155684362008-06-17T17:19:00.003-04:002008-06-17T17:37:08.538-04:00Top Papers on Distributed SystemsI wanted to list some of the pioneering and important papers on distributed systems, but I kept forgetting to do that.<br />Most people only use some books to teach/learn distributed systems, but I feel these papers really captures the essence of the field. I strongly recommend to anyone in this field to read these papers and feel free to suggest other relevant papers.<br />(Thanks to <a href="http://www.cs.indiana.edu/People/auto/p/plale.html">Professor Beth Plale</a> for selecting these great papers for our <a href="http://www.cs.indiana.edu/classes/b534/">distributed systems course</a>. )<br /><br /><span style=";font-family:helvetica;color:darkblue;" ><a href="http://www.cs.indiana.edu/classes/b534-plal/Papers/Lamport.pdf">"Time, Clocks, and the Ordering of Events in a Distributed System</a>", L. Lamport, Communications of the ACM, 21, 7, pgs. 558-565, July 1978.<br /><br /></span><span style=";font-family:helvetica;color:darkblue;" ><a href="http://web.mit.edu/Saltzer/www/publications/endtoend/endtoend.pdf">End-to-End Arguments in System Design</a>, J.H. Saltzer, D.P. Reed, and D.D. Clark, <em>ACM Transactions on Computer Systems</em>, Vol. 2, No. 4, Nov 1984</span><br /><span style=";font-family:helvetica;color:darkblue;" ><br /></span><span style=";font-family:helvetica;color:darkblue;" > <a href="http://www.cs.indiana.edu/classes/b534-plal/Papers/Alonso.ps"> "Myths around Web Services"</a>, G. Alonso, Data Engineering, vol 25, no. 4, December 2002<br /><br /></span><span style=";font-family:helvetica;color:darkblue;" ><a href="http://www.sunlabs.com/techrep/1994/abstract-29.html">"A Note on Distributed Computing</a>", Jim Waldo, Geoff Wyant, Ann Wollrath, and Sam Kendall, Sun Microsystems Laboratories Technical Report TR-94-29, November 1994<br /><br /></span><span style=";font-family:helvetica;color:darkblue;" > <a href="http://citeseer.ist.psu.edu/74848.html">Scale in Distributed Systems</a>, B. Clifford Neuman, <em>Readings in Distributed Computing Systems</em>, IEEE Computer Society Press, 1994<br /><br /></span><span style=";font-family:helvetica;color:darkblue;" > <a href="http://labs.google.com/papers/gfs.html">The Google File System</a>, <em>Proceedings of 18th Annual ACM Symposium on Operating Systems Principles</em>. October 2003<br /><br /></span><span style=";font-family:helvetica;color:darkblue;" ><a href="http://www.cs.indiana.edu/classes/b534-plal/Papers/p71-martin.pdf">"NFS Sensitivity to High Performance Networks</a>", Richard P. Martin and David E. Culler, ACM SIGMETRICS, 1999<br /><br /></span><span style=";font-family:helvetica;color:darkblue;" > <a href="http://www.pdos.lcs.mit.edu/papers/chord:sigcomm01"> Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications</a>, Ion Stoica, Robert Morris, David Karger, M. Frans Kaashoek, Hari Balakrishnan, ACM SIGCOMM, 2001<br /><br /><br /></span><span style=";font-family:helvetica;color:darkblue;" ><br /><br /></span>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-46672584137123695112008-05-29T16:52:00.003-04:002008-05-29T17:00:01.463-04:00WS-Security vs SSLIt seems some people are taking Web services security so serious. No you it is not a must to use WS-Security to secure your Web service communications. Most of the time the plain old SSL is enough.<br /><br />If<br /><ol><li>you are using http for communications</li><li>message exchanges are always between two nodes and doesn't use multiple hops to go from source to destination</li><li>not worried to encrypt only parts of the message. i.e. you want to encrypt the whole message</li></ol>then you are fine with SSL over HTTP.<br /><br />There are few advantages in using SSL over WS-Security. First its much simpler and easier. Most of the web container, like Tomcat or http implementations like httpclient supports https by default. You will have to do minimal changes to enable https.<br />And WS-Security might be complex and hard to get working.<br /><br />So whenever your answer is "Yes" to all the three questions above, you are fine with SSL.Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-67634770030467421722008-05-29T16:42:00.003-04:002008-05-29T16:52:01.205-04:00Visible Human ProjectIt is great to see a profile of our body animated from head to toes with 135 transverse sections. Check whether you can identify individual organs like heart, brain, lungs, etc., Amazing isn't it? Go to <a href="http://www.madsci.org/%7Elynn/VH/transverse.html">original web page</a> for more animations.<br /><br /><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.madsci.org/%7Elynn/VH/Transverse.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px;" src="http://www.madsci.org/%7Elynn/VH/Transverse.gif" alt="" border="0" /></a>(Original image extracted from : http://www.madsci.org/~lynn/VH/Transverse.gif)<br /></div>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-91950117037823634022008-05-04T15:54:00.004-04:002008-05-04T16:43:34.973-04:00Answers to Interesting QuestionsHere are the answers to <a href="http://blog.chinthaka.org/2008/03/interesting-questions.html">"Interesting Questions"</a>, I posted earlier.<br /><br />1. Imagine you were standing on South pole. Whichever direction you chose to go, it will be north. Travel one mile north. Then go 1 mile east. You will be traveling in a circular path, centering the south pole. Then when you come back south 1 mile, you will be on the south pole once again. Your path will be like a pizza piece. Ok, we have one. What else?<br />Time to goto North pole ....... What ??? Yeah, you will get infinite points like this.<br />Stand 1+(1/(2*pi)) miles away from the north pole. Now travel 1 mile north (you will be traveling towards north pole). Then go 1 mile east (you will be going exactly one mile around the north pole). then when you go 1 mile south, you will come back to the same location you started. We selected the distance so that, when we go one mile east, you will be going in a circular path around the north pole and you will go exactly one time around north pole.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_i-a8GfjGfM0/SB4bf3uf-MI/AAAAAAAABw4/ZmDjHP82E28/s1600-h/Screenshot-Untitled1+-+OpenOffice.org+Writer.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_i-a8GfjGfM0/SB4bf3uf-MI/AAAAAAAABw4/ZmDjHP82E28/s320/Screenshot-Untitled1+-+OpenOffice.org+Writer.png" alt="" id="BLOGGER_PHOTO_ID_5196621254381009090" border="0" /></a>There will be infinite number of points like this, which will be on a circle with radius = 1 + (1/(2*pi)) miles and making north pole the center. So do we have more?? Yes !!<br /><br />How about going around the north pole twice to make that 1 mile. So you will start 1 + 1/(2*2*pi) away from the pole. Like this you can start at any of 1 + 1/(2*n*pi) points from the pole, which will be again infinite combinations.<br />So you will have infinity * infinity points to fulfill this requirement.<br /><br />2. This is again tricky :). This is how you do this. You switch on any of the three switches, for about 10 minutes. Then switch it off. Then switch on, one of the other two. Its the time to go to the room now.<br /><br />If the light is on, then what you have set just now is the switch.<br />If the light is off, touch the light.<br /> If it is hot, then the switch is what you switched on first. The bulb is hot as it was on for 10 minutes (that is the trick).<br /> If it is not hot, then it is the switch which you never touched.<br /><br />3. This is completely based on assumptions.<br />Assume you have 3 windows in an apartment and there are 20 houses in an apartment complex. Assume we have 3 apartment complexes in a block and there are about 200 blocks in your city.<br />Summing all these info together, we will have about<br /><br />3 windows/house * 20 houses/complex * 3 apartment complexes/block * 200 blocks/city = 36000 windows/city.<br />Let's say you want to earn $20 per hour and you can clean 2 windows/hour. Then to clean all the windows you will charge (36000 windows/city) * ($20 per hour/ 2 windows/hour) = $36000 * 10<br /><br />4. There are different ways of doing this. The one I think the best is to use a ship. Mark the water level on the body of the ship first. Then put <span style="font-family: verdana;">boeing 747 of whatever object, that you want to weigh on the ship. Get the difference in water levels and use Archimedes' principles to get the weight.<br /><br />Will post answers to the next two later. </span>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-9351575453928219732008-05-04T15:34:00.003-04:002008-05-04T15:52:54.903-04:00I think we need Axis2 "Lite Edition"Last week I was desperate on a particular instrument on eBay and I was bidding like crazy. There were only one more person on this and I wanted to bid at the last 10 secs so that I could get it without increasing the price so much.<br /><br />Since this was a trivial task, I searched for softwares to do this, and I saw couple of people earning money selling these software.<br /><br />Interestingly eBay provides a <a href="http://developer.ebay.com/support/docs/tutorials/">Web services API</a>, which anyone can use to write a tool like that. I wanted to write this as a light weight Swing application, but I wanted to use Axis2 for this. When I looked at Axis2 distro, I was not happy with it, coz we have lots of jars inside our distro which our code was dependingupon. If I am writing a software like eBay trader, which will run on some ones desktop, may it be a small webstart app or a swing app, it should be light weight.<br />To send bit of SOAP messages, I don't want to have 20 odd jars, especially if this app becomes a webstart app. So I think its the time to start thinking about Axis2 lite edition, which can be used at these sorts of cases. Yes, Axis2 can be for real pros, who needs real B2B stuff and yes Axis2 supports them without any trouble.<br />But wait .. it should be able to help me with these also. I think Axis2 should come as a lite edition, with max of 5 jars in total, which will help to do these sorts of apps. I think I proposed on minimal jar distro to Axis2 list, but I didn't see any movement towards that. Perhaps I think some one might tell me "thanks for volunteering". Yes I am willing to do that, but I didn't see any energy with others on this. People realize lots of flaws in software that they develop, when they become users of their own software. Sometimes it is a pain even for them to "eat their own dog food".<br /><br />(BTW, I won that item, bidding at the last 5 secs. Fortunately the other person was not using any software for bidding :) )Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-25561046288483456952008-05-04T15:16:00.002-04:002008-05-04T15:34:11.404-04:00Dependency Parsing vs NGramsI did a project this time for my <a href="http://www.cs.indiana.edu/classes/b651/index.html">Natural Language Processing</a> class, on using both dependency parsing and ngrams to build a language models.<br /><br />The key idea that motivated me and my friend Ikhyun was that NGram model was having trouble (as we thought) with long dependencies and with sparse data. So we wanted to see a hybrid model, consisting of both dependency model and ngram model, would be any better than ngram model alone.<br /><br />We build our two language models and tested with various kinds of data. Initially we were not impressed by the results as it was no improvements over ngram model.<br /><br />Then we tested with bad sets of sentences. These sentences were created shuffling original sentences. But our hybrid model didn't perform very well compared to ngram model alone, as we expected. We tested our results with a special perplexity measure. Since it failed, we drew graphs to see how models performance with ngram model. Both approaches showed no or little improvement.<br /><br />During the discussion with <a href="http://www.cs.indiana.edu/%7Egasser/">Professor Gasser</a>, we came up with some interesting ideas for the failure.<br />1. We used English sentences for this experiment. Perhaps English might not be too rigid about word order and this might be one factor. So carrying out the same experiment with a language like Spanish might give us some better results. But the problem was neither me or Ikhyun speaks or understands Spanish :(<br /><br />2. The sentences we used to train and test the system didn't have long dependencies within them. But we wanted to have a model which would perform well, irrespective of the nature of the sentences. Actually we identified that dependency model was capturing the same information that ngram model was capturing. When we graph our probability results from the experiment, this was so obvious to us. Even though these two models rely on two different concepts, these observations were really interesting.<br /><br />3. The worst one. We used <a href="http://nlp.stanford.edu/software/lex-parser.shtml">Stanford dependency parser</a> for our experiment to get dependency outputs. Being a statistical parser, this was always trying to give the best possible output, irrespective of the nature of the input sentence. For example, this was treating both "I go to school" vs "I to go School" the same way. We were expecting this parser to output something wrong, but since it was outputting correct even for the wrong ones, we were having trouble with our model.<br /><br />I think we learnt a lot from these experiences. Perhaps we should try to test our model with a different dependency parser and a different language.Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-81419905614522793722008-05-04T15:08:00.002-04:002008-05-04T15:16:38.542-04:00Moved to Ubuntu Hardy and Vista ...This times I changed both my the OSs in my laptop.<br /><br />From Microsoft camp, I moved in to Vista Business edition, and that seems to be great (at least for the time being). I think I am fine as I have 2GB of memory in it. I am happy about the stylish user interface and various desklets. I was having trouble installing Visual Studio 2008, but in the second time I was successful.<br /><br />From the Ubuntu side, I was having trouble with my Feisty version, especially w.r.t. to my graphics. I couldn't watch a video full screen, open-office was always stuck, and no Compiz etc. But hardy seems to be great. It had got everything correct so far, except that Skype seems to be having some trouble working with my sounds and mic. I think Hardy seems to much stable than anything else so far, but I don't know what might go wrong.<br /><br />I kinda like Vista a bit (there is a different reason for this ;) ), but I still like working with Ubuntu.Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-11939184444050484062008-04-18T22:26:00.003-04:002008-04-18T22:34:55.205-04:00Sample Codes for Programming Languages<span style="font-family:verdana;">Sometimes when I wanted to find out how something can be done using Java my obvious choice was to goto <a href="http://exampledepot.com/">exampledepot.com</a> (previously known as javaalmanac.com).<br /><br />I am wandering whether there are any sites like this for other programming languages, which will be really useful.<br /></span>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-91638191159998071762008-04-18T09:03:00.002-04:002008-04-18T09:19:13.448-04:00First Earthquake Experience<span style="font-size:85%;"><span style="font-family: verdana;">This morning around 5.41 am I felt like my bed was shaking. It last about 30-60 seconds. I thought it should be an earthquake but also thought it can be due to a tornado also. It went off and I couldn't figure out what it was.<br /><br />But <a href="http://www.cnn.com/2008/US/04/18/illinois.earthquake/index.html">this news</a>, says everything about it. I'm glad my first earthquake experience is not so bad.<br /></span></span>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-50993880465320833402008-04-15T02:05:00.004-04:002008-04-15T02:12:31.049-04:00Microsoft Moves in to PC Market with a Low Cost Laptop<span style="font-family: verdana;"><a href="http://www.informationweek.com/shared/printableArticle.jhtml?articleID=207200519">Link to original news</a><br />This seems to be great news from Microsoft. I am not sure whether Microsoft is only responsible for WinXP in this laptop, but whatever it is, this might not be a good sign for other PC vendors in the long term.<br />Can this be the first sign for a laptop which can only run Windows XXX with Windows XXX version built into a flash (or whatever) memory in it?<br /></span>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-41291992942938513712008-04-13T18:06:00.006-04:002008-04-18T22:35:26.668-04:00Use java to send mail using your gmail account<span style="font-family:verdana;">One might ask why bother using Java (or any other programming language) to send mail using GMail, since you can easily do that using GMail web. But consider you want to send the same mail to some one, so that they will think the mail was sent only to them (personalize mass email).<br />(Today it is Sinhala New year festival, in Sri Lanka. So this was a great tool for me to wish everyone).<br /><br />I tried to use the <a href="http://www.javacommerce.com/displaypage.jsp?name=javamail.sql&id=18274">basic mail client</a> with Google, but it didn't work out as GMail needs more settings. But I found the best Android hacker, aka Dims had put up a nice blog on <a href="http://davanum.wordpress.com/2007/12/22/android-send-email-via-gmail-actually-via-smtp/">using Android to send mails with GMail</a>. So I extracted some code from that for this task.<br />First get <a href="http://fisheye5.cenqua.com/browse/%7Eraw,r=1.1/glassfish/repo/javax.activation/jars/activation-1.1.jar">activation.jar</a> and <a href="http://fisheye5.cenqua.com/browse/%7Eraw,r=1.1/glassfish/repo/javax.mail/jars/mail-1.4.1.jar">mail.jar</a> and put them in your classpath.<br /><br />Put your recipients list in a simple text file like this and name it recipients.txt.<br /><br /><code><br />John=john@greatplace.com<br />Siripala=siri@srilanka.net<br /></code><br /><br />Then use the following code. Make sure you put valid gmail username and a password.<br /><br /><code><br />import javax.mail.Authenticator;<br />import javax.mail.Message;<br />import javax.mail.MessagingException;<br />import javax.mail.PasswordAuthentication;<br />import javax.mail.Session;<br />import javax.mail.Transport;<br />import javax.mail.internet.InternetAddress;<br />import javax.mail.internet.MimeMessage;<br />import java.io.BufferedReader;<br />import java.io.FileReader;<br />import java.io.IOException;<br />import java.util.Properties;<br /><br />/**<br />* @author : Eran Chinthaka<br />* @date : Apr 13, 2008<br />*/<br />public class GMailClient extends Authenticator {<br /><br /> // Edit these settings with your username and password<br /> private String gmailUserName = "username";<br /> private String gmailPassword = "password";<br /> //=====================================================<br /><br /> public void postMail(String recipients[], String subject,<br /> String message, String from) throws MessagingException {<br /> boolean debug = false;<br /><br /> //Set the host smtp address<br /> Properties props = new Properties();<br /> props.setProperty("mail.transport.protocol", "smtp");<br /> props.setProperty("mail.host", "smtp.gmail.com");<br /> props.put("mail.smtp.auth", "true");<br /> props.put("mail.smtp.port", "465");<br /> props.put("mail.smtp.socketFactory.port", "465");<br /> props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");<br /> props.put("mail.smtp.socketFactory.fallback", "false");<br /> props.setProperty("mail.smtp.quitwait", "false");<br /><br /> Session session = Session.getDefaultInstance(props, this);<br /><br /> session.setDebug(debug);<br /><br /> // create a message<br /> Message msg = new MimeMessage(session);<br /><br /> // set the from and to address<br /> InternetAddress addressFrom = new InternetAddress(from);<br /> msg.setFrom(addressFrom);<br /><br /> InternetAddress[] addressTo = new InternetAddress[recipients.length];<br /> for (int i = 0; i < message = "Your HTML Message goes here" subject = "This is the subject" fromaddress = "from@whatever.com" mailclient =" new" in =" new" str =" in.readLine())" details =" str.split(" name =" details[0];" email =" details[1];"><br /><br /></span>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-49573521812709997382008-03-31T23:07:00.001-04:002008-03-31T23:07:27.276-04:00Beauty of Sri Lanka<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/_sM9vcAIYyc&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/_sM9vcAIYyc&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-85575003908617689462008-03-30T15:12:00.003-04:002008-03-30T15:23:54.336-04:00Sufferings and Life<span style="font-family:verdana;">Last week I had to take, sort of a difficult decision on selection of XXX out of n options. I was upset when I didn't have any of the option, about 3 weeks before. Last week I was upset since I had too many options to select and to abandon all of them except one.<br /><br />This reminded me about <a href="http://en.wikipedia.org/wiki/Ajahn_Brahm">Ven. Ajahn Brahma's</a> talk on <a href="http://www.bswa.org/modules/mydownloads/singlefile.php?cid=15&lid=546">"Your way to Happiness"</a>. He gave some wonderful examples of how we suffer due to our expectations. For example, when one is not married and having problems with marriage he (or she) has the "single person suffering". When he (or she) get married, then he (or she) has the "married person suffering". When </span><span style="font-family:verdana;">he (or she) doesn't have kids </span><span style="font-family:verdana;">he (or she) has "no kid suffering". When </span><span style="font-family:verdana;">he (or she) has kids then </span><span style="font-family:verdana;">he (or she) has "sufferings due to kids". So the point is we will never get away with sufferings. We will just transfer one form of suffering to another. </span><span style="font-family:verdana;"><br /><br />When will we be satisfied with no sufferings? </span><span style="font-family:verdana;">If we think about this for a while, it is true for everything.<br /></span>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-71095801048103167002008-03-30T14:57:00.004-04:002008-03-30T15:11:55.745-04:00CBR and Workflows for e-Science<span style="font-family: verdana;">I was talking with my friend <a href="http://www.google.com/url?sa=t&ct=res&cd=3&url=http%3A%2F%2Fjaliyablogs.blogspot.com%2F&ei=teLvR5v0AYzQeYWakY4B&usg=AFQjCNEYAIM8mc9zj1uM4KTMWe4FlNMYMw&sig2=M0rvJy4C7_AdseHKR_UmuQ">Jaliya</a> about an interesting application of CBR (Case-Based Reasoning) to workflows in e-Science.<br />Most of the eScience systems that use workflows, run these workflows on super computers. These operations might take a considerable amount of time even within super computers and the overhead of the system itself might degrade the performance of a system. Sometimes we might have to run multiple workflows to get a good decision or output.<br />If we take weather applications for example, we will run couple of workflows to get a final decision. What if we can look at the data, compare them with previous data and results, and then predict the workflows to run? It is true that no two weather events are similar (a quote from my friend Suresh Marru). But this method might give really fast clues to those meteorologists.<br /><br />We were trying to do this as a class project, but failed as we couldn't find enough data within the system. But for me this seems a very promising approach.<br /><br />During one of our extreme lab brainstorming coffee session, we thought about the application of CBR for scheduling jobs within grid environment. If we have data like, process requirements (# of CPUs, time constraints, etc.,) and previous information like wait time, execution time, affinity for each super computer, then we can build a AI system, with concepts from CBR. An interesting project to do, if I get some time.<br /></span>Eran Chinthakanoreply@blogger.comtag:blogger.com,1999:blog-16615635.post-16823739591670901662008-03-30T14:43:00.004-04:002008-03-30T14:54:56.509-04:00Example Based Learning<span style="font-family:verdana;">People who already know about this might disregard this approach as soon as they see it. But this seems to be a more fundamental way of how we initially grasp a new spoken language. It is true that the extent to which you can proceed with this approach is limited. But this method is a good starter.<br /><br />This method can be applied to translate between languages, learning from given examples. Let me give an idea of how this works and teach you some <a href="http://en.wikipedia.org/wiki/Sinhala_language">Sinhala</a> ;).<br /><br />English : I go to (the) school<br />Sinhala : Mama pasela ta yami<br /><br />English : I go to the shop<br />Sinhala : Mama kade ta yami<br /><br />Now if you are asked to translate "I go to campus", now you can translate some of this as "Mama xxxx ta yami". You just have to find out the translation from campus to Sinhala and you are done.<br /><br />This is the simplest way one can use learning. As you can see this will become harder for long and complex sentences, but this is very useful to start learning languages.<br /></span>Eran Chinthakanoreply@blogger.com