<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>try {} except &#187; Articles</title>
	<atom:link href="http://www.tryexcept.com/category/articles/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tryexcept.com</link>
	<description>Tools and information for software developers</description>
	<lastBuildDate>Sun, 18 Sep 2011 20:33:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Running Windows 8 inside VirtualBox</title>
		<link>http://www.tryexcept.com/articles/2011/09/18/running-windows-8-inside-virtualbox.html</link>
		<comments>http://www.tryexcept.com/articles/2011/09/18/running-windows-8-inside-virtualbox.html#comments</comments>
		<pubDate>Sun, 18 Sep 2011 20:33:29 +0000</pubDate>
		<dc:creator>Manuel Gomes</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[windows 8]]></category>

		<guid isPermaLink="false">http://www.tryexcept.com/?p=431</guid>
		<description><![CDATA[Small step-by-step guide on how to install and run Windows 8 Developer Preview under VirtualBox. First of all, download the 32bit edition of Windows 8 developer preview, available at Windows DevCenter, (the direct short link is http://goo.gl/Vvs1H - 2.8GB ISO image). &#8230; <a href="http://www.tryexcept.com/articles/2011/09/18/running-windows-8-inside-virtualbox.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Small step-by-step guide on how to install and run Windows 8 Developer Preview under VirtualBox.</p>
<p><span id="more-431"></span></p>
<p>First of all, download the 32bit edition of Windows 8 developer preview, available at <a title="Windows Metro Dev Center" href="http://msdn.microsoft.com/en-us/windows/apps/br229516" target="_blank">Windows DevCenter</a>, (the direct short link is <a title="Windows 8 32bit ISO" href="http://goo.gl/Vvs1H">http://goo.gl/Vvs1H</a> - 2.8GB ISO image).</p>
<h2>Create the Virtual Machine</h2>
<p>While the ISO downloads, open virtualbox and create a new virtual machine:</p>
<ul>
<li>Operating System: Microsoft Windows, Version: Windows 7;</li>
<li>2048MB Memory size</li>
<li>Create a new Virtual Hard Disk, with at least 20GB &#8211; you can use &#8220;Fixed-size storage&#8221; (better performance, but uses more HDD space) or &#8220;Dynamically expanding storage&#8221; (a bit slower, but the .vdi file grows as necessary, using less HDD space);</li>
</ul>
<div>Before you boot the virtual machine, adjust the following properties, in the settings dialog:</div>
<div>
<ul>
<li>In the &#8220;System&#8221; group, under &#8220;Motherboard&#8221;, choose the &#8220;ICH9&#8243; chipset, enable &#8220;IO APIC&#8221; and &#8220;absolute pointing device&#8221;; under &#8220;Acceleration&#8221; enable &#8220;VT-x/AMD-v&#8221; and &#8220;Nested paging&#8221;;</li>
<li>In &#8220;Display&#8221; enable 2D acceleration. Increase the video memory accordingly (~ 40MB);</li>
<li>In &#8220;Storage&#8221;, under &#8220;IDE Controller&#8221;, in the &#8220;Empty&#8221; node choose the new Windows 8 ISO file &#8211; this will be the Boot DVD;</li>
<li>In &#8220;Network&#8221; adjust the network settings: in my case i am using the &#8220;Bridge Adapter&#8221;;</li>
</ul>
<div id="attachment_437" class="wp-caption aligncenter" style="width: 214px"><a href="http://www.tryexcept.com/wp-content/uploads/2011/09/windows8vbox.png"><img class="size-medium wp-image-437" title="Windows 8 under Virtual Box settings" src="http://www.tryexcept.com/wp-content/uploads/2011/09/windows8vbox-204x300.png" alt="Windows 8 under Virtual Box settings" width="204" height="300" /></a><p class="wp-caption-text">Windows 8 VirtualBox settings</p></div>
</div>
<h2>Install Windows 8</h2>
<p>Boot the VM. It may seem that it is hanged at boot, but it is not, just be patient; 10 to 20 seconds later, the Windows 8 logo will show up and the setup will boot normally. The setup process, in the first stages, is pretty straightforward &#8211; virtually the same as Windows 7.</p>
<p><a href="http://www.tryexcept.com/wp-content/uploads/2011/09/windows8firstboot_preparing.png"><img class="aligncenter size-medium wp-image-444" title="Windows 8 First Boot under VirtualBox" src="http://www.tryexcept.com/wp-content/uploads/2011/09/windows8firstboot_preparing-300x250.png" alt="Windows 8 First Boot under VirtualBox" width="300" height="250" /></a></p>
<p>In my system the setup took about 25(!) minutes to complete.</p>
<h2>Final Impressions</h2>
<p>It&#8217;s not possible to install the VirtualBox Guest Additions, so the overall performance is not brilliant (no Graphics accel. is a big drawback&#8230;), but Windows 8 remains usable for testing purposes.</p>
<p>Specs: VirtualBox 4.0.12, running under Windows 7 64bit, Core2Duo 2.13.</p>
<p>Boot example on youtube: <a href="http://youtu.be/fXvvmk-5KMc" target="_blank">http://youtu.be/fXvvmk-5KMc</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tryexcept.com/articles/2011/09/18/running-windows-8-inside-virtualbox.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wunderlist for Android is going native, drops Appcelerator Titanium Mobile</title>
		<link>http://www.tryexcept.com/articles/2011/09/12/wunderlist-for-android-is-going-native-drops-appcelerator-titanium-mobile.html</link>
		<comments>http://www.tryexcept.com/articles/2011/09/12/wunderlist-for-android-is-going-native-drops-appcelerator-titanium-mobile.html#comments</comments>
		<pubDate>Mon, 12 Sep 2011 22:33:59 +0000</pubDate>
		<dc:creator>Manuel Gomes</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[titanium]]></category>

		<guid isPermaLink="false">http://www.tryexcept.com/?p=405</guid>
		<description><![CDATA[Appcelerator&#8217;s approach to the Android platform has made another victim, a significant one: 6Wunderkinder&#8217;s popular Wunderlist ditched Titanium Mobile (TM) for Android, and is now a native app. &#8220;(&#8230;) Wunderlist is now native – smaller, faster and more stable.&#8221; Matthew &#8230; <a href="http://www.tryexcept.com/articles/2011/09/12/wunderlist-for-android-is-going-native-drops-appcelerator-titanium-mobile.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Appcelerator&#8217;s approach to the Android platform has made another victim, a significant one: 6Wunderkinder&#8217;s popular Wunderlist ditched Titanium Mobile (TM) for Android, and is now a native app.</p>
<blockquote cite="http://www.6wunderkinder.com/blog/2011/09/05/wunderlist-for-android-rebuilt-relaunched-and-really-awesome/"><p>&#8220;(&#8230;) Wunderlist is now native – smaller, faster and more stable.&#8221;<br />
<a href="http://bit.ly/qUQpVv" target="_blank">Matthew Bostock, 6Wunderkinder&#8217;s blog</a></p></blockquote>
<p>Translated, Wunderlist got rid of TM&#8217;s biggest problems:</p>
<ul>
<li>Size: even the smallest &#8220;Hello World&#8221; app weights at least 1.5MB (this is still huge in the mobile world &#8211; do the same thing using native Java and the app will only weight a few KB);</li>
<li>Speed: TM for Android slow. This is mainly due to the fact that TM for Android is using <a href="www.mozilla.org/rhino" target="_blank">Mozilla&#8217;s Rhino</a> as its javascript interpreter, written in Java, running inside Dalvik&#8217;s VM, and not compiled to native ARM, as <a href="http://code.google.com/p/v8" target="_blank">google&#8217;s V8</a>, <a href="https://developer.mozilla.org/en/SpiderMonkey" target="_blank">SpiderMonkey</a> or any JS engine written in C or C++ would;</li>
<li>Stability: this one is not really, in my opinion, TM&#8217;s fault. Due to the fact that Javascript is dynamic language, and Titanium does not compile or even do any proper syntax check, the quality of the code is probably to blame here.</li>
</ul>
<p>Appcelerator<a href="http://developer.appcelerator.com/blog/2011/09/platform-engineering-android-runtime-performance-improvements.html" target="_blank"> reacted two days after 6Wunderkinder&#8217;s announcement</a>, stating that Titanium Mobile for Android will use, somewhere in the future, google&#8217;s<a href="http://code.google.com/p/v8" target="_blank"> V8 engine</a>. This comes, however, with a <a href="http://developer.android.com/resources/dashboard/platform-versions.html" target="_blank">still significant</a> drawback: only devices running Android 2.2 or newer support android&#8217;s NDK, and therefore the natively compiled V8 Engine. According to Appcelerator&#8217;s own benchmarks, this will at least double the performance. Remains to be seen if the &#8220;Size&#8221; problem will be solved: V8&#8242;s binaries will still be inside the app&#8217;s package&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tryexcept.com/articles/2011/09/12/wunderlist-for-android-is-going-native-drops-appcelerator-titanium-mobile.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Now that WebOS died, which is the best development crossplatform for iOS, Android, RIM and WP7?</title>
		<link>http://www.tryexcept.com/articles/2011/09/02/mobile_crossplatform.html</link>
		<comments>http://www.tryexcept.com/articles/2011/09/02/mobile_crossplatform.html#comments</comments>
		<pubDate>Fri, 02 Sep 2011 16:35:47 +0000</pubDate>
		<dc:creator>Manuel Gomes</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[titanium]]></category>
		<category><![CDATA[webos]]></category>

		<guid isPermaLink="false">http://www.tryexcept.com/?p=373</guid>
		<description><![CDATA[Yes, the excellent WebOS is defunct, and it will never be the mainstream player as, at least technically, it deserved. For all of us developing for the mobile world that don&#8217;t have the time or budget to develop natively in all the &#8230; <a href="http://www.tryexcept.com/articles/2011/09/02/mobile_crossplatform.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yes, the excellent WebOS is defunct, and it will never be the mainstream player as, at least technically, it deserved. For all of us developing for the mobile world that don&#8217;t have the time or budget to develop natively in all the mainstream platforms, its one less player to target. Myself, personally, am deciding/evaluating available options for true cross-platform development targeting iOS, Android, Blackberry and Windows Phone 7.</p>
<p>My requirements are:</p>
<ul>
<li>Native UI components must be used &#8211; maintaining the native look and feel for each platform is important (PhoneGap is out of the picture because of this);</li>
<li>The same code base (or at least most of it) must be used in all platforms;</li>
<li>The UI must scale well between Phone and Tablet formats and screen densities (DPI);</li>
<li>The application must perform smoothly, speedwise, even in lower end devices;</li>
<li>Some access to the device&#8217;s hardware: GPS, sensors, camera.</li>
</ul>
<p>I have found some platforms so far:</p>
<ul>
<li><strong><a href="http://www.appcelerator.com/" target="_blank">Titanium Mobile</a></strong>: this is my current number one, but i don&#8217;t think Windows Phone 7 will be supported. Plus, the Android implementation is a bit clumsy: the JavaScript core is not interpreted by the OS, so a java JS interpreter is included- this makes the application big and slow. In iOS this problem does not exist, as the system&#8217;s javascript interpreter is used. On the plus side, native UI components are supported and a very nice, Eclipse based, IDE is provided;</li>
<li><strong><a href="http://www.phonegap.com" target="_blank">PhoneGap</a></strong>: this one also uses JavaScript, but is completely HTML/JS based: the application runs inside a WebView, and has no bindings to native UI components, it relies on third-party JS libraries to build the UI, such as <a href="http://www.sencha.com/products/touch/" target="_blank">Sencha Touch</a> or <a href="http://jquerymobile.com/" target="_blank">jQuery Mobile</a>. It&#8217;s a browser on steroids basically, and doesn&#8217;t float my boat.</li>
<li><strong><a href="http://rhomobile.com/" target="_blank">RhoMobile</a></strong>: haven&#8217;t tested or reviewed this one yet, opinions anyone?</li>
</ul>
<p><span class="Apple-style-span" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;">So, i need your opinion about these or other development tools: are they any good? Have you used them in a project? Comment below.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tryexcept.com/articles/2011/09/02/mobile_crossplatform.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Titanium Mobile&#8217;s Android development now less painful than Prostate Exam &#8211; Mobile SDK 1.8 (!) + Fastdev</title>
		<link>http://www.tryexcept.com/articles/2011/05/14/titanium-mobiles-android-development-now-less-painful-than-prostate-exam-mobile-sdk-1-8-fastdev.html</link>
		<comments>http://www.tryexcept.com/articles/2011/05/14/titanium-mobiles-android-development-now-less-painful-than-prostate-exam-mobile-sdk-1-8-fastdev.html#comments</comments>
		<pubDate>Sat, 14 May 2011 19:45:00 +0000</pubDate>
		<dc:creator>Manuel Gomes</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[appcelerator]]></category>
		<category><![CDATA[fastdev]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[titanium]]></category>

		<guid isPermaLink="false">http://www.tryexcept.com/?p=241</guid>
		<description><![CDATA[A few days ago, Appcelerator announced a really cool new feature: Fastdev for Titanium Mobile. This thing cuts dramatically development times for Android apps as all the wait time spent recompiling and re-publishing the app to the emulator simply disappears! &#8230; <a href="http://www.tryexcept.com/articles/2011/05/14/titanium-mobiles-android-development-now-less-painful-than-prostate-exam-mobile-sdk-1-8-fastdev.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tryexcept.com/wp-content/uploads/2011/05/exam.jpg"><img class="alignleft size-medium wp-image-274" style="width: 300px; height: 199px;" title="exam" src="http://www.tryexcept.com/wp-content/uploads/2011/05/exam-300x199.jpg" alt="" /></a>A few days ago, Appcelerator announced a really cool new feature: Fastdev for Titanium Mobile. This thing cuts dramatically development times for Android apps as all the wait time spent recompiling and re-publishing the app to the emulator simply disappears!<br />
<span id="more-241"></span></p>
<h3>The problem</h3>
<p>Normally, Titanium has to compile the entire titanium class library, then &#8220;dex&#8221; it and package all your app&#8217;s js files and resources and push it inside the emulator so you can test it &#8211; and this happens every time you change something in your app. The problem here is&#8230; this is slow, really slow. This fact alone almost drove me off Titanium Mobile, in favour of other, friendlier, platforms.</p>
<h3>Using Fastdev</h3>
<p>First download a recent nightly build of Titanium Mobile SDK (latest 1.7.x or 1.8.0) &#8211; <a href="http://www.tryexcept.com/articles/2011/05/14/titanium-mobile-sdk-1-8-available.html">more details in this previous post</a>.</p>
<p>Now, the tricky part. This feature is still in beta, so there is no fancy UI integration inside <a href="http://bit.ly/mfGYU5" target="_blank">Titanium Studio</a>, and we need to do everything &#8220;by hand&#8221;.</p>
<p>First, add the 1.8.0 SDK folder to your system environment&#8217;s PATH (if you don&#8217;t know how to do this, <a href="http://bit.ly/iNvq6S" target="_blank">click here</a>). After this, in the command shell, go to your application&#8217;s folder and type:</p>
<pre class="ruby">start /B titanium fastdev start</pre>
<p>This will start a new server that will send all the .js files and resources to your app, running in the emulator (according to Appcelerator, using fastdev on devices will be available soon). The files served are logged into this terminal window, so keep it open and visible, to check what is happening under the hood.</p>
<p>After this, just run the app on the emulator, as always, but do it only ONCE &#8211; if you need to update your app, don&#8217;t recompile: just close it inside the emulator and run it again &#8211; it will download all the resources from the fastdev server started above!</p>
<p>And that&#8217;s it, much faster and less painful&#8230; unless you are targeting honeycomb; but here the problem is that the emulator is, I think officially, the slowest emulator in the world.</p>
<blockquote><p>Update: fastdev is already available inside the latest Titanium Studio &#8211; update it ASAP</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.tryexcept.com/articles/2011/05/14/titanium-mobiles-android-development-now-less-painful-than-prostate-exam-mobile-sdk-1-8-fastdev.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Titanium Mobile SDK 1.8 available</title>
		<link>http://www.tryexcept.com/articles/2011/05/14/titanium-mobile-sdk-1-8-available.html</link>
		<comments>http://www.tryexcept.com/articles/2011/05/14/titanium-mobile-sdk-1-8-available.html#comments</comments>
		<pubDate>Sat, 14 May 2011 17:26:46 +0000</pubDate>
		<dc:creator>Manuel Gomes</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[titanium]]></category>

		<guid isPermaLink="false">http://www.tryexcept.com/?p=257</guid>
		<description><![CDATA[Titanium Mobile SDK 1.8.0 is already available in the Appcelerator&#8217;s continuous integration (CI) area: Just choose the &#8220;master&#8221; branch and download the latest SDK files for your O.S.! - http://builds.appcelerator.com.s3.amazonaws.com/mobile/master/mobilesdk-1.8.0-20110513115704-win32.zip is the latest for windows at this moment. To install, just &#8230; <a href="http://www.tryexcept.com/articles/2011/05/14/titanium-mobile-sdk-1-8-available.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Titanium Mobile SDK 1.8.0 is already available in the Appcelerator&#8217;s <a href="http://bit.ly/ihViXq" target="_blank">continuous integration (CI) area</a>: Just choose the &#8220;master&#8221; branch and download the latest SDK files for your O.S.!</p>
<p><span id="more-257"></span>- <a href="http://builds.appcelerator.com.s3.amazonaws.com/mobile/master/mobilesdk-1.8.0-20110513115704-win32.zip" target="_blank">http://builds.appcelerator.com.s3.amazonaws.com/mobile/master/mobilesdk-1.8.0-20110513115704-win32.zip</a> is the latest for windows at this moment. To install, just unzip it inside your Titanium SDK folder (this should be, in Windows, %ProgramData%\Titanium &#8211; in my case, this translates to C:\ProgramData\Titanium); The ZIP already has the required folder structure (mobilesdk\win32\[version]\etc..), so just unzip it there and everything will be fine.</p>
<p><a href="http://www.tryexcept.com/wp-content/uploads/2011/05/sdk180.png"><img class="alignnone size-full wp-image-261" title="sdk180" src="http://www.tryexcept.com/wp-content/uploads/2011/05/sdk180.png" alt="" width="396" height="444" /></a></p>
<p>If you are already using <a href="http://bit.ly/mfGYU5" target="_blank">Titanium Studio</a>, use the &#8220;Help&#8221; -&gt; &#8220;Install Titanium SDK from URL&#8221; and paste the full URL to the ZIP file you have selected from the nightly builds. I prefer the method above, as this option, sometimes, doesn&#8217;t unzip the full contents of the updated SDK.</p>
<p><a href="http://www.tryexcept.com/wp-content/uploads/2011/05/titaniumInstall.png"><img class="alignnone size-full wp-image-258" title="Titanium Studio, install SDK from URL" src="http://www.tryexcept.com/wp-content/uploads/2011/05/titaniumInstall.png" alt="Titanium Studio, install SDK from URL" width="603" height="433" /></a></p>
<p>Appcelerator has made no official announcement on 1.8.0, so I have no idea what is new, but keep in mind: this is a beta release, and should not be used in production apps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tryexcept.com/articles/2011/05/14/titanium-mobile-sdk-1-8-available.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Updated Titanium autocomplete for 1.5.1 using Eclipse and Aptana</title>
		<link>http://www.tryexcept.com/articles/2011/01/08/updated-titanium-autocomplete-for-1-5-1-using-eclipse-and-aptana.html</link>
		<comments>http://www.tryexcept.com/articles/2011/01/08/updated-titanium-autocomplete-for-1-5-1-using-eclipse-and-aptana.html#comments</comments>
		<pubDate>Sat, 08 Jan 2011 00:17:43 +0000</pubDate>
		<dc:creator>Manuel Gomes</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[titanium]]></category>

		<guid isPermaLink="false">http://www.tryexcept.com/?p=228</guid>
		<description><![CDATA[Here is the uploaded javascript header file, updated for Appcelerator&#8217;s Titanium Mobile version 1.5.1. This can be used with Eclipse+Aptana&#8217;s autocomplete, using the method described by James David Low a while back.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tryexcept.com/wp-content/uploads/2011/01/titanium_autocomplete_screenshot.png"><img class="alignright size-medium wp-image-229" title="Screenshot of titanium's autocomplete using Eclipse" src="http://www.tryexcept.com/wp-content/uploads/2011/01/titanium_autocomplete_screenshot-300x155.png" alt="" width="300" height="155" /></a></p>
<p><a href="http://www.tryexcept.com/wp-content/uploads/2011/01/timobile151.js">Here is the uploaded javascript header file</a>, updated for Appcelerator&#8217;s Titanium Mobile version 1.5.1. This can be used with Eclipse+Aptana&#8217;s autocomplete, using the method described by <a title="James Low method" href="http://jameslow.com/2010/05/31/titanium-autocomplete-eclipse/" target="_blank">James David Low</a> a while back.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tryexcept.com/articles/2011/01/08/updated-titanium-autocomplete-for-1-5-1-using-eclipse-and-aptana.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Titanium Autocomplete</title>
		<link>http://www.tryexcept.com/articles/2010/12/08/titanium-autocomplete.html</link>
		<comments>http://www.tryexcept.com/articles/2010/12/08/titanium-autocomplete.html#comments</comments>
		<pubDate>Wed, 08 Dec 2010 00:11:11 +0000</pubDate>
		<dc:creator>Manuel Gomes</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[titanium]]></category>

		<guid isPermaLink="false">http://www.tryexcept.com/?p=222</guid>
		<description><![CDATA[James Low has a AppCelerator Titanium&#8217;s API AutoComplete for Eclipse+Aptana. Download it here http://jameslow.com/2010/05/31/titanium-autocomplete-eclipse/ I haven&#8217;t tried it yet, I&#8217;m using notepad++ still, but I&#8217;ll give it a go ASAP!]]></description>
			<content:encoded><![CDATA[<p>James Low has a AppCelerator Titanium&#8217;s API AutoComplete for Eclipse+Aptana. Download it here <a href="http://jameslow.com/2010/05/31/titanium-autocomplete-eclipse/">http://jameslow.com/2010/05/31/titanium-autocomplete-eclipse/</a></p>
<p>I haven&#8217;t tried it yet, I&#8217;m using notepad++ still, but I&#8217;ll give it a go ASAP!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tryexcept.com/articles/2010/12/08/titanium-autocomplete.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>c# for iPad?</title>
		<link>http://www.tryexcept.com/articles/2010/02/06/c-for-ipad.html</link>
		<comments>http://www.tryexcept.com/articles/2010/02/06/c-for-ipad.html#comments</comments>
		<pubDate>Sat, 06 Feb 2010 16:38:08 +0000</pubDate>
		<dc:creator>Manuel Gomes</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[monoTouch]]></category>

		<guid isPermaLink="false">http://www.tryexcept.com/?p=136</guid>
		<description><![CDATA[Yet a another alternative to Objectve-C/XCode has arrived: MonoTouch, the non Microsoft dotNet implementation, supports the new useless computer-without-a-keyboard -slash- big iPhone, Apple iPad. Yes, not surprisingly, Novell&#8217;s MonoTouch is now supporting the iPad. Not a surprise, as they already supported the &#8230; <a href="http://www.tryexcept.com/articles/2010/02/06/c-for-ipad.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yet a another alternative to Objectve-C/XCode has arrived: MonoTouch, the non Microsoft dotNet implementation, supports the new useless computer-without-a-keyboard -slash- big iPhone, Apple iPad.</p>
<p><span id="more-136"></span>Yes, not surprisingly, Novell&#8217;s MonoTouch is now supporting the iPad. Not a surprise, as they already supported the iPhone, and iPad is just an iPhone with a bigger screen. This means you can use your C# skills to create applications to for the whole iSomething ecosystem, without having to learn Objective-C or even ActionScript (the upcoming<a href="http://labs.adobe.com/technologies/flashcs5/" target="_blank"> Flash CS5</a> will have a cross-compiler that targets the iPhone+iPad).</p>
<p>MonoTouch supports many of the iPhad gadgetry, including GPS and accelerometer, as well as bindings to the address book. The User Interface is built using the Apple&#8217;s Interface Builder, that ships with the iPhone SDK &#8211; this means that you also have all the controls native to the iPhone available for you app, including Pickers, Sliders, Buttons, etc, etc &#8211; the downside is: you can&#8217;t just recompile your Silverlight/WPF/Winforms .net application&#8230; you have to write the UI from scratch, which is not a big problem if you have logic and presentation truly separated. Also, the applications are statically compiled, instead of being compiled on demand by a JIT compiler inside the CLR &#8211; as a result of this some limitations, such as limited Generics support and no dynamic code generation, are present &#8211; more on this at <a href="http://monotouch.net/Documentation/Limitations">http://monotouch.net/Documentation/Limitations</a></p>
<p>But, as with all things Apple-related, there&#8217;s a catch: None of this is free &#8211; to deploy your app you need to pay Apple; MonoTouch is not OpenSource, its a commercial product, prices start at $399. Also, you need to buy an Apple Mac Intel computer (10.5 or 10.6) to develop your applications.</p>
<p>Bryan Costanich wrote a nice introduction article about MonoTouch at InfoQ &#8211; read it <a href="http://www.infoq.com/articles/monotouch-introduction" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tryexcept.com/articles/2010/02/06/c-for-ipad.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using .net assemblies inside SQL Server: Quick start guide</title>
		<link>http://www.tryexcept.com/articles/2009/09/22/using-net-assemblies-inside-sql-server-quick-start-guide.html</link>
		<comments>http://www.tryexcept.com/articles/2009/09/22/using-net-assemblies-inside-sql-server-quick-start-guide.html#comments</comments>
		<pubDate>Tue, 22 Sep 2009 21:21:55 +0000</pubDate>
		<dc:creator>Manuel Gomes</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sqlclr]]></category>

		<guid isPermaLink="false">http://www.tryexcept.com/?p=78</guid>
		<description><![CDATA[Are you are an experienced .net programmer and you are too lazy to learn TSQL stored procedures, triggers or functions? Yes? Then read on this quick start guide on using .net assemblies inside SQL Server using SQLCLR. SQLCLR (or SQL &#8230; <a href="http://www.tryexcept.com/articles/2009/09/22/using-net-assemblies-inside-sql-server-quick-start-guide.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Are you are an experienced .net programmer and you are too lazy to learn TSQL stored procedures, triggers or functions? Yes? Then read on this quick start guide on using .net assemblies <span style="text-decoration: underline;">inside</span> SQL Server using SQLCLR.</p>
<p><span id="more-78"></span>SQLCLR (or SQL Common Language Runtime) is a technology for hosting of the .NET CLR engine inside SQL Server. This allows managed code, written in any .net language, to be hosted and run in the SQL Server environment. This technology is available in SQL Server 2005 or 2008 and allows you to create Stored Procedures, Triggers (for DML or DDL statements), UDFs, UDTs or even User-defined types, which allows you to create simple or complex data types which can be serialized or deserialized within the Database.<br />
[ad#468x60]<br />
Now, the example. I used Visual C# 2008 and SQLServer 2008 Express x64, but this example should work with 2005 editions as well. Remember, this is just a quick start guide, so the example is very simple.</p>
<p>Then create a new assembly (class library) project in Visual C# and name it tryExceptSQLCLR. Start by adding the following assemblies:</p>
<pre name="code" class="c-sharp">using Microsoft.SqlServer.Server;
using System.Data;
using System.Data.Sql;
using System.Data.SqlTypes;</pre>
<p>(we won&#8217;t be using all of them, but these are the ones you will normally need for SQLCLR integration)</p>
<p>Now lets start by creating a new Stored Procedure. This (useless) SP will use an input string and return the string length. SP&#8217;s are created as static methods, as SQLServer will not instantiate your class. Return type must always be Void, as all the SP result must be channeled via the SqlContext.Pipe class. </p>
<pre name="code" class="c-sharp">[Microsoft.SqlServer.Server.SqlProcedure]
public static void CountStringLength(String inputString)
{
   SqlContext.Pipe.Send(inputString.Length.ToString());
}</pre>
<p>SQLCLR recognizes the CountStringLength as a SP using the <em>Microsoft.SqlServer.Server.SqlProcedure</em> attribute. Pipe.Send also allows you to return SqlDataRecord objects or even full SqlDataReader result sets, but for the sake of simplicity, lets just return the string length as a string for now.</p>
<p>Build the assembly and that&#8217;s it, our new SP is ready! Now, create a new database in SQL Server and run the following TSQL statement:</p>
<pre name="code" class="sql">CREATE ASSEMBLY tryexceptAssembly
  FROM  '(path to the compiled assembly)\tryExceptSQLCLR.dll'
  WITH PERMISSION_SET = SAFE
go</pre>
<p>This loads the assembly binary file into the database &#8211; this is important: the assembly is not linked/referenced from your hard-disk or GAC, its actually loaded into the MDB file, so every time you compile a new version you have to reload it using the ALTER ASSEMBLY command. Our example only needs the SAFE permission_set, as we are not accessing information outside the database and we are not using any unmanaged code inside.</p>
<p>Few more things to go: SQLServer does not recognize automagically all the SPs inside this assembly &#8211; we have to create them all, one by one, with the correct parameters.</p>
<pre name="code" class="sql">CREATE PROCEDURE spCountStringLength (@inputString nvarchar(max))
AS
EXTERNAL NAME tryexceptAssembly.[tryExceptSQLCLR.Class1].CountStringLength
go</pre>
<p>(if you run into trouble, check out <a href="http://blogs.msdn.com/mattn/archive/2008/04/22/writing-clr-stored-procedures.aspx">this post</a> &#8211; MattN has done a lot of trouble shooting for us)<br />
CREATE PROCEDURE is not required every time you reload the assembly into the database using the ALTER ASSEMBLY command &#8211; if you change your SP header (e.g. alter the input parameters, method name, etc), SQLServer will only complain when you try to EXEC the SP, so Unit Test your project to prevent this.</p>
<p>And, finally, before we can execute our SP, we must enable CLR in our database, as SQLCLR support is disabled by default. Run the following:</p>
<pre name="code" class="sql">sp_configure 'clr enabled',1
go
reconfigure with override
go</pre>
<p>(this enables SQLCLR serverwide)</p>
<p>And voila, our SP is ready to run!</p>
<pre name="code" class="sql">EXEC dbo.spCountStringLength N'The lazy fox... whatever'</pre>
<p>&#8230; that returns 24, so it works.</p>
<p>Remember, every time you change and build your assembly you must <em>upload</em> it again into the database:</p>
<pre name="code" class="sql">ALTER ASSEMBLY tryexceptAssembly
  FROM  '(path to the compiled assembly)\tryExceptSQLCLR.dll'
  WITH PERMISSION_SET = SAFE
go</pre>
<p>If you want to publish your SQLCLR assembly in your newly developed product inside a DDL script do the following inside SQL Management Studio
<ul>
<li>Open your database (the one with the most recent assembly loaded)</li>
<li>Expand &#8220;Programmability&#8221; and &#8220;Assemblies&#8221;</li>
<li>In the context menu of your assembly (in this case tryexceptAssembly) choose the option &#8220;Script assembly as&#8221;->&#8221;Create to&#8221;->&#8221;New editor window&#8221;</li>
</ul>
<p>This will generate the statement needed to load your assembly using DDL commands only, without hard-disk file dependencies. The statement is basically the same as you saw in the beginning, but the entire assembly binary file coded as HEX:
<pre name="code" class="sql">CREATE ASSEMBLY [tryexceptAssembly]
AUTHORIZATION [dbo]
FROM 0x4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000800000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A2400000000000000504500004C0103001E4DB94A0000000000000000E00002210B010800000800000006000000000000CE2700000020000000400000000040000020000000020000040000000000000004000000000000000080000000020000000000000300408500001000001000000000100000100000000000001000000000000000000000007427000057000000004000008003000000000000000000000000000000000000006000000C000000F82600001C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000080000000000000000000000082000004800000000000000000000002E74657874000000D4070000002000000008000000020000000000000000000000000000200000602E72737263000000800300000040000000040000000A0000000000000000000000000000400000402E72656C6F6300000C0000000060000000020000000E00000000000000000000000000004000004200000000000000000000000000000000B027000000000000480000000200050080200000780600000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000133002001900000001000011281100000A026F1200000A0A1200281300000A6F1400000A2A1E02281500000A2A00000042534A4201000100000000000C00000076322E302E35303732370000000005006C00000020020000237E00008C020000E002000023537472696E6773000000006C05000008000000235553007405000010000000234755494400000084050000F400000023426C6F620000000000000002000001471502000900000000FA0133001600000100000016000000020000000200000001000000150000000E00000001000000010000000200000000000A00010000000000060045003E000600820070000600990070000600B60070000600D50070000600EE00700006000701700006002201700006003D0170000600750156010600890156010600970170000600B00170000600E001CD013B00F40100000600230203020600430203020A0088026D020A009E026D020A00A9026D020600BA023E000600CC023E000000000001000000000001000100010010001E00250005000100010050200000000096004C000A00010075200000000086185E000F00020000000100640011005E00130019005E00130021005E00130029005E00130031005E00130039005E00130041005E00130049005E00130051005E00180059005E00130061005E00130069005E00130071005E001D0081005E00230089005E000F0091005E000F009900B1022D00A900C1023200B100D2023600A100DB02130009005E000F002000830028002E00330068002E00130053002E001B0053002E00230059002E002B003E002E000B003E002E003B0053002E004B0053002E00530089002E006300B3002E006B00C0002E007300C9002E007B00D2003A0004800000010000000000000000000000000025000000020000000000000000000000010035000000000002000000000000000000000001006102000000000000003C4D6F64756C653E0074727945786365707453514C434C522E646C6C00436C617373310074727945786365707453514C434C52006D73636F726C69620053797374656D004F626A65637400436F756E74537472696E674C656E677468002E63746F7200696E707574537472696E670053797374656D2E5265666C656374696F6E00417373656D626C795469746C6541747472696275746500417373656D626C794465736372697074696F6E41747472696275746500417373656D626C79436F6E66696775726174696F6E41747472696275746500417373656D626C79436F6D70616E7941747472696275746500417373656D626C7950726F6475637441747472696275746500417373656D626C79436F7079726967687441747472696275746500417373656D626C7954726164656D61726B41747472696275746500417373656D626C7943756C747572654174747269627574650053797374656D2E52756E74696D652E496E7465726F70536572766963657300436F6D56697369626C65417474726962757465004775696441747472696275746500417373656D626C7956657273696F6E41747472696275746500417373656D626C7946696C6556657273696F6E4174747269627574650053797374656D2E446961676E6F73746963730044656275676761626C6541747472696275746500446562756767696E674D6F6465730053797374656D2E52756E74696D652E436F6D70696C6572536572766963657300436F6D70696C6174696F6E52656C61786174696F6E734174747269627574650052756E74696D65436F6D7061746962696C6974794174747269627574650053797374656D2E44617461004D6963726F736F66742E53716C5365727665722E5365727665720053716C50726F6365647572654174747269627574650053716C436F6E746578740053716C50697065006765745F5069706500537472696E67006765745F4C656E67746800496E74333200546F537472696E670053656E640000032000000000004EEF9C17A7B837438681FDDA362695DF0008B77A5C561934E089040001010E03200001042001010E042001010205200101113D042001010804010000000400001251032000080320000E030701081401000F74727945786365707453514C434C5200000501000000000E0100094D6963726F736F667400002001001B436F7079726967687420C2A9204D6963726F736F6674203230303900002901002439396364316462642D323265342D343632622D393363392D66356639366564653331303200000C010007312E302E302E3000000801000200000000000801000800000000001E01000100540216577261704E6F6E457863657074696F6E5468726F777301000000000000001E4DB94A0000000002000000600000001427000014090000525344533E76D4B9A768514DB4FF25422CD3EFAD02000000653A5C6C69786F5C74727945786365707453514C434C525C74727945786365707453514C434C525C6F626A5C52656C656173655C74727945786365707453514C434C522E706462009C2700000000000000000000BE270000002000000000000000000000000000000000000000000000B02700000000000000000000000000000000000000005F436F72446C6C4D61696E006D73636F7265652E646C6C0000000000FF2500204000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100100000001800008000000000000000000000000000000100010000003000008000000000000000000000000000000100000000004800000058400000280300000000000000000000280334000000560053005F00560045005200530049004F004E005F0049004E0046004F0000000000BD04EFFE00000100000001000000000000000100000000003F000000000000000400000002000000000000000000000000000000440000000100560061007200460069006C00650049006E0066006F00000000002400040000005400720061006E0073006C006100740069006F006E00000000000000B00488020000010053007400720069006E006700460069006C00650049006E0066006F00000064020000010030003000300030003000340062003000000034000A00010043006F006D00700061006E0079004E0061006D006500000000004D006900630072006F0073006F00660074000000480010000100460069006C0065004400650073006300720069007000740069006F006E0000000000740072007900450078006300650070007400530051004C0043004C0052000000300008000100460069006C006500560065007200730069006F006E000000000031002E0030002E0030002E003000000048001400010049006E007400650072006E0061006C004E0061006D0065000000740072007900450078006300650070007400530051004C0043004C0052002E0064006C006C0000005C001B0001004C006500670061006C0043006F007000790072006900670068007400000043006F0070007900720069006700680074002000A90020004D006900630072006F0073006F006600740020003200300030003900000000005000140001004F0072006900670069006E0061006C00460069006C0065006E0061006D0065000000740072007900450078006300650070007400530051004C0043004C0052002E0064006C006C000000400010000100500072006F0064007500630074004E0061006D00650000000000740072007900450078006300650070007400530051004C0043004C0052000000340008000100500072006F006400750063007400560065007200730069006F006E00000031002E0030002E0030002E003000000038000800010041007300730065006D0062006C0079002000560065007200730069006F006E00000031002E0030002E0030002E00300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000C000000D03700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
WITH PERMISSION_SET = SAFE

GO</pre>
<hr/>
<b>Next time</b> i&#8217;ll expand on this subject with more complex (and useful) examples &#8211; triggers in SQLCLR. I&#8217;ll write the article when i have some free time or when my PayPal donations reach one million dollars &#8211; whichever one comes first. (donate below :) )<br />
[RAW]</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYA114lW/Z6tf6DKAHlKhmQRkfG1xhHI+yzxge1EOkwNFU6ZWwFpkVkOGhViGeQwY6ZqMYnJa/AF0FRtamF3pWz1YtuFixVHzW9qkNNmQE9bpT1A1S11zkYzwgSJ4BF53PzDBejVsJ9I0ocUoTtbg7fTWAi07XSM/BY2hYQGEIzbzTELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIH3B4y8Mh8dKAgaC6XMcmdCoQue0BIpRy1ucE9bgh8JlBybmk/303oaZsJmF0gO/FsW3DcccuJvLdDQshvaG/C29HXYGtnOzT+1F6ndi0OVAp8n81CEehk8/uP7/1xGprHYOQuMqlSOnmJAK7f9WUA/OPV1MEb9vwCZ/87rv7PinR/B0vt+mqCMISHsgrU0w5/g1Z+zCS8Irb2wyTPVYtiTbQOOHX5oYRAWaGoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDkwOTIyMjMwMTI1WjAjBgkqhkiG9w0BCQQxFgQUYMKbE7g96OSxQP6PT8G7xNFdLy4wDQYJKoZIhvcNAQEBBQAEgYBmXsbm2u306L/urG8JyFwohL+QvEj57XH7w0MSaUl183fkhJJ6gwCzN5g+QZj0Mwr+cNSnRw7vcU012r4+QRoejziy0uK+rViUr7FO2wh2ZlgJNbe34isMQUja3c+nLS1gbtz60m6HKAa0Ru6DUtV2dF5tUCgCmzIUmwZ8PoQ7ug==-----END PKCS7-----<br />
"><br />
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/pt_BR/i/scr/pixel.gif" width="1" height="1"><br />
</form>
<p>[/RAW]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tryexcept.com/articles/2009/09/22/using-net-assemblies-inside-sql-server-quick-start-guide.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a Zend Modular CMS Tutorial</title>
		<link>http://www.tryexcept.com/articles/2009/09/20/building-a-zend-modular-cms-tutorial.html</link>
		<comments>http://www.tryexcept.com/articles/2009/09/20/building-a-zend-modular-cms-tutorial.html#comments</comments>
		<pubDate>Sun, 20 Sep 2009 00:41:11 +0000</pubDate>
		<dc:creator>Manuel Gomes</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zendframework]]></category>

		<guid isPermaLink="false">http://www.tryexcept.com/?p=52</guid>
		<description><![CDATA[A series of blog posts have been created covering the development of an extendable, modular CMS system, currently up to part 7 with ACL, Database, Navigation, Config, Bootstrapping, and Translate, already built in. This is a good way to start &#8230; <a href="http://www.tryexcept.com/articles/2009/09/20/building-a-zend-modular-cms-tutorial.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A series of blog posts have been created covering the development of an extendable, modular CMS system, currently up to part 7 with ACL, Database, Navigation, Config, Bootstrapping, and Translate, already built in. This is a good way to start using/understanding the Zend Framework.<br />
<span id="more-52"></span>Check out the first part in <a href="http://steven.macintyre.name/building-a-zend-modular-cms-system-part-1/">here</a> (links to the other 7 parts are inside)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tryexcept.com/articles/2009/09/20/building-a-zend-modular-cms-tutorial.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Security Developer Starter Kit</title>
		<link>http://www.tryexcept.com/articles/2009/09/20/security-developer-starter-kit.html</link>
		<comments>http://www.tryexcept.com/articles/2009/09/20/security-developer-starter-kit.html#comments</comments>
		<pubDate>Sun, 20 Sep 2009 00:30:33 +0000</pubDate>
		<dc:creator>Manuel Gomes</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://www.tryexcept.com/?p=49</guid>
		<description><![CDATA[The Microsoft SDL &#8211; Developer Starter Kit offers 14 modules of content, labs, and training to help you establish a standardized approach to rolling out security development policies and industry best practices into your organization. Download it here]]></description>
			<content:encoded><![CDATA[<p>The Microsoft SDL &#8211; Developer Starter Kit offers 14 modules of content, labs, and training to help you establish a standardized approach to rolling out security development policies and industry best practices into your organization.<br />
Download it <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0FCBA3C7-BC30-47B0-A2F8-2E702720998A&amp;displaylang=en">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tryexcept.com/articles/2009/09/20/security-developer-starter-kit.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check if a service is installed with ServiceController using LINQ</title>
		<link>http://www.tryexcept.com/articles/2008/07/27/check-if-a-service-is-installed-with-servicecontroller-using-linq.html</link>
		<comments>http://www.tryexcept.com/articles/2008/07/27/check-if-a-service-is-installed-with-servicecontroller-using-linq.html#comments</comments>
		<pubDate>Sun, 27 Jul 2008 18:40:12 +0000</pubDate>
		<dc:creator>Manuel Gomes</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[.net 3.5]]></category>
		<category><![CDATA[linq]]></category>

		<guid isPermaLink="false">http://www.tryexcept.com/articles/2008/07/27/check-if-a-service-is-installed-with-servicecontroller-using-linq.html</guid>
		<description><![CDATA[If you want to check if a specific NT Service is installed you will need to use the ServiceController class (from System.ServiceProcess). The first problem you will encounter is that the ServiceController has no static method, that would return a &#8230; <a href="http://www.tryexcept.com/articles/2008/07/27/check-if-a-service-is-installed-with-servicecontroller-using-linq.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you want to check if a specific NT Service is installed you will need to use the <a title="ServiceController class @msdn" href="http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontroller.aspx" target="_blank">ServiceController </a>class (from System.ServiceProcess). The first problem you will encounter is that the ServiceController has no static method, that would return a Boolean, specifying if the service is installed or not (e.g. ServiceController.IsInstalled(‘MyService’);) – so, to solve this you need to fetch the list of all installed services, using the static method ServiceController.GetServices(), which returns an array of ServiceController[], and then iterate thru all the elements to see if “MyService” is on that list. Now, this is not a problem, is just too much code for such a simple task. If you use LINQ things are simple: basically you will iterate thru the list, but in a much focused and simple way.</p>
<p><span id="more-37"></span></p>
<pre name="code" class="c-sharp">var temp = from sc in ServiceController.GetServices()
where sc.ServiceName == "MyService"
select sc;
// temp.Count() is 0 if the service is not installed
Boolean isInstalled = temp.Count() != 0;</pre>
<p>If you want to manipulate the service (if installed, obviously), you don’t need to instantiate a new ServiceController(servicename), as the LINQ query returned a ServiceController ready to go. Add the following lines to the example:</p>
<pre name="code"  class="c-sharp">if (isInstalled)
{
    ServiceController myController =
        // the LINQ query only returns one element - we can use First&lt;&gt;()
        temp.First();
    Console.WriteLine("Service is installed and " +
        myController.Status.ToString());
    if (myController.Status == ServiceControllerStatus.Stopped)
    {
        Console.WriteLine("Starting the service...");
        myController.Start();
    }
}
else
{
    Console.WriteLine("The service is not installed");
}</pre>
<p>[ad#468x60]</p>
<p>You can change this LINQ query to search for any of the ServiceController’s properties. The following example returns the list of all started services:</p>
<pre name="code"  class="c-sharp">// Get all installed services
var startedServices = from sc in ServiceController.GetServices()
    where sc.Status == ServiceControllerStatus.Running
    select sc;
Console.WriteLine("And the installed services are:");
// now lets iterate thru all the started services
foreach (ServiceController startedService
    in startedServices.ToList())
{
    Console.WriteLine("  " + startedService.ServiceName +
        ": " + startedService.DisplayName);
}</pre>
<p>The major (and only) drawback when using LINQ is that it&#8217;s only available in .net framework 3.5.</p>
<p>For more on LINQ see also: <a href="http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx" target="_blank">ScottGu&#8217;s introduction to LINQ</a> (focused on SQL LINQ), Introducing <a href="/books/view/0735623910/Introducing+Microsoft++LINQ.html">Microsoft LINQ</a>, <a href="/books/view/0596519249/LINQ+Pocket+Reference+(Pocket+Reference+(O'Reilly)).html">LINQ Pocket Reference</a>, <a href="/books/view/1590597893/Pro+LINQ%3A+Language+Integrated+Query+in+C%23+2008.html">Language Integrated Query in C#2008</a>, <a href="/books/view/0735624003/Programming+Microsoft®+LINQ+(PRO-Developer).html">Programming Microsoft LINQ </a>or the <a href="http://en.wikipedia.org/wiki/Linq" target="_blank">LINQ page in Wikipedia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tryexcept.com/articles/2008/07/27/check-if-a-service-is-installed-with-servicecontroller-using-linq.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reading image metadata with .net 3.0</title>
		<link>http://www.tryexcept.com/articles/2007/10/11/reading-image-metadata-with-net.html</link>
		<comments>http://www.tryexcept.com/articles/2007/10/11/reading-image-metadata-with-net.html#comments</comments>
		<pubDate>Thu, 11 Oct 2007 20:27:42 +0000</pubDate>
		<dc:creator>Manuel Gomes</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[.net 3.0]]></category>
		<category><![CDATA[vista]]></category>
		<category><![CDATA[wpf]]></category>

		<guid isPermaLink="false">http://www.tryexcept.com/articles/2007/09/18/reading-image-metadata-with-net.html</guid>
		<description><![CDATA[When you take a picture today your digital camera, something is stored in the JPG file other than the image itself: digital cameras store information such as camera model, date taken, metering mode, focal length shutter speed and in some &#8230; <a href="http://www.tryexcept.com/articles/2007/10/11/reading-image-metadata-with-net.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When you take a picture today your digital camera, something is stored in the JPG file other than the image itself: digital cameras store information such as camera model, date taken, metering mode, focal length shutter speed and in some cases a small thumbnail image; some news agencies, such as <a href="http://www.reuters.com" target="_blank">Reuters</a> (see chopper.jpg image in this example) also add comments and other information. In this article we&#8217;ll show how to read this information using the new classes in WPF&#8217;s System.Windows.Media namespace.</p>
<p>  <span id="more-15"></span> Metadata that is associated with an image is data that describes the image but that is not necessary for display of the image.
</p>
<p>Some image formats (such as JPEG, PNG, TIFF, PSD and others) support one or more metadata formats, and the way this information can be read differs from format to format. WPF&#8217;s new classes allows you to read this information without having to worry about the underlying format, always using the same piece code. Windows Presentation Foundation supports the following metadata schemas: Exchangeable image file (<a href="http://en.wikipedia.org/wiki/EXIF" target="_blank">Exif</a>), International Press Telecommunications Council (<a href="http://en.wikipedia.org/wiki/IPTC" target="_blank">IPTC</a>), Extensible Metadata Platform (<a href="http://en.wikipedia.org/wiki/Extensible_Metadata_Platform" target="_blank">XMP</a>), tEXt (PNG Textual Data) and image file directory (IFD).</p>
<p>To read metadata you need to insert first a reference to the PresentationCore assembly to your project: this assembly contains the <a href="http://msdn2.microsoft.com/en-us/library/system.windows.media.aspx" target="_blank">System.Windows.Media</a> namespace that we will use. Now, lets walk thru the example code, step by step. First you need to open the image, using the <a href="http://msdn2.microsoft.com/en-us/library/system.windows.media.imaging.bitmapframe_members.aspx" target="_blank">BitmapFrame</a>.<a href="http://msdn2.microsoft.com/en-us/library/system.windows.media.imaging.bitmapframe.create.aspx" target="_blank">Create </a>constructor:</p>
<pre name="code" class="c-sharp">BitmapSource img = BitmapFrame.Create(new Uri(filename));</pre>
<p>
  <br />The BitmapSource img instance contains a property that has an instance of BitmapMetadata called &quot;Metadata&quot;. This is where all the metadata is contained:</p>
<p></p>
<pre name="code" class="c-sharp">BitmapMetadata meta = (BitmapMetadata)img.Metadata;
Console.WriteLine(&quot; metadata\n Type: {0}&quot;,meta.GetType());
Console.WriteLine(&quot; Title: {0}&quot;, meta.Title);
Console.WriteLine(&quot; Subject: {0}&quot;, meta.Subject);
Console.WriteLine(&quot; Comment: {0}&quot;, meta.Comment);
Console.WriteLine(&quot; Date taken: {0}&quot;, meta.DateTaken);
Console.WriteLine(&quot; Camera: {0} {1}&quot;,meta.CameraManufacturer,meta.CameraModel);
Console.WriteLine(&quot; Copyright: {0}&quot;, meta.Copyright);</pre>
<p>
  <br />Image dimensions are not a part of metadata, these are stored directly in the &quot;img&quot; instance:</p>
<p></p>
<pre name="code" class="c-sharp">double mpixel = (img.PixelHeight * img.PixelWidth)/(double)1000000;
Console.WriteLine(&quot; Pixelsize {0}x{1} ({2} megapixels)&quot;, img.PixelWidth, img.PixelHeight,mpixel);
Console.WriteLine(&quot; DPI {0}x{1}&quot;, img.DpiX, img.DpiY);</pre>
<p>Its as simple as this, just instantiate the <a href="http://msdn2.microsoft.com/en-us/library/system.windows.media.imaging.bitmapsource.aspx" target="_blank">BitmapSource</a> and read the <a href="http://msdn2.microsoft.com/en-us/library/system.windows.media.imaging.bitmapsource.metadata.aspx" target="_blank">Metadata</a> property.</p>
<p>Now, lets put it all together: Create a new Console Application project in Visual Studio. Add a reference to the PresentationCore assembly and write/paste the following code inside the &quot;Program&quot; class, replacing the default &quot;Main&quot; function:</p>
<pre name="code" class="c-sharp">static void readMetadata(string filename)
{
    BitmapSource img = BitmapFrame.Create(new Uri(filename)); 

    /* Image data */
    double mpixel = (img.PixelHeight * img.PixelWidth)/(double)1000000;
    Console.WriteLine(&quot;  Pixelsize {0}x{1} ({2} megapixels)&quot;, img.PixelWidth, img.PixelHeight,mpixel);
    Console.WriteLine(&quot;  DPI {0}x{1}&quot;, img.DpiX, img.DpiY); 

    /* Image metadata */
    BitmapMetadata meta = (BitmapMetadata)img.Metadata;
    Console.WriteLine(&quot;  metadata\n    Type: {0}&quot;,meta.GetType());
    Console.WriteLine(&quot;  Title: {0}&quot;, meta.Title);
    Console.WriteLine(&quot;  Subject: {0}&quot;, meta.Subject);
    Console.WriteLine(&quot;  Comment: {0}&quot;, meta.Comment);
    Console.WriteLine(&quot;  Date taken: {0}&quot;, meta.DateTaken);
    Console.WriteLine(&quot;  Camera: {0} {1}&quot;,meta.CameraManufacturer,meta.CameraModel);
    Console.WriteLine(&quot;  Copyright: {0}&quot;, meta.Copyright); 

    StringBuilder authors = new StringBuilder();
    if (meta.Author != null)
    {
        foreach (string author in meta.Author)
        {
            authors.Append(author + &quot;; &quot;);
        }
        Console.WriteLine(&quot;  Author(s): {0}&quot;, authors.ToString());
    } 

    Console.WriteLine(&quot;  Rating: {0}&quot;, meta.Rating); 

    StringBuilder keyWords = new StringBuilder();
    if (meta.Keywords!=null) {
        foreach (string keyword in meta.Keywords) {
            keyWords.Append(keyword+&quot;; &quot;);
        }
        Console.WriteLine(&quot;  Keywords: {0}&quot;, keyWords.ToString());
    }
    Console.WriteLine(&quot;&quot;);
} 

static void Main(string[] args)
{
    Console.WriteLine(&quot;Tryexcept.com Image metadata example&quot;);
    /* Get info from all files in c:\pictures */
    DirectoryInfo di = new DirectoryInfo(@&quot;c:\pictures&quot;);
    /* Only JPEG files */
    FileInfo[] files = di.GetFiles(&quot;*.jpg&quot;);
    foreach (FileInfo fi in files)
    {
        Console.WriteLine(fi.Name);
        Program.readMetadata(fi.FullName);
    }
    Console.ReadLine();
}
}</pre>
<p>Copy a couple of JPG images to the c:\pictures folder and run the project. The output should be something like this:</p>
<p><a title="Image Metadata example screenshot" href="http://www.tryexcept.com/wp-content/uploads/2007/10/new-2.jpg"><img style="width: 442px; height: 531px" height="532" alt="Image Metadata example screenshot" src="http://www.tryexcept.com/wp-content/uploads/2007/10/new-2.jpg" width="442" /></a></p>
<p>The Windows Vista Explorer uses these classes to access image metadata as well. It also uses the InPlaceBitmapMetadataWriter to add or edit tags and to edit the image rating. InPlaceBitmapMetadataWriter allows you to edit or create metadata without changing the image contents in any way, avoiding the quality-loss effect that happens when you re-save a JPEG image.<br />
  <br /><a title="Vista Explorer showing image metadata" href="http://www.tryexcept.com/wp-content/uploads/2007/10/vista-explorer-metadata.jpg"><img style="width: 466px; height: 264px" height="264" alt="Vista Explorer showing image metadata" src="http://www.tryexcept.com/wp-content/uploads/2007/10/vista-explorer-metadata.jpg" width="466" /></a></p>
<p>In the screenshot you can see the DSCF1852.JPG image selected along with some of the metadata below: compare it with the previous screenshot to see the same information as output from our example.</p>
<p>Downloads: <a href="http://www.tryexcept.com/wp-content/uploads/2007/10/example-pictures.zip">example JPEG images from this example</a>, <a title="Imagemetadata example source code" href="http://www.tryexcept.com/wp-content/uploads/2007/10/imagemetadata_sourcecode.zip">example source code</a> or <a title="compiled imagemetadata.exe" href="http://www.tryexcept.com/wp-content/uploads/2007/10/imagemetadata_compiled_exe.zip">compiled imagemetadata.exe</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tryexcept.com/articles/2007/10/11/reading-image-metadata-with-net.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

