tag:blogger.com,1999:blog-152833312009-06-29T03:10:06.348+05:30Anuradha's Diaryof shoes and ships and sealing wax, of cabbages and kings, and why the sea is boiling hot, and whether pigs have wingsAnuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.comBlogger55125tag:blogger.com,1999:blog-15283331.post-51951899160924371872009-05-24T13:17:00.005+05:302009-05-24T14:37:34.575+05:30A Rare Video of SWRD<p>In this recent <a href="http://unprotectedthoughts.com/2009/03/tamil-struggle-vs-black-struggle-reply.cfm">blog post</a>, Sam reminds how S W R D Bandaranaike changed national language in 1956, something most people in the present generation [wrongly] call a "Sinhala-only" policy.</p> <blockquote> English was the Language in Sri Lanka until Bandaranayaka changed it in to Sinhala “with reasonable use of Tamil” (the part everyone forget to mention when they talk about this), and later on, Tamil also considered as national language. </blockquote> <p>This rare <a href="http://www.youtube.com/watch?v=rbL5E5naR6s">video on youtube</a> is an interview with SWRD, where he states the "reasonable use of Tamil" part. He also admires Tamil as a "rich language with literature and so on".</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-5195189916092437187?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com0tag:blogger.com,1999:blog-15283331.post-92085670392102477492009-05-21T20:40:00.002+05:302009-05-21T20:53:10.554+05:30How "Free" Media Create Hatred<p>Here are two reports on the resettlement of displaced people in Sri Lanka: <a href="http://news.bbc.co.uk/2/hi/south_asia/8061623.stm">one by the BBC</a>, and <a href="http://www.google.com/hostednews/ap/article/ALeqM5gVoaDFmbCYS-Usz9ACDRIengj21QD98ALF1O0">another by the Associated Press</a>.</p> <p>The BBC report talks about "most of the 250,000 Tamils displaced", while AP talks about "the fate of the ethnic Tamil civilians".</p> <p>WTF?</p> <p>In my eyes, they are <em>Sri Lankan</em> citizens, be it "Tamil" or not, our brothers and sisters who desperately need help after going through so much. I am sure that I am not alone.</p> <p>But some media reports continue to highlight ethnic prefixes. Does someone, or more than one someone, want to stop our country from unifying under a single Sri Lankan identity?</p> <p>Even if they have an excuse to add an ethnic prefix, how do they say for sure that all the 250,000 displaced people are in fact Tamil? It may be true, but can those reports be so authoritative without even a sample survey?</p> <p>Here is <a href="http://www.reuters.com/article/asiaCrisis/idUSCOL432964">another news item from Reuters</a>, which talks about just "refugees". No prefixes.</p> <p>Interestingly, BBC conveniently forgot the "Tamil" prefix when headlining the assassination of <a href="http://news.bbc.co.uk/2/hi/south_asia/4147196.stm">Lakshman Kadiragamar</a> and <a href="http://news.bbc.co.uk/2/hi/south_asia/7332952.stm">Jeyaraj Fernandopulle</a> but not when pro-LTTE persons got killed (e.g.: <a href="http://news.bbc.co.uk/2/hi/south_asia/7166560.stm">here</a>, <a href="http://news.bbc.co.uk/2/hi/south_asia/5271062.stm">here</a> and <a href="http://news.bbc.co.uk/2/hi/south_asia/7282205.stm">here</a>).</p> <p>The war is over, but we now have more reasons to be vigilant. Not just about LTTE sleeping sells, but also about those who subtly create and extend ethnic hatred to stop us from uniting as Sri Lankans.</p> <p>I don't expect every media organization to positively contribute to peace and harmony in Sri Lanka; being neutral is just fine. But if they positively and systematically contribute to create hatred among us, that's where we need to take a stand. By "taking a stand", I don't mean that we should ban them here, but educating ourselves and peace-loving fellow citizens of perils much more dangerous than armed terrorist organizations will go a long way.</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-9208567039210247749?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com2tag:blogger.com,1999:blog-15283331.post-52920097762168628642009-05-20T13:46:00.002+05:302009-05-20T13:52:59.423+05:30We Salute You!<p>Our country has finally become a truly unified sovereign. Last time it happened was in the 1500s (no, not in 1948).</p> <p>I salute all our armed forces, those who have sacrificed their lives for the betterment of others in our nation, for making this happen!</p> <p>Our country is lucky to be blessed with a President like Mahinda Rajapaksa, at the right time, if not later, complimented by great military leadership. A leadership that didn't become pawns of some other intrusive nations who call themselves the "International Community".</p> <p>We also should be thankful to the nations who were with us during these hard times. Such times are invaluable to figure out who our true friends are.</p> <p>In this defining moment of history, I think it is important for all of these to happen.</p> <ul> <li><b>Victory celebrations</b>. Peaceful celebrations is a good way to bring our nation together. It is important not to spend a lot of money, next two items in the list needs them. Serving milk rice, hoisting national flags, rallies are all good, as long as they don't grow violent. I noticed Police presence in most of these events, which is good, so things won't go out of control.</li> <li><b>Helping disabled/fallen heroes, and their families</b>.</li> <li><b>Contributing to help displaced people</b>.</li> <li><b>Get rid of ethnic identities, and treat everyones as "Sri Lankans"</b>. Just getting rid of the adjectives marking ethnicity is all we need to do. We don't need "Sinhala Villages", "Tamil areas" etc. We have only Sri Lankan stuff. We may use "Sinhala-speaking" or "Tamil-speaking" when necessary, but there is no need to label people in ethnic terms anymore.</li> </ul> <p>I am hopeful and optimistic that this will be the beginning of prosperity to our country!</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-5292009776216862864?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com4tag:blogger.com,1999:blog-15283331.post-66799950255380922612009-05-16T07:43:00.001+05:302009-05-16T08:13:23.136+05:30How to become a Superhero<p>There is Superman. There is Catwoman. There is Spiderman. And a few others.</p> <p>There was a time I could count the number of superheros with my fingers. Not anymore. They are now everywhere!</p> <p>And you can become one, if you like; simple.</p> <p>Join an NGO to become an "aid worker". Become a journalist. Become a doctor or anyone that can be called an "official", or just call yourself one.</p> <p>That's all it takes to become a superhero these days. And you will be much more powerful than the handful or traditional superheros!</p> <p>Whatever you say will be fully trusted by "international" media. Even if they hear your (claimed) voice over the phone, or an email. No cross checking. No verifications. How very convenient?</p> <p>Your judgment powers will become objective all of a sudden. Your previous relationships, your religions and political beliefs and aspirations, your former affiliations, will never affect your decisions. All that will be past. If others can't make head or tail of something, they will ask you. You will always be treated as "independent".</p> <p>You will never take sides. Even if you did so in the past, you will make sure to leave such allegiances in the past. You will not merely transform into a superhero; you will be re-born!</p> <p>If harm comes your way, judgment will have be fast-tracked and accelerated. Justice for other human beings can wait. After all, you are super-human, right?</p> <p>You will get full immunity. Since you are very objective in thinking, you will never do something wrong. So no one can arrest you. Even if they did, you will have a stream of fans who will do everything in their power, and possibly more, to set you free. Laws made by ordinary humans for themselves cannot apply to you, even when you are not acting in the capacity of a superhero.</p> <p>And you will be allowed to go to any dangerous place, and any other place, too, for that matter. But unlike for Superman, you will not have to look after your own safety. Others will have to make sure that you are safe, even if that makes their job much more difficult and dangerous. It's their problem; not yours.</p> <p>And last, but not least, Superman will feel very jealous of you, because he doesn't get paid! ;-)</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-6679995025538092261?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com5tag:blogger.com,1999:blog-15283331.post-49685773348955434142009-02-03T08:52:00.004+05:302009-02-03T09:05:10.327+05:30iPhone 3G for 800+ USD?<p>In this <a href="http://www.youtube.com/watch?v=40YW7Lco0og">WWDC 2008 keynote</a>, Steve Jobs said that the iPhone 3G will sell at 199/299 USD in <em>almost</em> all countries around the world.</p> <p>Today I saw an email passing around which said that <a href="http://www.dialog.lk">Dialog</a> is selling the iPhone 3G for Rs 89,000, more than 800 USD! Few months ago, <a href="http://www.btoptions.com/">BT Options</a>, the local Apple agent, was selling iPhones at Rs 120,000!!!</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-4968577334895543414?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com6tag:blogger.com,1999:blog-15283331.post-35200163095247415162008-05-23T21:18:00.004+05:302008-05-23T22:38:13.518+05:30Congratulations Shilpa Sayura<p>Sri Lanka's <a href="http://shilpasayura.org/" target="_blank">Shilpa Sayura</a> project has won the <a href="http://stockholmchallenge.se" target="_blank">Stockholm Challenge</a> 2008.</p> <p>The Jury had studies 400 projects from around the globe and selected 145 finalists in six categories. Shilpa Sayura won the first place in the Education category.</p> <p>Congratulations Niranjan and the team for this great achievement!</p> <span class="fullpost"><p>I once had the opportunity to see a Shilpa Sayura event at Kandiyapitawewa village. Pictures from that event <a href="http://www.flickr.com/photos/anuradha/sets/72157602123087620/detail/" target="_blank">are here</a>.</p></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-3520016309524741516?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-69912890463220331792008-05-06T15:44:00.005+05:302008-05-06T16:44:38.030+05:30Mr Donald, Please Correct the Alphabet First!<p>I have <a href="http://anuradha.sayura.net/2006/03/is-sinhala-unicode-incomplete.html" target="_blank">already replied</a> to Mr Donald Gaminitillake's mudslinging campaign against Sinhala Unicode, which he wields through <a href="http://www.akuru.org" target="_blank">akuru.org</a> web site and by hijacking discussions on various blogs and forums.</p> <p>Mr Donald's motives are quite clear. He claims that every Sinhala character shape needs an individual "code point", and has applied for a patent for this "invention". With Sinhala Unicode becoming mainstream, avenues for making money with his pending patent are going thin.</p> <p>So he is doing what any desperate human being (or animal for that matter) would do; try everything to remove the "opponent".</p> <span class="fullpost"> <p>One of the examples Mr Donald always uses is the absence of character "du" in the Sinhala Unicode codepage.</p> <p>Of course he conveniently forgets to mention that "da" and "papilla" are in fact available. Well, it requires a bit of brains to put them together. ;-)</p> <p><b>Mr Donald, there are lots of missing characters in the Sinhala Hodiya (alphabet), including your infamous "du", let alone "yansaya" and "rakaransaya". If you love the Sinhala language so much as you claim, please start a campaign to "fix" Hodiya!</b></p> <p>I have <a href="http://anuradha.sayura.net/2007/05/unicode-and-sinhala-alphabet.html">previously pointed out</a> this similarity between Hodiya and Sinhala Unicode, and why "du" + "papilla" is as good as "du". <a href="http://anuradha.sayura.net/2006/03/is-sinhala-unicode-incomplete.html">This blog post</a> discusses technicalities in detail including the matter of "yansaya" and "rakaransaya".</p> <p>Unfortunately for Mr Donald, his "opponent", namely Sinhala Unicode, is growing stronger day by day. Implementations are maturing, more standards compliant fonts are beginning to appear, and as I <a href="http://anuradha.sayura.net/2008/03/more-sinhala-web-sites-using-sinhala.html">wrote earlier</a>, more web sites and blogs are now Unicode compliant (e.g.: <a href="http://www.sinhalabloggers.com" target="_blank">Sinhala Bloggers</a>, <a href="http://si.wikipedia.org" target="_blank">Sinhala Wikipedia</a>, <a href="http://www.sinhalablogs.com" target="_blank">Sinhala Blogs</a> and of course our own <a href="http://sinhala.linux.lk" target="_blank">Sinhala GNU/Linux</a>).</p> </span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-6991289046322033179?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com11tag:blogger.com,1999:blog-15283331.post-9918927475127101982008-05-03T12:12:00.007+05:302008-05-06T06:59:52.867+05:30External Projectors and GNU/Linux<p>Some GNU/Linux computers seem to have problems connecting to projectors. While my earlier <a href="http://www.thinkwiki.org/wiki/Category:R51" target="_blank">ThinkPad R51</a> always obeyed Fn+F7 combination to turn on output to an external projector, recently acquired <a href="http://www.thinkwiki.org/wiki/Category:R52" target="_blank">R52</a> did not.</p> <p>After some research I found that <a href="http://www.x.org/wiki/Projects/XRandR" target="_blank">XRandR</a> has good support for output hotplugging. Although graphical tools are available to do this, I found the following commands useful.</p> <span class="fullpost"> <pre> % xrandr --auto % xrandr --output --auto </pre> <p>The first one usually works, and it has to be issued as the same user running X, and not root.</p> <p>In rare cases when parts of the screen is cropped due to the projector having a smaller resolution, use the -s option to reset the resolution:</p> <pre> % xrandr -s 1024x768 </pre> <p>Running xrandr without options would show what is going on with the screen modes.</p> </span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-991892747512710198?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-20881957925400589532008-04-21T19:02:00.004+05:302008-04-21T19:37:14.277+05:30Why Native Language is Important for Web<p>After reading <a href="http://rumblinglankan.com/whats-the-point-of-blogging-in-sinhala/" target="_blank">this blog post</a> about blogging Sinhala, I felt like writing my thoughts about the topic.</p> <p>There are very few "yes" or "no" answers in life, so I don't think it is correct to rule "blogging in Sinhala is a good idea" or vice versa. Most answers can begin with an "it depends", and I think it is true here, too.</p> <span class="fullpost"><p>In certain circumstances, using in English on the Web is a good idea. When addressing a global audience, or selling to a product on the Web to the global market, not using English will definitely not serve the purpose.</p> <p>A key argument for using Sinhala is about addressing certain audiences who are not fluent in other languages.</p> <p>I think there is a more important reason. Certain things can <em>only</em> be done in Sinhala, and this argument holds for any other language.</p> <p>A blog post is not always a piece of information to be transmitted to a maximum audience. Sometimes it is a work of art. Works of art are diverse, and this diversity is not only limited to language.</p> <p>Sinhala is not only a communication medium. It also has a very rich literature: poetry, writings and what not. Being a living language, new Sinhala literature is made every day. And if Web is the medium for such literature, obviously, Sinhala has to be the language.</p> <p>Check out <a href="http://suonline.blogspot.com/2008/04/blog-post_4020.html" target="_blank">this blog post</a> for example. (You may need to <a href="http://www.siyabas.lk/sinhala_how_to_install.html" target="_blank">enable Unicode support</a>). It is a collection of Sinhala poetry from an online "hitiwana kavi maduwa", where people used poetry to communicate. I am sure there are lots of readers who appreciate such work. I can hardly imagine how such a blog post can be in English.</p> <p>So I think the answer to most questions of life applies here as well: <em>it depends</em>. ;-)</p></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-2088195792540058953?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com4tag:blogger.com,1999:blog-15283331.post-3877346719031757852008-04-20T18:00:00.005+05:302008-04-21T16:50:36.163+05:30LaTeX and Sinhala Unicode<p>When we <a href="http://mail.lug.lk/lurker/thread/20080417.161404.4759eb85.html" target="_blank">met at Excel World</a> on last 17th, <a href="http://www.geekaholic.org/" target="_blank">Bud</a>, Srimal and myself started talking about using Sinhala Unicode in <a href="http://en.wikipedia.org/wiki/TeX" target="_blank">TeX</a> / <a href="http://www.latex-project.org/" target="_blank">LaTeX</a>.</p> <p>It didn't occur to me that <a href="http://www.ucsc.cmb.ac.lk/People/cik/" target="_blank">Chamath</a>, who also created one of the first Sinhala FOSS keyboard drivers, has already created a preprocessor for LaTeX called sintex which reads Sinhala files in Unicode/UTF-8. In fact, not only had I replied to <a href="http://mail.lug.lk/lurker/thread/20060503.023257.e7bd4af3.html" target="_blank">his announcement</a>, but also sent a patch to Debianize it! Life is too complex, and I am too human to keep track of all these.</p> <p>But that forgetfulness turned out to be a lucky incident, as our pursuit lead to something more useful!</p> <span class="fullpost"><p>So we started creating a preprocessor for Vasantha Saparamadu's <a href="http://www.ocs.mq.edu.au/~vsaparam/sinhala.html" target="_blank">Sinhala TeX</a> package which uses Samanala transliteration scheme.</p> <p>However, Bud pointed out that the generated PDF files will have ASCII characters instead of Unicode, making it a problem for search engines that index them, and convert them for "HTML view" pages.</p> <p>After some research, we found <a href="scripts.sil.org/xetex" target="_blank">XeTeX</a>, a Unicode enabled version of LaTeX.</p> <p>XeTeX uses <a href="http://www.icu-project.org/" target="_blank">ICU</a> for text layout, and ICU versions after 3.6 supports Sinhala out of the box. However, latest stable version 0.996 of XeTeX uses statically linked ICU 3.4. I managed to patch the "tetex-xetex" package that comes with <a href="http://www.debian.org" target="_blank">Debian</a> and make it recognize Sinhala. The patches <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476957" target="_blank">were also submitted</a> to Debian.</p> <p>XeTeX font changes are always manual, which made the source look ugly. After a bit of research, I found <a href="http://code.google.com/p/zhspacing/" target="_blank">zhspacing</a> package, which among other things automatically sets fonts for Chinese characters. But it is a complicated package, but I managed to get an idea of how it uses character class feature in the latest XeTeX version 0.997.</p> <p>Downloading the latest version of XeTeX from <a href="http://scripts.sil.org/svn-view/xetex/TRUNK" target="_blank">SVN repository</a> and building for Debian was not difficult, except I had to edit debian/control files to replace tetex-base and tetex-bin dependency to their texlive counterparts. I had to first get <a href="http://scripts.sil.org/svn-view/xdvipdfmx/TRUNK/" target="_blank">xdvipdfmx</a>. Here is a rough sketch of the work.</p> <pre> % mkdir xdvipdfmx % cd xdvipdfmx % svn co http://scripts.sil.org/svn-view/xdvipdfmx/TRUNK % cd TRUNK % chmod +x debian/rules # dpkg-buildpackage -b # cd .. # dpkg --purge dvipdfmx # dpkg -i xdvipdfmx...deb % cd .. % mkdir xetex % cd xetex % svn co http://scripts.sil.org/svn-view/xetex/TRUNK % cd TRUNK % vi debian/control % chmod +x debian/rules # dpkg-buildpackage -b # cd .. # dpkg --purge texlive-xetex # dpkg -i xetex...deb </pre> <p>As the XeTeX web site had warned, the Debian build files provided by vanilla XeTeX were not up to date. After installing I had to create a /etc/texmf/fmt.d/10local.cnf with the following two lines:</p> <pre> xetex xetex - *xetex.ini xelatex xetex language.dat *xelatex.ini </pre> <p>and then run the following commands:</p> <pre> # update-fmutil # fmutil-sys --enablefmt xetex # fmutil-sys --enablefmt xelatex </pre> <p>to make "xelatex" command to work properly.</p> <p>After getting latest version of XeTeX working, the last remaining step was to create a small style file, which I called "sinhala.sty", to make automatic font switching for Sinhala.</p> <pre> % sinhala.sty version 20080420 % Typesetting mixed Sinhala documents in XeTeX % % Copyright (C) 2008 by Anuradha Ratnaweera % \ifx\XeTeXrevision\@undefined \errmessage{XeTeX is required to use sinhala} \fi \ifx\XeTeXinterchartokenstate\@undefined \errmessage{XeTeX 0.997 or above required to use sinhala} \fi \ProvidesPackage{sinhala}[2008/04/20] \RequirePackage{fontspec} \newfontinstance{\sifont}[Script=Sinhala]{LKLUG} \newcommand\latinfont{\fontfamily{lmr}\selectfont} \XeTeXinterchartokenstate = 1 \newcount\cnt\cnt="0D80 \loop \XeTeXcharclass\cnt=10 \ifnum\cnt<"0DFF \advance\cnt1 \repeat \XeTeXcharclass "200C = 10 \XeTeXcharclass "200D = 10 \XeTeXinterchartoks 0 10 = {\sifont} \XeTeXinterchartoks 255 10 = {\sifont} \XeTeXinterchartoks 10 0 = {\latinfont} \XeTeXinterchartoks 10 255 = {\latinfont} </pre> <p>So, all you need is XeTeX 0.997 and sinhala.sty to write LaTeX files using Sinhala Unicode.</p></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-387734671903175785?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com0tag:blogger.com,1999:blog-15283331.post-83150277222833612432008-04-15T07:40:00.002+05:302008-04-16T07:34:50.091+05:30Goodbye xorg.conf!<p>After reading <a href="http://wiki.debian.org/XStrikeForce/HowToRandR12">this article</a> on <a href="http://www.x.org/wiki/Projects/XRandR" target="_blank">xrandr</a>, I wanted to see how total autoconfiguration works on <a href="http://en.wikipedia.org/wiki/X_Window_System" target="_blank">X Windows</a>.</p> <p>As a start, I tried removing xorg.conf file completely and restart X. The sky didn't fall down! In fact, I didn't notice any change. Everything from USB hotplug to OpenGL continued to work as before.</p> <span class="fullpost"><p>The only tweak needed was to the old font system. Unlike fontconfig, the old X font system seems to depend on the "font path" set in xorg.conf. This was a problem for using my custom SUN22x12 font in xterm. After adding the following lines to ~/.fvwm/preferences/Startup, this problem was gone, too.</p> <pre> AddToFunc InitFunction + I Exec exec /usr/bin/xset +fp /usr/local/share/fonts </pre> <p>Yes, I use <a href="http://fvwm-crystal.org/" target="_blank">fvwm-crystal</a>, a "polished" version of <a href="http://www.fvwm.org/" target="_blank">FVWM</a>. Old school, so what?</p></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-8315027722283361243?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-46634868283386705332008-04-14T22:20:00.007+05:302008-04-16T07:36:08.426+05:30Simplifying Digital Camera Access on GNU/Linux<p>Digital camera access is simple enough on GNU/Linux, but with a couple of tweaks here and there, it can be made even simpler.</p> <p><it>Summary</it>: I keep my photos in directories named "yyyy-mm-dd" by the date taken. When I plug in the camera, photos are automatically downloaded and sent to correct directories. If you like to know how I did it, please read on!</p> <span class="fullpost"><p>Accessing digital cameras has always been simple on GNU/Linux. A large number of digital cameras are supported out of the box. When using the shell, arguably <a href="http://www.gphoto.org/" target="_blank">gphoto</a> is the most convenient. Running gphoto with the "P" option autodetects the camera and downloads all the photos in it.</p> <pre> % gphoto2 -P </pre> <p>I keep all my photos in a "photos" directory with subdirectories in the "yyyy-dd-mm" format indicating the date taken.</p> <p>First step of simplification is to automatically put each image into the correct location. Digital cameras put a lot of <a href="http://en.wikipedia.org/wiki/Exif" target="_blank">Exif information</a> into each image, so extracting the date taken is quite straightforward. I use a simple tool called <a href="http://sourceforge.net/projects/libexif" target="_blank">exif</a> to do this.</p> <p>Both gphoto2 and exif are available on <a href="http://www.debian.org" target="_blank">Debian</a>.</p> <pre> # apt-get install gphoto2 exif </pre> <p> After some trial and error, I figured that the images taken with my <a href="http://en.wikipedia.org/wiki/Canon_PowerShot_S3_IS" target="_blank">Canon PowerShot S3 IS</a> have a tag 0x132 indicating the date each photo was taken. </p> <pre> % exif -t 0x132 IMG_0416.JPG EXIF entry 'Date and Time' (0x132, 'Date and Time')... Tag: 0x132 ('DateTime') Format: 2 ('Ascii') Components: 20 Size: 20 Value: 2007:10:22 06:05:49 </pre> <p>What we want is in the "Value:" line. After filtering that line with grep, and using sed a couple of times, we can get the date in yyyy-dd-mm format.</p> <pre> % exif -t 0x132 IMG_0416.JPG | \ grep 'Value: ' | \ # Filter the line with "Value:" sed 's/.*Value: \(....:..:..\) .*/\1/' | \ # Get the yyyy:mm:dd part of the value line sed 's/:/-/g' # convert ":" to "-" 2007-10-22 </pre> <p>If you want to understand exactly what each step is doing, try the above pipeline by adding one filter at a time.</p> <p>Then I put together a small script to move each image in the current directory to ~/pictures/yyyy-mm-dd/ subdirectories where I want them.</p> <pre> gphoto2 -P for i in *.JPG do date=$(exif -t 0x132 $i | \ grep 'Value: ' | \ sed 's/.*Value: \(....:..:..\) .*/\1/' | \ sed 's/:/-/g') dir="/home/anuradha/pictures/test/$date" mkdir -p "$dir" mv -f "$i" "$dir" done </pre> <p>Notice that I use a test directory. I saved this in ~/bin/, and made it executable.</p> <p>Now comes the fun part. After connecting the camera to the computer, I used "lsusb" to find out its vendor ID and product ID are 04a9:311a. The following <a href="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" target="_blank">udev</a> rule in /etc/udev/rules.d/010_local.rules invokes the above script whenever this camera is plugged in.</p> <pre> ACTION=="add", BUS=="usb", \ SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="311a", \ RUN+="/home/anuradha/bin/pictures.sh" </pre> <p>Well, matters are a little more complicated. Udev seems to invoke the script <em>multiple</em> times. So I added two extra "features" to stop that.</p> <ul> <li>Adding a lock file to prevent multiple simultaneous running of the script.</li> <li>Use a "timestamp" file at the end of the script, and not run again "too soon" (60 seconds turned out to be ok).</li> </ul> <p>These made sure that the script is run only once when the camera is plugged in.</p> <p>I used the number of seconds since the <a href="http://en.wikipedia.org/wiki/Unix_time" target="_blank">Unix Epoch</a> given by the stat and date commands. If the timestamp file was created less than 60 seconds ago, the script aborts.</p> <p>So here is the complete script:</p> <pre> #!/bin/bash set -e user=anuradha group=users pictures="/home/$user/Pictures" download="$pictures/.download" logdir="$pictures/log" log=$(date +"$logdir/%Y-%m-%d"); cooldown=60 lock=/tmp/.pictures.download lasttime=$lock.time # Avoid multiple simultaneous runs ln -s $lock $lock || exit 0 # Abort if we had run less than $cooldown seconds ago if [ -f "$lasttime" ] then t1=$(stat -c '%Z' $lasttime) t2=$(date +'%s'); dt=$((t2 - t1)) if [ $dt -lt $cooldown ] then rm -f $lock exit 0 fi fi # Take it slowly ;-) sleep 3 mkdir -p $download mkdir -p $logdir rm -f $download/* # Get the photos, all of them cd $download gphoto2 -P for i in *.JPG do date=$(exif -t 0x132 $i | \ grep 'Value: ' | \ sed 's/.*Value: \(....:..:..\) .*/\1/' | \ sed 's/:/-/g') dir="$pictures/$date" if [ ! -f "$dir/$i" ] then [ -d $dir ] || mkdir -p $dir chown $user:$group $i chmod 644 $i chown $user:$group $dir mv -f $i $dir echo "$date/$i" >> $log fi done cd rmdir $download # Add a timestamp touch $lasttime rm -f $lock exit 0 </pre></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-4663486828338670533?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com3tag:blogger.com,1999:blog-15283331.post-21768858677684183182008-04-09T23:36:00.005+05:302008-04-16T07:37:41.352+05:30Network Traffic Accounting<p>After <a href="http://anuradha-ratnaweera.blogspot.com/2008/04/mobitel-3g-with-huawei-e220-on-debian.html">totally automating</a> my Mobitel 3G connection, the next natural step was to setup some kind of a traffic accounting system. I wanted to avoid tools that monitor individual packets, because that was an unnecessary overhead. <a href="http://www.humdi.net/vnstat/" target="_blank">vnStat</a> turned out to be a perfect match.</p> <span class="fullpost"><p>Here are the steps in setting up vnstat on <a href="http://www.debian.org" target="_blank">Debian</a>. Good news is that vnstat in Debian comes with proper crontab entries and network up/down hooks already in place.</p> <ul> <li>First step, obviously is to install vnstat: <pre> # apt-get install vnstat </pre> </li> <li>Create a new configuration: <pre> # vnstat --showconfig > /etc/vnstat.conf </pre> </li> <li>Edit /etc/vnstat.conf and set the default interface to "ppp0".</li> <li>Create an empty database for ppp0: <pre> # vnstat -u -i ppp0 </pre> </li> </ul> <p>Now vnstat starts counting network traffic. The default crontab seems to run "vnstat -u" every 5 minutes.</p> <p>Then I installed this simple web based frontend called <a href="http://www.sqweek.com/sqweek/index.php?p=1" target="_blank">vnStat PHP frontend</a>. Installation is just a matter of unpacking:</p> <pre> # cd /usr/local/src/ # wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.3.tar.gz # cd /var/www # tar -xzvf /usr/local/src/vnstat_php_frontend-1.3.tar.gz # mv vnstat_php_frontend-1.3 vnstat </pre> <p>Then I had to edit /var/www/vnstat/config.php and set the following values.</p> <pre> $iface_list = array('ppp0'); $iface_title['ppp0'] = 'Mobitel 3G'; $vnstat_bin = '/usr/bin/vnstat'; </pre> <p>Pointing a browser to http://localhost/vmstat/ showed that everything is working fine.</p> <p>I also have the following .htaccess file in vnstat directory to avoid access from remote hosts:</p> <pre> Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </pre></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-2176885867768418318?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-79447209237634719962008-04-09T10:30:00.012+05:302008-04-16T07:38:04.402+05:30Mobitel 3G with Huawei E220 on Debian<p>Finally I decided to shift my mobile Internet connectivity from <a href="http://en.wikipedia.org/wiki/General_Packet_Radio_Service" target="_blank">GPRS</a> to <a href="http://en.wikipedia.org/wiki/High-Speed_Downlink_Packet_Access" target="_blank">HSDPA</a> by getting a <a href="http://www.mobitel.lk/m3/broadband/broadband.html" target="_blank">Mobitel 3G broadband</a> connection.</p> <p>The package includes a <a href="http://www.huawei.com/mobileweb/en/products/view.do?id=282" target="_blank">Huawei E220 HSDPA USB modem</a> (<a href="http://en.wikipedia.org/wiki/Huawei_E220" target="_blank">Wikipedia article</a>), SIM card and connection, connection fee and first month's bill waived, a Rs 5k deposit which shall be refunded after an year.</p> <span class="fullpost"><p>Huawai E220 is known to work out of the box on Linux after 2.6.20. However, some of the most recent kernels <a href="http://lkml.org/lkml/2007/10/30/348" target="_blank">seems to have a conflict</a> with the USB mass storage driver. It means, the disk drive in the modem with Windows drivers get detected, but not the modem. I am presently running Linux 2.6.24.4, which also exhibits this behavior.</p> <p><a href="http://www.geekaholic.org/" target="_blank">Bud</a> suggested a quick workaround: to start the computer while the USB dongle is plugged in. This worked, and the modem was autodetected as /dev/ttyUSB0.</p> <p>The sales person at Excel World Mobitel outlet told me that the APN has to be statically set to "mobitel3g" and the number is "*99***1#". It was easy to find the <a href="http://en.wikipedia.org/wiki/Hayes_command_set" target="_blank">AT commands</a> to do this. I created the following /etc/wvdial.conf file and running "wvdial" afterwards took me to the Internet. Username and password was just to stop wvdial complaining.</p> <pre> [Dialer Defaults] Modem = /dev/ttyUSB0 Baud = 1843200 Modem Type = Analog Modem Init2 = ATZ Init3 = ATQ0 V1 E1 S0=0 &amp;C1 &amp;D2 +FCLASS=0 Init4 = AT+CGDCONT=1,"IP","mobitel3g" Dial Command = ATDT Phone = *99***1# Username = foo Password = bar Stupid Mode = yes </pre> <p>Going with the "get it working, then make it better" philosophy, then I looked at the conflict with the USB disk. There are couple of suggestions to the kernel usb-storage driver discussed on the above thread - which didn't work for me unfortunately, but just running this <a href="http://www.kanoistika.sk/bobovsky/archiv/umts/huaweiAktBbo.c" target="_blank">huaweiAktBbo utility</a> did the trick. So I copied the binary to a standard location.</p> <pre> # apt-get install build-essential libusb-dev # just to be sure # cc -o huaweiAktBbo -lusb huaweiAktBbo.c # cp huaweiAktBbo /usr/local/sbin/ </pre> <p>Then I created a small script to initiate the connection:</p> <pre> #!/bin/sh lock=/tmp/.mobitel.lock if ln -s $lock $lock then [ -c /dev/ttyUSB0 ] || /usr/local/sbin/huaweiAktBbo sleep 3 if [ -c /dev/ttyUSB0 ] then cp -f /etc/wvdial.conf.mobitel /etc/wvdial /usr/bin/wvdial fi rm -f $lock fi exit 0 </pre> <p>Lock can also be created in /var/run, and notice that I have <em>not</em> done a "set -e", because if wvdial stops with an error, we still need to remove the lock. The lock is there to avoid multiple invocations of the script.</p> <p>Then I created a simple <a href="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" target="_blank">udev</a> rule to automatically connect whenever the E220 is plugged in. You can use "lsusb", among others, to find the vendor ID and product ID. I created a new /etc/udev/rules.d/010_local.rules file with the following line.</p> <pre> ACTION=="add", BUS=="usb", SYSFS{idVendor}=="12d1", \ SYSFS{idProduct}=="1003", RUN+="/usr/local/sbin/mobitel.sh" </pre> <p>That's it! Now I am on the Internet automatically whenever the device is connected to the computer!</p> <p>The only remaining "problem" was <a href="http://www.freedesktop.org/wiki/Software/hal" target="_blank">hal</a> which was still trying to automount the USB disk. As <a href="http://wiki.archlinux.org/index.php/Huawei_E220" target="_blank">suggested in ArchLinux wiki</a>, creating a file /usr/share/hal/fdi/preprobe/20thirdparty/10-huawei-e220.fdi with the following fixes this:</p> <pre> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;deviceinfo version="0.2"&gt; &lt;device&gt; &lt;match key="usb.vendor_id" int="0x12d1"&gt; &lt;match key="usb.product_id" int="0x1003"&gt; &lt;merge key="info.ignore" type="bool"&gt;true&lt;/merge&gt; &lt;/match&gt; &lt;/match&gt; &lt;/device&gt; &lt;/deviceinfo&gt; </pre> <p>The connection is fast and way cheaper than GPRS when it comes to volume. HSDPA costs one rupee per MB, while GPRS costs 20!</p> <p><b>Update</b>: I noticed that udev runs the script multiple times, so as a quick fix I have added a test for /dev/ttyUSB0 in a couple of places in the script to make matters better.</p></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-7944720923763471996?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com11tag:blogger.com,1999:blog-15283331.post-44916599521245818992008-03-30T14:33:00.004+05:302008-04-16T07:38:26.260+05:30HDR Imaging on FOSS<p><a href="http://en.wikipedia.org/wiki/High_dynamic_range_imaging" target="_blank">High dynamic range (HDR) imaging</a> is an interesting aspect of modern photography.</p><p>Today I demonstrated HDR imaging and panoramas at <a href="http://www.agschool.edu.lk/" target="_blank">AG School of Business and Computer Studies</a>, Negambo. Here are some resources I listed during this session.</p><span class="fullpost"><ul><li><a href="http://en.wikipedia.org/wiki/High_dynamic_range_imaging" target="_blank">Wikipedia HDR imaging article</a></li><li><a href="http://qtpfsgui.sourceforge.net/" target="_blank">Home page of qtpfsgui</a></li><li><a href="http://hugin.sourceforge.net/" target="_blank">Home page of Hugin</a></li><li><a href="http://www.gimp.org/" target="_blank">Home page of GIMP</a></li><li><a href="http://www.flickr.com/groups/hdr/" target="_blank">HDR group</a> on <a href="http://www.flickr.com/" target="_blank">Flickr</a></li><li><a href="http://www.flickr.com/photos/tags/qtpfsgui/" target="_blank">Photos tagged qtpfsgui</a> on Flickr (hint: click on "<a href="http://www.flickr.com/photos/tags/qtpfsgui/interesting/" target="_blank">Most interesting</a>" to see good images)</li><li><a href="http://www.flickr.com/photos/tags/hdr/" target="_blank">Photos tagged HDR</a> on Flickr (hint: click on "<a href="http://www.flickr.com/photos/tags/hdr/interesting/" target="_blank">Most interesting</a>" to see good images)</li><li><a href="http://www.flickr.com/photos/tags/panorama/" target="_blank">Photos tagged Panorama</a> on Flickr (hint: click on "<a href="http://www.flickr.com/photos/tags/panorama/interesting/" target="_blank">Most interesting</a>" to see good images)</li></ul></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-4491659952124581899?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com0tag:blogger.com,1999:blog-15283331.post-45448762185312152342008-03-07T17:53:00.007+05:302008-04-16T07:39:45.570+05:30More Sinhala Web Sites Using Unicode<p>Use of of Sinhala Unicode on the Web is slowly, but steadily, growing.</p><p>Two years ago, our good friend Niranjan Meegammana started <a href="http://groups.google.com/group/Sinhala-Unicode">the Sinhala Unicode group</a> to bring together all those who are involved in the development of Sinhala Unicode to communicate, and to use Sinhala itself to do so. Today the group has become one of the very active forums on the topic, and provides a living example for the success of the standard.</p><span class="fullpost"><p>Although some newspapers are still reluctant to move from legacy font tricks to Sinhala Unicode, <a href="http://www.dinamina.lk">Dinamina</a> and <a href="http://www.ethalaya.com">e-thalaya</a> online newspapers made a bold move by using only Unicode in their web sites, providing fine examples that the implementations are mature.</p><p>This <a href="http://www.sinhalablogs.com/">Sinhala blog sindicator</a> aggregates dozens of blogs written in Sinhala.</ap><p>My previous posts on this topic are <a href="http://anuradha-ratnaweera.blogspot.com/2007/05/unicode-and-sinhala-alphabet.html" target="_blank">here</a>, <a href="http://anuradha-ratnaweera.blogspot.com/2006/03/is-sinhala-unicode-incomplete.html" target="_blank">here</a> and <a href="http://anuradha-ratnaweera.blogspot.com/2006/03/sinhala-unicode-on-gnulinux.html" target="_blank">here</a>.</p></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-4544876218531215234?l=anuradha.sayura.net'/></div>Anuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.com3tag:blogger.com,1999:blog-15283331.post-89207717249446628792008-02-06T21:50:00.003+05:302008-05-03T20:16:41.803+05:30The Old Order Changeth<blockquote> "The old order changeth, yielding place to new" [said King Arthur] -- From <a href="http://charon.sfsu.edu/TENNYSON/poems/mortedarthur.shtml" target="_blank">Morte D'Arthur</a> by Lord Tennyson </blockquote> <p>And so again the time has come for a change. I decided to spend more time in the wilderness where I came from, and move away from this city life, to which I will never get used to. ;-)</p><span class="fullpost"><p>I started working as a freelance consultant starting 1st of February, 2008. Initially I am focusing on software/IT, but hoping to expand to <a href="http://en.wikipedia.org/wiki/CNC" target="_blank">CNC</a> sooner or later.</p><p>I will also continue to work for <a href="http://www.virtusa.com" target="_blank">Virtusa</a> as an external consultant.<p><p>You can reach me at anuradha at taprobane dot org. If you forget it or loose it, searching Google for "anuradha" or "anuradha ratnaweera" should find <a href="http://www.sayura.net/anuradha/" target="_blank">my home page</a> with contact details and links.</p></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-8920771724944662879?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-90487478109037555262008-01-11T18:55:00.000+05:302008-01-11T19:09:11.500+05:30FBI on LTTEThe <a href="http://www.fbi.gov">FBI site</a> has <a href="http://www.fbi.gov/page2/jan08/tamil_tigers011008.html">this article</a> on how to stop helping terrorism while living in the US. It is also the top story on the site as of today.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-9048747810903755526?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com0tag:blogger.com,1999:blog-15283331.post-30797882438920617702007-10-16T07:53:00.000+05:302007-10-16T11:55:42.087+05:30My Photo BlogI'm featuring selected photos in my <a href="http://www.flickr.com/photos/anuradha/">photo gallery</a> on a <a href="http://photos-by-anuradha.blogspot.com/">photo blog</a>.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-3079788243892061770?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com0tag:blogger.com,1999:blog-15283331.post-78327602260527956472007-07-22T13:07:00.001+05:302008-04-16T07:40:54.386+05:30FVWM-Crystal Windows Manager<p>I always liked to have <a href="http://www.fvwm.org/">FVWM</a> as my <a href="http://xwinman.org/">window manager</a>. However, it lacks three important features I need on my desktop:</u> <ul><li>Taskbar</li><li>Notification area (AKA system tray)</li><li>Application launcher</li></ul> <p>The <a href="http://www.fvwm-crystal.org">FVWM-Crystal</a> window manager adds exactly these features to vanilla FVWM, along with other subtle goodies all over.</p> <span class="fullpost"><p>Lack of desktop icons has never been a problem to me. Launchers are best left in a corner, so there is no need to "show desktop" or "hide windows" in order to use icons.</p> <p>Another nice thing about FVWM-Crystal is the ability to start a terminal just by right-clicking anywhere on the desktop. Even blank areas between launcher, workarea switcher and notification area would do, so there is no need to resize a maximized window to do this. Another nice thing is the ability to start a small terminal by pressing Alt + grave(`).</p> <p>I know several users who have switched to FWVM-Crystal and are happy. :-)</p></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-7832760226052795647?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-26595858061439101032007-05-29T16:34:00.002+05:302008-04-16T07:50:32.691+05:30Unicode and Sinhala Alphabet<p>There is a great deal of similarity between Sinhala Unicode (~ SLS 1134) and Sinhala Hodiya (alphabet).</p> <p>Sidath Sangarawa, one of the oldest texts on Sinhala grammar written over 2000 years ago, lists 10 vowels and 20 consonants (see footnote 1), but the book also uses two unlisted vowels ඇ and ඈ (see footnote 2).</p> <p>Sanskrit influence increased the number of characters to over 50.</p> <span class="fullpost"><p>Actual number of shapes, known as "glyphs" in modern typographic terminology, needed to write in Sinhala is in the range of thousands, due to derived and joint forms of basic characters.</p> <p>Listing all these thousands of glyphs was never a popular practice. Students learn basic characters and modifiers, and common sense takes care of generating the thousands of other shapes. For example, after learning "ispilla", you can add it to basic consonants and generate all the "i" forms such as "ki", "gi", "ji" etc.</p> <p>Hodiya doesn't have any of these extra characters such as "ki" or "du". Hodiya doesn't have rakaransaya nor yansaya. But nobody complained. Everybody knew, and still know, that the Hodiya is only a basic guide to generate more complex glypls.</p> <p>However, this didn't work when Sinhala texts started to be printed on printing machines. These machines don't have brains and couldn't learn how to "generate". Therefore every possible glyph had to be given.</p> <p>Walk into an old press to see a large "matrix" or such glyphs.</p> <p>Then came the age of computer based typography. Computers can be taught to do things, and that is exactly how standards like Unicode and SLS 1134 generate shapes. We can teach computers to generate thousands of glyphs using less than a hundred of basic shapes. For example, we can generate "du" by adding "da" and "papilla", so a seperate "du" is not necessary.</p> <p>How about "yansaya" and "rakaransaya"? They are generated by sequences including the <a href="http://en.wikipedia.org/wiki/Zero-width_joiner">zero-width joiner</a> (ZWJ). For example, "pra" is represented as "pa", "hal kireema", ZWJ and "ra". ZWJ also is used to represent joint and touching letters.</p> <p>Gone are the days of brainless matrix-based printing machines.</p> <p>We need two things to view Sinhala on a computer. A font containing Sinhala glyphs, and the computer programs should knows how to generate glyphs using sequences of basic characters. Let me explain using an example.</p> <p><em>Step 0.</em> Here is how a sample web page looks on a browser when it cannot find a Sinhala Unicode font. The "boxes" indicate unavailable character numbers:</p> <p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_erOx2fbT8Og/RlwJZnblyNI/AAAAAAAAABM/OeJyTvT49PY/s1600-h/sinhala-0.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_erOx2fbT8Og/RlwJZnblyNI/AAAAAAAAABM/OeJyTvT49PY/s400/sinhala-0.gif" alt="" id="BLOGGER_PHOTO_ID_5069937616198420690" border="0" /></a></p> <p><em>Step 1.</em> After installing a font, the browser will show some Sinhala, but if it hasn't "learned" how to generate glyphs, only basic characters and modifiers are shown independently:</p> <p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_erOx2fbT8Og/RlwJZ3blyOI/AAAAAAAAABU/6IFLzmdO544/s1600-h/sinhala-1.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_erOx2fbT8Og/RlwJZ3blyOI/AAAAAAAAABU/6IFLzmdO544/s400/sinhala-1.gif" alt="" id="BLOGGER_PHOTO_ID_5069937620493388002" border="0" /></a></p> <p><em>Step 2.</em> Now I have enabled the "shaper" in the browser, which is the part that knows how to generate Sinhala glyphs using basic characters:</p> <p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_erOx2fbT8Og/RlwJZ3blyPI/AAAAAAAAABc/qyubi8m-JPk/s1600-h/sinhala-2.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_erOx2fbT8Og/RlwJZ3blyPI/AAAAAAAAABc/qyubi8m-JPk/s400/sinhala-2.gif" alt="" id="BLOGGER_PHOTO_ID_5069937620493388018" border="0" /></a></p> <p>All is well!</p> <p>So where exactly is the similarity?</p> <p>Students learn less than 100 basic characters in the alphabet and modifiers, and use their brains with some support from teachers to generate the rest of the 1000+ shapes.</p> <p>Computers can be programmed - and some computers have already been programmed - to generate 1000+ Sinhala glyphs using less than 100 basic shapes in Sinhala Unicode / SLS 1134 standard.</p> <p>As the standard is platform independent, we use it to communicate with people using diverse platforms in the <a href="http://groups.google.com/group/Sinhala-Unicode">Sinhala Unicode Group</a> among others.</p> <p><em>Footnote 1.</em> පණකුරු පසෙක් එද ලුහු ගුරු බෙයින් දසවේ, ගතකුරුද වේ විස්සෙක්, වහරට යුහු හෙළ බස</p> <p><em>Footnote 2.</em> Notice the use of ඇ and ඈ, both independently and in consonants: පසැස් ඈ සරලොප් නැතද සර ගතට පැමිණවූ බැවින් සර සඳ නම්.</p></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-2659585806143910103?l=anuradha.sayura.net'/></div>Anuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.com6tag:blogger.com,1999:blog-15283331.post-37396892098647977122007-05-25T20:53:00.001+05:302008-04-16T07:51:37.569+05:30Ages of life<p>While chilling out at home a few weeks ago, a colorful "Dothulu" tree caught my eye. After clicking some photographs I totally forgot about it.</p> <p>When I later checked the photos on a PC, the tree turned out to contain <em>five</em> different types of seeds at five different stages of life! Six if you count the one inside the next branch about to come out.</p> <p><div align="center"><a href="http://www.flickr.com/photos/anuradha/513238700/"><img src="http://farm1.static.flickr.com/209/513238700_a8a6550b89_m.jpg"></a></div></p> <span class="fullpost"><p>Manifestations of <a href="http://en.wikipedia.org/wiki/Impermanence">impermanence</a> are everywhere, but I find this one fascinating, because it fitted into just one colorful photograph.</p></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-3739689209864797712?l=anuradha.sayura.net'/></div>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com6tag:blogger.com,1999:blog-15283331.post-45975468521126589322007-05-23T11:15:00.001+05:302008-04-16T07:52:55.132+05:30Orbitrek vs Orbitrak<p>Recently I wanted to buy an aerobic exercising machine.</p> <p>After doing a lot of research on the Internet and reading user reviews, I finally settled to buy an <a href="http://www.thane.com/products/fitness/orbitrek/orbitrek.php">Orbitrek Platinum</a>. One of the key decision factors was that it's yet another implementation of well known <a href="http://en.wikipedia.org/wiki/Elliptical_trainer">Ellipical Trainer</a>.</p> <span class="fullpost"><p>The original Orbitrek had some scary reviews: that it is falling apart. Probably this may be due to poor assembling, but still good enough reason for me to be doubtful. However the newer version known as the Orbitrek Platinum, which also has been around for a while, didn't seem to have this problem and the reviews were good.</p> <p>So here I am, looking around to buy an Orbitrek Platinum.</p> <p>First I went to Teleseen Marketing in Majestic City. They were offering the Orbitrek Platinum, but the old one was also available. Then I checked with Himalayas, which was only a few blocks away on the same floor, and to my surprise they also were offering both the old one and the Platinum, but the price of the latter was several thousand rupees lower (about 60% of the one at Teleseen)!</p> <p>The cheaper one at Himalayas didn't have any reference to "Thane", the company that made the Orbitrek. By some luck I happened to notice a subtle difference. It was <em>not</em> Orbitrek, but "Orbitrak"!</p> <p>I didn't buy either and did some more research to find out that the "Orbitrek" is the real one and "Orbitrak" was probably a fake.</p> <p>So I went ahead and bought the Orbitrek Platinum from Teleseen.</p> <p>Later I noticed so many advertisements and signboards selling the "Orbitrak"!!!</p> <p>If cost was a problem to buy the "real" product, and if I have a choice between a fake product and a lower quality product, I would go for the latter. Why? Because the fake product developers try to get the <em>looks</em> right to match the real one without much attention to the inner workings, while the low quality product may have done <em>some</em> research to get the inner workings right.</p></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-4597546852112658932?l=anuradha.sayura.net'/></div>Anuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.com9tag:blogger.com,1999:blog-15283331.post-61444120314273615032007-05-16T10:26:00.001+05:302008-04-16T07:53:19.469+05:30FWDC web site goes mobile<p>Finally managed to get the mobile version of our Four Wheel Drive Club (FWDC) web site done. The mobile site, <a href="http://m.4x4.lk/">m.4x4.lk</a>, has a very lightweight theme, smaller thumbnails, and most external links point to mobile versions of relevant sites.</p> <p>The difference is best seen by comparing similar pages on the two sites. E.g.: <a href="http://www.4x4.lk/node/29">www.4x4.lk/node/29</a> and <a href="http://m.4x4.lk/node/29">m.4x4.lk/node/29</a>.</p> <span class="fullpost"><p>We would like the new site to be tested on as many mobile devices as possible. Please send your feedback to info@4x4.lk. Thanks in advance!</p></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-6144412031427361503?l=anuradha.sayura.net'/></div>Anuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.com0tag:blogger.com,1999:blog-15283331.post-14872567067552964272007-04-24T18:01:00.000+05:302007-04-24T18:20:06.669+05:30Missing the pointIan Chappel and Arjuna Ranatunga, along with many other media, have expressed their concern about the Sri Lankan team resting some key bowlers during the World Cup super-eight match against Australia. But they are missing the key point: Sri Lanka rested some key <em>bowlers</em>. But the team lost mainly due to not-so-good <em>batting</em>. And every critic/pundit seem to miss this simple point! So even if Vaas and Muralitharan <em>were</em> playing, will it have helped Sri Lanka to change their score on the board? Not likely. By the way, <a href="http://content.msn.co.in/Sports/Columns/CricketColumn_Kumar+Sangakkara.htm">here is one great answer</a> by Sangakkara.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15283331-1487256706755296427?l=anuradha.sayura.net'/></div>Anuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.com1