<?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:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-566335258997766011</id><updated>2010-05-15T12:39:34.831-07:00</updated><title type='text'>Arindam's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://maxarindam.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566335258997766011/posts/default'/><link rel='alternate' type='text/html' href='http://maxarindam.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Max</name><uri>http://www.blogger.com/profile/06472183758666225659</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-566335258997766011.post-4634800766771592632</id><published>2010-05-15T12:34:00.000-07:00</published><updated>2010-05-15T12:36:53.584-07:00</updated><title type='text'>You Don’t Know Anything About Regular Expressions: A Complete Guide</title><content type='html'>&lt;p&gt; Regular expressions can be scary…really scary. Fortunately, once you memorize what each symbol represents, the fear quickly subsides. If you fit the title of this article, there’s much to learn! Let’s get started. &lt;/p&gt; &lt;p&gt;&lt;span id="more-7869"&gt;&lt;/span&gt;&lt;/p&gt; &lt;h3&gt;Section 1: Learning the Basics&lt;/h3&gt; &lt;p&gt;The key to learning how to effectively use regular expressions is to just take a day and memorize all of the symbols. This is the best advice I can possibly offer. Sit down, create some flash cards, and just memorize them! Here are the most common: &lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;. &lt;/strong&gt; – Matches any character, except for line breaks if dotall is false. &lt;/li&gt;&lt;li&gt;&lt;strong&gt; * &lt;/strong&gt; – Matches 0 or more of the preceding character. &lt;/li&gt;&lt;li&gt;&lt;strong&gt; + &lt;/strong&gt; – Matches 1 or more of the preceding character. &lt;/li&gt;&lt;li&gt;&lt;strong&gt; ? &lt;/strong&gt; – Preceding character is optional. Matches 0 or 1 occurrence. &lt;/li&gt;&lt;li&gt;&lt;strong&gt; \d &lt;/strong&gt; – Matches any single digit &lt;/li&gt;&lt;li&gt;&lt;strong&gt; \w &lt;/strong&gt; – Matches any word character (alphanumeric &amp;amp; underscore). &lt;/li&gt;&lt;li&gt;&lt;strong&gt; [XYZ] &lt;/strong&gt; – Matches any single character from the character class. &lt;/li&gt;&lt;li&gt;&lt;strong&gt; [XYZ]+ &lt;/strong&gt; – Matches one or more of any of the characters in the set.  &lt;/li&gt;&lt;li&gt;&lt;strong&gt; $ &lt;/strong&gt; – Matches the end of the string. &lt;/li&gt;&lt;li&gt;&lt;strong&gt; ^ &lt;/strong&gt; – Matches the beginning of a string. &lt;/li&gt;&lt;li&gt;&lt;strong&gt; [^a-z] &lt;/strong&gt; – When inside of a character class, the ^ means NOT; in this case, match anything that is NOT a lowercase letter. &lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Yep – it’s not fun, but just memorize them. You’ll be thankful if you do! &lt;/p&gt; &lt;h4&gt;Tools &lt;/h4&gt; &lt;p&gt;You can be certain that you’ll want to rip your hair out at one point or another when an expression doesn’t work, no matter how much it should – or you think it should! Downloading the &lt;a href="http://gskinner.com/RegExr/"&gt;RegExr Desktop app&lt;/a&gt; is essential, and is really quite fun to fool around with. In addition to real-time checking, it also offers a sidebar which details the definition and usage of every symbol. &lt;a href="http://gskinner.com/RegExr/"&gt;Download it!&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt;&lt;h3&gt;Section 2: Regular Expressions for Dummies: Screencast Series &lt;/h3&gt; &lt;p&gt; The next step is to learn how to actually use these symbols! If video is your preference, you’re in luck! Watch the five lesson video series, &lt;a href="http://net.tutsplus.com/videos/screencasts/regular-expressions-for-dummies-screencast-series/"&gt;“Regular Expressions for Dummies.”&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Read the full article &lt;a href="http://net.tutsplus.com/tutorials/javascript-ajax/you-dont-know-anything-about-regular-expressions/"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566335258997766011-4634800766771592632?l=maxarindam.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxarindam.blogspot.com/feeds/4634800766771592632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=566335258997766011&amp;postID=4634800766771592632' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566335258997766011/posts/default/4634800766771592632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566335258997766011/posts/default/4634800766771592632'/><link rel='alternate' type='text/html' href='http://maxarindam.blogspot.com/2010/05/you-dont-know-anything-about-regular.html' title='You Don’t Know Anything About Regular Expressions: A Complete Guide'/><author><name>Max</name><uri>http://www.blogger.com/profile/06472183758666225659</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02468214196981006729'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566335258997766011.post-8389142272009480764</id><published>2008-06-27T06:33:00.000-07:00</published><updated>2008-06-27T06:39:56.997-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vertical align for navigation lists with multiple lines'/><title type='text'>Minimum Width for a Page</title><content type='html'>&lt;p&gt;A very handy CSS command that exists is the min-width command, whereby you can specify a minimum width for any element. This can be particularly useful for specifying a minimum width for a page.&lt;/p&gt;  &lt;p&gt;Unfortunately, IE doesn't understand this command, so we'll need to come up with a new way of making this functionality work in this browser. First, we'll insert a &lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;div&gt; under the &lt;code&gt;&lt;/code&gt; tag, as we can't assign a minimum width to the &lt;code&gt;&lt;/code&gt;:&lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;&lt;div class="container"&gt;&lt;p&gt;&lt;/p&gt;  &lt;p&gt;Next, we create our CSS commands, to create a minimum width of 600px:&lt;/p&gt;  &lt;p&gt;&lt;code&gt;#container&lt;br /&gt;{&lt;br /&gt;min-width: 600px;&lt;br /&gt;width:expression(document.body.clientWidth &lt;&gt;&lt;/p&gt;  &lt;p&gt;The first command is the regular minimum width command; the second is a short &lt;a href="http://www.sitepoint.com/glossary.php?q=J#term_9" class="glossary" title="JavaScript is a Web scripting language most commonly used for client-side applications."&gt;JavaScript&lt;/a&gt; command that only IE understands. Do note, though, that this command will cause your CSS document to become invalid; you may prefer to insert it into the head of each HTML document to get around this.&lt;/p&gt;  &lt;p&gt;You might also want to combine this minimum width with a maximum width:&lt;/p&gt;  &lt;p&gt;&lt;code&gt;#container&lt;br /&gt;{&lt;br /&gt;min-width: 600px;&lt;br /&gt;max-width: 1200px;&lt;br /&gt;width:expression(document.body.clientWidth &lt;&gt; 1200? "1200px" : "auto");&lt;br /&gt;}&lt;/code&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566335258997766011-8389142272009480764?l=maxarindam.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxarindam.blogspot.com/feeds/8389142272009480764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=566335258997766011&amp;postID=8389142272009480764' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566335258997766011/posts/default/8389142272009480764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566335258997766011/posts/default/8389142272009480764'/><link rel='alternate' type='text/html' href='http://maxarindam.blogspot.com/2008/06/minimum-width-for-page.html' title='Minimum Width for a Page'/><author><name>Max</name><uri>http://www.blogger.com/profile/06472183758666225659</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02468214196981006729'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566335258997766011.post-1181690988957553824</id><published>2008-06-27T06:27:00.000-07:00</published><updated>2008-06-27T06:32:54.194-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Design Tips and Tricks'/><title type='text'>Making web pages extend to the bottom of the browser window</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;  &lt;p&gt;If you ever made a web site with the content in a center column and a different background for the body, or with a short lateral navigation bar, probably you experienced the problem of some elements not extending to the bottom of the browser window when the height of the content is lesser than the document area of the browser window.&lt;/p&gt;  &lt;p&gt;For simple designs, like pages with a side navigation bar and the rest of the page for contents, &lt;a href="http://www.ampsoft.net/webdesign-l/making-web-pages-extend-to-bottom-fake-background.html"&gt;faking the layout with a background image&lt;/a&gt; can be enough to fix the problem, but for more complex layouts real full height element usually are required. For that cases we can resort to JavaScript to perform some DOM manipulation magic.&lt;/p&gt;    &lt;h2&gt;The CSS layout&lt;/h2&gt;  &lt;p&gt;I'm going to use a layout with one fixed-width centered content area, a menu at the top of it and some decorations at the top and bottom of the content area. Let's take a look to the CSS code:&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;body {&lt;br /&gt;padding: 0;&lt;br /&gt;margin: 0;&lt;br /&gt;background: White url(img/img_116.gif);&lt;br /&gt;text-align: center; /* IE 5.x */&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#menu {&lt;br /&gt;width: 650px; /* IE 5.x */&lt;br /&gt;width/**/:/**/ 610px;&lt;br /&gt;margin: 0 auto;&lt;br /&gt;padding: 10px 20px;&lt;br /&gt;background: transparent url(img/sample-menu-border.gif) repeat-y left top;&lt;br /&gt;text-align: left;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#contents {&lt;br /&gt;position: relative;&lt;br /&gt;width: 650px; /* IE 5.x */&lt;br /&gt;width/**/:/**/ 500px;&lt;br /&gt;margin: 0 auto;&lt;br /&gt;padding: 50px 75px 30px;&lt;br /&gt;background: transparent url(img/sample-contents-border.gif) repeat-y left top;&lt;br /&gt;text-align: justify;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;p&gt;You can see a couple of examples of &lt;a href="http://www.ampsoft.net/webdesign-l/making-web-pages-extend-to-bottom-example1.html"&gt;a page with a lot of content&lt;/a&gt; and &lt;a href="http://www.ampsoft.net/webdesign-l/making-web-pages-extend-to-bottom-example2.html"&gt;a page with very few content&lt;/a&gt;. If you are wondering about the "&lt;span class="attrib"&gt;/**/:/**/&lt;/span&gt;", it's &lt;a href="http://www.sitepoint.com/article/top-ten-css-tricks" class="external" target="_blank"&gt;an alternative fancy method to the box model hack&lt;/a&gt;. &lt;/p&gt;    &lt;h2&gt;Fixing the layout&lt;/h2&gt;  &lt;p&gt;The JavaScript fix involves getting the size of the document element and the container we want to resize (in this case &lt;span class="tag"&gt;#contents&lt;/span&gt;), and the position of this element. There is no standard DOM attribute for this, but almost all browsers support the &lt;span class="attrib"&gt;offsetHeight&lt;/span&gt; and &lt;span class="attrib"&gt;offsetTop&lt;/span&gt; attributes (although Opera needs a bit of tweaking for getting the height of the document).&lt;/p&gt;  &lt;p&gt;Then we compare the size of the target element (&lt;span class="tag"&gt;#contents&lt;/span&gt;) with the size of the document minus the top offset of that element. If it's smaller, then a style rule with the proper height is applied to &lt;span class="tag"&gt;#contents&lt;/span&gt; (making a difference for IE 5.x due to its broken box model). Also, the code is attached to the &lt;span class="attrib"&gt;onresize&lt;/span&gt; event for readjusting the size if the user makes the browser window bigger.&lt;/p&gt;  &lt;p&gt;The resulting JavaScript code would be something like this:&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;var isIE5=navigator.userAgent.toUpperCase().indexOf("MSIE 5")!=-1;&lt;br /&gt;&lt;br /&gt;var &lt;strong&gt;targetElementID="contents"&lt;/strong&gt;, &lt;strong&gt;targetElementStyleOffset=80&lt;/strong&gt;;&lt;br /&gt;&lt;br /&gt;function adjustHeight() {&lt;br /&gt;if (document.getElementById) {&lt;br /&gt;  var targetElement=document.getElementById(targetElementID),&lt;br /&gt;      documentHeight, totalOffset;&lt;br /&gt;&lt;br /&gt;  if (targetElement &amp;amp;&amp;amp; document.documentElement.offsetHeight&lt;br /&gt;      &amp;amp;&amp;amp; targetElement.offsetHeight &amp;amp;&amp;amp; targetElement.offsetTop) {&lt;br /&gt;    documentHeight=document.documentElement.offsetHeight;&lt;br /&gt;    if (targetElement.offsetHeight&lt;documentheight-targetelement.offsettop) if="" else="" totaloffset="targetElement.offsetTop;" height="String(documentHeight-totalOffset)+'px';" onresize="adjustHeight;" onload="adjustHeight;"&gt;&lt;/documentheight-targetelement.offsettop)&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;p&gt;Also, for making the script work in Opera 8 and Konqueror 3.4 we need to set the height of the &lt;span class="tag"&gt;html&lt;/span&gt; element to 100%:&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;html {&lt;br /&gt;height: 100%;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;   &lt;p&gt;For using the code you only need to modify two values and include a call to the function. First, you need to change the values that appear in bold in the script to reflect the following data:&lt;/p&gt;  &lt;ol&gt;&lt;li&gt;The ID of the element that need to be extended (&lt;span class="tag"&gt;#contents&lt;/span&gt; in the previous example, so we'll   use the string &lt;span class="attrib"&gt;"contents"&lt;/span&gt;).&lt;/li&gt;&lt;li&gt;The vertical offset generated by the styles applied to the element (&lt;span class="attrib"&gt;margin&lt;/span&gt;,   &lt;span class="attrib"&gt;padding&lt;/span&gt; and &lt;span class="attrib"&gt;border&lt;/span&gt;). In the example we have:&lt;br /&gt; &lt;pre&gt;&lt;code&gt;padding: 50px 75px 30px;&lt;br /&gt;margin: 0 auto;&lt;/code&gt;&lt;/pre&gt;   so we use &lt;span class="attrib"&gt;80&lt;/span&gt; for the style offset. This offset is not applied to   IE 5.x due to its broken box model. See the notes below for an explanation of this.&lt;/li&gt;&lt;/ol&gt;  &lt;p&gt;For activating the script, we can use the &lt;code&gt;onload&lt;/code&gt; event, but the best method is including also a call to the &lt;code&gt;adjustHeight()&lt;/code&gt; function just before closing the &lt;span class="tag"&gt;body&lt;/span&gt; tag, like:&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;&lt;script type="text/javascript"&gt;adjustHeight();&lt;/script&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;p&gt;This usually works fine since all the DOM objects are already defined at that point, and it's much faster that using the &lt;code&gt;onload&lt;/code&gt; event, because this event doesn't trigger until all the page is loaded (images and ads included). Anyway, assigning the function to the event ensures that the function will be called.&lt;/p&gt;  &lt;p&gt;Following the next link you can see an example of &lt;a href="http://www.ampsoft.net/webdesign-l/making-web-pages-extend-to-bottom-example3.html"&gt;the page with the JS fix applied&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The script works in Firefox/Mozilla, Internet Explorer 5/6/7, Opera 7/8, Konqueror 3.4, Safari and Omniweb (thanks to Stephen Caudill for the Mac feedback), which adds a nice 99% of the current browser pool :-) .&lt;/p&gt;    &lt;a name="notes"&gt;&lt;/a&gt;&lt;h2&gt;Notes and limitations&lt;/h2&gt;  &lt;ul&gt;&lt;li&gt;If you need to apply any padding and/or margin to the container you want to resize, you have to express it in   pixels, since the script needs that value for setting the proper height. Since the box model doesn't include   padding and margin in the dimensions of the boxes, and I was unable to find a reliable way to get the margin and padding   values from JS, this manual workaround is needed.&lt;/li&gt;&lt;li&gt;The script doesn't downsize the target container, only enlarges it. Take into account that the goal of the script   is getting a page that extend &lt;em&gt;at least&lt;/em&gt; to the bottom of the browser window, not a page that fits always   in the browser document area.&lt;/li&gt;&lt;li&gt;The script doesn't work when the user changes the base font size in the browser after the page is loaded. Simply   there is no JS event to catch this. Anyway, the next time the page is loaded with the new size, the script will work   fine.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566335258997766011-1181690988957553824?l=maxarindam.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxarindam.blogspot.com/feeds/1181690988957553824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=566335258997766011&amp;postID=1181690988957553824' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566335258997766011/posts/default/1181690988957553824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566335258997766011/posts/default/1181690988957553824'/><link rel='alternate' type='text/html' href='http://maxarindam.blogspot.com/2008/06/making-web-pages-extend-to-bottom-of.html' title='Making web pages extend to the bottom of the browser window'/><author><name>Max</name><uri>http://www.blogger.com/profile/06472183758666225659</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02468214196981006729'/></author><thr:total>0</thr:total></entry></feed>