<?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>gHacks technology news &#187; code</title>
	<atom:link href="http://www.ghacks.net/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Tue, 24 Nov 2009 16:29:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How To Display Valid Markup Code In Websites</title>
		<link>http://www.ghacks.net/2009/05/07/how-to-display-valid-markup-code-in-websites/</link>
		<comments>http://www.ghacks.net/2009/05/07/how-to-display-valid-markup-code-in-websites/#comments</comments>
		<pubDate>Thu, 07 May 2009 13:19:48 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html entities]]></category>
		<category><![CDATA[html entities converter]]></category>
		<category><![CDATA[markup code]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[valid code]]></category>
		<category><![CDATA[w3c]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=12644</guid>
		<description><![CDATA[There are two difficulties or problems that Internet users encounter when they want to paste code into forms to display these on the Internet. The first problem that can be encountered is that the website will interpret part or all of the code instead of displaying it. A basic example would be to display the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.ghacks.net/wp-content/uploads/2009/05/w3c.jpg" alt="w3c" title="w3c" width="100" height="86" class="alignleft size-full wp-image-12647" />There are two difficulties or problems that Internet users encounter when they want to paste code into forms to display these on the Internet. The first problem that can be encountered is that the website will interpret part or all of the code instead of displaying it. A basic example would be to display the html code needed to make text linkable on a website. These codes are interpreted by most forms automatically if the user just pastes the code into the form. The second problem that can arise is that the website will not validate because of the way it has been pasted into the form. Displaying the &amp; char will for example return an error when validating the code. This can lead to all kinds of troubles including broken RSS feeds (read: <a href="http://www.ghacks.net/2009/04/14/internet-explorer-8-and-feeds-the-xml-page-cannot-be-displayed/">The XML Feed Cannot Be Displayed</a>).</p>
<p><span id="more-12644"></span>Displaying valid markup code in websites, forums, blogs and any other page is not difficulty. The only thing that needs to be done to achieve this is to convert all entities before pasting the code. This can be done manually or by using a script like that offered at <a href="http://www.spacefem.com/tutorials/makecode.php">Spacefem</a>.</p>
<p>All that needs to be done is to paste the code into the form and click on the Make Code button at the bottom. To display the following code on a website</p>
<p><code>&lt;a href=&quot;http://www.ghacks.net/&quot;&gt;Ghacks&lt;/a&gt;</code></p>
<p>one would have to paste the following code into the form on the website where the code should be displayed</p>
<p><code>&amp;lt;a href=&amp;quot;http://www.ghacks.net/&amp;quot;&amp;gt;Ghacks&amp;lt;/a&amp;gt;</code></p>
<p><img src="http://www.ghacks.net/wp-content/uploads/2009/05/html_entities_converter-500x273.jpg" alt="html entities converter" title="html entities converter" width="500" height="273" class="alignnone size-medium wp-image-12646" /></p>
<p>This is actually the easiest way to ensure that the website will not interpret the code and that the code will be valid markup code.</p>

	Tags: <a href="http://www.ghacks.net/tag/code/" title="code" rel="tag">code</a>, <a href="http://www.ghacks.net/tag/html/" title="html" rel="tag">html</a>, <a href="http://www.ghacks.net/tag/html-entities/" title="html entities" rel="tag">html entities</a>, <a href="http://www.ghacks.net/tag/html-entities-converter/" title="html entities converter" rel="tag">html entities converter</a>, <a href="http://www.ghacks.net/tag/markup-code/" title="markup code" rel="tag">markup code</a>, <a href="http://www.ghacks.net/tag/php/" title="php" rel="tag">php</a>, <a href="http://www.ghacks.net/tag/valid-code/" title="valid code" rel="tag">valid code</a>, <a href="http://www.ghacks.net/tag/w3c/" title="w3c" rel="tag">w3c</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/02/01/web-development-php-what-role-does-it-fill/" title="Web Development: PHP &#8211; what role does it fill (February 1, 2009)">Web Development: PHP &#8211; what role does it fill</a> (1)</li>
	<li><a href="http://www.ghacks.net/2009/01/08/web-development-how-does-php-work/" title="Web Development: How does PHP work? (January 8, 2009)">Web Development: How does PHP work?</a> (21)</li>
	<li><a href="http://www.ghacks.net/2009/03/09/scriptastique-web-development-roundup/" title="Scriptastique web development roundup (March 9, 2009)">Scriptastique web development roundup</a> (4)</li>
	<li><a href="http://www.ghacks.net/2009/02/16/php-what-it-does-and-what-it-doesnt/" title="PHP &#8211; what it does and what it doesn&#8217;t (February 16, 2009)">PHP &#8211; what it does and what it doesn&#8217;t</a> (4)</li>
	<li><a href="http://www.ghacks.net/2009/03/04/how-echo-works-in-php/" title="How echo works in PHP (March 4, 2009)">How echo works in PHP</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/05/07/how-to-display-valid-markup-code-in-websites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Male or Female? Your Browser&#8217;s History Might Tell</title>
		<link>http://www.ghacks.net/2008/07/28/male-or-female-your-browsers-history-might-tell/</link>
		<comments>http://www.ghacks.net/2008/07/28/male-or-female-your-browsers-history-might-tell/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 14:19:00 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Browsing]]></category>
		<category><![CDATA[Entertainment]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[gender]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[quantcast]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=5663</guid>
		<description><![CDATA[A website should not be able to read the the history of websites that a user visited previously. An ingenious CSS hack and some spicy Javascript is however enough to use a trial and error method to find out if a user has been to specific websites.
Some webmasters use this method to display the social [...]]]></description>
			<content:encoded><![CDATA[<p>A website should not be able to read the the history of websites that a user visited previously. An ingenious CSS hack and some spicy Javascript is however enough to use a trial and error method to find out if a user has been to specific websites.</p>
<p>Some webmasters use this method to display the social bookmarking and news batches of websites that their visitors have been through which is very effective in gaining popularity on those websites.</p>
<p><a href="http://www.mikeonads.com/2008/07/13/using-your-browser-url-history-estimate-gender/">Others</a> came up with a script that is using this method to estimate if the visitor is male or female. The Javascript makes use of the Quantcast Top 10K websites and the male:female ratio that they provide plus a neat algorithm to compute the percentages for male and female likeliness.</p>
<p><span id="more-5663"></span>Mine turned out 50/50 because I don&#8217;t use the history at all. Good luck and let me know what the script thinks about your gender..</p>
<p>The same principle could possible be used to display targeted advertisements. Have been to a lot of parenting websites lately? How about parenting ads? Like sports? How about an ESPN subscription? It&#8217;s a bit scary, don&#8217;t you think?</p>

	Tags: <a href="http://www.ghacks.net/tag/code/" title="code" rel="tag">code</a>, <a href="http://www.ghacks.net/tag/gender/" title="gender" rel="tag">gender</a>, <a href="http://www.ghacks.net/tag/history/" title="history" rel="tag">history</a>, <a href="http://www.ghacks.net/tag/javascript/" title="javascript" rel="tag">javascript</a>, <a href="http://www.ghacks.net/tag/quantcast/" title="quantcast" rel="tag">quantcast</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2008/06/27/you-better-stop-using-internet-explorer-for-now/" title="You better stop using Internet Explorer for now (June 27, 2008)">You better stop using Internet Explorer for now</a> (18)</li>
	<li><a href="http://www.ghacks.net/2008/01/10/watch-documentaries-online/" title="Watch Documentaries Online (January 10, 2008)">Watch Documentaries Online</a> (7)</li>
	<li><a href="http://www.ghacks.net/2008/08/19/view-javascript-sources-with-jsview/" title="View Javascript Sources with JSView (August 19, 2008)">View Javascript Sources with JSView</a> (1)</li>
	<li><a href="http://www.ghacks.net/2008/10/17/test-your-browsers-javascript-performance/" title="Test Your Browser&#8217;s JavaScript Performance (October 17, 2008)">Test Your Browser&#8217;s JavaScript Performance</a> (5)</li>
	<li><a href="http://www.ghacks.net/2009/07/11/speed-up-firefox-by-limiting-the-history/" title="Speed Up Firefox By Limiting The History (July 11, 2009)">Speed Up Firefox By Limiting The History</a> (5)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2008/07/28/male-or-female-your-browsers-history-might-tell/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
