<?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>SlickDev</title>
	<atom:link href="http://www.slickdev.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.slickdev.com</link>
	<description>Freelance Web and Software Developer</description>
	<lastBuildDate>Sat, 15 May 2010 02:27:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Special Character Encoding in XML</title>
		<link>http://www.slickdev.com/2010/02/13/special_character_encoding_in_xml/</link>
		<comments>http://www.slickdev.com/2010/02/13/special_character_encoding_in_xml/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 02:36:16 +0000</pubDate>
		<dc:creator>Chaoz</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.slickdev.com/?p=121</guid>
		<description><![CDATA[Ran into a problem returning an XML data with special characters encoded into it through an AJAX call. The problem was that special characters (i.e. &#38;ntilde; -> &#241;) throws an error when being returned through XML and is in the process of being parsed by the browser. The catch? XML does not support named entities [...]]]></description>
			<content:encoded><![CDATA[<p>Ran into a problem returning an XML data with special characters encoded into it through an AJAX call. The problem was that special characters (i.e. &amp;ntilde; -> &ntilde;) throws an error when being returned through XML and is in the process of being parsed by the browser. </p>
<p>The catch?<br />
XML does not support <em>named entities</em> by default, you have to declare it before hand. Only <strong>&amp;lt; &amp;gt; &amp;amp; &amp;quot;</strong> and <strong>&amp;apos;</strong>  are predefined.</p>
<p>Something like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE xsl:stylesheet [ &lt;!ENTITY nbsp &quot;&amp;#160;&quot;&gt;</span> ]&gt;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:stylesheet</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/XSL/Transform&quot;</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></td></tr></table></div>

<p>Got this from <a href="http://www.dpawson.co.uk/xsl/sect2/nbsp.html">here&#8230;</a></p>
<p>The fix&#8230;<br />
Instead of using named entities in the XML (I think this also affects JSON, I could be wrong since I didn&#8217;t test this is JSON) like &amp;ntilde;, use character references to support special character encoding.</p>
<p>Example:<br />
white space = &amp;nbsp; = &amp;#160;<br />
&ntilde; = &amp;ntilde; = &amp;#241;</p>
<p>they are all the same&#8230; #160 is referenced/mapped to &#8221; &#8221; and #241 is referenced/mapped to &ntilde;</p>
<p>So when forming your XML before returning it through an AJAX call, form the special characters via character reference.</p>
<p>Hope this helps you out there having this problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slickdev.com/2010/02/13/special_character_encoding_in_xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java IO Problem in Tomcat</title>
		<link>http://www.slickdev.com/2010/02/13/java-io-problem-in-tomcat/</link>
		<comments>http://www.slickdev.com/2010/02/13/java-io-problem-in-tomcat/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 02:05:23 +0000</pubDate>
		<dc:creator>Chaoz</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.slickdev.com/?p=117</guid>
		<description><![CDATA[Encountered this problem today while testing an image upload AJAX script in tomcat. Later on I found out that the folder is actually protected Win7 and tomcat couldn&#8217;t write the cache or temporary file into the folder. So anyone having this problem, check the following&#8230; What OS are you running? Vista/Win7? What IDE are you [...]]]></description>
			<content:encoded><![CDATA[<p>Encountered this problem today while testing an image upload AJAX script in tomcat. Later on I found out that the folder is actually protected Win7 and tomcat couldn&#8217;t write the cache or temporary file into the folder.</p>
<p>So anyone having this problem, check the following&#8230;</p>
<ul>
<li>What OS are you running? Vista/Win7?</li>
<li>What IDE are you using?</li>
<li>Was your IDE elevated to admin status?</li>
</ul>
<p>So, check your OS, I&#8217;m using Win7. I was developing this under WinXP a few months back, and now under Win7, the folder is protected since it was under the &#8220;Program Files (x86)&#8221; folder group. (Argh!)<br />
I closed my IDE, using IDEA IntelliJ 9.0, ran the IDE under <strong>&#8220;Administrator Level&#8221;</strong> and the problem disappeared!</p>
<p>So check those out first.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slickdev.com/2010/02/13/java-io-problem-in-tomcat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Analytics with Flash Actionscript 2</title>
		<link>http://www.slickdev.com/2009/12/03/google-analytics-with-flash-actionscript-2/</link>
		<comments>http://www.slickdev.com/2009/12/03/google-analytics-with-flash-actionscript-2/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 09:00:42 +0000</pubDate>
		<dc:creator>Chaoz</dc:creator>
				<category><![CDATA[Code Library]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.slickdev.com/?p=106</guid>
		<description><![CDATA[A little background info, Google Analytics is a free service provided by google to track site statistics, page visits, unique visitors, most visited page, etc. Now I have been working around with flash actionscript 2 for a few months now and last week I was trying to connect to google analytics using flash actionscript 2, [...]]]></description>
			<content:encoded><![CDATA[<p>A little background info, Google Analytics is a free service provided by google to track site statistics, page visits, unique visitors, most visited page, etc. </p>
<p>Now I have been working around with flash actionscript 2 for a few months now and last week I was trying to connect to google analytics using flash actionscript 2, I know there&#8217;s already Actionscript 3 but its AS2 that was required for the project <img src='http://www.slickdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  After a few days of trial and error, finally got the stupid code to work, my initial code was not able to properly remove the white spaces from the returned IDs sent by Google. Weird thing is as I googled around the web, people seem to have a problem logging in and authenticating google AuthID through flash AS2 and AS3. As I understand it, there was supposed to be no way of authenticating the AuthID unless google add an option in their crossdomain.xml.</p>
<p>Well&#8230; seems like I was able to login and authenticate using the google account&#8217;s AuthID and retrieve my Profile list as well as used the profile data to retrieve the analytics data from my account =)</p>
<p>Codes are shown below on how I was able to login and authenticate the AuthID. One note, ALWAYS remove the white spaces (\r and \n) that was returned after initial login process (email &#038; pass).</p>
<p>Note this is just a proof of concept and I didn&#8217;t do any clean-up,etc&#8230;<br />
This will also work with Actionscript 3&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> authId<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;&quot;</span>;
gProfile = <span style="color: #0033ff; font-weight: bold;">new</span> LoadVars<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
gData = <span style="color: #0033ff; font-weight: bold;">new</span> LoadVars<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
gLogin = <span style="color: #0033ff; font-weight: bold;">new</span> LoadVars<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
gLogin.Email = <span style="color: #990000;">&quot;yourgoogleaccount@email.com.here&quot;</span>;
gLogin.Passwd = <span style="color: #990000;">&quot;password goes here&quot;</span>;
gLogin.service = <span style="color: #990000;">&quot;analytics&quot;</span>; <span style="color: #009900;">// what service your accessing, analytics for google analytics, mail for gmail, and so on...</span>
gLogin.accountType = <span style="color: #990000;">&quot;GOOGLE&quot;</span>; <span style="color: #009900;">// this should be default to GOOGLE</span>
gLogin.<span style="color: #004993;">source</span> = <span style="color: #990000;">&quot;proj-name-0.1&quot;</span>; <span style="color: #009900;">// anything goes heres, just a string for your proj</span>
&nbsp;
gLogin.onLoad = <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span>success<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>success<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        logs.<span style="color: #004993;">text</span> <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;<span style="">\r</span>yay!&quot;</span>;
&nbsp;
    <span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
        logs.<span style="color: #004993;">text</span> <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;<span style="">\r</span>try again&quot;</span>;    
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900;">//header content type should be of application urlencoded form</span>
headers = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;Content-Type&quot;</span>, <span style="color: #990000;">&quot;application/x-www-form-urlencoded&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
gLogin.onHTTPStatus = <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">httpStatus</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
       logs.<span style="color: #004993;">text</span> <span style="color: #000000; font-weight: bold;">+</span>=  <span style="color: #990000;">&quot;<span style="">\r</span>&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #004993;">httpStatus</span>;
    <span style="color: #000000;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #009900;">//address where to login using the username and pass</span>
gLogin.sendAndLoad<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;https://www.google.com/accounts/ClientLogin&quot;</span>, gLogin, <span style="color: #990000;">&quot;POST&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> myAuthID<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
&nbsp;
gLogin.onData = <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span>ret<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>	
	<span style="color: #6699cc; font-weight: bold;">var</span> auth<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span> = ret.<span style="color: #004993;">split</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Auth=&quot;</span><span style="color: #000000;">&#41;</span>;
	authId = auth<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>;	
	authId = authId.<span style="color: #004993;">split</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">'<span style="">\n</span>'</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">join</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">''</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> auth<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;GoogleLogin auth=&quot;</span> <span style="color: #000000; font-weight: bold;">+</span>  authId;
	logs.<span style="color: #004993;">text</span> <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;<span style="">\r</span>&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> auth;
	myAuthID = authId;
&nbsp;
	<span style="color: #009900;">//for the authentication and profile retrieval, add the &quot;Authorization&quot; header and the google login authid we received </span>
	<span style="color: #009900;">// from google after logging in a few seconds ago. We also add X-HTTP-Method-Override with a value of &quot;GET&quot; to force</span>
	<span style="color: #009900;">// the server to accept our data as GET insted of POST method, if we don't do this, the Authorization fails.</span>
	gProfile.addRequestHeader<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;X-HTTP-Method-Override&quot;</span>, <span style="color: #990000;">&quot;GET&quot;</span>, <span style="color: #990000;">&quot;Authorization&quot;</span>, <span style="color: #990000;">&quot;GoogleLogin auth=&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> authId<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #009900;">//debugging trace of the customer headers</span>
	<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;_customHeaders = &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> gProfile._customHeaders<span style="color: #000000;">&#41;</span>;		
&nbsp;
	<span style="color: #009900;">//authorization and profile retrieval address</span>
	gProfile.sendAndLoad<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;https://www.google.com/analytics/feeds/accounts/default&quot;</span>, gProfile, <span style="color: #990000;">&quot;POST&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #004993;">String</span>.<span style="color: #004993;">prototype</span>.<span style="color: #004993;">replace</span> = <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span>searchStr, replaceStr<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> <span style="color: #000000;">&#123;</span>	
    <span style="color: #6699cc; font-weight: bold;">var</span> arr<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span> = <span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">split</span><span style="color: #000000;">&#40;</span>searchStr<span style="color: #000000;">&#41;</span>;
    <span style="color: #0033ff; font-weight: bold;">return</span> arr.<span style="color: #004993;">join</span><span style="color: #000000;">&#40;</span>replaceStr<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>;
&nbsp;
gProfile.onData = <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span>ret<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;-----&gt;&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> ret<span style="color: #000000;">&#41;</span>;
	<span style="color: #009900;">//everytime you retrieve data/profile from google analytics, always add the Authorization header as this will </span>
	<span style="color: #009900;">// be used to authenticate your account.	</span>
	gData.addRequestHeader<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;X-HTTP-Method-Override&quot;</span>, <span style="color: #990000;">&quot;GET&quot;</span>, <span style="color: #990000;">&quot;Authorization&quot;</span>, <span style="color: #990000;">&quot;GoogleLogin auth=&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> myAuthID<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;_customHeaders = &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> gData._customHeaders<span style="color: #000000;">&#41;</span>;		
&nbsp;
	<span style="color: #009900;">//here is the string to query analytics data from a certain project, ids is the table/proj id to retrieve the metrics</span>
	<span style="color: #009900;">// you can read more from analytics developer api docs on how to manipulate your data retrieval...</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> str<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;&amp;ids=ga:1234567&amp;dimensions=ga:source,ga:medium&amp;metrics=ga:visits,ga:pageviews&quot;</span>;
	gData.sendAndLoad<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;https://www.google.com/analytics/feeds/data?start-date=2009-10-01&amp;end-date=2009-10-31&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> str, gData, <span style="color: #990000;">&quot;POST&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
gData.onData = <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #000000;">&#40;</span>ret<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
&nbsp;
	<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;======&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> ret <span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
gProfile.onHTTPStatus = <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">httpStatus</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
       logs.<span style="color: #004993;">text</span> <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #990000;">&quot;<span style="">\r</span>&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #004993;">httpStatus</span> ;
    <span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Any suggestions and comments are very welcome.</p>
<p><strong>Update:</strong> I&#8217;d like to add that this only works on your local machine, if you upload this to a live server or website, you will need a <strong><em>crossdomain.xml</em></strong> from www.google.com to allow your site.</p>
<p><strong>Sources:</strong><br />
<a href="http://meidell.dk/archives/2005/12/30/http-authentication-with-flash/">http://meidell.dk/archives/2005/12/30/http-authentication-with-flash/</a><br />
<a href="http://code.google.com/p/ga-api-http-samples/source/browse/trunk/src/v2/accountFeed.sh">http://code.google.com/p/ga-api-http-samples/source/browse/trunk/src/v2/accountFeed.sh</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.slickdev.com/2009/12/03/google-analytics-with-flash-actionscript-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Updates to come&#8230;</title>
		<link>http://www.slickdev.com/2009/11/29/updates-to-come/</link>
		<comments>http://www.slickdev.com/2009/11/29/updates-to-come/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 09:35:30 +0000</pubDate>
		<dc:creator>Chaoz</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.slickdev.com/?p=104</guid>
		<description><![CDATA[Been busy around.. but a little heads-up, I&#8217;ll be posting and update to installing tomcat and java to Ubuntu 9.10 since I&#8217;m &#8220;forced&#8221; to upgrade now lol&#8230; also I&#8217;ll be posting a tutorial on how to login-authenticate and query google Analytics using flash AS2, which I think some of you there are also having some [...]]]></description>
			<content:encoded><![CDATA[<p>Been busy around.. but a little heads-up, I&#8217;ll be posting and update to installing tomcat and java to Ubuntu 9.10 since I&#8217;m &#8220;forced&#8221; to upgrade now lol&#8230; also I&#8217;ll be posting a tutorial on how to login-authenticate and query google Analytics using flash AS2, which I think some of you there are also having some problems <img src='http://www.slickdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.slickdev.com/2009/11/29/updates-to-come/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weird turn of events&#8230;</title>
		<link>http://www.slickdev.com/2009/11/17/weird-turn-of-events/</link>
		<comments>http://www.slickdev.com/2009/11/17/weird-turn-of-events/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 04:53:35 +0000</pubDate>
		<dc:creator>Chaoz</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.slickdev.com/?p=102</guid>
		<description><![CDATA[I&#8217;m now developing in flash actionscript 2&#8230;. ok from one language to the other&#8230;.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m now developing in flash actionscript 2&#8230;. ok from one language to the other&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slickdev.com/2009/11/17/weird-turn-of-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java JNI: Unsatisfied Link Error in Library Path</title>
		<link>http://www.slickdev.com/2009/05/05/java-jni-unsatisfied-link-error-in-library-path/</link>
		<comments>http://www.slickdev.com/2009/05/05/java-jni-unsatisfied-link-error-in-library-path/#comments</comments>
		<pubDate>Tue, 05 May 2009 08:29:06 +0000</pubDate>
		<dc:creator>Chaoz</dc:creator>
				<category><![CDATA[Code Library]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://www.slickdev.com/?p=88</guid>
		<description><![CDATA[I&#8217;m currently playing around with Java Native Interfaces(JNI) and I must say its been too long since I programmed in Java. Its good to be back! Anyway, lets hop to the main topic&#8230; I was following the tutorial from Sun in creating my first JNI and calling my compiled C++ library, I was stuck in [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently playing around with Java Native Interfaces(JNI) and I must say its been too long since I programmed in Java. Its good to be back! Anyway, lets hop to the main topic&#8230;</p>
<p>I was following the tutorial from Sun in creating my first JNI and calling my compiled C++ library, I was stuck in the last part where this error popped out whenever I tried to invoke</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">java HelloWorld</pre></div></div>

<p>the error was&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">java.lang.UnsatisfiedLinkError: no HelloWorld <span style="color: #000000; font-weight: bold;">in</span> java.library.path
          at java.lang.ClassLoader.loadLibrary<span style="color: #7a0874; font-weight: bold;">&#40;</span>ClassLoader.java:<span style="color: #000000;">1709</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
          at java.lang.Runtime.loadLibrary0<span style="color: #7a0874; font-weight: bold;">&#40;</span>Runtime.java:<span style="color: #000000;">823</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
          at java.lang.System.loadLibrary<span style="color: #7a0874; font-weight: bold;">&#40;</span>System.java:<span style="color: #000000;">1030</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
          at HelloWorld.<span style="color: #000000; font-weight: bold;">&lt;</span>clinit<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>HelloWorld.java:<span style="color: #000000; font-weight: bold;">&lt;</span>line number<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
Could not <span style="color: #c20cb9; font-weight: bold;">find</span> the main class: HelloWorld. Program will exit.</pre></div></div>

<p>one way of fixing this is to include the current location of your newly compiled shared library (ex. HelloWorld.so). I&#8217;m using Ubuntu linux,so to include the current folder where your &#8220;.so&#8221; file is located, invoke&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">LD_LIBRARY_PATH</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">pwd</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">export</span> LD_LIBRARY_PATH</pre></div></div>

<p>or you can also do &#8230;<br />
<span id="more-88"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">LD_LIBRARY_PATH</span>=.
<span style="color: #7a0874; font-weight: bold;">export</span> LD_LIBRARY_PATH</pre></div></div>

<p>another way is to define the location when running the program&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">java -Djava.library.path=. HelloWorld</pre></div></div>

<p>this will instruct java to locate the native library in the current location. Now call your program again and this time it work execute your native program.</p>
<p>It&#8217;s possible that when you execute your program after doing the above steps, another error will come out. This happened to me and the culprit was when I compiled the cpp file. The error would look something like&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">java.lang.UnsatisfiedLinkError: <span style="color: #000000; font-weight: bold;">&lt;</span>library location<span style="color: #000000; font-weight: bold;">&gt;</span>: <span style="color: #000000; font-weight: bold;">&lt;</span>library location<span style="color: #000000; font-weight: bold;">&gt;</span>: only ET_DYN and ET_EXEC can be loaded
        at java.lang.ClassLoader<span style="color: #007800;">$NativeLibrary</span>.load<span style="color: #7a0874; font-weight: bold;">&#40;</span>Native Method<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        at java.lang.ClassLoader.loadLibrary0<span style="color: #7a0874; font-weight: bold;">&#40;</span>ClassLoader.java:<span style="color: #000000;">1778</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        at java.lang.ClassLoader.loadLibrary<span style="color: #7a0874; font-weight: bold;">&#40;</span>ClassLoader.java:<span style="color: #000000;">1674</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        at java.lang.Runtime.load0<span style="color: #7a0874; font-weight: bold;">&#40;</span>Runtime.java:<span style="color: #000000;">770</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        at java.lang.System.load<span style="color: #7a0874; font-weight: bold;">&#40;</span>System.java:<span style="color: #000000;">1005</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        at HelloWorld.<span style="color: #000000; font-weight: bold;">&lt;</span>clinit<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>HelloWorld.java:<span style="color: #000000;">16</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>to fix this, include the &#8220;-shared&#8221; option when compiling the cpp file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">g++</span> <span style="color: #660033;">-shared</span> HelloWorld.cpp <span style="color: #660033;">-o</span> HelloWorld.so <span style="color: #660033;">-I</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>folder<span style="color: #000000; font-weight: bold;">/</span>where<span style="color: #000000; font-weight: bold;">/</span>jni.h<span style="color: #000000; font-weight: bold;">/</span>is<span style="color: #000000; font-weight: bold;">/</span>located <span style="color: #660033;">-I</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>linux<span style="color: #000000; font-weight: bold;">/</span>folder<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Do not include the &#8220;-c&#8221; option, this will skip the linking stage.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slickdev.com/2009/05/05/java-jni-unsatisfied-link-error-in-library-path/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Overdue Post&#8230;</title>
		<link>http://www.slickdev.com/2009/02/27/overdue-post/</link>
		<comments>http://www.slickdev.com/2009/02/27/overdue-post/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 01:53:06 +0000</pubDate>
		<dc:creator>Chaoz</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.slickdev.com/?p=85</guid>
		<description><![CDATA[Seems like I got caught up with my work again, ah well que sera sera&#8230; I&#8217;ll be posting some new stuffs later on, one will be mysql replication through SSH tunneling and the other are tips on extjs javascript framework I have been using for over 2 years now. Should have done this a looooong [...]]]></description>
			<content:encoded><![CDATA[<p>Seems like I got caught up with my work again, ah well que sera sera&#8230; I&#8217;ll be posting some new stuffs later on, one will be mysql replication through SSH tunneling and the other are tips on extjs javascript framework I have been using for over 2 years now. Should have done this a looooong time ago. </p>
<p>Stay tune <img src='http://www.slickdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.slickdev.com/2009/02/27/overdue-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Explorer Restarting Virus/Trojan</title>
		<link>http://www.slickdev.com/2008/12/09/continuous-explorer-restarting-virustrojan/</link>
		<comments>http://www.slickdev.com/2008/12/09/continuous-explorer-restarting-virustrojan/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 03:56:35 +0000</pubDate>
		<dc:creator>Chaoz</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://www.slickdev.com/?p=76</guid>
		<description><![CDATA[Came across this little bugger in my manager&#8217;s pc. The whole thing is that after logging into windows, the windows explorer continuously restart and exits. You can click the start button, open something but will naturally kill itself when explorer exits. You can&#8217;t even open the drives and folders normally since it will close sooner [...]]]></description>
			<content:encoded><![CDATA[<p>Came across this little bugger in my manager&#8217;s pc. The whole thing is that after logging into windows, the windows explorer continuously restart and exits. You can click the start button, open something but will naturally kill itself when explorer exits. You can&#8217;t even open the drives and folders normally since it will close sooner or later, anything running under Explorer.exe will die when Explorer.exe dies. Simplest way around the folder and drives is using the good ol&#8217; command prompt. Did this and amazingly it didn&#8217;t die, thank God for command prompts. As usual scouring the RECYCLER folder for hidden trojans resulted in a no show, next was the usual system32 and system folder under windows folder. These little buggers get smarter everyday. There weren&#8217;t and hidden files so I was already assuming the exe file is there and ran through windows startup using the registry. Using autoruns from sysinternals, found one of the problems, a rogue exe is started everytime the system starts. Deleted the entry from the registry, located the file under system32 folder and also removed it. </p>
<p>That didn&#8217;t fixed the problem.</p>
<p>There was something else running when windows starts up. Next target&#8230; DLLs. Amazingly, there were dlls that was out-of-placed and curiously named. Example crypt32.dll that wasn&#8217;t signed by microsoft. Removed the entry and tried to remove the dll. No luck, its being used. Next tool that was very useful was Unlocker. I &#8216;unlocked&#8217; the hook for the dll and restarted. Still didn&#8217;t fix it but I was getting close. There were two more dlls I found that was very suspicious. I tried to kill one and removed, the other regenerated the dll. I try to unhook the other dll, the whole pc restarts. Smart bugger. Thank goodness for safe mode. Restarted in safe mode and use unlocker again to unhook the dll. Removed one of the dll and its entry in the registry. Good&#8230; it didn&#8217;t restart&#8230; just a countdown for a system shutdown.. freaking dll.</p>
<p>The system restarted and good news is the dll that forced the shutdown wasn&#8217;t regenerated. Last dll was a bit simpler. Used unlocker to unhook the dll, deleting was not successful, though unlocker had a feature to delete the dll after a restart. Selected the option and waited. Thankfully, the whole ordeal ended there. All three dlls didn&#8217;t regenerate after that. </p>
<p>Note to PC users who watch videos from torrent ( Heroes, Prison break&#8230;). If it asks you to download a player to run the video you downloaded.. DON&#8217;T!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slickdev.com/2008/12/09/continuous-explorer-restarting-virustrojan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slow update&#8230;</title>
		<link>http://www.slickdev.com/2008/11/27/slow-update/</link>
		<comments>http://www.slickdev.com/2008/11/27/slow-update/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 02:43:54 +0000</pubDate>
		<dc:creator>Chaoz</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.slickdev.com/?p=72</guid>
		<description><![CDATA[Well, its been a month&#8230; or more? of no updates&#8230; been busy for a while cleaning codes and installing some pcs. I was thinking of posting those extjs codes I used that gave me some &#8216;wtf?!&#8217; or &#8216;doh!&#8217; moments in the past&#8230;.we&#8217;ll see. I&#8217;m also currently compiling the documentations on how I set up a [...]]]></description>
			<content:encoded><![CDATA[<p>Well, its been a month&#8230; or more? of no updates&#8230; been busy for a while cleaning codes and installing some pcs. I was thinking of posting those extjs codes I used that gave me some &#8216;wtf?!&#8217; or &#8216;doh!&#8217; moments in the past&#8230;.we&#8217;ll see. I&#8217;m also currently compiling the documentations on how I set up a replication master-slaver server on 3 different locations and replicate through SSH. I&#8217;ll be posting that later on also.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slickdev.com/2008/11/27/slow-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Slave Failed to Open the Relay Log</title>
		<link>http://www.slickdev.com/2008/10/20/mysql-slave-failed-to-open-the-relay-log/</link>
		<comments>http://www.slickdev.com/2008/10/20/mysql-slave-failed-to-open-the-relay-log/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 14:53:32 +0000</pubDate>
		<dc:creator>Chaoz</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.slickdev.com/?p=68</guid>
		<description><![CDATA[This problem is a little tricky, there are possible fixes that MySQL website has stated. Sad to say, the one&#8217;s I read in the forum and site didn&#8217;t fix my problem. What I encountered was that the relay-bin from my MySQL slave server has already been &#8216;rotated&#8217;, meaning deleted from the folder. This happens when [...]]]></description>
			<content:encoded><![CDATA[<p>This problem is a little tricky, there are possible fixes that MySQL website has stated. Sad to say, the one&#8217;s I read in the forum and site didn&#8217;t fix my problem. What I encountered was that the relay-bin from my MySQL  slave server has already been &#8216;rotated&#8217;, meaning <em>deleted</em> from the folder. This happens when the slave has been disconnected from the master for quite a long time already and has not replicated anything. A simple way to fix this is to flush the logs, but make sure the slave is stopped before using this command&#8230;</p>
<p><code>FLUSH LOGS;</code></p>
<p>Bring in a fresh copy of the database from the master-server and update the slave-server database. THIS IS IMPORTANT! Since if you don&#8217;t update the slave database, you will not have the data from the time you were disconnected until you reset the relay logs. So UPDATE YOUR SLAVE WITH THE LATEST DATABASE FROM THE MASTER!</p>
<p>Now when the logs are flushed,all the relay-bin logs will be deleted when the slave is started again. Usually, this fixes the problem, but when you start the slave and the failed relay log error is still there, now you have to do some more desperate measures&#8230; reset the slave. This is what I had to do to fully restore my MySQL slave server. Reseting the slaves restores all the settings to default&#8230; password, username, relay-log, port, table to replicate, etc&#8230; So better to have a copy of your settings first before actually do a slave reset. When your ready to rest the slave, do the command&#8230;</p>
<p><code>RESET SLAVE;</code></p>
<p>after which you should restore all your setting with a command something like&#8230;</p>
<p><code>CHANGE MASTER TO MASTER_HOST=.....</code></p>
<p>now start your server with&#8230;</p>
<p><code>SLAVE START;</code></p>
<p>check your slave server with&#8230;</p>
<p><code>SHOW SLAVE STATUS\G</code></p>
<p>look for &#8230;</p>
<p><code>Slave_IO_Running: Yes<br />
Slave_SQL_Running: Yes</code></p>
<p>both should be <strong>YES</strong>, if not, check your syslog if there are other errors encountered. I&#8217;ll leave this until here since this is what I encountered and I was able to fix it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slickdev.com/2008/10/20/mysql-slave-failed-to-open-the-relay-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
