<?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>doonot.com &#187; Development</title>
	<atom:link href="http://www.doonot.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.doonot.com</link>
	<description></description>
	<lastBuildDate>Fri, 09 Sep 2011 15:03:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PL/SQL script which removes all data from all tables of a database</title>
		<link>http://www.doonot.com/plsql-script-which-removes-all-data-from-all-tables-of-a-database/</link>
		<comments>http://www.doonot.com/plsql-script-which-removes-all-data-from-all-tables-of-a-database/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 15:00:57 +0000</pubDate>
		<dc:creator>Pädde</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[11]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[drop]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[pl/sql]]></category>
		<category><![CDATA[remove data from table]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[truncate]]></category>

		<guid isPermaLink="false">http://www.doonot.com/?p=570</guid>
		<description><![CDATA[I spent quite a bit of time today, because I needed something that removes all data from my oracle 11.0 database. I didn&#8217;t want to perform a drop command, as the tables should stay there. I tried it with the truncate command which failed because of the constraints. This script disables all constraints, performs truncate [...]]]></description>
			<content:encoded><![CDATA[<p>I spent quite a bit of time today, because I needed something that removes all data from my oracle 11.0 database. I didn&#8217;t want to perform a drop command, as the tables should stay there. I tried it with the truncate command which failed because of the constraints.</p>
<p>This script disables all constraints, performs truncate commands on each table and re-enables the constraints. It&#8217;s generic and should work out of the box, that means you don&#8217;t have to change anything. Make sure that you run it as database user and not as sys user, otherwise it will fuck up the content of your tables <img src='http://www.doonot.com/wp-includes/images/smilies/emoticon_smile.png' alt=':)' class='wp-smiley' /> </p>
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="coMULTI">/******************************************************************************<br />
&nbsp; &nbsp;NAME: &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clean_stm_database.sql<br />
&nbsp; &nbsp;PURPOSE: &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; This script first disables all constraints on all tables. In <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the second step, all data is being truncated on all tables. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Last but not least, all constraints are re-enabled<br />
&nbsp; &nbsp;INSTRUCTIONS:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Run this script as database user (e.g. STM_T)<br />
&nbsp; &nbsp;REVISIONS:<br />
&nbsp; &nbsp;Ver &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Date &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Author &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Description<br />
&nbsp; &nbsp;&#8212;&#8212;&#8212; &nbsp; &nbsp;&#8212;&#8212;&#8212;- &nbsp; &nbsp;&#8212;&#8212;&#8212;&#8212;&#8212; &nbsp; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&nbsp; &nbsp;1.0.0 &nbsp; &nbsp; &nbsp; &nbsp;09.09.2011 &nbsp; &nbsp;Patrick Breiter &nbsp; draft version<br />
******************************************************************************/</span></p>
<p>rem <span class="kw1">DROP</span> procedure clean_database;<br />
<span class="kw1">SET</span> serveroutput <span class="kw1">ON</span>;</p>
<p><span class="kw1">CREATE</span> <span class="kw1">OR</span> <span class="kw1">REPLACE</span> procedure clean_database<br />
<span class="kw1">AS</span><br />
&nbsp; table_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;varchar2<span class="br0">&#40;</span>255<span class="br0">&#41;</span>;<br />
&nbsp; enabled_constraint &nbsp; &nbsp;varchar2<span class="br0">&#40;</span>255<span class="br0">&#41;</span>;<br />
&nbsp; disabled_constraint &nbsp; varchar2<span class="br0">&#40;</span>255<span class="br0">&#41;</span>;</p>
<p>BEGIN</p>
<p>&nbsp; dbms_output<span class="sy0">.</span>enable<span class="br0">&#40;</span>1000000<span class="br0">&#41;</span>;<br />
&nbsp; <br />
&nbsp; <span class="co1">&#8211; this loop disables all constraints in every table</span><br />
&nbsp; <span class="kw1">FOR</span> c <span class="kw1">IN</span><br />
&nbsp; <span class="br0">&#40;</span><span class="kw1">SELECT</span> c<span class="sy0">.</span>owner<span class="sy0">,</span> c<span class="sy0">.</span>table_name<span class="sy0">,</span> c<span class="sy0">.</span>constraint_name<br />
&nbsp; &nbsp;<span class="kw1">FROM</span> user_constraints c<span class="sy0">,</span> user_tables t<br />
&nbsp; &nbsp;<span class="kw1">WHERE</span> c<span class="sy0">.</span>table_name <span class="sy0">=</span> t<span class="sy0">.</span>table_name<br />
&nbsp; &nbsp;<span class="kw1">AND</span> c<span class="sy0">.</span><span class="kw1">STATUS</span> <span class="sy0">=</span> <span class="st0">&#8216;ENABLED&#8217;</span><br />
&nbsp; &nbsp;<span class="kw1">ORDER</span> <span class="kw1">BY</span> c<span class="sy0">.</span>constraint_type <span class="kw1">DESC</span><span class="br0">&#41;</span><br />
&nbsp; LOOP<br />
&nbsp; &nbsp; disabled_constraint:<span class="sy0">=</span>c<span class="sy0">.</span>constraint_name;<br />
&nbsp; &nbsp; dbms_utility<span class="sy0">.</span>exec_ddl_statement<span class="br0">&#40;</span><span class="st0">&#8216;alter table &#8216;</span> <span class="sy0">||</span> c<span class="sy0">.</span>owner <span class="sy0">||</span> <span class="st0">&#8216;.&#8217;</span> <span class="sy0">||</span> c<span class="sy0">.</span>table_name <span class="sy0">||</span> <span class="st0">&#8216; disable constraint &#8216;</span> <span class="sy0">||</span> c<span class="sy0">.</span>constraint_name<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; dbms_output<span class="sy0">.</span>put_line<span class="br0">&#40;</span><span class="st0">&#8216;disabled: &#8216;</span> <span class="sy0">||</span> disabled_constraint<span class="br0">&#41;</span>;<br />
&nbsp; END LOOP;</p>
<p>&nbsp; <span class="co1">&#8211; this loop truncates all data from every table</span><br />
&nbsp; <span class="kw1">FOR</span> tab <span class="kw1">IN</span> <span class="br0">&#40;</span><span class="kw1">SELECT</span> table_name <span class="kw1">FROM</span> user_tables <span class="kw1">ORDER</span> <span class="kw1">BY</span> table_name <span class="kw1">DESC</span><span class="br0">&#41;</span> <br />
&nbsp; loop<br />
&nbsp; &nbsp; table_name:<span class="sy0">=</span>tab<span class="sy0">.</span>table_name;<br />
&nbsp; &nbsp; execute immediate <span class="st0">&#8216;truncate table &#8216;</span><span class="sy0">||</span> table_name;<br />
&nbsp; &nbsp; dbms_output<span class="sy0">.</span>put_line<span class="br0">&#40;</span><span class="st0">&#8216;truncated: &#8216;</span> <span class="sy0">||</span> table_name<span class="br0">&#41;</span>;<br />
&nbsp; end loop;<br />
&nbsp; <br />
&nbsp; <span class="co1">&#8211; this loop re-enables all constraints on all tables</span><br />
&nbsp; <span class="kw1">FOR</span> c <span class="kw1">IN</span><br />
&nbsp; <span class="br0">&#40;</span><span class="kw1">SELECT</span> c<span class="sy0">.</span>owner<span class="sy0">,</span> c<span class="sy0">.</span>table_name<span class="sy0">,</span> c<span class="sy0">.</span>constraint_name<br />
&nbsp; &nbsp;<span class="kw1">FROM</span> user_constraints c<span class="sy0">,</span> user_tables t<br />
&nbsp; &nbsp;<span class="kw1">WHERE</span> c<span class="sy0">.</span>table_name <span class="sy0">=</span> t<span class="sy0">.</span>table_name<br />
&nbsp; &nbsp;<span class="kw1">AND</span> c<span class="sy0">.</span><span class="kw1">STATUS</span> <span class="sy0">=</span> <span class="st0">&#8216;DISABLED&#8217;</span><br />
&nbsp; &nbsp;<span class="kw1">ORDER</span> <span class="kw1">BY</span> c<span class="sy0">.</span>constraint_type<span class="br0">&#41;</span><br />
&nbsp; LOOP<br />
&nbsp; &nbsp; enabled_constraint:<span class="sy0">=</span>c<span class="sy0">.</span>constraint_name;<br />
&nbsp; &nbsp; dbms_utility<span class="sy0">.</span>exec_ddl_statement<span class="br0">&#40;</span><span class="st0">&#8216;alter table &#8216;</span> <span class="sy0">||</span> c<span class="sy0">.</span>owner <span class="sy0">||</span> <span class="st0">&#8216;.&#8217;</span> <span class="sy0">||</span> c<span class="sy0">.</span>table_name <span class="sy0">||</span> <span class="st0">&#8216; enable constraint &#8216;</span> <span class="sy0">||</span> c<span class="sy0">.</span>constraint_name<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; dbms_output<span class="sy0">.</span>put_line<span class="br0">&#40;</span><span class="st0">&#8216;re-enabled: &#8216;</span> <span class="sy0">||</span> disabled_constraint<span class="br0">&#41;</span>;<br />
&nbsp; END LOOP;</p>
<p>END;<br />
<span class="sy0">/</span></p>
<p>execute clean_database;</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.doonot.com/plsql-script-which-removes-all-data-from-all-tables-of-a-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Änderungen seit facts 1.0.0</title>
		<link>http://www.doonot.com/anderungen-seit-facts-1-0-0/</link>
		<comments>http://www.doonot.com/anderungen-seit-facts-1-0-0/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 13:43:34 +0000</pubDate>
		<dc:creator>Pädde</dc:creator>
				<category><![CDATA[Apps]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[1.1.0]]></category>
		<category><![CDATA[1.2.0]]></category>
		<category><![CDATA[1.3.0]]></category>
		<category><![CDATA[1.3.1]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[appstore]]></category>
		<category><![CDATA[facts]]></category>
		<category><![CDATA[fakten]]></category>
		<category><![CDATA[knowledge]]></category>
		<category><![CDATA[sinnlos]]></category>
		<category><![CDATA[unnützes]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[useless]]></category>
		<category><![CDATA[wissen]]></category>

		<guid isPermaLink="false">http://www.doonot.com/?p=566</guid>
		<description><![CDATA[Facts 1.3.1: - Fehlerbehebung: &#8220;Next&#8221;-Button funktionierte nach Update nicht mehr. Facts 1.3.0: + Zufallsgenerator &#8211;> via Einstellungen aktivieren. + Wenn Facts wegen ihrer Länge nicht auf Facebook gepostet werden können, wird es angezeigt. + Neue Animation, wenn Gerät geschüttelt wird und neuen Fact lädt. Facts 1.2.0: + Suchfunktion für Favoriten + Alle Facts können nun [...]]]></description>
			<content:encoded><![CDATA[<p>Facts 1.3.1:<br />
- Fehlerbehebung: &#8220;Next&#8221;-Button funktionierte nach Update nicht mehr. </p>
<p>Facts 1.3.0:<br />
+ Zufallsgenerator &#8211;> via Einstellungen aktivieren.<br />
+ Wenn Facts wegen ihrer Länge nicht auf Facebook gepostet werden können, wird es angezeigt.<br />
+ Neue Animation, wenn Gerät geschüttelt wird und neuen Fact lädt. </p>
<p>Facts 1.2.0:<br />
+ Suchfunktion für Favoriten<br />
+ Alle Facts können nun in einer eigenen Tabelle gelesen werden. Suche in allen Facts<br />
+ Andere Benachrichtigung, wenn ein Fact entfavorisiert wird in der Detail Ansicht<br />
+ Weitere kleinere Fehlerbehebungen (Angepasste Schriftart beim lesen von Favoriten)<br />
+ 85 neue Facts<br />
+ Drastische Performance Verbesserung<br />
+ Verbessertes Memory Management</p>
<p>Facts 1.1.0:<br />
+ Facebook Integration!<br />
+ Neue Icons!<br />
+ Schüttle dein Gerät, um den nächsten Fact zu laden<br />
+ Volle Retina Display Unterstützung<br />
+ Verkleinertes Installationspacket<br />
+ Neues Start Bild<br />
+ Einige Fehler Behebungen<br />
+ Dialog wird nun länger angezeigt, wenn ein Favorit hinzugefügt oder entfernt wird.<br />
+ Neue Icons, wenn Favoriten hinzugefügt oder entfernt werden.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doonot.com/anderungen-seit-facts-1-0-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>facts iPhone app</title>
		<link>http://www.doonot.com/facts-iphone-app/</link>
		<comments>http://www.doonot.com/facts-iphone-app/#comments</comments>
		<pubDate>Fri, 06 May 2011 20:53:32 +0000</pubDate>
		<dc:creator>Pädde</dc:creator>
				<category><![CDATA[Allgemeines]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Apps]]></category>
		<category><![CDATA[Bekanntgabe]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[XCode]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[appstore]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[awesome facts]]></category>
		<category><![CDATA[Breiter]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[fact]]></category>
		<category><![CDATA[facts]]></category>
		<category><![CDATA[fakt]]></category>
		<category><![CDATA[favorit]]></category>
		<category><![CDATA[favoriten]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[ipad 2]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iphone 4]]></category>
		<category><![CDATA[iphone development]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[Link]]></category>
		<category><![CDATA[liste]]></category>
		<category><![CDATA[luzern]]></category>
		<category><![CDATA[patrick]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[Schweiz]]></category>
		<category><![CDATA[sinlos]]></category>
		<category><![CDATA[sinnlos]]></category>
		<category><![CDATA[sinnloses wissen]]></category>
		<category><![CDATA[unnütz]]></category>
		<category><![CDATA[unnützes]]></category>
		<category><![CDATA[unnützes wissen]]></category>
		<category><![CDATA[wissen]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.doonot.com/?p=540</guid>
		<description><![CDATA[So, ich habe eine neue iPhone Applikation am start mit dem Namen &#8220;Facts&#8221;. Als ich mit dem iPhone Programmieren begonnen habe, wollte ich eine Applikation erstellen, mit der man Zugriff auf Tausende von Fakten rund ums Leben hat. Ich habe begonnen überall im Internet solche Facts zu suchen und habe bis heute über 2900 zusammen. [...]]]></description>
			<content:encoded><![CDATA[<p>So, ich habe eine neue iPhone Applikation am start mit dem Namen &#8220;Facts&#8221;.</p>
<p>Als ich mit dem iPhone Programmieren begonnen habe, wollte ich eine Applikation erstellen, mit der man Zugriff auf Tausende von Fakten rund ums Leben hat. Ich habe begonnen überall im Internet solche Facts zu suchen und habe bis heute über 2900 zusammen.</p>
<p>Ich werde nun einige Screenshots zeigen und die App kurz erklären:</p>
<p>Der Willkommensscreen sieht wie folgt aus. Die interne Facts Datenbank wird überprüft.</p>
<p><a href="http://www.doonot.com/wp-content/uploads/2011/05/Foto.png"><img class="alignnone size-full wp-image-541" title="Foto" src="http://www.doonot.com/wp-content/uploads/2011/05/Foto.png" alt="" width="60%" /></a></p>
<p>Der Hauptscreen der App sieht so aus. Hier kann man den Fact lesen und mit den Vor- und Zurückknöpfen navigieren. Desweiteren gibt es eine Favoriten Funktion, welche den jetztigen Fact zu den Favoriten legt. Dafür muss man auf den Stern klicken. Wenn der Fact in der Vergangenheit schon einmal gelesen wurde, dann wird das angezeigt. Somit weisst du immer, ob du alte Facts liest, die du schon kennst. Schüttle dein Gerät um zum nächsten Fact zu gelangen.</p>
<p><a href="http://www.doonot.com/wp-content/uploads/2011/05/Foto1.png"><img class="alignnone size-full wp-image-544" title="Foto(1)" src="http://www.doonot.com/wp-content/uploads/2011/05/Foto1.png" alt="" width="60%" /></a><br />
Klicke hier, um die ganze Review zu lesen.<br />
<span id="more-540"></span></p>
<p>Ein Klick auf den Info Button zeigt folgendes Bild. Die Version ist ersichtlich, wer die Applikation entwickelt hat, und wer die Icons entworfen hat, welche in der App verwendet werden.</p>
<p><a href="http://www.doonot.com/wp-content/uploads/2011/05/Foto2.png"><img class="alignnone size-full wp-image-547" title="Foto(2)" src="http://www.doonot.com/wp-content/uploads/2011/05/Foto2.png" alt="" width="60%" /></a></p>
<p>Wenn ein Fact favorisiert wird, dann wird kurz ausgegeben, dass der Fact erfolgreich zu den Favoriten hinzugefügt wurde:</p>
<p><a href="http://www.doonot.com/wp-content/uploads/2011/05/Foto3.png"><img class="alignnone size-full wp-image-549" title="Foto(3)" src="http://www.doonot.com/wp-content/uploads/2011/05/Foto3.png" alt="" width="60%" /></a></p>
<p>Wenn du den Fact &#8220;entfavorisieren&#8221; möchtest, dann kannst du auf den aktivierten, gelben Stern klicken, und folgender Screen erscheint:</p>
<p><a href="http://www.doonot.com/wp-content/uploads/2011/05/Foto4.png"><img class="alignnone size-full wp-image-551" title="Foto(4)" src="http://www.doonot.com/wp-content/uploads/2011/05/Foto4.png" alt="" width="60%" /></a></p>
<p>Ab Version 1.1.0 können Facts auch auf Facebook gepostet werden. Dafür klickst du einfach auf den Facebook Knopf. Das aller erste Mal fragt Facebook dich, ob du der App gestattest, an deine Pinnwand zu posten. Wenn du mit der Anmeldung fertig bist, kommt die Bestätigungsmeldung. Klicke nun auf veröffentlichen!</p>
<p><a href="http://www.doonot.com/wp-content/uploads/2011/05/Foto5.png"><img class="alignnone size-full wp-image-553" title="Foto(5)" src="http://www.doonot.com/wp-content/uploads/2011/05/Foto5.png" alt="" width="60%" /></a></p>
<p>Um eine Liste deiner Favoriten zu sehen, klickst du auf das Favoriten-Tab. Eine neue Seite erscheint mit all deinen favorisierten Facts.</p>
<p><a href="http://www.doonot.com/wp-content/uploads/2011/05/Foto6.png"><img class="alignnone size-full wp-image-555" title="Foto(6)" src="http://www.doonot.com/wp-content/uploads/2011/05/Foto6.png" alt="" width="60%" /></a></p>
<p>Um einen einzelnen favorisierten Fact zu lesen, klickst du einfach auf den Fact in der Tabellen Ansicht. Eine neue Seite erscheint. Dort kannst du mit dem &#8220;Favorit entfernen&#8221; Button den Favorit von der Liste entfernen. Du hast hier auch die Möglichkeit, den Fact an deine Facebook Pinwand zu posten:</p>
<p><a href="http://www.doonot.com/wp-content/uploads/2011/05/Foto7.png"><img class="alignnone size-full wp-image-556" title="Foto(7)" src="http://www.doonot.com/wp-content/uploads/2011/05/Foto7.png" alt="" width="60%"  /></a></p>
<p>Wenn du weitere Facts kennen solltest, dann kannst du diese mit der letzten Funktion einsenden. Nachdem sie geprüft wurden, werden sie der App hinzugefügt:</p>
<p><a href="http://www.doonot.com/wp-content/uploads/2011/05/Foto8.png"><img class="alignnone size-full wp-image-557" title="Foto(8)" src="http://www.doonot.com/wp-content/uploads/2011/05/Foto8.png" alt="" width="60%" /></a></p>
<p>Facts kann im Appstore oder direkt in <a href="http://itunes.apple.com/us/app/facts/id434894484?mt=8&#038;ls=1">iTunes</a> für 1.10 CHF heruntergeladen werden. Wenn du eine Website hast, und eine Review schreiben möchtest, dann gibt doch Bescheid, damit ich dir einen Promocode für einen gratis Download senden kann.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doonot.com/facts-iphone-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to dismiss keyboard in uitextview</title>
		<link>http://www.doonot.com/how-to-dismiss-keyboard-in-uitextview/</link>
		<comments>http://www.doonot.com/how-to-dismiss-keyboard-in-uitextview/#comments</comments>
		<pubDate>Tue, 15 Mar 2011 15:02:16 +0000</pubDate>
		<dc:creator>Pädde</dc:creator>
				<category><![CDATA[Allgemeines]]></category>
		<category><![CDATA[Anleitung]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[dismiss]]></category>
		<category><![CDATA[dissmis]]></category>
		<category><![CDATA[done]]></category>
		<category><![CDATA[first]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[iboutlet]]></category>
		<category><![CDATA[isequaltostring]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[range]]></category>
		<category><![CDATA[replacement]]></category>
		<category><![CDATA[resignfirstresponder]]></category>
		<category><![CDATA[responder]]></category>
		<category><![CDATA[return]]></category>
		<category><![CDATA[shouldchangetextinrange]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[to]]></category>
		<category><![CDATA[uitextview]]></category>
		<category><![CDATA[uitextviewdelegate]]></category>
		<category><![CDATA[view]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://www.doonot.com/?p=531</guid>
		<description><![CDATA[In my iPhone application I had a UITextView and I wanted to allow the user to insert text and submit it. The problem was that the keyboard didn&#8217;t disappear when you clicked on return or done. I searched quite a bit and found this working solution: In your controller .h file: @interface YourController : UIViewController [...]]]></description>
			<content:encoded><![CDATA[<p>In my iPhone application I had a UITextView and I wanted to allow the user to insert text and submit it. The problem was that the keyboard didn&#8217;t disappear when you clicked on return or done. I searched quite a bit and found this working solution:</p>
<p>In your controller .h file:</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="kw1">@interface</span> YourController <span class="sy0">:</span> UIViewController &nbsp;<span class="br0">&#123;</span><br />
IBOutlet UITextView <span class="sy0">*</span>textView;<br />
<span class="br0">&#125;</span></div>
</div>
<p>In your controller.m file:</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">BOOL</span><span class="br0">&#41;</span>textView<span class="sy0">:</span><span class="br0">&#40;</span>UITextView <span class="sy0">*</span><span class="br0">&#41;</span>textView shouldChangeTextInRange<span class="sy0">:</span><span class="br0">&#40;</span><span class="kw4">NSRange</span><span class="br0">&#41;</span>range replacementText<span class="sy0">:</span><span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>text <span class="br0">&#123;</span><br />
NSLog<span class="br0">&#40;</span><span class="co3">@</span><span class="st0">&quot;called&quot;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">if</span><span class="br0">&#40;</span><span class="br0">&#91;</span>text isEqualToString<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;<span class="es0">\n</span>&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="br0">&#91;</span>textView resignFirstResponder<span class="br0">&#93;</span>;<br />
<span class="kw1">return</span> <span class="kw2">NO</span>;<br />
<span class="br0">&#125;</span><br />
<span class="kw1">return</span> <span class="kw2">YES</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<p>This function gets called every time you insert a character. If you click on Return/Finish/Whatever, the keyboard will be dismissed.<br />
If it doesnt work, open Interface Builder and map your UITextView with the Files owner and assign delegate. Put your comments into the comment section.</p>
<p><script type="text/javascript">// < ![CDATA[
 google_ad_client = "ca-pub-1445556659678019"; /* Horizontaler Banner */ google_ad_slot = "5289321608"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doonot.com/how-to-dismiss-keyboard-in-uitextview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sqlite3 umlauts/special character problem</title>
		<link>http://www.doonot.com/sqlite3-umlautsspecial-character-problem/</link>
		<comments>http://www.doonot.com/sqlite3-umlautsspecial-character-problem/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 13:42:36 +0000</pubDate>
		<dc:creator>Pädde</dc:creator>
				<category><![CDATA[Anleitung]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Weblog]]></category>
		<category><![CDATA[XCode]]></category>
		<category><![CDATA[characters]]></category>
		<category><![CDATA[chmod+x]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[facts]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[special]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[sqlite3]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[to]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[umlaute]]></category>
		<category><![CDATA[umlauts]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://www.doonot.com/?p=499</guid>
		<description><![CDATA[When you are developing an iPhone application, you will most likely have to use an internal database to store your data. I also needed a database for my Facts iPhone application. As the app contains german words, it also contains umlauts and special characters like äöü and all this stuff that is not present in [...]]]></description>
			<content:encoded><![CDATA[<p>When you are developing an iPhone application, you will most likely have to use an internal database to store your data. I also needed a database for my Facts iPhone application. As the app contains german words, it also contains umlauts and special characters like äöü and all this stuff that is not present in the english language. However, I was not able to support these special characters although I used UTF8 encryption in my application.</p>
<p>To create the database, I used the following commands in terminal:</p>
<blockquote><p>cd Desktop<br />
mkdir FactsDatabase<br />
cd FactsDatabase<br />
sqlite3 facts.sqlite
</p></blockquote>
<p>Now you will see the sqlite command prompt which only accepts sql commands from now on. This is where I have created my database, and inserted some facts:</p>
<blockquote><p>
// create table<br />
create table facts(id integer primary key, fact text, isFavorite varchar(5), alreadyRead varchar(5));</p>
<p>// fill database with facts<br />
sqlite3 facts.sqlite &#8220;INSERT INTO facts(fact, isFavorite, alreadyRead) values(&#8216;Täglich werden 12 Neugeborene den falschen Eltern gegeben.&#8217;, &#8216;no&#8217;,'no&#8217;);&#8221;
</p></blockquote>
<p>Now if you do it like this, the special characters won&#8217;t show up in your application. After some hours of trying I tried to use run my sqlite commands in a shell script. I had to rearrange the commands to fit like this:</p>
<blockquote><p>
# drop exising table<br />
sqlite3 facts.sqlite &#8220;drop table facts;&#8221;</p>
<p># create database<br />
sqlite3 facts.sqlite &#8220;create table facts(id integer primary key, fact text, isFavorite varchar(5), alreadyRead varchar(5));&#8221;</p>
<p># fill database with facts<br />
sqlite3 facts.sqlite &#8220;INSERT INTO facts(fact, isFavorite, alreadyRead) values(&#8216;Täglich werden 12 Neugeborene den falschen Eltern gegeben.&#8217;, &#8216;no&#8217;,'no&#8217;);&#8221;
</p></blockquote>
<p>Save it as database.sh and in terminal, give it the rights to execute: chmod+x database.sh, and then run it with ./database.sh<br />
If you do it like this, the special characters are finally in the database and will show up in your application. To be honest, I have no idea why it only works with this workaround. It costed me quite a bit of time. Anyway, hope that helps anyone. If you have questions, use the comment section. Cheers.</p>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-1445556659678019";
/* Horizontaler Banner */
google_ad_slot = "5289321608";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doonot.com/sqlite3-umlautsspecial-character-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>all in vain iphone applikation</title>
		<link>http://www.doonot.com/all-in-vain-iphone-applikation/</link>
		<comments>http://www.doonot.com/all-in-vain-iphone-applikation/#comments</comments>
		<pubDate>Sat, 26 Feb 2011 12:42:06 +0000</pubDate>
		<dc:creator>Pädde</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Apps]]></category>
		<category><![CDATA[Bekanntgabe]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[XCode]]></category>
		<category><![CDATA[all]]></category>
		<category><![CDATA[all in vain]]></category>
		<category><![CDATA[app store]]></category>
		<category><![CDATA[appstore]]></category>
		<category><![CDATA[band]]></category>
		<category><![CDATA[in]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[punk rock]]></category>
		<category><![CDATA[rock]]></category>
		<category><![CDATA[rock punk]]></category>
		<category><![CDATA[vain]]></category>

		<guid isPermaLink="false">http://www.doonot.com/?p=489</guid>
		<description><![CDATA[Heute wurde meine 2. iPhone Applikation von Apple frei gegeben. Die Applikation beschäftigt sich mit meiner Band All in Vain. Hier ein kurzer Einblick, was Ihr mit der App so anstellen könnt: All in Vain ist eine junge, aufstrebende Punkrock/Alternative Band von Luzern (Schweiz). Diese Applikation bietet Zugriff auf alle wichtigen Daten rund um die [...]]]></description>
			<content:encoded><![CDATA[<p>Heute wurde meine 2. iPhone Applikation von Apple frei gegeben. Die Applikation beschäftigt sich mit meiner Band All in Vain. Hier ein kurzer Einblick, was Ihr mit der App so anstellen könnt:</p>
<blockquote><p>All in Vain ist eine junge, aufstrebende Punkrock/Alternative Band von Luzern (Schweiz). Diese Applikation bietet Zugriff auf alle wichtigen Daten rund um die Band.</p>
<p>Einige der Features im Überblick:</p>
<p>- Alles über All in Vain<br />
- Bandmembers einzeln vorgestellt (Details, Fotos, Equipment, Hobbies, etc).<br />
- Eine Media-Rubrik mit unveröffentlichen Demo Aufnahmen, welche nur mit dieser iPhone App gehört werden können!<br />
- Schau dir Bilder der Band und Ihren Projekten an (inkl. All in Vain Groupie Pics, Demo Session, Rock Night Sursee). Sobald neue Bilder verfügbar sind, werden sie automatisch uf deinem iPhone geladen.<br />
- Normal Display und iPhone 4 Retina Display Support.<br />
- RSS Feed, welcher dir alle Beiträge von www.allinvain.ch auf einen Blick präsentiert. Schüttle dein iPhone oder zieh mit dem Finger über die Tabelle um die Feeds zu aktualisieren.<br />
- Tour/Konzert Übersicht &#8211;&gt; somit weisst du immer, wo die nächsten Konzerte stattfinden werden. Nebst Konzertdaten siehst du auf einer Maps Karte direkt, wo sich die Location befindet.<br />
- Direkten Zugriff auf &#8220;All in Vain&#8221;-Channels wie Facebook, Twitter und Youtube!<br />
- All in Vain Sponsoring Übersicht.<br />
- Ordne die Tab Icons an wie&#8217;s dir am Besten passt. Sie können im &#8216;Mehr&#8217;-Menu verändert werden.<br />
- Dank Apples Push Notifications bist du immer auf dem neusten Stand. (Neue Websiten Einträge, neue Tourdaten, Allgemeine Informationen).</p>
<p>Funktionen, die bald kommen werden:<br />
- Werde ein Groupie von der Band oder von einzelnen Mitgliedern.<br />
- Songtexte.</p>
<p>Für diese Applikation braucht es eine Internetverbindung (Bilder, RSS Feeds, Tourdaten, Songs, Verschiedene Channels).</p></blockquote>
<p>Zum Schluss noch einige Bilder und der Link zur Applikation im<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=421511452&amp;mt=8" target="_blank"> iTunes Store</a>:</p>
<p><a href="http://www.doonot.com/wp-content/uploads/2011/02/all_in_vain_appstore_images.png"><img class="alignnone size-full wp-image-491" title="all_in_vain_appstore_images" src="http://www.doonot.com/wp-content/uploads/2011/02/all_in_vain_appstore_images.png" alt="" width="100%" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doonot.com/all-in-vain-iphone-applikation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xcode Debugger has exited with error code 45</title>
		<link>http://www.doonot.com/xcode-debugger-has-exited-with-error-code-45/</link>
		<comments>http://www.doonot.com/xcode-debugger-has-exited-with-error-code-45/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 15:16:09 +0000</pubDate>
		<dc:creator>Pädde</dc:creator>
				<category><![CDATA[Anleitung]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Cydia]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Macbook Pro]]></category>
		<category><![CDATA[XCode]]></category>
		<category><![CDATA[+]]></category>
		<category><![CDATA[albums]]></category>
		<category><![CDATA[debugger]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[error 45]]></category>
		<category><![CDATA[exited]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[greenpois0n]]></category>
		<category><![CDATA[iphone 3gs]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[photoalbums+]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[solve]]></category>
		<category><![CDATA[solved]]></category>

		<guid isPermaLink="false">http://www.doonot.com/?p=478</guid>
		<description><![CDATA[I jailbroke my iPhone some days ago with the GreenPois0n Tool and installed all my stuff. When I was using my iPhone for Developing I found out that the debugger always exited with error status code 45. First I thought it was a problem with my app but then I tried with a non-jailbroken iPhone [...]]]></description>
			<content:encoded><![CDATA[<p>I jailbroke my iPhone some days ago with the GreenPois0n Tool and installed all my stuff. When I was using my iPhone for Developing I found out that the debugger always exited with error status code 45. First I thought it was a problem with my app but then I tried with a non-jailbroken iPhone 3GS and it worked without errors. I debugged the output code and found out that the &#8220;PhotoAlbums+&#8221; application which gives you the ability to create photo folders crashed all the time. I uninstalled this app from Cydia and now I can continue with development. Just as information if someone has the same problem <img src='http://www.doonot.com/wp-includes/images/smilies/emoticon_smile.png' alt=':)' class='wp-smiley' /> </p>
<p><script type="text/javascript">// < ![CDATA[
 google_ad_client = "ca-pub-1445556659678019"; /* Horizontaler Banner */ google_ad_slot = "5289321608"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doonot.com/xcode-debugger-has-exited-with-error-code-45/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adium Soundboard for Cydia</title>
		<link>http://www.doonot.com/adium-soundboard-for-cydia/</link>
		<comments>http://www.doonot.com/adium-soundboard-for-cydia/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 13:11:26 +0000</pubDate>
		<dc:creator>Pädde</dc:creator>
				<category><![CDATA[Allgemeines]]></category>
		<category><![CDATA[Apps]]></category>
		<category><![CDATA[Cydia]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Repository]]></category>
		<category><![CDATA[adium]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[duck]]></category>
		<category><![CDATA[IM]]></category>
		<category><![CDATA[messenger]]></category>
		<category><![CDATA[modmyi.com]]></category>
		<category><![CDATA[packae]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[soundboard]]></category>
		<category><![CDATA[sounds]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[Winterboard]]></category>

		<guid isPermaLink="false">http://www.doonot.com/?p=455</guid>
		<description><![CDATA[I was searching an Adium Soundboard for my iPhone this weekend but unfortutately I didn&#8217;t find one. So I decided to make my own. I just uploaded it to www.modmyi.com You will find it if you have the source: apt.modmyrepo.com added in Cydia.]]></description>
			<content:encoded><![CDATA[<p>I was searching an Adium Soundboard for my iPhone this weekend but unfortutately I didn&#8217;t find one. So I decided to make my own. I just uploaded it to www.modmyi.com</p>
<p>You will find it if you have the source: <em>apt.modmyrepo.com</em> added in Cydia.</p>
<p><img class="alignnone size-full wp-image-456" title="logo" src="http://www.doonot.com/wp-content/uploads/2009/12/logo.png" alt="logo" width="128" height="128" /></p>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-1445556659678019";
/* Text Banner */
google_ad_slot = "8502078237";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doonot.com/adium-soundboard-for-cydia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PL/SQL: How to convert MD5 from Hex to Base64</title>
		<link>http://www.doonot.com/plsql-how-to-convert-md5-from-hex-to-base64/</link>
		<comments>http://www.doonot.com/plsql-how-to-convert-md5-from-hex-to-base64/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 12:51:45 +0000</pubDate>
		<dc:creator>Pädde</dc:creator>
				<category><![CDATA[Application Server]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[5.1.0]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[base64]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[he]]></category>
		<category><![CDATA[hex]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[jboss 5.1.0GA]]></category>
		<category><![CDATA[login-config.xml]]></category>
		<category><![CDATA[md5]]></category>

		<guid isPermaLink="false">http://www.doonot.com/?p=450</guid>
		<description><![CDATA[I was working with JBoss 5.1.0GA and I wanted to activate the JBoss MD5 Authentication. The passwords were stored as HEX 16Byte long (32 Hex Characters). When you have a look at the official JBoss User Manual (Chapter 9) you will see that they are using Base64-Encoding. So we had to come up with a [...]]]></description>
			<content:encoded><![CDATA[<p>I was working with JBoss 5.1.0GA and I wanted to activate the JBoss MD5 Authentication. The passwords were stored as HEX 16Byte long (32 Hex Characters). When you have a look at the official JBoss User Manual (Chapter 9) you will see that they are using Base64-Encoding. So we had to come up with a short PL/SQL-script to convert the passwords to Base64!</p>
<p>Simply create a PL-SQL Script and add the following code:</p>
<p>[codesyntax lang="plsql"]</p>
<p>set sqlblanklines on;</p>
<p>set serveroutput on;</p>
<p>DECLARE</p>
<p>BEGIN</p>
<p>//read password field as hex-encoded raw data and convert data using base64 encoding</p>
<p>update users set password=utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw(utl_raw.cast_to_varchar2(password))));</p>
<p>END;</p>
<p>[/codesyntax]</p>
<p>Additionally, if you have a unix or linux machine, you can check it in command line:</p>
<p><strong>$ echo -n &#8220;j2ee&#8221; | openssl dgst -md5 -binary | openssl base64 glcikLhvxq1BwPBZN0EGMQ==</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doonot.com/plsql-how-to-convert-md5-from-hex-to-base64/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java: How to get MD5 hash from password string</title>
		<link>http://www.doonot.com/java-how-to-get-md5-hash-from-password-string/</link>
		<comments>http://www.doonot.com/java-how-to-get-md5-hash-from-password-string/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 08:31:12 +0000</pubDate>
		<dc:creator>Pädde</dc:creator>
				<category><![CDATA[Application Server]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[5.1]]></category>
		<category><![CDATA[authorisation]]></category>
		<category><![CDATA[base64]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[jboss 5.1.0GA]]></category>
		<category><![CDATA[md5]]></category>
		<category><![CDATA[org.jboss.security.*]]></category>
		<category><![CDATA[org.jboss.security.util;]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://www.doonot.com/?p=439</guid>
		<description><![CDATA[Recently I had the problem that I had to convert a normal password string to a MD5 Password String which is Base64-Encoded. I found a lot of results but they just worked on JBoss 4.2, so I changed it and now it will also run on JBoss 5.1.0GA:: [codesyntax lang="java" strict="yes"] package com.sicap.ssis2.servlets; import java.security.MessageDigest; [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had the problem that I had to convert a normal password string to a MD5 Password String which is Base64-Encoded. I found a lot of results but they just worked on JBoss 4.2, so I changed it and now it will also run on JBoss 5.1.0GA::</p>
<p>[codesyntax lang="java" strict="yes"]<br />
package com.sicap.ssis2.servlets;<br />
import java.security.MessageDigest;</p>
<p>/**<br />
 * @author doonot<br />
 *<br />
 */<br />
public class MD5HashGenerator {</p>
<p>	/**<br />
	 * @param args<br />
	 * @throws Exception<br />
	 */<br />
	public static void main(String[] args) throws Exception {<br />
		// TODO Auto-generated method stub<br />
		String password = &#8220;testpassword&#8221;;<br />
        MessageDigest md = null;<br />
        try<br />
        {<br />
           md = MessageDigest.getInstance(&#8220;MD5&#8243;);<br />
        }<br />
        catch(Exception e)<br />
        {<br />
           e.printStackTrace();<br />
        }</p>
<p>        byte[] passwordBytes = password.getBytes();<br />
        byte[] hash = md.digest(passwordBytes);<br />
        System.out.println(getHexString(hash));<br />
        String passwordHash = org.jboss.security.Base64Encoder.encode(hash);</p>
<p>        System.out.println(&#8220;password hash: &#8220;+ passwordHash);<br />
    }</p>
<p>    /**<br />
     * This method returns the hex string from the password byte array<br />
     * @param b		Byte[]<br />
     * @return string	hex password string<br />
     * @throws Exception<br />
     */<br />
    public static String getHexString(byte[] b) throws Exception {<br />
        String result = &#8220;&#8221;;<br />
        for (int i=0; i < b.length; i++) {<br />
          result +=<br />
                Integer.toString( ( b[i] &#038; 0xff ) + 0&#215;100, 16).substring( 1 );<br />
        }<br />
        return result;<br />
    }<br />
}</p>
<p>[/codesyntax]</p>
<p>Leave a short comment if you think that was usefull! Best regards!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doonot.com/java-how-to-get-md5-hash-from-password-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

