tag:blogger.com,1999:blog-178967202009-05-03T05:24:31.093-07:00The Road Ahead...by Sundarram P. V.Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.comBlogger42125tag:blogger.com,1999:blog-17896720.post-31713451901204072562009-05-03T04:04:00.000-07:002009-05-03T05:12:13.520-07:00Projects to watch outThese are some projects I have been watching for sometime now which can allow you to scale easily and at the same time provide flexibility. Three things that can help one to scale are partitioning, caching and queuing. A lot that happens inside a OS is queuing.<br /><br /><a href="http://www.gearman.org/doku.php"><span style="font-weight: bold;">Gearman</span></a><br />It can be looked on as a load-balancer of sorts for your functions. The gearman simply interfaces the client(who wants to get a particular job done) and the worker. The best thing about gearman is, it allows both synchronous and asynchronous job calls. Lets say for instance there is a search query, where you have multiple shards from which you need to consolidate data. Through gearman you can make multiple job calls, and can do the processing in parallel. When all the workers have returned, all you need to do is consolidate the data. When the load is high, it will take time for your responses but the system can still handle it gracefully. When used with a cloud service like EC2, all you need to do is have a service monitor the jobs in queue and create new EC2 worker instances depending on the load. When the load is lower some of those instances can be killed. <br />What gearman doesnt as of now provide is (in the works):<br />1. broadcast (sending a message to all the workers) (useful for housekeeping)<br />2. persistence of unprocessed jobs i.e. saving of jobs after the gearman server has crashed<br /><br />For using gearman one needs either an neutral encoding system or both client and worker has to use the same platform. They can either choose to use <a href="http://www.json.org">JSON</a>(JavaScript Object Notation) due to its ubiquitous nature. Or they can choose to go for language neutral binary encoding format like <br /><br /><a href="http://wiki.apache.org/thrift/"><span style="font-weight:bold;">Thrift</span></a><br />This encoding format is used by Facebook for making RPCs. The encoding format supports versioning of data objects and also is language neutral. Its bindings for different language is still under development but is available for c++, PHP, Perl, erlang etc.. It also provides transport apart from deserialization/serialization of objects. The documentation for various language bindings is not great but one can understand by looking at their test code. Thrift has got somewhat influenced by google's protobuf. It also provides an interface for using a custom encoding/decoding format.<br /><br /><a href="http://code.google.com/p/protobuf/"><span style="font-weight:bold;">ProtoBuf</span></a><br />It is similar to thrift, but the only difference is it doesnt provide transport. It is open sourced by google. Different language <a href="http://code.google.com/p/protobuf/wiki/OtherLanguages">bindings</a> are available for this format, and some of them have been developed outside of google. <br /><br />Both of them generate static code from a definition file for creating classes/types. When used with Gearman, these can provide queued language neutral setup of backend.<div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-3171345190120407256?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-50921104347634048082009-04-11T07:50:00.000-07:002009-05-03T04:01:14.165-07:00OOPS in Javascript: Part IIIApart from using inheritance and prototype for defining an object, there is closure which is strong and often misused feature in javascript. It is one feature I love and knowingly or unknowingly everyone would have used this feature. It is something like whenever a function is defined inside another function, all the variables inside the parent function exists even after the parent function has returned. It is something in the lines of creating a parallel world each time you invoke a function. <br /><pre class="brush: js"><br />/**<br /> * A simple example of closure<br /> */<br />var rank = 0;<br />function greet(name) {<br /> var my_rank = ++rank;<br /> /* adding a anonymous function to greet person after 5 seconds*/<br /> window.setTimeout(function() {<br /> alert("hi " + name + " you came in " + my_rank);<br /> }, 5000);<br />}<br /><br />greet("ram");<br />greet("geetha");<br /><br /></pre><br />To create a closure, two things are needed,<br />1. Creation of a function inside a parent function.<br />2. Send the reference of child function outside the scope of parent function.<br /><br />Firstly all the variables declared inside a function can be accessed only inside the function, unless explicitly it is passed as a reference outside. In case of closure, all those variables the child function could access will live until its reference is not deleted. <br />Javascript as you know, doesnt want you to manage memory and uses garbage collection to free memory. All that the garbage collector is looking for is reference count of each instance, and in this particular case my_rank, name and also the anonymous function. It will not release these resources until there is a setTimeout trigger, and it removes the reference of this anonymous function.<br /><pre class="brush: js"><br /><br />class2 = function () {<br /> <br />};<br /><br />class2.prototype = {<br /> manager : function (params, postcallback) {<br /> var my_dailog;<br /> var usr_callback = function(filename) {<br /> //make ajax call and get the content<br /> my_dailog.hide();<br /> };<br /> //get user input from dailog,<br /> my_dailog = new Dailog({<br /> message : "Enter the name of the file",<br /> callback : usr_callback<br /> });<br /> my_dailog.show();<br /> },<br /> req : function() {<br /> var my_div = document.getElementById('status');<br /> var content_div = document.getElementById('content');<br /><br /> my_div.innerHTML = "working...";<br /> <br /> var callback = function(params) {<br /> my_div.innerHTML = "Done.";<br /> content_div.innerHTML = params;<br /> };<br /> this.manager({<br /> url : "http://www.ajaxian.com"<br /> }, callback);<br /> }<br />};<br /><br />var ob = new class2();<br />ob.req();<br /></pre><br />If for some reason, setTimeout's internal code fails to remove anonymous function's reference or doesnt have a mechanism to release its reference, all these variable will be like a zombie or in technical terms leaked memory. The problem will multiply when this function is called a hundred times, boggling down a lot of memory. This memory will never be claimed back until there is a window.unload. In the above example, all we are doing is try to get the name of the file so that it can be updated. Both manager and the req, functions are using closures, and if not handled properly can and will lead to a memory leak. The leak will only occur when there is a reference to anonymous function present outside of its scope. IE's internal handling of closures is somewhat different when compared with that of Firefox or Safari and also leaks a lot of memory. <br />Memory leak is not a serious problem for any page which doesnt live for a longer period of time. Detection of leaks are tricky with any language, and its very difficult to debug in complex applications. It is bad for an application like gmail which runs throughout the day. It is a good idea to reload the page over a period of time.<div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-5092110434763404808?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-18642267857970383712008-08-27T22:15:00.000-07:002009-04-11T10:20:14.626-07:00My experiments with ImageMagickI have been experimenting with ImageMagick for quite some time now. Its one of those great libraries one couldn't manage without and the best part is it just works. I had to write an implementation on top of ImageMagick, to draw styled text on image. Which i thought was pretty straight forward, and started to dig on the api docs of ImageMagick. In the end i finally found that, there was no implementation or function in api to wrap have different style of text in the same line. No big deal right, but then there are lot of subtleties which one will not realize until he/she is deep in it.<br />I then went over my normal ritual of getting the pseudo code(comments, i cant work without them). First i thought the only thing i ll have to do would be to wrap the text, and then set the height which is maximum for any style. There also was a straight forward api function call in ImageMagick (QueryMultilineFontMetrics). So i started not knowing what i was getting into. The wrap logic was something like,<br /><br />1. you get the width of all the visible characters by making the api call,<br />2. now get all the words in the sentence/ paragraph<br />3. for each of those word add the width for each character and try to figure out whether it has surpassed the line width or not.<br />4. if it has start over on the next line, calculate the height needed.<br /><br />To describe the above solution in one word, it is specious and it didnt work. Some of the characters were going outside the boundary. I didnt know a thing about typography and typefaces which in a way increased my curiosity. Here I was coding, without really knowing any fundamentals about the internals. I decided to give programming a pass and started reading about typeface and things related with it.<br />I have been using computer for more than a decade now, but one thing that has never interested me is fonts. I was finally coming to terms with my demons. As i read more about fonts, it became clear that there was a lot of thought, logic and research gone into it, so much so that it was a science as well as creative. I feel it is one of those things which stares right on our face, but we just dont realize it. The fonts are mainly categorized into monospaced (ones we see in code editors) i.e. all characters are equally spaced and have equal widths and what we normally write in paper is proportional typeface i.e. 'i' has a smaller width compared to 'W'. There is something else apart from these in the font, which created the bug in my code. They are the small pauses between two characters when they are rendered. My algorithm didnt include kerning(this is what the that hole is called) for calculations and resulted in text bleeding out. I had to slightly change my approach, and had to include this along, but since the font could be proportional or monospaced you dont really know that width. The only way you can do that is by making the query fonts call for the whole word, and use it for all the calculations. Apart from that i also found that QueryFontMetrics was trimming the space, and it had to be found out in a round about way. <br /><br /><pre class="brush: perl" rows="100"><br />use strict;<br />use warnings;<br />use Image::Magick;<br /><br /><br />my ($my_styles);<br />$my_styles = {<br /> style1 =&gt; {<br /> font =&gt; &quot;Arial&quot;,<br /> color =&gt; &quot;#000000&quot;,<br /> size =&gt; &quot;20&quot;<br /> },<br /> style2 =&gt; {<br /> font =&gt; &quot;Arial&quot;,<br /> color =&gt; &quot;#00ff00&quot;,<br /> size =&gt; &quot;25&quot;<br /> }<br />};<br />#returns the image magick object after rendering the text, with given height and width.<br />#it truncates the paragraph after reaching the height limit.<br />#wraps the text, and also can support multiple styles in the same line<br />sub draw_styled_text {<br /> my ($text, $height, $width, $default_style) = @_;<br /> my $im = Image::Magick-&gt;new();<br /> my $last_pos = 0;<br /> my ($x, $y) = (0, 0);<br /> my %lines;<br /><br /> $im-&gt;Set(<br /> size =&gt; $width . &quot;x&quot; . $height<br /> );<br /> $im-&gt;Read('xc:none');<br /> #format<br /> #sentence%%$$style_name$$sentence%%sentence<br /> #for each styled sentence<br /> my @sentences = split /\%\%/, $text;<br /> for my $sentence (@sentences) {<br /> my ($style_name, $style_details);<br /> $style_name = $default_style;<br /><br /> if ($sentence =~ /\$\$(.*)\$\$([\w\W]*)/) {<br /> #get the style name,<br /> $style_name = $1;<br /> $sentence = $2;<br /> }<br /> #check length of the string<br /> unless (length $sentence) {<br /> next;<br /> }<br /><br /> #get the style details,<br /> $style_details = get_style_details($style_name);<br /> $im-&gt;Set(<br /> font =&gt; $style_details-&gt;{'font'},<br /> pointsize =&gt; $style_details-&gt;{'pointsize'}<br /> );<br /> #wrap text<br /> my ($new_text, $line_height);<br /> my $space_width = get_space_metrics($im);<br /> #annotate trims text. to avoid that check the no. of spaces in the begining and in the end.<br /> #space in the begining of the string<br /> if ($sentence =~ /^( +).*/) {<br /> $last_pos = $last_pos + ($space_width * length($1));<br /> $x = $last_pos;<br /> }<br /> <br /> ($new_text, $last_pos, $line_height) = Wrap($sentence, $im, $width, $last_pos);<br /> #space at the end of the string.<br /> if ($sentence =~ /.*( +)$/) {<br /> $last_pos = $last_pos + ($space_width * length($1));<br /> }<br /><br /> #for each line<br /> for my $line (split /\n/, $new_text) {<br /> $y = $line_height unless ($y);<br /> my $arr;<br /> if (defined $lines{$y}) {<br /> $arr = $lines{$y};<br /> } else {<br /> $arr = ();<br /> }<br /> #write the line<br /> push @$arr, {<br /> x =&gt; $x,<br /> y =&gt; $y,<br /> text =&gt; $line,<br /> color =&gt; $style_details-&gt;{'color'},<br /> font =&gt; $style_details-&gt;{'font'},<br /> pointsize =&gt; $style_details-&gt;{'pointsize'},<br /> line_height =&gt; $line_height<br /> };<br /> $lines{$y} = $arr;<br /><br /> $x = 0;<br /> $y = $y + $line_height;<br /> }<br /> $x = $last_pos;<br /><br /> if ($new_text !~ /.*\n$/) {<br /> $y = $y - $line_height;<br /> } else {<br /> $x = $last_pos = 0;<br /> }<br /><br /> }<br /><br /> my $adjustment_y = 0;<br /> for my $y(sort {$a &lt;=&gt; $b} keys %lines) {<br /> my $arr = $lines{$y};<br /> my $max_height = 0;<br /> my $considered_height = 0;<br /><br /> for my $line (@$arr) {<br /> if ($max_height &lt; $line-&gt;{'line_height'}) {<br /> $max_height = $line-&gt;{'line_height'};<br /> }<br /> unless ($considered_height) {<br /> $considered_height = $line-&gt;{'line_height'};<br /> }<br /> }<br /> if ($considered_height != $max_height) {<br /> $adjustment_y += $max_height - $considered_height;<br /> }<br /> $y += $adjustment_y;<br /> for my $line (@$arr) {<br /> $im-&gt;Annotate(<br /> font =&gt; $line-&gt;{'font'},<br /> fill =&gt; $line-&gt;{'color'},<br /> pointsize =&gt; $line-&gt;{'pointsize'},<br /> text =&gt; $line-&gt;{'text'},<br /> x =&gt; $line-&gt;{'x'},<br /> y =&gt; $y,<br /> );<br /> }<br /> }<br /> #return<br /> return $im;<br />}<br /><br />#im doesnt support space<br />sub get_space_metrics {<br /> my ($im) = @_;<br /> my $val = 0;<br /> #first get for a<br /> my $a_width = ($im-&gt;QueryFontMetrics(text =&gt; &quot;a&quot;))[4];<br /> my $a_with_space_width = ($im-&gt;QueryFontMetrics(text =&gt; &quot;a a&quot;))[4];<br /> $val = $a_with_space_width - (2 * $a_width);<br /> return $val;<br />}<br /><br />sub Wrap {<br /> my ($text, $img, $maxwidth, $lastpos) = @_;<br /> my (@newtext, $pos);<br /> $pos = $lastpos || 0;<br /> my (@words, @lines, @char, $i, $word);<br /> @char = split //, $text;<br /> $i = 0;<br /> $word = &quot;&quot;;<br /><br /> for my $c (@char) {<br /> $i++;<br /> #get the word<br /> if ($c eq &quot; &quot; || $c eq &quot;-&quot; || $c eq &quot;\n&quot;) {<br /> push @words, $word;<br /> } else {<br /> $word = $word . $c;<br /> if ($i &gt;= scalar @char) {<br /> push @words, $word;<br /> } else {<br /> next;<br /> }<br /> }<br /> $word = &quot;&quot;;<br /> #measure the length of current line<br /> my @metrics = $img-&gt;QueryFontMetrics(text =&gt; join(&quot;&quot;, @words));<br /> if (($pos + $metrics[4]) &gt; $maxwidth) {<br /> $word = pop @words;<br /> push @lines, join(&quot;&quot;, @words), &quot;\n&quot;;<br /><br /> $pos = 0;<br /> @words = ();<br /> #check whether the size of the word is greater than max width<br /> if ($word &amp;&amp; ($img-&gt;QueryFontMetrics(text =&gt; $word))[4] &gt; $maxwidth) {<br /> #force a line break and -<br /> my $splitword = &quot;&quot;;<br /> for my $ch (split //, $word) {<br /> #check whether the set is greater than max width<br /> if (($img-&gt;QueryFontMetrics(text =&gt; &quot;$splitword$ch-&quot;))[4] &gt; $maxwidth) {<br /> push @lines, &quot;$splitword-&quot;, &quot;\n&quot;;<br /> $splitword = &quot;&quot;;<br /> } else {<br /> $splitword .= $ch;<br /> }<br /> }<br /> if ($splitword) {<br /> $word = $splitword;<br /> }<br /> }<br /> #push it to the current line<br /> if ($word) {<br /> push @words, $word;<br /> $word = &quot;&quot;;<br /> }<br /> }<br /> #add the white space<br /> if (scalar @words) {<br /> $words[-1] .= $c if ($c eq &quot; &quot; || $c eq &quot;-&quot;);<br /> if ($c eq &quot;\n&quot;) {<br /> push @lines, join(&quot;&quot;, @words), &quot;\n&quot;;<br /> @words = ();<br /> }<br /> }<br /> }<br /> #push the last remaining words<br /> push @lines, join(&quot;&quot;, @words);<br /> my $str = join &quot;&quot;, @lines;<br /> my @arr = split /\n/, $str;<br /> #try to measure the width of the last line<br /> my @metrics = $img-&gt;QueryMultilineFontMetrics(text =&gt; $arr[-1]);<br /> $pos = $metrics[4];<br /> my $line_height = $metrics[5];<br /> unless (scalar @arr &gt; 1) {<br /> $pos += $lastpos;<br /> }<br /> return ($str, $pos, $line_height);<br />}<br /><br />sub get_style_details {<br /> my ($style_name) = @_;<br /> return $my_styles-&gt;{$style_name} if defined $my_styles-&gt;{$style_name};<br /> die &quot;style doesnt exist&quot;;<br />}<br /></pre><br /><br />P.S.ttt...:<br />I couldnt find a lot of solutions in web to suite my requirements, and that's one of the reason why i am sharing the solution. The code though is not neat, and there could be other optimizations that can be done, but at the very least it works and can be used as a base for further refinements.<br /><br />download the source code here: <a href="http://www.scribd.com/doc/14147418/Perl-Word-Wrap-ImageMagick-Program">Perl WordWrap for ImageMagick</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-1864226785797038371?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-53386276380773750792008-06-06T12:00:00.000-07:002008-06-06T14:41:16.700-07:00Five9s Availability - Is it too much to ask for?Imagine logging into GMail, and suddenly getting a Oil change page. No way thats gonna happen now right?? Nearly 4 years back I used to see this page quite often, but over a period of time GMail has certainly matured as a product. They are still adding features seamlessly and making releases without any downtime of the service. That makes me look in awe at many services which achieve this and I sometimes wonder what it takes to achieve 99.999(Five9s) i.e. approximately 6 minutes of downtime in a year.<br /><blockquote><span style="font-style: italic;"><br />Message from ABC: OOPS, No donuts for you.<br />Developer of ABC: The possibility of this is infinitesimally small and guess what, Shit happens!!!<br />User: Damn!!! It always happens when I am in middle of something important<br />But hey why go through such a ordeal.. Let me try XYZ...<br /></span></blockquote><br />Real donuts for guessing the service ;)<br /><br />Why?<br /><br />For starters, if there are lot of outages users will loose trust in the service and might start looking at it as a liability. Twitter is a classic example of that. I would hate to see GMail go down while i am using it. In the Web 2.0 world there are lot of <span style="font-style: italic;">'me too'</span> services to take your place, the only differentiator can in many instance be speed and availability of your service.<br />This is normally in a later stage of a start-up as feature takes precedence over availability. But a use of little common sense initially will prolong the availability issues.<br /><br />Why measure?<br /><br />It is always better to measure than not to. It can be used to compare the availability of service month over month and progress made in terms of availability. In extreme cases, one can boast in some scalability and availability conference. ;)<br /><br />Why Five9s and not any other number?<br /><br />Six minutes of downtime is not very huge and not very small, though this depends on the type of outage and service. Choose a number that suits your goals. It is also a measure of availability of service during its business hours(24x7 for most web 2.0 startups). It is a number which is quite difficult to achieve but not impossible. Every year very few services achieve Five9s. Personally I look at it as a benchmark as only a selected few make it to this league.<br /><br />The downtimes can be categorized into two, viz. predictable and unpredictable ones.<br /><br /><span style="font-weight: bold;">1. Unknown/Unpredictable ones</span><br /><span style="font-style: italic;"> a. DB/web server needing a restart(often with windows based environs.)<br /> b. Hardware failures</span><br />The service should have at least have two point of failures for the whole service to fail completely. It pays to have redundancy but its expensive too. RAID depending on the configuration will only protect the data, but the time required to recover from such a disaster and to go up online again will be huge. Its better to have another redundant h/w and s/w which is hot swappable. This will require a lot of design and architecture considerations. Its always better to assume that some failure like this will always happen and being prepared to tackle it. It is not financially viable for many early stage startups to have redundancy for everything, but being prepared for such a eventuality will not hurt the company.<br /><br /><span style="font-style: italic;"> c. A spike in traffic, taking everything down with it.</span><br />Its difficult to be prepared for spike, it is given that there will at least be one spike in a year you cant handle. Having a architecture and design for rainy days will pay off in the longer run. Services like Amazon EC2 will certainly help in handling spike, but it all depends on the preparedness for a spike.<br /><br /><span style="font-style: italic;"> d. Some <span style="font-weight: bold;">goofy</span> in datacenter, restarts the server by accident (I am not making it up. it has happened twice.)<br /></span>To avoid such a scenario don't have your server in India, unless you are having redundant counterpart elsewhere. Not kidding!!! India is light years behind for providing any serious hosting services. If at all you want to have a server in India for various reasons, avoid resellers. If the number of servers are more go for a co-location.<br /><br />continued...<div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-5338627638077375079?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-73356879557229547302007-11-04T07:19:00.000-08:002007-11-04T07:25:28.198-08:00OCC Mumbai MeetOff late I have come to notice the number of startups in India are increasing. Last Year the number of Startups could be counted, but now there is a explosion in the number of startups. Thanks mainly to Web 2.0<br />Here are some of the pics of OCC and Barcamp Mumbai I had visited.<br /><div style="text-align: center;"><embed src="http://www.zoom.in/swf/SlideShow.swf" id="slideShow" name="slideShow" allowfullscreen="true" swliveconnect="true" scale="noscale" menu="false" quality="high" bgcolor="#333333" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="xmlPath=http://www.zoom.in/Slideshow.axd?albumid=970a38c2-4590-4d32-816c-35c4e65f2aea&amp;slideShowMode=embed&amp;photoPath=http://www.zoom.in/GetResizedImage.aspx?PhotoID=&amp;photoViewPath=http://www.zoom.in" align="left" height="216" width="288"></embed></div><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-7335687955722954730?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-49625261967187602462007-10-11T07:27:00.000-07:002007-10-11T07:38:44.793-07:00Funny!!!<a href="http://bp3.blogger.com/_Ndoytqm00qA/Rw41CoahDcI/AAAAAAAAAAc/xm2rdCl6Osc/s1600-h/google-adds.JPG"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_Ndoytqm00qA/Rw41CoahDcI/AAAAAAAAAAc/xm2rdCl6Osc/s320/google-adds.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5120088145691479490" /></a><br /><br />I found this advertisement while reading a blog, and i found this add by google funny.....<div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-4962526196718760246?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-12900212651118973852007-10-06T12:42:00.001-07:002007-10-06T13:06:08.468-07:00The First Step<strong>September 3rd:</strong><br /><em>0825 hrs:</em> 30 pair of eyes zeroin on a location, and are carefully calculating their next move. From the look of their eyes one could tell that they wont hesitate to kill if it is necessary. Chaos erupts as it comes to a halt and people are in a frenzy to board. With room only for a dozen, somehow all 29 of them make it. My jaws dropped, my shoulders sagged and my legs felt loose when I suddenly realised that I have to go in such a train daily to reach my office.<br />0855 hrs:<br />After watching 4 trains pass by, I summoned all the strength and courage to actually approach the train. I was pushed aside by a set of very decent looking hooligans when the next train came. After that movement, I really became one of them and any one could see the same fire in my eyes.<br />I finally got in and felt elevated about the herculian task I had just finished, but to my dismay I found the challenge had just began as I was standing in way of people who wanted to get down<br />at the next station.<br /><br /><strong>October 1st:</strong><br /><em>0840 hrs:</em> Nearly ##(couldnt count because of my concentration) pair of eyes zoomin on a location<br />and I made it(dont know about the rest as I was the first).<br /><br />After a month, I started enjoying the whole experience. In retrospect I feel, the first step is often the most difficult and the most important one to take. Things do get easier as time goes by.<br /><br />I dont know when I will be taking my first step.<div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-1290021265111897385?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-13486089059606872422007-09-30T06:59:00.000-07:002007-09-30T07:06:31.051-07:00Changed Address!!!!The idea of buying my domain had been there in the back of my mind for quite some time.<br />Finally I bought one and have changed the blog address from <a href="http://pvsun.blogspot.com">pvsun.blogspot.com</a> to <a href="http://blog.pvsundarram.com">blog.pvsundarram.com</a>. <br />All the old links will still work!!!!.<br />Looking forward to buy more in the future....<div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-1348608905960687242?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com1tag:blogger.com,1999:blog-17896720.post-5586058444410056532007-09-30T06:36:00.000-07:002007-09-30T07:16:45.716-07:00Missed it this time!!!I went for a walk in the ground near my house, and I found lots of people working on something huge. After looking more closely, I couldnt determine what they were really trying to do. As Ganesh chathurthy was nearing, the artists were adding finishing touches to what they were doing. I could hardly believe my eyes, when I saw what they did just after 10 days. It was like a full blown ship!!!!<br /><img src='http://img01.zoom.in/1191141355/984091324_v.jpg' onclick=window.location='http://www.zoom.in/PhotoView.aspx?PhotoGuid=dc57a773-a806-66d7-c70f-d1d1b28cbbfc&Type=public'/><br />This photo was taken at 00:30 hrs from a distance of more than 400 meters and the place was still buzzing with people. <br /><br />If you are wondering where this photo is coming from, you can check <a href="http://www.zoom.in">zoom.in</a>.<br />Tags: <a href="http://technorati.com/tag/ganpathy" rel="tag">ganpathy</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-558605844441005653?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-15739135644340737412007-08-10T12:33:00.000-07:002009-04-11T09:18:46.133-07:00OOPS in JavaScript : Part IIIn JavaScript we might not need inheritance all the time but as the applications gets complex we might need more structuring of code and also for reusing it. Inheritance according to Mozilla's documentation states that we need to copy the prototype of the base class to the Sub Class. You might ask why. The reason is 'Prototype' is nothing but the Structure of a object and this structure is shared across all the instances of the Class. When a property is added to a object dynamically, it is only for that particular object and not the whole class. On the other hand, when a property is added to the prototype, that property gets added in all the instances of that class. This might sound a little confusing, but thats the way the language works.<br />We will have to be very disciplined when we are writing a application partly because the language is dynamic and very flexible. We should follow some good practices while doing inheritance,<br />1. Avoid adding of properties to objects inside the functions dynamically(that includes the constructor) and always add them to the prototype object. In this case we might not be utilizing the full power of JavaScript, but then all the properties will not get inherited. The properties which are dynamic in nature does not get copied to its subclass.<br /><pre class="brush: js"><br />BaseClass Definition<br />:<br />:<br />myFunction : function(){<br /> this.newProperty = 0;<br />},<br />:<br />:<br /></pre><br />2. A very common mistake one can make is after inheriting, they replace the prototype of the subclass object.<br /><pre class="brush: js"><br />inherit(BaseClass, SubClass);<br />SubClass.prototype = {<br />:<br />:<br />};<br /></pre><br />3. Avoid adding properties to prototype of BaseClass after inheritence, it makes the code very confusing and unreadable to others. But it will get reflected in the SubClass.<br /><pre class="brush: js"><br />inherit(BaseClass, SubClass);<br />BaseClass.prototype.xyzProperty = QWER;<br /></pre><br />There are many approaches to do a extend, but it is very difficult to do a true extend in a dynamic language, because properties can be added dynamically. One should take a approach depending on the way they organize their code.<br />Now after knowing the donts, we will have to write our own extend function or use a function from any library you like. I am not going to re-invent the wheel(I might be taking a fairly similar approach), I will just explain the extend function of <a href="http://developer.yahoo.com/yui/">YUI</a>. <br /><a href="http://developer.yahoo.com/yui/docs/Lang.js.html">Original Code</a><br /><pre class="brush: js"><br />extend: function(subc, superc, overrides) {<br /> if (!superc||!subc) {<br /> throw new Error("YAHOO.lang.extend failed, please check that " +<br /> "all dependencies are included.");<br /> }<br /> var F = function() {};<br /> F.prototype=superc.prototype;<br /> subc.prototype=new F();<br /> subc.prototype.constructor=subc;<br /> subc.superclass=superc.prototype;<br /> if (superc.prototype.constructor == Object.prototype.constructor) {<br /> superc.prototype.constructor=superc;<br /> }<br /> <br /> if (overrides) {<br /> for (var i in overrides) {<br /> subc.prototype[i]=overrides[i];<br /> }<br /><br /> YAHOO.lang._IEEnumFix(subc.prototype, overrides);<br /> }<br /> }<br /></pre><br />After checking the arguments, they create a new dummy class. The prototype of Super Class is then copied to this dummy class. The reason being that in JavaScript everything is a reference and if the prototype of Super class is copied directly to the Sub class, then the Sub Class and the Super Class will be referring to the same prototype. This can be catastrophic. For this we will have to separate the prototype of Sub Class and the Super Class. While inheriting, we will have to call the constructor of the Super Class to initialize. Thats why they are adding a property superclass and assigning the constructor to its prototype's constructor. Apart from that, the guys at yahoo have made sure that derived object has all the enumerated functions when it is overridden(this is a problem in IE). Not only we are reusing the code, we are also reusing the research that went into building the library. And if they had not documented(comments) it in their code, it would have probably never been discovered by others.<br />Tags |- <a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> | <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><br />| <a href="http://technorati.com/tag/oops" rel="tag">oops</a> | <a href="http://technorati.com/tag/javascript" rel="tag">javascript</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-1573913564434073741?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com1tag:blogger.com,1999:blog-17896720.post-24622812935361532772007-08-10T04:55:00.000-07:002007-08-10T04:56:29.349-07:00After a long time.....Finally after a month of inactivity i am back...<br />I couldnt manage to come online for the past one month(i dont know how I survived this) partly because i quit my job at tutorvista..<br />I had not at all planned it... but it happens to everyone of us all the time...<br />Now my mind is vascillating between working in a startup and start something on my own...<br />Tags |- <a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> | <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><br />| <a href="http://technorati.com/tag/" rel="tag"></a> | <a href="http://technorati.com/tag/" rel="tag"></a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-2462281293536153277?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-50539885743302706142007-07-03T22:11:00.000-07:002009-04-11T09:16:32.500-07:00OOPS in JavaScript : Part IEvery one of us knowingly or unknowingly uses OOPS in JavaScript. Every function and every global variable we add in the script is actually a property of window object. The DOM API is also a very powerful API which we extensively use. There are no Classes( in actual sense ) in JavaScript.<br />But first one should understand why we go for OOPS, two of the main reasons i see are code maintainability and extendability. For instance <a href="http://developer.yahoo.com/yui/">YUI Library</a> is extensively used by many big sites, the code is getting reused everywhere and libraries like the <a href="http://www.yui-ext.com/">yui-ext</a> are extending it and taking it to the next level. And thats power... General developer mentality is "i'll do it myself"... Its very natural, but has its side effects of reinventing the wheel again and if we are going to take the same approach i don't think there is a point in reinventing it.... Better would be extend the code that is already there( should be well written and extendable ;-) ) and take it to the next level...<br />OOPS is intended for greater flexibility and maintainability, that IMO is achievable in JavaScript. <br /><br /><strong>Classes</strong><br />There are no classes in real sense of the word in JavaScript. Every function, every property( except the native ones like number, string... ) are objects. Any function can be a constructor to the class. All functions are a instance of Function.<br /><pre class="brush: js"><br />/**<br /> * @class MyClasss<br /> * @constructor<br /> * This is my class constructor<br /> * @param {Object} argument1 first argument for configuring properties of the objects<br /> */<br />function MyClass (argument1)<br />{<br /> //some constructor code<br /> this._config = argument1 || {};<br />}<br /></pre><br />The properties to the object can be added in run-time. The prototype property determines the initial structure of the object( thats why they call it prototype and it is a property of Function ). But it is a good practice to define all the properties that will be used in the prototype object. Which can be added like this<br /><pre class="brush: js"><br />/**<br /> * @method MyClass<br /> * this is my first method<br /> */<br />MyClass.prototype.myFunction = function () {<br /> alert('hello world');<br />};<br />/**<br /> * @type String<br /> * @property name<br /> * name of the instance<br /> */<br />MyClass.prototype.name = '';<br />/**<br /> * @private<br /> * @type Object<br /> * @property _config<br /> * configuration object<br /> */<br />MyClass.prototype._config = null; //default value<br /></pre><br />Here if you notice it is practice and not a must because properties to the objects can be added on the fly thats why all the objects are unique and thats why there are no classes in JavaScript. If you see the above code, the property _config is marked private but it is not actually private. In JavaScript there are no scopes for properties of objects. To put it differently all properties of an object are public. <br />Whatever has been done so far is just for making the code extendable. There are other approaches to OOP like<br /><pre class="brush: js"><br />var myObj = {}; // one way to create a new instance<br />//adding method to the object<br />myObj.myFunction = function () {<br /> alert('hello world');<br />};<br /></pre><br />But the biggest problem with the above approach is it is not extendable.<br />One can also add static properties to the class.<br /><pre class="brush: js"><br />/**<br /> * @method MyClass<br /> * my static method<br /> * @static<br /> */<br />MyClass.myStaticFunction = function () {<br /> alert('my static function');<br />};<br /></pre><br />If you notice closely we are not adding this property to the prototype object but we are adding to the 'MyClass' itself. This is shared across all the instances of the MyClass. The use of 'this' in static methods will refer to MyClass and not the instance and also reference to any other static property via 'this' is not possible. Now that we have created a class-like structure we can now create instances of the MyClass. <br /><pre class="brush: js"><br />//creating a new instance.<br />var myObj = new MyClass(); <br /></pre><br />The 'new' operator creates a new object with the structure of MyClass.prototype and then calls its constructor viz. MyClass. The constructor does some initialization and the object is returned to myObj. In JavaScript objects are passed by reference. Here i am not passing the parameter in the constructor. It is not mandatory to pass the required arguments to any function( including constructor ). The memory will not get released if there are any references to that object. <br />If you notice carefully we are actually adding properties to the prototype object on the fly. You can access the properties of 'myObj'.<br /><pre class="brush: js"><br />myObj.myFunction();<br /></pre><br />Tags - <a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a> <a href="http://technorati.com/tag/oops" rel="tag">oops</a> <a href="http://technorati.com/tag/javascript" rel="tag">javascript</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-5053988574330270614?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-8428620460550343942007-06-27T08:27:00.000-07:002007-06-27T10:05:24.390-07:00Whiteboard / Chat released....We released the Whiteboard / Chat after working for more than 50 days( & nights ofcourse)...... Anyone can check the new Chat and Whiteboard @ <a href="http://www.tutorvista.com">tutorvista.com</a> and by clicking on the 'Try it Now!' button.<br />Tags |- <a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> | <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><br />| <a href="http://technorati.com/tag/TutorVistaNow" rel="tag">TutorVistaNow</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-842862046055034394?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com1tag:blogger.com,1999:blog-17896720.post-36195036475768789642007-06-10T05:55:00.000-07:002007-06-27T10:12:24.975-07:00Coding conventions and practices.Lately i have become a big fan of javascript for its flexibility and expressiveness. It is fragile(depends heavily on the programmer) but a very expressive language. And halfway down the product i have come to realise that its expressiveness and flexibility makes reading of someone else's code difficult. But in a team, the team has to follow similar set of conventions so that everyone else's code doesnt look odd to each other in the team. And this is very important in a very small team, where this can lead to altercations. To avoid such a situation, we have adopted our own set of coding conventions inspired from Java Coding conventions and the one from Douglas Crokford. <br />The main inspirer had been the YUI library, though one looking at their code closely could find out that there are subtle differences but at a higher level they all look the same. At YUI library they spend a lot of time(i guess) to make the code look fabulous and elegant. Any code starts with looking elegant but later becomes very ugly and unmaintainable, but no one can avoid such a situation. At that point of time someone has to step-in and say, the code has to look elegant and maintainable and refactor the code. This does take time but is very useful in the long run when the product matures its maintainability becomes more important or the other alternative will be to rewrite the whole product from scratch(This happens in most companies). With a very short product deadlines it becomes very difficult to do so, but we will have to set ourselves some time for looking back at what we did and correct the things we would have knowingly or unknowingly done the wrong way. <br />Tags |- <a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> | <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><br />| <a href="http://technorati.com/tag/coding+practices" rel="tag"></a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-3619503647576878964?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com3tag:blogger.com,1999:blog-17896720.post-43111645385473860322007-05-19T00:56:00.000-07:002007-05-19T01:45:33.826-07:00'>returnable<a href="http://www.blogger.com/profile/14112196631031678210">Bhasker V Kode</a> <em>alias</em> <span><returnable href='http://onhover.returnable.org/tooltip.text/<img src="http://photos1.blogger.com/blogger/5004/157/1600/bhaskerSNAP1.jpg"/>'>Bosky</returnable></span> has written a nice and very useful library for delivery of content and the best part is its very easy to use. I have added the returnable widgets to my blog. as you can see that u can add just about anything to that widget..<br />I have added an iframe to view the <span><returnable href='http://onhover.returnable.org/tooltip.text/<iframe width="350" height="300" src="http://returnable.org/demos/snapshot.php"/>'>returnable.org</returnable></span> just hover over it to see the widget at work...<br /><br />to add it i have included the javascript file in my template, and added this returnable tag and viola!!!!!.... It just works.....<br /><br />great work bosky!!!!!keep ur gud work going!!!!<br /><br />Tags - <a href="http://technorati.com/tag/widget" rel="tag">widget</a> <a href="http://technorati.com/tag/bosky" rel="tag">bosky</a> <a href="http://technorati.com/tag/returnable" rel="tag">returnable</a> <a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><br /><a href="http://technorati.com/tag/" rel="tag"></a><a href="http://technorati.com/tag/" rel="tag"></a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-4311164538547386032?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.comtag:blogger.com,1999:blog-17896720.post-4240554468435199492007-05-04T06:25:00.000-07:002007-05-04T06:34:20.507-07:00An Irony.....I saw the site of <a href="http://ajaxexperience.techtarget.com">The Ajax Experience Conference</a> by <a href="http://ajaxian.com/">Ajaxian.com</a> which hardly has any AJAX Eperience in the site.......<div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-424055446843519949?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-50052596129005660302007-04-18T12:31:00.000-07:002007-04-18T12:35:18.212-07:00 My post at the startup blog<strong><a href='http://thestartupblog.blogspot.com/2007/04/just-thinking-aloud.html'>Just Thinking Aloud........</a> </strong><br><br /><blockquote>I saw my friend bhasker edit some of his files in his desktop, and then was pushing the files to his webserver hosted at godaddy. Then something struck me................. <a href='http://thestartupblog.blogspot.com/2007/04/just-thinking-aloud.html'>more</a></blockquote>Tags |- <a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> | <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-5005259612900566030?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-65389311145021261202007-03-03T12:09:00.000-08:002007-03-03T12:48:00.466-08:00actionscript 3.0 and sockets.While doing scheduling i learnt a lot about what not to do. Looking at it now, i feel that scheduler had been a victim of premature optimization. I wanted to make it really fast and went all out to do just that. And tried optimizing everything rite from the begining, and ended up screwing the readability and maintainability of the code. As time passed changes started becoming difficult, and the optimizations that were done initially became pointless. I then realised that i should have done optimization after the basics were finished.<br /><br />I then started working on client(again), the one which i had left unfinished. After looking at the stats provided in adobe site, we decided on flash player v8. This supports actionscript 2.0. Main reason for choosing flash was that it was truly platform independent(unlike java ;-) ), and it could open sockets. The class XMLSocket in actionscript 2.0 adds a null byte(<span style="font-weight: bold;">/000</span>) to the end of any string it sends via the socket. The server which was reading it did not understand, and treated this as end of XML stream, and used to throw back xml-not-well-formed-error. I was breaking my head for the reason why this error message was coming from server. Then finally after some investigation we found 2 things which made xmlsocket unusable for client,<br />1> it doesnt support xml v1.0.<br />2> it adds null byte(<span style="font-weight: bold;">/000</span>) to the end of the string.<br />finally dumped actionscript 2.0 and then did one test in actionscript 3.0 and it just worked without any problems(used Socket and not XMLSocket).<br />Tags |- <a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> | <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><br />| <a href="http://technorati.com/tag/actionscript 3.0" rel="tag">actionscript</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-6538931114502126120?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com2tag:blogger.com,1999:blog-17896720.post-1163974614742988732006-11-19T14:10:00.000-08:002006-11-19T14:16:54.753-08:00Been Long TimeIts been a long time since i blogged... part of the reason being i was working on a scheduler.... once i finish the framework for scheduler, i ll be back with what i was trying to do, and whatever i had learnt the hard-way while solving an age old problem of scheduling......<br />Tags |- <a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> | <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-116397461474298873?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-1161928870911884312006-10-26T22:52:00.000-07:002006-10-26T23:01:10.923-07:00a nice video i liked and links.....<a href="http://www.seopedia.org/internet-marketing-and-seo/101-web-marketing-ideas-and-tips/">Web marketing ideas and tips(101)</a><br /><blockquote>Use the title and meta description tags as wise as possible. They are your best choice of avoiding supplemental pages. Try to make each page with it’s own unique title and description, and never repeat more than 20-25% of the title and description tags content on different pages. Use a limited number of characters (8-10) in the title tag, and put the most important of them, relevant to each page, at the beginning.</blockquote><br /><br /><a href="http://googlesystem.blogspot.com/">A blog just about google products</a><br /><blockquote><br />Google has created some pages for the upcoming Halloween. On Google Video, you can find 14 short videos, including a teaser for "Hood of Horror". Google Books features a big list of famous scary stories, like Bram Stoker's Dracula or Mary Shelley's Frankenstein.</blockquote><br /><br /><span style="font-weight:bold;">Firefox add</span><br />I kindof liked this video.<br /><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/euZ0j7vtKEQ"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/euZ0j7vtKEQ" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object><br /><br />Tags |- <a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> | <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><br />| <a href="http://technorati.com/tag/links" rel="tag">links</a> | <a href="http://technorati.com/tag/firefox" rel="tag">firefox</a> | <a href="http://technorati.com/tag/web+marketing+tips" rel="tag">web marketing tips</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-116192887091188431?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-1161845248710834172006-10-25T23:45:00.000-07:002006-10-25T23:49:07.150-07:00benchmark of languages.....While googling i found this....<br /><br /><a href="http://shootout.alioth.debian.org/gp4/benchmark.php">Check it out..</a><br />Tags |- <a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> | <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><br />| <a href="http://technorati.com/tag/benchmark" rel="tag">benchmark</a> | <a href="http://technorati.com/tag/language+speed" rel="tag">language speed</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-116184524871083417?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-1161764081902709842006-10-25T01:13:00.000-07:002006-10-25T23:01:11.696-07:00good jokes i found while googling<blockquote># Me: "What compiler do you use?"<br /># Him: "Well, Qbasic is my favorite."<br /># Me: "Nobody over the age of eight uses QBasic for serious purposes."<br /># Him: "But they made windows with QBasic." </blockquote><br />I have a small anecdote of what happened in my class in our college.<br /><span style="font-weight:bold;">Student:</span> M'am, can you suggest any topic for my project?<br /><span style="font-weight:bold;">Teacher:</span> I ll have to think about it. But i dont have time.<br /><span style="font-weight:bold;">Student:</span> Please tell it to now, so that i can start working on it.<br /><span style="font-weight:bold;">Teacher:</span> Why dont you do VOICE CHAT IN TAMIL.<br /><span style="font-weight:bold;">Student:</span> Mam!!!But...<br />We were all laughing by then.<br /><br /><a href="http://www.rinkworks.com/stupid/cs_programming.shtml">check it out</a><br /><a href="http://technorati.com/tag/funny" rel="tag">funny</a> | <a href="http://technorati.com/tag/jokes" rel="tag">jokes</a> | <a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> | <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-116176408190270984?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-1161606568922110962006-10-23T04:40:00.000-07:002006-10-25T23:01:45.890-07:006 Must have Tools for web2.0 application developmentFor proper development of any application, a developer needs an editor and debugger. PHP and javascript are the technologies i am considering for serverside scripting and client side scripting respectively. <br />First lets look at the editors that are available for free.<br /><span style="font-weight:bold;">1. <a href="en.wikipedia.org/wiki/Vi">vi</a></span><br />Who can ever forget vi. Thats one of the best editors i have ever seen in my life. Any one familiar with *nix would have used this editor. This can be your choice of development if you want a fast, simple ,small editor then vi is just the right editor for you. But it takes time for you to get used to it.<br /><span style="font-weight:bold;">2. <a href="http://www.mpsoftware.dk/phpdesigner.php">PHPDesigner 2005</a></span><br />This is a good editor to start off with, if you want an editor not taking much resources but still helpful, this is just right for you. I have seen the later versions of phpdesigner, which i found very buggy and taking too much resources. This version is best of the lot.<br /><span style="font-weight:bold;">3. <a href="http://www.phpeclipse.de/">PHPEclipse</a> (php)</span> <br />If you want an IDE, then you can go for phpeclipse plugin for eclipse. I have used the plugin from zend, its very buggy and is not that good. PHPEclipse plugin has been there for a long time compared to the zend plugin, and has matured over the time. You can find a tutorial for <a href="http://pvsun.blogspot.com/2006/08/setting-up-development-environment.html">installing phpeclipse here</a> .<br /><span style="font-weight:bold;">4. <a href="http://www.interaktonline.com/Products/Eclipse/JSEclipse/Overview/">JSEclipse</a> (javascript)</span><br />This is a plugin to eclipse ide.There is a community version available for this plugin. It uses almost all the features of eclipse.If you are planning to use it for commercial purpose i'd suggest you buy it.<br /><span style="font-weight:bold;">5. <a href="http://www.aptana.com/">Aptana</a> (javascript)</span><br />There is a aptana plug-in for eclipse. This comes bundled with some of the most used AJAX libraries like yahoo,dojo... Even this plugin uses all the features of eclipse.<br />After choosing the editors, we need to choose some tools for debugging.<br /><span style="font-weight:bold;">6. <a href="http://dd.cron.ru/">DBG Debugger</a>(PHP)</span><br />This debugger has to be installed in your webserver. The debugger client is built in phpeclipse plugin. There is a tutorial for howto <a href="http://pvsun.blogspot.com/2006/08/setting-up-development-environment.html">install dbg debugger here.</a><br /><span style="font-weight:bold;">7. <a href="https://addons.mozilla.org/firefox/1843/">Firebug extension for firefox</a> (javascript)</span><br />This extension is very useful in debugging javascript. You can also use venkman javascript debugger, but i found firebug to be more useful and faster when compared to venkman.<br /><span style="font-weight:bold;">8. <a href="http://livehttpheaders.mozdev.org/">Live HTTP Header extension for firefox</a> <br /></span>This is very useful for debugging web2.0 based applications. This extension is useful for monitoring the http requests going out from the browser. There is a replay feature in this extension which is very useful.<br /><span style="font-weight:bold;">9. <a href="http://ietab.mozdev.org/">IETab extension for firefox</a></span><br />This extension is a very useful extension, for viewing how the site behaves in ie. It basically creates a new tab where ie is embedded in it. This will reduce a lot of pain especially when you dont want to switch windows while using firefox.<br /><span style="font-weight:bold;">10. <a href="http://hermann.czedik.net/projekte/switcher/">Server Switcher extension for firefox</a></span><br />This extension is very useful for switching between the developer server and the live server. This will help reduce a lot of time and irratation while development.<br /><br />By choosing a suitable editor and the above tools, the application development becomes a lot easier. There are other editors and tools which i havent mentioned. most of them i think were redundant or werent that good when i had used it.<br /><br /><span style="font-weight:bold;">happy ajaxing!!!!</span><br />Tags : <br /><a href="http://technorati.com/tag/web2.0" rel="tag">web2.0</a> | <a href="http://technorati.com/tag/ajax+tools" rel="tag">ajax tools</a> | <a href="http://technorati.com/tag/editor" rel="tag">editor</a> |<a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> | <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-116160656892211096?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-1161594990709528642006-10-23T02:10:00.000-07:002006-10-25T23:02:01.536-07:00Funny link on web2.0While googling i found this oliver widder's blog. it was funny and different....<br /><a href="http://geekandpoke.blogspot.com/"><img style="cursor:pointer; cursor:hand;width: 320px;" src="http://photos1.blogger.com/blogger/2859/2904/1600/Page_1.75.jpg" border="0" alt="" /></a> |<a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> | <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-116159499070952864?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0tag:blogger.com,1999:blog-17896720.post-1160973524222963142006-10-15T21:38:00.000-07:002006-10-25T23:02:28.920-07:00DataStructures and algorithmThis blog is an effort to help people understand the basics of programming, data structures and algorithms. This blog doesnt have any mathematical equations,this blog is purely for programmers.....A must read for anyone trying to learn datastructures<br/><br/><a href="http://datastructures101.blogspot.com/">read more</a>&nbsp;|&nbsp;<a href="http://digg.com/programming/DataStructures_and_algorithm">digg story</a> |<a href="http://technorati.com/tag/sundarram" rel="tag">sun</a> | <a href="http://technorati.com/tag/pvs" rel="tag">pvs</a><div class="blogger-post-footer"><!--google analytics --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2599010-1"; urchinTracker(); </script><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17896720-116097352422296314?l=blog.pvsundarram.com'/></div>Sundarram P Vhttp://www.blogger.com/profile/15024343846566595681noreply@blogger.com0