<?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"
	>

<channel>
	<title>Ventrix's Code Folds</title>
	<atom:link href="http://ventrix.nsdc.gr/code_folds/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://ventrix.nsdc.gr/code_folds</link>
	<description>su; mount /dev/brain /media/head; coding &#38;; tail -F /var/log/coding &#62;&#62; code_folds</description>
	<pubDate>Sat, 08 May 2010 17:20:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Android URLConnection ReadUTF</title>
		<link>http://ventrix.nsdc.gr/code_folds/?p=127</link>
		<comments>http://ventrix.nsdc.gr/code_folds/?p=127#comments</comments>
		<pubDate>Sat, 08 May 2010 17:20:37 +0000</pubDate>
		<dc:creator>ventrix</dc:creator>
		
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://ventrix.nsdc.gr/code_folds/?p=127</guid>
		<description><![CDATA[URLConnection conn;
DataInputStream dis = null;
String url = &#8220;http://test.com/lalala.html&#8221;;
StringBuffer sb1 = new StringBuffer();
try {
URL updateURL = new URL(url);
conn = updateURL.openConnection();
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream(), &#8220;UTF8&#8243;));
String s = &#8220;&#8221;;
while ((s = rd.readLine()) != null) {
sb1.append(s);
}
Log.i(&#8221;AAAAA&#8221;, sb1.toString());
]]></description>
			<content:encoded><![CDATA[<p>URLConnection conn;<br />
DataInputStream dis = null;<br />
String url = &#8220;http://test.com/lalala.html&#8221;;<br />
StringBuffer sb1 = new StringBuffer();<br />
try {<br />
URL updateURL = new URL(url);<br />
conn = updateURL.openConnection();</p>
<p>BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream(), &#8220;UTF8&#8243;));</p>
<p>String s = &#8220;&#8221;;<br />
while ((s = rd.readLine()) != null) {<br />
sb1.append(s);<br />
}<br />
Log.i(&#8221;AAAAA&#8221;, sb1.toString());</p>
]]></content:encoded>
			<wfw:commentRss>http://ventrix.nsdc.gr/code_folds/?feed=rss2&amp;p=127</wfw:commentRss>
		</item>
		<item>
		<title>Vertical AND Horizontal scroll on android</title>
		<link>http://ventrix.nsdc.gr/code_folds/?p=124</link>
		<comments>http://ventrix.nsdc.gr/code_folds/?p=124#comments</comments>
		<pubDate>Sat, 08 May 2010 10:27:56 +0000</pubDate>
		<dc:creator>ventrix</dc:creator>
		
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://ventrix.nsdc.gr/code_folds/?p=124</guid>
		<description><![CDATA[&#60;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&#62;
&#60;LinearLayout xmlns:android=&#8221;http://schemas.android.com/apk/res/android&#8221;
android:layout_width=&#8221;fill_parent&#8221; android:layout_height=&#8221;fill_parent&#8221;
android:orientation=&#8221;vertical&#8221; android:background=&#8221;#919191&#8243;&#62;
&#60;ScrollView android:id=&#8221;@+id/ScrollView01&#8243;
android:layout_width=&#8221;wrap_content&#8221; android:layout_height=&#8221;wrap_content&#8221;&#62;
&#60;HorizontalScrollView android:layout_width=&#8221;wrap_content&#8221; android:layout_height=&#8221;wrap_content&#8221;&#62;
&#60;ImageView android:id=&#8221;@+id/ImageView01&#8243;
android:layout_width=&#8221;fill_parent&#8221; android:layout_height=&#8221;fill_parent&#8221;&#62;&#60;/ImageView&#62;
&#60;/HorizontalScrollView&#62;
&#60;/ScrollView&#62;
&#60;/LinearLayout&#62;
]]></description>
			<content:encoded><![CDATA[<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;LinearLayout xmlns:android=&#8221;http://schemas.android.com/apk/res/android&#8221;<br />
android:layout_width=&#8221;fill_parent&#8221; android:layout_height=&#8221;fill_parent&#8221;<br />
android:orientation=&#8221;vertical&#8221; android:background=&#8221;#919191&#8243;&gt;</p>
<p>&lt;ScrollView android:id=&#8221;@+id/ScrollView01&#8243;<br />
android:layout_width=&#8221;wrap_content&#8221; android:layout_height=&#8221;wrap_content&#8221;&gt;<br />
&lt;HorizontalScrollView android:layout_width=&#8221;wrap_content&#8221; android:layout_height=&#8221;wrap_content&#8221;&gt;</p>
<p>&lt;ImageView android:id=&#8221;@+id/ImageView01&#8243;<br />
android:layout_width=&#8221;fill_parent&#8221; android:layout_height=&#8221;fill_parent&#8221;&gt;&lt;/ImageView&gt;</p>
<p>&lt;/HorizontalScrollView&gt;</p>
<p>&lt;/ScrollView&gt;</p>
<p>&lt;/LinearLayout&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://ventrix.nsdc.gr/code_folds/?feed=rss2&amp;p=124</wfw:commentRss>
		</item>
		<item>
		<title>Button up, listview in the middle, button bottom</title>
		<link>http://ventrix.nsdc.gr/code_folds/?p=122</link>
		<comments>http://ventrix.nsdc.gr/code_folds/?p=122#comments</comments>
		<pubDate>Sat, 08 May 2010 08:05:14 +0000</pubDate>
		<dc:creator>ventrix</dc:creator>
		
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://ventrix.nsdc.gr/code_folds/?p=122</guid>
		<description><![CDATA[&#60;?xml version=&#8220;1.0&#8243; encoding=&#8220;utf-8&#8243;?&#62;
&#60;LinearLayout xmlns:android=&#8220;http://schemas.android.com/apk/res/android&#8221;
android:orientation=&#8220;vertical&#8221;
android:layout_width=&#8220;fill_parent&#8221;
android:layout_height=&#8220;fill_parent&#8221;
&#62;
&#60;TextView
android:layout_width=&#8220;fill_parent&#8221;
android:layout_height=&#8220;wrap_content&#8221;
android:text=&#8220;You textview&#8221;
/&#62;
&#60;ListView
android:id=&#8220;@android:id/list&#8221;
android:layout_width=&#8220;fill_parent&#8221;
android:layout_weight=&#8220;1&#8243;
android:layout_height=&#8220;wrap_content&#8221; /&#62;
&#60;TextView
android:layout_width=&#8220;fill_parent&#8221;
android:layout_height=&#8220;wrap_content&#8221;
android:layout_gravity=&#8220;bottom&#8221;
android:text=&#8220;Another textview but now beneath the ListView&#8221;
/&#62;
&#60;/LinearLayout&#62;
]]></description>
			<content:encoded><![CDATA[<div class="xml" style="font-family: monospace;"><span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=<span class="st0">&#8220;1.0&#8243;</span> <span class="re0">encoding</span>=<span class="st0">&#8220;utf-8&#8243;</span><span class="re2">?&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;LinearLayout</span> <span class="re0">xmlns:android</span>=<span class="st0">&#8220;http://schemas.android.com/apk/res/android&#8221;</span><br />
<span class="re0">android:orientation</span>=<span class="st0">&#8220;vertical&#8221;</span><br />
<span class="re0">android:layout_width</span>=<span class="st0">&#8220;fill_parent&#8221;</span><br />
<span class="re0">android:layout_height</span>=<span class="st0">&#8220;fill_parent&#8221;</span><br />
<span class="re2">&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;TextView</span><br />
<span class="re0">android:layout_width</span>=<span class="st0">&#8220;fill_parent&#8221;</span><br />
<span class="re0">android:layout_height</span>=<span class="st0">&#8220;wrap_content&#8221;</span><br />
<span class="re0">android:text</span>=<span class="st0">&#8220;You textview&#8221;</span><br />
<span class="re2">/&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;ListView</span><br />
<span class="re0">android:id</span>=<span class="st0">&#8220;@android:id/list&#8221;</span><br />
<span class="re0">android:layout_width</span>=<span class="st0">&#8220;fill_parent&#8221;</span><br />
<span class="re0">android:layout_weight</span>=<span class="st0">&#8220;1&#8243;</span><br />
<span class="re0">android:layout_height</span>=<span class="st0">&#8220;wrap_content&#8221;</span> <span class="re2">/&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;TextView</span><br />
<span class="re0">android:layout_width</span>=<span class="st0">&#8220;fill_parent&#8221;</span><br />
<span class="re0">android:layout_height</span>=<span class="st0">&#8220;wrap_content&#8221;</span><br />
<span class="re0">android:layout_gravity</span>=<span class="st0">&#8220;bottom&#8221;</span><br />
<span class="re0">android:text</span>=<span class="st0">&#8220;Another textview but now beneath the ListView&#8221;</span><br />
<span class="re2">/&gt;</span></span></p>
<p><span class="sc3"><span class="re1">&lt;/LinearLayout<span class="re2">&gt;</span></span></span></div>
]]></content:encoded>
			<wfw:commentRss>http://ventrix.nsdc.gr/code_folds/?feed=rss2&amp;p=122</wfw:commentRss>
		</item>
		<item>
		<title>How to sort an ArrayList in Java</title>
		<link>http://ventrix.nsdc.gr/code_folds/?p=119</link>
		<comments>http://ventrix.nsdc.gr/code_folds/?p=119#comments</comments>
		<pubDate>Tue, 22 Sep 2009 20:55:10 +0000</pubDate>
		<dc:creator>ventrix</dc:creator>
		
		<category><![CDATA[android]]></category>

		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://ventrix.nsdc.gr/code_folds/?p=119</guid>
		<description><![CDATA[Example:
Class Test {
public String name;
public String sirName;
}
ArrayList&#60;Test&#62; res = new ArrayList&#60;Test&#62;();
res.add(&#8230;);
res.add(&#8230;);
Comparator&#60;Test&#62; comperator = new Comparator&#60;Test&#62;() {
@Override
public int compare(Test object1, Test object2) {
return object1.name.compareToIgnoreCase(object2.name);
}
};
Collections.sort(res, comperator);
the list is now sorted by name.
 
]]></description>
			<content:encoded><![CDATA[<p>Example:</p>
<p>Class Test {</p>
<p>public String name;</p>
<p>public String sirName;</p>
<p>}</p>
<p>ArrayList&lt;Test&gt; res = new ArrayList&lt;Test&gt;();</p>
<p>res.add(&#8230;);</p>
<p>res.add(&#8230;);</p>
<p>Comparator&lt;Test&gt; comperator = new Comparator&lt;Test&gt;() {</p>
<p>@Override<br />
public int compare(Test object1, Test object2) {<br />
return object1.name.compareToIgnoreCase(object2.name);<br />
}</p>
<p>};<br />
Collections.sort(res, comperator);</p>
<p>the list is now sorted by name.</p>
<p> <img src='http://ventrix.nsdc.gr/code_folds/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://ventrix.nsdc.gr/code_folds/?feed=rss2&amp;p=119</wfw:commentRss>
		</item>
		<item>
		<title>Android Keep Screen on</title>
		<link>http://ventrix.nsdc.gr/code_folds/?p=117</link>
		<comments>http://ventrix.nsdc.gr/code_folds/?p=117#comments</comments>
		<pubDate>Sun, 20 Sep 2009 11:47:58 +0000</pubDate>
		<dc:creator>ventrix</dc:creator>
		
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://ventrix.nsdc.gr/code_folds/?p=117</guid>
		<description><![CDATA[You do not need the PowerManager.
Just call: View.setKeepScreenOn
http://developer.android.com/reference/android/view/View.html#setKeepScreenOn(boolean)
]]></description>
			<content:encoded><![CDATA[<p>You do not need the PowerManager.</p>
<p>Just call: View.setKeepScreenOn</p>
<p>http://developer.android.com/reference/android/view/View.html#setKeepScreenOn(boolean)</p>
]]></content:encoded>
			<wfw:commentRss>http://ventrix.nsdc.gr/code_folds/?feed=rss2&amp;p=117</wfw:commentRss>
		</item>
		<item>
		<title>Android ListView Autoscroll</title>
		<link>http://ventrix.nsdc.gr/code_folds/?p=112</link>
		<comments>http://ventrix.nsdc.gr/code_folds/?p=112#comments</comments>
		<pubDate>Tue, 12 May 2009 10:08:29 +0000</pubDate>
		<dc:creator>ventrix</dc:creator>
		
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://ventrix.nsdc.gr/code_folds/?p=112</guid>
		<description><![CDATA[If you are adding items in a listview and you want to autoscroll down, then you should call the
getListView().setSelection(NumberOfItems);
]]></description>
			<content:encoded><![CDATA[<p>If you are adding items in a listview and you want to autoscroll down, then you should call the</p>
<p><strong>getListView().setSelection(NumberOfItems);</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://ventrix.nsdc.gr/code_folds/?feed=rss2&amp;p=112</wfw:commentRss>
		</item>
		<item>
		<title>Jakarta Commons StringUtils</title>
		<link>http://ventrix.nsdc.gr/code_folds/?p=110</link>
		<comments>http://ventrix.nsdc.gr/code_folds/?p=110#comments</comments>
		<pubDate>Fri, 13 Feb 2009 16:22:55 +0000</pubDate>
		<dc:creator>ventrix</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ventrix.nsdc.gr/code_folds/?p=110</guid>
		<description><![CDATA[Jakarta Commons StringUtils source code

]]></description>
			<content:encoded><![CDATA[<p><a title="Jakarta Commons StringUtils" href="http://www.koders.com/java/fidB29436EC634995BA0A41C5DC97C3F97F549D54B9.aspx" target="_blank">Jakarta Commons StringUtils source code<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ventrix.nsdc.gr/code_folds/?feed=rss2&amp;p=110</wfw:commentRss>
		</item>
		<item>
		<title>php string contains</title>
		<link>http://ventrix.nsdc.gr/code_folds/?p=108</link>
		<comments>http://ventrix.nsdc.gr/code_folds/?p=108#comments</comments>
		<pubDate>Thu, 12 Feb 2009 20:54:29 +0000</pubDate>
		<dc:creator>ventrix</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ventrix.nsdc.gr/code_folds/?p=108</guid>
		<description><![CDATA[$text = &#8220;this is a happy cow&#8221;;
$a = &#8220;happy&#8221;;
if (strlen(strstr($text,$a))&#62;0) {
echo &#8220;contained&#8221;;
} else {
echo &#8220;not contained&#8221;;
}
]]></description>
			<content:encoded><![CDATA[<p>$text = &#8220;this is a happy cow&#8221;;<br />
$a = &#8220;happy&#8221;;</p>
<p>if (strlen(strstr($text,$a))&gt;0) {<br />
echo &#8220;contained&#8221;;<br />
} else {<br />
echo &#8220;not contained&#8221;;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://ventrix.nsdc.gr/code_folds/?feed=rss2&amp;p=108</wfw:commentRss>
		</item>
		<item>
		<title>Read all the raw data posted in a php script</title>
		<link>http://ventrix.nsdc.gr/code_folds/?p=104</link>
		<comments>http://ventrix.nsdc.gr/code_folds/?p=104#comments</comments>
		<pubDate>Wed, 04 Feb 2009 14:08:33 +0000</pubDate>
		<dc:creator>ventrix</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[post]]></category>

		<guid isPermaLink="false">http://ventrix.nsdc.gr/code_folds/?p=104</guid>
		<description><![CDATA[Read all the raw data posted in a php script
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
   $str = trim(file_get_contents('php://input'));
}
]]></description>
			<content:encoded><![CDATA[<p>Read all the raw data posted in a php script</p>
<pre name="code" class="php">if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
   $str = trim(file_get_contents('php://input'));
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://ventrix.nsdc.gr/code_folds/?feed=rss2&amp;p=104</wfw:commentRss>
		</item>
		<item>
		<title>Java socket timeout</title>
		<link>http://ventrix.nsdc.gr/code_folds/?p=101</link>
		<comments>http://ventrix.nsdc.gr/code_folds/?p=101#comments</comments>
		<pubDate>Fri, 30 Jan 2009 17:42:54 +0000</pubDate>
		<dc:creator>ventrix</dc:creator>
		
		<category><![CDATA[android]]></category>

		<category><![CDATA[j2ee]]></category>

		<category><![CDATA[j2me]]></category>

		<category><![CDATA[j2se]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[socket timeout]]></category>

		<guid isPermaLink="false">http://ventrix.nsdc.gr/code_folds/?p=101</guid>
		<description><![CDATA[
private String socketIP="192.168.1.1";
private int socketPort=2424;
private int timeout=5000; //5 seconds

Socket socket1 = new Socket();
socket1.connect(new InetSocketAddress(this.socketIP, this.socketPort), timeout);
//or else
Socket socket1 = new Socket();
socket1.connect(new InetSocketAddress(this.socketIP, this.socketPort));
socket1.setSoTimeout(timeout);

http://java.sun.com/j2se/1.4.2/docs/api/java/net/Socket.html
]]></description>
			<content:encoded><![CDATA[<pre name="code" class="java">
private String socketIP="192.168.1.1";
private int socketPort=2424;
private int timeout=5000; //5 seconds

Socket socket1 = new Socket();
socket1.connect(new InetSocketAddress(this.socketIP, this.socketPort), timeout);
//or else
Socket socket1 = new Socket();
socket1.connect(new InetSocketAddress(this.socketIP, this.socketPort));
socket1.setSoTimeout(timeout);
</pre>
<p><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/net/Socket.html">http://java.sun.com/j2se/1.4.2/docs/api/java/net/Socket.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ventrix.nsdc.gr/code_folds/?feed=rss2&amp;p=101</wfw:commentRss>
		</item>
	</channel>
</rss>
