<feed xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
    <title>Nothing is always absolutely so</title>
    <link rel="self" type="application/atom+xml" href="http://www.cyby.org/blog/Atom.aspx" />
    <subtitle type="html" />
    <id>http://www.cyby.org/blog/Default.aspx</id>
    <author>
        <name>Vlad Balan</name>
        <uri>http://www.cyby.org/blog/Default.aspx</uri>
    </author>
    <generator uri="http://subtextproject.com" version="Subtext Version 2.6.0.0">Subtext</generator>
    <updated>2012-01-12T18:11:53Z</updated>
    <entry>
        <title>Probably the most frequent LINQ mistake</title>
        <link rel="alternate" type="text/html" href="http://www.cyby.org/blog/archive/2012/01/12/probably-the-most-frequent-linq-mistake.aspx" />
        <id>http://www.cyby.org/blog/archive/2012/01/12/probably-the-most-frequent-linq-mistake.aspx</id>
        <published>2012-01-12T12:27:09Z</published>
        <updated>2012-01-12T21:21:08Z</updated>
        <content type="html">&lt;script src="https://gist.github.com/1601802.js?file=gistfile1.cs"&gt;&lt;/script&gt;

&lt;a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable.first(v=VS.110).aspx"&gt;First&lt;/a&gt; always throws an exception if the collection does not contain the specified element. If you know that the element might not exist in the collection, use &lt;a href="http://msdn.microsoft.com/en-us/library/bb340482.aspx"&gt;FirstOrDefault&lt;/a&gt;&lt;img src="/blog/aggbug/43.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Deploying database projects without Visual Studio</title>
        <link rel="alternate" type="text/html" href="http://www.cyby.org/blog/archive/2010/11/13/deploying-database-projects-without-visual-studio.aspx" />
        <id>http://www.cyby.org/blog/archive/2010/11/13/deploying-database-projects-without-visual-studio.aspx</id>
        <published>2010-11-13T18:21:53Z</published>
        <updated>2010-11-13T18:41:37Z</updated>
        <content type="html">&lt;p&gt;If you need to deploy a database project using the built-in tool VSDBCMD.EXE you will need to have a couple of files on that machine but there is no need to have Visual Studio on the build machine.   &lt;br /&gt;For the full list of files needed read this link http://msdn.microsoft.com/en-us/library/dd193258.aspx&lt;/p&gt;&lt;img src="/blog/aggbug/40.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>My Visual Studio 2010 settings</title>
        <link rel="alternate" type="text/html" href="http://www.cyby.org/blog/archive/2010/10/15/my-visual-studio-2010-settings.aspx" />
        <id>http://www.cyby.org/blog/archive/2010/10/15/my-visual-studio-2010-settings.aspx</id>
        <published>2010-10-15T23:05:25Z</published>
        <updated>2010-10-15T23:05:25Z</updated>
        <content type="html">&lt;p&gt;It`s actually a combination of the &lt;a href="http://idesign.net"&gt;http://idesign.net&lt;/a&gt;settings with the theme from &lt;a href="http://studiostyles.info/schemes/wekeroad-ink"&gt;http://studiostyles.info/schemes/wekeroad-ink&lt;/a&gt; , some changes from &lt;a href="http://kozmic.pl/archive/2010/09/06/my-visual-studio-with-resharper-color-settings.aspx"&gt;http://kozmic.pl/archive/2010/09/06/my-visual-studio-with-resharper-color-settings.aspx&lt;/a&gt; plus some small changes.    &lt;br /&gt;It uses the Monaco Font which I downloaded from &lt;a href="http://www.webdevkungfu.com/textmate-envy-aka-monaco-font-for-windows/"&gt;http://www.webdevkungfu.com/textmate-envy-aka-monaco-font-for-windows/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And it looks like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.cyby.org/blog/images/www_cyby_org/blog/WindowsLiveWriter/MyVisualStudio2010settings_12877/myVs2010Settings.jpg" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="myVs2010Settings" border="0" alt="myVs2010Settings" src="http://www.cyby.org/blog/images/www_cyby_org/blog/WindowsLiveWriter/MyVisualStudio2010settings_12877/myVs2010Settings_thumb.jpg" width="640" height="414" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://cid-2ae09020cc20cab0.office.live.com/self.aspx/Public/vlad.vssettings" target="_blank"&gt;download it from here&lt;/a&gt;&lt;/p&gt;&lt;img src="/blog/aggbug/37.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Long DNS lookup time in Mozilla Firefox?</title>
        <link rel="alternate" type="text/html" href="http://www.cyby.org/blog/archive/2010/09/13/long-dns-lookup-time-in-mozilla-firefox.aspx" />
        <id>http://www.cyby.org/blog/archive/2010/09/13/long-dns-lookup-time-in-mozilla-firefox.aspx</id>
        <published>2010-09-04T15:54:28Z</published>
        <updated>2010-09-15T22:54:05Z</updated>
        <content type="html">&lt;p&gt;&lt;a href="http://www.cyby.org/blog/images/www_cyby_org/blog/WindowsLiveWriter/LongDNSlookuptimeinMozillaFirefox_BF79/longDNSlookup.jpg" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="longDNSlookup" border="0" alt="longDNSlookup" src="http://www.cyby.org/blog/images/www_cyby_org/blog/WindowsLiveWriter/LongDNSlookuptimeinMozillaFirefox_BF79/longDNSlookup_thumb.jpg" width="810" height="274" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Go to about:config in Firefox and change the property network.dns.disableIPv6 to true. &lt;/p&gt;  &lt;p&gt;This was the result:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.cyby.org/blog/images/www_cyby_org/blog/WindowsLiveWriter/LongDNSlookuptimeinMozillaFirefox_BF79/noMoreDNSLookup.jpg" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="noMoreDNSLookup" border="0" alt="noMoreDNSLookup" src="http://www.cyby.org/blog/images/www_cyby_org/blog/WindowsLiveWriter/LongDNSlookuptimeinMozillaFirefox_BF79/noMoreDNSLookup_thumb.jpg" width="778" height="265" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="/blog/aggbug/24.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Strings</title>
        <link rel="alternate" type="text/html" href="http://www.cyby.org/blog/archive/2010/09/04/strings.aspx" />
        <id>http://www.cyby.org/blog/archive/2010/09/04/strings.aspx</id>
        <published>2010-09-04T15:20:49Z</published>
        <updated>2010-09-15T22:53:52Z</updated>
        <content type="html">&lt;p&gt;I went over some selenium tests today and found this code that creates a string that is used in order to test that validation is fired whenever the text entered in a text box has a greater length that allowed.&lt;/p&gt;
&lt;pre class="csharpcode"&gt; &lt;/pre&gt;&lt;pre class="csharpcode"&gt;var temp = &lt;span class="kwrd"&gt;new&lt;/span&gt; StringBuilder();
&lt;span class="kwrd"&gt;for&lt;/span&gt; (var i = 0; i &amp;lt; 52; i++)
{
      temp.Append(&lt;span class="str"&gt;'x'&lt;/span&gt;);
}
longerThan50Chars = temp.ToString();&lt;/pre&gt;
&lt;p&gt;&lt;span class="kwrd" /&gt; &lt;/p&gt;
&lt;p&gt;This is all good and working code but it can all be replaced with just one line.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; longerThan50Chars = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;(&lt;span class="str"&gt;'x'&lt;/span&gt;,52);&lt;/pre&gt;&lt;img src="/blog/aggbug/22.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Check if an email address is valid</title>
        <link rel="alternate" type="text/html" href="http://www.cyby.org/blog/archive/2010/06/20/check-if-an-email-address-is-valid.aspx" />
        <id>http://www.cyby.org/blog/archive/2010/06/20/check-if-an-email-address-is-valid.aspx</id>
        <published>2010-05-30T12:05:17Z</published>
        <updated>2010-09-15T22:54:16Z</updated>
        <content type="html">&lt;pre class="csharpcode"&gt;/^([\w\!\#$\%\&amp;amp;\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&amp;amp;\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i&lt;/pre&gt;

&lt;pre class="csharpcode"&gt; &lt;/pre&gt;
This regular expression will check if an e-mail address is valid.An extended comparison &lt;a href="http://fightingforalostcause.net/misc/2006/compare-email-regex.php" target="_blank"&gt;here&lt;/a&gt; &lt;style type="text/css"&gt;&lt;![CDATA[


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;img src="/blog/aggbug/10.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Multiple Google calendars sync on the IPhone</title>
        <link rel="alternate" type="text/html" href="http://www.cyby.org/blog/archive/2010/06/19/multiple-google-calendars-sync-on-the-iphone.aspx" />
        <id>http://www.cyby.org/blog/archive/2010/06/19/multiple-google-calendars-sync-on-the-iphone.aspx</id>
        <published>2010-03-17T18:53:45Z</published>
        <updated>2010-06-19T12:29:41Z</updated>
        <content type="html">In order to be able to sync multiple calendars on your iPhone you need to first select the calendars that you want to sync. For some reason not all calendars are synced automatically... &lt;a href="https://www.google.com/calendar/iphoneselect"&gt;https://www.google.com/calendar/iphoneselect&lt;/a&gt;&lt;img src="/blog/aggbug/7.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Remember kids</title>
        <link rel="alternate" type="text/html" href="http://www.cyby.org/blog/archive/2009/11/29/remember-kids.aspx" />
        <id>http://www.cyby.org/blog/archive/2009/11/29/remember-kids.aspx</id>
        <published>2009-11-29T18:12:24Z</published>
        <updated>2010-09-15T22:54:26Z</updated>
        <content type="html">&lt;p&gt;When creating jQuery custom utility functions always use this pattern because it protects the use of $.&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt;($){
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;   $.foo = &lt;span style="color: #0000ff"&gt;function&lt;/span&gt;(argument) {&lt;span style="color: #0000ff"&gt;alert&lt;/span&gt;(argument);}
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;})(jQuery)&lt;/pre&gt;&lt;/pre&gt;&lt;img src="/blog/aggbug/4.aspx" width="1" height="1" /&gt;</content>
    </entry>
</feed>System.Web.HttpWriter
