<?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>Talkwards &#187; Computer Architecture</title>
	<atom:link href="http://www.talkwards.com/category/computers-and-internet/computer-architecture/feed" rel="self" type="application/rss+xml" />
	<link>http://www.talkwards.com</link>
	<description>Advancing Talkwards...</description>
	<lastBuildDate>Sat, 03 Sep 2011 16:33:28 +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>Compiling to different versions of Java in Eclipse</title>
		<link>http://www.talkwards.com/2008/11/compiling-to-different-versions-of-java-in-eclipse</link>
		<comments>http://www.talkwards.com/2008/11/compiling-to-different-versions-of-java-in-eclipse#comments</comments>
		<pubDate>Fri, 21 Nov 2008 22:00:50 +0000</pubDate>
		<dc:creator>Hoakz</dc:creator>
				<category><![CDATA[Computer Architecture]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Apache Tomcat]]></category>
		<category><![CDATA[configuration management]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[runtime errors]]></category>

		<guid isPermaLink="false">http://www.talkwards.com/?p=440</guid>
		<description><![CDATA[I&#8217;ve just had the rather unsettling experience of trying to deploy a new jar file (one I recompiled after some changes). This file were to be deployed on a rather old set up of Java 1.4.2. On first try everything broke with the classic &#8220;Unsupported major.minor version 50.0&#8243;. So I went back to the drawing [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just had the rather unsettling experience of trying to deploy a new jar file (one I recompiled after some changes).  This file were to be deployed on a rather old set up of Java 1.4.2.  On first try everything broke with the classic &#8220;Unsupported major.minor version 50.0&#8243;.</p>
<p>So I went back to the drawing board.  I installed java 1.4, and made sure my development Tomcat was running it.  Then I did some research and found out how to make Eclipse compile 1.4 compliant code.  I started and I got the same error still.</p>
<p>Once I figured out what was wrong I realized I was an idiot (Doh!).  The error I&#8217;ve gotten wasn&#8217;t for any file part of the jar I was trying to deploy but for &#8220;index_jsp&#8221;.  The thing is my Tomcat compiled my JSP:s into class files and never looked at them again until they were changed.  I am sure there&#8217;s several ways to solve the problem, I just went and deleted the files in the &#8220;work&#8221;-directory (those pertaining to my Context).</p>
<div id="attachment_442" class="wp-caption alignright" style="width: 310px"><a href="http://www.talkwards.com/wp-content/uploads/2008/11/eclipse-source-target-versions.png"><img class="size-medium wp-image-442" title="The Eclipse preferences window" src="http://www.talkwards.com/wp-content/uploads/2008/11/eclipse-source-target-versions-300x269.png" alt="The preferences window for setting source and target versions for java compilation" width="300" height="269" /></a><p class="wp-caption-text">The preferences window for setting source and target versions for Java compilation</p></div>
<p>Now over to how to make Eclipse code projects to a certain Java version.</p>
<p>There are two values you will want to keep track of.  The source version and the target version.  The source version tells what version your source code is written in.  Whereas the target version tells what version of Java you want your class files in.</p>
<p>If for instance you have a project written in Java 1.4 source style, but you have to run it on a Java 5 you&#8217;d set the source version to 1.4 and the target to 1.5. You are now compiling Java 1.4 source into Java 5 class files.  Unfortunately you&#8217;re not able to do the opposite, compile Java 5 source code into Java 1.4 class files.  This is probably due to API incompatibilities, Java 5 has a larger API than Java 1.4.</p>
<p>Now, in Eclipse you have two settings in three places that controls the source and target versions of your compilations.  Under Window-&gt;Preferences-&gt;Java-&gt;Compiler (Eclipse 3.4) you&#8217;re able to set the versions for the whole IDE.</p>
<p>When you create a new project you&#8217;re able to determine what version of Java (source and target you want) and right clicking on a project and choosing Properties-&gt;Java Compiler, you have the same dialog as before.</p>
<p>You set the target level in the select box &#8220;Compiler compliance level&#8221;, and optionally by unchecking the &#8220;Use default compliance settings&#8221; you&#8217;re able to change the target (&#8220;Generated .class files compatibility&#8221;) and source respectively.</p>
<p>If you experience other problems you may want to &#8220;clean&#8221; your project(s).  Cleaning a project means all compiled files are removed and all source files are recompiled (something the IDE will do by itself when you change compilation versions, but if you want to be sure, you can do it manually).  This is done by choosing Project-&gt;Clean.  In the dialog you can chose to clean all projects or just those you select.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.talkwards.com%2F2008%2F11%2Fcompiling-to-different-versions-of-java-in-eclipse&amp;title=Compiling%20to%20different%20versions%20of%20Java%20in%20Eclipse" id="wpa2a_2"><img src="http://www.talkwards.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.talkwards.com/2008/11/compiling-to-different-versions-of-java-in-eclipse/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Injections, the two most common types</title>
		<link>http://www.talkwards.com/2008/11/sql-injections-the-two-most-common-types</link>
		<comments>http://www.talkwards.com/2008/11/sql-injections-the-two-most-common-types#comments</comments>
		<pubDate>Fri, 14 Nov 2008 22:00:03 +0000</pubDate>
		<dc:creator>Hoakz</dc:creator>
				<category><![CDATA[Computer Architecture]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL-injections]]></category>
		<category><![CDATA[web programming]]></category>

		<guid isPermaLink="false">http://www.talkwards.com/?p=434</guid>
		<description><![CDATA[What is an SQL-injection. How can it affect my site. How does it happen and how can I avoid it? Since Firefox (2 and 3) and MSIE 7 started using Google&#8217;s (and others) system for blocking sites that produce harmful web pages the problem with SQL-injections have been put on the spot. What happens is [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_471" class="wp-caption alignright" style="width: 310px"><a href="http://www.talkwards.com/wp-content/uploads/2008/11/reported-attack-site.png"><img class="size-medium wp-image-471" title="Reported Attack Site" src="http://www.talkwards.com/wp-content/uploads/2008/11/reported-attack-site-300x203.png" alt="Opening a site Google has listed as spreading malicious software via the browser." width="300" height="203" /></a><p class="wp-caption-text">Opening a site Google has listed as spreading malicious software via the browser.</p></div>
<p>What is an SQL-injection.  How can it affect my site.  How does it happen and how can I avoid it?</p>
<p>Since Firefox (2 and 3) and MSIE 7 started using Google&#8217;s (and others) system for blocking sites that produce harmful web pages the problem with SQL-injections have been put on the spot.</p>
<p>What happens is that an attacker hacks a site by placing their own SQL-code into the database of the victim system.  Instead of just performing a DOS (<a href="http://en.wikipedia.org/wiki/Denial_of_service" target="_blank">denial of service</a>) attack bringing the whole site down by for instance deleting all the tables or doing something else harmful to the site the attacker plants client side browser code in the database making all visitors run client side code that will infect their computer with a virus.  This virus may do everything from listening in on traffic between the client (web browser) and bank applications, to connecting the client system to a <a href="http://en.wikipedia.org/wiki/Bot_net" target="_blank">botnet</a>.</p>
<p>Needless to say, the SQL-injection attack has become a problem not so much for the owner of the originally defunct site as for the visitors to said site.  (Although users of the web should not underestimate the consequence of a good virus protection, system update policy and secure browsing policy).</p>
<p>Since the owner of the vulnerable software won&#8217;t notice any detour from business as usual (and neither will most infected clients), nobody is the wiser to the problem.</p>
<p>This is why Google (and others) have started evaluating (and flagging) sites with bad content, and why Firefox and MSIE (and probably others) have started blocking them.</p>
<p><span id="more-434"></span></p>
<h4>What is an SQL-injection?</h4>
<p>The short explanation (hinted above) is that an <a href="http://en.wikipedia.org/wiki/SQL_injection" target="_blank">SQL-injection</a> is an attack where the attacker inserts their own SQL code into the attacked system, and thus alters the database content of the attacked system.  Either wrecks havoc by destroying part of or the whole system, or by inserting virus spreading code onto the pages of the attacked site (if their content is stored in the database).</p>
<h4>How is an SQL-injection attack performed?</h4>
<p>There are two major ways of doing this (and in order to follow this part of the conversation you will need to know a bit of SQL).</p>
<p>The first method of performing an SQL-injection is by manipulating the input to different kinds of forms on the site (search forms, contact forms, and other places where the user can put information into the system).</p>
<p>To understand this attack you need a basic understanding of SQL.</p>
<p>Imagine we have a database table with products, each having a color, and we want to list all products that are &#8216;green&#8217;.  This would be done with the following question:</p>
<blockquote>
<pre>SELECT * FROM products WHERE color = 'green';</pre>
</blockquote>
<p>Each database command is ended with a semicolon (;), and all literal strings are enclosed by single quotes (&#8216;).  So issuing two commands in a row would look something like:</p>
<blockquote>
<pre>SELECT * FROM products WHERE color = 'green';
UPDATE products SET hasBeenSearchedFor = 'true' WHERE color = 'green';</pre>
</blockquote>
<p>Notice the semicolons and the single quotes.  You do not need to understand what the commands do in order to understand the rest.</p>
<p>Now imagine that we get the value &#8216;green&#8217; from an application the user can input data into.  As long as the user types things like green, red, blue everything is safe, but what would happen if the user typed in the following as a color?</p>
<blockquote>
<pre>'; do harmful thing to database; '</pre>
</blockquote>
<p>In an unprotected system the SQL-string is usually tacked together one part after the other without checking if the search parameter is valid or sane.  Imagine the search command is built in the following way (double quotes are used in most systems to create strings, they are not to be confused with the single quotes of the database query):</p>
<blockquote>
<pre>sql = "SELECT * FROM products WHERE color = '" + colorValue + "'";</pre>
</blockquote>
<p>Now if a user would put the above value into the color search (placing it in &#8220;colorValue&#8221;) the value of the sql string (and what would be passed on to the database would be):</p>
<blockquote>
<pre>"SELECT * FROM products WHERE color = '" +
          "'; do harmful thing to database; '" + "'"</pre>
</blockquote>
<p>This in turn would evaluate to:</p>
<blockquote>
<pre>SELECT * FROM products WHERE color = ''; do harmful thing to database; ''</pre>
</blockquote>
<p>I.e. select all products with an empty color value, then &#8220;do harmful thing to database&#8221;.  After that the SQL-server will encounter the empty quotes and issue an error.</p>
<p>If the database question is executed in a transaction all changes will be rolled back, however this is a rather weak defense against SQL-injections since it is possible to input values that will create three valid commands easily.  (I&#8217;ll leave that up to the fantasy of the reader!)</p>
<p>The second way of performing an SQL-injection attack is to tack on values to numerical input to the system.  Pages that display products, user profiles, or any other information easily mapped to a row in a database table are usually candidates for this kind of attack.</p>
<p>Imagine a page that displays a product profile.  It might be called with the following URL:</p>
<blockquote>
<pre>http://www.mysite.com/showProduct?productid=123</pre>
</blockquote>
<p>The &#8220;productid&#8221; value will then be passed on to make the following database question:</p>
<blockquote>
<pre>sql = "SELECT * FROM products WHERE id = " + productid;</pre>
</blockquote>
<p>Here the attacker does not even have to add a single quote to get an extra SQL-command.  All they need to do is add a trailing &#8220;;&#8221; and they&#8217;re in.  The only complicating factor is that the URL used to call the system will have to be URL-encoded in order for this attack to work, but that&#8217;s far from a problem even for an unskilled attacker.</p>
<h4>How do you protect against SQL-injections?</h4>
<p>The key concept is: never, NEVER, <strong>NEVER</strong>, trust input from a user!</p>
<p>That&#8217;s right.  NEVER TRUST THE USER.</p>
<p>Don&#8217;t ask what-if a user tries to gain access to our system.</p>
<p>Say WHEN the user tries to gain access to our system, then we&#8217;re gonna&#8230;.</p>
<p>The short, technical answer (for Java, .NET and similar languages) is to NEVER build SQL-strings like shown above.  Use &#8220;prepared statements&#8221; or similar constructs where the input variables can be tested by JDBC (or ADODB or LINQ or similar framworks).</p>
<p>Another safe way to go is to use stored procedures.  These are not just optimized for speed and performance, they are also, almost always strongly typed, disallowing the kind of problems displayed above.</p>
<p>If neither of these are feasible always make sure the input&#8217;s single quotes are filtered away or &#8220;escaped&#8221;.  Escaping a single quote means that all databases have support for using single quotes as values in a table column, if you prepend them with a backslash (\) or use double single quotes (&#8221;, that&#8217;s two single quotes).  Do this programatically before sending the data on to the database.</p>
<p>Protecting against attacks on pages with numerical input is even simpler.  If there&#8217;s a number input value, make sure it is numerical by translating it into a number before passing it on to the database (input from web applications are almost always sent as strings, but if a value should be a number, make sure it is!)</p>
<p>Part from this a sound backup and restore policy is a sure way to not only protect hours of time invested in putting information into the system but the users trust in the system, and the time it will take to get a blocked site back up on its feet.</p>
<p>Read more about SQL-injections here: <a href="http://en.wikipedia.org/wiki/SQL_injection" target="_blank">http://en.wikipedia.org/wiki/SQL_injection</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.talkwards.com%2F2008%2F11%2Fsql-injections-the-two-most-common-types&amp;title=SQL%20Injections%2C%20the%20two%20most%20common%20types" id="wpa2a_4"><img src="http://www.talkwards.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.talkwards.com/2008/11/sql-injections-the-two-most-common-types/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Who writes GNU/Linux?</title>
		<link>http://www.talkwards.com/2008/10/who-writes-gnulinux</link>
		<comments>http://www.talkwards.com/2008/10/who-writes-gnulinux#comments</comments>
		<pubDate>Fri, 24 Oct 2008 22:00:54 +0000</pubDate>
		<dc:creator>Hoakz</dc:creator>
				<category><![CDATA[Computer Architecture]]></category>
		<category><![CDATA[Computer Operating Systems]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[OpenOffice.org]]></category>

		<guid isPermaLink="false">http://www.hoakz.com/blog/?p=250</guid>
		<description><![CDATA[You may have thought GNU/Linux was written by idealistic Unix Gurus camped up with a bunch of Jolt-Colas in their mom&#8217;s basement, but a recent report from the Linux Foundation states the opposite. Since Linux kernel version 2.6.11 in Mars 2005 the number of developers has grown from 483 to 1,057 in version 2.6.24 (January [...]]]></description>
			<content:encoded><![CDATA[<p>You may have thought GNU/Linux was written by idealistic Unix Gurus camped up with a bunch of Jolt-Colas in their mom&#8217;s basement, but <a href="http://www.linuxfoundation.org/publications/linuxkerneldevelopment.php" target="_blank">a recent report</a> from <a href="https://www.linuxfoundation.org/" target="_blank">the Linux Foundation</a> states the opposite.  Since Linux kernel version 2.6.11 in Mars 2005 the number of developers has grown from 483 to 1,057 in version 2.6.24 (January 2008).  However, the number of sponsoring companies has also grown from 71 to 186 in the same time.</p>
<p>The major contributors aren&#8217;t Mom&#8217;s Basement Inc. either. Companies like Novell, IBM, Intel, SGI, Oracle, Google and HP rank among the 20 largest contributors (counted in number of sponsored changes, and here sponsoring means paying employees to program those changes).</p>
<p>This is just the Linux kernel (some 8.5 &#8211; 9 million lines of code). However, the Linux kernel in itself is of little use to anyone. You have to add the <a href="http://www.gnu.org/" target="_blank">GNU</a> part of GNU/Linux, consisting of commands like fdisk, aspell, bison, ghostview, and wget to that, and you&#8217;ll be looking at a much larger number of lines of code.  If we go even further adding programs from other projects (like the Mozilla project&#8217;s FireFox web browser, or the OpenOffice suite) more lines of code are added (for exact numbers see <a href="http://www.ohloh.net/projects/" target="_blank">ohloh.net</a>), and we&#8217;re still talking about programs supported by large companies (<a href="http://www.openoffice.org/press/ibm_press_release.html" target="_blank">IBM</a>, <a href="http://www.sun.com/2006-1113/feature/" target="_blank">Sun</a>, etc).</p>
<p>To sum it all up: no,  GNU/Linux is not being written by enthusiasts in the basement anymore.  It&#8217;s being written by large corporations for competitive reasons.  Hardware manufacturers wants to make sure Linux will work on their hardware, software companies can be anything from Linux distribution owners (Red Hat, Novell, MontaVista), use embedded versions of Linux in their consumer hardware (Sony, Nokia, Samsung), or for other reasons (for instance <a href="http://lwn.net/Articles/253425/" target="_blank">Volkswagen uses Linux</a> for in-car networking between different components).</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.talkwards.com%2F2008%2F10%2Fwho-writes-gnulinux&amp;title=Who%20writes%20GNU%2FLinux%3F" id="wpa2a_6"><img src="http://www.talkwards.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.talkwards.com/2008/10/who-writes-gnulinux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DVDs catching up?</title>
		<link>http://www.talkwards.com/2007/07/dvds-catching-up</link>
		<comments>http://www.talkwards.com/2007/07/dvds-catching-up#comments</comments>
		<pubDate>Sun, 08 Jul 2007 02:00:43 +0000</pubDate>
		<dc:creator>Hoakz</dc:creator>
				<category><![CDATA[Computer Architecture]]></category>
		<category><![CDATA[CD]]></category>
		<category><![CDATA[DVD]]></category>
		<category><![CDATA[storage media]]></category>

		<guid isPermaLink="false">http://www.hoakz.com/blog/?p=24</guid>
		<description><![CDATA[Once upon a time a CD was large. Huge. You used it to save lots and lots of data. Then came MP3s, movies, digital cameras with millions of pixels and suddenly the CD was small. And the DVD came, and for a while it was large&#8230; I don&#8217;t think it ever was huge. Today I [...]]]></description>
			<content:encoded><![CDATA[<p>Once upon a time a CD was large.  Huge.  You used it to save lots and lots of data.</p>
<p>Then came MP3s, movies, digital cameras with millions of pixels and suddenly the CD was small. And the DVD came, and for a while it was large&#8230; I don&#8217;t think it ever was huge.</p>
<p>Today I would have to use more than 300 4.4 GB DVDs to save all my data, and that only includes the data on hard drives. Making back-ups becomes a question of selecting what to back-up and what to leave for chance. A real pain.</p>
<p>But there might be light at the end of the tunnel.<a href="http://arstechnica.com/news.ars/post/20070707-microholography-milks-500gb-out-of-dvd-sized-discs.html"></a></p>
<p><a href="http://arstechnica.com/news.ars/post/20070707-microholography-milks-500gb-out-of-dvd-sized-discs.html">Researches at the Technical University of Berlin claims they&#8217;ve managed to put up to 500 GB of data on a CD/DVD-sized disc</a></p>
<p>This is (layman&#8217;s interpretation) done by using holograms. The disc is transparent (wonder how that will work with labeling?) and uses ten layers of data (to compare with blu-rays that use two, and ordinary DVDs that use one). Anyway, sometime around 2010 they might be able to fit as much as 1 Terabyte to a CD-sized disc.</p>
<p>That&#8217;s probably the same time as hard drives comes in 10-20 Terabyte sizes, and soon after the 1TB DVD will once more be insufficient.</p>
<p>Wheehoo&#8230;</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.talkwards.com%2F2007%2F07%2Fdvds-catching-up&amp;title=DVDs%20catching%20up%3F" id="wpa2a_8"><img src="http://www.talkwards.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.talkwards.com/2007/07/dvds-catching-up/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

