<?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>16bytes &#187; Uncategorized</title>
	<atom:link href="http://16bytes.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://16bytes.com</link>
	<description>keeping IT open and simple</description>
	<lastBuildDate>Sat, 08 May 2010 11:10:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JDSF Getting Started</title>
		<link>http://16bytes.com/jdsf_getting_started-html/</link>
		<comments>http://16bytes.com/jdsf_getting_started-html/#comments</comments>
		<pubDate>Sat, 08 May 2010 11:10:41 +0000</pubDate>
		<dc:creator>Amir Shevat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://spacebug.com/16bytes/?p=30</guid>
		<description><![CDATA[
Overview
Almost every programmer has got to the point where he worked with  more than one thread, and then started synchronizing them. Today’s  applications become not only multi threaded but also distributed, that  is, an application can run on different processors and even different  computers. Synchronizing such application is a very difficult [...]]]></description>
			<content:encoded><![CDATA[<div>
<h2>Overview</h2>
<p>Almost every programmer has got to the point where he worked with  more than one thread, and then started synchronizing them. Today’s  applications become not only multi threaded but also distributed, that  is, an application can run on different processors and even different  computers. Synchronizing such application is a very difficult task, and  that is where our new project comes handy.</p>
<p>We provide a one class Monitor object that provides distributed getLock,  releaseLock as well as wait-notify functionality.</p>
<h2>Configuration</h2>
<li> Add jdsf.jar into your classpath.</li>
<li> This API is based on JMS. Use the jms.provider JVM property to state the  JMSLoader class being used (fully qualified name is needed)</li>
<h2>Synchronizing</h2>
<p>Use <em>org.jdsf.dl.LockObject</em> to perform distributed  synchronization.</p>
<li> To lock a critical section use LockObject.getLock(&#8220;your string&#8221;) at the  beginning of the section.</li>
<li> To release a critical section use LockObject.releaseLock(&#8220;your string&#8221;)  at the end of the section.</li>
<p>Please note that the lock can be created only on String objects at  this time.</p>
<h2>Wait-notify</h2>
<p>Use <em>org.jdsf.dl.LockObject</em> to perform distributed wait-notify.</p>
<li> To wait for a notification use the LockObject.waitFor(&#8220;your string&#8221;);</li>
<li> To notify a single instance use the LockObject.notifyFor(&#8220;your string&#8221;);</li>
<li>To notify all instances use the LockObject.notifyAllFor(&#8220;your  string&#8221;);</li>
<p>Please note that at the current version the wait and notify method do  not lock/release the distributed monitor.</p>
<p>An example use of JDSF can be found in the current release under the  examples folder.</p>
<p>Each String creates a lock only for the relevant String value, in  this way multiple Distributed lock can be created.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://16bytes.com/jdsf_getting_started-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Java web development easier</title>
		<link>http://16bytes.com/making_java_web_development_easier-html/</link>
		<comments>http://16bytes.com/making_java_web_development_easier-html/#comments</comments>
		<pubDate>Sat, 08 May 2010 11:09:31 +0000</pubDate>
		<dc:creator>Amir Shevat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://spacebug.com/16bytes/?p=28</guid>
		<description><![CDATA[
After a very long time of infrastructure  development I have taken some time to get myself familiar again with web  development and web frameworks. I did not keep my search contained to  the Java domain but I kept coming back to Java because I like java and  because Java provided me [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>After a very long time of infrastructure  development I have taken some time to get myself familiar again with web  development and web frameworks. I did not keep my search contained to  the Java domain but I kept coming back to Java because I like java and  because Java provided me with everything I needed.</p>
<p>Well almost anything….</p>
<p>Most people interact with applications via graphical user interface.  Graphical user interface (such as web interface) exposes the  functionality of the application; it should be easy to use, nice to look  at, personalized and customized to meet all the end-user needs.  This  is a very hard task as is and should not be made more complex by  cumbersome web frameworks. The main problem in J2EE was that developers  must face 100 percent of Java EE&#8217;s complexity even if they only need 20  percent of the services.</p>
<p>To address these issues, several simpler frameworks, all intended to  help developers, were created. One of the most promising and best known  to date is Spring- a simple-to-use application framework that provides  programmers with the same Java EE functionality they need, but with a  fraction of the complexity and cumbersomeness. I have worked a little  with Spring MVC web framework and I enjoyed developing with it.</p>
<p>But, at the risk of sounding greedy, this is not enough. It should be  simpler and easier to develop a well-structured, MVC, web applications.</p>
<p>One way of doing so would  be with the help of graphical tools (an  eclipse plug-in&#8230;)</p>
<p>These tools should help developers:</p>
<li> Automatically create and wire MVC components.</li>
<li> Define web application flows.</li>
<li> Generate automatic validation.</li>
<li> Wire data components with their graphical presentation.</li>
<li> Prevent excessive configuration and configuration errors</li>
</div>
]]></content:encoded>
			<wfw:commentRss>http://16bytes.com/making_java_web_development_easier-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Towards a fully distributed queue (a new idea is born) &#8211; Revisited</title>
		<link>http://16bytes.com/towards_a_fully_distributed_queue_revisited-html/</link>
		<comments>http://16bytes.com/towards_a_fully_distributed_queue_revisited-html/#comments</comments>
		<pubDate>Sat, 08 May 2010 11:07:56 +0000</pubDate>
		<dc:creator>Amir Shevat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://spacebug.com/16bytes/?p=25</guid>
		<description><![CDATA[Not so long ago I have posted a blog in which I talked about my thesis, more precisely about its beginning.  My original idea to study and hopefully come up with a reasonable  implementation of a fully distributed queue has taken a slight detour  (as these things sometimes do). Instead of studying [...]]]></description>
			<content:encoded><![CDATA[<p>Not so long ago I have posted a <a href="http://www.coridan.com/Blog_Item.asp?ppid=2156&amp;pid=2259&amp;nid=10427">blog</a> in which I talked about my thesis, more precisely about its beginning.  My original idea to study and hopefully come up with a reasonable  implementation of a fully distributed queue has taken a slight detour  (as these things sometimes do). Instead of studying only distributed  queues I ended up looking at the relationship between mutual exclusion  algorithms or as they are sometimes called, locking algorithms, and  various distributed data structures such as queues, stacks, linked lists  and even shared counters. Some types of data structures, such as the  shared counters, had more than one implementation, and some of the more  complex data structures made use of lower data structures as their  building blocks. For example a distributed queue made use of a shared  counter.</p>
<p>My thesis work consisted of both theoretical and practical aspects.  My analysis of the data structures’ behavior and relationships was based  on a complex testing framework which I have developed. The framework,  which made use of various open source projects and in particular  MantaRay, allowed me to test the performance of various distributed data  structures using any of the locking algorithms I implemented.</p>
<p>My supervisor, Prof. Gadi Taubenfeld, suggested that I start with  implementing known / existing locking algorithms in order to get some  preliminary numbers. Having thoroughly read and researched papers which  dealt with distributed mutual exclusion, I have decided to stick to the  basics and implement 3 of the more well known and respected algorithms  in the field. The algorithms I implemented were Suzuki-Kasami’s  Token-based Algorithm, Ricart-Agrawala Permission-based Algorithm and  Maekawa’s Permission-based Algorithm.</p>
<p>One of the most challenging aspects of designing and implementing a  locking algorithm or a distributed data structure is making sure that  the implementation is ‘correct’ and scales well under load. In my next  blog I will shade some light on this simple statement which turns out to  be a hell of a lot harder than one might expect</p>
]]></content:encoded>
			<wfw:commentRss>http://16bytes.com/towards_a_fully_distributed_queue_revisited-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I choose Drupal and not joomla / mambo</title>
		<link>http://16bytes.com/why_i_choose_drupal_and_not_joomla-html/</link>
		<comments>http://16bytes.com/why_i_choose_drupal_and_not_joomla-html/#comments</comments>
		<pubDate>Sat, 08 May 2010 11:06:37 +0000</pubDate>
		<dc:creator>Amir Shevat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://spacebug.com/16bytes/?p=23</guid>
		<description><![CDATA[
I figured that for 16bytes.com I would do a new  research on open source CMS. I used Drupal for my last site but was  determined to keep an open mind.
After a quick search in Google I decided to install mambo / joomla. My  first reaction was “WOW, these guys know how to [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>I figured that for 16bytes.com I would do a new  research on open source CMS. I used Drupal for my last site but was  determined to keep an open mind.</p>
<p>After a quick search in Google I decided to install mambo / joomla. My  first reaction was “WOW, these guys know how to do CMS”. The GUI was  great and it looked like a feature-full CMS.</p>
<p>Well, I came to my senses after two days of tedious configuration,  rigid and complex management and a few explorer crashes. Reading a few <a href="http://www.nicklewis.org/mambo-vs-drupal" target="new">blogs</a> made it all clear, Mambo / joomla have great marketing people but they  are still wanting in many CMS aspects. And while Drupal has something to  learn about marketing and professional UI (the default user-interface  of Drupal should be as good as mambo / joomla and currently it is not),  they certainly hit the spot when it comes to CMS.</p>
<p>There are some things that are still missing from Drupal but I can  certainly say – Drupal rocks!</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://16bytes.com/why_i_choose_drupal_and_not_joomla-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweaking FacesIDE Eclipse Plugin for Easier JSF Development with Tomcat</title>
		<link>http://16bytes.com/tweaking_faceside_eclipse_plugin_for_easier_jsf_development_with_tomcat-html/</link>
		<comments>http://16bytes.com/tweaking_faceside_eclipse_plugin_for_easier_jsf_development_with_tomcat-html/#comments</comments>
		<pubDate>Sat, 08 May 2010 11:04:33 +0000</pubDate>
		<dc:creator>Amir Shevat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://spacebug.com/16bytes/?p=20</guid>
		<description><![CDATA[
FacesIDE plugin comes in very handy when you  need to develop JSF applications.
However, when put into work, there are two changes you need to make by  hand to the web.xml file it creates in the project  structure.
This blog shows how to tweak the plugin so you don&#8217;t need to make those  [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>FacesIDE plugin comes in very handy when you  need to develop JSF applications.</p>
<p>However, when put into work, there are two changes you need to make by  hand to the web.xml file it creates in the project  structure.</p>
<p>This blog shows how to tweak the plugin so you don&#8217;t need to make those  changes manually every time you create a new JSF project.</p>
<ol>
<li>Open your eclipse&#8217;s plugins directory (In my installation eclipse is  installed directly under c:\ so the plugins directory is  c:\eclipse\plugins).Find FacesIDE plugin&#8217;s directory &#8211;  c:\eclipse\plugins\tk.eclipse.plugin.jsf_2.0.2\myfaces-1.1.3\conf (the  version number might change depending on the version of the plugin you  have installed).</li>
<li>Find <cite>web.xml</cite> and open it in an editor.</li>
<li>Towards the end of the file you will find the following section:
<pre>&lt;!-- virtual path mapping --&gt;
&lt;!--
    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;

    &lt;/servlet-mapping&gt;
--&gt;
</pre>
<p>The virtual path mapping allows for the JSF Servlet to grab all  requests for JSF pages.</p>
<p>Remove the comment surrounding the servlet-mapping tag and save the  file. You will no longer have to do it manually for every JSF project  you create.</li>
<li>There&#8217;s one more thing you can do in this file, so you won&#8217;t have to  change the filter attribute manually for Tomcat.Find the section starting with :
<pre>    &lt;!-- Extensions Filter --&gt;
</pre>
<p>In the filter-class tag, change the original content of <strong>org.apache.myfaces.component.html.util.ExtensionsFilter</strong> to read <strong>org.apache.myfaces.webapp.filter.ExtensionsFilter</strong></p>
<p>Don&#8217;t forget to save the file.</li>
</ol>
<p>That&#8217;s it. The next JSF project you create using this plugin will  have those two changes ready out-of-the-box for you, and save you some  work.</p>
<p><strong>Explanation:</strong></p>
<p>The FacesIDE plugin creates a file structure for a JSF application  inside your eclipse project. One of the files that the plugin creates is  the <cite>web.xml</cite> file.</p>
<p>What you did just now changes the original <cite>web.xml</cite> file  used by the plugin, and so, the next time the plugin is used, the  altered version will be used.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://16bytes.com/tweaking_faceside_eclipse_plugin_for_easier_jsf_development_with_tomcat-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fix live msn messenger 8.0 when it hangs while “signing in”</title>
		<link>http://16bytes.com/how_to_fix_live_msn_messenger_8_0_when_it_hangs_while_signing_in-html/</link>
		<comments>http://16bytes.com/how_to_fix_live_msn_messenger_8_0_when_it_hangs_while_signing_in-html/#comments</comments>
		<pubDate>Sat, 08 May 2010 11:03:21 +0000</pubDate>
		<dc:creator>Amir Shevat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://spacebug.com/16bytes/?p=18</guid>
		<description><![CDATA[
I have several accounts in my msn messenger.  Yesterday one of my accounts just wouldn’t sign-in.
My live messenger kept trying to sign-in forever, setting a false  password returned an error message and I had no problem sign-in with my  other msn account.
After spending two hours on this problem and in the spirit [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>I have several accounts in my msn messenger.  Yesterday one of my accounts just wouldn’t sign-in.</p>
<p>My live messenger kept trying to sign-in forever, setting a false  password returned an error message and I had no problem sign-in with my  other msn account.<br />
After spending two hours on this problem and in the spirit of 16bytes, I  decided to post the solution to this problem.</p>
<p>I found two solutions on the web, one did not work, but maybe it will  be helpful for others.<br />
<strong>The solution that did not work for me:</strong><br />
<em>“To correct this, click Start, then Run, then type:<br />
%appdata%\microsoft<br />
and click OK.<br />
Right-click the MSN Messenger folder and choose Delete. After all this,  restart Messenger<br />
and see if the problem has been corrected.”</em></p>
<p><a href="http://help.lockergnome.com/windows/MSN-Stuck-Signing-user-account-ftopict182501.html" target="new">Here</a> it is source of this solution</p>
<p>It toke me quite a while to find the other solution, it looked risky  because it involved regedit, but it did the trick.<br />
<strong>The solution that worked:</strong><br />
<em>“1. Hit &#8220;run&#8221; in the start menu<br />
2. Type &#8220;regedit&#8221;<br />
3. Open &#8220;HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger&#8221;<br />
4. Delete the folder called MSN Messenger<br />
5. After this MSN Messenger Live will login as normal.”</em><br />
<a href="http://groups.google.com/group/microsoft.public.msn.messenger/browse_thread/thread/d5fc184a9f5acc76/1ab4a56b92376747?lnk=st&amp;q=live+msn+messenger+stuck+in+signing+in&amp;rnum=1&amp;hl=en#1ab4a56b92376747" target="new">Here</a> it is source of this solution</p>
<p>The second solution involves playing with the computer registry so be  careful and “do not try this at home” if you do not know what your  doing.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://16bytes.com/how_to_fix_live_msn_messenger_8_0_when_it_hangs_while_signing_in-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build your own Geo-Locating solution</title>
		<link>http://16bytes.com/geo_locating-html/</link>
		<comments>http://16bytes.com/geo_locating-html/#comments</comments>
		<pubDate>Sat, 08 May 2010 11:01:37 +0000</pubDate>
		<dc:creator>Amir Shevat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://spacebug.com/16bytes/?p=15</guid>
		<description><![CDATA[Many websites use Geo-Locating services to provide location aware  content, so users will get the content in their language and currency,  and will &#8220;enjoy&#8221; from some targeted adverts.
Geo-location is also required when providing content that is  protected by DRM (Digital Rights Management) and has some geographical  constraints.
On top of that, webmasters [...]]]></description>
			<content:encoded><![CDATA[<p>Many websites use Geo-Locating services to provide location aware  content, so users will get the content in their language and currency,  and will &#8220;enjoy&#8221; from some targeted adverts.</p>
<p>Geo-location is also required when providing content that is  protected by DRM (Digital Rights Management) and has some geographical  constraints.<br />
On top of that, webmasters can benefit from Geo-Locating logs to  analysis their web traffic.</p>
<p>This article explains how to build your own GeoLocating solution by  translating IP address to Country.<br />
At the end of this article, I&#8217;ll show an example of simple Java  implementation of IP-to-Country Geo-Locating tool.</p>
<p><strong>Who manage the IP address allocation space?</strong></p>
<p>There are five Regional Internet Registries (RIR) operating  worldwide. Each one of these not-for-profit organisations is responsible  to manage all internet number resources in its region, as specified at  the following table:</p>
<table>
<tbody>
<tr>
<th width="100">Registry</th>
<th>IPv4 Allocations*</th>
<th>Region</th>
</tr>
<tr>
<td><a href="http://www.afrinic.net/">AfriNIC</a></td>
<td>1%</td>
<td>Africa</td>
</tr>
<tr>
<td><a href="http://www.apnic.net/">APNIC</a></td>
<td>32%</td>
<td>Asia Pacific</td>
</tr>
<tr>
<td><a href="http://www.arin.net/">ARIN</a></td>
<td>30%</td>
<td>Canada, United States and several islands in the Caribbean Sea and  North Atlantic Ocean</td>
</tr>
<tr>
<td><a href="http://www.lacnic.net/">LACNIC</a></td>
<td>4%</td>
<td>Latin America, Caribbean</td>
</tr>
<tr>
<td><a href="http://www.ripe.net/">RIPE NCC</a></td>
<td>33%</td>
<td>Europe, the Middle East and parts of Central Asia</td>
</tr>
</tbody>
</table>
<p><small>* As stated on <a href="http://www.nro.net/">NRO</a> (Number  Resource Organisation) report from September 2006. NRO is the  organisation which is responsible for the joint activities of all  Regional Internet Registries.</small></p>
<p>Historical assignments which are not under Regional Internet Registry  management are still maintained by <a href="http://www.iana.net/">IANA</a></p>
<p><strong>How do I get RIR database?</strong><br />
Each one of the Regional Internet Registries is managing its own  database, and providing access to the database through a dedicated whois  server.<br />
Since hitting the whois servers every time our application is willing to  get some IP information is not a good idea, it makes more sense to  download their entire database.<br />
Each RIR has a different format and a different way to download their  entire database which contains many details as company&#8217;s name. In  addition, that detailed data is protected by some restricted terms and  conditions.<br />
However, since all we want is to get the country for a given IP  addresses, we can just download files in a simplified format called  &#8220;Standard Statistics Exchange Format&#8221;. These files are used by all  regional internet registries, produced daily, and can be downloaded by  saving the following links:</p>
<p><a href="ftp://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-latest">ftp://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-latest</a><br />
<a href="ftp://ftp.apnic.net/pub/stats/apnic/delegated-apnic-latest">ftp://ftp.apnic.net/pub/stats/apnic/delegated-apnic-latest</a><br />
<a href="ftp://ftp.arin.net/pub/stats/arin/delegated-arin-latest">ftp://ftp.arin.net/pub/stats/arin/delegated-arin-latest</a><br />
<a href="ftp://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-latest">ftp://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-latest</a></p>
<p><a href="ftp://ftp.ripe.net/ripe/stats/delegated-ripencc-latest">ftp://ftp.ripe.net/ripe/stats/delegated-ripencc-latest</a><br />
<a href="ftp://ftp.apnic.net/pub/stats/iana/delegated-iana-latest">ftp://ftp.apnic.net/pub/stats/iana/delegated-iana-latest</a></p>
<p><strong>How do I use RIR Statistics Exchange files?</strong><br />
The full specification of the RIR statistics exchange file format can be  found <a href="ftp://ftp.ripe.net/pub/stats/ripencc/RIR-Statistics-Exchange-Format.txt">here</a>.</p>
<p>The following Java class provides geo-locating solution by using RIR  statistics exchange files.<br />
Take a look at the main() method to see an example of how to use this  class.</p>
<pre><code>
/*
 * @(#)GeoLocator.java    1.00 15/10/06
 *
 * Copyright 2006 16Bytes.
 *
 */
package com.sixteenbytes.geolocator;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.net.InetAddress;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.Vector;

/**
 * The GeoLocator class allows applications to support
 * Real Time Geo-Locating solution by using IP allocation database.
 * Before calling the getCountry() method, be sure you loaded
 * all IP ranges by calling addIPRanges().
 *
 * @author  Alon Schreibman
 * @version 1.00, 15/10/06
 */

public class GeoLocator {

    private TreeMap&lt;Long, List&lt;Object&gt;&gt; map = new TreeMap&lt;Long, List&lt;Object&gt;&gt;();

    /**
     * Parse the ipAddress string, and transform it into a single long value
     *
     * @param    ipAddress     a string contains the ip address.
     * @return    the ipAddress in a long format
     */
    protected long ipToLong(String ipAddress)
    {
        StringTokenizer st1 = new StringTokenizer(ipAddress,".");
        long byte1 = Short.parseShort(st1.nextToken());
        long byte2 = Short.parseShort(st1.nextToken());
        long byte3 = Short.parseShort(st1.nextToken());
        long byte4 = Short.parseShort(st1.nextToken());

        return byte1 * 256 * 256 * 256
                + byte2 * 256 * 256
                + byte3 * 256
                + byte4;
    }

    /**
     * Convert IPv4 InetAddress into a single long value
     *
     * @param    ipAddress     a string contains the ip address.
     * @return    the ipAddress in a long format
     */
    protected long ipToLong(InetAddress addr)
    {

        byte[] addrBytes = addr.getAddress();
        long byte1 = (addrBytes[0] &lt; 0 ? addrBytes[0] + 256 : addrBytes[0]);
        long byte2 = (addrBytes[1] &lt; 0 ? addrBytes[1] + 256 : addrBytes[1]);
        long byte3 = (addrBytes[2] &lt; 0 ? addrBytes[2] + 256 : addrBytes[2]);
        long byte4 = (addrBytes[3] &lt; 0 ? addrBytes[2] + 256 : addrBytes[2]);

        return byte1 * 256 * 256 * 256
                + byte2 * 256 * 256
                + byte3 * 256
                + byte4;
    }

    /**
     * Load RIR Statistics Exchange Format file into memory.
     * It is possible to load multiple RIR Statistics Exchange
     * from different registries.
     *
     * @param   fileName     a string to be parsed.
     * @exception FileNotFoundException
     * @exception IOException
     */
    public void addIPRanges(String fileName) throws FileNotFoundException, IOException
    {
        File f = new File(fileName);
        BufferedReader r = new BufferedReader(new FileReader(f));

        r.readLine();
        List&lt;Object&gt; list;
        // for each line in the file

        for (String str = r.readLine(); str != null; str = r.readLine()) {

            // get all tokens

            StringTokenizer st = new StringTokenizer(str, "|");

            if (st.countTokens() == 7) {

                list = new Vector&lt;Object&gt;(7);
                list.add(st.nextToken());
                list.add(st.nextToken());
                list.add(st.nextToken());
                // if it's IPv4 record
                if (list.get(2).equals("ipv4")) {
                    // Create a long which represents the beginning of the IP range
                    Long lIp = new Long(ipToLong(st.nextToken()));
                    list.add(lIp);
                    list.add(new Long(Long.parseLong(st.nextToken())
                            + ((Long) list.get(3)).longValue()));
                    list.add(st.nextToken());
                    list.add(st.nextToken());
                    // use the IP as the index
                    map.put(lIp, list);
                }
            }
        }
        r.close();
    }

    /**
     * Returns a two-letter country code for a givven IPv4 InetAddress
     *
     * @param   addr     string to be parsed.
     * @return the two-letter country code.
     */
    public String getCountry(InetAddress addr) {
        long ipAddress = ipToLong(addr);

        try {
            Object key = map.headMap(new Long(ipAddress + 1)).lastKey();
            List resultRecord = (List) map.get(key);
            if (((Long) resultRecord.get(4)).longValue() &gt;= ipAddress)
                return (String) resultRecord.get(1);
        } catch (NoSuchElementException e) {
//            e.printStackTrace();
        }
        return null;
    }

    public static void main(String[] args) {
        try {

            GeoLocator geoLocator = new GeoLocator();
            geoLocator.addIPRanges("/RIR/delegated-arin-latest.txt");
            geoLocator.addIPRanges("/RIR/delegated-apnic-latest.txt");
            geoLocator.addIPRanges("/RIR/delegated-lacnic-latest.txt");
            geoLocator.addIPRanges("/RIR/delegated-ripencc-latest.txt");
            geoLocator.addIPRanges("/RIR/delegated-afrinic-latest.txt");
            geoLocator.addIPRanges("/RIR/delegated-iana-latest.txt");

            System.out.println(geoLocator.getCountry
               (InetAddress.getByName("80.178.75.155")));
            System.out.println(geoLocator.getCountry
               (InetAddress.getByName("16bytes.com")));

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}

</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://16bytes.com/geo_locating-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure FacesIDE, Tomcat and Eclipse for JSF Development</title>
		<link>http://16bytes.com/configure_faceside_tomcat_and_eclipse_for_jsf_development-html/</link>
		<comments>http://16bytes.com/configure_faceside_tomcat_and_eclipse_for_jsf_development-html/#comments</comments>
		<pubDate>Sat, 08 May 2010 11:00:02 +0000</pubDate>
		<dc:creator>Amir Shevat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://spacebug.com/16bytes/?p=13</guid>
		<description><![CDATA[
This blog shows you how to configure an entirely  open-source JSF development and test platform.
Eclipse can be easily set up to support JSF development with FacesIDE  and Tomcat. The process is quite easy – if you have the right plugins.
In Eclipse architecture, plugins are additions to the basic platform.  Actually, when you [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>This blog shows you how to configure an entirely  open-source JSF development and test platform.</p>
<p>Eclipse can be easily set up to support JSF development with FacesIDE  and Tomcat. The process is quite easy – if you have the right plugins.<br />
In Eclipse architecture, plugins are additions to the basic platform.  Actually, when you install eclipse, many plugins are already there for  you under the hood. They serve as extensions, builts on the basic  functionality provided by the platform.<br />
If you want the basic eclipse to serve as a JSF development workbench, a  good choice would be to add the FacesIDE plugin to it.<br />
FacesIDE is an open source eclipse plugin designed for JSF development.  It contains some functions that allow you to easily make your eclipse  project a JSF project and code away without having to focus on JSF&#8217;s  tidbits.<br />
<strong>What you need:</strong></p>
<ol>
<li>An eclipse installation.<br />
You may have some problems configuring the FacesIDE plugin on eclipse  level lower than 3.2. I prefer using a Callisto distribution but a  simple eclipse should suffice. You may download it from IBM&#8217;s site  (internal links there tend to change a lot, so just go to <a href="http://www.ibm.com/">IBM site</a> and search for &#8216;callisto&#8217;, Select  the Java EE project bundle).</li>
<li>Tomcat.<br />
I use Tomcat 5.5 but any other will do.<br />
You can download Tomcat from <a href="http://tomcat.apache.org/download-55.cgi">here</a> and  installation is quite straightforward</li>
<li>Additionally, you may use SysDEO&#8217;s Tomact plugin to ease  deploying and testing your application. It is downloadable <a href="http://www.sysdeo.com/eclipse/tomcatplugin">here</a>. make sure  that you download the version that supports your version of eclipse.</li>
<li>The FacesIDE plugin.<br />
These are actually two plugins that you need. Both are downloadable from  <a href="http://sourceforge.jp/projects/amateras">here</a>.You need both EclipseHTMLEditor and FacesIDE plugins.</li>
</ol>
<p>You are now ready to set up your environment.</p>
<ol>
<li>If you haven&#8217;t got eclipse installed already, extract the archive  that you downloaded. You can extract it anywhere, but for this tutorial I  assume that it is extracted into c:\.</li>
<li>Install Tomcat if you haven&#8217;t done it yet.</li>
<li>Eclipse&#8217;s file structure is simple. You have a directory called  c:\eclipse. Under this directory you have a plugins directory. This  directory holds all the plugins that you have installed. You will now  add the three plugins there.<br />
Extract both EclipseHTMLEditor and FacesIDE archives to c:\eclipse. The  archives contatin a \plugins directory, and therefore the contents will  be extracted to c:\eclipse\plugins, where plugins should reside.</li>
<li>Install Sysdeo Tomcat plugin under eclipse.Unzip the plugin&#8217;s archive under c:\eclipse\plugins (this archive  does not contain a \plugins directory, so you need to extract it there  yourself).</li>
<li>Configure Eclipse<br />
If you already used this eclipse, you may have to restart it using  –clean attribute on the command (right click the shortcut for eclipse,  and select properties. Enter &#8216;-clean&#8217; at the &#8216;Target&#8217; textbox). Remember  to remove the -clean attribute after you verify that the plugins are  active.</li>
<li>Confirm that the plugins are installed : Before we can start,  we must confirm that eclipse registered the three new plugins.
<ol type="a">
<li>In eclipse, go to the Help menu, and select &#8216;About Eclipse SDK&#8217;.</li>
<li>A pop-up window opens. Click on the button labeled &#8216;Plug-in  Details&#8217;. This should display a list of all the plugins installed.</li>
<li>Scroll down to the bottom of the list. You should see the  following:Click <a href="http://16bytes.com/img/faces1/faces_1.JPG" target="new">here</a> for a full screen image.<br />
Make sure that the FacesIDE, FacesIDE Visual page designer, the  HTML/JSP/XML Editor and the SYSDEO plugins are listed. (They are shown  on the bottom of the list).</li>
<li>If the plugins are not found there, close this list, and click  the &#8216;Configuration Details&#8217; button. Check the error log there to see  what went wrong.</li>
</ol>
</li>
<li>In eclipse&#8217;s main toolbar you should see Tomcat&#8217;s buttons and  menu item. If they are not present, you will need to do the following:
<ol>
<li>From eclipse main menu select Window-&gt;Customize  Perspective-&gt;Commands.</li>
<li>Check the box next to Tomcat in the commands tab and click OK.Click <a href="http://16bytes.com/img/faces1/faces_2.JPG" target="new">here</a> for a full screen image.</li>
</ol>
</li>
<li>Before you can use Tomcat from eclipse, you need to set  Tomcat&#8217;s properties.
<ol type="a">
<li>In eclipse&#8217;s menu select Window-&gt;preferences.Under Tomcat, set the tomcat version you use and Tomcat&#8217;s home.
<p>Click <a href="http://16bytes.com/img/faces1/faces_3.JPG" target="new">here</a> for a full screen image.<br />
In this example I am using Tomcat 5.5, so &#8216;version 5.x&#8217; is selected.  Tomcat home points to the containing directory of Tomcat&#8217;s installation.</li>
<li>If you are using Tomcat version 5.5.12 and above, make sure  that the context declaration mode is &#8216;Context files&#8217;.</li>
<li>Inside the archive for Tomcat&#8217;s plugin there&#8217;s another archive  named DevLoader.zip. extract this archive under %Tomcat&#8217;s  home%\server\classes (On my computer this will be C:\Program  Files\Apache Software Foundation\Tomcat 5.5\server\classes)</li>
<li>The plugin points Tomcat to eclipse&#8217;s default JRE, however,  this must be a JDK and not a JRE (Think: you need to be able to compile  JSP&#8217;s). So, you must make sure that the default runtime for eclipse is  indeed a JDK (Open Window-&gt;Preferences, and expand the Java node.  Under there, check Installed JREs, to make sure that you are indeed  using a JDK as the default one for eclipse).<br />
Check that the configuration is correct by starting Tomcat from eclipse  toolbar. You should see the server starting in the console with no  exceptions :Click <a href="http://16bytes.com/img/faces1/faces_4.JPG" target="new">here</a> for a full screen image.</li>
</ol>
<p><strong>Creating a Tomcat/JSF project</strong><br />
The last part of this blog describes how to create a Tomcat-ready JSF  project in the configuration you just completed. In the next blog I will  show how to create a simple JSF application and deploy it to Tomcat  from within eclipse.</p>
<ol>
<li>A project in eclipse is a container for your code, and it&#8217;s the  first thing you need to create for your JSF application (or any  application for that matter).
<ol type="a">
<li>In eclipse menu, select File-&gt;New-&gt;Project</li>
<li>In the wizard you see, expand &#8216;Java&#8217; and select &#8216;Tomcat  Project&#8217; underneath it. Click on Next.</li>
<li>Enter a name for your project and click Next.</li>
<li>In the next screen you see the &#8216;Context Name&#8217; of your  application. This is the place inside Tomcat that your application will  be deployed. It defaults to the project name.<br />
Additionally you see a &#8216;Subdirectory to set as web application root&#8217;  text box. it defaults to &#8216;/&#8217; &#8211; which means the top level of your project  file-structure. I usually prefer to set it to &#8216;/webcontent&#8217; and work  from there. Click Finish.</li>
</ol>
</li>
<li>Eclipse creates a new project. It is Tomcat-ready, and you can  see it in the Project Explorer view on the left of the eclipse window  (workbench).Inside the project structure it has all the jars and definitions  needed for Tomcat (you can see them in project properties, under Tomcat  section). However, you now need to configure it for JSF development.  (That is: tell eclipse that this is actually a JSF project and not an  ordinary one).<br />
To achieve this, you need to create the file-structure for this project,  and add JSF support. The plugins that you installed previously make  this an easy task.</p>
<ol type="a">
<li>The project contains a &#8216;webcontent&#8217; folder inside (since we asked  for this on project creation). Right click webcontent folder and create a  new folder under it. This new folder will hold the JSF pages that you  develop. Give this folder a meaningful name.</li>
<li>Now we use the FacesIDE plugin to add JSF support to the  project.<br />
Right click the project name in the Package Explorer, and select  New-&gt;Other. In the wizard that you see, expand Amateras node and  select &#8216;Add JSF Support&#8217;.Click Next.<br />
In the next wizard screen you need to supply the Web Application root.  Notice that the wizard defaults to the name of your project, but this  will not do.</p>
<p>The Amateras plugin can not guess where your application root  resides, so you need to manually enter it.<br />
Click the Browse button, and navigate to the root (webcontent folder).  Select it and click on OK.</p>
<p>Make sure that the three checkboxes are checked, and click Finish.<br />
Note: It is possible to create the web root of the application  (webcontent in the example) directly under the project&#8217;s top directory.  In my opinion, though, it is more manageable to divide the files in a  certain directory structure.<br />
Moreover, keeping the structure this way, will ease deployment into  Tomcat later on.</li>
<li>Verify that the application web root is set.<br />
Right click your project, and select properties. In the screen that you  see, select the Amateras node. See that the <strong>Root</strong> points  to your web rootClick <a href="http://16bytes.com/img/faces1/faces_9.JPG" target="new">here</a> for a full screen image.</li>
<li>You need to manually change web.xml for Tomcat to use the  correct listener class for the JSF project.<br />
Open web.xml file under webcontent/WEB-INF and find the listener section  inside it.<br />
change the listener-class tag to point to <strong>org.apache.myfaces.webapp.filter.ExtensionsFilter</strong>.</li>
</ol>
</li>
</ol>
<p>You now have a JSF-oriented eclipse project under your hand. In the  next blog we will use all the setup done here to develop and deploy a  JSF application to Tomcat.</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://16bytes.com/configure_faceside_tomcat_and_eclipse_for_jsf_development-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to turn off the user Account Control in Vista</title>
		<link>http://16bytes.com/how_to_turn_off_the_user_account_control_in_vista-html/</link>
		<comments>http://16bytes.com/how_to_turn_off_the_user_account_control_in_vista-html/#comments</comments>
		<pubDate>Sat, 08 May 2010 10:58:26 +0000</pubDate>
		<dc:creator>Amir Shevat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://spacebug.com/16bytes/?p=11</guid>
		<description><![CDATA[
Windows Vista,  Microsoft’s new operating system, brings many new cool features. It  seems the new look and feel gets all the attention, the famous aero  glass transparency and the amazing new windows browsing 3D effect  (pressing the keyboard’s “Windows” button + TAB) provide a killer user  experience and a better [...]]]></description>
			<content:encoded><![CDATA[<div class="content">
<p>Windows <a title="Windows Vista" href="http://www.microsoft.com/windowsvista/" target="_blank">Vista</a>,  Microsoft’s new operating system, brings many new cool features. It  seems the new look and feel gets all the attention, the famous aero  glass transparency and the amazing new windows browsing 3D effect  (pressing the keyboard’s “Windows” button + TAB) provide a killer user  experience and a better way for us humans to communicate with our  computer.</p>
<p>However, Vista has also provides many more other features besides  User Experience, <a title="Vista main features" href="http://www.microsoft.com/windowsvista/features/default.mspx" target="_blank">features</a> such as Search and Organization, enhanced  networking capabilities, speech recognition and off course, the best  secured version of Windows yet.</p>
<p>The rigorous security includes a very cool <a title="Vista's User  Account Control" href="http://www.microsoft.com/technet/windowsvista/security/uacppr.mspx" target="_blank">User Account Control</a> which isolates “regular” users  from “admin” users. This feature checks whether a given user has enough  permissions before executing certain activities on the OS or before  launching / installing an applications. For example, one can’t register a  new DLL , regsvr32 command,  if he has no admin permissions. Non  administrator users <strong>can NOT</strong> change the date and time, the same  applies for configuring the network and other various tasks. Vista takes  the User Account Control a step further. Even if you are logged-in as  administrator, any application you launch is launched under <strong>regular</strong> user permissions, unless you specifically indicate you want to run this  application as administrator. Only when you right clicking on the  executable and choose “Run as administrator”, the application will run /  installed under administrator permissions, assuming the user really has  administrator permissions.</p>
<p>This is great for standard users whom are afraid to harm their  computer by mistakes. How many times did you have to fix your father  computer after all he did was installing something he downloaded from  the WEB? User Account Control feature protects your Vista from harmful  actions performed by non professional users, this feature simply limits  the amount of damage a non administrator user can inflict on the OS to a  minimum.</p>
<p>But for professional users and IT Pros, this extra security, when  logged as admin, is too much of a hassle. Therefore one can turn off  this feature.</p>
<p>To turn off the User Account Control:</p>
<p>1. Click Start &#8211;&gt; in the search text box simply write users  &#8211;&gt;in the search results choose User Accounts. You can also do it the  old way, click Start &#8211;&gt; Control Panel &#8211;&gt; choose User Accounts.</p>
<p>2. In the User Accounts windows, choose “Turn User Account Control on  or off”, when the “Windows needs you permission to continue” windows  pops-up to insure that you, who is already logged as administrator,  allow this application to launch by pressing Continue.</p>
<p>3. Check out the “User Account Control (UAC) to help protect your  computer” checkbox.</p>
<p>4. Click OK</p>
<p>5. You will need to restart your computer in order for the change to  affect your setting.</p>
<p>Please note: removing this protection may place you computer in harm,  and it is recommended only for IT Pros and professional users – DO NOT  try this at home.</p>
</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">
<h1><a href="http://16bytes.com/How_to_turn_off_the_user_Account_Control_in_Vista.html">How  to turn off the user Account Control in Vista</a></h1>
</div>
]]></content:encoded>
			<wfw:commentRss>http://16bytes.com/how_to_turn_off_the_user_account_control_in_vista-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install PHP5 to run with Apache 2.2 and MySQL 5 on Windows</title>
		<link>http://16bytes.com/how_to_install_php5_apache_2_2_and_mysql_5_on_windows-html/</link>
		<comments>http://16bytes.com/how_to_install_php5_apache_2_2_and_mysql_5_on_windows-html/#comments</comments>
		<pubDate>Sat, 08 May 2010 10:55:00 +0000</pubDate>
		<dc:creator>Amir Shevat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://spacebug.com/16bytes/?p=8</guid>
		<description><![CDATA[I just installed from scratch PHP5 (PHP version 5) to run with MySQL  and Apache HTTP server. Despite the popularity of this configuration, I  spent few hours straggling to set it up. The main reason it was not  straight forward is that most of the “how-to” articles I found on the  [...]]]></description>
			<content:encoded><![CDATA[<p>I just installed from scratch PHP5 (PHP version 5) to run with MySQL  and Apache HTTP server. Despite the popularity of this configuration, I  spent few hours straggling to set it up. The main reason it was not  straight forward is that most of the “how-to” articles I found on the  net were not up-to-date and just didn’t work with the latest version of  Apache, PHP and MySQL.</p>
<p>Nowadays, most of the low cost hosting packages come with PHP and  MySQL. PHP became very popular, with many free scripts available to  download, and writing new PHP scripts is a fast and easy way to build  dynamic and stable web sites.</p>
<p>Installing PHP on your local machine makes testing your PHP scripts  much easier.<br />
Save time on debugging, without the need of uploading your test files to  the server for every minor change you’ve done on your test scripts.</p>
<ul>
<li> <strong>Install and configure Apache 2.2</strong>
<ol>
<li>Download the latest release of Apache HTTP Server from <a href="http://httpd.apache.org/download.cgi">http://httpd.apache.org/download.cgi</a><br />
<code> </code></li>
<li>During installation, you will be asked about your domain name,  server name and e-mail address. Set the domain name and server name to  “localhost”, and enter any e-mail address you want. All these settings  and many others can be altered later by editing the configuration file  C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf</li>
<li>If you are a Windows XP user, you will find the Apache icon on your  taskbar. You can start/stop/restart the service from there, or,  alternatively, you can do it through the Control Panel -&gt;  Administrative Tools -&gt; Services.</li>
<li>If you don’t want to use the default port (port 80), you should open  the configuration file C:\Program Files\Apache Software  Foundation\Apache2.2\conf\httpd.conf, search for “Listen 80”, if it is  commented, uncomment it by removing the “#” and set it to your desired  port.</li>
<li>To make these changes take affect, don’t forget to restart the  Apache server.</li>
<li>Test it by going to <a href="http://localhost/">http://localhost:80</a> through your browser.</li>
<li>Place your web content under C:\Program Files\Apache Software  Foundation\Apache2.2\htdocs</li>
</ol>
</li>
<li> <strong>Install MySQL</strong><br />
It’s really simple to install MySQL. All you have to do is to download  the current release of MySQL for Windows from <a href="http://dev.mysql.com/downloads/">http://dev.mysql.com/downloads/</a> , run the executable and follow the simple instructions.</li>
<li> <strong>Install and configure PHP5 (PHP Version 5.2)</strong>
<ol>
<li>Go to <a href="http://snaps.php.net/">http://snaps.php.net/</a> and  download a zip file with the latest stable version of PHP for Win32  package. At the time I wrote this, the latest version was PHP 5.2.</li>
<li>Extract all the files to c:\php or any folder you choose. Ensure  that php5apache2_2.dll is there. Previous versions of PHP5 come only  with the old php5apache2.dll, and this one doesn’t work with the latest  Apache HTTP server (version 2.2).</li>
<li>Add “C:\php\” and “C:\php\ext\” to the system path variable. You can  do it by going to Control Panel -&gt; System. Click on “Environment  Variables” which is located on the “Advanced” tab, and edit your “Path”  variable. You should append “;C:\php\;C:\php\ext\” to the end of the  path variable value.</li>
<li>Copy c:\php\libmysql.dll to C:\WINDOWS\system32.</li>
<li>Rename c:\php\php.ini-dist to php.ini and edit it with text editor  as notepad. It is recommended to backup it before making the following  changes:
<ul>
<li>Set doc_root = &#8220;C:\Program Files\Apache Software  Foundation\Apache2.2\htdocs&#8221;. the path should be the same one used by  DocumentRoot property in Apache httpd.conf</li>
<li>Set extension_dir = &#8220;C:\php\ext&#8221;</li>
<li>Uncomment by removing the &#8216;;’ from extension=php_mysqli.dll &#8211; if it  doesn&#8217;t exist than add it just before extension=php_mysql.dll.</li>
<li>Uncomment extension=php_mysql.dll</li>
</ul>
</li>
<li>Edit Apache configuration file httpd.conf, and add the following  lines right after the last LoadModule property:<br />
<code><br />
LoadModule php5_module "c:/php/php5apache2_2.dll"<br />
AddType application/x-httpd-php .php .php5<br />
PHPIniDir "c:/php" </code></li>
<li>In the same file, add to the end of “DirectoryIndex” property “  index.php5 index.php”.</li>
<li>Create a new file called phptest.php with the following script.  Replace ‘rootpassword’ with your actual MySQL root password, and place  the file in your apache htdocs folder. Test the Apache-PHP-MySQL  configuration by going to <a href="http://localhost/phptest.php">http://localhost:80/phptest.php</a>
<p>&lt;?php</p>
<p>$mysqli = new mysqli(&#8216;localhost&#8217;,'root&#8217;,'rootpassword&#8217;);<br />
$mysqli-&gt;select_db(&#8216;information_schema&#8217;);</p>
<p>$result = $mysqli-&gt;query(&#8220;SELECT * FROM SCHEMATA&#8221;);</p>
<p>while($row = $result-&gt;fetch_assoc()) {<br />
print $row['SCHEMA_NAME'] . &#8216; &#8211; &#8216; . $row['DEFAULT_CHARACTER_SET_NAME'] .  &#8216;&lt;br/&gt;&#8217;;</p>
<p>}</p>
<p>$result-&gt;close();</p>
<p>?&gt;</li>
<li> If you can get this page, it means that you&#8217;ve successfully installed  everything! However, if this script doesn’t work, try to run a more  simple script that doesn’t use MySQL, but provides you with information  about your PHP setup:<br />
<code><br />
&lt;?php<br />
phpinfo();<br />
?&gt; </code></li>
</ol>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://16bytes.com/how_to_install_php5_apache_2_2_and_mysql_5_on_windows-html/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

