<?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:blogger='http://schemas.google.com/blogger/2008' 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-5076461344159269131</id><updated>2024-09-08T05:29:47.092-05:00</updated><category term="MentalNotes"/><category term="jQuery plugin"/><category term="jQuery"/><category term="Excel"/><category term="JavaScript"/><category term="Aspx"/><category term="BindHelper"/><category term="Design"/><category term="Django"/><category term="Helpers"/><category term="Insert scripts"/><category term="Interop"/><category term="Migration"/><category term="MyLovelyTable"/><category term="Patterns"/><category term="Pdf"/><category term="Python"/><category term="Regex"/><category term="Semantic queries"/><category term="Sql Server"/><category term="Tables"/><category term="Usability"/><category term="Webforms"/><category term="iTextSharp"/><category term="jsBin"/><title type='text'>Gr8 Code, on how the code saved the day ^_^</title><subtitle type='html'>On how the code saved the day ^_^</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-2176502422384637917</id><published>2011-11-26T14:28:00.001-05:00</published><updated>2011-11-26T14:33:59.885-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="jsBin"/><category scheme="http://www.blogger.com/atom/ns#" term="Regex"/><title type='text'>Email address extractor with jQuery Regex and jsBin</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
All these years I&#39;ve received a lot of those emails that says kind of &quot;send this to ten close friends...&quot;. Well, now I found an interesting application for those emails, I am currently working in an email campain with &lt;a class=&quot;zem_slink&quot; href=&quot;http://www.mailchimp.com/&quot; rel=&quot;homepage&quot; title=&quot;MailChimp&quot;&gt;Mail Chimp&lt;/a&gt; and I need a lot of email addresses for setting this up. Then I checked out all these mass emails and created a &lt;a class=&quot;zem_slink&quot; href=&quot;http://en.wikipedia.org/wiki/Text_file&quot; rel=&quot;wikipedia&quot; title=&quot;Text file&quot;&gt;text file&lt;/a&gt; with all the content, then I needed to extract from that content, all email addresses for the campaing.&lt;br /&gt;
&lt;br /&gt;
Using jsBin and &lt;a class=&quot;zem_slink&quot; href=&quot;http://jquery.com/&quot; rel=&quot;homepage&quot; title=&quot;JQuery&quot;&gt;jQuery&lt;/a&gt; I created this simple yet useful email addresses extractor, I hope you find this gr8 code as useful as I did.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://jsbin.com/aribic/14&quot;&gt;http://jsbin.com/aribic/14&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;zemanta-pixie&quot; style=&quot;height: 15px; margin-top: 10px;&quot;&gt;
&lt;a class=&quot;zemanta-pixie-a&quot; href=&quot;http://www.zemanta.com/&quot; title=&quot;Enhanced by Zemanta&quot;&gt;&lt;img alt=&quot;Enhanced by Zemanta&quot; class=&quot;zemanta-pixie-img&quot; src=&quot;http://img.zemanta.com/zemified_e.png?x-id=2579d6af-49b3-49b3-8aa4-2317ebc840dc&quot; style=&quot;border: none; float: right;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/2176502422384637917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2011/11/email-address-extractor-with-jquery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/2176502422384637917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/2176502422384637917'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2011/11/email-address-extractor-with-jquery.html' title='Email address extractor with jQuery Regex and jsBin'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-4497065298707076354</id><published>2011-04-17T12:50:00.001-05:00</published><updated>2011-04-28T17:25:34.090-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Design"/><category scheme="http://www.blogger.com/atom/ns#" term="Webforms"/><title type='text'>Modern Web Form Design</title><content type='html'>&lt;div class=&quot;publicacion&quot;&gt;This is my outline/notes on &lt;a href=&quot;http://channel9.msdn.com/Events/MIX/MIX10/EX03&quot;&gt;Modern Web Form Design by Luke Wroblewski&lt;/a&gt; at &lt;a href=&quot;http://channel9.msdn.com/events/mix/mix10&quot;&gt;Mix10&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Rich Interactin to enhance standard forms&lt;/h3&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Dynamic inline forms&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Inline multi-step (accordion) forms should not efect conversion rates&lt;/li&gt;
&lt;li&gt;People were fastest with the inline multi-step form&lt;/li&gt;
&lt;li&gt;People do not think of section headers as form actions/elements&lt;/li&gt;
&lt;li&gt;Inline multi-step forms do not inherently have more usability issues than single or multipage forms&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;Unnecessary Inputs&lt;/li&gt;
&lt;b&gt;Any question you ask requires people to:&lt;/b&gt; &lt;ul&gt;&lt;li&gt;Parse it&lt;/li&gt;
&lt;li&gt;Formulate a response&lt;/li&gt;
&lt;li&gt;Input their answer&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;Be vigilant about every question you ask&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Can it be removed?&lt;/li&gt;
&lt;li&gt;Can it be postponed?&lt;/li&gt;
&lt;li&gt;Can it be inferred?&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;Selection Dependent Inputs&lt;/li&gt;
&lt;b&gt;BEST PRACTICE&lt;/b&gt; &lt;ul&gt;&lt;li&gt;If lots of dependent inputs, use page-level&lt;/li&gt;
&lt;li&gt;Vertical &amp; horizontal tabs perform well but have mutual exclusivity issues&lt;/li&gt;
&lt;li&gt;Long lists of initial inputs, few dependent inputs for each, use drop-down menu&lt;/li&gt;
&lt;li&gt;Short list of initial options &amp; few dependents, exposed inline&lt;/li&gt;
&lt;li&gt;Maintain clear relationship between initial selection options&lt;/li&gt;
&lt;li&gt;Clearly associate additional inputs with their trigger&lt;/li&gt;
&lt;li&gt;Avoid &quot;jumping&quot; that disassociates initial selection options&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;Inline Validation&lt;/li&gt;
&lt;b&gt;Versus a page submit/refresh model&lt;/b&gt; &lt;ul&gt;&lt;li&gt;22% increase in completions&lt;/li&gt;
&lt;li&gt;31% increase in satisfaction ratings&lt;/li&gt;
&lt;li&gt;42% decrease in completion times&lt;/li&gt;
&lt;li&gt;22% decrease in errors made&lt;/li&gt;
&lt;li&gt;47% decrease in number of eye fixations&lt;/li&gt;
&lt;/ul&gt;&lt;b&gt;BEST PRACTICES&lt;/b&gt; &lt;ul&gt;&lt;li&gt;Use inline validation for inputs that have potentially high error rates&lt;/li&gt;
&lt;li&gt;Validate &quot;open&quot; inputs after people finish&lt;/li&gt;
&lt;li&gt;Keep validation messages persistent&lt;/li&gt;
&lt;li&gt;Use suggested inputs to disambiguate&lt;/li&gt;
&lt;li&gt;Avoiding &quot;jumping&quot; forms around&lt;/li&gt;
&lt;/ul&gt;&lt;/ol&gt;&lt;br /&gt;
&lt;h3&gt;Forms on mobile devices&lt;/h3&gt;&lt;cite&gt;The rule of thumb is to limit the use of forms in the mobile context, Mobile Web Design &amp; Development, O&#39;Reilly 2009&lt;/cite&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Field zoom&lt;/li&gt;
&lt;b&gt;Use top aligned fields instead of left aligned&lt;/b&gt; &lt;ul&gt;&lt;li&gt;When data being collected is familiar&lt;/li&gt;
&lt;li&gt;Minimize time to completion&lt;/li&gt;
&lt;li&gt;Flexibility for localization and complex inputs&lt;/li&gt;
&lt;li&gt;Easier to code: no floats or tables&lt;/li&gt;
&lt;li&gt;Accessibility: label, field in order&lt;/li&gt;
&lt;li&gt;Better format for mobile screen&lt;/li&gt;
&lt;li&gt;Support help/error messaging column&lt;/li&gt;
&lt;li&gt;Require more vertical space&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;Input Types&lt;/li&gt;
&lt;b&gt;Take advantage of HTML5 input types:&lt;/b&gt; &lt;cite&gt;Usability suffers when users type in passwords and the only feedback they get is a row of bullets. Typically, masking passwords doesn&#39;t even increase security, but i does cost you business due to login failures, Jakob Nielsen, 2009&lt;/cite&gt;
&lt;li&gt;Pop-Up &amp; Compound Menus&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Use pop-up and compund controls to simplify data input&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;Device Capabilities&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Form Fields&lt;/li&gt;
&lt;li&gt;Location&lt;/li&gt;
&lt;li&gt;Gestures&lt;/li&gt;
&lt;li&gt;Audio&lt;/li&gt;
&lt;li&gt;Images&lt;/li&gt;
&lt;/ul&gt;&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;More Information&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;@lukewdesign&lt;/li&gt;
&lt;li&gt;www.lukew.com/ff/&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;Web Form Design&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;www.rosenfeldmedia.com/books/webforms/&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/4497065298707076354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2011/04/modern-web-form-design.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/4497065298707076354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/4497065298707076354'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2011/04/modern-web-form-design.html' title='Modern Web Form Design'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-8265431785654522239</id><published>2011-04-15T22:11:00.000-05:00</published><updated>2011-04-15T22:11:03.485-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jQuery plugin"/><title type='text'>How to warn the user that all unsaved changes will be lost when he is leaving the page Part 3</title><content type='html'>&lt;div class=&quot;publicacion&quot;&gt;Here is some progress on my jQuery plugin for warning a user when he is leaving the page and there are unsaved changes.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Consolas; font-size: 10pt; color: black; background: white;&quot;&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006400;&quot;&gt;// Version 0.2&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006400;&quot;&gt;// April 10 2011 22:54&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006400;&quot;&gt;// Julian Vargas&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006400;&quot;&gt;// http://gr8code.blogspot.com&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; () {&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; userIsEditing = &lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; message = &lt;span style=&quot;color: maroon;&quot;&gt;&amp;quot;Do you really want to abandon this page?, unsaved changes will be lost.&amp;quot;&lt;/span&gt;;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; controlsToObserve = &lt;span style=&quot;color: maroon;&quot;&gt;&amp;quot;:input, :text, :password, :radio, :checkbox, select&amp;quot;&lt;/span&gt;;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; eventsToObserve = &lt;span style=&quot;color: maroon;&quot;&gt;&amp;quot;keyup change&amp;quot;&lt;/span&gt;;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #006400;&quot;&gt;// the function is declared as a &#39;var&#39; for DRY.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; confirmation = &lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; (event) {&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (userIsEditing &amp;amp;&amp;amp; !confirm(message))&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; event.preventDefault();&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&lt;span style=&quot;color: maroon;&quot;&gt;&amp;quot;a&amp;quot;&lt;/span&gt;).click(confirmation);&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(window).unload(confirmation);&lt;span style=&quot;color: #006400;&quot;&gt;// This still needs improvements&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(controlsToObserve).bind(eventsToObserve, &lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; () { userIsEditing = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;; });&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/span&gt;&amp;nbsp;})();&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/8265431785654522239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2011/04/how-to-warn-user-that-all-unsaved_15.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/8265431785654522239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/8265431785654522239'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2011/04/how-to-warn-user-that-all-unsaved_15.html' title='How to warn the user that all unsaved changes will be lost when he is leaving the page Part 3'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-6778478221274976590</id><published>2011-04-13T16:15:00.000-05:00</published><updated>2011-04-13T16:15:53.481-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="MentalNotes"/><title type='text'>On Using jQuery Deferred and Promises</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;publicacion&quot;&gt;&lt;br /&gt;
Julian Aubourg and Addy Osmani provide a very comprehensive explanation on &lt;a href=&quot;http://msdn.microsoft.com/es-es/scriptjunkie/gg723713.aspx&quot;&gt;Creating Responsive Applications Using jQuery Deferred and Promises&lt;/a&gt;, worth check it out.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/6778478221274976590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2011/04/on-using-jquery-deferred-and-promises.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/6778478221274976590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/6778478221274976590'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2011/04/on-using-jquery-deferred-and-promises.html' title='On Using jQuery Deferred and Promises'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-665215066703862593</id><published>2011-04-10T23:34:00.003-05:00</published><updated>2011-04-15T22:14:05.243-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jQuery plugin"/><title type='text'>How to warn the user that all unsaved changes will be lost when he is leaving the page Part 2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;publicacion&quot;&gt;I come back to show some progress on &lt;a href=&quot;http://gr8code.blogspot.com/2011/04/how-to-warn-user-that-all-unsaved.html&quot;&gt;How to warn the user that all unsaved changes will be lost when he is leaving the page&lt;/a&gt;. This is my current implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: white; color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: darkgreen;&quot;&gt;//Version 0.1&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: darkgreen;&quot;&gt;//April 10 2011 22:54&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: darkgreen;&quot;&gt;//Julian Vargas&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: darkgreen;&quot;&gt;//http://gr8code.blogspot.com&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; () {&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; userIsEditing = &lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; message = &lt;span style=&quot;color: maroon;&quot;&gt;&quot;Do you really want to abandon this page?, unsaved changes will be lost.&quot;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;a&quot;&lt;/span&gt;).click(&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; (event) {&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (userIsEditing)&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (!confirm(message))&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; event.preventDefault();&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;:input, :text, :password, :radio, :checkbox&quot;&lt;/span&gt;).bind(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;keyup&quot;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; () {&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; userIsEditing = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/span&gt;&amp;nbsp;})();&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/665215066703862593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2011/04/how-to-warn-user-that-all-unsaved_10.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/665215066703862593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/665215066703862593'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2011/04/how-to-warn-user-that-all-unsaved_10.html' title='How to warn the user that all unsaved changes will be lost when he is leaving the page Part 2'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-8799238406030513681</id><published>2011-04-07T15:40:00.001-05:00</published><updated>2011-04-07T15:44:03.410-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><title type='text'>How to modify an IFrame behaviour with jQuery</title><content type='html'>&lt;div class=&quot;publicacion&quot;&gt;        This post is about how I used jQuery to work out a situation regarding two existing&lt;br /&gt;
        applications.&lt;br /&gt;
        &lt;br /&gt;&lt;br /&gt;
        The situation is this. We have two applications &lt;b&gt;MainApp&lt;/b&gt; and &lt;b&gt;SubApp&lt;/b&gt;,&lt;br /&gt;
        MainApp loads SubApp in a IFrame and passes two out of three querystring parameters.&lt;br /&gt;
        &lt;br /&gt;&lt;br /&gt;
        Now the SubApp was modified to use the third parameter but the MainApp is not currently&lt;br /&gt;
        passing it and we are not allowed to perform any change to MainApp because it is&lt;br /&gt;
        a legacy application compiled with framework 1.1. So, what we did was edit the MainApp.aspx&lt;br /&gt;
        file and add the next lines:&lt;br /&gt;
        &lt;div class=&quot;cf&quot;&gt;            &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cb2&quot;&gt;script&lt;/span&gt; &lt;span
                class=&quot;cb3&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;cb1&quot;&gt;=&amp;quot;javascript&amp;quot;&lt;/span&gt; &lt;span
                    class=&quot;cb3&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;cb1&quot;&gt;=&amp;quot;jquery.min.js&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;cb2&quot;&gt;script&lt;/span&gt;&lt;span
    class=&quot;cb1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;            &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cb2&quot;&gt;script&lt;/span&gt; &lt;span
                class=&quot;cb3&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;cb1&quot;&gt;=&amp;quot;javascript&amp;quot;&lt;/span&gt; &lt;span
                    class=&quot;cb3&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;cb1&quot;&gt;=&amp;quot;querySt.js&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span
                        class=&quot;cb2&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;cb1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;            &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cb2&quot;&gt;script&lt;/span&gt; &lt;span
                class=&quot;cb3&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;cb1&quot;&gt;=&amp;quot;javascript&amp;quot;&amp;gt;&lt;/span&gt;&lt;/pre&gt;            &lt;pre class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(document).ready(&lt;span class=&quot;cb1&quot;&gt;function&lt;/span&gt; () {&lt;/pre&gt;            &lt;pre class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb1&quot;&gt;var&lt;/span&gt; $frame = $(&lt;span
                class=&quot;cb2&quot;&gt;&amp;quot;#IFrameForSubApp&amp;quot;&lt;/span&gt;);&lt;/pre&gt;            &lt;pre class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb1&quot;&gt;var&lt;/span&gt; address = $frame.attr(&lt;span
                class=&quot;cb2&quot;&gt;&#39;src&#39;&lt;/span&gt;);&lt;/pre&gt;            &lt;pre class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; address = address + &lt;span class=&quot;cb2&quot;&gt;
                &#39;&amp;amp;ThirdParameter=&#39;&lt;/span&gt; + &lt;b&gt;querySt&lt;/b&gt;(&lt;span class=&quot;cb2&quot;&gt;&#39;ThirdParameter&#39;&lt;/span&gt;);&lt;/pre&gt;            &lt;pre class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $frame.attr(&lt;span class=&quot;cb2&quot;&gt;
                &#39;src&#39;&lt;/span&gt;, address);&lt;/pre&gt;            &lt;pre class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/pre&gt;            &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;cb2&quot;&gt;script&lt;/span&gt;&lt;span
                class=&quot;cb1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;            &lt;pre class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/pre&gt;        &lt;/div&gt;        That&#39;s it, this is how The Code Saved The Day.&lt;br /&gt;
    &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/8799238406030513681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2011/04/how-to-modify-iframe-behaviour-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/8799238406030513681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/8799238406030513681'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2011/04/how-to-modify-iframe-behaviour-with.html' title='How to modify an IFrame behaviour with jQuery'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-1708093166391957136</id><published>2011-04-07T13:49:00.000-05:00</published><updated>2011-04-07T13:49:40.212-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MentalNotes"/><title type='text'>On &quot;How to Create Effective Facebook Wall Posts&quot;</title><content type='html'>&lt;div class=&quot;publicacion&quot;&gt;        This morning I read this post called &lt;a href=&#39;http://thenextweb.com/facebook/2011/04/06/how-to-create-effective-facebook-wall-posts/&#39;&gt;&lt;br /&gt;
            How to Create Effective Facebook Wall Posts&lt;/a&gt; by Courtney Boyd Myers. The&lt;br /&gt;
        post summarises the results of a research performed by Buddy Media; the research&lt;br /&gt;
        was about the &quot;Likes&quot; and comments on all Facebook Wall Posts. My notes on this&lt;br /&gt;
        are:&lt;br /&gt;
        &lt;ul&gt;            &lt;li&gt;Marketers work Monday through Friday but Facebook is always available.&lt;/li&gt;
            &lt;li&gt;Post with up to 80 words lenght have a higher engagement raten than longer posts.&lt;/li&gt;
            &lt;li&gt;Engagement rates are 3 times higher for posts that used a full-length URL, rather&lt;br /&gt;
                than a URL shortener.&lt;/li&gt;
            &lt;li&gt;Posting outside normal business hours icreasees the engagement rates.&lt;/li&gt;
            &lt;li&gt;Engagement rates on Thursday and Friday are higher than other days of the week.&lt;/li&gt;
            &lt;li&gt;Keywords as &quot;Events&quot; or &quot;Winning&quot; were associated with promotions that had the highest&lt;br /&gt;
                engagement, while “buy,” and “shop” had low engagement.&lt;/li&gt;
        &lt;/ul&gt;    &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/1708093166391957136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2011/04/on-how-to-create-effective-facebook.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/1708093166391957136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/1708093166391957136'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2011/04/on-how-to-create-effective-facebook.html' title='On &quot;How to Create Effective Facebook Wall Posts&quot;'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-2928949997079891715</id><published>2011-04-06T17:06:00.001-05:00</published><updated>2011-04-06T17:13:15.125-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BindHelper"/><category scheme="http://www.blogger.com/atom/ns#" term="Patterns"/><title type='text'>A pattern for binding items to a ListControl</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;publicacion&quot;&gt;Almost every time that I create a webform, I have to put a DropDownList or other&lt;br /&gt;
ListControl in order to bind a set of values. Doing this is fairly simple, just&lt;br /&gt;
set the properties DataSource, DataValueField and DataTextField to the appropriated&lt;br /&gt;
values and then perform a DataBind, but notice that this implies writing four lines&lt;br /&gt;
of code just to perform this particular task and when you have more ListControls&lt;br /&gt;
in a single webform, the amount of code for doing this binding would be overwhelming.&lt;br /&gt;
That is why I developed the BindHelper Pattern, which is simply a set of functions&lt;br /&gt;
that perform the binding task for me. For instance, if we have an entity called&lt;br /&gt;
CountryBrl (the suffix Brl stands for BusinessRulesLayer) and we want to have a&lt;br /&gt;
bindhelper for it, then the code would be like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Partial&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;Public&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;Class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;CountryUil&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; Public&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;Shared&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt; Bind(&lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; control &lt;span style=&quot;color: blue;&quot;&gt;As&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;ListControl&lt;/span&gt;, _&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; ByVal&lt;/span&gt; objList&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;Of&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;CountryBrl&lt;/span&gt;),&amp;nbsp;_&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Optional&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ByVal&amp;nbsp;&lt;/span&gt;firstItem &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;ListItem&lt;/span&gt; = &lt;span style=&quot;color: blue;&quot;&gt;Nothing&lt;/span&gt;,&amp;nbsp;_&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Optional&lt;/span&gt; DataTextField &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;String&lt;/span&gt; = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Name&quot;&lt;/span&gt;)&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; SortList&lt;/span&gt;.SortByProperty(objList,_&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;DataTextField, _&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;  &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;SortOrder&lt;/span&gt;.Asc)&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; control.DataSource = objList&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp; control.DataValueField = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;ID&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;  &amp;nbsp;&amp;nbsp; control.DataTextField = DataTextField&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;  &amp;nbsp;&amp;nbsp; control.DataBind()&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &#39;Commonly used for a &quot;Select&quot;&amp;nbsp;item&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;If&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Not&amp;nbsp;&lt;/span&gt;firstItem &lt;span style=&quot;color: blue;&quot;&gt;Is&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Nothing&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;  &amp;nbsp;&amp;nbsp; &amp;nbsp; control.Items.Insert(0, firstItem)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;  &amp;nbsp;&amp;nbsp; &amp;nbsp;End&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;If&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;  &lt;br /&gt;
&amp;nbsp; End&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;    &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;Public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Shared&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;Function&lt;/span&gt; BindToListControl(&lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; control &lt;span style=&quot;color: blue;&quot;&gt;As&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;ListControl&lt;/span&gt;, _&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;  &amp;nbsp;&amp;nbsp; &amp;nbsp;Optional&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ByVal&amp;nbsp;&lt;/span&gt;firstItem &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;ListItem&lt;/span&gt; = &lt;span style=&quot;color: blue;&quot;&gt;Nothing&lt;/span&gt;,&amp;nbsp;_&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Optional&lt;/span&gt; DataTextField &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;String&lt;/span&gt; = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Name&quot;&lt;/span&gt;) _&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;  &amp;nbsp;&amp;nbsp; &amp;nbsp;As&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;Of&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;CountryBrl&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;    &lt;br /&gt;
&amp;nbsp;&amp;nbsp; Dim&lt;/span&gt; objList &lt;span style=&quot;color: blue;&quot;&gt;As&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;Of&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;CountryBrl&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;  &lt;br /&gt;
&amp;nbsp;&amp;nbsp; objList = &lt;span style=&quot;color: #2b91af;&quot;&gt;CountryBrl&lt;/span&gt;.GetAll()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp; Bind(control, objList, _&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;  &amp;nbsp;&amp;nbsp; &amp;nbsp;firstItem:=firstItem, _&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;DataTextField:=DataTextField)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Return&lt;/span&gt; objList&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;End&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Function&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
End&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Class&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The code above implements:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A class called CountryUil (the suffix Uil stands for User Interface Layer).&lt;/li&gt;
&lt;li&gt;A static core method responsible for the binding task: this method receives the&lt;br /&gt;
ListControl to bind the data to, a list of entities as the data source, and optional&lt;br /&gt;
parameter to show at the top of the ListControl (Commonly used for “Select”) and&lt;br /&gt;
an optional parameter that specifies the field to be used as the DataTextField in&lt;br /&gt;
the ListControl.&lt;/li&gt;
&lt;li&gt;A static method called BindToListControl which receives the same parameters except&lt;br /&gt;
for the list of entities. This method loads the data from the model, sorts the data&lt;br /&gt;
by the field corresponding to the parameter DataTextField and then calls the method&lt;br /&gt;
Bind.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
To clarify how to use this class I proceed to show some examples:&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt; &lt;br /&gt;
Protected&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt; Page_Load(&lt;span style=&quot;color: blue;&quot;&gt;ByVal&amp;nbsp;&lt;/span&gt;sender &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Object&lt;/span&gt;, _&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #2b91af;&quot;&gt;EventArgs&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &#39;ddlCountries is a DropDownList&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;chkCountries is a ChekBoxList&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp;&amp;nbsp; &#39;The default configuration: loads&amp;nbsp;all&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;the countries and binds them&amp;nbsp;to&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;the control showing the name&amp;nbsp;and putting&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;as the first item the &quot;Select&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;CountryUil&lt;/span&gt;.BindToListControl(ddlCountries,&amp;nbsp;_&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;New&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;ListItem&lt;/span&gt;(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Select&quot;&lt;/span&gt;, 0))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &#39;Loads all the countries and&amp;nbsp;binds them to&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;the control showing the CountryCode&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;and putting as the first&amp;nbsp;item the &quot;Select&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;CountryUil&lt;/span&gt;.BindToListControl(ddlCountries,&amp;nbsp;_&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;New&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;ListItem&lt;/span&gt;(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Select&quot;&lt;/span&gt;, 0), _&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&quot;CountryCode&quot;&lt;/span&gt;)&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: green;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &#39;Loads all the countries and&amp;nbsp;binds them to&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&#39;the control showing the CountryCode&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;&amp;nbsp; CountryUil&lt;/span&gt;.BindToListControl(chkCountries,&amp;nbsp;_&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;DataTextField:=&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;CountryCode&quot;&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &#39;Loads all the countries and&amp;nbsp;binds them to&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp;&amp;nbsp; &#39;the control showing the&amp;nbsp;Name&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;CountryUil&lt;/span&gt;.BindToListControl(chkCountries)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &#39;performs&amp;nbsp;the binding using a set of data&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&amp;nbsp;&amp;nbsp; &#39;available&amp;nbsp;in the session&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2b91af;&quot;&gt;  &amp;nbsp;&amp;nbsp; &amp;nbsp;CountryUil&lt;/span&gt;.Bind(chkCountries,&amp;nbsp;Session(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Countries&quot;&lt;/span&gt;))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;End&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
And that’s it, we performed multiple binds by calling the same utility and this&lt;br /&gt;
is saving us a lot of code and time.&lt;br /&gt;
&lt;br /&gt;
It is important to mention that I do not write this kind of code by hand, I use&lt;br /&gt;
a code generator to do it for me. The generator creates BindHelpers for every single&lt;br /&gt;
table in my database including the methods for binding by foreign keys like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #2b91af; font-family: &#39;Courier New&#39;;&quot;&gt;CityUil&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;.BindToListControl&lt;b&gt;ByCountryId&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;chkCities&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;, &lt;b&gt;intCountryId&lt;/b&gt;,&lt;span style=&quot;color: #6464b9;&quot;&gt;...&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;
And since the class is generated as partial, I am able to create custom bind methods&lt;br /&gt;
in a separate file, very useful when working with code generators.&lt;br /&gt;
I hope this Code Saves Your Day as it did with mine.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/2928949997079891715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2011/04/pattern-for-binding-items-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/2928949997079891715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/2928949997079891715'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2011/04/pattern-for-binding-items-to.html' title='A pattern for binding items to a ListControl'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-8004784779114220286</id><published>2011-04-05T13:49:00.000-05:00</published><updated>2011-04-05T13:49:26.256-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jQuery plugin"/><title type='text'>How to warn the user that all unsaved changes will be lost when he is leaving the page</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Recently I was asked to implement the following requirement in all my webforms:&lt;br /&gt;
&quot;When the user is leaving a page, the application must show a confirm dialog warning the user that if he leaves the page, will lose all unsaved changes&quot;&lt;br /&gt;
I decided to implement this with jQuery because I already have included the reference in all my webforms as well as some standard scripts which I use through out my applications.&lt;br /&gt;
&lt;br /&gt;
What I did was add the next lines to an existing script file:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;var&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;isEditing&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;$(document).ready(&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; () {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;$(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;:input, :text,&amp;nbsp;:password, :radio, :checkbox&quot;&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;.bind(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;keyup change&quot;&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; () {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; isEditing = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;});&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;$(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;a&quot;&lt;/span&gt;).click(&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; (event) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;(isEditing)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;(!confirm(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;Warning&amp;nbsp;message&quot;&lt;/span&gt;))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;event.preventDefault();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;});&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;});&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Certainly this Code Saved the Day, but giving a closer look at this code one can note some issues to bear in mind:&lt;br /&gt;
-Global variables are not a good practice&lt;br /&gt;
-The dialog does not show up when the user close the window&lt;br /&gt;
-The dialog does not show up when the user clicks a button&lt;br /&gt;
&lt;br /&gt;
I will fix these issues shortly, perhaps by implementing the appropriate jQuery plug-in.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/8004784779114220286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2011/04/how-to-warn-user-that-all-unsaved.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/8004784779114220286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/8004784779114220286'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2011/04/how-to-warn-user-that-all-unsaved.html' title='How to warn the user that all unsaved changes will be lost when he is leaving the page'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-9223101427333103628</id><published>2011-04-04T17:42:00.000-05:00</published><updated>2011-04-04T17:42:12.826-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Helpers"/><category scheme="http://www.blogger.com/atom/ns#" term="iTextSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="Pdf"/><title type='text'>Creating PDF Documents with ASP.NET and iTextSharp</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;I read the article &lt;a href=&quot;http://www.4guysfromrolla.com/articles/030911-1.aspx&quot;&gt;Creating PDF Documents with ASP.NET and iTextSharp by Scott Mitchell&lt;/a&gt; and I found it very useful, especially the section where he explains how to create a pdf file from an html template. Now I&#39;m trying to create a helper that receives a URL and creates the pdf for me, this is because I use to create my reports in webforms, and it would be very useful if one could take the content of that report and generate a pdf file with it.&lt;br /&gt;
One thing to bear in mind before trying to create the pdf with this approach is that you cannot have any button of link in the page; otherwise the parser will throw an exception. The other thing is that your page has to have inline styles (which is not a good practice) in order to generate the pdf file with all your design.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: green; font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;&#39;This works with URLs in the same site, I got an exception when&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&#39;trying&lt;/span&gt; others like http://gr8code.blogspot.com&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
Dim&lt;/span&gt; webPage &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; System.Net.&lt;span style=&quot;color: #2b91af;&quot;&gt;WebRequest&lt;/span&gt; = _&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;System.Net.&lt;span style=&quot;color: #2b91af;&quot;&gt;WebRequest&lt;/span&gt;.Create(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;http://someurl&quot;&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
Dim&lt;/span&gt; sReader &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;New&lt;/span&gt; IO.&lt;span style=&quot;color: #2b91af;&quot;&gt;StreamReader&lt;/span&gt;(&amp;nbsp;_&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;webPage.GetResponse().GetResponseStream())&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;br /&gt;
&#39;gets all the response as you&lt;br /&gt;
see it in the &#39;View source&#39;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
Dim&lt;/span&gt; strContent = sReader.ReadToEnd()&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;             Dim&lt;/span&gt; parsedHtmlElements = _&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af; font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;HTMLWorker&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;.ParseToList&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;New&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;             &lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;StringReader&lt;/span&gt;(strContent),&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;Nothing&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; document &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Document&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;PageSize&lt;/span&gt;.LEGAL, 50, 50, 25, 25)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;             Dim&lt;/span&gt; output &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;FileStream&lt;/span&gt; = _&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;FileStream&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;Server.MapPath&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;&quot;myFile.pdf&quot;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;),&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp;FileMode&lt;/span&gt;.Create)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; writer = pdf.&lt;span style=&quot;color: #2b91af;&quot;&gt;PdfWriter&lt;/span&gt;.GetInstance(document,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;             output)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;document.Open()&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;             For&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Each&lt;/span&gt; htmlElement&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;In&lt;/span&gt; parsedHtmlElements&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;document.Add&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;htmlElement&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Next&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 16px;&quot;&gt;document.Close()&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
The helper is still far from being ready but I think this is a good starting point.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/9223101427333103628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2011/04/creating-pdf-documents-with-aspnet-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/9223101427333103628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/9223101427333103628'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2011/04/creating-pdf-documents-with-aspnet-and.html' title='Creating PDF Documents with ASP.NET and iTextSharp'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-2386897698077864864</id><published>2011-04-04T14:14:00.001-05:00</published><updated>2011-04-04T14:16:23.456-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MentalNotes"/><category scheme="http://www.blogger.com/atom/ns#" term="Usability"/><title type='text'>10 Essential Web Application Usability Guidelines by Oleg Mokhov</title><content type='html'>Keypoints on &lt;a href=&quot;http://speckyboy.com/2011/03/31/10-essential-web-application-usability-guidelines/&quot;&gt;10 Essential Web Application Usability Guidelines by Oleg Mokhov&lt;/a&gt;&lt;br /&gt;
&lt;p&gt;&lt;b&gt;1. Have a Consistent and Standardized UI:&lt;/b&gt; Keep the interface constant and use standardized elements.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;b&gt;2. Guide the user:&lt;/b&gt; Make clear where to click to progress. If one action is more important that other, have the button or action area for it prominently displayed.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;b&gt;3. Make (Call-to-Action) Interactive Objects Obvious:&lt;/b&gt; Make click and tap targets as large as possible, make the interactive objects big and obvious. Make the interactive objects noticeably bigger than the surrounding elements.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;b&gt;4. Give Feedback - Both for User&#39;s Interacting and Progressing:&lt;/b&gt; Give visual feedback then a user&#39;s interacting, as well as the user&#39;s progress if applicable.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;b&gt;5. Never Have Users Repeat Anything &amp; Keep Signup Info to a Minimum:&lt;/b&gt; Ask for any info only once. &lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;b&gt;6. Always Have Default Values in Fields and Forms:&lt;/b&gt; Having a simple default value in a text field will push the user in the right direction as to what they need to type in.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;b&gt;7. Explain How the Inputted Info Will Be Used:&lt;/b&gt; Make it clear, comfortable and affirming as possible for the users how the info will be used (&quot;Your email will be your login username&quot;, &quot;Your location will be used to *do something*&quot;)&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;b&gt;8. Don&#39;t Have any Reset or Mass-Delete Buttons:&lt;/b&gt; There&#39;s almost no situation where a user will have to wipe every scrap of data and start again.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;b&gt;9. Have Clear and Explanatory Error &amp; Success Messages:&lt;/b&gt; Instead of &quot;Oops, something went wrong&quot; message that doesn&#39;t inspire confidence, have something more specific and explanatory like &quot;Our database which holds your account info is temporarily inaccessible and will be back shortly&quot;.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;b&gt;10. Include a Clear Visual Hierarchy and Navigation (Breadcrumbs):&lt;/b&gt; Make sure your layout and navigation is very clear. Have clear &#39;breadcrumbs&#39; at the top of the page.&lt;br /&gt;
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/2386897698077864864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2011/04/10-essential-web-application-usability.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/2386897698077864864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/2386897698077864864'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2011/04/10-essential-web-application-usability.html' title='10 Essential Web Application Usability Guidelines by Oleg Mokhov'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-3105392490378857774</id><published>2011-04-03T21:41:00.000-05:00</published><updated>2011-04-03T21:41:53.531-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MentalNotes"/><title type='text'>Number Decimal Separator</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Remember, Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator&amp;nbsp;gives us the character used for decimals, then we can :&lt;br /&gt;
&lt;br /&gt;
Dim separator As String = Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator&lt;br /&gt;
&lt;br /&gt;
Dim strNumber As String = &quot;1.0&quot; &#39;A string number with dot as separator&lt;br /&gt;
strNumber = strNumber.Replace(&quot;.&quot;, separator).Replace(&quot;,&quot;,separator) &#39;Replaces dot or comma for the current separator&lt;br /&gt;
&lt;br /&gt;
Dim value As Double = CDbl(strNumber)&#39; Casts the string to Double&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/3105392490378857774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2011/04/number-decimal-separator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/3105392490378857774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/3105392490378857774'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2011/04/number-decimal-separator.html' title='Number Decimal Separator'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-3628771226396734367</id><published>2011-03-31T15:49:00.000-05:00</published><updated>2011-03-31T15:49:05.370-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MentalNotes"/><title type='text'>The Transformative Power of Personal Projects</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;These are my mental notes on &lt;a href=&quot;http://www.swiss-miss.com/2011/03/ji-lee-the-transformative-power-of-personal-projects-2.html?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A+Swissmiss+%28swissmiss%29&quot;&gt;The Transformative Power of Personal Projects by Ji Lee&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Conclusion:&lt;br /&gt;
I can&#39;t depend on others to make things happen.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
I&#39;ll just have to doit myself.&lt;br /&gt;
&lt;br /&gt;
Includes:&lt;br /&gt;
1. Creation&lt;br /&gt;
2. Planning&lt;br /&gt;
3. Financing&lt;br /&gt;
4. Production&lt;br /&gt;
5. Marketing&lt;br /&gt;
&lt;br /&gt;
What personal projects taught me&lt;br /&gt;
Personal and professional projects compliment each other.&lt;br /&gt;
Creating platforms is powerful. (Creating an oper project to allow other to participate)&lt;br /&gt;
Time is a concept which can be stretched.(Time is just an idea and it can be changed)&lt;br /&gt;
Sharing is rewarding.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/3628771226396734367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2011/03/transformative-power-of-personal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/3628771226396734367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/3628771226396734367'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2011/03/transformative-power-of-personal.html' title='The Transformative Power of Personal Projects'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-6266595463287208621</id><published>2010-10-19T14:22:00.006-05:00</published><updated>2010-10-19T15:01:35.240-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Insert scripts"/><category scheme="http://www.blogger.com/atom/ns#" term="Migration"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql Server"/><title type='text'>Generate Insert Queries for a given table</title><content type='html'>&lt;div class=&quot;publicacion&quot;&gt;Oftentimes I face the challenge of migrating data from one SQL Server database to another of the same type. I&#39;m not going to discuss the reasons why I chose to do it this way, I just want to share this utility with the community because it has been very useful for me. The solution is to create an stored procedure that generates insert queries for every single record in a given table, like this: &lt;br /&gt;
&lt;div style=&quot;font-family: Courier New; font-size: 12pt; color: black; background: white;&quot;&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Exec &lt;/span&gt;dbo.GenerateInsertQueriesFor &lt;span style=&quot;color: #a31515;&quot;&gt;&#39;Student&#39;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt; By running the procedure I will get in the results pane, an insert query with the values of each tuple in the table Student. Then I can copy the results and paste it and run it in other database. The procedure uses the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms186778.aspx&quot;&gt;information_schema&lt;/a&gt; to introspect the table and know what columns it has. Each column name is concatenated to the insert query and all values are treated as string. Here is the source code of the stored procedure:&lt;br /&gt;
        &lt;br /&gt;&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;cf&quot;&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Create Procedure &lt;/span&gt;dbo.GenerateInsertQueriesFor&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;@TableName &lt;span class=&quot;cb1&quot;&gt;Varchar&lt;/span&gt;(&lt;span class=&quot;cb1&quot;&gt;max&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;As&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;/* &lt;/span&gt; &lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;Generate Insert Queries for a given table&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;Created by: Julian Vargas &lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;Url: http://gr8code.blogspot.com&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;On: October 19 2010&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;*/&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Declare &lt;/span&gt;@ColumnName &lt;span class=&quot;cb1&quot;&gt;varchar&lt;/span&gt;(&lt;span class=&quot;cb1&quot;&gt;max&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Declare &lt;/span&gt;@DataType &lt;span class=&quot;cb1&quot;&gt;Varchar&lt;/span&gt;(&lt;span class=&quot;cb1&quot;&gt;max&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Declare &lt;/span&gt;@Insert &lt;span class=&quot;cb1&quot;&gt;Varchar&lt;/span&gt;(&lt;span class=&quot;cb1&quot;&gt;max&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;--Initial structure of the insert query&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Set &lt;/span&gt;@Insert = &lt;span class=&quot;cb3&quot;&gt;&#39;Select &#39;&#39;Insert Into &#39; &lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; + @TableName &lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; + &lt;span class=&quot;cb3&quot;&gt;&#39; Values(&#39;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;--A cursor to navigate through the list of columns in the table&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;--specified by @TableName&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Declare &lt;/span&gt;Columnas &lt;span class=&quot;cb1&quot;&gt;Cursor For&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb2&quot;&gt;--Uses the information schema for listing the columns&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb1&quot;&gt;Select &lt;/span&gt;Column_Name, Data_Type&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb1&quot;&gt;From &lt;/span&gt;Information_Schema.Columns&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb1&quot;&gt;Where &lt;/span&gt;Table_Name =@TableName&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Open &lt;/span&gt;Columnas&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Fetch Next From &lt;/span&gt;Columnas &lt;span class=&quot;cb1&quot;&gt;Into &lt;/span&gt;@ColumnName, @DataType&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;/*&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;The final query will look like this:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb2&quot;&gt;Select &#39;Insert Into Student Values(&#39; + &#39;&#39;&#39;&#39; &lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb2&quot;&gt;+ Cast(IsNull(StudentId,0) As Varchar(max)) &lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb2&quot;&gt;+ &#39;&#39;&#39;&#39; + &#39;,&#39; + &#39;&#39;&#39;&#39; + Cast(IsNull(Name,&#39;&#39;) As Varchar(max)) &lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb2&quot;&gt;+ &#39;&#39;&#39;&#39; + &#39;)&#39; &lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb2&quot;&gt;From Student&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;after running the query, the result will look like this:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb2&quot;&gt;Insert Into Student Values(&#39;1&#39;,&#39;Jhon&#39;)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;Notice that all columns are casted to varchar for allowing concatenation &lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;and also are inside quotes to treat them as string and let SQL Server &lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;to convert them to their corresponding values.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;To determine if the datatype is any numerical type, the &lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;funcion CharIndex is used like this:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;CharIndex(&#39; int &#39; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb2&quot;&gt;, &#39; bigint int smallint ...&#39;) is equal to 8&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;CharIndex(&#39; smallint &#39; , &#39; bigint int smallint ...&#39;) is equal to 12&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;CharIndex(&#39; varchar &#39; &lt;/span&gt; &lt;span class=&quot;cb2&quot;&gt;, &#39; bigint int smallint ...&#39;) is equal to 0&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;*/&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;While &lt;/span&gt;@@Fetch_status = 0 &lt;span class=&quot;cb1&quot;&gt;Begin&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb1&quot;&gt;Set &lt;/span&gt;@Insert = @Insert &lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb2&quot;&gt;-- 1quote &lt;/span&gt; &lt;span class=&quot;cb2&quot;&gt;4quotes&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; +&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb3&quot;&gt;&#39;&#39;&#39; + &#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39; + Cast(IsNull(&#39;&lt;/span&gt;+@ColumnName+&lt;span class=&quot;cb3&quot;&gt;&#39;,&#39;&lt;/span&gt;+&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb1&quot;&gt;Case CharIndex&lt;/span&gt;(&lt;span class=&quot;cb3&quot;&gt;&#39; &#39;&lt;/span&gt;+@DataType+ &lt;span class=&quot;cb3&quot;&gt;&#39; &#39;&lt;/span&gt;, &lt;span class=&quot;cb3&quot;&gt;&#39; bigint int &#39;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; +&lt;span class=&quot;cb3&quot;&gt;&#39;smallint tinyint bit decimal numeric money &#39;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; +&lt;span class=&quot;cb3&quot;&gt;&#39;smallmoney float real &#39;&lt;/span&gt;)&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb2&quot;&gt;-- &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb2&quot;&gt;2quotes&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb1&quot;&gt;When &lt;/span&gt;0 &lt;span class=&quot;cb1&quot;&gt;Then &lt;/span&gt;&lt;span class=&quot;cb3&quot;&gt;&#39;&#39;&#39;&#39;&#39;&#39; &lt;/span&gt;&lt;span class=&quot;cb1&quot;&gt;Else &lt;/span&gt;&lt;span class=&quot;cb3&quot;&gt;&#39;0&#39; &lt;/span&gt;&lt;span class=&quot;cb1&quot;&gt;End&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb2&quot;&gt;-- &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;cb2&quot;&gt;4quotes&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; +&lt;span class=&quot;cb3&quot;&gt;&#39;) As Varchar(max)) + &#39;&#39;&#39;&#39;&#39;&#39;&#39;&#39; + &#39;&#39;,&#39;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Fetch Next From &lt;/span&gt;Columnas &lt;span class=&quot;cb1&quot;&gt;Into &lt;/span&gt;@ColumnName, @DataType&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;End&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Close &lt;/span&gt;Columnas&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Deallocate &lt;/span&gt;Columnas&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;--Remove the last comma&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Set &lt;/span&gt;@Insert = &lt;span class=&quot;cb1&quot;&gt;Substring&lt;/span&gt;(@Insert, 1, Len(@Insert)-1)&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;--Closes the sentence&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Set &lt;/span&gt;@Insert = (@Insert + &lt;span class=&quot;cb3&quot;&gt;&#39;)&#39;&#39; From &#39; &lt;/span&gt;+ @TableName)&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;--Runs the query&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;Exec&lt;/span&gt;(@Insert)&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;&lt;br /&gt;
One thing to keep in mind is that you have to enable identity insert before running the final scripts.&lt;br /&gt;
I hope you find the procedure useful as I do.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/6266595463287208621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2010/10/generate-insert-queries-for-given-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/6266595463287208621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/6266595463287208621'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2010/10/generate-insert-queries-for-given-table.html' title='Generate Insert Queries for a given table'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-4800141763740796837</id><published>2010-10-18T20:42:00.003-05:00</published><updated>2010-10-19T00:04:48.313-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery plugin"/><category scheme="http://www.blogger.com/atom/ns#" term="MyLovelyTable"/><category scheme="http://www.blogger.com/atom/ns#" term="Tables"/><title type='text'>My lovely table</title><content type='html'>&lt;div class=&quot;publicacion&quot;&gt;    This project is a &lt;a class=&quot;zem_slink&quot; href=&quot;http://jquery.com/&quot; rel=&quot;homepage&quot; title=&quot;JQuery&quot;&gt;&lt;br /&gt;
        jQuery&lt;/a&gt; plugin for displaying tabular data into &lt;a class=&quot;zem_slink&quot; href=&quot;http://en.wikipedia.org/wiki/HTML_element&quot;
            rel=&quot;wikipedia&quot; title=&quot;HTML element&quot;&gt;html tables&lt;/a&gt;, this was inspired&lt;br /&gt;
    by some personal needs but it is aimed at satisfying all the patterns described&lt;br /&gt;
    in the post &lt;a href=&quot;http://www.jankoatwarpspeed.com/post/2010/02/26/table-ui-patterns.aspx&quot;&gt;&lt;br /&gt;
        Ultimate guide to table UI patterns&lt;/a&gt; by Janko Jovanovic, &lt;a href=&quot;http://designingwebinterfaces.com/ultimate-guide-to-table-ui-patterns&quot;&gt;&lt;br /&gt;
            Ultimate guide to table UI patterns&lt;/a&gt; by Theresa Neil, &lt;a href=&quot;http://designshack.co.uk/articles/css/15-tips-for-designing-terrific-tables&quot;&gt;&lt;br /&gt;
                15 tips for designing terrific tables&lt;/a&gt; by &lt;a class=&quot;zem_slink&quot; href=&quot;http://en.wikipedia.org/wiki/Joshua_Johnson&quot;
                    rel=&quot;wikipedia&quot; title=&quot;Joshua Johnson&quot;&gt;Joshua Johnson&lt;/a&gt; and &lt;a href=&quot;http://www.8164.org/the-big-table-issue&quot;&gt;&lt;br /&gt;
                        The big table issue&lt;/a&gt; by Jin. The plugin is going to be delivered&lt;br /&gt;
    progresively as the following &lt;a class=&quot;zem_slink&quot; href=&quot;http://en.wikipedia.org/wiki/Requirement&quot;
        rel=&quot;wikipedia&quot; title=&quot;Requirement&quot;&gt;requirements&lt;/a&gt; are satisfied. &lt;br /&gt;
        &lt;br /&gt;&lt;br /&gt;
        &lt;b&gt;Requirements&lt;/b&gt;&lt;br /&gt;
    &lt;ul&gt;        &lt;li&gt;Alternating row styling&lt;/li&gt;
        &lt;li&gt;Full row selection&lt;/li&gt;
        &lt;li&gt;Table sections: Grouping relateddata&lt;/li&gt;
        &lt;li&gt;Sorting&lt;/li&gt;
        &lt;li&gt;Filtering&lt;/li&gt;
        &lt;li&gt;Pagination&lt;/li&gt;
        &lt;li&gt;Continious scrolling: As a constrast to pagination, shows new rows when scrolling&lt;br /&gt;
            down&lt;/li&gt;
        &lt;li&gt;Fiex table header&lt;/li&gt;
        &lt;li&gt;Headerless table&lt;/li&gt;
        &lt;li&gt;Expandable rows&lt;/li&gt;
        &lt;li&gt;Row actions&lt;/li&gt;
        &lt;li&gt;Inline actions: at the beginning or the end of the row.&lt;/li&gt;
        &lt;li&gt;Hover actions: display a menu somewhere in the data when certain event occurs.&lt;/li&gt;
        &lt;li&gt;Actions on multiple rows&lt;/li&gt;
        &lt;li&gt;Inline editing&lt;/li&gt;
    &lt;/ul&gt;    Another important requirement is to allow the footer to contain controls for adding&lt;br /&gt;
    new rows to the table&lt;br /&gt;
    &lt;div class=&quot;zemanta-pixie&quot; style=&quot;height: 15px; margin-top: 10px;&quot;&gt;        &lt;a class=&quot;zemanta-pixie-a&quot; href=&quot;http://www.zemanta.com/&quot; title=&quot;Enhanced by Zemanta&quot;&gt;&lt;br /&gt;
            &lt;img alt=&quot;Enhanced by Zemanta&quot; class=&quot;zemanta-pixie-img&quot; src=&quot;http://img.zemanta.com/zemified_e.png?x-id=b0d8aac6-693c-4959-b01a-5e04069b85cd&quot;
                style=&quot;border: none; float: right;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
    &lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/4800141763740796837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2010/10/my-lovely-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/4800141763740796837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/4800141763740796837'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2010/10/my-lovely-table.html' title='My lovely table'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Bogotá, Cundinamarca, Colombie</georss:featurename><georss:point>4.6319760286102154 -74.0626734495163</georss:point><georss:box>4.6313075286102157 -74.0635854495163 4.6326445286102151 -74.0617614495163</georss:box></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-7197000222192178955</id><published>2010-10-09T12:35:00.000-05:00</published><updated>2010-10-09T12:35:36.123-05:00</updated><title type='text'>Instantly Kill Bad Programs in Windows - Tekzilla Daily Tip</title><content type='html'>&lt;object style=&quot;background-image:url(http://i2.ytimg.com/vi/m89JTGsnys8/hqdefault.jpg)&quot; width=&quot;480&quot; height=&quot;295&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/m89JTGsnys8?fs=1&amp;amp;hl=fr_FR&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/m89JTGsnys8?fs=1&amp;amp;hl=fr_FR&quot; width=&quot;480&quot; height=&quot;295&quot; allowscriptaccess=&quot;never&quot; allowfullscreen=&quot;true&quot; wmode=&quot;transparent&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/7197000222192178955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2010/10/instantly-kill-bad-programs-in-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/7197000222192178955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/7197000222192178955'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2010/10/instantly-kill-bad-programs-in-windows.html' title='Instantly Kill Bad Programs in Windows - Tekzilla Daily Tip'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-867726448314371173</id><published>2010-08-25T21:56:00.000-05:00</published><updated>2010-08-25T21:56:30.246-05:00</updated><title type='text'>Ten Laws to Design By</title><content type='html'>&lt;a href=&quot;http://www.3point7designs.com/blog/2010/07/ten-laws-to-design-by/&quot;&gt;Ten Laws to Design By&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/867726448314371173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2010/08/ten-laws-to-design-by.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/867726448314371173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/867726448314371173'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2010/08/ten-laws-to-design-by.html' title='Ten Laws to Design By'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-759192776739976062</id><published>2010-08-03T21:39:00.000-05:00</published><updated>2010-08-03T21:39:27.144-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Aspx"/><category scheme="http://www.blogger.com/atom/ns#" term="Excel"/><title type='text'>Exporting webforms to Excel files</title><content type='html'>In this post I will explain a simple way to generate excel files out of webforms using &lt;a class=&quot;zem_slink&quot; href=&quot;http://en.wikipedia.org/wiki/MIME&quot; rel=&quot;wikipedia&quot; title=&quot;MIME&quot;&gt;mime types&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
It is very easy, just follow this steps:&lt;br /&gt;
&lt;br /&gt;
1. In the &quot;@ page&quot; declaration, add these attributes:&lt;b&gt;&amp;nbsp;EnableViewState=&quot;false&quot; CodePage=&quot;1252&quot;&lt;/b&gt;. By disabling viewstate you prevent some errors when opening the file with &lt;a class=&quot;zem_slink&quot; href=&quot;http://www.microsoft.com/mac/products/excel2008/default.mspx&quot; rel=&quot;homepage&quot; title=&quot;Microsoft Excel&quot;&gt;Excel&lt;/a&gt; and the CodePage is for allowing unicode characters to be displayed correctly in the worksheet.&lt;br /&gt;
&lt;br /&gt;
2. In the Page_Load handler, type the following line:&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;Response.ContentType = &quot;application/vnd.ms-excel&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;It is important to use this value because others (application/excel and application/ms-excel) does not work always.&lt;br /&gt;
&lt;br /&gt;
3. Do not use &lt;a class=&quot;zem_slink&quot; href=&quot;http://en.wikipedia.org/wiki/Cascading_Style_Sheets&quot; rel=&quot;wikipedia&quot; title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/a&gt; files. Since your content will be generated as an Excel file, you cannot link to external files. To allow styles, put all your css in the same page.&lt;br /&gt;
&lt;br /&gt;
That&#39;s it, by performing these steps you can now export an &lt;a class=&quot;zem_slink&quot; href=&quot;http://www.asp.net/&quot; rel=&quot;homepage&quot; title=&quot;ASP.NET&quot;&gt;aspx&lt;/a&gt; page to a Excel file.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px; font-weight: bold;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px; font-weight: bold;&quot;&gt;Related articles by &lt;a class=&quot;zem_slink&quot; href=&quot;http://www.zemanta.com/&quot; rel=&quot;homepage&quot; title=&quot;Zemanta&quot;&gt;Zemanta&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;zemanta-related&quot;&gt;&lt;ul class=&quot;zemanta-article-ul&quot;&gt;&lt;li class=&quot;zemanta-article-ul-li&quot;&gt;&lt;a href=&quot;http://www.edugeek.net/forums/scripts/60431-vba-vbscript-load-excel-files-folder-into-sql-server-2000-table.html&quot;&gt;VBA/VBScript to Load Excel Files In A Folder Into SQL Server 2000 table&lt;/a&gt; (edugeek.net)&lt;/li&gt;
&lt;li class=&quot;zemanta-article-ul-li&quot;&gt;&lt;a href=&quot;http://www.lockergnome.com/windows/2010/07/08/create-a-list-of-excel-worksheets/&quot;&gt;Create A List Of Excel Worksheets&lt;/a&gt; (lockergnome.com)&lt;/li&gt;
&lt;li class=&quot;zemanta-article-ul-li&quot;&gt;&lt;a href=&quot;http://www.excelhero.com/blog/2010/07/excel-optical-illusions-week-24.html&quot;&gt;Excel Optical Illusions Week #24&lt;/a&gt; (excelhero.com)&lt;/li&gt;
&lt;li class=&quot;zemanta-article-ul-li&quot;&gt;&lt;a href=&quot;http://www.lockergnome.com/it/2010/05/18/create-a-list-of-excel-worksheets/&quot;&gt;Create A List Of Excel Worksheets&lt;/a&gt; (lockergnome.com)&lt;/li&gt;
&lt;li class=&quot;zemanta-article-ul-li&quot;&gt;&lt;a href=&quot;http://www.makeuseof.com/tag/top-3-websites-download-free-excel-programs/&quot;&gt;Top 3 Websites To Download Useful Free Excel Programs&lt;/a&gt; (makeuseof.com)&lt;/li&gt;
&lt;li class=&quot;zemanta-article-ul-li&quot;&gt;&lt;a href=&quot;http://chandoo.org/wp/free-excel-templates-download/&quot;&gt;Excel Templates - Free Excel Templates, Excel Downloads, Excel Charts, VBA Macros and More | Chandoo.org - Learn Microsoft Excel Online&lt;/a&gt; (chandoo.org)&lt;/li&gt;
&lt;li class=&quot;zemanta-article-ul-li&quot;&gt;&lt;a href=&quot;http://www.brighthub.com/computing/windows-platform/articles/80628.aspx&quot;&gt;Using the Right Excel File Extension&lt;/a&gt; (brighthub.com)&lt;/li&gt;
&lt;li class=&quot;zemanta-article-ul-li&quot;&gt;&lt;a href=&quot;http://www.brighthub.com/computing/windows-platform/articles/79562.aspx&quot;&gt;Using a Microsoft Excel Reconciliation Template for Your Banking&lt;/a&gt; (brighthub.com)&lt;/li&gt;
&lt;li class=&quot;zemanta-article-ul-li&quot;&gt;&lt;a href=&quot;http://www.useragentman.com/blog/2010/07/27/cross-browser-html5-forms-using-modernizr-webforms2-and-html5widgets/&quot;&gt;Creating Cross Browser HTML5 Forms Now, Using modernizr, webforms2 and html5Widgets&lt;/a&gt; (useragentman.com)&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div class=&quot;zemanta-pixie&quot; style=&quot;height: 15px; margin-top: 10px;&quot;&gt;&lt;a class=&quot;zemanta-pixie-a&quot; href=&quot;http://www.zemanta.com/&quot; title=&quot;Enhanced by Zemanta&quot;&gt;&lt;img alt=&quot;Enhanced by Zemanta&quot; class=&quot;zemanta-pixie-img&quot; src=&quot;http://img.zemanta.com/zemified_e.png?x-id=c5d2d6f9-bb35-4531-8417-9b7ce9a6fad2&quot; style=&quot;border: none; float: right;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/759192776739976062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2010/08/exporting-webforms-to-excel-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/759192776739976062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/759192776739976062'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2010/08/exporting-webforms-to-excel-files.html' title='Exporting webforms to Excel files'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-6707884149187612909</id><published>2010-08-01T20:34:00.012-05:00</published><updated>2010-08-01T23:39:07.158-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Semantic queries"/><title type='text'>Readable queries</title><content type='html'>&lt;span xmlns=&quot;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span xmlns=&quot;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;It is important to every developer, to write semantic query to allow himself or other to easily understand what a query is intended to do. In this post I&#39;m going to describe a simple technique that I use every day to make my &lt;/span&gt;&lt;a class=&quot;zem_slink&quot; href=&quot;http://en.wikipedia.org/wiki/Database&quot; rel=&quot;wikipedia&quot; title=&quot;Database&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;database&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; queries easy to read and understand.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Let us suppose that we have the following database:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/_dhP_6Q9t7WM/TFYenetvtwI/AAAAAAAAN3M/RVf5ssEdYhs/s1600/StudentsDb.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;306&quot; src=&quot;http://2.bp.blogspot.com/_dhP_6Q9t7WM/TFYenetvtwI/AAAAAAAAN3M/RVf5ssEdYhs/s320/StudentsDb.png&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Casing&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Write your queries using &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;a class=&quot;zem_slink&quot; href=&quot;http://en.wikipedia.org/wiki/CamelCase&quot; rel=&quot;wikipedia&quot; title=&quot;CamelCase&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Pascal Casing&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;, i.e, capitalize the first character of every word as in:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Select * From Student&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Joins&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;When &lt;/span&gt;&lt;a class=&quot;zem_slink&quot; href=&quot;http://en.wikipedia.org/wiki/Writing&quot; rel=&quot;wikipedia&quot; title=&quot;Writing&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;writing&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &#39;joins&#39;, put the main entity in the first place. For instance, if I need to know all the students and their courses, notice that here I am &lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;talking about the students&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;, so the query would look like this:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Select *&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;From Student &lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;s&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; Join StudentCourse &lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;sc&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;On &lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;s&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;.StudentId = &lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;sc&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;.StudentId&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;In this query, notice that I used an alias for each table, since my tables are named using Pascal Casing, I can use the first character of every word for compounding the corresponding alias. Also notice that &#39;On&#39;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;statement is indented used one &lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;tab&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; which commonly is equivalent to four white spaces. The comparison of values for the &lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;join&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; is made following the same order of the tables, first for Student and then for StudentCourse.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;If you need to write longer &lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;joins&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; as in &#39;students with their corresponding payment and the courses&#39;, the query would be written as follows:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;Select *&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;From Student s Join Payment p&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; On s.StudentId = p.StudentId&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;Join StudentCourse sc&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; On s.StudentId = sc.StudentId&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Here I put the second join in a new line and keep the intent for the &lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;on&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; statement. This is very useful when writing very long queries that imply joining &lt;/span&gt;&lt;a class=&quot;zem_slink&quot; href=&quot;http://en.wikipedia.org/wiki/Data&quot; rel=&quot;wikipedia&quot; title=&quot;Data&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;data&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; between several tables.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt;  &lt;span class=&quot;Apple-style-span&quot;&gt;   &lt;/span&gt; &lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Select&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;In the select statement put the columns separated by comma in the same line except for those that either has an alias or is inside any function or both like this:&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Select Name, LastName, Hobby,&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Datepart(Year, Isnull(DoB, getDate())) Year,&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Amount, Description&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;From Student s Join Payment p&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&amp;nbsp;&amp;nbsp; On s.StudentId = p.StudentId&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Notice that in this query, the &lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Select&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; and the &lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;From&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; are separated by a blank line, this is easily separate the sections of the query. This query is written in &lt;/span&gt;&lt;a class=&quot;zem_slink&quot; href=&quot;http://www.microsoft.com/sqlserver&quot; rel=&quot;homepage&quot; title=&quot;Microsoft SQL Server&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Ms Sql Server&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; but the idea applies for other engines as well.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt;  &lt;span class=&quot;Apple-style-span&quot;&gt;   &lt;/span&gt; &lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Sub-queries&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;When writing sub-queries, follow the same rules but tab each sub-query according to its level and use the parenthesis as in the following example:&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Select *&lt;br /&gt;
From Student s Join (&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Select StudentId&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;From Payment&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Where Amount &amp;gt; 0&lt;br /&gt;
) HavePayments&lt;br /&gt;
&amp;nbsp;&amp;nbsp; On s.StudentId = Havepayments.StudentId&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;In&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; and &lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;not in&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Put the &lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;in&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; or the &lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;not in&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; at the end of the &lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;where&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; statement, this avoid confusing when reading the query. Compare these two queries:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Select *&lt;br /&gt;
From Student s&lt;br /&gt;
Where DoB = getDate()&lt;br /&gt;
And Name = &#39;Bob&#39;&lt;br /&gt;
And StudentId Not In(&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Select StudentId&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;From Payment&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Where Amount &amp;gt; 0&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Select *&lt;br /&gt;
From Student s&lt;br /&gt;
Where DoB = getDate()&lt;br /&gt;
And StudentId Not In(&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Select StudentId&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;From Payment&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Where Amount &amp;gt; 0&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 35pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;)&lt;br /&gt;
And Name = &#39;Bob&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;The first query is easier to understand because after the &lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;not in&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; there is no more query to read so you don&#39;t have to keep in mind the rest of the predicates in the &lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;where&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; statement.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Conclusion&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;This techniques help to write more semantic queries, easy to read and easy to understand. The examples given above are written in sql server but the main idea can be applied to other database engies.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Every query is different and no rules can be taken so seriously because you cannot force your query requirements fit these recommendations, but certainly you will notice the benefits of applying these techniques to your queries specially then they turn very long and complex.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div class=&quot;zemanta-pixie&quot; style=&quot;height: 15px; margin-top: 10px;&quot;&gt;&lt;a class=&quot;zemanta-pixie-a&quot; href=&quot;http://www.zemanta.com/&quot; title=&quot;Enhanced by Zemanta&quot;&gt;&lt;img alt=&quot;Enhanced by Zemanta&quot; class=&quot;zemanta-pixie-img&quot; src=&quot;http://img.zemanta.com/zemified_e.png?x-id=fd661c74-f431-4660-b389-aa7773906c32&quot; style=&quot;border: none; float: right;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/6707884149187612909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2010/08/semantic-and-readable-queries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/6707884149187612909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/6707884149187612909'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2010/08/semantic-and-readable-queries.html' title='Readable queries'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_dhP_6Q9t7WM/TFYenetvtwI/AAAAAAAAN3M/RVf5ssEdYhs/s72-c/StudentsDb.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-7627448345743722122</id><published>2010-07-16T15:09:00.003-05:00</published><updated>2010-08-01T20:46:46.343-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Excel"/><category scheme="http://www.blogger.com/atom/ns#" term="Interop"/><title type='text'>DISP_E_OVERFLOW</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;When working with Interop Excel, is better to read values from a given cell by using  mySheet.Range(&quot;A2&quot;).&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Value2&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt; instead of mySeet.Range(&quot;A2&quot;).&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Value&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;. This is because when a cell is not displaying the whole content, for instance &quot;######&quot; the property &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Value&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt; will throw the exception DISP_E_OVERFLOW, but when you are using &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Value2&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt; you will get the actual value inside the cell rather than the value displayed on the screen.&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/7627448345743722122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2010/07/dispeoverflow.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/7627448345743722122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/7627448345743722122'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2010/07/dispeoverflow.html' title='DISP_E_OVERFLOW'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-1022584902107816110</id><published>2010-07-15T17:58:00.001-05:00</published><updated>2010-07-16T12:49:55.682-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Django"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Setting up Django</title><content type='html'>I am currently beggining to work with Django, I followed the tutorial but in the second part, when trying to run the admin/ page, I get the error:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;name &#39;admin&#39; is not defined&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Later I noticed that the tutorial shows how the file urls.py should look like, and that there three lines uncommented:&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt; from django.contrib import admin&lt;br /&gt;
admin.autodiscover()&lt;br /&gt;
&lt;br /&gt;
(r&#39;^admin/&#39;, include(admin.site.urls))&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I was missing the first two lines.</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/1022584902107816110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2010/07/setting-up-django.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/1022584902107816110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/1022584902107816110'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2010/07/setting-up-django.html' title='Setting up Django'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5076461344159269131.post-1132083551936131639</id><published>2010-07-09T20:26:00.008-05:00</published><updated>2010-07-11T22:11:26.601-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><title type='text'>Get Query String Using Javascript</title><content type='html'>&lt;span xmlns=&quot;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Weeks ago I needed to get queystring parameters using JavaScript. I found a function called &lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://ilovethecode.com/Javascript/Javascript-Tutorials-How_To-Easy/Get_Query_String_Using_Javascript.shtml&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;querySt()&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;, this function is quite useful but I added an extra line that returns the string &quot;undefined&quot; in the case that the requested parameter does not exists in the querystring. My final code is:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: #d9d9d9;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;function querySt(ji) {&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: #d9d9d9;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;hu = window.location.search.substring(1);&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: #d9d9d9;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;gy = hu.split(&quot;&amp;amp;&quot;);&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: #d9d9d9;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for (i = 0; i &amp;lt; gy.length; i++) {&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: #d9d9d9;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ft = gy[i].split(&quot;=&quot;);&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: #d9d9d9;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (ft[0] == ji) {&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: #d9d9d9;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return ft[1];&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: #d9d9d9;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: #d9d9d9;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: #d9d9d9;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return &quot;undefined&quot;;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background: #d9d9d9;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;}&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://gr8code.blogspot.com/feeds/1132083551936131639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gr8code.blogspot.com/2010/07/get-query-string-using-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/1132083551936131639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5076461344159269131/posts/default/1132083551936131639'/><link rel='alternate' type='text/html' href='http://gr8code.blogspot.com/2010/07/get-query-string-using-javascript.html' title='Get Query String Using Javascript'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13985320779088159118</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>