<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-25948697</id><updated>2011-04-21T21:59:39.866+03:00</updated><category term='Hebrew'/><category term='English'/><category term='Google'/><category term='Programming'/><title type='text'>Mostly Harmless</title><subtitle type='html'>An Anti-Blog by Yanir Kleiman</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hexygen.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://hexygen.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Yanir Kleiman</name><uri>http://www.blogger.com/profile/00844954059781925250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-25948697.post-670310259907065193</id><published>2007-05-21T21:04:00.000+03:00</published><updated>2007-05-24T10:32:22.937+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='English'/><title type='text'>Some Comments About Commenting</title><content type='html'>Lately I have seen far too much undocumented code. It seems that no one really appreciates the power of good commenting anymore.&lt;br /&gt;&lt;br /&gt;I'm a pretty good coder, I think, and so are many of the people I work with. But for some odd reason, I don't remember anyone taking comments as seriously as I do.&lt;br /&gt;&lt;br /&gt;Commenting is what makes the difference!&lt;br /&gt;Comments are the difference between good code and excellent code, and as such, they make the difference between a good coder and an excellent coder.&lt;br /&gt;&lt;br /&gt;Nobody like to comment their code, and I really don't know why, but I suspect a part of the problem is not knowing how to comment code in a good manner, or not recognizing good comments when you see them.&lt;br /&gt;&lt;br /&gt;So I've decided to compile a short list of tips for the common coder, who now have to sit and write some comments for the first time in his life.&lt;br /&gt;Here they are, from least important to most important:&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;9 Tips for Good Commenting&lt;/h3&gt;&lt;br /&gt;&lt;strong&gt;9. Don't write too long, but don't write too short&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Writing "War and Peace" in your code will not do anyone good, everybody knows that.&lt;br /&gt;But more often, you will find out comments that are simply not helpfull, all in the name of shorthand writing.&lt;br /&gt;&lt;br /&gt;Writing "sets X according to the database value" is far better than "this line of code sets X according to the value that was returned from the database", no doubt about it. However, how many times did you see a comment that said "sets X" and that's it? Writing those extra 5 words won't cost you more than a few seconds, and can save a lot of time to whoever it may be that will read your code in the future.&lt;br /&gt;It might even be you...&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;8. Not all comments must be operational&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Not all your comments need to describe exactly what happens in the next line.&lt;br /&gt;Comments like "don't forget to set variable X", "to activate these settings you must call function F" or "this code affects function F2" can sometimes be more helpful.&lt;br /&gt;&lt;br /&gt;Keep in mind that sometimes code segments are copy-pasted - not a best practice, but it happens a lot - and it could help to know which other places the copied code segment affects.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7. Don't leave dead code in comments&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If you don't need it, delete it. I know it's hard, but just let it go...&lt;br /&gt;&lt;br /&gt;If you have some brilliant piece of code you just have to keep for the next generations, just in case they will need to do something like that in some other place - you can put it on external documentation, write an email, or post it in your favorite forum. If it's not used, don't keep it in the code!&lt;br /&gt;&lt;br /&gt;If you suspect a line of code will be necessary in the very near future, you can leave it, but &lt;b&gt;explain&lt;/b&gt; what it does. Write a comment before the dead code that makes it crystal clear why you left it there.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. Beware of copy-pasted comments&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Come on, guys, this is the oldest trick in the book. We've all suffered from copy-pasted code gone bad. However, copy-pasted code gone bad usually get fixed quickly, since it's bound to be discovered sooner or later. Copy-pasted comments, on the other hand, just stay in the code and get rotten. &lt;br /&gt;&lt;br /&gt;You copy a block of code, with comments, and you just change the variables you need in the code, and you end up with a comment that has nothing to do with the code. The next time anyone will look at this code he wouldn't understand where the comment came from, so he might leave it as it is "just in case"...&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. Use correct language&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This is a problem especially with non-native English speakers, that must write their comments in English (such as myself).&lt;br /&gt;I don't expect the comments to demonstrate impeccable writing skills in a foreign language, but every one that has basic understanding of the language can tell the difference between "returns the X object if it exists" and "object X to return or null".&lt;br /&gt;&lt;br /&gt;Even if the comment can be understood without using proper English, it will take an extra second or two to understand it. It could also cause mistakes simply because the person who read the comment didn't understand it correctly. Not a life or death matter, but it is still very important.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Don't be afraid of repeating yourself&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Don't be afraid of repeating yourself. Over and over again, when necessary. The same sentence can appear in 4 different procedures, and maybe a couple of times in the same procedure. Remember, probably nobody will ever read your code like a storybook, as a whole. The reader will not mind that some comments repeat themselves. Sometimes the reader will only look at one part of your code, at one specific function.&lt;br /&gt;&lt;br /&gt;It's OK to write the meaning of a variable or parameter in the constructor, setter, and every function that use it. It's more than OK, it's better to do so than to write the meaning of the variable only once in some private function that is only used way down the call stack. This way the programmer will not need to drill down only to discover the meaning of a parameter he is using. &lt;br /&gt;&lt;br /&gt;So again, when commenting, don't be afraid of repeating yourself.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Don't be afraid to comment the obvious&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The important point here again is that nobody will read your code like a book. Nobody will be upset if you write a comment stating the obvious. The fact is for most programmers, even the most experienced, it is easier to read natural language than code. That's just the way the human mind works.&lt;br /&gt;&lt;br /&gt;Try to read this simple code and you will understand:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;private int multi(int a, int b)&lt;br /&gt;{&lt;br /&gt;   return a*b;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You could guess from the name that this function multiplies two numbers.&lt;br /&gt;However, you could not be sure until you read the whole function.&lt;br /&gt;If you read the following example instead:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;// This function multiplies two numbers&lt;br /&gt;private int multi(int a, int b)&lt;br /&gt;{&lt;br /&gt;   return a*b;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You only have to read the first line to understand it.&lt;br /&gt;If you have a comment for every couple of rows in your code, you don't have to delve into the code every time to understand it, you can find the part you need quickly.&lt;br /&gt;&lt;br /&gt;This example may seem a little silly, but this is the same for 5 rows long functions or 50 rows long functions, and hopefully you don't have functions much longer than that in your code :)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Comment the why, not only the how&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;OK, now we are getting serious. Whenever we comment a piece of code, we should not only comment what we are doing and how, we should also comment why we are doing what we are doing.&lt;br /&gt;&lt;br /&gt;I have a couple of way to comment this method:&lt;br /&gt;&lt;pre&gt;public MyClass(int myProp1, int myProp2, string myProp3)&lt;br /&gt;{&lt;br /&gt;   this._myProp1 = myProp1;&lt;br /&gt;   this._myProp2 = myProp2;&lt;br /&gt;   this._myProp3 = myProp3;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I could comment the how:&lt;br /&gt;&lt;pre&gt;// This is the constructor for class MyClass&lt;br /&gt;public MyClass(int myProp1, int myProp2, string myProp3)&lt;br /&gt;{&lt;br /&gt;   // initialize private properties&lt;br /&gt;   this._myProp1 = myProp1;&lt;br /&gt;   this._myProp2 = myProp2;&lt;br /&gt;   this._myProp3 = myProp3;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;But I better comment the why:&lt;br /&gt;&lt;pre&gt;// This is the constructor for class MyClass.&lt;br /&gt;// This class does this and that. &lt;br /&gt;// Classes that creates MyClass should do X, Y and Z.&lt;br /&gt;public MyClass(int myProp1, int myProp2, string myProp3)&lt;br /&gt;{&lt;br /&gt;   // initialize private properties:&lt;br /&gt;   // _myProp1 controls this behavior&lt;br /&gt;   this._myProp1 = myProp1;&lt;br /&gt;   // _myProp2 controls that behavior&lt;br /&gt;   this._myProp2 = myProp2;&lt;br /&gt;   // _myProp3 is displayed on screen when X happens.&lt;br /&gt;   // It can be omitted, and then the default message&lt;br /&gt;   // is displayed.&lt;br /&gt;   this._myProp3 = myProp3;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Isn't that a lot better? When reading this code, I know why I need to initialize myProp1 in the constructor, and what is the purpose of doing so.&lt;br /&gt;&lt;br /&gt;Commenting the &lt;b&gt;why&lt;/b&gt; is the key for good commenting. If you take only one thing from this post, take this. &lt;br /&gt;Programmers are not idiots. They can read code - and if they can't, it won't help no matter how much comments you give them. But a line of code cannot express the meaning or spirit of the whole program. This is why you should comment, to explain the place of this specific line of code in the overall stucture of your system.&lt;br /&gt;&lt;br /&gt;And now, for the number one tip of good commenting...&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Comment&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;...As opposed to "do not comment", of course.&lt;br /&gt;&lt;br /&gt;You know what they say, practice makes perfect - so start commenting today!&lt;br /&gt;&lt;br /&gt;Make it a habit to comment your code when you are writing it, not afterwards. It always helps to think a little before you code. So while you're at it, planning how your code will work and all the bits and bytes, you already know why you need to write this piece of code. You know it now, but tomorrow you may forget. Someone else that will look at the code will not know. So tell him why you wrote it, and what it is supposed to do.&lt;br /&gt;&lt;br /&gt;Believe me, before you know it you will not be able to code without commenting.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I hope this helps, and if a single helpful comment was born as a result of my post, my work here is done :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25948697-670310259907065193?l=hexygen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hexygen.blogspot.com/feeds/670310259907065193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25948697&amp;postID=670310259907065193' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/670310259907065193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/670310259907065193'/><link rel='alternate' type='text/html' href='http://hexygen.blogspot.com/2007/05/some-comments-about-commenting.html' title='Some Comments About Commenting'/><author><name>Yanir Kleiman</name><uri>http://www.blogger.com/profile/00844954059781925250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25948697.post-6960700073941184658</id><published>2007-01-20T21:49:00.000+02:00</published><updated>2007-01-20T22:13:39.656+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hebrew'/><title type='text'>מפנה מקום באייפוד לשירים שלך</title><content type='html'>אם ברי סחרוף היה כותב היום את השיר "מפנה מקום", מעניין אם הוא היה נשמע כך:&lt;br /&gt;&lt;br /&gt;אני מפנה מקום בנייד למספרים שלך&lt;br /&gt;מפנה מקום בדיסק למסמכים שלך&lt;br /&gt;מפנה מקום באייפוד לשירים שלך&lt;br /&gt;מפנה מקום במסך בשביל הרקע שלך&lt;br /&gt;אני מפנה מקום באימייל למכתבים שלך&lt;br /&gt;מפנה מקום במסנג'ר לחברים שלך&lt;br /&gt;מפנה מקום בבלוג לתגובות שלך&lt;br /&gt;&lt;br /&gt;כל כך הרבה מקום, ואת בשלך... את בשלך&lt;br /&gt;&lt;br /&gt;כל כך הרבה מקום&lt;br /&gt;את יכולה לעשות לוג-און&lt;br /&gt;ואם תהיי לגמרי שלי&lt;br /&gt;אני אצטרך לקנות עוד דיסק-און-קי&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;וובכן, מזל שהשיר הוקלט בשנת 1995 ולא 2005.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25948697-6960700073941184658?l=hexygen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hexygen.blogspot.com/feeds/6960700073941184658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25948697&amp;postID=6960700073941184658' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/6960700073941184658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/6960700073941184658'/><link rel='alternate' type='text/html' href='http://hexygen.blogspot.com/2007/01/blog-post.html' title='מפנה מקום באייפוד לשירים שלך'/><author><name>Yanir Kleiman</name><uri>http://www.blogger.com/profile/00844954059781925250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25948697.post-6176685106631804211</id><published>2006-11-15T16:21:00.000+02:00</published><updated>2006-11-15T17:04:21.824+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hebrew'/><title type='text'>פח הזבל של האנושות</title><content type='html'>הפסקתי לקרוא בלוגים.&lt;br /&gt;ניתקתי את האינטרנט.&lt;br /&gt;כיביתי את המחשב.&lt;br /&gt;&lt;br /&gt;יום אחד קמתי בבוקר ואמרתי "די!".&lt;br /&gt;די לפשפש בערימות הזבל, לזפזפ בין גרפומנים מקושקשים לאנשי דעת רהוטים, לקרוא עוד ועוד בלוגי מציאות, בלוגי כלכלה, בלוגי טכנולוגיה, בלוגי אמנות ובלוגי מדע וטבע.&lt;br /&gt;שוב ושוב אתה מוצא את עצמך בוהה במסך המרצד בשעות הקטנות של הלילה, תוהה לאן נעלמו להן שוב 3 או 4 שעות מחייך, וממלמל לעצמך בלחש "רק עוד אתר אחד קטן... רק עוד אחד".&lt;br /&gt;ההומור כבר אינו מצחיק, החדשות דרמטיות מדי, הריאליטי נדוש מדי, והדברים אותם אתה "לומד" בשיטוטים האינסופיים נעלמים מראשך באותה המהירות שבה מתעדכנים האתרים, כלומר מדי יום ביומו.&lt;br /&gt;&lt;br /&gt;והפרסומות, אלוהים, הפרסומות!&lt;br /&gt;קופצות עליך בין כל קליק לקליק, אורבות לך בנבכי האתרים, מפמפמות לך במוח באופן בלתי פוסק, ואתה, כארנב שנלכד באורם של פנסי המכונית, בוהה ובוהה וממשיך לחפש באופן נואש את הכפתור הקטן הזה עם האיקס.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;מכירים את אלו?&lt;br /&gt;בטח, כל אחד מכיר אותם.&lt;br /&gt;"הפסקתי לראות טלויזיה", הם אומרים.&lt;br /&gt;"התנתקתי מהכבלים!", הם מכריזים (מיד לפני שהם מצהירים שסחבק - ישראלי או לא? - מוריד את כל התוכניות שהוא הכי אוהב בחינם לגמרי בפרד האלקטרוני).&lt;br /&gt;"נמאס כבר מהפרסומות", הם מתלוננים, ובצדק.&lt;br /&gt;"הזבל שמציף אתכם מבוקר עד ליל ומזהם לכם את השכל", קורא לזה &lt;a href="http://www.notes.co.il/dror/24340.asp"&gt;דרור פויר&lt;/a&gt;, בעוד הוא עצמו שוקד על הוספת תכנים (משובחים ככל שיהיו) לפח הזבל הגדול של האנושות, פח הזבל שאיש אינו טורח לרוקנו, פח הזבל שכל אדם יכול לצקת בו תוכן ללא כל הכשרה רשמית או גוף מכוון, פח הזבל שאותו לא מתסרטים, לא עורכים, לא מגיהים ובוודאי לא מסננים.&lt;br /&gt;&lt;br /&gt;חלק גדול &lt;a href="http://www.weboptimiser.com/search_engine_marketing_news/13036168.html"&gt;מ 12 מיליארד&lt;/a&gt; או יותר העמודים באינטרנט - בערך פי 2 ממספר האנשים בעולם, כולל אפילו את נמיביה - נכתב בידי אנשים משכילים ובעלי כשרון, ומהווה באופן כללי מה שאדם בר דעת היה בוודאי מכנה כ"לא זבל".&lt;br /&gt;טוב, נו, אולי לא חלק גדול. חלק קטן. קטן מאוד. מזערי.&lt;br /&gt;&lt;br /&gt;ועם זאת, אפשרי ואפילו רצוי לצרוך במידה מסוימת את אותו חלק קטן של תרבות אינטרנטית איכותית, כשם שאנו צורכים מדיות אחרות כגון מוזיקה, קולנוע, תיאטרון וספרות.&lt;br /&gt;&lt;br /&gt;אז לא, אני עדיין לא ויתרתי על הבלוגים.&lt;br /&gt;לא ניתקתי את האינטרנט ולא כיביתי את "מכשיר הטמטום" של המאה ה 21, המחשב.&lt;br /&gt;כשם שלא ניתקתי את הלווין, לא כיביתי את הטלויזיה ולא הוצאתי אותה מן הבית.&lt;br /&gt;&lt;br /&gt;את הסינון בין טוב ורע, בין מועיל ומזיק, בין ניצול זמן ובזבוז זמן, אני כבר אצטרך לעשות בעצמי - מה לעשות, החיים קשים בשנות האלפיים.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25948697-6176685106631804211?l=hexygen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hexygen.blogspot.com/feeds/6176685106631804211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25948697&amp;postID=6176685106631804211' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/6176685106631804211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/6176685106631804211'/><link rel='alternate' type='text/html' href='http://hexygen.blogspot.com/2006/11/blog-post.html' title='פח הזבל של האנושות'/><author><name>Yanir Kleiman</name><uri>http://www.blogger.com/profile/00844954059781925250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25948697.post-115715615207452351</id><published>2006-09-02T01:52:00.000+03:00</published><updated>2007-05-24T10:20:30.636+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='English'/><title type='text'>Bidirectional Blogging</title><content type='html'>When starting this blog, I was really concerned about writing a blog in two languages - English and Hebrew. As the title suggests, the problem is not using two different languages but actually writing in two different &lt;B&gt;directions&lt;/B&gt; - left to right and right to left.&lt;br /&gt;&lt;br /&gt;Unfortunately, searching the web for a little while yields no real solution for us bidirectional bloggers out there (I can only assume the Arabic blog scene propose no solution either).&lt;br /&gt;I am sure some bloggers have sorted this out by themselves, while the others chose to align all of their posts to one direction or the other, regardless of the language they are written in. Another easy solution could be starting a different blog for each language. But that wasn't good enough for me.&lt;br /&gt;&lt;br /&gt;The Blogger system, as I suppose other blogging platforms as well, provides the blogger with almost absolute control over the graphic design and layout of the page. It is done by means of a "Template" which is basically some html code with special tags inside, which is actually very similar to web scripting languages like ASP.&lt;br /&gt;&lt;br /&gt;I was very pleased to find out Blogger allows javascript code to run from within the template, which among other things can solve this problem for all you bidirectional bloggers.&lt;br /&gt;&lt;br /&gt;So, let's say you want to align every post with English text in it to the left, and any other post to the right. Here's how you do it:&lt;br /&gt;First, start editing your template.&lt;br /&gt;Then search for the special tag which looks like this: &lt;pre&gt;&amp;lt;$BlogItemBody$&amp;gt;&lt;/pre&gt;Usually this tag is contained by a &amp;lt;p&amp;gt; tag, a &amp;lt;div&amp;gt; tag, or both. One of these containing tags probably has a class name used for graphic design purposes. In the template I worked on, that class name was "post-body". I assume this is the case in most templates.&lt;br /&gt;The class name we found is the class we need to change from left to right or right to left.&lt;br /&gt;For this you need to add the following piece of code to the end of the template:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;script language="javascript"&amp;gt;&lt;br /&gt;&lt;br /&gt;window.onload = applyRTL;&lt;br /&gt;&lt;br /&gt;// This fucntion applies right-to-left style to posts&lt;br /&gt;// that contains hebrew:&lt;br /&gt;function applyRTL()&lt;br /&gt;{&lt;br /&gt; var arrDivs = document.getElementsByTagName("DIV");&lt;br /&gt; var i;&lt;br /&gt; var divPostBody;&lt;br /&gt;&lt;br /&gt; for (i = 0; i &lt; arrDivs.length; i++)&lt;br /&gt; {&lt;br /&gt;  divPostBody = arrDivs[i];&lt;br /&gt;  &lt;br /&gt;  if (divPostBody.className.toLowerCase() == 'post-body')&lt;br /&gt;  {&lt;br /&gt;   if (divPostBody.innerHTML.search(/[a-z]/) &gt; -1)&lt;br /&gt;   {&lt;br /&gt;    divPostBody.style.direction = "ltr";&lt;br /&gt;    divPostBody.style.textAlign = "left";&lt;br /&gt;   }&lt;br /&gt;   else&lt;br /&gt;   {&lt;br /&gt;    divPostBody.style.direction = "rtl";&lt;br /&gt;    divPostBody.style.textAlign = "right";&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;This code will execute once the page and all of the posts in it were loaded, and will make every post that contains hebrew letters right-to-left and every other post left-to-right.&lt;br /&gt;In case the class name from above is different in your template, change 'post-body' in the line:&lt;br /&gt;&lt;pre&gt;  if (divPostBody.className.toLowerCase() == 'post-body')&lt;/pre&gt;to the name of the class in your template. &lt;br /&gt;&lt;br /&gt;Since what that code does is basically search your posts for specific letters, you can change it to search for specific phrases and change the appearance of your posts according to their content.&lt;br /&gt;&lt;br /&gt;Using client-side scripts inside your blog can do a lot of other cool stuff - any ideas anyone?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25948697-115715615207452351?l=hexygen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hexygen.blogspot.com/feeds/115715615207452351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25948697&amp;postID=115715615207452351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/115715615207452351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/115715615207452351'/><link rel='alternate' type='text/html' href='http://hexygen.blogspot.com/2006/09/bidirectional-blogging.html' title='Bidirectional Blogging'/><author><name>Yanir Kleiman</name><uri>http://www.blogger.com/profile/00844954059781925250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25948697.post-115479139842323424</id><published>2006-08-05T17:58:00.001+03:00</published><updated>2006-11-14T22:43:42.535+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='English'/><title type='text'>New Google Service</title><content type='html'>I've managed to put my hands on some top secret images of a very interesting new Google service... (enlarge for details)&lt;br /&gt;&lt;br /&gt;I'll be the first one to sign up!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7636/2716/1600/GBank%20-%20Incomes.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7636/2716/400/GBank%20-%20Incomes.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7636/2716/1600/GBank%20-%20Debts.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7636/2716/400/GBank%20-%20Debts.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7636/2716/1600/GBank%20-%20Savings.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7636/2716/400/GBank%20-%20Savings.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope you all enjoy it as much as I did :)&lt;br /&gt;Yanir&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25948697-115479139842323424?l=hexygen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hexygen.blogspot.com/feeds/115479139842323424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25948697&amp;postID=115479139842323424' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/115479139842323424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/115479139842323424'/><link rel='alternate' type='text/html' href='http://hexygen.blogspot.com/2006/08/new-google-service.html' title='New Google Service'/><author><name>Yanir Kleiman</name><uri>http://www.blogger.com/profile/00844954059781925250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25948697.post-115135141689730692</id><published>2006-06-26T22:36:00.000+03:00</published><updated>2006-11-14T22:43:42.405+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hebrew'/><title type='text'>רוג'ר, מאחוריך</title><content type='html'>אז יצאנו מה&lt;a href="http://mitkadem.homestead.com/files/events/rogerwaters2006/"&gt;הופעה&lt;/a&gt;, עייפים אך מרוצים עד מאוד.&lt;br /&gt;הייתה אחלה הופעה, עמדנו במיקום מצוין והסאונד היה מדהים - והשירים גדולים כפי שתמיד היו ותמיד יהיו.&lt;br /&gt;&lt;br /&gt;הגענו לרכב ב 12:30, ופתחנו את הרדיו בפקקים.&lt;br /&gt;כמובן שמיד חיפשנו תחנות שמדברות על ההופעה שזה עתה נגמרה, כי תמיד כיף לשמוע על עצמך ברדיו. רצה הגורל ונחתנו על תוכניתו של ניסים גרמה ברשת ב'.&lt;br /&gt;&lt;br /&gt;ניסים מאוד התעניין בשמועות על השימוש של רוג'ר ווטרס בפלייבק במהלך ההופעה, בכדי לכסות על יכולות השירה שלו שידעו ימים יפים יותר.&lt;br /&gt;שוחח ניסים עם מעין כתב מן השטח, ש"גם הוא זמר" לדבריו (כמובן שמעולם לא שמעתי את שמו). הזמר הלא ידוע אישר שאמנם לא שמו לב וזה היה עשוי היטב, אך בשיר אחד הוא הבחין בכך שייתכן וזהו פלייבק.&lt;br /&gt;&lt;br /&gt;וכך ניסים גרמה:&lt;br /&gt;&lt;B&gt;&lt;br /&gt;"אני לא יודע אם הוא באמת השתמש בפלייבק, אבל אם כן הוא צריך להתבייש בעצמו. זה לא רציני".&lt;br /&gt;&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;וובכן, רוג'ר, תתבייש לך.&lt;br /&gt;כנראה שיש לך עוד מה ללמוד כדי להגיע לסטנדרט הגבוה שדרוש כדי להצליח בארץ.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25948697-115135141689730692?l=hexygen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hexygen.blogspot.com/feeds/115135141689730692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25948697&amp;postID=115135141689730692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/115135141689730692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/115135141689730692'/><link rel='alternate' type='text/html' href='http://hexygen.blogspot.com/2006/06/blog-post.html' title='רוג&apos;ר, מאחוריך'/><author><name>Yanir Kleiman</name><uri>http://www.blogger.com/profile/00844954059781925250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25948697.post-114583202854531237</id><published>2006-04-24T01:37:00.000+03:00</published><updated>2006-11-14T22:43:42.327+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='English'/><title type='text'>Why Google is the Next Big Thing</title><content type='html'>Why is Google the next big thing?&lt;br /&gt;Because Google has the three U's that will make it the number one software company in the world.&lt;br /&gt;&lt;br /&gt;The first U stands for &lt;B&gt;Understanding&lt;/B&gt;.&lt;br /&gt;&lt;br /&gt;Google understands the future.&lt;br /&gt;&lt;br /&gt;Billions of people today use Google software through their PC's or PDA's,&lt;br /&gt;but Google understands this is only the very beginning. In the future, the number of devices that are connected to the internet will grow in such a way today's numbers will be negligible. It has already started with internet on cell phones, and it will continue with internet connections in your car, in your TV, in your radio, and even in your fridge. Think about it, you switch the channel on TV a lot more often then you search for something on the web. Can you imagine those little Google Ads appearing under the show details on cable TV? I sure can.&lt;br /&gt;So if you think Google is already "the big thing", think again.&lt;br /&gt;&lt;br /&gt;Google also understands that information is everything.&lt;br /&gt;&lt;br /&gt;Google's mission is to organize the world's information.&lt;br /&gt;Google understands that you can easily take out the word "information" and say the exact same thing: their mission is to organize the world.&lt;br /&gt;What is the information Google talks about?&lt;br /&gt;The answer to that question is somewhat similar to the answer to "what is the matrix" - information is all around you. You can see it when you look out the window, when you turn on your TV, when you pay your taxes.&lt;br /&gt;Today Google organizes your web content, your e-mail, and even your calendar. In the future they can organize your taxes, your cable TV, and even your fridge.&lt;br /&gt;&lt;br /&gt;Okay, understanding what the world is all about and what it will be like in the future is important, but that's an understanding a lot of us share, and by itself it's clearly not enough to become the next big thing.&lt;br /&gt;&lt;br /&gt;The second U stands for &lt;B&gt;Unification&lt;/B&gt;.&lt;br /&gt;&lt;br /&gt;Google works hard to unify its services, a task it probably learned (and learned well) from its sworn enemy nowadays, Microsoft.&lt;br /&gt;This unification means that everything you can do with Google services is connected to every other thing you can do with other Google services. It means that if I want to search my e-mail, it's as easy as searching the web with Google. It means that if I want to set a meeting with my friend all I have to do is e-mail him using my Gmail account and add a little note in my Google calendar. It means that if I want to chat with my friend online before sending the e-mail, I don't have to use a different software. It means that if I need to find some detail he mentioned during that chat I can search my mailbox the same way I search any other e-mail.&lt;br /&gt;&lt;br /&gt;It eventually means that it is going to be easier for a user to use Google software instead of using lots of different services that don't fit together as nicely.&lt;br /&gt;&lt;br /&gt;Unification is one of the major principles that got Microsoft to where it is today.&lt;br /&gt;It is easier for the user to use Word, Excel, and Windows Media Player, simply because he is using Windows, and they go so well together - and it will probably take Google just as far.&lt;br /&gt;&lt;br /&gt;The last U stands for &lt;B&gt;Usability&lt;/B&gt;.&lt;br /&gt;&lt;br /&gt;Google has a unique approach to usability.&lt;br /&gt;Back in the 90's, Microsoft used to be the kings of usability.&lt;br /&gt;Their software was simply the easiest to use, and that is the number one reason everybody uses Microsoft Windows today. When we migrated from Oracle database to Microsoft SQL Server, it was such a relief! It was amazing to see how much easier it was to work with Microsoft products. There are other consideration of course for working (or not working) with Microsoft products, such as reliability or efficiency&lt;br /&gt; - but that's a different discussion.&lt;br /&gt;The point is, Microsoft products were always so simple to work with, and for the average user, that's enough. And guess what - it turns out there are a lot more average users than linux geeks out there...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So why can't Microsoft keep up with Google?&lt;br /&gt;Because usability is not what it used to be.&lt;br /&gt;Usability today doesn't only mean that it's easy to use the product.&lt;br /&gt;Usability for me is that I have 2.7 GB of storage in my Gmail account, instead of 2 MB in my previous hotmail account. It means that 99% of the junk mail I recieve is going automatically into my junk mail folder, instead of only about 50% in my previous hotmail account. It means that it's easier for me to type only the first few letters and not the full address of my reciepent. It means that it's easier for me to quickly type "Status meeting next wednesday 9:00" in Google calendar than it is to search for the right time in my outlook.&lt;br /&gt;&lt;br /&gt;That is why today Google products are much more usable than Microsoft products (or any other company), and that is why I believe they will win the fight over the internet.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Google is doing what every other internet software company is doing (or at least trying to do).&lt;br /&gt;Simply put, they are doing it better.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25948697-114583202854531237?l=hexygen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hexygen.blogspot.com/feeds/114583202854531237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25948697&amp;postID=114583202854531237' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/114583202854531237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/114583202854531237'/><link rel='alternate' type='text/html' href='http://hexygen.blogspot.com/2006/04/why-google-is-next-big-thing.html' title='Why Google is the Next Big Thing'/><author><name>Yanir Kleiman</name><uri>http://www.blogger.com/profile/00844954059781925250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25948697.post-114485730304645880</id><published>2006-04-12T18:42:00.000+03:00</published><updated>2006-11-14T22:43:42.262+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hebrew'/><title type='text'>Resistance is Futile</title><content type='html'>מעטים יודעים זאת, אך אי שם בתחילת הרבעון השני של שנת 2006 המציא בחור צעיר, ככל הנראה ממוצא איטלקי, את האנטי-בלוג.&lt;br /&gt;&lt;br /&gt;האנטי-בלוג הוא אוסף של מידע חדש ומעניין.&lt;br /&gt;הוא כתוב ללא הומור, אך רק במידה הנכונה.&lt;br /&gt;הוא כתוב באופן מאוד פורמלי, ומאוד לא אישי.&lt;br /&gt;הוא אינו מכיל קישורים לאנטי-בלוגים נוספים.&lt;br /&gt;הוא אינו מכיל תגובות לאנטי-פוסטים של אנטי-בלוגרים אחרים.&lt;br /&gt;באנטי-בלוג אין משחקי מילים.&lt;br /&gt;אין בו הצהרות פוליטיות.&lt;br /&gt;אין בו דבר המרמז על דעותיו של הכותב או תחומי העניין שלו,&lt;br /&gt;וחשוב מכל, אין באנטי-בלוג דבר המוכיח את יכולת הכותב המדהימה להתבטא בכתב.&lt;br /&gt;האנטי-בלוג אינו מהווה חלק מן "הקהילה".&lt;br /&gt;&lt;br /&gt;לצערנו, ברגע עליית האנטי-בלוג לאוויר, חלה התנגשות בלתי נמנעת עם הבלוגוספירה הישראלית.&lt;br /&gt;מאחר וכידוע בלוג ואנטי-בלוג נוהגים לפתח אלרגיות חמורות זה לזה, לא איחרה לבוא התפוצצות קוסמית שמחקה לחלוטין את האנטי-בלוג מן הקיום האנושי.&lt;br /&gt;&lt;br /&gt;הצעיר, ככל הנראה ממוצא איטלקי, משך בכתפיו והמציא את האנטי-פסטי במקום.&lt;br /&gt;&lt;br /&gt;בלוג זה לא יהיה שונה מבלוגים אחרים שקראתם.&lt;br /&gt;הוא יהיה, ככל הנראה, אוסף של מידע ישן ומשעמם.&lt;br /&gt;הוא יהיה כתוב בהומור, אך רק במידה הנכונה.&lt;br /&gt;הוא יהיה כתוב באופן אישי ולא פורמלי.&lt;br /&gt;כנראה שיכיל קישורים לבלוגים נוספים.&lt;br /&gt;כנראה שיכיל אף תגובות לפוסטים של בלוגרים אחרים.&lt;br /&gt;קרוב לוודאי שיהיו בו משחקי מילים.&lt;br /&gt;הצהרות פוליטיות? אולי.&lt;br /&gt;הוא כנראה ירמוז על דעותיו של הכותב או תחומי העניין שלו,&lt;br /&gt;ואף יוכיח את יכולת הכותב המדהימה להתבטא בכתב.&lt;br /&gt;ועם קצת מזל, הבלוג אפילו יהווה חלק מן "הקהילה".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25948697-114485730304645880?l=hexygen.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hexygen.blogspot.com/feeds/114485730304645880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25948697&amp;postID=114485730304645880' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/114485730304645880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25948697/posts/default/114485730304645880'/><link rel='alternate' type='text/html' href='http://hexygen.blogspot.com/2006/04/resistance-is-futile.html' title='Resistance is Futile'/><author><name>Yanir Kleiman</name><uri>http://www.blogger.com/profile/00844954059781925250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
