<?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-914390830736708880</id><updated>2026-01-23T09:37:05.615+05:00</updated><category term="SQL"/><category term="SQL2000"/><category term="SQL2005"/><category term="sql server"/><category term="C#"/><category term=".NET"/><category term="open source"/><category term="Alternative"/><category term="arithmetic operator"/><category term="www.visualsoft-inc.com"/><category term="Microsoft"/><category term="android"/><category term="CHARINDEX"/><category term="Network"/><category term="Network operations center"/><category term="security"/><category term="Drop"/><category term="Image"/><category term="NOC"/><category term="PrimaryKey"/><category term="RFID"/><category term="SNMP"/><category term="SQLCMD"/><category term="Virtual Table"/><category term="Visual Studio"/><category term="Winform"/><category term="access control"/><category term="computer vision"/><category term="database"/><category term="decrypt"/><category term="desfire"/><category term="encrypt"/><category term="mifare"/><category term="reporting tools"/><category term="smart card"/><category term="sql select"/><category term="sysobjects"/><category term="trigger"/><category term="ultralight"/><category term="wifi"/><category term="AND"/><category term="ANSI"/><category term="APP_NAME"/><category term="AVC"/><category term="AVI"/><category term="Alphanumeric"/><category term="BIRT"/><category term="Barca"/><category term="BlockInput"/><category term="CORBA"/><category term="CSS"/><category term="CURRENT_USER"/><category term="Cartridge"/><category term="Connection string"/><category term="DBCC"/><category term="DPI"/><category term="DVD"/><category term="Datetime"/><category term="Dynamic location"/><category term="Emeditor"/><category term="Enable Disable Input"/><category term="Extinct"/><category term="Fax"/><category term="Frequency"/><category term="Function"/><category term="GUI"/><category term="Graphics"/><category term="Group By"/><category term="HF"/><category term="HP OpenView"/><category term="ISO 14443"/><category term="LF"/><category term="Love for all"/><category term="MSDE"/><category term="Microsoft Enterprise Library 2.0"/><category term="Microsoft Office"/><category term="Microsoft outlook"/><category term="Microsoft windows"/><category term="Monodevelop"/><category term="Network printer"/><category term="Notepad"/><category term="Nullable"/><category term="OID"/><category term="OR"/><category term="Openoffice"/><category term="Openreports"/><category term="Pegasus"/><category term="Pentaho"/><category term="Plasma"/><category term="RDBMS"/><category term="Rotate"/><category term="SHF"/><category term="SYSTEM_USER"/><category term="Select Union"/><category term="Sharpdevelop"/><category term="Soundex"/><category term="Technology"/><category term="Thunderbird"/><category term="Time Periods"/><category term="UHF"/><category term="UI"/><category term="UPDATEUSAGE"/><category term="VB6"/><category term="View"/><category term="Windows Mobile 7"/><category term="ad hoc"/><category term="alislam.org"/><category term="animal tracking"/><category term="asp.net"/><category term="asset management"/><category term="assignment operator"/><category term="battery"/><category term="business intelligence"/><category term="camera"/><category term="cd"/><category term="client_net_address"/><category term="cordova"/><category term="datadude"/><category term="datavision"/><category term="dbxtra"/><category term="ddl"/><category term="dm_exec_connections"/><category term="dml"/><category term="dotnet"/><category term="dynamic query"/><category term="electronic toll collection"/><category term="etc"/><category term="face detection"/><category term="floppy"/><category term="gesture recognition"/><category term="gmail"/><category term="gunning fog"/><category term="gunning fog index"/><category term="hatred for none"/><category term="hotspot"/><category term="iPod"/><category term="identity column"/><category term="indexof"/><category term="insert into"/><category term="izenda"/><category term="jasper"/><category term="java"/><category term="landline phone"/><category term="len"/><category term="loveforallhatredfornone.org"/><category term="master_files"/><category term="motion detection"/><category term="nagios"/><category term="nedi"/><category term="neooffice"/><category term="netsetman"/><category term="ntext"/><category term="null-coalesce"/><category term="opennms"/><category term="order by"/><category term="padding"/><category term="pandora"/><category term="parking"/><category term="phonegap"/><category term="physical_name"/><category term="pimero"/><category term="postbox"/><category term="proximity card"/><category term="replicate"/><category term="scaling"/><category term="select distinct"/><category term="sp_msForEachTable"/><category term="sp_spaceused"/><category term="spicebird"/><category term="split"/><category term="sql update"/><category term="structured query language"/><category term="substring"/><category term="syntax"/><category term="text"/><category term="tolling"/><category term="traffic"/><category term="vb.net"/><category term="vehicle management"/><category term="version history"/><category term="video analytics"/><category term="walkman"/><category term="where clause"/><category term="while loop"/><category term="wristwatch"/><category term="zenoss"/><category term="zimbra"/><title type='text'>Binary Myth</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>92</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-648472651613352632</id><published>2013-12-21T22:29:00.001+05:00</published><updated>2013-12-21T22:29:36.172+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="battery"/><title type='text'>Android Get Current Battery Level</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Get current battery level once on Android platform by using Battery_Changed Intent. This gets total scale value and current level to calculate.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public float getCurrentBatteryLevel() {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Intent battery = registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int batteryLevel =&amp;nbsp;battery.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int batteryScale =&amp;nbsp;battery.getIntExtra(BatteryManager.EXTRA_SCALE, -1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //to avoid error use this&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(batteryLevel == -1 || batteryScale == -1) {&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 50.0f;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return ((float)batteryLevel / (float)batteryScale) * 100.0f;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/648472651613352632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2013/12/android-get-current-battery-level.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/648472651613352632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/648472651613352632'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2013/12/android-get-current-battery-level.html' title='Android Get Current Battery Level'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-3617111690999999974</id><published>2013-12-21T22:23:00.000+05:00</published><updated>2013-12-21T22:39:27.458+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="hotspot"/><category scheme="http://www.blogger.com/atom/ns#" term="wifi"/><title type='text'>Android - Turn WiFi Hotspot On and Off Programmatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Programmatically turn WiFi Hotspot On and Off on android platform using following permissions in Manifest file.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;android.permission.ACCESS_WIFI_STATE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;android.permission.CHANGE_WIFI_STATE&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;and&amp;nbsp;following code&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;WifiManager wifi = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;WifiConfiguration wifi_config = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;wifi.setWifiEnabled(false); &lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;//True or False&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;//There is no direct call so use following...&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//USE REFLECTION ON THE METHOD NAMED //SetWifiAPEnabled//&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Method methodAP = wifi.getClass().getMethod(&quot;setWifiApEnabled&quot;, WifiConfig.class, boolean.class);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;methodAP&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;.invoke(wifi, wifi_config, false);&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;//True or False&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/3617111690999999974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2013/12/android-turn-wifi-hotspot-on-and-off.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/3617111690999999974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/3617111690999999974'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2013/12/android-turn-wifi-hotspot-on-and-off.html' title='Android - Turn WiFi Hotspot On and Off Programmatically'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-51121071806951206</id><published>2013-12-21T22:12:00.000+05:00</published><updated>2013-12-21T22:30:42.334+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="wifi"/><title type='text'>Android - Turn WiFi On and Off Programmatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Programmatically turn WiFi On and Off on android platform using following permissions in Manifest file.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;android.permission.ACCESS_WIFI_STATE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;android.permission.CHANGE_WIFI_STATE&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;
and&amp;nbsp;following code&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;WifiManager wifi_manager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;wifi_manager.setWifiEnabled(false); &lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;//True or False&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/51121071806951206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2013/12/android-turn-wifi-on-and-off.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/51121071806951206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/51121071806951206'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2013/12/android-turn-wifi-on-and-off.html' title='Android - Turn WiFi On and Off Programmatically'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-311733620406295312</id><published>2012-12-25T17:45:00.000+05:00</published><updated>2013-12-21T22:30:18.316+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="cordova"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="phonegap"/><title type='text'>cordova 2.2.0 messages.slice error in eclipse (android)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
When using cordova 2.2.0 in eclipse for android development if you see following error&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;TypeError: &#39;undefined&#39; is not a function (evaluating &#39;messages.slice(0, spaceIdx)&#39;) at file:///android_asset/www/cordova-2.2.0.js:1113&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
No need to worry, just do the following&lt;br /&gt;
&lt;br /&gt;
Change line 1101&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;messages = messagesFromNative.shift();&lt;/span&gt;&lt;br /&gt;
to&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;messages = messagesFromNative.shift() + &#39;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/311733620406295312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2012/12/cordova-220-messagesslice-error-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/311733620406295312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/311733620406295312'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2012/12/cordova-220-messagesslice-error-in.html' title='cordova 2.2.0 messages.slice error in eclipse (android)'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-3595179613248208566</id><published>2011-09-28T14:07:00.000+05:00</published><updated>2011-09-28T14:07:19.715+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>Dynamically Calculate Control Dimension at UI</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Calculate the dimension of controls at UI in term of rows*columns. This accepts parent container width/height and number of controls to draw. You may also provide what ratio you need for controls.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; Calculate control dimension as per parent size and required ratio&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;param name=&quot;ParentWidth&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;Parent control width&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;param name=&quot;ParentHeight&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;Parent control height&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;param name=&quot;TotalControls&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;Total control&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;param name=&quot;RatioX&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;X ratio of control to maintain&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;param name=&quot;RatioY&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;Y ratio of control to maintain&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;param name=&quot;TotalColumns&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;get columns&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;param name=&quot;TotalRows&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;get rows&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; CalculateDimensions(&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; ParentWidth, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; ParentHeight, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; TotalControls, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; RatioX, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; RatioY, &lt;span style=&quot;color: blue;&quot;&gt;out&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; TotalColumns, &lt;span style=&quot;color: blue;&quot;&gt;out&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; TotalRows)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none; text-indent: .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;TotalColumns = TotalRows = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; areaRatio = &lt;span style=&quot;color: #2b91af;&quot;&gt;Math&lt;/span&gt;.Sqrt(((&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)(ParentHeight * RatioX) / (&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)(ParentWidth * RatioY)) / (&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)TotalControls);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; expectedWidth = areaRatio * ParentWidth;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; expectedHeight = areaRatio * ParentHeight;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (ParentWidth &amp;gt; ParentHeight)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;TotalColumns = (&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;)&lt;span style=&quot;color: #2b91af;&quot;&gt;Math&lt;/span&gt;.Ceiling((&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)ParentWidth / (&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)expectedWidth);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&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; &lt;/span&gt;TotalRows = (&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;)&lt;span style=&quot;color: #2b91af;&quot;&gt;Math&lt;/span&gt;.Ceiling((&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)ParentHeight / (&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)expectedHeight);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none; text-indent: .5in;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;bool&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt; isOK = &lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;while&lt;/span&gt; (!isOK)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (ParentWidth &amp;gt; ParentHeight)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&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; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&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; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;TotalRows = (&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;)(&lt;span style=&quot;color: #2b91af;&quot;&gt;Math&lt;/span&gt;.Ceiling((&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)TotalControls / (&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)TotalColumns));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&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;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (TotalColumns &amp;gt;= TotalRows) isOK = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;; &lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt; TotalColumns++;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&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; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&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; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&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; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&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; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;TotalColumns = (&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;)(&lt;span style=&quot;color: #2b91af;&quot;&gt;Math&lt;/span&gt;.Ceiling((&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)TotalControls / (&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt;)TotalRows));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&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;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (TotalRows &amp;gt;= TotalColumns) isOK = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;; &lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt; TotalRows++;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&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; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; line-height: 115%; mso-no-proof: yes;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/3595179613248208566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/09/dynamically-calculate-control-dimension.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/3595179613248208566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/3595179613248208566'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/09/dynamically-calculate-control-dimension.html' title='Dynamically Calculate Control Dimension at UI'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-4923122082475761745</id><published>2011-06-30T14:59:00.000+05:00</published><updated>2011-06-30T14:59:58.810+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>C# Shortcuts (Automatic Properties)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
C # 3.0 introduces automatic properties. A property is usually (but not have to) to a private variable that is exposed to the outside world through getters and setters. The following is a common example of this&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;public class Employee
{
 private string _fName;
 public string FName
 {
    get { return _fName; }
    set { _fName = value; }
 }
}&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;Now see the magic...&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; white-space: normal;&quot;&gt;&lt;pre&gt;public class Employee
{
 public string FName { get; set; }
}&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; white-space: normal;&quot;&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/span&gt;&lt;pre&gt;C # compiler automatically creates a variable background and the right to get and set properties. Why is it useful? After all, you could have just done a string variable instead of a public class.

When you define as a property allows you to add validation logic in the current class at a later stage. The signature in the memory of the class will not change which means that any external library compiled code need not be recompiled
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/4923122082475761745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-automatic-properties.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/4923122082475761745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/4923122082475761745'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-automatic-properties.html' title='C# Shortcuts (Automatic Properties)'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-1689656132757043562</id><published>2011-06-30T14:46:00.000+05:00</published><updated>2011-06-30T14:46:06.169+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Nullable"/><title type='text'>C# Shortcuts (Nullable objects)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;The variable must have a value, can not be empty. Sometimes it would be convenient, it was possible to give a &quot;null&quot; (for example, undefined) variable. . NET 2.0 Nullable general use, that makes this possible. The next two lines to produce exactly the same purpose:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;Nullable&lt;int&gt; myVar = null;&lt;/int&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;or use this...&lt;/pre&gt;&lt;pre&gt;int?&amp;nbsp;myVar = null;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;By one ? According to a definition of the variable, the compiler will wrap a Nullable &lt;t&gt; generic type.&lt;/t&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/1689656132757043562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-nullable-objects.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/1689656132757043562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/1689656132757043562'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-nullable-objects.html' title='C# Shortcuts (Nullable objects)'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-1262510602814089448</id><published>2011-06-30T14:44:00.000+05:00</published><updated>2011-06-30T14:44:03.478+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>C# Shortcuts (Alias ​​long namespaces and types)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
The names of the identifiers of C # can be very long. For example if you are automating Microsoft Office in C #, you may want to do something as simple as MS Word to open and edit a document. You can use the &quot;use&quot; to create an alias for a class or namespace.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;using ShortWord = Microsoft.Office.Interop.Word;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;Now in code simply use ShortWord where ever you want...&lt;/pre&gt;&lt;pre&gt;ShortWord.Application = new ShortWord.Application() { Visible = True; }&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/1262510602814089448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-alias-long-namespaces-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/1262510602814089448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/1262510602814089448'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-alias-long-namespaces-and.html' title='C# Shortcuts (Alias ​​long namespaces and types)'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-1416704256165628077</id><published>2011-06-30T14:39:00.000+05:00</published><updated>2011-06-30T14:39:52.155+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>C# Shortcuts (Using Statement)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
Often, you will need to allocate a system resource or network resources, etc. Each time you need such a resource, there are three crucial steps to go through:&lt;br /&gt;
&lt;br /&gt;
You will have the resource you use, and then get rid of it. If you forget to properly dispose of it, you create a memory or resource leaks. This is best illustrated through the following models&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;// Step-A. Allocation of desired object here
Font myFont = new Font(&quot;Arial&quot;, 12.0f);
try
{
     // Step-B. use the resource (myFont) here
}
finally
{
     // Step-C. Dispose your object here
     if (myFont != null)
        ((IDisposable)myFont).Dispose();
}&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;Using allows us to use to compress this to:&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; white-space: normal;&quot;&gt;&lt;pre&gt;//Allocate the desired resource here
using (Font myFont = new Font(&quot;Arial&quot;, 12.0f))
{
    // Use the resource here
}
&lt;b&gt;// The best part is that Disposal is automatic.&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/1416704256165628077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-using-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/1416704256165628077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/1416704256165628077'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-using-statement.html' title='C# Shortcuts (Using Statement)'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-769726111965062418</id><published>2011-06-30T14:31:00.000+05:00</published><updated>2011-06-30T14:31:35.929+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>C# Shortcuts (Object Initializers)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
When you create a new object, it is often necessary to assign one or more of its properties. The introduction of C # 3.0 you can now use object initializers, and to improve the readability of this, and reduce your code&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;Employee emp = new&amp;nbsp;Employee();&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;emp.Name = &quot;Mr Smith&quot;;
&lt;/span&gt;emp&lt;span class=&quot;Apple-style-span&quot;&gt;.Designation = &quot;Driver&quot;;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;Now make it short like this...&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;Employee emp = new&amp;nbsp;Employee {&lt;span class=&quot;Apple-style-span&quot;&gt;emp.Name = &quot;Mr Smith&quot;, &lt;/span&gt;emp&lt;span class=&quot;Apple-style-span&quot;&gt;.Designation = &quot;Driver&quot;};&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; white-space: normal;&quot;&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; white-space: normal;&quot;&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/pre&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/769726111965062418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-object-initializers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/769726111965062418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/769726111965062418'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-object-initializers.html' title='C# Shortcuts (Object Initializers)'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-8026397278456868252</id><published>2011-06-30T14:27:00.000+05:00</published><updated>2011-06-30T14:27:12.311+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="null-coalesce"/><title type='text'>C# Shortcuts (?? Null Coalesce Operator)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;How often to check for null values ​​in the code?&lt;br /&gt;
Then the null-coalesce operator (??) is convenient. To see how this works, consider the following sample code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;object c = null;
object a = new object();
object b;

if (c != null)
    b = c;
else
   b = a;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;Now using the &quot;?&quot; conditional statement you may write it as...&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; white-space: normal;&quot;&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;object c = null;
object a = new object();
object b = (c != null) ? c : a;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;Now make it even shorter using ?? null-coalesce operator...&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; white-space: normal;&quot;&gt;&lt;pre&gt;object c = null;
object a = new object();
object b = c ?? a;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; white-space: normal;&quot;&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/8026397278456868252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-null-coalesce-operator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/8026397278456868252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/8026397278456868252'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-null-coalesce-operator.html' title='C# Shortcuts (?? Null Coalesce Operator)'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-3262291175396476117</id><published>2011-06-30T14:11:00.000+05:00</published><updated>2011-06-30T14:11:33.961+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>C# Shortcuts (? Conditional Operator)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&quot;?&quot; operator is convenient. It allows you to pack a common &quot;if then else&quot; statement model in a single activity&lt;br /&gt;
&lt;br /&gt;
Normally we use the following.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;int x = 70;
int y = 95;
int min;

if (x &amp;lt; y)
  min = x;
else
  min = y;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;But this can be written as...&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; white-space: normal;&quot;&gt;&lt;pre&gt;int x = 70;
int y = 95;
int min = (x &amp;gt; y) ? x : y;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/3262291175396476117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-conditional-operator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/3262291175396476117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/3262291175396476117'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/c-shortcuts-conditional-operator.html' title='C# Shortcuts (? Conditional Operator)'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-4214700803994664801</id><published>2011-06-28T14:45:00.000+05:00</published><updated>2011-06-28T14:45:49.777+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>CSS Positioning - Elements Center Alignment</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
CSS is a mighty beast, and an integral part of any self-respecting web site. After all, this power comes a lot of different tricks you can use to accomplish the mission. Some of the tricks associated with the placement of content, and today we are going to do with it. This tutorial we are going to reveal some of the best ways to center the content when the content may be.&lt;br /&gt;
&lt;br /&gt;
There are many ways the center of your content using CSS. Some are a little further forward than the other channel, but fortunately they are all relatively simple to implement. At the end of this tutorial, you should be able to do something like this:&lt;br /&gt;
&lt;br /&gt;
I&#39;m focused!&lt;br /&gt;
&lt;br /&gt;
Center Horizontally&lt;br /&gt;
&lt;br /&gt;
One of the easiest ways you can use elements of the center is the text-align: center on the package contents. For example:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt; I am Centered... &lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
As you can see we use the property text-align both the content and packaging. It is because we center the text on the parent div that will be inherent inner div. So we must adapt our text inside div to the left. It is easy to implement, but not perfect.&lt;br /&gt;
&lt;br /&gt;
We can indeed use the margins to the horizontal center of things as well. But when you use the margins, we generally have a content container that has a defined size. Sometimes you even have to give your wrapper contained an exact size, as well. For the first example, we started with the worst:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;width: 400px;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-left: 150; width: 100px;&quot;&gt; Again Centered... &lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
As you can see that we have to give us both the packaging and the width of our container. Because we all know the numbers, we can do some &#39;math to reach our goal. We are half the width of the pack, which is 200 pixels, subtract half the width of the content. This gives us a margin of 150 pixels, which is the central fact in full. Although this is strictly forward and ensures that the content is at the center no matter what the width of our wrapper, it is an easier way.&lt;br /&gt;
&lt;br /&gt;
This method consists in the margins of automobiles, which means that the CSS margins are calculated for us. In this case, we still have to give our content contains a wide range of ... but our package. This means that our budget can be any size you want. In addition, we can shorten the margin up / down left / right as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin: 0 auto; width: 100px;&quot;&gt; Atlast I Am focused... &lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
This is usually the preferred method to center the content, but there is a problem. If you are looking for a good match, you must go to the text with the alignment method, such as automatic margins are not supported by all browsers. All modern browsers support auto margins, but not only in older browsers.&lt;br /&gt;
&lt;br /&gt;
If you feel adventurous, try our latest example of the horizontal center. It is &quot;relatively&quot; the positioning of the contents of our container, and then move a little. This is what it would look like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;left: 50%; margin-left: -50px; position: relative; width: 100px;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
I&#39;m focused!&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Here we take the content and the relative position of it. This allows us to use the property left to move the content around us, which we used for the left: 50%. This will move the content, but not centralized, as the top left hand pointing to the center of the contents of the container, moves to the right. To satisfy this, as the first example, the margin is calculated half-width of our content, but this time we are reducing the current drive. The end result is a central content.&lt;br /&gt;
&lt;br /&gt;
So those are the main ways to get in half horizontally and CSS. There are other tricks you can do things, but these methods are the most common, and in the case of the first two, the most dynamic. However, there is a trick to get things centered vertically.&lt;br /&gt;
&lt;br /&gt;
Center Vertically&lt;br /&gt;
&lt;br /&gt;
This is where the trick There are two ways to focus your content vertically on the page. But before you dig I want to emphasize that both methods require your content for a specified height. There are several ways to focus on content without having to adjust the height, but they showed a lack of compatibility between browsers. These two routes are your best paris.&lt;br /&gt;
&lt;br /&gt;
The first way is exactly the same concept as our last example horizontally, except suitable for the vertical position. It looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;height: 100px; margin-top: -50px; position: relative; top: 50%;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
I&#39;m focused!&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
As you can see that the same basic concept. You respect the position of the content in the middle, then offset by half its height. It works in virtually any browser, you will meet, and is simple to implement. A good solution, but that&#39;s another way of doing things.&lt;br /&gt;
&lt;br /&gt;
This solution is a bit strange at first, but it is the best way to center the content vertically. That said, it is a sensitive issue. Using a floating div to force the contents in the center of the page, and we all know that things float can be a pain at times. Fortunately, implementation is very simple:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;float: left; height: 50%; margin-bottom: -50px; width: 1px;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;clear: both; height: 100px; position: relative;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
The Centered!&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
So now we have this new arc, which can be called at the end float guide our container contents, a vertical center of the page. As long be remembered as the &quot;clear&quot; the entire contents of the container works as expected. To make things better, this method is said to be a very wise browser compatible, which means that it works with IE 5&lt;br /&gt;
&lt;br /&gt;
While there are all sorts of crazy ways to center the content vertically, if you just want some centered text. Of course, you can use one of the solutions above, but this seems a little bit exaggerated. Well, it was our secret third option comes into play.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;height: 50px; line-height: 50px;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
I&#39;m focused!&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
This is one of the center line of the text, and I want to stress one. I&#39;m sure you&#39;ve noticed that the key to this method is the line height, which makes every line of text a certain height. This means that if the text is wrapped, the following line is 50 pixels high. This makes it a good solution if you need a quick solution for a line of text, but something else later.&lt;br /&gt;
&lt;br /&gt;
So this is a set of techniques are the best solutions for centering content, then x and y planes They are simple to use, and get the job done. This concludes this tutorial, but just remember, when you need help coding have to do is connect the Code.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/4214700803994664801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/css-positioning-elements-center.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/4214700803994664801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/4214700803994664801'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/css-positioning-elements-center.html' title='CSS Positioning - Elements Center Alignment'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-2924123910502853539</id><published>2011-06-28T13:50:00.000+05:00</published><updated>2011-06-28T13:50:40.395+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows Mobile 7"/><title type='text'>Being A Developer of Windows Mobile 7</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
I have a sad news :( &amp;nbsp;I have never built a Windows Mobile 7 applications.&lt;br /&gt;
As Guy Blend and WPF, which bubbled over in Silverlight, it may shock you, but time and effort (not enough of the former and too much of it) kept me do it Hello everyone. Of course, it does not allow Verizon Stinkin WP7 has not yet, but we hope that this issue will arrange soon.&lt;br /&gt;
&lt;br /&gt;
Since I promised to write an annex to the mix in the action focuses on the mixture WP7, I think it&#39;s time we jumped on the bandwagon and made some WP7 development.&lt;br /&gt;
&lt;br /&gt;
Where I am from&lt;br /&gt;
&lt;br /&gt;
Since I have Visual Studio and Expression Blend installed everything I need to start developing was to download and install the developer tools Windows Phone. This includes the emulator and necessary WP7 types of projects. If you do not Blend or Visual Studio on your machine, free tools are a part of this installation.&lt;br /&gt;
&lt;br /&gt;
Register App Hub&lt;br /&gt;
&lt;br /&gt;
Since I intend to create and publish real applications I went ahead and created an account AppHub. There are some things you should know before you start. First, it costs $ 99 in advance, so be prepared to pay when creating your account. Second, you need a Live ID. Third, you can not create an account without a website URL. While this may seem trivial, it threw me because I did not create this site, I intend to use my phone still Apps. I went ahead and use this site with the hope that I can change it later.&lt;br /&gt;
&lt;br /&gt;
The next thing I did not expect the requirement of a tag as a player. I&#39;m not a gamer, I do not own an Xbox, and I&#39;m not sure what player is a tag, so I obviously did not deliver. I was stuck on the screen gamer tag you want for a while until I found one I wanted, which was not taken (theblendguy).&lt;br /&gt;
&lt;br /&gt;
The last thing that threw me for a circuit that was to fill in forms, all copies is strongly oriented to XBox Live. Once past the home screen, everything I&#39;ve read the account was in XBox Hub of the application: there was no mention of Windows Mobile 7. I canceled to make sure I had made the right decision, but decided to go to my guns, especially when I saw the price was right. In fact, when all was said and done, I had the appropriate account.&lt;br /&gt;
&lt;br /&gt;
I received an email confirmation, and graduated from the account. If I understand correctly, the next step is to contact me and GeoTrust to verify I am who I say I am. I like the fact that Microsoft is putting so much effort to examine the accounts and applications: in the long term should mean a stable quality of the applications, which is the beginning, if you want to succeed.&lt;br /&gt;
&lt;br /&gt;
And here is the next step...&lt;br /&gt;
&lt;br /&gt;
The next step is the development of applications. I have a couple in mind already. I&#39;m going to write my experiences as I go forward, so keep watching this space.&lt;br /&gt;
&lt;br /&gt;
The next day I created my account, I received an email from GeoTrust take me to another site where I had to verify my identity. From the start, be prepared for some questions seem intrusive. I had to give them my social security number and possibly my license and some less info such as date of birth and address. Also, if you have been at your current address for less than two years, you must provide the previous address.&lt;br /&gt;
&lt;br /&gt;
This information is the first step. When you place this time, another page comes with a set of questions specific financial, which, theoretically, you should be able to respond. I received questions about my mortgage and car payment, including a couple of trick questions. The answers are multiple choice, so you do not give them special, and it does not matter, because it seems they know it all already anyway.&lt;br /&gt;
&lt;br /&gt;
Of course this is all done in HTTPS, so I&#39;m not concerned about the safety of me when I use a credit card online. I was quite surprised that although the BI is in place to develop a trick question that I mentioned. (And no, I&#39;m not going to be more specific). Overall, the process was tedious, and I passed the test at this stage I&#39;m just waiting for my developer ID AppHub. I will keep you all posted.&lt;br /&gt;
&lt;br /&gt;
And wait for the message in your inbox.&lt;br /&gt;
&lt;br /&gt;
Now that you&#39;re an official you can start to develop, and applications.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/2924123910502853539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/being-developer-of-windows-mobile-7.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/2924123910502853539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/2924123910502853539'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/being-developer-of-windows-mobile-7.html' title='Being A Developer of Windows Mobile 7'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-3267407904609475991</id><published>2011-06-28T13:40:00.000+05:00</published><updated>2011-06-28T13:40:55.372+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>To Recompile All The Stored Procedures For Database</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
Recompiling an object is an advantage when the &quot;indexes or other changes that affect statistics are made the database, compiled stored procedures and triggers may lose efficiency. Sp_recompile is a system stored procedure in SQL to rebuild an object, the next time it runs. Recompiling you can re-optimize queries.&lt;br /&gt;
&lt;br /&gt;
Here is the query to recompile all the SPS in the database.&lt;br /&gt;
&lt;br /&gt;
Declare @ name nvarchar (125), @ cmd nvarchar (300)&lt;br /&gt;
&lt;br /&gt;
SPList declare the cursor / Cursor * It must be observed to go through all the SPS DB * /&lt;br /&gt;
&lt;br /&gt;
Select the name of sys.objects&lt;br /&gt;
&lt;br /&gt;
where type = &#39;P&#39;&lt;br /&gt;
&lt;br /&gt;
SPList open&lt;br /&gt;
&lt;br /&gt;
FETCH NEXT from SPList / * get the record of the cursor * /&lt;br /&gt;
&lt;br /&gt;
in the name @&lt;br /&gt;
&lt;br /&gt;
While @ @ FETCH_STATUS = 0&lt;br /&gt;
&lt;br /&gt;
start&lt;br /&gt;
&lt;br /&gt;
Select @ cmd = &#39;EXEC sp_recompile [&#39; + @ name + &#39;]&#39;&lt;br /&gt;
&lt;br /&gt;
Exec @ cmd / * recompile the SP * /&lt;br /&gt;
&lt;br /&gt;
FETCH NEXT SPList / * Get the name of SP after the cursor * /&lt;br /&gt;
&lt;br /&gt;
@ In the name&lt;br /&gt;
&lt;br /&gt;
Head&lt;br /&gt;
&lt;br /&gt;
SPList close&lt;br /&gt;
&lt;br /&gt;
Deallocate SPList&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/3267407904609475991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/to-recompile-all-stored-procedures-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/3267407904609475991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/3267407904609475991'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/to-recompile-all-stored-procedures-for.html' title='To Recompile All The Stored Procedures For Database'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-5153548964995743452</id><published>2011-06-28T13:36:00.002+05:00</published><updated>2011-06-28T13:36:11.683+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Remove The NOT NULL Column Constraint ALTER TABLE</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
Many times it may be necessary to remove the limitation Not Null applied to a column in a table. It is generally necessary to overcome the unexpected integrity constraints (which rarely happens, if well designed) against a table. We can remove the constaint Not Null using the ALTER TABLE .... ALTER COLUMN ... option.&lt;br /&gt;
&lt;br /&gt;
A sample query is&lt;br /&gt;
&lt;br /&gt;
Alter table dbo.Test&lt;br /&gt;
&lt;br /&gt;
alter column test nvarchar (10) null;&lt;br /&gt;
&lt;br /&gt;
You can also reuse the next.&lt;br /&gt;
&lt;br /&gt;
Alter table dbo.Test&lt;br /&gt;
&lt;br /&gt;
alter column test nvarchar (10) NOT NULL;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/5153548964995743452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/remove-not-null-column-constraint-alter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/5153548964995743452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/5153548964995743452'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/remove-not-null-column-constraint-alter.html' title='Remove The NOT NULL Column Constraint ALTER TABLE'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-7295641150232180863</id><published>2011-06-28T13:33:00.002+05:00</published><updated>2011-06-28T13:33:54.573+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CHARINDEX"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Find The Model For SQL Server Using PATINDEX () And CHARINDEX ()</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
Although these features are not commonly used, is very powerful in the search for a reason and return the location of the text / string / model. By understanding the functionality of the string functions, we will be able to understand the difference too.&lt;br /&gt;
&lt;br /&gt;
PATINDEX ()&lt;br /&gt;
&lt;br /&gt;
The search function of a pattern in a string / expression and returns the starting position of the first occurrence of the pattern. It works similarly to the operator, as in any application.&lt;br /&gt;
&lt;br /&gt;
The general syntax is&lt;br /&gt;
&lt;br /&gt;
PATINDEX (&#39;% pattern%&#39;, expression)&lt;br /&gt;
&lt;br /&gt;
You may have already noticed the &#39;%&#39; symbols used in the model. These are important, as I mentioned before, using the same syntax used for research by the LIKE operator.&lt;br /&gt;
&lt;br /&gt;
Choose PATINDEX (&#39;% System%&#39;, description) index location, description&lt;br /&gt;
&lt;br /&gt;
From dbo.TestTable&lt;br /&gt;
&lt;br /&gt;
CHARINDEX ()&lt;br /&gt;
&lt;br /&gt;
CHARINDEX () function is similar to PATINDEX (). However, CHARINDEX search for the string expression specified in the start position (Start loction default is 1). If you have already noted above, we can begin to determine the position of PATINDEX ()&lt;br /&gt;
&lt;br /&gt;
The general syntax is&lt;br /&gt;
&lt;br /&gt;
CHARINDEX (expression1, expression2 [, start_location])&lt;br /&gt;
&lt;br /&gt;
An example of the same data set used earlier would look like&lt;br /&gt;
&lt;br /&gt;
Select CHARINDEX (&quot;System&quot;, description) index position, description&lt;br /&gt;
&lt;br /&gt;
from dbo.TestTable&lt;br /&gt;
&lt;br /&gt;
We can also start position indlude. Below is a sample search function in the string from the position of three&lt;br /&gt;
&lt;br /&gt;
Select charindex (&quot;System&quot;, description, 3) indexlocation Description&lt;br /&gt;
&lt;br /&gt;
from dbo.TestTable&lt;br /&gt;
&lt;br /&gt;
Finally, the main difference between the PATINDEX () and CHARINDEX () is the ability to CHARINDEX To find a specific location.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/7295641150232180863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/find-model-for-sql-server-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/7295641150232180863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/7295641150232180863'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/find-model-for-sql-server-using.html' title='Find The Model For SQL Server Using PATINDEX () And CHARINDEX ()'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-7093472942656832803</id><published>2011-06-28T13:30:00.002+05:00</published><updated>2011-06-28T13:30:58.614+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DBCC"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Reindex The Database With A Large Gap With &quot;DBCC DBREINDEX&quot;</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
DBCC commands is one of the most commonly used are DBAs worldwide. Today I&#39;m going to present a simple way to index the specific table or all indexes using DBCC.&lt;br /&gt;
&lt;br /&gt;
The command used for this is&lt;br /&gt;
&lt;br /&gt;
DBCC DBREINDEX&lt;br /&gt;
&lt;br /&gt;
General Sytax&lt;br /&gt;
&lt;br /&gt;
DBCC DBREINDEX&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
&lt;br /&gt;
table_name&lt;br /&gt;
&lt;br /&gt;
[, Index_name [, fillfactor]]&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
The best feature of this command is that we need not abandon such unique or primary key restrictions applied to the index to rebuild the index. This means that the index can be rebuilt without knowing the structure of a table or limitations.&lt;br /&gt;
&lt;br /&gt;
It accepts three parameters. The table name, index name and the fill factor.&lt;br /&gt;
&lt;br /&gt;
This is an example below&lt;br /&gt;
&lt;br /&gt;
The command below will not be indexed and table &quot;IDX_EMPL&quot; &quot;TBL_DIM_EMPL&quot; with a fill factor of 80&lt;br /&gt;
&lt;br /&gt;
DBCC DBREINDEX (&quot;TBL_DIM_EMPL&quot;, &quot;IDX_EMPL&quot;, 80)&lt;br /&gt;
&lt;br /&gt;
The following command reindex all indexes on the table &quot;TBL_DIM_EMPL&quot;&lt;br /&gt;
&lt;br /&gt;
DBCC DBREINDEX (&quot;TBL_DIM_EMPL&quot;, &quot;&quot;, 80)&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/7093472942656832803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/reindex-database-with-large-gap-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/7093472942656832803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/7093472942656832803'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/reindex-database-with-large-gap-with.html' title='Reindex The Database With A Large Gap With &quot;DBCC DBREINDEX&quot;'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-1065405315821329478</id><published>2011-06-28T13:27:00.002+05:00</published><updated>2011-06-28T13:27:52.589+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>What NULLIF () Do? How It Differs From ISNULL ()?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
NULLIF () returns zero if the two specified expressions are equal in function.&lt;br /&gt;
&lt;br /&gt;
Syntax&lt;br /&gt;
&lt;br /&gt;
NULLIF (expression1, expression2)&lt;br /&gt;
&lt;br /&gt;
If expression1 = expression2, the function returns NULL.&lt;br /&gt;
&lt;br /&gt;
ISNULL () function replaces an expression with no specified value.&lt;br /&gt;
&lt;br /&gt;
The syntax used is&lt;br /&gt;
&lt;br /&gt;
ISNULL (expression1, expression2)&lt;br /&gt;
&lt;br /&gt;
If expr1 is NULL, then the function returns expression2 output.&lt;br /&gt;
&lt;br /&gt;
ISNULL functionality can be written using if ... WHEN the&lt;br /&gt;
&lt;br /&gt;
CASE WHEN expression1 THEN END ELSE NULL Expression2 expression1&lt;br /&gt;
&lt;br /&gt;
An example of these two functions are shown below&lt;br /&gt;
&lt;br /&gt;
Select ISNULL (NULL, &#39;hello&#39;) as IsNullOutPut1&lt;br /&gt;
&lt;br /&gt;
, IsNull (1001, 1) as IsNullOutPut2&lt;br /&gt;
&lt;br /&gt;
, NULLIF (100, 100) that NullIfOutPut1&lt;br /&gt;
&lt;br /&gt;
, NULLIF (1, 100) that NullIfOutPut2&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/1065405315821329478/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/what-nullif-do-how-it-differs-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/1065405315821329478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/1065405315821329478'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/what-nullif-do-how-it-differs-from.html' title='What NULLIF () Do? How It Differs From ISNULL ()?'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-1544543286570632828</id><published>2011-06-28T13:23:00.002+05:00</published><updated>2011-06-28T13:23:57.445+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Changing The SQL Database In Single User Mode And Back To The Multi-User Mode</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
It is often necessary to modify the database in single user mode, especially if you are the DBA. A simple example would be to change the sorting options, or settings TE. A single user only allows a user (typically the DBA) to access the database. Therefore, it is easy to make changes without worrying about the blind alleys, and any claim, DB, and also without affecting users.&lt;br /&gt;
&lt;br /&gt;
It is very easy to change the database in single user mode, in fact, it&#39;s just a script. Use the following script to change the mode.&lt;br /&gt;
&lt;br /&gt;
ALTER DATABASE &amp;lt; &lt;database name=&quot;&quot;&gt; &amp;gt; SET SINGLE_USER no_wait&lt;/database&gt;&lt;br /&gt;
&lt;br /&gt;
NO_WAIT clause to set the single-user mode, when you run the query. Replacing this is to use the system stored sp_dboption&lt;br /&gt;
&lt;br /&gt;
EXEC sp_dboption &amp;lt; &lt;data base=&quot;&quot; name=&quot;&quot;&gt; &amp;gt; &#39;SINGLE USER&#39;, False&lt;/data&gt;&lt;br /&gt;
&lt;br /&gt;
However, you must set the database in multiuser mode for other users to use. Without it, it will not be available to others.&lt;br /&gt;
&lt;br /&gt;
Here is a script to set the basis for multi-mode.&lt;br /&gt;
&lt;br /&gt;
ALTER DATABASE &amp;lt; &lt;database name=&quot;&quot;&gt; &amp;gt; GAME MULTI_USER no_wait&lt;/database&gt;&lt;br /&gt;
&lt;br /&gt;
Or alternative&lt;br /&gt;
&lt;br /&gt;
EXEC sp_dboption &amp;lt; &lt;data base=&quot;&quot; name=&quot;&quot;&gt; &#39;SINGLE USER&#39;&amp;gt;, False&lt;/data&gt;&lt;br /&gt;
&lt;br /&gt;
I advise you to maintain caution while changing database in single user mode, because it would link users already connected to the database.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/1544543286570632828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/changing-sql-database-in-single-user.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/1544543286570632828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/1544543286570632828'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/changing-sql-database-in-single-user.html' title='Changing The SQL Database In Single User Mode And Back To The Multi-User Mode'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-651062950888157798</id><published>2011-06-28T13:18:00.000+05:00</published><updated>2011-06-28T13:18:22.297+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>The Benefits And The Differences Between CHAR And VARCHAR Data Types For SQL Server</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
All of you reading this have encountered these types of data, but have you ever thought about what the differences and advantages of the two?&lt;br /&gt;
&lt;br /&gt;
The obvious difference that comes to mind in length. Yes! You are right. Varchar Char supports of various lengths and supports fixed length. This is the main advantage of the VARCHAR data type. For example, consider the varchar (10) and char (10). You can save the &quot;GEEKEPISODE&quot; Both types of data using the entire length of the target and save the &quot;geek&quot;, char data type to use 10 characters in common, but only 4 VARCHAR&lt;br /&gt;
&lt;br /&gt;
From the above examples, it seems better than CHAR VARCHAR all the time. But remember, CHAR was included as a separate type because it has certain advantages over VARCHAR.&lt;br /&gt;
&lt;br /&gt;
VARCHAR use the extra space to store the length of the string stored in it, and mark the end of the string. Considering that the char data type does not use this extra space. This is certainly the advantage of data type CHAR.&lt;br /&gt;
&lt;br /&gt;
Summary:&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;CHAR&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;It is used to store a fixed string / character data&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;It requires no additional space / bytes to capture the length and the end of the string.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Still, if the length of the string data / character is fixed. Example: SSN, systemId, EmpID.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;It is faster than VARCHAR, when used in collections and queries.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;VARCHAR&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Used to store variable-length string.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Requires additional bytes / space to enter the time and the end of the chain.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;use, if the length of the data string / character can not be determined at the design stage. Example: name, brief description&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;Slower than the CHAR data type when used in collections and queries.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Here the above explanation also applies to data types nchar and nvarchar.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/651062950888157798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/benefits-and-differences-between-char.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/651062950888157798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/651062950888157798'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/benefits-and-differences-between-char.html' title='The Benefits And The Differences Between CHAR And VARCHAR Data Types For SQL Server'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-4555908945008394159</id><published>2011-06-28T13:09:00.000+05:00</published><updated>2011-06-28T13:09:16.496+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQLCMD"/><title type='text'>The Script In The Batch File Using Sqlcmd</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
I often create batch files to run SQL scripts (especially SPS), and then schedule jobs using SQL Agent / Task Scheduler. In this post, I will show you how to create a batch file with SQL commands.&lt;br /&gt;
&lt;br /&gt;
First, the command used to execute SQL queries commnd SQLCMD system. The general syntax of this command is available on the link. I&#39;m going with a single as follows&lt;br /&gt;
&lt;br /&gt;
Server Name sqlcmd-Q-ES-o Query &quot;Output Path&quot;&lt;br /&gt;
&lt;br /&gt;
here&lt;br /&gt;
&lt;br /&gt;
E = secure connection (Windows Authentication)&lt;br /&gt;
&lt;br /&gt;
-Server Name = S&lt;br /&gt;
&lt;br /&gt;
-Q = CommandLineQuery&lt;br /&gt;
&lt;br /&gt;
O = output file path&lt;br /&gt;
&lt;br /&gt;
a simple command prompt can commnad&lt;br /&gt;
&lt;br /&gt;
C: \ Users \ geekEpisodes&amp;gt; sqlcmd-IS &quot;Local-SRV01&quot;-Q &quot;Select top 10 * from MyTestDatabase .. [ForecastHistory]&quot;-o &quot;C: \ New Folder \ output.txt&quot;&lt;br /&gt;
&lt;br /&gt;
All commands you execute the command can be run from batch control / files. to create a batch file with SQL commands to follow the steps below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1: Create a file with a bat or cmd (for example testfile.bat, test.cmd) ...&lt;br /&gt;
&lt;br /&gt;
2: Add the file commands such as&lt;br /&gt;
&lt;br /&gt;
sqlcmd-IS &quot;Local-SRV01&quot;-Q &quot;Select top 10 * from MyTestDatabase .. [ForecastHistory]&quot;-o &quot;C: \ New Folder \ output.txt&quot;&lt;br /&gt;
&lt;br /&gt;
sqlcmd-IS &quot;Local-SRV01&quot;-Q &quot;select count (1) of MyTestDatabase .. [ForecastHistory]&quot;-o &quot;C: \ New Folder \ Output2.txt&quot;&lt;br /&gt;
&lt;br /&gt;
sqlcmd-ES &quot;SRV01 local&quot;-Q &quot;Exec MyTestDatabase .. [spPopulateData]&quot;&lt;br /&gt;
&lt;br /&gt;
3: Now save it.&lt;br /&gt;
&lt;br /&gt;
4: Double-click the file and query the file exeuted. This file can be used in the Task Scheduler and other applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/4555908945008394159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/script-in-batch-file-using-sqlcmd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/4555908945008394159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/4555908945008394159'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/script-in-batch-file-using-sqlcmd.html' title='The Script In The Batch File Using Sqlcmd'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-9035298249152857678</id><published>2011-06-28T13:01:00.000+05:00</published><updated>2011-06-28T13:01:27.959+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Soundex"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>String Soundex() And Its Purpose In The SQL</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
Soundex code was developed to help defeat the effects of all spelling variations, which can occur in similar-sounding name (Smith, Smithe, Smythe, etc.). This allows users to index is based on the Soundex code is based on votes and &quot;no&quot;, as it is written.&lt;br /&gt;
&lt;br /&gt;
The Soundex system is not foolproof - after Gough sounding names and Goff (Goff), but a different code is generated for these two names. Soundex can however be more widely used to obtain a desired result (closer to a desired result atleast) This is an algorithm commonly used by many researchers.&lt;br /&gt;
&lt;br /&gt;
Depending on SQL string is available for this and usually come handy. SOUNDEX () function.&lt;br /&gt;
&lt;br /&gt;
It accepts a string (name) as a parameter and returns a 4 character. This code is known as code name soundex / string is sent as a parameter.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
Choose Soundex (&#39;Smith&#39;) O / P: S580&lt;br /&gt;
&lt;br /&gt;
Select SOUNDEX (&#39;Smith&#39;) O / P: S580&lt;br /&gt;
&lt;br /&gt;
SELECT SOUNDEX (&#39;green&#39;) O / P: G652&lt;br /&gt;
&lt;br /&gt;
Another use for this is contrary to a user enters a field where you need to search for specific words, but words can be wrong (even if it can not produce 100% conversion).&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/9035298249152857678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/string-soundex-and-its-purpose-in-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/9035298249152857678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/9035298249152857678'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/string-soundex-and-its-purpose-in-sql.html' title='String Soundex() And Its Purpose In The SQL'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-2972755468963597293</id><published>2011-06-28T12:33:00.000+05:00</published><updated>2011-06-28T12:33:49.808+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Sequence Number As Per Each Group</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Use the following to display the sequence numbers as per each group&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;select&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myGroupID,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;my&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;GROUPCOUNTER = ROW_NUMBER()&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;OVER (PARTITION BY [&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;myGroupID&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;]&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;ORDER BY [&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;myGroupID&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;])&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myGroupTable&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #335577; font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #335577; font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/2972755468963597293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/sequence-number-as-per-each-group.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/2972755468963597293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/2972755468963597293'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/sequence-number-as-per-each-group.html' title='Sequence Number As Per Each Group'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-914390830736708880.post-5156658272636553765</id><published>2011-06-28T12:28:00.000+05:00</published><updated>2011-06-28T12:28:28.380+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Database Files Location in SQL</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;Use the following to find the location of all database files (.mdf and .ldf) present in SQL server&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;SELECT physical_name as Path_Name&amp;nbsp;FROM master.sys.master_files&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarymyth.blogspot.com/feeds/5156658272636553765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarymyth.blogspot.com/2011/06/database-files-location-in-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/5156658272636553765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/914390830736708880/posts/default/5156658272636553765'/><link rel='alternate' type='text/html' href='http://binarymyth.blogspot.com/2011/06/database-files-location-in-sql.html' title='Database Files Location in SQL'/><author><name>Skelet0n</name><uri>http://www.blogger.com/profile/08610798937920513993</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5zQreA2Oxslt5-CJmnlmMhDl_Eb4ylEBEi7CJxHkPGMYkuvlYUjlOEezqZNzdzY-NV37gmZHDFw1OUylNFHFYjyiYHNtMIn3_OEB7ydiOakgeAfAF61nznMsB1AkOv5w/s220/DSCF8003.JPG'/></author><thr:total>0</thr:total></entry></feed>