<?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>Tara Andrei</title>
	<atom:link href="http://andreitara.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://andreitara.com</link>
	<description>I could change the world if they would let my allocate more instances of myself.</description>
	<lastBuildDate>Mon, 13 Jun 2011 21:32:54 +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>Perform face detection in PHP</title>
		<link>http://andreitara.com/2011/06/perform-face-detection-in-php/</link>
		<comments>http://andreitara.com/2011/06/perform-face-detection-in-php/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 21:31:41 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[face detection php]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[php module]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=364</guid>
		<description><![CDATA[This short article will learn you how to perform face detection in PHP. So basically we are going to make use of OpenCV ( you know it you are using it everyday &#8230;aren&#8217;t you ?? ) we actually will abuse only on face detection algorithm that comes with it. We are going to compile the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.andreitara.com/wp-content/uploads/2011/06/clip_php_cms.png"><img class="alignleft size-full wp-image-374" style="margin: 10px;" title="clip_php_cms" src="http://www.andreitara.com/wp-content/uploads/2011/06/clip_php_cms.png" alt="" width="342" height="198" /></a>This short article will learn you how to perform <strong>face detection</strong> in <strong>PHP</strong>. So basically we are going to make use of OpenCV ( you know it you are using it everyday &#8230;aren&#8217;t you ?? <img src='http://andreitara.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ) we actually will abuse only on face detection algorithm that comes with it. We are going to compile the face detection as an .so module for php and hook this module in PHP.</p>
<p>&nbsp;</p>
<p>Requirements:</p>
<ul>
<li>LAMP stack installed, you know&#8230; Apache 2, PHP</li>
<li>Build essentials (gcc compilers and all the hoard )</li>
<li>A Linux distribution (mine is Ubuntu  11.something)</li>
<li>1 beer &amp; nothing beater to do  <img src='http://andreitara.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> <span id="more-364"></span></li>
</ul>
<p>OK so the fist thing that you have to do is to install the build essentials by running the command :</p>
<blockquote>
<pre escaped="true">sudo apt-get install build-essential</pre>
</blockquote>
<p>Be proud ! and tell to all you&#8217;re friends ! you are a linux developer &#8217;cause you have a compiler running on you PC. Now that you can compile c/c++ files you will need the OpenCV library. There are two ways to install it: that first is to download the latest version from http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.2/ and run make and make-install commands (not recommended, there is always a missing library or a stupid error ) or you just can open System-&gt;Administration-&gt;Synaptic package manager search <strong>opencv</strong> and check all the libraries as in the following image:</p>
<p><a href="http://www.andreitara.com/wp-content/uploads/2011/06/Screenshot-3.png"><img class="size-full wp-image-365 alignnone" title="Screenshot-3" src="http://www.andreitara.com/wp-content/uploads/2011/06/Screenshot-3.png" alt="" width="545" height="396" /></a></p>
<p>OpenCv library is installed but&#8230; hold on, do not touch you&#8217;re beer yet ! you still have to download and compile facedetection library, do that by using the following magic incantation :</p>
<blockquote>
<pre escaped="true">wget http://www.xarg.org/download/facedetect-1.0.1.tar.gz
tar -xvf facedetect-1.0.1.tar.gz
cd facedetect
phpize
configure
make
make-install</pre>
</blockquote>
<p>Congratulation !! you parents should be so proud of  you, now is the first time when you have compiled a module for PHP. The facedetect.so was created and copied to the corresponding PHP lib directory (/usr/lib/PPH5), add <strong>extension=facedetect.so</strong> to the php.ini file ( in  /etc/php5/apache2/php.ini or a similar location) restart the apache, now if you run phpinfo you should see the facedetect module up and running:</p>
<p><a href="http://www.andreitara.com/wp-content/uploads/2011/06/Screenshot-4.png"><img class="alignnone size-full wp-image-366" title="Screenshot-4" src="http://www.andreitara.com/wp-content/uploads/2011/06/Screenshot-4.png" alt="" width="541" height="202" /></a></p>
<p>Now let&#8217;s create a PHP file ( for e.g. face.php)  with the following content:</p>
<blockquote><p>&lt;?php</p>
<p>function LoadJpeg($img) {<br />
$im = @imagecreatefromjpeg($img);<br />
if (!$im) {</p>
<p>echo &#8216;Bad image&#8217;;<br />
}</p>
<p>$total = face_count($_GET['file'], &#8216;haarcascade_frontalface_alt.xml&#8217;);<br />
$rectangles = face_detect($_GET['file'], &#8216;haarcascade_frontalface_alt.xml&#8217;);</p>
<p>$im = LoadJpeg($_GET['file']);<br />
$pink = imagecolorallocate($im, 255, 105, 180);</p>
<p>if (count($rectangles) &gt; 0) {</p>
<p>foreach ($rectangles as $arr) {<br />
imagerectangle($im, $arr['x'], $arr['y'], $arr['x'] + $arr['w'],<br />
$arr['y'] + $arr['h'], $pink);<br />
}<br />
}<br />
header(&#8216;Content-Type: image/jpeg&#8217;);<br />
imagejpeg($im);<br />
imagedestroy($im);</p></blockquote>
<p>now run it in the browser http://localhost/face.php?file=lena.jpg and voala !!! you have detected the face of Lenna (still have to test it on fill version of Lenna <img src='http://andreitara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) .</p>
<p><a href="http://www.andreitara.com/wp-content/uploads/2011/06/Screenshot-5.png"><img class="alignnone size-full wp-image-367" title="Screenshot-5" src="http://www.andreitara.com/wp-content/uploads/2011/06/Screenshot-5.png" alt="" width="406" height="395" /></a></p>
<p>While you are enjoying you&#8217;re beer just add few words as feed back in section belowww.</p>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2011/06/perform-face-detection-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Social developing</title>
		<link>http://andreitara.com/2011/02/social-developing/</link>
		<comments>http://andreitara.com/2011/02/social-developing/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 20:51:22 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[facebook java API]]></category>
		<category><![CDATA[facebook java login]]></category>
		<category><![CDATA[social application]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=342</guid>
		<description><![CDATA[At the beginning the socialization networks were for me just a childish thing but I have figure  out the power of social networks, that can be used not only to promote out applications but also to increase the number of users. Well when I am specking about social networks I am thinking first of all [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.andreitara.com/wp-content/uploads/2011/02/facebook.jpg"><img class="alignleft size-medium wp-image-345" style="margin: 10px;" title="facebook" src="http://www.andreitara.com/wp-content/uploads/2011/02/facebook-300x112.jpg" alt="" width="180" height="67" /></a>At the beginning the <strong>socialization networks</strong> were for me just a childish thing but I have figure  out the power of social networks, that can be used not only to promote out applications but also to increase the number of users. Well when I am specking about social networks I am thinking first of all on <strong><span id="more-342"></span>Facebook</strong>. Facebook is &#8220;<strong>the social network </strong>&#8221; of our days used by millions of user so try to imagine how cool wold be that this users would use and share our application. They are providing to developers a very powerful API that can be used to  develop social application. OK but what&#8217;s a social application you may  say ? well in big therms a social application is noting more than a  application that you used together with you&#8217;re friends. Facebook expose services through they&#8217;re API that is available for JavaScript and PHP, but they don&#8217;t offer any support for Java. There is a community effort to implement a API for Java (see more on http://restfb.com/) but there are a lot of things to be implemented. One of the missing part for this is the login. So I will show you how to implement authentication for Facebook application wrote in Java but before that let&#8217;s say just two words about OAuth 2.0.</p>
<p>OAuth 2.0 protocol was made in 2006 and is used for authentication and authorization  in the most of the web services from today ( in special REST service ) in two words you can authenticate users in Web applications via redirects, in Javascript or in desktop and mobile applications. Let&#8217;s take a look at the following schema (see more on http://www.ibm.com/developerworks/web/library/wa-oauthsupport/?ca=drs-) this schema may be referenced as tree legged OAuth dance. This protocol ensure a simple way to access some private resource with a access token.<strong> <a name="N100D0"></a></strong><a href="http://www.andreitara.com/wp-content/uploads/2011/02/ThreeLeggedOAuthDance.gif"><img class="size-full wp-image-343 alignnone" title="ThreeLeggedOAuthDance" src="http://www.andreitara.com/wp-content/uploads/2011/02/ThreeLeggedOAuthDance.gif" alt="" width="568" height="469" /></a> So enough with the theory now is time for practice:</p>
<blockquote><p>/**<br />
* Authenticate on Facebook as user<br />
*<br />
* @param request<br />
*            Servlet request<br />
* @param response<br />
*            Servlet response<br />
* @param scope<br />
*            Comma separated permissions<br />
* @see http://developers.facebook.com/docs/authentication/permissions<br />
* @throws IOException<br />
*/<br />
public void authenticateAsUser(String scope) throws IOException {</p>
<p>log.info(&#8220;Executing FB AUTH&#8221;);</p>
<p>// &#8216;extract&#8217; HTTP request and response</p>
<p>HttpServletResponse httpResponse = (HttpServletResponse) response;</p>
<p>// Check if the user is authenticated already<br />
if (getFacebookToken() != null) {<br />
log.info(&#8220;User is already autheticated&#8221;);<br />
return;<br />
}</p>
<p>// Get the code parameter posted by Facebook<br />
String code = request.getParameter(&#8220;code&#8221;);</p>
<p>// The callback URL<br />
String nextURL = fbAppCanvasURL;</p>
<p>log.info(nextURL);</p>
<p>// OAuth step 1<br />
if (code == null) {</p>
<p>log.info(&#8220;Auth steph 1&#8243;);</p>
<p>@SuppressWarnings(&#8220;deprecation&#8221;)<br />
String requestAdress = String<br />
.format(&#8220;https://graph.facebook.com/oauth/authorize?client_id=%s&amp;canvas=true&amp;display=page&amp;redirect_uri=%s&amp;scope=%s&#8221;,<br />
fbClientAppId, URLEncoder.encode(nextURL), scope);</p>
<p>log.info(requestAdress);</p>
<p>// Make a call to Facebook to invoke authentication<br />
// httpResponse.sendRedirect(requestAdress);<br />
String out = String<br />
.format(&#8220;&lt;script type=\&#8221;text/javascript\&#8221;&gt;\ntop.location.href = \&#8221;%s\&#8221;;\n&lt;/script&gt;&#8221;,<br />
requestAdress);<br />
httpResponse.getWriter().print(out);<br />
httpResponse.flushBuffer();</p>
<p>log.info(&#8220;End of steph 1&#8243;);</p>
<p>}<br />
// OAuth step 2<br />
// the &#8216;code&#8217; parameter is sent in the 2&#8242;nd authentication phase<br />
// if we have the code param the we are in the 2&#8242;nd phase<br />
else {<br />
log.info(&#8220;Auth steph 2&#8243;);</p>
<p>// request URL to make the 2&#8242;nd call to Facebook<br />
@SuppressWarnings(&#8220;deprecation&#8221;)<br />
String requestAdress = String<br />
.format(&#8220;https://graph.facebook.com/oauth/access_token?client_secret=%s&amp;code=%s&amp;client_id=%s&amp;redirect_uri=%s&#8221;,<br />
fbClientAppSecret, URLEncoder.encode(code),<br />
fbClientAppId, URLEncoder.encode(nextURL));</p>
<p>log.info(requestAdress);</p>
<p>// The 2&#8242;nd phase doesen&#8217;t involve the user interaction<br />
// so we can read the result directly on server with a stream reader<br />
URL requestURL = new URL(requestAdress);</p>
<p>// Open a connection to Facebook<br />
BufferedReader in = new BufferedReader(new InputStreamReader(<br />
requestURL.openStream()));</p>
<p>// Read the response and store the result in<br />
// resultString buffer<br />
String inputLine;<br />
StringBuilder resultString = new StringBuilder();</p>
<p>while ((inputLine = in.readLine()) != null)<br />
resultString.append(inputLine);</p>
<p>// Close the connection stream<br />
in.close();</p>
<p>log.info(&#8220;Response string:&#8221;);<br />
log.info(resultString.toString());</p>
<p>// fetch access token &amp; expiration time from response string<br />
String[] params = resultString.toString().split(&#8220;&amp;&#8221;);<br />
params[0] = params[0].split(&#8220;access_token=&#8221;)[1];<br />
// params[1] = params[1].split(&#8220;expires=&#8221;)[1];</p>
<p>// Store them in cookies<br />
log.info(&#8220;Store them in cookies&#8221;);<br />
log.info(params[0]);</p>
<p>httpResponse.addCookie(new Cookie(&#8220;FB_ACCESS_TOKEN&#8221;, params[0]));</p>
<p>// httpResponse.addCookie(new Cookie(&#8220;FB_EXPIRE&#8221;,<br />
// params[1]));</p>
<p>log.info(&#8220;End of steph 2&#8243;);<br />
log.info(&#8220;Exiting Facebook authentication&#8221;);</p>
<p>}</p>
<p>}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2011/02/social-developing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We&#8217;re living cloudy times</title>
		<link>http://andreitara.com/2011/01/were-living-cloudy-times/</link>
		<comments>http://andreitara.com/2011/01/were-living-cloudy-times/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 06:24:05 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=333</guid>
		<description><![CDATA[The increasing number of users who have access to the internet has lead technology as we knew it to a new evolution step, I am specking about cloud computing and the way this new paradigm   is affecting the way we are thinking and writing applications. Today there are 3 main giants witch are providing cloud [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.andreitara.com/wp-content/uploads/2011/01/images.jpg"><img class="alignleft size-full wp-image-334" title="images" src="http://www.andreitara.com/wp-content/uploads/2011/01/images.jpg" alt="" width="131" height="98" /></a> The increasing number of users who have access to the internet has lead technology as we knew it to a new evolution step, I am specking about <strong>cloud computing</strong> and the way this new paradigm   is affecting the way we are thinking and writing applications. Today there are 3 main giants witch are providing cloud hosting solutions/platforms: Google, Microsoft and Amazon. The price are almost identical, the big   difference is in the supported technologies/ programming languages. In the next list<span id="more-333"></span> are compared some  aspects of the main three cloud solutions:</p>
<table style="height: 732px;" border="1" cellpadding="10" width="584">
<tbody>
<tr>
<td valign="top"><strong>Feature</strong></td>
<td valign="top"><strong>Microsoft</strong></td>
<td valign="top"><strong>Amazon</strong></td>
<td valign="top"><strong>Google</strong></td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top"></td>
<td valign="top"></td>
<td valign="top"></td>
<td valign="top"></td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top"><strong>Computing Architecture</strong></td>
<td valign="top">You provide .NET code for front-end and back-end servers which<br />
Microsoft then runs on Windows 2008 virtual machines according to your<br />
environment specifications (how many machines of each kind you need, and so<br />
on.)</td>
<td valign="top">Elastic Compute Cloud (EC2) allows you to upload your XEN virtual<br />
machine images to the infrastructure and gives you APIs to instantiate and<br />
manage them.</td>
<td valign="top">You write your web application in Python,  Django and Java with a specific<br />
set of limitations set by Google and submit the application code to them.</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top"><strong>Load balancing</strong></td>
<td valign="top">Yes</td>
<td valign="top">Yes</td>
<td valign="top">Yes</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top"><strong>Storage</strong></td>
<td valign="top">Yes: application storage and SQL services</td>
<td valign="top">Yes: Simple Storage Service (S3) and SimpleDB</td>
<td valign="top">Yes: database Datastore APIs</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top"><strong>Message queuing for machine communcations</strong></td>
<td valign="top">Yes: queues in Windows Azure storage</td>
<td valign="top">Yes: Simple Queue Service (SQS)</td>
<td valign="top">No</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top"><strong>Integration with other services</strong></td>
<td valign="top">So called .NET services (aka BizTalk in the cloud):</p>
<p>Access control services, workflow service, service bus.</p>
<p>Live Mesh</p>
<p>Various Live services (contacts, mail, maps and so on.)</p>
<p>At the moment, all these components do not seem to be integrated with<br />
the solution but rather bundled.</td>
<td valign="top">No</td>
<td valign="top">Yes, with existing Google services: authentication, mail, base, calendar,<br />
contacts, documents, pictures, spreadsheets, YouTube.</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top"><strong>Tied to the vendor datacenter</strong></td>
<td valign="top">Yes</td>
<td valign="top">Yes</td>
<td valign="top">Yes</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top"><strong>Development tools </strong></td>
<td valign="top">Yes, integration into Visual Studio, support for any .NET languages,</td>
<td valign="top">Not applicable. Amazon simply runs your virtual machines and does not<br />
care which development platform you are using on top of the base OS.</td>
<td valign="top">Yes, have basic editing, local simulation, and deployment tools.<br />
Language selection limited to Python, Django and Java.</p>
<p>Now the GWT ca be really simple integrated with Java App Engine applications</td>
<td valign="top"></td>
</tr>
</tbody>
</table>
<p>source (http://cloudenterprise.info/2008/10/29/microsoft-azure-vs-amazon-google-and-vmware/)</p>
<p>From this three solution, the truly <strong>cloud solutions</strong> are from <strong>Google </strong>and <strong>Microsoft</strong>,  Amazon is actually providing a visualization solution. The thinks  that are so cool about cloud technologies is that <strong>we pay</strong> <strong>only </strong>for what we <strong>consume,</strong> we can <strong>easily scale up</strong> and down our applications and my favorite the automatic load balance. If in the case of traditional hosting solutions you pay a fix amount of money for some resource event if you use them or not in the case of cloud hosting solutions you pay only for the amount of resources that you use, is just as in the case of the electricity. I personally like on cloud the so called &#8220;computation on demand&#8221; or with other words the possibility of  scaling up you&#8217;re application making it available to more users. To understand the importance of cloud computation let&#8217;s suppose that you have just created a really new cool application and customers start using it, but the application is so  awesome that you&#8217;re clients start sharing it with they&#8217;re friends and they friends with they&#8217;re friends and so on. In this way you get a traffic spike, but the hamsters that are powering you&#8217;re servers get tired. To avoid this you have to able to predict when you will have a traffic spike and buy or rent more servers where to host you&#8217;re application so that it can handle the heavy load.  Maybe you&#8217;re application has a shortly glorious moment of couple of days and the number of users start to decrease, but you have already payed for the extra hardware resource and you have used it just for a short period.   Well in the case of the cloud the story is more simple because you don&#8217;t have to predict anything, the amount of resources that are needed to run you&#8217;re application will be automatically scaled  up and down as they are needed.</p>
<p>Well of course, you can&#8217;t just take you&#8217;re old application and just put it on cloud, there are some rules and constrains imposed by  the cloud computing model.</p>
<p>In short time I will come back with samples of cloud application on Google App Engine (Java &amp; Python) and of course on Windows Azure (C# and F#).</p>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2011/01/were-living-cloudy-times/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Functions networks &#8211; a paralel computation model</title>
		<link>http://andreitara.com/2010/12/functions-networks-a-paralel-computation-model/</link>
		<comments>http://andreitara.com/2010/12/functions-networks-a-paralel-computation-model/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 18:05:18 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=313</guid>
		<description><![CDATA[The main problem about computers in nowadays is that they all are, or at vast majority,  are based on the same computation model, the &#8220;von Newman model &#8220;, that we are all knowing from school. In this article I am going to present a less know face of computability, basically I am going to scratch [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">The main problem about computers in nowadays is that they all are, or at vast majority,  are based on the same computation model, the &#8220;von Newman model &#8220;, that we are all knowing from school. In this article I am going to present a less know face of computability, basically I am going to scratch the surface of the networks of functions.</p>
<p style="text-align: left;">The idea behind such systems is to create some networks of functions , witch are some functional units that can perform some operation on the input(s) and generate a <strong>single output</strong>. Mainly the idea from function networks is used also in the artificial neural networks, with the big difference that in the case of the neural networks, the functions are bulided based on the training information.<span id="more-313"></span></p>
<p style="text-align: left;">If you are not very familiar with the notion of functions I will try to explain it in a very simple fashion, ignoring all the formal aspect of  definition. We could say that a function is a transformation. A simple representation of a function can be seen in the image below; <a href="http://www.andreitara.com/wp-content/uploads/2010/12/f.png"><img class="size-medium wp-image-314 alignleft" title="f" src="http://www.andreitara.com/wp-content/uploads/2010/12/f-300x125.png" alt="" width="140" height="58" /></a>a function has some inputs, in this case just one, and an single output. A function can perform the operation F witch can be theoretically every possible transformation from simple addition up to very complex transformations. As an observation the inputs and the output doesn&#8217;t have to be primitive data (as numbers), this could be everything you may want, for e.g. a very complex data model with very complex internal states and so on. Until now nothing it doesn&#8217;t seams to be very interesting in fact this are thinks that you may already know. What you may not know is that we can group such functions in a network to perform computation. So basically the programming such systems would appear more like playing with some Lego pieces.</p>
<p style="text-align: left;">A very simple way to show the power of the networks of  function  is to define some simple function with N <a href="http://www.andreitara.com/wp-content/uploads/2010/12/and1.png"><img class="size-full wp-image-321 alignright" title="and" src="http://www.andreitara.com/wp-content/uploads/2010/12/and1.png" alt="" width="112" height="87" /></a>entry witch will produce at output 1 only  id the sum of the entries are at last equal with a fix threshold value (in short therm F= 1 only if  sum(inputs) &gt;= threshold ). In the next figure it can be seen a implementation of a logical AND. By changing the value of the threshold to 1 we can obtain a logical OR . By combining of such functions  in networks  we can obtain really complex functionality. The main power of  such network is the parallel nature.<a href="http://www.andreitara.com/wp-content/uploads/2010/12/and.png"><img class="alignleft size-full wp-image-320" title="and" src="http://www.andreitara.com/wp-content/uploads/2010/12/and.png" alt="" width="127" height="100" /></a> So basically every operation can be made independent from the other.</p>
<p style="text-align: left;">
<p style="text-align: left;">Another example that I like is writing the Fourier series  using function networks. If you wan to find out more about Fourier series go to  (http://en.wikipedia.org/wiki/Fourier_series) . The Fourier series is described by the next expression: <a href="http://www.andreitara.com/wp-content/uploads/2010/12/f712dc7dc49203f6412ed644d1426ab1.png"><img class="size-full wp-image-322 alignnone" title="f712dc7dc49203f6412ed644d1426ab1" src="http://www.andreitara.com/wp-content/uploads/2010/12/f712dc7dc49203f6412ed644d1426ab1.png" alt="" width="279" height="48" /></a>.</p>
<p style="text-align: left;">So this can be representated using a network like in the following image; the main advantage of this <strong>computability model </strong>is that the sin and cos functions can be computed in parallel, <a href="http://www.andreitara.com/wp-content/uploads/2010/12/Untitledasdasd1.png"><img class="alignleft size-full wp-image-324" title="Untitledasdasd" src="http://www.andreitara.com/wp-content/uploads/2010/12/Untitledasdasd1.png" alt="" width="520" height="518" /></a>in contrast with a traditional iterative  model where basically the values of each sin and cos is computed step by step.</p>
<p style="text-align: left;">Although this model is used basically for computation ,it can be also  extended for other stuff as a model for an adaptive ranking (http://portal.acm.org/citation.cfm?id=1062806).</p>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2010/12/functions-networks-a-paralel-computation-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML serialization of objects in C# and Java</title>
		<link>http://andreitara.com/2010/10/xml-serialization-of-objects-in-c-and-java/</link>
		<comments>http://andreitara.com/2010/10/xml-serialization-of-objects-in-c-and-java/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 19:04:19 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=294</guid>
		<description><![CDATA[In this post I will explain some basic methods for creating XML serialization of objects in C# and Java but before let&#8217;s take a look and see what actually XML is and when should we use it. XML or eXtended Markup Language is as it says his name nothing more the a markup language same [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.andreitara.com/wp-content/uploads/2010/10/gateau-geek-xml.jpg"><img class="alignleft size-full wp-image-300" title="gateau-geek-xml" src="http://www.andreitara.com/wp-content/uploads/2010/10/gateau-geek-xml.jpg" alt="" width="287" height="215" /></a>In this post I will explain some basic methods for creating XML serialization of objects in C# and Java but before let&#8217;s take a look and see what actually XML is and when should we use it.<br />
XML or eXtended Markup Language is as it says his name nothing more the a markup language same as HTML, but the main difference beside the possibility of creating you&#8217;re own tags, is that XML is used to structure information.<span id="more-294"></span> The posibility of structuring information made from XML a really useful tool to transport data across application that can even reside on different machines across internet, here we can remember the REST  and OData protocol. So  XML can be used to expose and access information from a variety of sources including, but not limited to, relational databases, file systems, content management systems and traditional Web sites.</p>
<p>Now that we know what is XML good for is time to get in to the business and write out first class that cam be serialized as XML.</p>
<p>C#</p>
<blockquote>
<pre escaped="true" lang="c#" line="1">using System.Xml.Serialization;
[XmlRoot(ElementName = "PersonalInformations")]

public class PersonalInformations
{
[XmlAttribute(AttributeName="name")]
public string Name { get; set; }

[XmlAttribute(AttributeName="age")]
public uint Age { get; set; }
[XmlAttribute(AttributeName="birth")]
public DateTime DateOfBirth { get; set; }

public string Adress{get;set;}

public static void StoreObject(Stream outStream, PersonalInformations obj)
{
XmlSerializer x = new XmlSerializer(typeof(PersonalInformations));
x.Serialize(outStream, obj);
}
}
public static PersonalInformations LoadObject(Stream inStream)
{
XmlSerializer x = new XmlSerializer(typeof(PersonalInformations));
return  x.Deserialize(inStream) as PersonalInformations;
}
}</pre>
</blockquote>
<p>Java</p>
<blockquote>
<pre escaped="true" lang="java" line="1">@Root(name="PersonalInformations")
class PersonalInformations {

@Attribute(name="name")
private String name;

@Attribute(name="age")
private int age;

@Attribute(name="birth")
private Date dateOfBirth;

@Element(name="birth")
private Date dateOfBirth;

public static void storeObject(Stream outStream, PersonalInformations obj)

{
      Serializer serializer = new Persister();
      serializer.write(obj, outStream);
}

}

public static PersonalInformations loadObject(Stream inStream)

{
      Serializer serializer = new Persister();
      return (PersonalInformations) serializer.read (PersonalInformations.class,inStream);
}

}</pre>
</blockquote>
<p>In the case  of C# we made use of the classes from System.Xml.Serialization namespace, that offers a simple way to serialize classes. In case of Java we use a third part library that can be downloaded from http://simple.sourceforge.net. In both cases we annote the class fields to inform the serialization service about the way we want to create the XML.<br />
As you maybe have already noticed from this sample, XML has become more then a way to store structured information, it is actually a way to express an object state. State that can be stored or sent across applications, applications that can be write in different programming languages.</p>
<p>The goal of this post is not informing about how to serialize classes to XML but to show the simplicity and beauty of XML in communication between applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2010/10/xml-serialization-of-objects-in-c-and-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[theGlowfish] &#8211; codename for my new CMS</title>
		<link>http://andreitara.com/2010/07/theglowfish-codename-for-my-new-cms/</link>
		<comments>http://andreitara.com/2010/07/theglowfish-codename-for-my-new-cms/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 17:46:20 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=265</guid>
		<description><![CDATA[It&#8217;s alive!!! Finally I have enough time to finis a first pre-alpha  release of my CMS (code name theGlowfish). So what  a hack is theGlowfish ? Well theGlowfish is an CMS  ( or in long form is an content management system ), an application that allows user to administrate the content of the website without [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.andreitara.com/wp-content/uploads/2010/07/Untitled-421.jpg"><br />
<img class="size-full wp-image-267 alignnone" title="Untitled-42" src="http://www.andreitara.com/wp-content/uploads/2010/07/Untitled-421.jpg" alt="Untitled-42" width="588" height="389" /></a></p>
<p>It&#8217;s alive!!! Finally I have enough time to finis a first pre-alpha  release of my CMS (code name <strong>theGlowfish</strong>).</p>
<p><span id="more-265"></span></p>
<p><span style="text-decoration: underline;"><strong>So what  a hack is </strong></span><strong><strong><span style="text-decoration: underline;">theGlowfish </span>? </strong></strong>Well theGlowfish  is an CMS  ( or in long form is an content management system ), an  application that allows user to administrate the content of the website  without having to bother about how the thinks are done. Content can be  simple text, photos,  movies, documents and anything that you can  imagine.</p>
<p><strong><span style="text-decoration: underline;">Why a pre-alpha release ? Why not an beta RC </span>?</strong> The answer is very simple: there are some modules under development ( deployment, update and design  module) that will be integrated in application core.</p>
<p><span style="text-decoration: underline;"><strong>Why should I use it ?</strong></span> There are a lot of advantages of using theGlowfish from each point of view:</p>
<p>Simple user:</p>
<ul>
<li>Clean, simple and intuitive administration panel.</li>
<li>Multiple tabs allowing you to do more stuff in parallel (for instance editing an article and creating a new menu).<a href="http://www.andreitara.com/wp-content/uploads/2010/07/Untitledgugujgbjh-1.jpg"><img class="alignnone  size-full wp-image-274" title="Untitledgugujgbjh-1" src="http://www.andreitara.com/wp-content/uploads/2010/07/Untitledgugujgbjh-1.jpg" alt="Untitledgugujgbjh-1" width="639" height="339" /></a></li>
<li>Treat separate the public content, private content (for registered users)</li>
<li>Multiple languages native support.</li>
<li>Mobile device detection, allowing  to be displayed a more simple design, small images, etc.<br />
<a href="http://www.andreitara.com/wp-content/uploads/2010/07/Untitlasdasdasdasdasdd-2.jpg"><img class="alignnone size-full wp-image-276" title="Untitlasdasdasdasdasdd-2" src="http://www.andreitara.com/wp-content/uploads/2010/07/Untitlasdasdasdasdasdd-2.jpg" alt="Untitlasdasdasdasdasdd-2" width="613" height="399" /></a></li>
<li>Simple and elegant content editor<br />
<a href="http://www.andreitara.com/wp-content/uploads/2010/07/Untitledhiuhkjhkjhhhhhhhhhhhhhhhhhhhhhhhhhh-1.jpg"><img class="alignnone size-full wp-image-275" title="Untitledhiuhkjhkjhhhhhhhhhhhhhhhhhhhhhhhhhh-1" src="http://www.andreitara.com/wp-content/uploads/2010/07/Untitledhiuhkjhkjhhhhhhhhhhhhhhhhhhhhhhhhhh-1.jpg" alt="Untitledhiuhkjhkjhhhhhhhhhhhhhhhhhhhhhhhhhh-1" width="584" height="412" /></a></li>
</ul>
<p>Designer:</p>
<p>Creating a theme for theGlowfish is very simple all you have to do is  to create an HTML as you are used and add some special tags called <em>positions </em>that indicate to the template engine that there must be  displayed  something. The form of a <em>position </em>is <span style="color: #ff0000;">{position name=&#8217;name&#8217;}</span>. Let  see an basic example:</p>
<blockquote><p>&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0  Transitional//EN&#8221;  &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;</p>
<p>&lt;head&gt;</p>
<p>&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html;  charset=iso-8859-1&#8243; /&gt;</p>
<p>&lt;link href=&#8221;<span style="color: #ff0000;">{$TEMPLATE_PATH}</span>/css/style.css&#8221; rel=&#8221;stylesheet&#8221; /&gt;<br />
&lt;link href=&#8221;<span style="color: #ff0000;">{$TEMPLATE_PATH}</span>/css/buttons.css&#8221; rel=&#8221;stylesheet&#8221;  /&gt;</p>
<p><span style="color: #ff0000;">{position  name=&#8217;head&#8217;}</span></p>
<p>&lt;/head&gt;</p>
<p>&lt;body &gt;</p>
<p><span style="color: #ff0000;">{position  name=&#8217;Menu&#8217; }</span></p>
<p>&lt;hr /&gt;</p>
<p><span style="color: #ff0000;">{position  name=&#8217;Content&#8217; }</span></p>
<p>&lt;/body&gt;</p>
<p>&lt;/html&gt;</p></blockquote>
<p>In the example above are defined 3 positions, to each position it can  be associated  items to be displayed, for instance an menu or content  of a page. Another simple modifier is the <span style="color: #ff0000;">{$TEMPLATE_PATH} <span style="color: #000000;">, the template engine will  replace the {$TEMPLATE_PATH} with the correct relative path of the  resource (image, file). There are more other special tags with more  magic, the template engine used extends Smarty.</span></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;">Coder:</span></span></p>
<ul>
<li><span style="color: #ff0000;"><span style="color: #000000;">modularity</span></span><br />
<span style="color: #ff0000;"> </span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">plugin support<br />
</span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">MVC architecture</span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">independent of database type<br />
</span></span></li>
</ul>
<p><span style="text-decoration: underline;"><strong>History ? </strong></span> I get sick  of trying to develop new features for some well known &#8220;classic&#8221;  CMS.  The weakness of the most free CMS are:  mixing the code with the  presentation or the aspect of the website,bad understanding an  utilization of OOP (object orientated programming), database dependency,  so trying to extend or change something is very unproductive ( in non  academic terms ..a pain in the ass ). The story of theGlowfish has started couple of months ago on a rainy day with me scratching some core UML diagrams of the  new CMS on an old piece of paper. If the first version wasn&#8217;t flexible enough, the second was too generic even for me ( if you <span id="result_box"><span style="background-color: #ffffff;">would know me</span></span>, I am the fan of generic programing ). The 3&#8242;rd version combined the simplicity of first and the flexibility of second was the perfect one.</p>
<p><span style="text-decoration: underline;"><strong> </strong></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;"><span style="text-decoration: underline;"><strong>Cool&#8230; so where can I try theGlowfish ?</strong></span></span></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;">demo page: http:\\test.andreitara.com/</span></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;">admin page: http:\\test.andreitara.com/administrator/</span></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;">user: admin</span></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;">password: admin</span></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;"><span style="text-decoration: underline;"><strong>Do you like it ? Want or participate ?</strong></span><br />
</span></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;">I have big plans and a lot o ideas for my CMS, the problem is that I don&#8217;t have time to do all the work by myself (software design, implementation, user interface, graphics , testing and debug) . If you are interested you can help me with:</span></span></p>
<ul>
<li><span style="color: #ff0000;"><span style="color: #000000;">test and debug</span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">implementation (PHP, Javascript and MySql)<br />
</span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">design and graphics</span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">spread the idea (tell to all you&#8217;re friends about theGlowfish )</span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">tell me about the things that can be improved.<br />
</span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;"><a href="http://www.andreitara.com/wp-content/uploads/2010/07/We_Need_You.jpg"><img class="alignnone size-full wp-image-279" title="We_Need_You" src="http://www.andreitara.com/wp-content/uploads/2010/07/We_Need_You.jpg" alt="We_Need_You" width="283" height="381" /></a><br />
</span></span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2010/07/theglowfish-codename-for-my-new-cms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The magic of mode_rewrite</title>
		<link>http://andreitara.com/2010/06/the-magic-of-mode_rewrite/</link>
		<comments>http://andreitara.com/2010/06/the-magic-of-mode_rewrite/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 20:00:35 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[others]]></category>
		<category><![CDATA[Programare]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[web app]]></category>
		<category><![CDATA[apache mode_rewrite]]></category>
		<category><![CDATA[installing mode_rewrite on linux]]></category>
		<category><![CDATA[installing mode_rewrite on windows]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=244</guid>
		<description><![CDATA[There&#8217;s a long time in the galaxy since I haven&#8217;t post on my blog and now,  finally here I am, posing a new article. Today I will speak about htaccess mod_rewrite. Well despite the tons of examples and docs, mod_rewrite is voodoo. Damned cool voodoo, but still voodoo. The majority of the web servers, that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.andreitara.com/wp-content/uploads/2010/06/images.jpg"><img class="alignleft size-full wp-image-252" title="images" src="http://www.andreitara.com/wp-content/uploads/2010/06/images.jpg" alt="images" width="179" height="134" /></a>There&#8217;s a long time in the galaxy since I haven&#8217;t post on my blog and now,  finally here I am, posing a new article. Today I will speak about <a title=".Htaccess rewrites, Mod_Rewrite Tricks and Tips" href="http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html">htaccess mod_rewrite</a>. Well despite the tons of examples and docs, <strong>mod_rewrite</strong> is voodoo. Damned cool voodoo, but still voodoo.</p>
<p>The majority of the web servers, that are based on Apache, have the mod_rewrite enabled so you don&#8217;t have to get dirty to install it on the hosting server.But anyone of those that are developing web application based on Apache server,  using PHP have a local installed server therefore mode_rewrite is also  necessary in testing process.<br />
<span id="more-244"></span></p>
<p>Installing mod_rewrite :</p>
<ol>
<li>On Linux: edit the Apache configuration file (  httpd.conf ) and uncomment   <em>LoadModule rewrite_module modules/mod_rewrite.so</em> (remove the  pound &#8216;#&#8217; sign from in front of the line) . Also be sure that the lines containing <em>ClearModuleList</em> and <em>AddModule mod_rewrite.c are</em> uncommented . Now you can create the famous .htacess file on the root of you website and start adding your code.</li>
<li>On Windows: well as we are expecting, things are a bit more complicated because on Windows you cannot create a file that doesn&#8217;t have a name (.htacess is a file that only have an extension). For first just uncomment the same lines as in the Linux example. Now you have to tell Apache to use you&#8217;re custom file instead of  .htacess file, so search in the configuration file (httpd.conf)  for the following lines:</li>
</ol>
<p style="padding-left: 60px;"><strong># AccessFileName: The  name of the file to look for in each directory # for additional  configuration directives. See also the AllowOverride<br />
# directive.<br />
#<br />
AccessFileName .htaccess (change the .htaccess to [name].htaccess where name can be whatever what you wish )</strong></p>
<p style="padding-left: 30px;">You can escape this step and create the .htacess file even on windows, actually the restriction of creating a file without name is an restriction of Windows Explorer is not an restriction of the operating system<strong> </strong>. Open the command (cmd), go to the root folder of the website and type <strong>copy con .htacess </strong>and press <strong>Ctrl+Z</strong>. well&#8230; that&#8217;s all folks.</p>
<p>Maybe you are asking yourself  about mod_rewrite and where to use it, well the short and  simple answer is :  for simplifying the URL of a website, simpler/shorter URL are easier to write easier to remember. For example instead of having an URL  like this www.example.com?id_product=23123&amp;color=23 you can have something like www.example.com/iphone-white. Mod_rewrite basicly make   use of regular expression to rewrite an specified URL.</p>
<p style="padding-left: 30px;">When to use it: mod_rewrite can be used in many circumstances where you may want to rewrite the an URL, also you can create dynamically virtual hosting entry;  practically mode_rewrite is an &#8220;Swiss Army Knife&#8221;.</p>
<p style="padding-left: 30px;">When not to use it: well as I have mentioned  before mode_rewrite make use of regular expression, and evaluating regular expression takes time, use memory and the global performance of the server is decreasing.</p>
<p>I will provide you some basic example of using mode_rewrite. .htaccess file should begin with:</p>
<pre style="padding-left: 60px;"><strong>Options +FollowSymLinks
RewriteEngine On
RewriteBase /

</strong></pre>
<ol>
<li><span style="text-decoration: underline;">Redirecting</span> <strong> </strong><br />
<strong>Redirect /index.php   http://www.example.com</strong>/    -this example redirect the current site to www.example.com<br />
RedirectMatch (.*)\.gif http://images.example.com$1.png      -In this example, we’ve taken all of our GIF files, converted them to PNG files, and<br />
moved them to another server</li>
<li><span style="text-decoration: underline;">Require www</span>
<pre>Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]</pre>
</li>
<li>Denying access to a folder except of fopen file from php
<pre>RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+)/.*\ HTTP [NC]
RewriteRule .* - [F,L]</pre>
</li>
<li>Limit access during some hours
<pre class="odd">Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# If the hour is 7
RewriteCond %{TIME_HOUR} ^7$
RewriteRule ^.*$ - [F,L]</pre>
</li>
</ol>
<p>These samples are here just to open your appetite for mode_rewrite. Practically this tool can be used in any other ways,yes&#8230; the limit is your imagination.</p>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2010/06/the-magic-of-mode_rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protecting HTML source code from being stolen</title>
		<link>http://andreitara.com/2010/03/protecting-html-source-code-from-being-stolen/</link>
		<comments>http://andreitara.com/2010/03/protecting-html-source-code-from-being-stolen/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 19:01:45 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Programare]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[web app]]></category>
		<category><![CDATA[web page protection]]></category>
		<category><![CDATA[hite web page code]]></category>
		<category><![CDATA[html protector]]></category>
		<category><![CDATA[javascript page encryptor]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=222</guid>
		<description><![CDATA[A  lot of people are asking me how they can protect the source code of HTML of they&#8217;re  site from being seen or worst being stolen. Well, the simple and short answer is that you can&#8217;t everything that the browser loads to render it can be seen by the user. The simplest method to protect [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-238" title="011810_home_security" src="http://www.andreitara.com/wp-content/uploads/2010/03/011810_home_security.jpg" alt="011810_home_security" width="243" height="243" />A  lot of people are asking me how they can <strong>protect the source code</strong> of HTML of they&#8217;re  site from being seen or worst being stolen. Well, the simple and <span style="text-decoration: underline;">short answer</span> is that <span style="text-decoration: underline;">you can&#8217;t</span> everything that the browser loads to render it can be seen by the user. The simplest method to protect you&#8217;re source HTML code is  never to publish it on Internet <img src='http://andreitara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Well seriously, there are some <strong>meta methods</strong> to <strong>protect</strong> you&#8217;re <strong>HTML</strong> source from being seen by a common user not from an expert user.I will enumerate some methods starting with the simplest.<br />
<span id="more-222"></span></p>
<ul>
<li>The first method, maybe the most stupid one but used by many people (stupid ideas work for stupid people <img src='http://andreitara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) is <strong>putting a lot of empty line in front of HTML source</strong>. If the user looks at the source will see just empty white page. But if he scroll down on bottom of the page he will see the source.</li>
<li>The  second method is to disable right click on page. To do that just take a look at next code://Disable right click script III- By Renigade (renigade@mediaone.net)<br />
//For full source code, visit http://www.dynamicdrive.com</p>
<p>var message=&#8221;";<br />
///////////////////////////////////<br />
function clickIE() {if (document.all) {(message);return false;}}<br />
function clickNS(e)<br />
{<br />
if(document.layers||(document.getElementById&amp;&amp;!document.all))<br />
{<br />
if (e.which==2||e.which==3)<br />
{(message);return false;}<br />
}<br />
}</p>
<p>if (document.layers)<br />
{<br />
document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;<br />
}<br />
else<br />
{<br />
document.onmouseup=clickNS;document.oncontextmenu=clickIE;<br />
}</p>
<p>document.oncontextmenu=new Function(&#8220;return false&#8221;)<br />
// &#8211;&gt;</p>
<p>Now that the user can do right click-&gt;show page source,  you have achieved a good protection method,  if you user is a old granny  <img src='http://andreitara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  that doesn&#8217;t know to use  (Ctrl+U)  shortcut or Edit-&gt;View page soure.</li>
<li>The third method is to <strong>use javascript</strong> to hide the HTML content. A short example is presented next:<br />
Let&#8217;s suppose that the page has the following code:&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=utf-8&#8243; /&gt;<br />
&lt;title&gt;Sample HTML-hide sorece code&lt;/title&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
Blah blah blah<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>Now what we have to do next is to &#8220;encrypt&#8221; this content, go to http://www.swingnote.com/tools/texttohex.php or a similar page and convert the text source code to an hexa representation. You will obtain something similar to this:<br />
%3c%21%44%4f%43%54%59%50%45%20%68%74%6d%6c%20%50%55%42%4c%49%43%20%5c%22%2d%2f%2f%57%33%43%2f%2f%44%54%44%20%58%48%54%4d%4c%20%31%2e%30%20%54%72%61%6e%73%69%74%69%6f%6e%61%6c%2f%2f%45%4e%5c%22%20%5c%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%54%52%2f%78%68%74%6d%6c%31%2f%44%54%44%2f%78%68%74%6d%6c%31%2d%74%72%61%6e%73%69%74%69%6f%6e%61%6c%2e%64%74%64%5c%22%3e%20%3c%68%74%6d%6c%20%78%6d%6c%6e%73%3d%5c%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%31%39%39%39%2f%78%68%74%6d%6c%5c%22%3e%20%3c%68%65%61%64%3e%20%3c%6d%65%74%61%20%68%74%74%70%2d%65%71%75%69%76%3d%5c%22%43%6f%6e%74%65%6e%74%2d%54%79%70%65%5c%22%20%63%6f%6e%74%65%6e%74%3d%5c%22%74%65%78%74%2f%68%74%6d%6c%3b%20%63%68%61%72%73%65%74%3d%75%74%66%2d%38%5c%22%20%2f%3e%20%3c%74%69%74%6c%65%3e%53%61%6d%70%6c%65%20%48%54%4d%4c%2d%68%69%64%65%20%73%6f%72%65%63%65%20%63%6f%64%65%3c%2f%74%69%74%6c%65%3e%20%3c%2f%68%65%61%64%3e%20%20%3c%62%6f%64%79%3e%20%09%42%6c%61%68%20%62%6c%61%68%20%62%6c%61%68%20%3c%2f%62%6f%64%79%3e%20%3c%2f%68%74%6d%6c%3e</p>
<p>The page is the same but now has a different representation that is strange to a common user but remember that this is a <em>meta protection method </em>an advanced user can and will do the reverse method to obtain you&#8217;re source.<br />
The next step is to create the &#8220;protected&#8221; page, create a new HTML document and add the next code:</p>
<p>&lt;script&gt;<br />
<strong>document.write</strong>(<strong>unescape</strong>(&#8220;%3c%21%44%4f%43%54%59%50%45%20%68%74%6d%6c%20%50%55%42%4c%49%43%20%5c%22%2d%2f%2f%57%33%43%2f%2f%44%54%44%20%58%48%54%4d%4c%20%31%2e%30%20%54%72%61%6e%73%69%74%69%6f%6e%61%6c%2f%2f%45%4e%5c%22%20%5c%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%54%52%2f%78%68%74%6d%6c%31%2f%44%54%44%2f%78%68%74%6d%6c%31%2d%74%72%61%6e%73%69%74%69%6f%6e%61%6c%2e%64%74%64%5c%22%3e%20%3c%68%74%6d%6c%20%78%6d%6c%6e%73%3d%5c%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%31%39%39%39%2f%78%68%74%6d%6c%5c%22%3e%20%3c%68%65%61%64%3e%20%3c%6d%65%74%61%20%68%74%74%70%2d%65%71%75%69%76%3d%5c%22%43%6f%6e%74%65%6e%74%2d%54%79%70%65%5c%22%20%63%6f%6e%74%65%6e%74%3d%5c%22%74%65%78%74%2f%68%74%6d%6c%3b%20%63%68%61%72%73%65%74%3d%75%74%66%2d%38%5c%22%20%2f%3e%20%3c%74%69%74%6c%65%3e%53%61%6d%70%6c%65%20%48%54%4d%4c%2d%68%69%64%65%20%73%6f%72%65%63%65%20%63%6f%64%65%3c%2f%74%69%74%6c%65%3e%20%3c%2f%68%65%61%64%3e%20%20%3c%62%6f%64%79%3e%20%09%42%6c%61%68%20%62%6c%61%68%20%62%6c%61%68%20%3c%2f%62%6f%64%79%3e%20%3c%2f%68%74%6d%6c%3e&#8221;));<br />
&lt;/script&gt;<br />
As you can see all we are doing is to use javascript to write the content (<strong>document.write</strong> method).<br />
<span style="color: #ff0000;">!!! Important</span> : if user has the javascript disabled he will not see anything because the code will not execute, therefore will  be nothing displayed. Also remember that most of searchengine as Google or Yahoo crawl  the web in text mode,  remember that <span style="text-decoration: underline;">javascript is luxury</span> not a necessity.</li>
<li>Now is time to get serious and speak about some more advanced, a little bit harder to break (not impossible to break), technique   to keep you HTML source protected.The base idea is to encrypt the content of the HTML page, this time really encryption . Let imagine  a function for encryption this time a simple one that is using xor logic function to achieve encryption. The code to do that is showed next:<br />
//Encryptionfunction encrypt(text,key){</p>
<p>var rez=new Array(text.length);<br />
for(i=0;i&lt;text.length;i++){<br />
rez[i]=text.charCodeAt(i) ^key.charCodeAt(i%key.length);<br />
}<br />
return rez;<br />
}</p>
<p>//Decryption</p>
<p>function decrypt(text,key){<br />
var rez=&#8221;";<br />
for(i=0;i&lt;text.length;i++){<br />
rez+=String.fromCharCode(text[i] ^key.charCodeAt(i%key.length));</p>
<p>}<br />
return rez;<br />
}</p>
<p>Using the functions in this form won&#8217;t help to much because the user will see clear what is about, so I am going to obfuscate the code (if you don&#8217;t know what is that google it <img src='http://andreitara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). Now the code looks not so friendly :</p>
<p>eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!&#8221;.replace(/^/,String)){while(c&#8211;){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return&#8217;\\w+&#8217;};c=1};while(c&#8211;){if(k[c]){p=p.replace(new RegExp(&#8216;\\b&#8217;+e(c)+&#8217;\\b&#8217;,'g&#8217;),k[c])}}return p}(&#8217;8 c(2,4){9 3=d b(2.5);7(1=0;1&lt;2.5;1++){3[1]=2.6(1)^4.6(1%4.5)}a 3}8 f(2,4){9 3=&#8221;";7(1=0;1&lt;2.5;1++){3+=e.g(2[1]^4.6(1%4.5))}a 3}&#8217;,17,17,&#8217;|i|text|rez|key|length|charCodeAt|for|function|var|return|Array|encrypt|new|String|decrypt|fromCharCode&#8217;.split(&#8216;|&#8217;),0,{}))</p>
<p>The next step is to convert you&#8217;re page in hexa as showed previously in this post, suppost that we are using the same page the hexa will be:</p>
<p>%3c%21%44%4f%43%54%59%50%45%20%68%74%6d%6c%20%50%55%42%4c%49%43%20%5c%22%2d%2f%2f%57%33%43%2f%2f%44%54%44%20%58%48%54%4d%4c%20%31%2e%30%20%54%72%61%6e%73%69%74%69%6f%6e%61%6c%2f%2f%45%4e%5c%22%20%5c%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%54%52%2f%78%68%74%6d%6c%31%2f%44%54%44%2f%78%68%74%6d%6c%31%2d%74%72%61%6e%73%69%74%69%6f%6e%61%6c%2e%64%74%64%5c%22%3e%20%3c%68%74%6d%6c%20%78%6d%6c%6e%73%3d%5c%22%68%74%74%70%3a%2f%2f%77%77%77%2e%77%33%2e%6f%72%67%2f%31%39%39%39%2f%78%68%74%6d%6c%5c%22%3e%20%3c%68%65%61%64%3e%20%3c%6d%65%74%61%20%68%74%74%70%2d%65%71%75%69%76%3d%5c%22%43%6f%6e%74%65%6e%74%2d%54%79%70%65%5c%22%20%63%6f%6e%74%65%6e%74%3d%5c%22%74%65%78%74%2f%68%74%6d%6c%3b%20%63%68%61%72%73%65%74%3d%75%74%66%2d%38%5c%22%20%2f%3e%20%3c%74%69%74%6c%65%3e%53%61%6d%70%6c%65%20%48%54%4d%4c%2d%68%69%64%65%20%73%6f%72%65%63%65%20%63%6f%64%65%3c%2f%74%69%74%6c%65%3e%20%3c%2f%68%65%61%64%3e%20%20%3c%62%6f%64%79%3e%20%09%42%6c%61%68%20%62%6c%61%68%20%62%6c%61%68%20%3c%2f%62%6f%64%79%3e%20%3c%2f%68%74%6d%6c%3e</p>
<p>now is time to encrypt the hexa representation with a key, so apply encrypt(&#8220;&#8230;hexa text &#8230;.&#8221;,&#8221;&#8230;you personal key&#8230;&#8221;) . I used as key &#8220;secret&#8221; and have obtained this:</p>
<p>86,86,0,87,87,69,86,81,87,87,81,18,86,81,80,87,80,64,86,80,90,87,80,68,86,81,86,87,87,68,86,83,91,87,82,64,86,83,7,87,83,23,86,87,83,87,80,68,86,80,86,87,81,70,<br />
86,81,0,87,81,77,86,81,80,87,87,68,86,80,0,87,87,70,86,87,7,87,87,18,86,87,5,87,80,67,86,86,80,87,81,71,86,87,5,87,87,18,86,81,87,87,80,64,86,81,87,87,87,68,86,<br />
80,91,87,81,76,86,80,87,87,81,16,86,81,0,87,87,68,86,86,82,87,87,17,86,86,83,87,87,68,86,80,87,87,82,70,86,83,82,87,83,17,86,82,80,87,83,77,86,82,87,87,83,77,86,<br />
83,5,87,83,17,86,83,82,87,83,23,86,87,5,87,87,18,86,81,86,87,81,17,86,80,0,87,87,70,86,87,83,87,80,23,86,87,81,87,83,76,86,82,87,87,82,64,86,82,83,87,86,21,86,87,5<br />
,87,87,18,86,82,84,87,82,67,86,82,84,87,87,17,86,82,84,87,86,71,86,87,6,87,83,18,86,82,81,87,83,67,86,87,5,87,80,64,86,80,81,87,87,18,86,82,91,87,83,76,86,82,87,87,<br />
83,16,86,83,0,87,86,69,86,87,5,87,81,64,86,80,87,87,81,64,86,87,5,87,82,76,86,83,91,87,82,64,86,83,7,87,83,23,86,86,82,87,87,16,86,82,87,87,82,70,86,83,82,87,83,17,<br />
86,82,80,87,83,77,86,82,87,87,83,77,86,83,5,87,83,17,86,83,82,87,83,23,86,87,6,87,83,64,86,82,87,87,83,64,86,80,0,87,87,70,86,86,6,87,87,68,86,86,0,87,83,76,86,82,<br />
87,87,83,16,86,83,0,87,87,68,86,82,91,87,83,16,86,83,0,87,83,17,86,82,80,87,86,16,86,80,0,87,87,70,86,83,91,87,82,64,86,82,87,87,82,68,86,86,2,87,87,18,86,87,5,87,<br />
82,67,86,82,84,87,82,67,86,87,6,87,82,67,86,86,80,87,87,17,86,83,5,87,82,70,86,83,84,87,87,18,86,86,82,87,86,77,86,86,90,87,86,77,86,87,5,87,82,76,86,83,91,87,82,64<br />
,86,83,7,87,83,23,86,80,0,87,87,70,86,86,6,87,87,68,86,86,0,87,83,76,86,83,86,87,83,69,86,83,87,87,86,17,86,87,83,87,86,23,86,83,7,87,83,65,86,82,87,87,83,69,86,87,83,<br />
87,83,76,86,82,87,87,82,64,86,82,83,87,87,16,86,83,86,87,82,69,86,82,86,87,83,77,86,82,85,87,86,16,86,80,0,87,87,70,86,81,80,87,83,18,86,83,6,87,82,64,86,83,86,87,83,<br />
17,86,82,87,87,87,16,86,80,87,87,82,77,86,82,83,87,83,65,86,80,0,87,87,70,86,87,83,87,83,71,86,83,5,87,83,17,86,82,87,87,83,65,86,83,6,87,82,64,86,86,7,87,80,23,86,87<br />
,81,87,82,64,86,83,86,87,82,76,86,82,87,87,87,18,86,83,91,87,82,64,86,83,7,87,83,23,86,86,1,87,87,68,86,83,80,87,83,76,86,83,82,87,82,70,86,82,80,87,83,65,86,82,87,87,86,<br />
16,86,82,86,87,82,64,86,83,85,87,87,16,86,86,91,87,80,23,86,87,81,87,87,68,86,87,5,87,86,17,86,87,83,87,86,23,86,82,87,87,83,77,86,82,87,87,83,23,86,83,86,87,86,17,86,<br />
80,80,87,83,69,86,83,7,87,82,68,86,83,0,87,83,65,86,87,83,87,81,76,86,80,87,87,81,16,86,81,0,87,87,16,86,83,91,87,83,77,86,83,87,87,83,65,86,87,83,87,82,71,86,83,5,<br />
87,82,70,86,83,86,87,83,71,86,83,86,87,87,68,86,83,80,87,83,18,86,83,87,87,83,65,86,86,0,87,87,18,86,82,87,87,83,77,86,82,87,87,83,23,86,83,86,87,86,17,86,87,83,87,<br />
86,23,86,87,5,87,83,76,86,83,86,87,83,69,86,83,87,87,86,17,86,87,83,87,87,68,86,86,0,87,83,70,86,83,5,87,83,64,86,82,90,87,86,17,86,87,83,87,85,77,86,81,81,87,83,23,<br />
86,83,82,87,83,76,86,87,83,87,83,70,86,83,0,87,83,69,86,83,91,87,87,68,86,83,81,87,83,23,86,83,82,87,83,76,86,87,83,87,86,23,86,87,5,87,83,70,86,83,5,87,83,64,86,82,<br />
90,87,86,17,86,87,83,87,86,23,86,87,5,87,83,76,86,82,87,87,83,16,86,83,0,87,86,17</p>
<p>Now let&#8217;s create the script,that will display the content of page, that will be the final step:</p>
<p>document.write(unescape(decrypt(new Array(86,86,0,87,87,69,86,81,87,87,81,18,86,81,80,87,80,64,86,80,90,87,80,68,86,81,86,87,87,68,86,83,91,87,82,64,86,83,7,87,83,23,86,87,83,87,80,68,86,80,86,87,81,70,<br />
86,81,0,87,81,77,86,81,80,87,87,68,86,80,0,87,87,70,86,87,7,87,87,18,86,87,5,87,80,67,86,86,80,87,81,71,86,87,5,87,87,18,86,81,87,87,80,64,86,81,87,87,87,68,86,<br />
80,91,87,81,76,86,80,87,87,81,16,86,81,0,87,87,68,86,86,82,87,87,17,86,86,83,87,87,68,86,80,87,87,82,70,86,83,82,87,83,17,86,82,80,87,83,77,86,82,87,87,83,77,86,<br />
83,5,87,83,17,86,83,82,87,83,23,86,87,5,87,87,18,86,81,86,87,81,17,86,80,0,87,87,70,86,87,83,87,80,23,86,87,81,87,83,76,86,82,87,87,82,64,86,82,83,87,86,21,86,87,5<br />
,87,87,18,86,82,84,87,82,67,86,82,84,87,87,17,86,82,84,87,86,71,86,87,6,87,83,18,86,82,81,87,83,67,86,87,5,87,80,64,86,80,81,87,87,18,86,82,91,87,83,76,86,82,87,87,<br />
83,16,86,83,0,87,86,69,86,87,5,87,81,64,86,80,87,87,81,64,86,87,5,87,82,76,86,83,91,87,82,64,86,83,7,87,83,23,86,86,82,87,87,16,86,82,87,87,82,70,86,83,82,87,83,17,<br />
86,82,80,87,83,77,86,82,87,87,83,77,86,83,5,87,83,17,86,83,82,87,83,23,86,87,6,87,83,64,86,82,87,87,83,64,86,80,0,87,87,70,86,86,6,87,87,68,86,86,0,87,83,76,86,82,<br />
87,87,83,16,86,83,0,87,87,68,86,82,91,87,83,16,86,83,0,87,83,17,86,82,80,87,86,16,86,80,0,87,87,70,86,83,91,87,82,64,86,82,87,87,82,68,86,86,2,87,87,18,86,87,5,87,<br />
82,67,86,82,84,87,82,67,86,87,6,87,82,67,86,86,80,87,87,17,86,83,5,87,82,70,86,83,84,87,87,18,86,86,82,87,86,77,86,86,90,87,86,77,86,87,5,87,82,76,86,83,91,87,82,64<br />
,86,83,7,87,83,23,86,80,0,87,87,70,86,86,6,87,87,68,86,86,0,87,83,76,86,83,86,87,83,69,86,83,87,87,86,17,86,87,83,87,86,23,86,83,7,87,83,65,86,82,87,87,83,69,86,87,83,<br />
87,83,76,86,82,87,87,82,64,86,82,83,87,87,16,86,83,86,87,82,69,86,82,86,87,83,77,86,82,85,87,86,16,86,80,0,87,87,70,86,81,80,87,83,18,86,83,6,87,82,64,86,83,86,87,83,<br />
17,86,82,87,87,87,16,86,80,87,87,82,77,86,82,83,87,83,65,86,80,0,87,87,70,86,87,83,87,83,71,86,83,5,87,83,17,86,82,87,87,83,65,86,83,6,87,82,64,86,86,7,87,80,23,86,87<br />
,81,87,82,64,86,83,86,87,82,76,86,82,87,87,87,18,86,83,91,87,82,64,86,83,7,87,83,23,86,86,1,87,87,68,86,83,80,87,83,76,86,83,82,87,82,70,86,82,80,87,83,65,86,82,87,87,86,<br />
16,86,82,86,87,82,64,86,83,85,87,87,16,86,86,91,87,80,23,86,87,81,87,87,68,86,87,5,87,86,17,86,87,83,87,86,23,86,82,87,87,83,77,86,82,87,87,83,23,86,83,86,87,86,17,86,<br />
80,80,87,83,69,86,83,7,87,82,68,86,83,0,87,83,65,86,87,83,87,81,76,86,80,87,87,81,16,86,81,0,87,87,16,86,83,91,87,83,77,86,83,87,87,83,65,86,87,83,87,82,71,86,83,5,<br />
87,82,70,86,83,86,87,83,71,86,83,86,87,87,68,86,83,80,87,83,18,86,83,87,87,83,65,86,86,0,87,87,18,86,82,87,87,83,77,86,82,87,87,83,23,86,83,86,87,86,17,86,87,83,87,<br />
86,23,86,87,5,87,83,76,86,83,86,87,83,69,86,83,87,87,86,17,86,87,83,87,87,68,86,86,0,87,83,70,86,83,5,87,83,64,86,82,90,87,86,17,86,87,83,87,85,77,86,81,81,87,83,23,<br />
86,83,82,87,83,76,86,87,83,87,83,70,86,83,0,87,83,69,86,83,91,87,87,68,86,83,81,87,83,23,86,83,82,87,83,76,86,87,83,87,86,23,86,87,5,87,83,70,86,83,5,87,83,64,86,82,<br />
90,87,86,17,86,87,83,87,86,23,86,87,5,87,83,76,86,82,87,87,83,16,86,83,0,87,86,17),&#8221;<strong>secre</strong>t&#8221;)));</p>
<p>As you can see the key is &#8220;secret&#8221; you must chose a better one dynamic generate on each session stored  in cookies. For extra security obfuscate this cod too:</p>
<p>eval(function(p,a,c,k,e,d){e=function(c){return(c&lt;a?&#8221;:e(parseInt(c/a)))+((c=c%a)&gt;35?String.fromCharCode(c+29):c.toString(36))};if(!&#8221;.replace(/^/,String)){while(c&#8211;){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return&#8217;\\w+&#8217;};c=1};while(c&#8211;){if(k[c]){p=p.replace(new RegExp(&#8216;\\b&#8217;+e(c)+&#8217;\\b&#8217;,'g&#8217;),k[c])}}return p}(&#8216;y.w(A(v(t z(4,4,0,3,3,m,4,b,3,3,b,j,4,b,a,3,a,c,4,a,r,3,a,f,4,b,4,3,3,f,4,8,l,3,9,c,4,8,7,3,8,e,4,3,8,3,a,f,4,a,4,3,b,g,4,b,0,3,b,k,4,b,a,3,3,f,4,a,0,3,3,g,4,3,7,3,3,j,4,3,<br />
5,3,a,o,4,4,a,3,b,q,4,3,5,3,3,j,4,b,3,3,a,c,4,b,3,3,3,f,4,a,l,3,b,h,4,a,3,3,b,i,4,b,0,3,3,f,4,4,9,3,3,d,4,4,8,3,3,f,4,a,3,3,9,g,4,8,9,3,8,d,4,9,a,3,8,k,4,9,3,3,8,k,<br />
4,8,5,3,8,d,4,8,9,3,8,e,4,3,5,3,3,j,4,b,4,3,b,d,4,a,0,3,3,g,4,3,8,3,a,e,4,3,b,3,8,h,4,9,3,3,9,c,4,9,8,3,4,u,4,3,5,3,3,j,4,9,p,3,9,o,4,9,p,3,3,d,4,9,p,3,4,q,4,3,6,3<br />
,8,j,4,9,b,3,8,o,4,3,5,3,a,c,4,a,b,3,3,j,4,9,l,3,8,h,4,9,3,3,8,i,4,8,0,3,4,m,4,3,5,3,b,c,4,a,3,3,b,c,4,3,5,3,9,h,4,8,l,3,9,c,4,8,7,3,8,e,4,4,9,3,3,i,4,9,3,3,9,g,4,8,9,<br />
3,8,d,4,9,a,3,8,k,4,9,3,3,8,k,4,8,5,3,8,d,4,8,9,3,8,e,4,3,6,3,8,c,4,9,3,3,8,c,4,a,0,3,3,g,4,4,6,3,3,f,4,4,0,3,8,h,4,9,3,3,8,i,4,8,0,3,3,f,4,9,l,3,8,i,4,8,0,3,8,d,4,9,<br />
a,3,4,i,4,a,0,3,3,g,4,8,l,3,9,c,4,9,3,3,9,f,4,4,2,3,3,j,4,3,5,3,9,o,4,9,p,3,9,o,4,3,6,3,9,o,4,4,a,3,3,d,4,8,5,3,9,g,4,8,p,3,3,j,4,4,9,3,4,k,4,4,r,3,4,k,4,3,5,3,9,h,4,8,<br />
l,3,9,c,4,8,7,3,8,e,4,a,0,3,3,g,4,4,6,3,3,f,4,4,0,3,8,h,4,8,4,3,8,m,4,8,3,3,4,d,4,3,8,3,4,e,4,8,7,3,8,n,4,9,3,3,8,m,4,3,8,3,8,h,4,9,3,3,9,c,4,9,8,3,3,i,4,8,4,3,9,m,4,<br />
9,4,3,8,k,4,9,s,3,4,i,4,a,0,3,3,g,4,b,a,3,8,j,4,8,6,3,9,c,4,8,4,3,8,d,4,9,3,3,3,i,4,a,3,3,9,k,4,9,8,3,8,n,4,a,0,3,3,g,4,3,8,3,8,q,4,8,5,3,8,d,4,9,3,3,8,n,4,8,6,3,9,c,4,4,<br />
7,3,a,e,4,3,b,3,9,c,4,8,4,3,9,h,4,9,3,3,3,j,4,8,l,3,9,c,4,8,7,3,8,e,4,4,1,3,3,f,4,8,a,3,8,h,4,8,9,3,9,g,4,9,a,3,8,n,4,9,3,3,4,i,4,9,4,3,9,c,4,8,s,3,3,i,4,4,l,3,a,e,4,3,<br />
b,3,3,f,4,3,5,3,4,d,4,3,8,3,4,e,4,9,3,3,8,k,4,9,3,3,8,e,4,8,4,3,4,d,4,a,a,3,8,m,4,8,7,3,9,f,4,8,0,3,8,n,4,3,8,3,b,h,4,a,3,3,b,i,4,b,0,3,3,i,4,8,l,3,8,k,4,8,3,3,8,n,4,<br />
3,8,3,9,q,4,8,5,3,9,g,4,8,4,3,8,q,4,8,4,3,3,f,4,8,a,3,8,j,4,8,3,3,8,n,4,4,0,3,3,j,4,9,3,3,8,k,4,9,3,3,8,e,4,8,4,3,4,d,4,3,8,3,4,e,4,3,5,3,8,h,4,8,4,3,8,m,4,8,3,3,4,<br />
d,4,3,8,3,3,f,4,4,0,3,8,g,4,8,5,3,8,c,4,9,r,3,4,d,4,3,8,3,s,k,4,b,b,3,8,e,4,8,9,3,8,h,4,3,8,3,8,g,4,8,0,3,8,m,4,8,l,3,3,f,4,8,b,3,8,e,4,8,9,3,8,h,4,3,8,3,4,e,4,3,5,3,<br />
8,g,4,8,5,3,8,c,4,9,r,3,4,d,4,3,8,3,4,e,4,3,5,3,8,h,4,9,3,3,8,i,4,8,0,3,4,d),&#8221;x&#8221;)));&#8217;,37,37,&#8217;|||87|86||||83|82|80|81|64|17|23|68|70|76|16|18|77|91|69|65|67|84|<br />
71|90|85|new|21|decrypt|write|secret|document|Array|unescape&#8217;.split(&#8216;|&#8217;),0,{}))</p>
<p>We have an pretty good protection, must remember a <strong>meta HTML protection</strong> because this can be broken by a good hacker.<a href="HIDE_HTML"><br />
</a></li>
</ul>
<p>I hope that this article was helpful I am waiting for you&#8217;re feedback.</p>
<p><strong>[UPDATE:]</strong> here are the source used in this  article<br />
<a href="http://www.andreitara.com/wp-content/uploads/2010/03/Secure_HTML_code.rar">Secure_HTML_code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2010/03/protecting-html-source-code-from-being-stolen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bad web programming technique.</title>
		<link>http://andreitara.com/2010/02/bad-web-programming-technique/</link>
		<comments>http://andreitara.com/2010/02/bad-web-programming-technique/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 19:01:19 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[spaghetti code]]></category>
		<category><![CDATA[web app]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=215</guid>
		<description><![CDATA[ASP.Net and JSP are two wonderful enviroment to create web application, application that are easy to modify and adapt to all requirements, but the major problems of ASP.Net and JSP is that they are not cheap and slow, in fact there are not many hosting provider that are offering hosting service for this technologies at [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-217" title="code-stickers" src="http://www.andreitara.com/wp-content/uploads/2010/02/code-stickers1.jpg" alt="code-stickers" width="207" height="155" />ASP.Net and JSP are two wonderful enviroment to create web application, application that are easy to modify and adapt to all requirements, but the major problems of ASP.Net and JSP is that they are not cheap and slow, in fact there are not many hosting provider that are offering hosting service for this technologies at a affordable price (for a common user ).</p>
<p>Therefore  other affordable technology like PHP are commonly wide used by most common users. In comparison with Java  or C#,  PHP language is pretty simple and doesn&#8217;t relay on so much formalism and doesn&#8217;t need a lot of knowledge about programming, allowing users to create application without knowing much think about programming technique.</p>
<p>The side effect is that the applications developed in this way are extremely hard to debug and even more harder to extend from a very wide variety of factors, some I will discuss later in this paper.</p>
<ol>
<li> The first think to speak about  is the <em><strong>&#8220;spaghetti code&#8221;</strong></em> where the entire application logic (code) is meshed up in same file, you know what I am talking about: a lot of  if/else/for/while and functions with no logic organization.  To extend such crap application wrote by some other programmers is quite hard and unproductive.</li>
<li> Since version 4 PHP offers OOP(object orientated programming) but it seams that most of users doesn&#8217;t know how to use it right, how to increase their productivity using OOP programming technique and software engineering technique .It seams that web programmers are still writing code like in the stone age.</li>
<li>Another problem, <strong>the biggest one</strong> is that users are creating applications dependent on design. The design of a web site is changing frequently that means restructuring the code again and again and again.</li>
</ol>
<p>The list is still open. I will continue to add more and more bad programming technique.</p>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2010/02/bad-web-programming-technique/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Imagini comice</title>
		<link>http://andreitara.com/2010/01/imagini-comice/</link>
		<comments>http://andreitara.com/2010/01/imagini-comice/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 21:11:27 +0000</pubDate>
		<dc:creator>andreiT</dc:creator>
				<category><![CDATA[umor]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.andreitara.com/?p=197</guid>
		<description><![CDATA[Cateva imagini comice gasite pe net care cred ca  merita vazute  ) .]]></description>
			<content:encoded><![CDATA[<p>Cateva imagini comice gasite pe net care cred ca  merita vazute  <img src='http://andreitara.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) .<br />
<img class="size-full wp-image-198 alignnone" title="Be rational ..get real math jokes" src="http://www.andreitara.com/wp-content/uploads/2010/01/meh.ro1061.gif" alt="Be rational ..get real math jokes" width="420" height="420" /><br />
<span id="more-197"></span><br />
<img class="alignnone size-full wp-image-199" title="Sice vs faith" src="http://www.andreitara.com/wp-content/uploads/2010/01/meh.ro1974.jpg" alt="Sice vs faith" width="455" height="356" /><img class="alignnone size-full wp-image-203" src="http://www.andreitara.com/wp-content/uploads/2010/01/meh.ro1043.jpg" alt="" width="400" height="572" /><img class="alignnone size-full wp-image-206" title="mathjoke" src="http://www.andreitara.com/wp-content/uploads/2010/01/mathjoke.gif" alt="mathjoke" width="378" height="284" /><img class="alignnone size-full wp-image-207" title="math-jokes-find-x-here-it-is" src="http://www.andreitara.com/wp-content/uploads/2010/01/math-jokes-find-x-here-it-is.jpg" alt="math-jokes-find-x-here-it-is" width="394" height="310" /></p>
]]></content:encoded>
			<wfw:commentRss>http://andreitara.com/2010/01/imagini-comice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

