<?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>students@work &#187; c</title>
	<atom:link href="http://www.stupent.at/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stupent.at</link>
	<description>Antworten auf die die Menschheit gewartet hat!  -- Heisenberg war hier ... oder auch nicht!</description>
	<lastBuildDate>Tue, 17 Aug 2010 13:51:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>NHibernate/Active Record &#8211; StaleStateException?</title>
		<link>http://www.stupent.at/2010/01/12/nhibernateactive-record-stalestateexception/</link>
		<comments>http://www.stupent.at/2010/01/12/nhibernateactive-record-stalestateexception/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 13:15:50 +0000</pubDate>
		<dc:creator>Cici</dc:creator>
				<category><![CDATA[Absurdes]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[active record]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[nhibernate]]></category>

		<guid isPermaLink="false">http://www.stupent.at/?p=240</guid>
		<description><![CDATA[Today I had to use an Ative Record implementation for C#: Castle Active Record. It worked verfy fine until i needed to save a one to many relationship. Then the underlying NHibernate yielded the following Exception:
   StaleStateException: unexpected row count -1 expected 1 . 
Googling for that Exception gave me two options: At [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.stupent.at%2F2010%2F01%2F12%2Fnhibernateactive-record-stalestateexception%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stupent.at%2F2010%2F01%2F12%2Fnhibernateactive-record-stalestateexception%2F" height="61" width="51" /></a></div><p>Today I had to use an Ative Record implementation for C#: <a href="http://www.castleproject.org/activerecord/index.html">Castle Active Record</a>. It worked verfy fine until i needed to save a one to many relationship. Then the underlying NHibernate yielded the following Exception:<br />
  <quote> StaleStateException: unexpected row count -1 expected 1 </quote>. </p>
<p>Googling for that Exception gave me two options: At first, turning the sql servers NOCOUNT property OFF by either sending &#8220;SET NOCOUNT OFF&#8221; or setting the appropriate property of the SQL-Server in the config dialog. Both did not work for me, as i am neither the Admin of the server nor i can send the command by hand through the many layers introduced by ActiveRecord/NHibernate. </p>
<p>Another possible solution was overriding the connection driver to let i send the query everytime the connection gets requested. This was proposed by the blog author of: http://www.socialanimal.com/archives/2008/03/07/nhibernate-and-nocount/. This either didn&#8217;t work for me.</p>
<p>But taking a look in the database suprised me! My Data was actually written! So a simply try {} catch(&#8230;) { //ignore } did the job! </p>
<p>SHAME ON ME FOR THAT <img src='http://www.stupent.at/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.stupent.at/2010/01/12/nhibernateactive-record-stalestateexception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Base64 En-/Decoding using OpenSSL in C</title>
		<link>http://www.stupent.at/2009/07/03/base64-en-decoding-using-openssl-in-c/</link>
		<comments>http://www.stupent.at/2009/07/03/base64-en-decoding-using-openssl-in-c/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 21:39:14 +0000</pubDate>
		<dc:creator>Cici</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[UNI]]></category>
		<category><![CDATA[base64]]></category>
		<category><![CDATA[bio]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[openssl]]></category>

		<guid isPermaLink="false">http://www.stupent.at/?p=195</guid>
		<description><![CDATA[Recently i had to implement Base64 en &#38; decoding using openssl&#8217;s bio library, which by the way is just great, but a little &#8220;under-documented!&#8221;
If you ever wondered, why the standard example of decoding base64 data always returns 0 when using it with your test data? Well there is some nice undocumented feature: Strings that do [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.stupent.at%2F2009%2F07%2F03%2Fbase64-en-decoding-using-openssl-in-c%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stupent.at%2F2009%2F07%2F03%2Fbase64-en-decoding-using-openssl-in-c%2F" height="61" width="51" /></a></div><p>Recently i had to implement Base64 en &amp; decoding using openssl&#8217;s bio library, which by the way is just great, but a little &#8220;under-documented!&#8221;</p>
<p>If you ever wondered, why the standard example of decoding base64 data always returns 0 when using it with your test data? Well there is some nice undocumented feature: Strings that do not end with a newline &#8216;\n&#8217; are not processed! So you have two possibilities: adding a newline to the string or use the following flag:</p>
<p>BIO_set_flags(BIO* to your bio_f_base64, BIO_FLAGS_BASE64_NO_NL);</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3396611173469301";
google_ad_width = 234;
google_ad_height = 60;
google_ad_format = "234x60_as";
google_ad_type = "text_image";
//2007-04-05: Swabidu
google_ad_channel = "2349987622";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Edit: 21/Dec/08:</p>
<p>After handin of the courses homework i can now give some details about how to do it:</p>
<p>Using a chain of BIO filters is the most flexible way to handle proper base64 en-/decoding:</p>
<p><code><br />
//write base64 coded data to stdout<br />
BIO* b64 = BIO_new(BIO_f_base64());<br />
BIO* bio_out = BIO_new_fp(stdout, BIO_NOCLOSE);<br />
bio_out = BIO_push(b64, bio_out); //attach output bio to base64 bio<br />
BIO_write(bio_out,"data",sizeof("data"));<br />
BIO_flush(bio_out); //flush the buffer<br />
BIO_free_all(bio_out); //cleanup!<br />
</code></p>
<p>For more information see the super perfect documentation: http://www.openssl.org/docs/crypto/BIO_f_base64.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stupent.at/2009/07/03/base64-en-decoding-using-openssl-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
