tag:blogger.com,1999:blog-137510272024-03-23T11:26:38.070-07:00What do you want to program today?My thoughts, articles, findings, etc. mainly about programming and computers in general.BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.comBlogger320125tag:blogger.com,1999:blog-13751027.post-35178868642659714762011-10-06T09:56:00.000-07:002011-10-06T09:56:44.790-07:00Steve Jobs, 1955 - 2011<span class="Apple-style-span" style="background-color: white; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 16px;">“Being the richest man in the cemetery doesn’t matter to me … Going to bed at night saying we’ve done something wonderful… that’s what matters to me.”</span>BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com0tag:blogger.com,1999:blog-13751027.post-34914006014583675552011-05-16T13:52:00.000-07:002011-05-16T13:54:57.078-07:00Visual Studio: ASP.NET MVC, Flip quickly through your controllers and viewsThis tip is specifically for those writing ASP.NET MVC applications using Visual Studio<br />
<br />
As your MVC application grows, the number of views and controllers can grow pretty quickly and ctrl+tabbing through them gets pretty painful, sometimes only to discover that you don't have *that* view open, so you need to go find it. That's where this tip comes in, <b>if you right click on your controller, there's a menu option to go to the view, likewise, if you are in the view and right click there's a menu option to go to the controller</b>, now, <b>if you are a mouse guy, this is enough for you</b>, you can stop reading now, but there's a quicker way, you can assign a shortcut key to those options<br />
<br />
Go to Tools, Options, Environment (first option), keyboard, and type "GoToView" (without the quotes) and assign the shortcut you want, chose one that is not being used, or one of a feature you don't use (there are millions of those), for this type of thing that I do a lot, I like using keys that are easily accessible, put that F1 key to good use!!, do the same thing for the "GoToController"<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-7sHhaDsCirs/TdGNENZfHAI/AAAAAAAABa0/zmhOo8ryJsQ/s1600/GoToView.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="230" src="http://3.bp.blogspot.com/-7sHhaDsCirs/TdGNENZfHAI/AAAAAAAABa0/zmhOo8ryJsQ/s400/GoToView.PNG" width="400" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-P2_DxiDVGv0/TdGND6WSMII/AAAAAAAABaw/rwcNpYUtt4w/s1600/GoToController.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="230" src="http://4.bp.blogspot.com/-P2_DxiDVGv0/TdGND6WSMII/AAAAAAAABaw/rwcNpYUtt4w/s400/GoToController.PNG" width="400" /></a></div><br />
<br />
Click OK and you're ready to roll, go to your controller and press your shortcut, you'll be flipping through your views and controllers like there's no tomorrow!<br />
<br />
You're welcome JBlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com2tag:blogger.com,1999:blog-13751027.post-77482757768324422042011-03-19T21:28:00.000-07:002011-03-21T07:53:00.892-07:00Kindle: We were unable to download the book... please try again later<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjE__Z8tUss3UbhMiw-Y6hSso_3SR_MvNeYDYHhVtwXOjecVz1O8sYeRhU3mPcuh6RAzSyrWhMADmAndvS92tOW97t44fokdq-dnu1K1ZlNpvI7wKRPeBVOuTbZPgNe9AqUkj8/s1600/kindle.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="258" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjE__Z8tUss3UbhMiw-Y6hSso_3SR_MvNeYDYHhVtwXOjecVz1O8sYeRhU3mPcuh6RAzSyrWhMADmAndvS92tOW97t44fokdq-dnu1K1ZlNpvI7wKRPeBVOuTbZPgNe9AqUkj8/s320/kindle.jpg" width="320" /></a></div>A few days ago I installed Kindle on my Mac Book Pro, then only after a couple days of using it I suddenly got this error and was not able to open any of the two books I had just bought, I was able to open the books just fine on my iPhone and iPad, but the Kindle for Mac kept giving me this error message no matter how many times I tried clicking; a search on Google gave me 3 results and no solutions, so I <b>uninstalled</b> the App and reinstalled, got nothing. I tried the Tools menu, <b>manage your Kindle</b> from the Kindle app which takes you to the amazon site, noticed the <b>"your orders"</b> at the bottom and the options to download the content, tried that a few times, still nothing, another thing I noticed on the Kindle app was that the title was something like <b>"???????????????? Home"</b>, I knew something was messed up bad, but even reinstalling didn't fix it, so in one last desperate attempt I checked out the <b>Kindle preferences</b> [Command]+, or under the <b>Kindle</b> menu, <b>preferences</b>, I clicked the only button there: <b>"Deregister"</b>, agreed to the warning and selected <b>"remove all licensed content from this device"</b> and clicked <b>"deregister"</b> again on the warning window; a <b>register</b> button then showed up, I clicked it to register the app again, had to agree to some other warning, and that right there was the solution, I was able to get my books (had to download them again) and start reading, so I'm just leaving this out there in hopes it can help someone else; long story short, <b>deregister</b> the app, make sure to select "remove all licensed content from this device", then <b>register</b> again.BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com13tag:blogger.com,1999:blog-13751027.post-57462296856446699742011-03-02T07:52:00.000-08:002011-03-02T07:52:36.710-08:00FluentNHibernate: "unable to locate persister:"There's quite a bit of info out there for this error message, but all I could find refers to xml configuration, the recommendation being somewhere along the lines of:<br />
<br />
<span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"></span><br />
<ol style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1em; margin-left: 30px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><li style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;">Make sure your mapping file is named *.hbm.xml</div></li>
<li style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;">Make sure it is set to an embedded resource.</div></li>
<li style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;">If all else fails, debug.</div></li>
</ol><br />
What most articles fail to mention is the root cause, which is the fact that NHibernate was not able to load the mappings for the class you are trying to use in your query, knowing that you can at least focus in a single area, in the case of fluent nhibernate, the configuration looks something like this:<br />
<br />
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.5px Consolas; color: #f7edcd}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.5px Consolas; color: #4daeb3}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.5px Consolas; color: #f7edcd; min-height: 11.0px}
span.s1 {color: #e6be6f}
span.s2 {color: #d58442}
span.s3 {color: #b8dbe5}
span.s4 {color: #d28542}
span.s5 {color: #f7edcd}
span.s6 {color: #4daeb3}
</style> <br />
<div class="p1"><span class="Apple-style-span" style="color: black; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"></span></div><pre class="default prettyprint" style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;"><code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><span class="kwd" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">public</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> </span><span class="kwd" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">static</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> </span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">ISessionFactory</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> </span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">CreateSessionFactory</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">()</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">{</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
</span><span class="kwd" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">return</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> </span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">Fluently</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">Configure</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">()</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">Database</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">(</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">MsSqlConfiguration</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">MsSql2008</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">ConnectionString</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">c </span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">=></span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> c</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">FromConnectionStringWithKey</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">(</span><span class="str" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">"AppDb"</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">)))</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">Mappings</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">m </span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">=></span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> m</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">FluentMappings</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">Add</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">ProductMap</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">>())</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">Mappings</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">m </span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">=></span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> m</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">FluentMappings</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">Add</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">CategoryMap</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">>())</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">ExposeConfiguration</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">c </span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">=></span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> c</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">SetProperty</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">(</span><span class="str" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">"current_session_context_class"</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">,</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> </span><span class="str" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">"web"</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">))</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">BuildSessionFactory</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">();</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">}</span></code></pre><br />
The two <b>.Mappings()</b> lines are the bug in this case, any subsequent calls to it override the first one and you won't be able to query Products<br />
There are two ways of fixing this, one you can tell it to load all the mappings found on the same assembly as the first map<br />
<br />
<br />
<pre class="default prettyprint" style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;"><code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">Mappings</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">m </span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">=></span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> m</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">FluentMappings</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">AddFromAssemblyOf</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">ProductMap</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">>())</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
</span></code></pre><br />
or if you want to be specific:<br />
<br />
<br />
<pre class="default prettyprint" style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;"><code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> </span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">Mappings</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">(</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">m </span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">=></span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> { m</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">FluentMappings</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">Add</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">ProductMap</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">>();</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">m</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">FluentMappings</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">Add</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><</span><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">CategoryMap</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">>(); })</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
</span></code></pre><div><code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><br />
</span></code></div><br />
Hope someone else finds this helpfulBlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com0tag:blogger.com,1999:blog-13751027.post-30235521166351262992011-02-28T09:50:00.000-08:002011-02-28T09:50:49.951-08:00IE 9 : How to get your old address bar back<div class="separator" style="clear: both; text-align: center;"><a href="https://lh6.googleusercontent.com/-WI_SnVk5bW0/TWveZbAtDvI/AAAAAAAABZc/CZc4GB_3Ou0/s1600/IE9_address_bar.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="156" src="https://lh6.googleusercontent.com/-WI_SnVk5bW0/TWveZbAtDvI/AAAAAAAABZc/CZc4GB_3Ou0/s640/IE9_address_bar.png" width="640" /></a></div><br />
IE9 introduced a new address bar that is located on the same row as the tabs that are open, that may be useful for some people, but for everyone else it's just annoying, luckily they added an easy way to change it back to the same way it was before, all you have to do is <b>right click</b> on any tab or the tab area and you'll get a "show tabs on a separate row" option at the bottom<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://lh3.googleusercontent.com/-qxcEaNr7Dek/TWvfsgRZ7TI/AAAAAAAABZk/jcnXLyrZfJ8/s1600/IE9_address_bar_show_tabs_on_a_separate_row.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="https://lh3.googleusercontent.com/-qxcEaNr7Dek/TWvfsgRZ7TI/AAAAAAAABZk/jcnXLyrZfJ8/s640/IE9_address_bar_show_tabs_on_a_separate_row.png" width="640" /></a></div><br />
And that's it, you get your old address bar back :)<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://lh5.googleusercontent.com/-Kf4InJ-DgNU/TWvgPzMKS5I/AAAAAAAABZo/ZhcpA9eF58M/s1600/IE9_old_address_bar_back.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="91" src="https://lh5.googleusercontent.com/-Kf4InJ-DgNU/TWvgPzMKS5I/AAAAAAAABZo/ZhcpA9eF58M/s400/IE9_old_address_bar_back.png" width="400" /></a></div>BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com0tag:blogger.com,1999:blog-13751027.post-77606848919555112232010-12-10T15:56:00.000-08:002010-12-10T15:56:45.342-08:00SQL: Group datetime by an arbitrary time intervalYesterday, a co-worker came to me with a puzzle, he wanted to write a query that would group records by intervals of 5, 10, 15 minutes, ideally just passing a parameter to the query to specify the time interval, I sat down and after 5 minutes I came up with the solution:<br />
<br />
<br />
<div class="MsoNormal" style="border-collapse: collapse; font-size: 13px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="color: blue; font-family: 'Courier New';"></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span class="Apple-style-span" style="color: blue; font-family: 'Courier New';"><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">declare</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> @interval <span style="color: blue;">int<o:p></o:p></span></span></span></div><span class="Apple-style-span" style="color: blue; font-family: 'Courier New';"> <div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">set</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> @interval <span style="color: grey;">=</span> 5<o:p></o:p></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">select</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: magenta;">datepart</span><span style="color: grey;">(</span>hh<span style="color: grey;">,</span> DateTimeColumn<span style="color: grey;">)<o:p></o:p></span></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="color: grey; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">,</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: magenta;">datepart</span><span style="color: grey;">(</span>mi<span style="color: grey;">,</span> DateTimeColumn<span style="color: grey;">)/</span><b>@interval<span style="color: grey;">*</span>@interval</b><o:p></o:p></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="color: grey; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">,</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: magenta;">count</span><span style="color: grey;">(*)<o:p></o:p></span></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">from</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> thetable<o:p></o:p></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">group</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">by</span> <span style="color: magenta;">datepart</span><span style="color: grey;">(</span>hh<span style="color: grey;">,</span> DateTimeColumn<span style="color: grey;">)<o:p></o:p></span></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="color: grey; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">,</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: magenta;">datepart</span><span style="color: grey;">(</span>mi<span style="color: grey;">,</span> DateTimeColumn<span style="color: grey;">)/</span><b>@interval<span style="color: grey;">*</span>@interval</b><o:p></o:p></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><br />
</div></span><br />
The trick is highlighted, though it looks like the division and multiplication eliminate each other, what is really happening is an <b>integer division</b>, which, multiplied by the same number, gives you the right intervals:<br />
<br />
here's the (minutes) values pattern for an interval of 5<br />
<br />
<br />
<b>minute<span class="Apple-tab-span" style="white-space: pre;"> </span>divided by 5<span class="Apple-tab-span" style="white-space: pre;"> </span>multiplied by 5</b><br />
0<span class="Apple-tab-span" style="white-space: pre;"> </span>0<span class="Apple-tab-span" style="white-space: pre;"> </span>0<br />
1<span class="Apple-tab-span" style="white-space: pre;"> </span>0<span class="Apple-tab-span" style="white-space: pre;"> </span>0<br />
...<br />
5<span class="Apple-tab-span" style="white-space: pre;"> </span>1<span class="Apple-tab-span" style="white-space: pre;"> </span>5<br />
6<span class="Apple-tab-span" style="white-space: pre;"> </span>1<span class="Apple-tab-span" style="white-space: pre;"> </span>5<br />
...<br />
10<span class="Apple-tab-span" style="white-space: pre;"> </span>2<span class="Apple-tab-span" style="white-space: pre;"> </span>10<br />
11<span class="Apple-tab-span" style="white-space: pre;"> </span>2<span class="Apple-tab-span" style="white-space: pre;"> </span>10<br />
...<br />
from there you can include more fields in your select criteria, make it prettier, etc<br />
<br />
<br />
<div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">declare</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> @interval <span style="color: blue;">int<o:p></o:p></span></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">set</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> @interval <span style="color: grey;">=</span> 5<o:p></o:p></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">select</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">convert</span><span style="color: grey;">(</span>varchar<span style="color: grey;">(</span>8<span style="color: grey;">),</span> DTColumn<span style="color: grey;">,</span> 1<span style="color: grey;">)+</span><span style="color: red;">' '<o:p></o:p></span></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><span style="mso-tab-count: 1;"> </span><span style="color: grey;">+</span><span style="color: blue;">convert</span><span style="color: grey;">(</span>varchar<span style="color: grey;">(</span>2<span style="color: grey;">),</span> <span style="color: magenta;">datepart</span><span style="color: grey;">(</span>hh<span style="color: grey;">,</span> DTColumn<span style="color: grey;">))+</span><span style="color: red;">':'<o:p></o:p></span></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><span style="mso-tab-count: 1;"> </span><span style="color: grey;">+</span><span style="color: blue;">convert</span><span style="color: grey;">(</span>varchar<span style="color: grey;">(</span>2<span style="color: grey;">),</span> <span style="color: magenta;">datepart</span><span style="color: grey;">(</span>mi<span style="color: grey;">,</span> DTColumn<span style="color: grey;">)/</span>@interval<span style="color: grey;">*</span>@interval<span style="color: grey;">)<o:p></o:p></span></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="color: grey; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">,</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: magenta;">count</span><span style="color: grey;">(*)<o:p></o:p></span></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">from</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> the_table<o:p></o:p></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">group</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">by</span> <span style="color: blue;">convert</span><span style="color: grey;">(</span>varchar<span style="color: grey;">(</span>8<span style="color: grey;">),</span> DTColumn<span style="color: grey;">,</span> 1<span style="color: grey;">)+</span><span style="color: red;">' '<o:p></o:p></span></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; text-autospace: none;"><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><span style="mso-tab-count: 1;"> </span><span style="color: grey;">+</span><span style="color: blue;">convert</span><span style="color: grey;">(</span>varchar<span style="color: grey;">(</span>2<span style="color: grey;">),</span> <span style="color: magenta;">datepart</span><span style="color: grey;">(</span>hh<span style="color: grey;">,</span> DTColumn<span style="color: grey;">))+</span><span style="color: red;">':'<o:p></o:p></span></span></div><h1 style="margin-bottom: 5.0pt; margin-left: 0in; margin-right: 0in; margin-top: 5.0pt;"><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><span style="mso-tab-count: 1;"> </span><span style="color: grey;">+</span><span style="color: blue;">convert</span><span style="color: grey;">(</span>varchar<span style="color: grey;">(</span>2<span style="color: grey;">),</span> <span style="color: magenta;">datepart</span><span style="color: grey;">(</span>mi<span style="color: grey;">,</span> DTColumn<span style="color: grey;">)/</span>@interval<span style="color: grey;">*</span>@interval<span style="color: grey;">)<o:p></o:p></span></span></h1><div><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><span style="color: grey;"><br />
</span></span></div><div><span class="Apple-style-span" style="color: grey; font-family: 'Courier New'; font-size: x-small;"><span class="Apple-style-span" style="color: black; font-family: 'Times New Roman'; font-size: small;">which produces something like:</span></span></div><div><span class="Apple-style-span" style="color: grey; font-family: 'Courier New'; font-size: x-small;"><span class="Apple-style-span" style="color: black; font-family: 'Times New Roman'; font-size: small;"><h1 style="margin-bottom: 5.0pt; margin-left: 0in; margin-right: 0in; margin-top: 5.0pt;"><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; font-weight: normal; mso-font-kerning: 0pt; mso-no-proof: yes;">11/12/10 10:10<span style="mso-tab-count: 1;"> </span>28<o:p></o:p></span></h1><h1 style="margin-bottom: 5.0pt; margin-left: 0in; margin-right: 0in; margin-top: 5.0pt;"><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; font-weight: normal; mso-font-kerning: 0pt; mso-no-proof: yes;">11/12/10 10:15<span style="mso-tab-count: 1;"> </span>11<o:p></o:p></span></h1><h1 style="margin-bottom: 5.0pt; margin-left: 0in; margin-right: 0in; margin-top: 5.0pt;"><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; font-weight: normal; mso-font-kerning: 0pt; mso-no-proof: yes;">11/12/10 10:20<span style="mso-tab-count: 1;"> </span>57<o:p></o:p></span></h1><div><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; font-weight: normal; mso-font-kerning: 0pt; mso-no-proof: yes;"><span class="Apple-style-span" style="color: black; font-family: 'Times New Roman'; font-size: small;">hope this is useful</span></span></div></span></span></div>BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com1tag:blogger.com,1999:blog-13751027.post-30963380482540879392010-11-29T11:42:00.000-08:002010-11-29T11:42:03.766-08:00VirtualBox VM won't release the mouseJust a quick post to share this, I'm playing with VirtualBox on my OpenSuse 11.3, installing Windows XP on a VM, I decided to click inside the VM while it was still installing, hoping that the right [ctrl] key would release the mouse, but that didn't work, Googled a bit with no good results, there's many related articles about this issue, but no solution, I was ready to give up so I hit <b>ctrl+alt+del</b> and what do you know, that released the mouse :)<br />
<br />
hope this helps someone out thereBlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com2tag:blogger.com,1999:blog-13751027.post-24349323881281895602010-09-21T21:01:00.000-07:002010-09-21T21:36:06.371-07:00Apple intuitiveness: Upgrading OS X results in downgraded components<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOuqnBCy1iGv3LKq_4zUTq4HUQmJsMLEWpDeHfZfH2kswE_7OBKuSpHr8l3Rh5lkqUjIVov6P2gF3CvHJNamUVjIRDHy6xD3U2_65TOMHKtLe3QcIuJnJ-nqqlxnRkSHIxD8EK/s1600/mac-os-x-snow-leopard.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOuqnBCy1iGv3LKq_4zUTq4HUQmJsMLEWpDeHfZfH2kswE_7OBKuSpHr8l3Rh5lkqUjIVov6P2gF3CvHJNamUVjIRDHy6xD3U2_65TOMHKtLe3QcIuJnJ-nqqlxnRkSHIxD8EK/s320/mac-os-x-snow-leopard.jpg" /></a></div>I just upgraded my OS X to Snow Leopard (yeah, a bit late), first of all I just can't wrap my head around the idea that OS X runs on a single hardware configuration (ok, maybe 3) yet it took over an hour to install, while Windows runs on millions of hardware configurations and can install in 15 mins (as in, ready to start using it), I just can't find that <b>intuitive</b>, it doesn't make sense; but anyway, one of the 3? 'big' features in this update is Safari 4, before installing I noticed I already had <b>Safari 5,</b> so I went ahead and did the install, to my surprise when it finally finished I had now <b>Safari 4</b>!! WTF? over an hour upgrading and they couldn't check if the components had a higher version than the one being installed? To be honest I was afraid to check if there was something else that got downgraded. <b>Upgrading OS X results in a downgrade of it's components!</b> how's that <b>intuitive</b>?<br />
To top if off, after upgrading I went to check for updates, there were 776MB of updates (and these are the people who make fun of Windows updates?), and sure enough, Safari 5 was on the list.<br />
<br />
So, to recap: I had Safari 5, I upgraded OS X, it got downgraded to Safari 4, then I had to get a 776MB update to get back to where I was before the upgrade. Intuitive or not, I'll let you be the judge xD.<br />
<br />
Update. after another 10 minutes, more updates came up, this time an additional 200MB, requiring, of course, that I reboot again.BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com2tag:blogger.com,1999:blog-13751027.post-78950998653370289242010-03-05T08:22:00.000-08:002010-03-05T08:22:33.006-08:00MissingManifestResourceException was unhandled<b>Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "PostProcessing.ConfigurationForm.resources" was correctly embedded or linked into assembly "PostProcessing" at compile time, or that all the satellite assemblies required are loadable and fully signed.</b><br />
<br />
There are many articles related to this one but they all point to a different solution than the problem I had, so I figured someone else might run into this<br />
<br />
you can get this exception if you declare a <b>class </b>before the code of one of your <b>forms</b><br />
<br />
This will generate the error:<br />
<br />
public class SomeTestClass {...}<br />
...<br />
public partial class <b>ConfigurationForm : Form ...</b><br />
<b><br />
</b><br />
The fix is simple, either <b>move your class</b> after the Form class, or (better yet) move it out <b>to it's own file</b>BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com0tag:blogger.com,1999:blog-13751027.post-63522720576467213112009-11-02T12:02:00.000-08:002009-11-02T12:02:37.165-08:00Software ever changing truths<div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/_cofcJplmJ2Q/Su8tN2gIVGI/AAAAAAAABRY/Eg3t8n6EqHQ/s1600-h/optical_illusions.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/_cofcJplmJ2Q/Su8tN2gIVGI/AAAAAAAABRY/Eg3t8n6EqHQ/s200/optical_illusions.jpg" /></a><br />
</div>Quite often in software [development] (more often than not?), as time goes on, what is truth, becomes not truth, and this is possibly one of the reasons it makes software development so difficult, human brains are normally trained to learn stuff, but are not trained for <b>dis learning</b> and that's where the problem resides, as humans, once we learn something a certain way and we learn that that is good (or "<b>the best way</b>"), it is very difficult to change our minds to do it differently.<br />
<br />
Programmers are frequently questioning <a href="http://stackoverflow.com/search?q=%22what+is+the+best%22">what is the best way to do x or y</a>, in many cases people will grab the first result from a web search (sounds familiar?), take that as the absolute truth, apply it to whatever problem they are solving and move on with life, though other times the ramifications of such <b>learning</b> experience will carry over much further, maybe the person will write a blog post about it or teach his/her co-workers, thus distributing the knowledge.<br />
<br />
Keep in mind that is not always about finding out the <b>best way of doing things</b>, some other times we find out that something is <b>not possible</b>, and this last one might be worst, more so on young developers, learning that something is not possible is very dangerous, have you seen an <a href="http://jnoubiyeh.blogspot.com/2008/11/taming-elephant-lesson-for-arab-and.html">elephant tied to the tiny stake</a>? it has <b>learned</b> that as soon as it reaches the end of its rope, it can't go any further.<br />
<br />
Many of these <b>truths</b> come from respected authorities in the world of software, maybe from the software vendor itself or the official community around it, making matters even more complicated because they are <b>the</b> source and you trust them. The key here is not that you <b>can't trust anyone</b>, it's only that <b>you should not lock that into your brain as the absolute truth</b>, software is always evolving, it's <b>always changing truths</b>.<br />
<br />
There are few things that you should take as the absolute truth though ;), among them:<br />
<ul><li>There's usually no <b>best way</b> of doing things, there's only a <b>better way</b>(s) of doing it.</li>
<li>Software development is not black or white, in fact I think most of it is gray area.</li>
<li>There are no hard rules in software development, it'd be too easy if that was the case. </li>
<li>There is no such thing as an impossible thing, only incapable beings.<br />
</li>
<li>Software is always evolving, what is truth today may not be the truth tomorrow.</li>
</ul>All I am saying is that whenever you come to "<b>the best way of doing</b>" (be it an algorithm, a technology, framework or methodology), a performance comparisson that shows that X is better than Y or something that is "<b>not possible</b>", it doesn't matter who it comes from, take it with a grain of salt. <b>What is truth today may not be truth tomorrow</b>.BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com1tag:blogger.com,1999:blog-13751027.post-32214306627483130722009-10-30T15:04:00.000-07:002009-10-30T15:04:55.510-07:00Information disclosure: It's everywhere<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeuJzhlnCrj7TwC2vQ_VrrPXkqL372TpG8Kw8M-Z4YTIua7DfrlEQqvu3nmqYQvJI4CTp5hvrvbnrNUexjrAOUcZnUAj3r_hz6TBULguMvXCZSlTSNWXVT6FVT9CnOZZ1ufVhW/s1600-h/information_disclosure.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5395644870783648786" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeuJzhlnCrj7TwC2vQ_VrrPXkqL372TpG8Kw8M-Z4YTIua7DfrlEQqvu3nmqYQvJI4CTp5hvrvbnrNUexjrAOUcZnUAj3r_hz6TBULguMvXCZSlTSNWXVT6FVT9CnOZZ1ufVhW/s320/information_disclosure.jpg" style="cursor: pointer; float: left; height: 182px; margin: 0pt 10px 10px 0pt; width: 320px;" /></a>You might have seen stickers like this in the back window of some minivan and maybe you thought it was funny/cute/stupid, but did you ever think of it as information disclosure? What's the big deal about showing all of your family's names? glad you ask :), let me briefly describe something that happens in Mexico and South America: <a href="http://www.google.com/search?q=virtual+kidnapping+extortion">Virtual kidnapping extortion</a>, criminals will call your phone, tell you that hey have kidnapped your kid (they have the names you graciously provided) and ask you to immediately pay the ransom, when in reality they don't have your kid, but use the emotional momentum to take advantage of you. This is only one example of how they conduct these activities, there are many other ways, and I'm not trying to make you scared of that, but to make a point on information disclosure. It can be found in the most innocent places and if you think this can't happen to you, then you're already very vulnerable.<br />
<br />
You've also probably seen this:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxFNg8fGnbyqthObA7CiVOQOvhM4P-Xm71wQtFrPZVcgS8qQu9wmgFE86s5CXPrjnUCNCGknQG2-CyNj1jdvLHxLDxLHMIqCEAahehVN9SG9LqAJVn6hKDbD_TOeIKyp3HDcU1/s1600-h/wordpress_fail.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxFNg8fGnbyqthObA7CiVOQOvhM4P-Xm71wQtFrPZVcgS8qQu9wmgFE86s5CXPrjnUCNCGknQG2-CyNj1jdvLHxLDxLHMIqCEAahehVN9SG9LqAJVn6hKDbD_TOeIKyp3HDcU1/s640/wordpress_fail.PNG" /></a><br />
</div><br />
I couldn't even tell you how many blogs have been hacked because of that (hint: too many), WordPress makes it too easy to break those sites when new vulnerabilities appear (as they do every other week).<br />
<br />
I have seen systems where they use some employee id as their login credentials, that id is visible when the computer is locked, and it turns out you can call the help desk, provide them with that id, the person's name, and they will happily reset the password for you.<br />
<br />
Unfortunately there are no rules that I can give you or that I have ever seen anywhere to prevent the issue of information disclosure, I'm just trying to raise the awareness on the potential issue that represents having information that bad people can use for malign purposes both in your systems and your own life. The only thing I can tell you is that information disclosure is really everywhere, in your comments, in your configuration files, disclosing the components that your app users, that version, that user id, etc. even in that innocent sticker.<br />
<br />
Security does get in the way of usability and usability gets in the way of security, <b>just give it a second thought</b> and be careful out there.<br />
<br />
<span style="font-weight: bold;">There is no such thing as a secure system</span>, all you can do is raise the bar a little bit more and yes, <b>security by obscurity</b> may be your friend some times.BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com2tag:blogger.com,1999:blog-13751027.post-63844905651074076742009-10-21T09:26:00.000-07:002010-04-23T10:47:42.928-07:00Duct tape programming: Elegant code doesn't pay the bills<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOIgXo3FpuQj_jSEKoOk2jNghmFq7lfKH4G1jyeJR0ReR__5cbo6KZFxTNIEw795ynveNhcUMVrKwK_dUJcnFTdVxhRRJGEQeh-dW4oii7PmOmljts0-OrCkURI4JupHqR6gUt/s1600-h/duct_tape_programmer.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5393377037548643458" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOIgXo3FpuQj_jSEKoOk2jNghmFq7lfKH4G1jyeJR0ReR__5cbo6KZFxTNIEw795ynveNhcUMVrKwK_dUJcnFTdVxhRRJGEQeh-dW4oii7PmOmljts0-OrCkURI4JupHqR6gUt/s320/duct_tape_programmer.jpg" style="cursor: pointer; float: left; height: 320px; margin: 0pt 10px 10px 0pt; width: 213px;" /></a><br />
Finally decided to jump into <a href="http://www.joelonsoftware.com/items/2009/09/23.html">the Duct Tape programmer</a> conversation that's been around the <span style="font-style: italic;">internets </span>for the last weeks; talk about flame wars! a large portion of the blogging/twitter community took this post as an attack on TDD, Agile development practices and overall quality software development; which makes perfect sense if you think about it, that's what they sell, that's what they blog and tweet about all the time, so, Joel's post hit some sensitive nerves there. All of those patterns and practices fanboys are trying to convince the world that the <b>duct tape programmers</b> are those who don't care about quality and that they are just writing software that is not maintainable, extensible and all those things that we expect from good software. Those are the same people that quickly dismiss content that is "<span style="font-weight: bold;">purely technical</span>", you'll see them talking and talking all the time about good patterns and practices, but not so much about implementations of anything down to the actual code level. I say, <b>theory is good, but without the practice, it's useless.</b><br />
<div><br />
</div><div>Unfortunately for them the very first example of duct tape programming that jumps out is <a href="http://stackoverflow.com/">StackOverflow</a>, a site that has been developed by self acknowledged duct tape programmers, but also a site that has proven to be fast, reliable, and has delivered tons of features over time, which tells me the code is very extensible; I'm sure the code is not something your average programmer could get a grasp of and would probably make purists throw up a little bit here and there, but is code that does what it supposed to do, and does it very well (do I hear <b>ship it</b>?)</div><div><br />
</div><div>When I stated that in Twitter about SO, some didn't believe it (which tells me they thought it was so good it couldn't be duct tape programming, but there are podcasts you can look for and listen to what they have done), and someone else madly replied to me, arguing that SO was the only real example of successful duct tape programming, unfortunately for them (again) if you look at the tremendous success on Apple products lately, you'll see <b>duct tape programming</b> all over the place, <span style="font-weight: bold;">Apple is the King </span>(or Queen?) <span style="font-weight: bold;">of duct tape programming</span>, specially the <b>iPhone development ecosystem</b>, it's not all that pretty but Apple has always delivered what people want, you may read my own blog about many stupid things that Apple does, but on the end, <b>people are very happy with their products</b>, and <b>that's all that matters</b>, people don't care that the underlying infrastructure or the code for the apps looks like crap, I'll say it again: <span style="font-weight: bold;">it doesn't matter</span>.</div><div><br />
<div>The biggest problem with purists is that when you focus on making every single line of code fit within a pattern, it's very easy to cross the line of over engineering and forget about the very basics of software development, which is, it has to meet your customers expectations, and you have to deliver, if you don't deliver a product, it doesn't matter how good the code is, unfortunately <b>elegant code doesn't pay the bills</b>, getting the job done does.<br />
<blockquote>A brute-force solution that works is better than an elegant solution that doesn't work. <span class="Apple-style-span" style="font-size: x-small;">Code Complete 2</span></blockquote></div></div><div>My most frequent pattern is "whatever works", I'm not afraid of throwing in procedural, OOP, functional, dynamic, stored procedures, you name it, whatever gets the job done (ok, except for XML, <a href="http://ebersys.blogspot.com/2009/06/are-we-done-with-xml-yet-hello-jini.html">I hate XML</a>) in a way that works and allows me to extend that code later, but most importantly, I am <span style="font-weight: bold;">used to</span> <b>delivering </b>good results, <span style="font-weight: bold;">always</span>, no excuses, you'll often hear me say, <b>is not an option, it HAS to work. <span class="Apple-style-span" style="font-weight: normal;">Don't get me wrong, I'm very strict with my code, I like elegant code, I follow good SOLID principles, I write unit tests when a piece of code definitely needs it, is just that I don't force everything into a pattern, I don't always write my tests <span style="font-weight: bold;">first </span>religiously (ok, actually, I never write the tests first, I think it's stupid). </span></b><b><span class="Apple-style-span" style="font-weight: normal;">That for me, is the <span style="font-weight: bold;">duct tape programmer</span>. </span></b><b><span class="Apple-style-span" style="font-weight: normal;">You just have to know when to pull the plug and keep in mind the most important feature of your product. </span>Shipping<span class="Apple-style-span" style="font-weight: normal;"> is that feature, without it, whatever you do, even if it is a master piece, is worthless.<br />
<br />
Now, when you corner purists showing them good results from duct tape programming, they argue that it takes very talented people to pull that off, sure, nobody said it was easy, it takes talent, it takes reading and understanding all those "<span style="font-weight: bold;">purely technical content</span>" entries, experimenting, playing, hacking, on the end, <a href="http://www.codinghorror.com/blog/archives/001033.html">software development IS a people problem</a>. I think <span style="font-weight: bold;">methodologies are for people who don't have the talent</span>, but that's a whole different topic.<br />
<br />
There are no hard rules in programming, it would be too easy if that was the case.<br />
<small><small><br />
disclaimer: I took the "elegant code doesn't pay the bills" phrase from someone in Twitter, sorry, can't find it now.<br />
</small></small></span></b></div>BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com7tag:blogger.com,1999:blog-13751027.post-25529198744068833712009-10-03T13:26:00.000-07:002009-10-03T13:44:39.203-07:00Mac intuitiveness: syncing notes and hard limitsI've had this issue from day 1, <span style="font-weight: bold;">every</span> time I sync my iPhone after I have added or modified some notes, I get this message<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHE7y6WviONoB-q9KxUcZp8rvwikLNDuYH9puE3TAxdzrvjWuchpOJjHMiKcF4ateUJDfHSmADqikqyInIetorZwhIRPPKtF_8T5dhXVYf285m9dVwbT4vOC8TNCxYnN4RcdxM/s1600-h/syncing_notes.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 172px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHE7y6WviONoB-q9KxUcZp8rvwikLNDuYH9puE3TAxdzrvjWuchpOJjHMiKcF4ateUJDfHSmADqikqyInIetorZwhIRPPKtF_8T5dhXVYf285m9dVwbT4vOC8TNCxYnN4RcdxM/s400/syncing_notes.png" alt="" id="BLOGGER_PHOTO_ID_5388473348688511490" border="0" /></a><br /><br />I usually keep around 10 notes on my iPhone, so, of course it's <span style="font-weight: bold;">always</span> going to be more than 5 freaking percent, why should it care that I change even 100% of all my notes, just keep a history if that's the concern, the other issue is that if you plug your iPhone in to sync it and walk away, you'll come back one hour later only to find out that it hasn't finished because it is stuck on this stupid dialog. Really bad usability there, hasn't improved even with the countless iTunes updates.<br /><br />Always remember the <span style="font-weight: bold;">least surprise principle</span>.BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com0tag:blogger.com,1999:blog-13751027.post-11619735658814567962009-09-25T14:22:00.000-07:002009-09-25T14:41:33.930-07:00Apple intuitiveness: The lost OK buttonEvery time you connect an iPhone/iPod to a Mac, iTunes does its thing, takes forever syncing and what not (one of those things is that it <span style="font-weight: bold;">steals the focus</span>, which I <span style="font-weight: bold;">hate</span>) and when is finally done, it comes up with this dialog:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbbFTGbk0pQN441AEYdE3MnD1tj3DddbQ0O9A9-VvbTXE4U3jDe_8WwRPDIbCBYXidN0D5fgSn74-pW03_bE4kXSGDJQivyH6TovKkOSIUqQj6JeBEb-wPzMTSAT75Zzk-aidT/s1600-h/Where_is_the_ok_button.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 237px; height: 60px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbbFTGbk0pQN441AEYdE3MnD1tj3DddbQ0O9A9-VvbTXE4U3jDe_8WwRPDIbCBYXidN0D5fgSn74-pW03_bE4kXSGDJQivyH6TovKkOSIUqQj6JeBEb-wPzMTSAT75Zzk-aidT/s400/Where_is_the_ok_button.png" alt="" id="BLOGGER_PHOTO_ID_5385519298796402898" border="0" /></a><br />Maybe it's just me, but it took me a <span style="font-weight: bold;">long time</span> (and I mean, months) to realize that it wasn't referring to an <span style="font-weight: bold;">OK button</span>, just that it was OK to disconnect your device; so much for being intuitive.<br /><br />But then again, I'm not the only one who thinks that <a href="http://www.google.com/search?q=itunes+sucks">iTunes sucks</a>BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com4tag:blogger.com,1999:blog-13751027.post-49501316191948410462009-09-23T08:41:00.000-07:002009-09-23T14:32:38.722-07:00Ping doesn't cut it for connectivity testing<div><b>A failed ping only means that the ping failed, doesn't tell you much about the connectivity.</b></div><div><br /></div>On some twitter discussion today I was reminded of how often people use the <b>ping</b> command to test for connectivity, what a lot of people don't know, is that ping is just another service, and can be disabled or blocked, -as it has become more frequent these days-, rendering this method useless, on top of that, more often than not you need to test connectivity to a specific service; a much better approach is to use <b>telnet</b>. Using telnet you can actually test not only that there is connectivity, but that you can reach the desired port.<div><br /></div><div><div>Some frequently used ports:</div><div><br /></div><div>20, 21 Standard FTP</div><div>23 Telnet default</div><div>25 SMTP</div><div>80 Standard web</div><div>115 SFTP</div><div>443 Standard secure web</div><div>139 NETBIOS (file and printer sharing in Windows)</div><div>143 IMAP</div><div>445 SMB (to connect to Windows from other OSs)</div><div><br /></div><div><a href="http://www.comptechdoc.org/independent/networking/guide/netports.html">You can find a bigger list here</a></div><div><br /></div><div>an example of testing if you can access the web on some ip:</div><div>telnet 192.168.1.2 80</div><div><br /></div><div>when the connection succeeds, you usually just get a black screen, with the cursor staring at you, if the connection fails, you will get an error message</div><div><br /></div><div>As a final note, in case the connection fails, you might want to use <b>tracert -d [ip address]</b> to get more details of why the connection fails</div></div>BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com1tag:blogger.com,1999:blog-13751027.post-62622283098419385602009-07-17T10:31:00.000-07:002009-07-17T11:09:33.613-07:00How to: Save GIF files in MS Outlook<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLBzZOdJymSBQM8K0NDE-GUJ3A4Gn_BAamB4eRQ3lP-M-v93G3SZlgnzaKGlp6IsG7cSP5DZMj0inGJ5JyFeJzLPCOrgUwRPJJPU25D89C8w9EF8D0QVGtcJwKm9qtr3WcQLA7/s1600-h/msoutlook.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 255px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLBzZOdJymSBQM8K0NDE-GUJ3A4Gn_BAamB4eRQ3lP-M-v93G3SZlgnzaKGlp6IsG7cSP5DZMj0inGJ5JyFeJzLPCOrgUwRPJJPU25D89C8w9EF8D0QVGtcJwKm9qtr3WcQLA7/s320/msoutlook.jpg" alt="" id="BLOGGER_PHOTO_ID_5359486078526751922" border="0" /></a><br />For some reason MS Outlook doesn't give you an <strike>option</strike> easy way to save animation files (.<span style="font-weight: bold;">GIF</span>), actually it won't let you save .<span style="font-weight: bold;">JPG, </span>.<span style="font-weight: bold;">PNG, </span><span>etc</span> directly from a message and what it does instead is that it gives you the option of saving it as <span style="font-weight: bold;">BMP</span>, but many times this is not desirable, every once in a while I need this and I keep forgetting how to do it so I decided to use my blog once again for the purpose of remembering later how to do something; it actually works quite well, so here it is<br /><br />I actually lied on the title, there are ways to save the .GIF files in Outlook, but I'm not going there, there is a much easier way, <span style="font-weight: bold;">forward the message to </span>a web-based email account such as Yahoo or <span style="font-weight: bold;">Gmail</span> (haven't tried Hotmail, but it probably works there too)<br /><br />You'll be able to save the files from there as you would expect, with a right click, save file as...BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com3tag:blogger.com,1999:blog-13751027.post-18284543314316026122009-07-14T10:03:00.000-07:002009-07-14T11:31:35.440-07:00Programming is like ChessFor a long time I have believed that software development is just like a Chess game, but apparently not many people have thought about it this way, just <a href="http://www.bing.com/search?q=%22programming+is+like+chess%22">*bing* it</a> and you'll see less than a page of results (Google is no better), of course this is about to change as I write this post and everybody sees the light... or not<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFfqxsyW0pqECIcjeqVo2DZ5N1-gql2KxHbTVOh6490VFh11nlv4qq6GLXYjw-b4yOfjz-zN4ezMMeDc0F5uxgHgM8yNlUj-UXug1bHuydhN-2qx3BJ4bH9fdE9-gBhGIaywmX/s1600-h/chess_programming.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 278px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFfqxsyW0pqECIcjeqVo2DZ5N1-gql2KxHbTVOh6490VFh11nlv4qq6GLXYjw-b4yOfjz-zN4ezMMeDc0F5uxgHgM8yNlUj-UXug1bHuydhN-2qx3BJ4bH9fdE9-gBhGIaywmX/s400/chess_programming.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5358385195822386946" /></a><br />anyway, let me elaborate on my analogy<br /><br /><span style="font-weight: bold;">The bad programmer</span><br />Arguably the average programmer, <span style="font-style: italic;">makes a move</span> without thinking about the <span style="font-weight: bold;">side effects</span>, his capacity of analyzing problems is not all that great, there are so many side effects (breaking code, introducing bugs, security, etc) but this guy is not even aware of most of them, he basically relies on the debugger and if it runs on his machine then is good to go; when stuff inevitably breaks he just goes back and makes another move that seems to fix the problem, if you give this guy a large project it is likely that he'll make a stupid move that will just cause <span style="font-weight: bold;">Checkmate</span> on the project<br /><br /><span style="font-weight: bold;">The good</span><br />Analyzes different paths and choses the one he thinks is best, this player can play a good game, every once in a while his analysis is not that through and makes some mistakes but he can learn from that, this guy usually delivers good quality software with few bugs that he can go back and fix quickly enough to be acceptable<br /><br /><span style="font-weight: bold;">The best</span><br />This guy can make a whole bunch of moves all in his head, he's informed about all the latest techniques to defeat the opponent but he doesn't just rush and use them in a game, he tries them first on his own little projects and ends up using the ones that he proves to be useful, the ones that are shorter, quicker and give him the best return, he knows the techniques to use with the small projects and the ones to be used with large projects, and he knows they are very different, this guy knows what the opponent is thinking, he knows what the opponent will respond to every one of his moves so he usually chooses the best move... he knows the <span style="font-weight: bold;">side effects</span>; the "works on my machine" is not on this guy's vocabulary.<br /><br />As you can see the the main two differences in my analogy are the capacity of analysis (selecting the move) and the awareness of the side effects (what happens when you make that move).<br />The opponent is your software project, the move is writing the code, the side effects are everything else that is affected by that.<br /><br />When was the last time that you introduced a new bug fixing that other bug or writing some new functionality? or when *they* found bugs of your code right after it went to production? or when it worked on your machine but not on the server?<br /><br />Every time you make a move, stop and think about the side effects, <span style="font-weight: bold;">there are always side effects</span>, if you can't think of them, there are <span style="font-style: italic;">tools</span> that can help you think better, such as <span style="font-weight: bold;">Unit Testing</span>, the more you practice it, the better you'll get at it, I promiseBlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com7tag:blogger.com,1999:blog-13751027.post-547067059027620912009-06-30T08:57:00.000-07:002009-06-30T09:07:41.375-07:00Firefox taking a long time to start after upgrading to 3.5Firefox 3.5 (code name <span style="font-weight: bold;">Shirekoto</span>) is out, <a href="http://www.spreadfirefox.com/shiretokoshock">get it while is hot</a>!<br /><br />After updating it and running it for the first time, I got this little window<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF_yqfWlTvx3I9OhAS0riG9vTBK04xWdvIngS2TfeQw2LFOTure_BOtb-kZE3TmFjnT7grxhnWd51Gb8dVjOKM1tbm-xsrAMvPDQUhf5bLw6H1ipQPPurYiAGH0R4JgM5mMf97/s1600-h/firefox3_5update.PNG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 123px; height: 33px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF_yqfWlTvx3I9OhAS0riG9vTBK04xWdvIngS2TfeQw2LFOTure_BOtb-kZE3TmFjnT7grxhnWd51Gb8dVjOKM1tbm-xsrAMvPDQUhf5bLw6H1ipQPPurYiAGH0R4JgM5mMf97/s400/firefox3_5update.PNG" alt="" id="BLOGGER_PHOTO_ID_5353150925773618818" border="0" /></a><br />It took me a while to even realize that that little guy was somewhere on my screen, <a href="http://twitter.com/BlackTigerX/statuses/2405306742">I thought</a> Firefox was just <span style="font-weight: bold;">taking a long time to start</span> after the update, then I clicked on the taskbar icon and that's when I saw the little window, I tried to re-size it but it didn't allow me to, all I could do was close the little (attempt of) window, then Firefox ran normal<br /><br />thought I would blog about it in case this happens to more people<br /><br />symptom: Firefox takes a long time to start after updating to 3.5<br />solution: click on the taskbar firefox icon and find the little window on your screen, close it, then Firefox will run normalBlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com0tag:blogger.com,1999:blog-13751027.post-51208902361507697562009-06-24T16:03:00.000-07:002009-06-24T16:19:53.781-07:00Are we done with XML yet? hello JINII have never been a fan of XML, I've hated it from "day one", the format is too inefficient, too bloated; I have had some ideas on things that can be done to reduce the size on xml data sets, such as having some kind of header definition embedded at the top of the file and other ideas, but the point of this post is not to talk those ideas, but rather my own proposal to start getting rid of xml.<br /><br />One area where I find particularly painful to use XML is on configuration files and my proposal to fix this problem is to formalize a new format, which I call <span style="font-weight: bold;">JINI</span> for now. JINI is a subset of JSON similar in simplicity to the good old .ini files and it's used specifically for configuration purposes to replace all those app.config xml configuration files<br /><br />Benefits<br />- <span style="font-weight: bold;">Simple</span><br />- No brackets<br />- <span style="font-weight: bold;">Simple</span><br />- Shorter<br />- Easier to read<br />- <span style="font-weight: bold;">Simpler</span><br />- Everything that can be expressed in XML, can be expressed in JINI, but simpler<br /><br />Too bad "jini" is kinda already taken (2 million results on Google and 714K on Bing say so)<br /><br />I thought someone would have come up with this idea already, but a quick search gave me nothing, so I thought I would get the ball rolling<br /><br />what do you think?BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com6tag:blogger.com,1999:blog-13751027.post-7794486688252811052009-06-22T17:28:00.001-07:002009-06-23T12:51:05.589-07:00How to: Convert DIB to Bitmap<p>During the weekend a friend asked for some help on code to convert a DIB to a Bitmap in .NET, he had found some code in internet and it almost did everything he needed but the image was getting cut off along the sides, we figured the issue had something to do with getting the pointer to the bitmap, so we digged more and found some more code that then we had to make a couple fixes and changes to get it working. Since I was not able to find a full working solution to the problem I decided to write this post, I saw many people asking the same question in multiple forums so hopefully this will help</p> <p>First, you’ll need to add System.Drawing.dll to the references of your project, then you’ll need to add the following uses clauses</p> <pre class="code"><span style="color:green;">//Name spaces needed<br /></span><span style="color:blue;">using </span>System;<br /><span style="color:blue;">using </span>System.Drawing;<br /><span style="color:blue;">using </span>System.Drawing.Imaging;<br /><span style="color:blue;">using </span>System.IO;<br /><span style="color:blue;">using </span>System.Reflection;<br /><span style="color:blue;">using </span>System.Runtime.InteropServices;</pre><br />the next step is to declare the BITMAPINFOHEADER structure, this can be declared <strong>outside your class</strong>:<br /><br /><pre class="code">[<span style="color: rgb(43, 145, 175);">StructLayout</span>(<span style="color: rgb(43, 145, 175);">LayoutKind</span>.Sequential, Pack = 1)]<br /><span style="color:blue;">public struct </span><span style="color: rgb(43, 145, 175);">BITMAPINFOHEADER<br /></span>{<br /> <span style="color:blue;">public uint </span>biSize;<br /> <span style="color:blue;">public int </span>biWidth;<br /> <span style="color:blue;">public int </span>biHeight;<br /> <span style="color:blue;">public ushort </span>biPlanes;<br /> <span style="color:blue;">public ushort </span>biBitCount;<br /> <span style="color:blue;">public uint </span>biCompression;<br /> <span style="color:blue;">public uint </span>biSizeImage;<br /> <span style="color:blue;">public int </span>biXPelsPerMeter;<br /> <span style="color:blue;">public int </span>biYPelsPerMeter;<br /> <span style="color:blue;">public uint </span>biClrUsed;<br /> <span style="color:blue;">public uint </span>biClrImportant;<br /><br /> <span style="color:blue;">public void </span>Init()<br /> {<br /> biSize = (<span style="color:blue;">uint</span>)<span style="color: rgb(43, 145, 175);">Marshal</span>.SizeOf(<span style="color:blue;">this</span>);<br /> }<br />}</pre><br />Then you need to import a function from GdiPlus.dll<br /><pre class="code"><span style="color:green;">//GDI External method needed Place it within your class<br /></span>[<span style="color: rgb(43, 145, 175);">DllImport</span>(<span style="color: rgb(163, 21, 21);">"GdiPlus.dll"</span>, CharSet = <span style="color: rgb(43, 145, 175);">CharSet</span>.Unicode, ExactSpelling = <span style="color:blue;">true</span>)]<br /><span style="color:blue;">private static extern int </span>GdipCreateBitmapFromGdiDib(<span style="color: rgb(43, 145, 175);">IntPtr </span>pBIH,<br /> <span style="color: rgb(43, 145, 175);">IntPtr </span>pPix, <span style="color:blue;">out </span><span style="color: rgb(43, 145, 175);">IntPtr </span>pBitmap);</pre><br />Now we can get to the actual code to conver the DIB to Bitmap, note the use of a helper function GetPixelInfo, this was the culprit of our issues, and the one we had a hard time finding then getting to work, the function <span style="font-weight: bold;">BitmapFromDIB</span> that you’ll find all over the web doesn’t have this code and so it doesn’t work in many cases, in fact the function that you'll find all over the place has a <span style="font-weight: bold;">parameter pPix</span> but it doesn't specify how to get this value. This code needs to be declared <strong>inside your class</strong><br /><br /><pre class="code"><span style="color:green;">//THIS METHOD SAVES THE CONTENTS OF THE DIB POINTER INTO A BITMAP OBJECT<br /></span><span style="color:blue;">private static </span><span style="color: rgb(43, 145, 175);">Bitmap </span>BitmapFromDIB(<span style="color: rgb(43, 145, 175);">IntPtr </span>pDIB)<br />{<br /> <span style="color:green;">//get pointer to bitmap header info <br /> </span><span style="color: rgb(43, 145, 175);">IntPtr </span>pPix = GetPixelInfo(pDIB);<br /><br /> <span style="color:green;">//Call external GDI method<br /> </span><span style="color: rgb(43, 145, 175);">MethodInfo </span>mi = <span style="color:blue;">typeof</span>(<span style="color: rgb(43, 145, 175);">Bitmap</span>).GetMethod(<span style="color: rgb(163, 21, 21);">"FromGDIplus"</span>, <span style="color: rgb(43, 145, 175);">BindingFlags</span>.Static | <span style="color: rgb(43, 145, 175);">BindingFlags</span>.NonPublic);<br /> <span style="color:blue;">if </span>(mi == <span style="color:blue;">null</span>)<br /> <span style="color:blue;">return null</span>;<br /><br /> <span style="color:green;">// Initialize memory pointer where Bitmap will be saved<br /> </span><span style="color: rgb(43, 145, 175);">IntPtr </span>pBmp = <span style="color: rgb(43, 145, 175);">IntPtr</span>.Zero;<br /><br /> <span style="color:green;">//Call external methosd that saves bitmap into pointer<br /> </span><span style="color:blue;">int </span>status = GdipCreateBitmapFromGdiDib(pDIB, pPix, <span style="color:blue;">out </span>pBmp);<br /><br /> <span style="color:green;">//If success return bitmap, if failed return null<br /> </span><span style="color:blue;">if </span>((status == 0) && (pBmp != <span style="color: rgb(43, 145, 175);">IntPtr</span>.Zero))<br /> <span style="color:blue;">return </span>(<span style="color: rgb(43, 145, 175);">Bitmap</span>)mi.Invoke(<span style="color:blue;">null</span>, <span style="color:blue;">new object</span>[] { pBmp });<br /> <span style="color:blue;">else<br /> return null</span>;<br />}<br /><br /><span style="color:green;">//THIS METHOD GETS THE POINTER TO THE BITMAP HEADER INFO<br /></span><span style="color:blue;">private static </span><span style="color: rgb(43, 145, 175);">IntPtr </span>GetPixelInfo(<span style="color: rgb(43, 145, 175);">IntPtr </span>bmpPtr)<br />{<br /> <span style="color: rgb(43, 145, 175);">BITMAPINFOHEADER </span>bmi = (<span style="color: rgb(43, 145, 175);">BITMAPINFOHEADER</span>)<span style="color: rgb(43, 145, 175);">Marshal</span>.PtrToStructure(bmpPtr, <span style="color:blue;">typeof</span>(<span style="color: rgb(43, 145, 175);">BITMAPINFOHEADER</span>));<br /><br /> <span style="color:blue;">if </span>(bmi.biSizeImage == 0)<br /> bmi.biSizeImage = (<span style="color:blue;">uint</span>)(((((bmi.biWidth * bmi.biBitCount) + 31) & ~31) >> 3) * bmi.biHeight);<br /><br /> <span style="color:blue;">int </span>p = (<span style="color:blue;">int</span>)bmi.biClrUsed;<br /> <span style="color:blue;">if </span>((p == 0) && (bmi.biBitCount <= 8))<br /> p = 1 << bmi.biBitCount;<br /> p = (p * 4) + (<span style="color:blue;">int</span>)bmi.biSize + (<span style="color:blue;">int</span>)bmpPtr;<br /> <span style="color:blue;">return </span>(<span style="color: rgb(43, 145, 175);">IntPtr</span>)p;<br />}</pre><br />finally, as a plus, what my friend actually needed was to convert from DIB to TIFF, so he wrote a function to do that, this function reuses the BitmapFromDIB function and allows you to set the image resolution<br /><br /><pre class="code"><span style="color:blue;">private void </span>SavehDibToTiff(<span style="color:blue;">int </span>hDIB, <span style="color:blue;">string </span>fileName, <span style="color:blue;">int </span>xRes, <span style="color:blue;">int </span>yRes)<br />{<br /> <span style="color:green;">//Identify the memory pointer to the DIB Handler (hDIB)<br /> </span><span style="color: rgb(43, 145, 175);">IntPtr </span>dibPtr = <span style="color:blue;">new </span><span style="color: rgb(43, 145, 175);">IntPtr</span>(hDIB);<br /><br /> <span style="color:green;">//Save the contents of DIB pointer into bitmap object<br /> </span><span style="color: rgb(43, 145, 175);">Bitmap </span>myBitmap = BitmapFromDIB(dibPtr);<br /><br /> <span style="color:green;">//Set resolution if needed<br /> </span><span style="color:blue;">if </span>(xRes >0 && yRes>0)<br /> myBitmap.SetResolution(xRes, yRes);<br /><br /> <span style="color:green;">//Create an instance of the windows TIFF encoder<br /> </span><span style="color: rgb(43, 145, 175);">ImageCodecInfo </span>ici = GetEncoderInfo(<span style="color: rgb(163, 21, 21);">"image/tiff"</span>);<br /><br /> <span style="color:green;">//Define encoder parameters<br /> </span><span style="color: rgb(43, 145, 175);">EncoderParameters </span>eps = <span style="color:blue;">new </span><span style="color: rgb(43, 145, 175);">EncoderParameters</span>(1); <span style="color:green;">// only one parameter in this case (compression)<br /><br /> //Create an Encoder Value for TIFF compression Group 4<br /> </span><span style="color:blue;">long </span>ev = (<span style="color:blue;">long</span>)<span style="color: rgb(43, 145, 175);">EncoderValue</span>.CompressionCCITT4;<br /> eps.Param[0] = <span style="color:blue;">new </span><span style="color: rgb(43, 145, 175);">EncoderParameter</span>(System.Drawing.Imaging.<span style="color: rgb(43, 145, 175);">Encoder</span>.Compression, ev);<br /><br /> <span style="color:green;">//Save file <br /> </span>myBitmap.Save(fileName, ici, eps);<br />}<br /></pre><pre class="code"><span style="color:green;">//Helper to get Encoder from Windows for file type.<br /></span><span style="color:blue;">private static </span><span style="color: rgb(43, 145, 175);">ImageCodecInfo </span>GetEncoderInfo(<span style="color: rgb(43, 145, 175);">String </span>mimeType)<br />{<br /> <span style="color: rgb(43, 145, 175);">ImageCodecInfo</span>[] encoders = <span style="color: rgb(43, 145, 175);">ImageCodecInfo</span>.GetImageEncoders();<br /> <span style="color:blue;">for </span>(<span style="color:blue;">int </span>j = 0; j < encoders.Length; ++j)<br /> {<br /> <span style="color:blue;">if </span>(encoders[j].MimeType == mimeType)<br /> <span style="color:blue;">return </span>encoders[j];<br /> }<br /> <span style="color:blue;">return null</span>;<br />}</pre><br />and that is it, hoping this will help someone out thereBlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com2tag:blogger.com,1999:blog-13751027.post-43727029324931345042009-06-13T14:24:00.001-07:002009-06-13T14:34:32.174-07:00What are those colors on IE tabs?<p><a href="http://lh4.ggpht.com/_cofcJplmJ2Q/SjQZIrhVYjI/AAAAAAAABDY/39bHa-pi-Aw/s1600-h/colored%20tabs%5B3%5D.png"><img style="border: 0px none ; display: block; float: none; margin-left: auto; margin-right: auto;" title="colored tabs" alt="colored tabs" src="http://lh3.ggpht.com/_cofcJplmJ2Q/SjQZJGfy17I/AAAAAAAABDc/jytb1sI9vP0/colored%20tabs_thumb%5B1%5D.png?imgmax=800" width="244" border="0" height="44" /></a></p> <p>I thought this was one of the best features in Internet Explorer 8, but not everyone gets the meaning of the colors on the tabs. The colors represent that the <strong>tabs are related</strong>, meaning that <strong>you followed a link from one page</strong>, IE opened another tab and assigned the same color as the previous tab, so that way <strong>the tabs that are derived from other tabs are now all grouped</strong> and it’s very easy to see this, very useful when you have multiple tabs open for different purposes. I just had to blog this because someone actually asked me what those colors were for, so I figured there’s more people who may have the same question.</p>BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com2tag:blogger.com,1999:blog-13751027.post-4228648886914407582009-05-31T17:35:00.001-07:002009-05-31T17:36:41.865-07:00Silverlight how to: Add a user control to another user control<p>I'm starting to experiment with SilverLight and there's plenty of material out there, but some of the small details are really hard to find. The first application I'm working on requires a couple user controls, one embedded in the other and I spent a couple hours finding how to insert the user control into another control, then to the page, I thought it would be as easy as drag and drop but that didn't work, tried a few other things with no luck, turns out you have to add the namespace to the xaml, similar to the way you declare your controls in ASP.NET <br />The top xml of a user control (or the Page.xaml which is really just a user control) looks like this: <br /></p> <p><UserControl x:Class="MyNameSpace.SomeUserControl" <br />    xmlns="<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation"">http://schemas.microsoft.com/winfx/2006/xaml/presentation"</a> <br />    xmlns:x="<a href="http://schemas.microsoft.com/winfx/2006/xaml"">http://schemas.microsoft.com/winfx/2006/xaml"</a> <br />    Width="200" Height="300"></p> <p>right after the <strong>last line with xmlns</strong>, you can type "xmlns:[prefix]=" (where [prefix] is the prefix you want to use in the xml to add your control, and make sure to add the <strong>=</strong> at the end); intellisense will do the rest, the first line of the drop down will contain the default namespace of your assembly, select that and you're good to go, it will look something like this:</p> <p><UserControl x:Class="MyNameSpace.SomeUserControl" <br />    xmlns="<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation"">http://schemas.microsoft.com/winfx/2006/xaml/presentation"</a> <br />    xmlns:x="<a href="http://schemas.microsoft.com/winfx/2006/xaml"">http://schemas.microsoft.com/winfx/2006/xaml"</a> <br />    <font color="#ff0000">xmlns:prefix="clr-namespace:MyUserControl"</font> <br />    Width="200" Height="300"></p> <p>You can now start adding your control by typing <strong><font color="#ff0000"><prefix:</font></strong> wherever you want to add your control and again intellisense will do the rest for you, you will be able to select any of the user controls that you have created previously under that namespace. <br />One last thing, if you will be referencing that user control from the code behind, you will need to name your control:</p> <p><prefix:MyUserControl <strong>Name="myControl"</strong> ></prefix:MyUserControl></p> <p>Doing so will give you strongly typed access to the instance of the control in your code behind, public members included</p> <p><strong>myControl</strong>.SomePublicMethod(someParameters);</p>BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com2tag:blogger.com,1999:blog-13751027.post-51196400619400155512009-04-16T14:58:00.000-07:002009-04-17T13:46:52.953-07:00my solution to Eric Lippert's quiz<a href="http://blogs.msdn.com/ericlippert/archive/2009/04/15/comma-quibbling.aspx">Eric posted a quiz</a> a few days ago, it generated quite a number of responses, so I thought I would answer with the shortest possible C# answer (with my previous team we used to kinda compete on refactoring), so here it is (<a href="http://juztinwilzon.blogspot.com/">Justin</a> and <a href="http://foxsys.blogspot.com">Paul</a>, bring it on!):<br />The problem:<br />Write me a function that takes a non-null IEnumerable<string> and returns a string with the following characteristics: <p>(1) If the sequence is empty then the resulting string is "{}".<br />(2) If the sequence is a single item "ABC" then the resulting string is "{ABC}".<br />(3) If the sequence is the two item sequence "ABC", "DEF" then the resulting string is "{ABC and DEF}".<br />(4) If the sequence has more than two items, say, "ABC", "DEF", "G", "H" then the resulting string is "{ABC, DEF, G and H}". (Note: no Oxford comma!)</p><br />My solution:<br /><div style="background: white none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-family:Courier New;font-size:10pt;color:black;"><p style="margin: 0px;"><span style="color:blue;">static</span> <span style="color:blue;">string</span> JoinStrings(<span style="color: rgb(43, 145, 175);">IEnumerable</span><<span style="color:blue;">string</span>> strings) {</p><p style="margin: 0px;"> <span style="color:blue;">int</span> len = strings.Count();</p><p style="margin: 0px;"> <span style="color:blue;">return</span> <span style="color: rgb(163, 21, 21);">"{"</span>+(</p><p style="margin: 0px;"> (len > 1) ?</p><p style="margin: 0px;"> strings.Take(len - 1)</p><p style="margin: 0px;"> .Aggregate((<span style="color:blue;">string</span> head, <span style="color:blue;">string</span> tail) => head+<span style="color: rgb(163, 21, 21);">", "</span>+tail)+</p><p style="margin: 0px;"> <span style="color: rgb(163, 21, 21);">" and "</span> +strings.Last()</p><p style="margin: 0px;"> : (len == 1) ?</p><p style="margin: 0px;"> strings.First()</p><p style="margin: 0px;"> : <span style="color: rgb(163, 21, 21);">""</span>)+</p><p style="margin: 0px;"> <span style="color: rgb(163, 21, 21);">"}"</span>;</p><p style="margin: 0px;">}</p></div></string>BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com2tag:blogger.com,1999:blog-13751027.post-37402428971360710272009-04-02T14:37:00.000-07:002009-04-02T15:25:35.108-07:00public ASP.NET MVC { get; private set; }For the 2 people who don't read many blogs (or <a href="http://twitter.com/blacktigerx">twitter</a>), but do read this one, yesterday it was announced that <a href="http://www.hanselman.com/blog/MicrosoftASPNETMVC10IsNowOpenSourceMSPL.aspx">ASP.NET MVC 1.0 is open source</a> baby! "Free like Speech." and there are no restrictions to the platform either, the license is MS-PL which provides broad rights to modify and redistribute the source code.<br /><br />The first question that was raised was "can I submit patches?" and the answer is <span style="font-weight: bold;">no</span>, however nothing stops you from going and creating your own copy (forking) and start modifying it and redistributing it <a href="http://github.com/machine/msmvc/tree/master">like this guy</a> has already done.<br /><br />You can get the <a href="http://go.microsoft.com/fwlink/?LinkId=144444">source code here</a>.BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com0tag:blogger.com,1999:blog-13751027.post-11546346107557366362009-04-02T09:15:00.000-07:002009-04-02T09:16:02.186-07:00Did you know? Interface members are allowed to be privateThis one comes as a surprise to most people, but it is possible to have a private implementation for an interface member, let's look at a very simple example, just for purposes of the ilustration.<br /><!-- {\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;\red163\green21\blue21;\red0\green128\blue0;}??\fs20 \cf1 public\cf0 \cf1 interface\cf0 \cf4 ITest\cf0 \{\par ?? \cf1 void\cf0 Test();\par ??\}\par ??\par ??\cf1 public\cf0 \cf1 class\cf0 \cf4 Test\cf0 : \cf4 ITest\cf0 \{\par ?? \cf1 void\cf0 \cf4 ITest\cf0 .Test() \{\par ?? \cf4 Console\cf0 .WriteLine(\cf5 "test"\cf0 );\par ?? \}\par ?? \cf1 public\cf0 \cf1 void\cf0 Test2() \{\par ?? \cf4 Console\cf0 .WriteLine(\cf5 "test2"\cf0 );\par ?? \}\par ??\}\par ??\par ??\cf1 class\cf0 \cf4 Program\cf0 \{\par ?? \cf1 static\cf0 \cf1 void\cf0 Main(\cf1 string\cf0 [] args) \{\par ?? \cf4 ITest\cf0 t = \cf1 new\cf0 \cf4 Test\cf0 ();\par ?? t.Test();\par ?? \cf4 Test\cf0 t2 = \cf1 new\cf0 \cf4 Test\cf0 ();\par ?? \cf6 //t2.Test(); //<<=== doesn't compile\par ??} --><br /><div style="background: white none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-family:Courier New;font-size:10pt;color:black;"><p style="margin: 0px;"><span style="color:blue;">public</span> <span style="color:blue;">interface</span> <span style="color: rgb(43, 145, 175);">ITest</span> {</p><p style="margin: 0px;"> <span style="color:blue;">void</span> Test();</p><p style="margin: 0px;">}</p><p style="margin: 0px;"> </p><p style="margin: 0px;"><span style="color:blue;">public</span> <span style="color:blue;">class</span> <span style="color: rgb(43, 145, 175);">Test</span> : <span style="color: rgb(43, 145, 175);">ITest</span> {</p><p style="margin: 0px;"> <span style="color:blue;">void</span> <span style="color: rgb(43, 145, 175);">ITest</span>.Test() {</p><p style="margin: 0px;"> <span style="color: rgb(43, 145, 175);">Console</span>.WriteLine(<span style="color: rgb(163, 21, 21);">"test"</span>);</p><p style="margin: 0px;"> }</p><p style="margin: 0px;"> <span style="color:blue;">public</span> <span style="color:blue;">void</span> Test2() {</p><p style="margin: 0px;"> <span style="color: rgb(43, 145, 175);">Console</span>.WriteLine(<span style="color: rgb(163, 21, 21);">"test2"</span>);</p><p style="margin: 0px;"> }</p><p style="margin: 0px;">}</p><p style="margin: 0px;"> </p><p style="margin: 0px;"><span style="color:blue;">class</span> <span style="color: rgb(43, 145, 175);">Program</span> {</p><p style="margin: 0px;"> <span style="color:blue;">static</span> <span style="color:blue;">void</span> Main(<span style="color:blue;">string</span>[] args) {</p><p style="margin: 0px;"> <span style="color: rgb(43, 145, 175);">ITest</span> t = <span style="color:blue;">new</span> <span style="color: rgb(43, 145, 175);">Test</span>();</p><p style="margin: 0px;"> t.Test();</p><p style="margin: 0px;"> <span style="color: rgb(43, 145, 175);">Test</span> t2 = <span style="color:blue;">new</span> <span style="color: rgb(43, 145, 175);">Test</span>();</p><p style="margin: 0px;"> <span style="color:green;">//t2.Test(); //<<=== doesn't compile</span></p></div><br />If you don't believe it you can try it of course.<br /><br />But why is this useful or how do you use this?<br /><br />The technique allows you to ensure that the method is only visible to those who are using a variable of the interface type. All this does is to force the use of the member through an instance of the interface, meaning, for this example, if you want to get access to the .Test method, you can only do so through a variable of type ITest.<br /><br />The only trick to make this work is to precede the member declaration with the Interface type as in:<br /><br />void ITest.Test();<br /><br />Not the most useful of tricks, but something to have on the bag of tricks, or maybe something to make you win a bet ;)BlackTigerXhttp://www.blogger.com/profile/05376454374607771065noreply@blogger.com0