<?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>Miha Valencic</title>
	<atom:link href="http://www.mihavalencic.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mihavalencic.com</link>
	<description>Solving IT Challenges</description>
	<lastBuildDate>Wed, 24 Oct 2012 21:20:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>BleedingEdge 2012 &#8211; recap</title>
		<link>http://www.mihavalencic.com/2012/10/24/bleedingedge-2012-recap/</link>
		<comments>http://www.mihavalencic.com/2012/10/24/bleedingedge-2012-recap/#comments</comments>
		<pubDate>Wed, 24 Oct 2012 21:05:43 +0000</pubDate>
		<dc:creator>miha</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mihavalencic.com/?p=355</guid>
		<description><![CDATA[Wow! Totalno presenečen sem bil nad obiskom predavanja, ki je vsaj po mojem občutku teklo gladko. Veliko zanimanja je požel projekt Weinre, mislim pa da je bilo poslušalstvo navdušeno tudi nad PhoneGap/Cordova ogrodjem. Se priporočam za kakšen feedback in pa seveda tudi za demonstracijo vaših produktov, ki bodo temeljili na tej tehnologiji. Ob začetku predavanja [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone  wp-image-356" title="20121024_104525_800" src="http://www.mihavalencic.com/wp-content/uploads/2012/10/20121024_104525_800.jpg" alt="" width="480" height="360" /></p>
<p>Wow! Totalno presenečen sem bil nad obiskom predavanja, ki je vsaj po mojem občutku teklo gladko. Veliko zanimanja je požel projekt <a href="http://people.apache.org/~pmuellr/weinre/" target="_blank">Weinre</a>, mislim pa da je bilo poslušalstvo navdušeno tudi nad PhoneGap/Cordova ogrodjem. Se priporočam za kakšen feedback in pa seveda tudi za demonstracijo vaših produktov, ki bodo temeljili na tej tehnologiji. Ob začetku predavanja sem imel kar nekaj težav: najprej Win7 niso hoteli dati iz sebe na projektor več kot 640&#215;480. Očitno so ga nekako napačno prepoznali. Tako da sem uporabil sposojen notebook, na katerem sem odprl Remote Desktop na moj notebook. Druga prepreka pa je bila konfiguracija omrežja, ki je preprečevala da bi iz mobilnega telefona lahko prišel do računalnika in demonstriral Weinre v praksi in v aplikaciji. No, pa drugič, ko bo official Weinre build deloval tudi na Windows Phone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihavalencic.com/2012/10/24/bleedingedge-2012-recap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bleeding Edge 2012 &#8211; Razvoj &#8220;native&#8221; mobilnih aplikacij za različne platforme</title>
		<link>http://www.mihavalencic.com/2012/10/24/bleeding-edge-2012-razvoj-native-mobilnih-aplikacij-za-razlicne-platforme/</link>
		<comments>http://www.mihavalencic.com/2012/10/24/bleeding-edge-2012-razvoj-native-mobilnih-aplikacij-za-razlicne-platforme/#comments</comments>
		<pubDate>Wed, 24 Oct 2012 09:45:17 +0000</pubDate>
		<dc:creator>miha</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mihavalencic.com/?p=345</guid>
		<description><![CDATA[V priponki je na voljo predavanje kot tudi izvorna koda uporabljena in demonstrirana na predavanju. Uporabljeno je ogrodje Apache Cordova (verzija 2.2.0rc1), prikazuje pa urnik konference BleedingEdge 2012.]]></description>
			<content:encoded><![CDATA[<p>V <a href="http://www.mihavalencic.com/wp-content/uploads/2012/10/BE2012-cross-platform-mobile.zip">priponki</a> je na voljo predavanje kot tudi izvorna koda uporabljena in demonstrirana na <a href="http://www.bleedingedge.si/Conference">predavanju</a>. Uporabljeno je ogrodje <a title="Apache Cordova" href="http://cordova.io" target="_blank">Apache Cordova</a> (verzija 2.2.0rc1), prikazuje pa urnik konference BleedingEdge 2012.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihavalencic.com/2012/10/24/bleeding-edge-2012-razvoj-native-mobilnih-aplikacij-za-razlicne-platforme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ntk2012 &#8211; prezentacija in demo</title>
		<link>http://www.mihavalencic.com/2012/05/23/ntk2012-prezentacija-in-demo/</link>
		<comments>http://www.mihavalencic.com/2012/05/23/ntk2012-prezentacija-in-demo/#comments</comments>
		<pubDate>Wed, 23 May 2012 09:46:35 +0000</pubDate>
		<dc:creator>miha</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mihavalencic.com/?p=342</guid>
		<description><![CDATA[V prilogi je tako prezentacija kot demo koda, ki je bila uporabljena na predavanju. Enjoy!]]></description>
			<content:encoded><![CDATA[<p>V <a href='http://www.mihavalencic.com/wp-content/uploads/2012/05/WebApiNtk2012.zip'>prilogi</a> je tako prezentacija kot demo koda, ki je bila uporabljena na predavanju. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihavalencic.com/2012/05/23/ntk2012-prezentacija-in-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android and stack traces</title>
		<link>http://www.mihavalencic.com/2011/10/18/android-and-stack-traces/</link>
		<comments>http://www.mihavalencic.com/2011/10/18/android-and-stack-traces/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 10:27:33 +0000</pubDate>
		<dc:creator>miha</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mihavalencic.com/?p=329</guid>
		<description><![CDATA[While doing native development for the Android platform, native segmentation faults happen. And they are not very descriptive to the usual developer (which includes me, of course). You would see something along those lines: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Build fingerprint: 'samsung/GT-I9100/GT-I9100:2.3.3/GINGERBREAD/XWKE2:user/release-keys' pid: 3833, [...]]]></description>
			<content:encoded><![CDATA[<p>While doing native development for the <a href="http://www.android.com/">Android</a> platform, native segmentation faults happen. And they are not very descriptive to the usual developer (which includes me, of course). You would see something along those lines:<span id="more-329"></span><br />
<code><br />
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***<br />
Build fingerprint: 'samsung/GT-I9100/GT-I9100:2.3.3/GINGERBREAD/XWKE2:user/release-keys'<br />
pid: 3833, tid: 4464  >>> your.project.name <<<<br />
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad<br />
 r0 00000027  r1 deadbaad  r2 a0000000  r3 00000000<br />
 r4 00000001  r5 00000000  r6 00000000  r7 00000004<br />
 r8 00000001  r9 47e279dc  10 47e279e0  fp 47e270b4<br />
 ip afd46688  sp 47e27048  lr afd19471  pc afd15f40  cpsr 60000030<br />
 d0  0000009643160000  d1  3ff0000043160000<br />
 d2  0000000000000000  d3  0000000000000000<br />
 d4  bf80000000000000  d5  0000000000000000<br />
 d6  3f80000000000000  d7  4080000000000000<br />
 d8  4100000044228000  d9  c42cc000429c0000<br />
 d10 3fd3441341600000  d11 bfe3441350ad386e<br />
 d12 3ddb7cdfd9d7bdbb  d13 0000000000000000<br />
 d14 0000000000000000  d15 0000000000000000<br />
 d16 0000000700000037  d17 3ff0000000000000<br />
 d18 3ff0000000000000  d19 0000000000000000<br />
 d20 0000000000000000  d21 0000000000000000<br />
 d22 3ff0000000000000  d23 0000000000000000<br />
 d24 3ff0000000000000  d25 0000000000000000<br />
 d26 0000000000000000  d27 0000000000000000<br />
 d28 bffe0d01b7ee0434  d29 3ff0000000000000<br />
 d30 0000000000000000  d31 3ff0000000000000<br />
 scr 60000013<br />
         #00  pc 00015f40  /system/lib/libc.so<br />
         #01  pc 000140a4  /system/lib/libc.so<br />
         #02  pc 0001475a  /system/lib/libc.so<br />
</code><br />
Now this is not very helpful, BUT, you can use <a href="http://stackoverflow.com/questions/3696978/where-is-the-stack-tool-for-android-dev-to-help-debug-native-c-code">the stack tool</a> (but in my case, stack tool breaks on one too many variables (I have a custom build, with different library paths, etc)) or you can manually translate the location of PC with a tool called addr2line (in my case arm-linux-androideabi-addr2line - use something like
<pre>find . | grep addr2line</pre>
<p> in your Android NDK directory). You can find the function name by setting a couple of parameters to addr2line. In the output<br />
<code><br />
#00  pc 00015f40  /system/lib/libc.so<br />
</code><br />
you see the address (00015f40) and the library name (/system/lib/libc.so). You can use addr2line tool to show the function name:<br />
<code><br />
./addr2line -f -e /path/to/libc.so 0x00015f40<br />
</code><br />
and the output will be<br />
<code><br />
__sfvwrite<br />
</code><br />
Also, a helpful article on <a href="http://bootloader.wikidot.com/linux:android:crashlog">analyzing Android seg faults</a>.</p>
<p>Another useful tool for analyzing stack traces is also <a href="http://code.google.com/p/android-ndk-stacktrace-analyzer/">android ndk stacktrace analyzer</a>. Additional thing to note is, that if you have addresses in the upper range (0x8xxxxxxx), you can <a href="http://groups.google.com/group/android-ndk/browse_thread/thread/4c0cc8bd9891ff29">subtract 0x81800000 from that address</a> and use addr2line tool for that.</p>
<p>Hopefully, this helps someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihavalencic.com/2011/10/18/android-and-stack-traces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>O negibnem dojemanju</title>
		<link>http://www.mihavalencic.com/2011/07/28/o-negibnem-dojemanju/</link>
		<comments>http://www.mihavalencic.com/2011/07/28/o-negibnem-dojemanju/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 12:24:39 +0000</pubDate>
		<dc:creator>miha</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.mihavalencic.com/?p=323</guid>
		<description><![CDATA[Pod roke mi je prišel tekst, ki se mi zdi vreden objave v širšem kontekstu. Gre za Takuanovo pismo Yagiu Tajima-no-Kami. Morda gre v tekstu za pomoto in gre dejansko za pisma Yagyū Munenori, kar pa zares ni toliko pomembno kot dejanska vsebina. Budistični nauk razlikuje dvainpetdeset stopenj duhovnega razvoja. Eno izmed stopenj imenuje zastoj, [...]]]></description>
			<content:encoded><![CDATA[<p>Pod roke mi je prišel tekst, ki se mi zdi vreden objave v širšem kontekstu. Gre za <a href="http://www.zenstoriesofthesamurai.com/Characters/TakuanSoho.htm">Takuanovo</a> pismo Yagiu Tajima-no-Kami. Morda gre v tekstu za pomoto in gre dejansko za pisma <a href="http://en.wikipedia.org/wiki/Yagy%C5%AB_Munenori">Yagyū Munenori</a>, kar pa zares ni toliko pomembno kot dejanska vsebina.</p>
<blockquote><p>Budistični nauk razlikuje dvainpetdeset stopenj duhovnega razvoja. Eno izmed stopenj imenuje <b>zastoj</b>, ko se človek prilepi na eno samo mesto ne more več naprej. S tvojim mečevanjem je nekaj podobnega: če nasprotnik udari po tebi in so vsi čuti zbrani na njegovem meču, tedaj si pod njegovim vplivom in nisi več gospodar lastnih gibov. Temu pravimo zastoj, ker obstaneš pripeljen na eno samo mesto.</p></blockquote>
<p>Celoten tekst je <a href="/wp-content/uploads/2011/07/O-negibnem-dojemanju.pdf">na voljo v PDF zapisu</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihavalencic.com/2011/07/28/o-negibnem-dojemanju/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Oh really? Password too long?</title>
		<link>http://www.mihavalencic.com/2011/02/23/oh-really-password-too-long/</link>
		<comments>http://www.mihavalencic.com/2011/02/23/oh-really-password-too-long/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 07:28:48 +0000</pubDate>
		<dc:creator>miha</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.mihavalencic.com/?p=306</guid>
		<description><![CDATA[We are in 2011 after all, so seeing an error message that a password is too long is&#8230; well embarasing. So, given that passwords shouldn&#8217;t or should I say must not be saved in a way that enables anyone (even administrators) to retrieve the plaintext version of a password, we&#8217;re talking about some sort of [...]]]></description>
			<content:encoded><![CDATA[<p>We are in 2011 after all, so seeing an error message that a password is too long is&#8230; well embarasing.<br />
<img class="alignnone size-full wp-image-307" title="linkedin-password-too-long" src="http://www.mihavalencic.com/wp-content/uploads/2011/02/linkedin-password-too-long.png" alt="" width="526" height="383" /></p>
<p>So, given that passwords <b>shouldn&#8217;t</b> or should I say <b>must not</b> be saved in a way that enables anyone (even administrators) to retrieve the plaintext version of a password, we&#8217;re talking about some sort of hashing. Whether hashing algorithm it is MD5 (avoid) os SHA1 (and in order to avoid precomputed hashes of passwords (known also as rainbow tables) you should use <a href="http://www.google.com/search?q=password+salting+techniques">salting techniques</a> with hashing algorithms), the length of a calculated hash does not depend on the length of the plain text password.</p>
<p>So, why is the length of the password limited to 16 characters? Beats me.</p>
<p>Of course, I recommend developers to use <a href="http://www.google.com/search?q=bcrypt">bcrypt</a> instead of SHA or MD5. Bcrypt is very slow (compared to SHA or MD5), which is a good property to have for checking passwords &#8212; you don&#8217;t want to have a super-fast hashing/crypting algorithm thus effectively preventing brute force attacks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihavalencic.com/2011/02/23/oh-really-password-too-long/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Airport Extreme and PPTP</title>
		<link>http://www.mihavalencic.com/2011/01/31/airport-extreme-and-pptp/</link>
		<comments>http://www.mihavalencic.com/2011/01/31/airport-extreme-and-pptp/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 20:38:01 +0000</pubDate>
		<dc:creator>miha</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Airport]]></category>
		<category><![CDATA[Connectivity]]></category>

		<guid isPermaLink="false">http://www.mihavalencic.com/?p=295</guid>
		<description><![CDATA[I was having issues with VPN connection (PPTP to be exact) to my customer. I was connecting with Mac OS X and Windows (tried Windows 7 and Windows XP sp3) and could not make it work. All computers are behind Airport Extreme. When I connected to internet directly (not through Airport), everything worked fine. While [...]]]></description>
			<content:encoded><![CDATA[<p>I was having issues with VPN connection (PPTP to be exact) to my customer. I was connecting with Mac OS X and Windows (tried Windows 7 and Windows XP sp3) and could not make it work. All computers are behind Airport Extreme. When I connected to internet directly (not through Airport), everything worked fine. While <a href="http://www.google.com/search?q=airport+pptp">googling</a> around, I found many posts referring to a <a href="http://discussions.apple.com/thread.jspa?messageID=4046689">lengthy post</a> describing to enable the default host on Airport base station. I had that configured already, so I was looking for solution elsewhere, since I just could not get the clients to connect. The error I was getting was &#8220;<code>PPTP received unexpected message type = 6699</code>&#8220;. And that error was printed in the log file after several <code>sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4e583e74>
<pcomp> <accomp>]</code> messages.<br />
<img src="http://www.mihavalencic.com/wp-content/uploads/2011/01/Airport-extreme-config.png" alt="Airport-extreme-config" title="Airport-extreme-config" width="547" height="222" class="alignnone size-full wp-image-298" /><br />
Since &#8220;Default host&#8221; setting is sort of dangerous (if don&#8217;t use a firewall), I decided to turn it off and to check with tcpdump what goes on on the wire (maybe the /var/log/ppp.log isn&#8217;t telling me everything).<br />
To my surprise, PPTP connection was established successfully, so there is a hint for you: if you have problems establishing PPTP connection, try <strong>disabling</strong> the &#8220;Enable default host at&#8221; in your Airport configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihavalencic.com/2011/01/31/airport-extreme-and-pptp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Netduino &#8211; the beginning</title>
		<link>http://www.mihavalencic.com/2011/01/20/netduino-beginning/</link>
		<comments>http://www.mihavalencic.com/2011/01/20/netduino-beginning/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 00:02:18 +0000</pubDate>
		<dc:creator>miha</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[Netduino]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[fritzing]]></category>
		<category><![CDATA[LED]]></category>

		<guid isPermaLink="false">http://www.mihavalencic.com/?p=279</guid>
		<description><![CDATA[I&#8217;ve received Netduino Plus yesterday. After playing with the on-board LED and button switch, I tried something else today. Since I don&#8217;t have a background in electronics, I googled a bit, asked around and connected LED, a couple of resistors and a transistor (BC108C) to control the external LED with the digital output of a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mihavalencic.com/wp-content/uploads/2011/01/netduino.jpg"><img src="http://www.mihavalencic.com/wp-content/uploads/2011/01/netduino.jpg" alt="netduino" title="netduino" width="359" height="270" class="alignnone size-full wp-image-286" /></a><br />
I&#8217;ve received <a href="http://www.netduino.com/netduinoplus/specs.htm">Netduino Plus</a> yesterday. After playing with the on-board LED and button switch, I tried something else today. Since I don&#8217;t have a background in electronics, I googled a bit, asked around and connected LED, a couple of resistors and a transistor (BC108C) to control the external LED with the digital output of a Netduino.<br />
The project goal is simple enough for a seasoned electronics guy, but for me, it is quite a challenge:</p>
<ul>
<li>Function as a <a href="http://www.eberle.de/product.aspx?id=2340">regular thermostat</a></li>
<li>Which can be controlled remotely via SMS as well:
<ul>
<li>to check current temperature on location</li>
<li>to set desired temperature on location</li>
<li>to switch power on or off for the oil boiler (heating furnace) and water pumps</li>
<li>to alert via SMS when the temperature drops below a defined threshold</li>
</ul>
</li>
</ul>
<p>The <a href="http://www.netduino.com">Netduino</a>/<a href="http://www.arduino.cc/">Arduino</a> boards are  amazing in that they offer a high level language to control them and create your stuff. You can develop &#038; debug with Visual Studio in case of Netduino boards using the familiar interface and software development skills. There are <a href="http://www.sparkfun.com/categories/103">tons of shields</a> (addons, plugins) available for those boards as well. I&#8217;m planning on integrating real time clock, digital temperature sensor and a cellular shield (GSM functionality) and a graphical LCD next. Baby steps.</p>
<h2>So, how did I wire the external LED?</h2>
<p>First, I had to learn some basics:</p>
<ol>
<li>You have to limit current for the LED, otherwise it will burn</li>
<li>You have to drop the voltage, or the LED will burn</li>
</ol>
<p>You can limit current by using resistors. I used the 5V pin on the Netduino, and LED needs only 2.5V, so I had to halve the voltage and limit current at the same time. You can do this simply by using two resistors. Smart people call this <a href="http://en.wikipedia.org/wiki/Voltage_divider">voltage divider</a>. First, I calculated the maximum current that is allowed for the LED, and that is 20mA. Given the 5V voltage and formula V = R*I, the resistor comes out to 5V / 0.02A = 250&#8486; (Ohm). Given that, I now needed to lower the voltage, which in my case is simple. The formula for voltage divider is Vout = Vin * R1 / (R1 + R2). Now that I know that R1 + R2 should be 250&#8486; it is easy to calculate that R1 = R2 = 125 Ohm. I actually used 120&#8486; resistors as I didn&#8217;t have 125&#8486; ones.<br />
So, the LED was lit, but I wanted to control it via software, so I needed a &#8220;switching&#8221; mechanism. I asked around used NPN transistor for that. I connected the LED output to collector of a transistor, and connected the emitor part of the transistor to ground. Now, we need to tell the transistor to &#8220;open up&#8221;. I figured I&#8217;ll just connect the digital output to base of transistor, but friendly guys on a Slovenian <a href="http://www.elektronik.si/phpBB2/viewtopic.php?t=24113">electronics forum suggested</a> that I use a resistor in between. So I did.<br />
The end result? A program, which turns the LED on whenever I press the button. The final schema looks something like this:<br />
<img src="http://www.mihavalencic.com/wp-content/uploads/2011/01/blinking_bb.png" alt="Blinking netduino with external LED" title="Blinking netduino with external LED" width="412" height="518" class="alignnone size-full wp-image-289" /><br />
This image was made with <a href="http://fritzing.org/">Fritzing</a> which looks like a very promising project as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihavalencic.com/2011/01/20/netduino-beginning/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bleeding Edge 2010</title>
		<link>http://www.mihavalencic.com/2010/10/01/bleeding-edge-2010/</link>
		<comments>http://www.mihavalencic.com/2010/10/01/bleeding-edge-2010/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 06:14:28 +0000</pubDate>
		<dc:creator>miha</dc:creator>
				<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.mihavalencic.com/?p=275</guid>
		<description><![CDATA[Že tretja Bleeding Edge konferenca je za nami. V prilogah najdete tako prezentacijo, ko tudi demo aplikacijo (ki zahteva VS2010 ter nameščen ASP.NET MVC 3 preview 1) ki demonstrira določene tehnike predstavljene med samim predavanjem. Vesel sem, da ste se odzvali v tako velikem številu in upam, da bo naslednjič tudi tako.]]></description>
			<content:encoded><![CDATA[<p>Že tretja <a href="http://www.bleedingedge.si">Bleeding Edge</a> konferenca je za nami. V <a href='http://www.mihavalencic.com/wp-content/uploads/2010/10/BleedingEdge2010-MVC3-DI-IOC.zip'>prilogah</a> najdete tako prezentacijo, ko tudi demo aplikacijo (ki zahteva VS2010 ter nameščen <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=cb42f741-8fb1-4f43-a5fa-812096f8d1e8&#038;displaylang=en">ASP.NET MVC 3 preview 1</a>) ki demonstrira določene tehnike predstavljene med samim predavanjem.</p>
<p>Vesel sem, da ste se odzvali v tako velikem številu in upam, da bo naslednjič tudi tako.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihavalencic.com/2010/10/01/bleeding-edge-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using PersistentDictionary for prototyping</title>
		<link>http://www.mihavalencic.com/2010/03/30/using-persistentdictionary-for-prototyping/</link>
		<comments>http://www.mihavalencic.com/2010/03/30/using-persistentdictionary-for-prototyping/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 13:01:54 +0000</pubDate>
		<dc:creator>miha</dc:creator>
				<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.mihavalencic.com/?p=265</guid>
		<description><![CDATA[Often times, one would find himself in a situation, where you need to temporarily store some data, but don&#8217;t wan&#8217;t the hassle of configuring a database, a username, etc for it. Maybe even more so, if your development box does not contain SQL Server express or similar database. You can of course use SqlCE, SQLite, [...]]]></description>
			<content:encoded><![CDATA[<p>Often times, one would find himself in a situation, where you need to temporarily store some data, but don&#8217;t wan&#8217;t the <em>hassle</em> of configuring a database, a username, etc for it. Maybe even more so, if your development box does not contain <a href="http://www.microsoft.com/express/database/">SQL Server express</a> or similar database. You can of course use <a href="http://www.microsoft.com/Sqlserver/2008/en/us/compact.aspx">SqlCE</a>, <a href="http://www.sqlite.org">SQLite</a>, <a href="http://sourceforge.net/projects/libdb-dotnet/">BerkeleyDB</a> or something else if your needs are beyond simple prototyping storage. SqlCE, SQLite and BerkeleyDB offer familiar querying interface using SQL to manipulate &amp; query data, whereas <a href="http://www.codeplex.com/ManagedEsent">PersistentDictionary</a> offers what the name suggests. A persistent (transactions included!) IDictionary&lt;k,v&gt; implementation.</p>
<p>PersistentDictionary implementation is based on <a href="http://blogs.msdn.com/windowssdk/archive/2008/10/23/esent-extensible-storage-engine-api-in-the-windows-sdk.aspx">Esent</a>, which is a not well-known embedded database included in all major windows version (XP, Vista, Windows Server, etc).  From the Microsoft Windows SDK blog:</p>
<blockquote><p>ESENT is used by the Active Directory, Windows Desktop Search, Windows Mail and several other Windows services and a slightly modified version of the code is used by Microsoft Exchange to store all its mailbox data. The ESENT API is available through the SDK and can be used on all versions of Windows from Windows Server 2000 on up</p></blockquote>
<p>There is a <a href="http://www.codeplex.com/ManagedEsent">managed wrapper for Esent</a>, part of which is also an implementation of PersistentDictionary. Out-of-the box, the PersistentDictionary implementation only stores simple structures and primitive data types, but it is very easy to modify it to support also classes, which are marked with the [Serializable] attribute. One just needs to change the ColumnConverter class. For your convenience,<a href="/wp-content/uploads/2010/03/ManagedEsentCollections.zip"> here is the compiled version of EsentCollections</a>, which enable just that. The usage is fairly simple.</p>
<pre>var store = new PersistentDictionary&lt;Guid, MyClass&gt;("test-database");
// save an instance of your class
store[Guid.NewGuid()] = new MyClass { PropertyA = "SomeValue" };

// to retrieve and display all elements, you can
foreach(var key in store.Keys) {
  var retrievedInstance = store[key];
  // now do something with this instance
  Console.WriteLine(retrievedInstance.PropertyA);
}</pre>
<p>You have to ensure, though, that your custom class is marked for serialization. You can achieve this like so:</p>
<pre>[Serializable]
public class MyClass {
  public string PropertyA { get; set; }
}</pre>
<p>You can see that it is very easy to implement <strong>simple</strong> repositories on top of that &#8212; for <strong>prototyping needs</strong>, where the entities are constantly evolving and changing.</p>
<p>Do note, however, that Esent is not limited to PersistentDictionary. You can query it in different ways, add indexes to it, have many columns, etc. The thing is used by large-scale software like Exchange, nontheless.</p>
<p>I will post a simple example of IRepository implementation shortly. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihavalencic.com/2010/03/30/using-persistentdictionary-for-prototyping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.378 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-06-19 16:33:46 -->
