<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>About MeName: Harjinder VirdiBorn: June 08, 1989 From: TorontoEmail: Harjinderv@gmail.comMy Website</description><title>Harjinder Virdi</title><generator>Tumblr (3.0; @harjinderv)</generator><link>http://harjinderv.tumblr.com/</link><item><title>Bug#557135 : Final Review</title><description>&lt;p&gt;&lt;a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=557135"&gt;&lt;strong&gt;Bug#557135&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The patch for indent went through a lot of iterations and changes. I have summarized everything up until this point as to where I am with my &lt;a href="https://bug557135.bugzilla.mozilla.org/attachment.cgi?id=439841"&gt;latest patch&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;- Selected lines are indented as well as multiple lines.&lt;br/&gt;- Indentation on multiple lines is grouped into a single undo/redo  event.&lt;br/&gt;- Rather then replacing the entire line with &amp;lt;indention&amp;gt; +  &amp;lt;line text&amp;gt; only  indentations are inserted this time.&lt;br/&gt;- After indenting if there is a selection, the selection is retained.&lt;br/&gt;- Indentation tab size on multiple lines is now consistent&lt;br/&gt;- When undoing the selection retains its expected position.&lt;/p&gt;
&lt;p&gt;After &lt;a target="_blank" href="http://twitter.com/jviereck"&gt;Julian&lt;/a&gt; reviewed &lt;a target="_blank" href="https://bug557135.bugzilla.mozilla.org/attachment.cgi?id=439841"&gt;my final patch&lt;/a&gt; he had recommended me the following changes before he could push the patch.&lt;/p&gt;
&lt;p&gt;1.) As of now the code is a bit complicated to read and has to be structured properly.&lt;/p&gt;
&lt;p&gt;2.) Be smart about leading spaces to determine how many tab spaces are required to align a text. An example Julian provided:&lt;/p&gt;
&lt;p&gt;For instance if tabstop = 4 and current line follows with cursor position at col 1&amp;#160;:&lt;br/&gt;&lt;br/&gt;&amp;#8220;space|spaceHello&amp;#8221;&lt;br/&gt;&lt;br/&gt;After hitting &amp;#8220;tab&amp;#8221; it would add 3 spaces since we&amp;#8217;re using cursor position to determine how many spaces are needed.&lt;/p&gt;
&lt;p&gt;&amp;#8220;spacespacespacespace|spaceHello&amp;#8221;&lt;/p&gt;
&lt;p&gt;Now we have 5 spaces in front of Hello. Instead there should be only 4 because we need to take the leading spaces into accountability and therefore only 2 spaces are required to align &amp;#8220;Hello&amp;#8221;:&lt;/p&gt;
&lt;p&gt;&amp;#8220;spacespacespace|spaceHello&amp;#8221;&lt;/p&gt;
&lt;p&gt;It is clear to me as to what needs to be done and how to do it. I will have my final patch before the end of this week.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;</description><link>http://harjinderv.tumblr.com/post/534086204</link><guid>http://harjinderv.tumblr.com/post/534086204</guid><pubDate>Mon, 19 Apr 2010 17:31:00 -0400</pubDate><category>open source</category></item><item><title>Bug#557135 Quick Update</title><description>&lt;p&gt;After I shortly submitted my &lt;a&gt;2nd patch,&lt;/a&gt; &lt;a&gt;Julian&lt;/a&gt; was able to provide me with feedback and as well as a &lt;a&gt;new patch&lt;/a&gt; with a few more additions to my current patch. My patch worked  but however there were a few issues pointed out by &lt;a&gt;Julian&lt;/a&gt; that were needed to be fixed and are fixed now with his help:)&lt;/p&gt;
&lt;p&gt;1.) Instead of replacing the entire line with &amp;lt;indention&amp;gt; + &amp;lt; line text &amp;gt; , only indentations are inserted this time.&lt;/p&gt;
&lt;p&gt;2.) Undo/Redo - Thanks to &lt;a&gt;Julian &lt;/a&gt;for the code, indentation on multiple lines is now grouped into one undo/redo event.&lt;/p&gt;
&lt;p&gt;3.) Since &amp;#8216;count&amp;#8217; always retained the same value in the &amp;#8216;line for loop&amp;#8217; it was not necessary for it to be executed more then once. I moved it outside of the &amp;#8216;line for loop&amp;#8217; &lt;/p&gt;
&lt;p&gt;4.) After a selection was indented, the selected text was no longer selected. Now the selected text remains selected.&lt;/p&gt;
&lt;p&gt;I have submitted a patch on bugzilla &lt;a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=557135"&gt;Bug#557135&lt;/a&gt; with these changes. &lt;br/&gt;*source code: &lt;a&gt;&lt;a href="http://gist.github.com/366757"&gt;http://gist.github.com/366757&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;More to follow&amp;#8230;&amp;#8230;&lt;/p&gt;</description><link>http://harjinderv.tumblr.com/post/522712711</link><guid>http://harjinderv.tumblr.com/post/522712711</guid><pubDate>Thu, 15 Apr 2010 02:28:00 -0400</pubDate><category>Open Source</category></item><item><title>Bespin Multi-line Revisited: BUG#557135</title><description>&lt;p&gt;Well before I get straight to the &lt;a target="_self" href="http://harjinderv.tumblr.com/post/512125783/bespin-multi-line-indent"&gt;multi-line stuff&lt;/a&gt;, let me mention a few bugs I encountered while working on this feature. &lt;/p&gt;
&lt;p&gt;1.) &lt;strong&gt;Undo/Redo&lt;/strong&gt; did not work properly with multi-line indent. Each indent on a line was treated as a separate change where as in the whole indent should be grouped into one undo event. &lt;a target="_blank" href="http://twitter.com/jviereck"&gt;Julian&lt;/a&gt; is aware of this now. I might know how to fix this so If I do come across a fix I will do it:)&lt;/p&gt;
&lt;p&gt;2.) &lt;strong&gt;Skipping Tab Spaces&lt;/strong&gt; I noticed that when moving from left to right if there is a tab space it does not skip a tab worth of spaces when it should. &lt;a target="_blank" href="http://derekambrose.blogspot.com/"&gt;Derek&lt;/a&gt; is working on this.&lt;/p&gt;
&lt;p&gt;After &lt;a target="_blank" href="http://twitter.com/jviereck"&gt;Julian&lt;/a&gt; reviewed my code, he told me that I should not be hard coding the tab spaces and instead I should use &amp;#8216;tabstop&amp;#8217; to determine the amount of spaces I need. Apart from that everything else looked good. I altered my code and below are the changes: &lt;/p&gt;
&lt;p&gt;&lt;img src="http://img17.imageshack.us/img17/794/test5b.png" width="676" align="middle" height="467"/&gt;&lt;/p&gt;
&lt;p&gt;Complete source code: &lt;a href="http://gist.github.com/363245"&gt;http://gist.github.com/363245&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;BTW It is &lt;a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=557135"&gt;Bug#557135&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Minor Update*&lt;/strong&gt; &lt;br/&gt;If the total tab spaces for every other line will always be the same then I believe the code below should go right after &amp;#8220;selection.start.column = 0;&amp;#8221; and before the for loop begins.  &lt;/p&gt;
&lt;p&gt;&lt;img align="middle" src="http://img718.imageshack.us/img718/1227/change.png" width="429" height="88"/&gt;&lt;/p&gt;
&lt;p&gt;I will wait for &lt;a target="_blank" href="http://twitter.com/jviereck"&gt;Julian&lt;/a&gt; to provide me feedback and go from there:)&lt;/p&gt;</description><link>http://harjinderv.tumblr.com/post/514788798</link><guid>http://harjinderv.tumblr.com/post/514788798</guid><pubDate>Sun, 11 Apr 2010 23:54:00 -0400</pubDate><category>Open Source</category></item><item><title>Bespin Multi-line Indent</title><description>&lt;p&gt;Schools just a week away from finishing and I have been working on &lt;a target="_blank" href="https://bespin.mozillalabs.com/"&gt;Bespin&lt;/a&gt;. In my previous post I was able to get indent working on a selected piece of text. Now &lt;span&gt;&lt;a&gt;Julian&lt;/a&gt; &lt;/span&gt;had suggested that I change the code so that it would work on multiple lines. &lt;/p&gt;
&lt;p&gt;First step was to grab all the selected lines:&lt;/p&gt;
&lt;p&gt;&lt;img height="35" width="353" src="http://img694.imageshack.us/img694/8572/capture1lk.png" align="middle"/&gt;&lt;/p&gt;
&lt;p&gt;*This gives us an array of selected lines which now contain the characters and the length of each line.&lt;/p&gt;
&lt;p&gt;Great so we have the lines we would like to indent! Now next step was to iterate through each line and add an indent space in front of it. But of course the first line was special on its own since its start position could be selected from any column, unlike the lines afterward which would always retain their start position at column 0. &lt;/p&gt;
&lt;p&gt;In order for me to add the indentation to any given line I would have to call the function &amp;#8220;replaceCharacters(range,text_to_be_replaced_with)&amp;#8221;. So therefore I would need to specify a range object which would point to that specific line. Here is how a range object looks like:&lt;/p&gt;
&lt;p&gt;&lt;img height="127" width="313" src="http://img94.imageshack.us/img94/6130/finalua.png" align="middle"/&gt;&lt;/p&gt;
&lt;p&gt;range = { &lt;br/&gt;                start: { row: 0, column: 13}, &lt;br/&gt;                end:   { row: 1, column: 24}&lt;br/&gt;} &lt;br/&gt;&lt;br/&gt;&amp;#8220;start&amp;#8221; position is where the selection starts and &amp;#8220;end&amp;#8221; is where the selection finishes. They both have &amp;#8220;row&amp;#8221; which specifies the line number and &amp;#8220;column&amp;#8221; which represents at which character. &lt;br/&gt;&lt;br/&gt;Now since its a bit more clear let me show you my complete code..I&amp;#8217;ll start from chunks:&lt;/p&gt;
&lt;p&gt;&lt;img height="307" width="547" src="http://img714.imageshack.us/img714/6898/capture3r.png" align="middle"/&gt;&lt;/p&gt;
&lt;p&gt;@line 15, we will add indentation to the first line, and since &amp;#8220;selection&amp;#8221; already points to the first line we do not need to modify it. &lt;/p&gt;
&lt;p&gt;Now we loop through each line and add 8 spaces of indentation. &amp;#8220;current&amp;#8221; identifies the row position where the first line is, since its not always 0!. Rest is self explanatory.&lt;/p&gt;
&lt;p&gt;&lt;img height="197" width="522" src="http://img444.imageshack.us/img444/4980/capture4g.png" align="middle"/&gt;&lt;/p&gt;
&lt;p&gt;After the indentations have been added where needed, we need to reposition the cursor. &lt;/p&gt;
&lt;p&gt;Here is the code&lt;/p&gt;
&lt;p&gt;&lt;img height="131" width="659" src="http://img526.imageshack.us/img526/5622/morecode.png" align="middle"/&gt;&lt;/p&gt;
&lt;p&gt;Complete source code:&lt;a href="http://pastebin.com/Vi4RgscU"&gt;&lt;a href="http://pastebin.com/Vi4RgscU"&gt;http://pastebin.com/Vi4RgscU&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For now It does indent multiple lines, However it is not the final code. I will revisit the code and make a few minor modifications. I do have question regarding the tab spaces but I will get &lt;span&gt;Julian&lt;span&gt; to review my code. I doubt its 100% right but I am getting there&amp;#8230;I&amp;#8217;ll post more updates until then have a great weekend!&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;p.s When I got the new repository I realized the code was not in the text.js file anymore, it had been moved to a different file named editing.js under &amp;#8220;commands&amp;#8221; folder.. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description><link>http://harjinderv.tumblr.com/post/512125783</link><guid>http://harjinderv.tumblr.com/post/512125783</guid><pubDate>Sat, 10 Apr 2010 02:00:00 -0400</pubDate><category>open source</category></item><item><title>Bespin: Indent "This"</title><description>&lt;p&gt;In the previous version of Bespin you were able to highlight a piece of text and upon hitting the “tab” key it would shift the text to the right and cause it to indent. However this feature is not available in the most recent version  0.7.1. &lt;a&gt;Julian&lt;/a&gt; asked me to bring this feature back.&lt;/p&gt;
&lt;p&gt;I started my work in the textview.js&amp;#160;; Where the code would belong for this type of action. I Looked for the function that got triggered when the “tab” key was pressed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img width="507" height="226" align="middle" src="http://img651.imageshack.us/img651/2458/testingcodekli.png"/&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;source:&lt;a&gt;&lt;a href="http://pastebin.com/bjTd8K0E"&gt;http://pastebin.com/bjTd8K0E&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The original code adds the tab space but overwrites the selected text while doing so.  To avoid this type of behaviour I appended the highlighted text (this.getSelectedCharacters() returns the highlighted characters) along with the tab space(str). This did the trick!&lt;/p&gt;
&lt;p&gt;However while working on this bug I noticed a strange behaviour, every time you would hit the “tab” key, the focus went to the command line, which was very annoying. I had a feeling it was a bug and asked on #Bespin IRC channel. &lt;a&gt;Patrick&lt;/a&gt; told me that it was &lt;a&gt;Bug#555598&lt;/a&gt; . After viewing the bug I noticed a patch had just been submitted, It just needed to be pulled.  Next up is &amp;#8220;Unindent&amp;#8221;&amp;#8230;um yeah at first I was like wth&amp;#8230;Its when you hold shift + tab and everything gets indented to the left(notice the two arrows on your tab key:D).&lt;/p&gt;</description><link>http://harjinderv.tumblr.com/post/484223929</link><guid>http://harjinderv.tumblr.com/post/484223929</guid><pubDate>Tue, 30 Mar 2010 10:00:00 -0400</pubDate><category>Open Source</category></item><item><title>Frustration Build Up : BUG#542524</title><description>&lt;p&gt;I usually wait to blog when I have accomplished a task or I believe I have something good to say. It&amp;#8217;s neither. When I had started to work on my &lt;a target="_blank" href="http://harjinderv.tumblr.com/post/455860204/bespin-word-wrap-bug-542524"&gt;bespin word wrap bug&lt;/a&gt; I was not sure where to start. Normally when I start my work on any programming assignment I usually go straight to coding and try to experiment with the code and start narrowing it down until I get something right going. Of course this is not the best step if your working with a large code base. Then again at the same time you need to have some clue as to where you &amp;#8220;might&amp;#8221; think the code resides using keywords or just simple guessing loll?&lt;/p&gt;
&lt;p&gt;I went into the file text.js because I had done some work in there previously. I began playing around and I was able to find the code where it inserts the character onto the line but it was not enough to do what I wanted. &lt;/p&gt;
&lt;p&gt;I needed help so the first thing I did was, I got on the IRC #Bespin channel and informed about my bug and that I needed help. Instantly &lt;a target="_blank" href="http://twitter.com/jviereck"&gt;Julian Viereck&lt;/a&gt; replied and told me to post my thoughts and suggestions on &lt;a target="_blank" href="http://groups.google.com/group/bespin-core/browse_thread/thread/7c5e7b098bf9b167?pli=1"&gt;Bespin-core mailing list&lt;/a&gt;. I did and I got a few replies. First suggestion was by Dany Zatuchna for me to use the &amp;#8220;&lt;a target="_blank" href="http://defoe.sourceforge.net/folio/knuth-plass.html"&gt;Knuth&amp;#8217;s Algorithm&lt;/a&gt;&amp;#8221;. I took a look but it was not exactly what I needed at the moment. I wanted to break the solution into a few steps: &lt;/p&gt;
&lt;p&gt;1.) Get the length of each line&lt;br/&gt;2.) Find out the max width of the editor&lt;br/&gt;3.) Set a speciific margin so if the user reaches the end of a line then insert the      characters on to the next line.&lt;br/&gt;4.) From there I can do the word wrap which would be iterating through each line and swapping words where necessary. &lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.blueskyonmars.com/"&gt;Kevin Dangoor&lt;/a&gt; had told me that the editor lives in the ScrollView and that&amp;#8217;s how it knows its dimensions. And that it uses character&amp;#8217;s width and height to determine the total area of the editor. Interestingly It was not what I thought it would be. He also Implied that I should talk to &lt;a target="_blank" href="http://twitter.com/pcwalton"&gt;Patrick&lt;/a&gt; and &lt;a target="_blank" href="http://twitter.com/jviereck"&gt;Julian&lt;/a&gt;. Since both had done most of the hacking in bespin-core. After going back to the IRC channel and speaking to &lt;a target="_blank" href="http://twitter.com/pcwalton"&gt;Patrick Walton&lt;/a&gt;, I found out that most of my hacking would be done in LayoutManager and a little modification in the TextView. &lt;span&gt;LayoutManager because it mostly entails what word wrap require. It is able to determine the pixel position of each character or a range within the editor.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;However after spending some time with both files I was still unsure as to where I would start coding. Also I did not understand some of the functions in the file LayoutManager. So I sent &lt;a target="_blank" href="http://twitter.com/jviereck"&gt;Julian&lt;/a&gt; an email about my questions and he felt that this bug was not simple and it would be hard to do if I hadn&amp;#8217;t had much experience working with &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Mozilla_Bespin"&gt;Bespin&lt;/a&gt; coding. He offered to guide me through it but felt that I should work on the bugs suggested by him first so that I could get more fimiliar with the &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Mozilla_Bespin"&gt;Bespin&lt;/a&gt; code base.&lt;/p&gt;
&lt;p&gt;At the end of the day there are no stupid questions and from every question you learn something even if you don&amp;#8217;t accomplish anything. I made a mistake and that was not being open about my problem. The idea of me looking &amp;#8220;stupid&amp;#8221; by not being able to do this or asking &amp;#8220;stupid&amp;#8221; questions kept stressing me. I was wrong and it&amp;#8217;s not like It was not obvious to me. You only get better at something by keep working on it&amp;#8230;.Learning can come from experimenting and asking questions. Not everyone has the answer to everything&amp;#8230; At the same time you might know something someone else might not and thats how we collaborate.&lt;br/&gt;&lt;br/&gt;Now having said that I got a better understanding of how the &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Mozilla_Bespin"&gt;Bespin&lt;/a&gt; code structure is layed out, similar to the way &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Cocoa_(API)"&gt;Cocoa&lt;/a&gt; does. In the mean time I&amp;#8217;ll work on other bugs recommended by &lt;a target="_blank" href="http://twitter.com/jviereck"&gt;Julian Viereck&lt;/a&gt;. Then I will come back and experiment this &lt;a target="_blank" href="http://harjinderv.tumblr.com/post/455860204/bespin-word-wrap-bug-542524"&gt;word wrap bug&lt;/a&gt;.&lt;/p&gt;</description><link>http://harjinderv.tumblr.com/post/481451789</link><guid>http://harjinderv.tumblr.com/post/481451789</guid><pubDate>Mon, 29 Mar 2010 07:00:00 -0400</pubDate><category>Open Source</category></item><item><title>My second prototype draft for the file system for our PJS   IDE....</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_kzufgixFD11qaqcj1o1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;My second prototype draft for the file system for our &lt;a&gt;PJS   IDE&lt;/a&gt;. This includes the basic functionalities such as creating a new file, opening an existing file, deleting files/folders and moving them.Any feedback or suggestions are welcome. I will get  my team’s input and suggestions and from there we will start making our revisions.&lt;/p&gt;</description><link>http://harjinderv.tumblr.com/post/472641484</link><guid>http://harjinderv.tumblr.com/post/472641484</guid><pubDate>Thu, 25 Mar 2010 11:09:54 -0400</pubDate><category>PRJ566</category><category>Open Source</category></item><item><title>Bespin Word Wrap: Bug #542524</title><description>&lt;p&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;It seems like hours, days, and months&amp;#8230;since I last worked on a bug. My last release was for &lt;span&gt;&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=509492"&gt;Bug #509492&lt;/a&gt;.&lt;span&gt;  A few days ago I acquired myself a new &lt;/span&gt;&lt;a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=542524"&gt;Bug #542524&lt;/a&gt;&lt;span&gt;. So What is the problem? Not necessary a problem but a feature.The folks at &lt;/span&gt;&lt;a target="_blank" href="https://bespin.mozillalabs.com/"&gt;Bespin&lt;/a&gt; &lt;span&gt;want to implement word wrap feature into the &lt;/span&gt;&lt;a target="_blank" href="https://bespin.mozillalabs.com/"&gt;Bespin&lt;/a&gt;&lt;span&gt; Editor. Now what the heck is word wrap? Word wrap is a feature that allows an editor to automatically shift words to the next line if the words are too large to fit onto the current line. &lt;br/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First step&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Thanks to &lt;a target="_blank" href="http://vocamus.net/dave/"&gt;David Humphrey&lt;/a&gt; for pointing out how I should get started with this. Initially I began reading about various Algorithms used to perform word wrap and the most important factor is optimization. As much as we love to get a piece of code to do what we want it do, we do have to ask our self is it the most efficient way&amp;#160;? Even after speaking to &lt;a target="_blank" href="http://www.blueskyonmars.com/"&gt;Kevin Dangoor&lt;/a&gt;, his only requirement was to make sure that this feature did not slow down the editor!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Greedy Algorithm&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;SpaceLeft := LineWidth&lt;br/&gt;&lt;br/&gt;for each Word in Text&lt;br/&gt;&lt;br/&gt;    if Width(Word) &amp;gt; SpaceLeft&lt;br/&gt;&lt;br/&gt;        insert line break before Word in Text&lt;br/&gt;&lt;br/&gt;        SpaceLeft := LineWidth - Width(Word)&lt;br/&gt;&lt;br/&gt;    else&lt;br/&gt;&lt;br/&gt;        SpaceLeft := SpaceLeft - (Width(Word) + SpaceWidth)&lt;/pre&gt;
&lt;p&gt;This Algorithm is called the &amp;#8220;&lt;a target="_blank" href="http://en.wikipedia.org/wiki/Greedy_algorithm"&gt;Greedy Algorithm&lt;/a&gt;&amp;#8221; and it used by popular word processors like &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Microsoft_Word"&gt;Microsoft Word&lt;/a&gt; and &lt;a target="_blank" href="http://en.wikipedia.org/wiki/OpenOffice.org"&gt;Open Office&lt;/a&gt;. This pseudo code as described goes through each word and tries to fit as many words it can on a line and continues this routine by going to the next line until there are no words left to insert.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Getting Started&amp;#8230;?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So I get the idea of how to do this but I&amp;#8217;m unclear as to where the code would go, I&amp;#8217;m guessing it should be a function that should called when the editor is redrawn after each character is typed. I will ask the folks on #Bespin IRC channel for help. &lt;/p&gt;
&lt;p&gt;In the mean time I will start playing around with the code but I&amp;#8217;m very hungry and I need to have my dinner&amp;#8230;So I&amp;#8217;ll continue from here, bye:) &lt;/p&gt;</description><link>http://harjinderv.tumblr.com/post/455860204</link><guid>http://harjinderv.tumblr.com/post/455860204</guid><pubDate>Wed, 17 Mar 2010 23:45:26 -0400</pubDate><category>Open Source</category></item><item><title>Thunderbird Lab: Fixing Mailto</title><description>&lt;p&gt;So Let me present you Part 2 of this Thunderbird Lab and no the caffeine is not kicking in, I&amp;#8217;m trying to avoid any intake of coffee&amp;#8230; After the initial debug build, I tried to reproduce the issue to ensure that the problem persisted in order for me to fix it in the first place.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Reproducing The Problem&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;img src="http://img13.imageshack.us/img13/5494/testxut.png" width="549" align="middle" height="413"/&gt;&lt;br/&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;This is a draft copy of an email I sent to myself and as you can see that all the current invalid email addresses contain two or more &amp;#8220;.&amp;#8221; after the @.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Fixing The Code&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To resolve this and thanks to &lt;a target="_blank" href="http://scottdowne.blogspot.com/2010/03/thunderbird-lab.html"&gt;Scott&lt;/a&gt; for pointing out &amp;#8220;&lt;a target="_blank" href="https://developer.mozilla.org/en/nsDependentString_external#Find%28const%20nsAString%26%2C%20PRInt32%20%28*%29"&gt;&lt;b&gt;Find()&lt;/b&gt;&lt;/a&gt;&amp;#8221; function belonging to the &lt;a target="_blank" href="https://developer.mozilla.org/en/nsDependentString_external"&gt;nsDependentString &lt;/a&gt;class; It allows us to check for a specific pattern in a string starting at any given index, and if the pattern is found it will return the position where the pattern first occurred else it will return &amp;#8220;-1&amp;#8221; meaning not found.&lt;/p&gt;
&lt;p&gt;if (inString.FindChar(&amp;#8216;.&amp;#8217;, pos)&amp;#160;!= kNotFound)&lt;br/&gt;This is the original code and it only checks for a single &amp;#8216;.&amp;#8217;  after &amp;#8216;pos&amp;#8217; which is the index of &amp;#8220;@&amp;#8221;&amp;#8230;.So to check for two &amp;#8216;..&amp;#8217; I appended this to the current code&lt;b&gt; &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;if (inString.FindChar(&amp;#8216;.&amp;#8217;, pos)&amp;#160;!= kNotFound) &lt;b&gt;&amp;amp;&amp;amp;&amp;#160;!inString.Find(&amp;#8220;..&amp;#8221;,pos))&lt;/b&gt;&lt;br/&gt;Now the code simply says in the string &amp;#8220;inString&amp;#8221; look for a single &amp;#8220;.&amp;#8221; and not &amp;#8220;..&amp;#8221; and if both conditions are met then a valid email address is found and create the string literal as a &amp;#8220;mailto&amp;#8221; link.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Result &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://img638.imageshack.us/img638/9264/test2o.png" width="333" align="middle" height="438"/&gt;&lt;/p&gt;
&lt;p&gt;Seems like the code fixed the problem.&lt;/p&gt;
&lt;p&gt;Bye&lt;/p&gt;</description><link>http://harjinderv.tumblr.com/post/436930624</link><guid>http://harjinderv.tumblr.com/post/436930624</guid><pubDate>Tue, 09 Mar 2010 10:00:00 -0500</pubDate><category>Open Source</category></item><item><title>Simply Building Thunderbird </title><description>&lt;p&gt;Its been ages since I have blogged but I&amp;#8217;m back on it&amp;#160;!..Currently we are working on a &lt;a target="_blank" href="http://zenit.senecac.on.ca/wiki/index.php/Thunderbird_Bug_Fix_Lab"&gt;Thunderbird Lab&lt;/a&gt;, which requires us to fix a bug regarding unwanted mailto link. This Lab will provide us a practical understanding of how to file a bug, finding a fix for it, create a patch for the fix and then submitting the patch for a review.&lt;br/&gt;The Problem?&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;img src="http://img10.imageshack.us/img10/7991/testtue.png" width="439" align="middle" height="83"/&gt;&lt;/p&gt;
&lt;p&gt;Even though &amp;#8220;S@Y&amp;#8230;&amp;#8221; is a string literal in the message it still detects it as a valid email address and that definitely is not a valid email address! The problem in this scenario is that there should only be a single period between the character &amp;#8216;Y&amp;#8217; followed by &amp;#8216;@&amp;#8217; and domain name &amp;#8216;where&amp;#8217; for it to be considered valid. Before resolving the problem, I decided to do a debug build of Thunderbird.&lt;/p&gt;
&lt;p&gt;For instructions on how to build Thunderbird, visit  &lt;a target="_blank" href="https://developer.mozilla.org"&gt;Mozilla Developer Center&lt;/a&gt; website and locate the article &amp;#8220;&lt;a target="_blank" href="https://developer.mozilla.org/en/Simple_Thunderbird_build"&gt;Simple Thunderbird build&lt;/a&gt;&amp;#8221;. I&amp;#8217;m building this on my windows laptop.&lt;/p&gt;
&lt;p&gt;1.) Retrieve the source code for Thunderbird using hg clone &lt;a href="http://hg.mozilla.org/comm-central/"&gt;&lt;a href="http://hg.mozilla.org/comm-central/"&gt;http://hg.mozilla.org/comm-central/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2.)cd comm-central&lt;/p&gt;
&lt;p&gt;3.) Configure .mozconfig file for a debug build:&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-tb-debug&lt;br/&gt;&lt;br/&gt;ac_add_options --enable-application=mail&lt;br/&gt;&lt;br/&gt;ac_add_options --enable-debug&lt;br/&gt;&lt;br/&gt;ac_add_options --disable-optimize&lt;/pre&gt;
&lt;p&gt;4.) python client.py checkout &lt;br/&gt;5.) make -f client.mk(Coffee break indeed)&lt;/p&gt;
&lt;p&gt;&lt;img src="http://img39.imageshack.us/img39/5971/capturexc.png" align="middle"/&gt;&lt;/p&gt;
&lt;p&gt;I successfully builded Thunderbird but with an error regarding NSGlue_Assesrtion..:(:(Seems like &lt;a target="_blank" href="http://tdao75.blogspot.com/"&gt;Than Dao&lt;/a&gt; and &lt;a target="_blank" href="http://scottdowne.blogspot.com/search/label/open%20source"&gt;Scott Downe&lt;/a&gt; encountered this error as well! Anyways I&amp;#8217;m off to bed I&amp;#8217;ll have to check that tomorrow and continue from there.&lt;/p&gt;
&lt;p&gt;Gnite!&lt;/p&gt;</description><link>http://harjinderv.tumblr.com/post/425982469</link><guid>http://harjinderv.tumblr.com/post/425982469</guid><pubDate>Thu, 04 Mar 2010 04:46:00 -0500</pubDate><category>open source</category></item></channel></rss>

