<?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>Who So &#187; Webdevelopment</title>
	<atom:link href="http://www.trondhuso.no/blog/category/webdevelopment/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.trondhuso.no/blog</link>
	<description>Blog about PHP, HTML, CSS, patents and all things inbetween</description>
	<lastBuildDate>Tue, 20 Dec 2011 23:45:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Standards matter</title>
		<link>http://www.trondhuso.no/blog/2010/06/22/standards-matter/</link>
		<comments>http://www.trondhuso.no/blog/2010/06/22/standards-matter/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 08:30:29 +0000</pubDate>
		<dc:creator>Trond Husø</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Webdevelopment]]></category>

		<guid isPermaLink="false">http://www.trondhuso.no/blog/?p=261</guid>
		<description><![CDATA[Some thoughts regarding the Browser World War 2 in 2010.]]></description>
			<content:encoded><![CDATA[<p>I am not that great fan of Apple, but sometimes they have an idea of doing things correctly (like when they built the iPod). It&#8217;s when they start getting proprietary that everything hits the fan.<br />
This is what they&#8217;ve said recently:</p>
<blockquote><p><a href="http://www.apple.com/safari/what-is.html" target="_blank">Standards matter. Before standards, every browser had its own play book.</a> With standards, every browser’s on the same page. Great for developers, standards let them create sites that work on all browsers out of the box. Great for the browsing public, they ensure that you enjoy a great experience on every site you visit. And these technologies are free for anyone to use.</p></blockquote>
<p>I am currently spending some time checking out <a href="http://dev.w3.org/html5/spec/Overview.html">HTML5</a> and <a href="http://www.w3.org/Style/CSS/current-work">CSS3</a>. And from what I can see the browser world is now just as unsynchronized as it was in the first browser war.<br />
My inspiration for checking the new features in HTML5 and CSS3 is the fact that so many people are saying that with HTML5 (and CSS3) Flash is dead. </p>
<p>Well. </p>
<p>The good thing about Flash is that it runs on all platforms, though really slow on iPads and iPhones &#8211; but that&#8217;s another issue. It is browser independent, which makes it look the same in all browsers. That&#8217;s what makes Flash a graphic designers choice instead of HTML5/CSS3.<br />
An example I can use is this:<br />
Let&#8217;s say there is a website wanting to show information about the players on the teams playing in the World Cup in South Africa (in 2010). The designer want some animation like flipping cards, sliding in/sliding out and so on. Let&#8217;s say the company creating this application wants to use HTML5. Well, he can&#8217;t:</p>
<ol>
<li><a href="http://www.microsoft.com/windows/internet-explorer/default.aspx" target="_blank">Internet Explorer</a> (from 6 up to current build of IE) does not understand all the 3d-stuff in CSS3</li>
<li><a href="http://www.getfirefox.com" target="_blank">Firefox 3.6</a> (and most likely 3.7) does not understand all the 3d-stuff in CSS3</li>
<li><a href="http://www.opera.no" target="_opera">Opera</a> 10.5 (and most likely 10.6) does not understand all the 3d-stuff in CSS3</li>
<li><a href="http://www.google.com/chrome/">Chrome</a> 5 does not understand all the 3d-stuff in CSS3</li>
</ol>
<p>So there is only Safari (with about 5% of the market) that understands the 3d-stuff in CSS3. Which is not so weird. Apple was one of the promoters of 3D-transformations in CSS.<br />
Also: In Flash there is only one build. There are no specific style sheet for IE(6-X), Firefox, Webkit/Chrome/Safari or Opera. There are no need for [IF IE] in the HTML/CSS-code. </p>
<p>I do hope that the developers and the designers who works with CSS3 and HTML5 at Apple will become advocates of standards and that they will fight for this in their forums. I experienced the lasts browser war (which Microsoft claims it won&#8230; you don&#8217;t win wars, ok! and&#8230; look where it left us: With IE6 still being widely used in 2010!!!). I don&#8217;t want another one in 2010. </p>
<p>And I think there is only one way we can achieve a compliant standard that all browse vendors will follow: Start thinking of your users and the web developers. Stop creating HTML/CSS rendering engines. Standardize on one or two (Webkit and Mozilla, with the latter also being the one to disappear).<br />
Sorry Microsoft. When you are nine years behind&#8230; although you did invent the XMLhttpRequest, most important part of AJAX, why not start contributing to an open source project instead?<br />
And sorry Opera. Your market share is way to small, and I think you are better off using one of the other engines and start contributing to those instead. And: Three is one to many (or three is a crowd as the saying goes).</p>
<p>So what shall the vendors do when they cannot focus on their own engine? </p>
<ul>
<li>Contribute to the two standard engines (webkit/mozilla)</li>
<li>Focus on making the best <strong>looking</strong>, <strong>fastest</strong> or <strong>functional</strong> browser out there.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.trondhuso.no/blog/2010/06/22/standards-matter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proposal: Windows-tag in HTML5</title>
		<link>http://www.trondhuso.no/blog/2010/05/25/proposal-in-html5/</link>
		<comments>http://www.trondhuso.no/blog/2010/05/25/proposal-in-html5/#comments</comments>
		<pubDate>Tue, 25 May 2010 07:31:08 +0000</pubDate>
		<dc:creator>Trond Husø</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Webdevelopment]]></category>

		<guid isPermaLink="false">http://www.trondhuso.no/blog/?p=251</guid>
		<description><![CDATA[Suggestion: windows tag Usage: If you want to create a modal form/window, a &#8220;popup&#8221; or a lightbox you have to use Javascript. I am suggesting this tag to remove the javascript need to create such a standard feature on the web. This technique uses iframe and css to create the look. Implementation: I am suggesting [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Suggestion: </strong>windows tag</p>
<p><strong>Usage:</strong> If you want to create a modal form/window, a &#8220;popup&#8221; or a lightbox you have to use Javascript. I am suggesting this tag to remove the javascript need to create such a standard feature on the web. This technique uses iframe and css to create the look.</p>
<p><strong>Implementation:</strong> I am suggesting that <windows> can use most of the same attributes as iframe/frame.<br />
Adding the following attributes: </p>
<ul>
<li>modal<br />
boolean, if the window shall be modal or not</li>
<li>movable<br />
boolean, true if the window shall be moveable, false if not</li>
<li>fade-background-color<br />
Color, set the background color being used when window opens. Default is dark gray&#8230;</li>
<li>background-opacity<br />
integer, set the transparency for the background</li>
</ul>
<p>I am not part of the W3 HTML 5 working group and I have not posted this suggestion to this group. I am just suggesting it here as something I wish to see in HTML 5. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.trondhuso.no/blog/2010/05/25/proposal-in-html5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP-Tip: Commenting your code</title>
		<link>http://www.trondhuso.no/blog/2010/05/17/php-tip-commenting-your-code/</link>
		<comments>http://www.trondhuso.no/blog/2010/05/17/php-tip-commenting-your-code/#comments</comments>
		<pubDate>Mon, 17 May 2010 20:52:32 +0000</pubDate>
		<dc:creator>Trond Husø</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[commenting]]></category>

		<guid isPermaLink="false">http://www.trondhuso.no/blog/?p=248</guid>
		<description><![CDATA[This really isn&#8217;t a PHP-tip, but more like a programming tip. But since I do most of my development in PHP (and some in C#, and some on VB) I put it up as a PHP-tip. So there. This post is all about commenting. Some do it, some don&#8217;t. I tend to do it. Sometimes [...]]]></description>
			<content:encoded><![CDATA[<p>This really isn&#8217;t a PHP-tip, but more like a programming tip. But since I do most of my development in PHP (and some in C#, and some on VB) I put it up as a PHP-tip. So there.<br />
This post is all about commenting. Some do it, some don&#8217;t. I tend to do it. Sometimes I even comment to much. But that&#8217;s sometimes better than not doing it at all.<br />
Why should you comment your code: </p>
<ol>
<li>Because sometime in the future you might have to go back to the code and fix it. It&#8217;s always nice to know what the initial idea was. And with years and years of programming, you now know a better way to do it. If you don&#8217;t have the comment, you have to analyze your own code much more thoroughly.</li>
<li>If someone else is going to work with your code, it is always nice for them to read your comments. It makes it easier for them to understand the code and to get into it.</li>
<li>It can be fun looking at the comments you&#8217;ve written. I recently looked over some code I did back in 2005(ish) and here I write: &#8220;<em>This part is done in an amazingly stupid way</em>&#8221; or what about: &#8220;<em>I must do this to keep the string value</em> (line break and some code)<em>Really&#8230;????</em>&#8220;.<br />
I posted this on twitter and I got an answer from Frank W. Zammetti (<a href="http://twitter.com/fzammetti">fzammetti</a>):  <em>&#8220;The person that wrote this is a grade A a**hole&#8230; oh wait, it was me!&#8221; <strong>I wrote that one once.</strong></em><br />
I just couldn&#8217;t stop laughing.
</ol>
<p>This is my style of commenting (example in PHP/C/C++/C#-style)<br />
My first line in the file is always the name of the file. This is a habit I&#8217;ve grown to use. It is smart when you are editing code in e.g. VI where you not necessary get the name of the file in the titlebar.<br />
<code><br />
<?php</p>
<p>// name-of-file.php</p>
<p></code></p>
<p>Next comes a general description of what the code in the file shall do:<br />
<code><br />
/**<br />
 * This file is used to create and edit blog posts<br />
 *<br />
</code><br />
Eclipse, Komodo-IDE and NetBeans (And probably other IDEs) supports @todo in the comment. By adding this "tag" you add tasks to your tasks list.<br />
I tend to add tasks in the beginning of the file.<br />
<code><br />
 * @todo: This file need some work.<br />
 * @todo: Fix the code related to creating blog posts<br />
</code><br />
In the same area I also write out bugs that I have fixed, or tasks that I have completed:<br />
<code><br />
 * FIXES:<br />
 * 01.01.2010: Fixed a bug related to updating a blogpost<br />
 * 17.05.2010: Translated all of the comments from Norwegian to English<br />
 */<br />
</code><br />
(note/suggestion) I wouldn't mind if the IDEs could have a @fixed element that I could add to the end of the line so that the IDE could mark out the task as completed.</p>
<p>Then in the code I can comment like this (note that PHP-example is just as an example here):<br />
<code><br />
// Fixing the string so that it is ready for SQL-input<br />
$string = mysql_real_escape_string($string);</p>
<p>// Creating a string for a dropdown-menu.<br />
foreach ($this as $that) {<br />
   $string .= $that;<br />
}<br />
</code></p>
<p>I also sometimes use comments to clear my head or to get a clear overview of the task at hand. This is especially important when you feel that the task is complicated.<br />
An example could be:<br />
<code><br />
/**<br />
 * In this section we shall create the tree-view.<br />
 * We must remember that all nodes starting with W shall be at the top<br />
 * And that we shall mark posts with pictures with a (p) or a small icon<br />
 * Also remember that no lines can be longer than 25 characters. Check the <strong>left</strong> syntax in mySQL...<br />
 */<br />
</code></p>
<p>This is also good practice when you sometimes do not return to the code in a couple of days. An example could be:<br />
<code><br />
/**<br />
 * continue here on Monday.<br />
 * The idea behind the following section is ... .... .. . . ..<br />
 */<br />
</code></p>
<p>Hope this post regarding commenting your code is of any help for you. If you have any great examples of self criticism in your code, please do post them as comments... (No pun intended)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trondhuso.no/blog/2010/05/17/php-tip-commenting-your-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP-tip: How to fix problems with file permissions</title>
		<link>http://www.trondhuso.no/blog/2010/05/14/php-tip-how-to-fix-problems-with-file-permissions/</link>
		<comments>http://www.trondhuso.no/blog/2010/05/14/php-tip-how-to-fix-problems-with-file-permissions/#comments</comments>
		<pubDate>Fri, 14 May 2010 20:58:18 +0000</pubDate>
		<dc:creator>Trond Husø</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webdevelopment]]></category>

		<guid isPermaLink="false">http://www.trondhuso.no/blog/?p=243</guid>
		<description><![CDATA[Have you tried to create or read a file with fopen, file_get_content or file_put_content and only getting permission denied. A reason for this error message can be that the file you are about to read/write already exists and with your account as owner. A quick, and safe, fix is to change the owner and group [...]]]></description>
			<content:encoded><![CDATA[<p>Have you tried to create or read a file with fopen, file_get_content or file_put_content and only getting permission denied.<br />
A reason for this error message can be that the file you are about to read/write already exists and with your account as owner.<br />
A quick, and safe, fix is to change the owner and group of the file to the same owner/group as the apache-server is running as.<br />
Example:<br />
Let&#8217;s say you are about to update index.htm. This file was uploaded by you to the ftp-server, and so the file is owned by foo (you) which is a member of the group bar. The Apache-server how ever is being run by user:group apache. the user:group apache does not have permission to change anything to this file.<br />
So what you do is:</p>
<ul>
<li>Connect to the web server with ssh (shell account)</li>
<li>Change ownership to the file to apache by running <strong>chmod apache:apache index.htm</strong></li>
</ul>
<p>Now you should be able to change the content of the file with PHP.<br />
I have seen suggestions on websites where they say that you should change the mode to 775 or even worse, 777. This is a security breach and so you should not do so.<br />
Hope this helps someone out</p>
<h3>Suggested links</h3>
<ul>
<li><a href="http://no.php.net/manual/en/function.fopen.php">fopen</a></li>
<li><a href="http://no.php.net/manual/en/function.chmod.php">chmod (within PHP)</li>
<li><a href="http://no.php.net/manual/en/function.file-get-contents.php">file_get_contents</li>
<li><a href="http://no.php.net/manual/en/function.file-put-contents.php">file_put_contents</li>
<li><a href="http://bit.ly/brXNCe">Top 7 PHP Security Blunders</li>
<li><a href="http://www.devshed.com/c/a/PHP/PHP-Security-Mistakes/">PHP Security Mistakes</li>
<li><a href="http://www.unix.com/unix-dummies-questions-answers/33137-chmod-777-security-risks.html">A nice forum post regarding chmod</li>
<li>There are of course someone out there saying that chmod to 777 is not a security risk: <a href="http://www.simplemachines.org/community/index.php?topic=2987.0"><b>Why chmod 777 is NOT a security risk</b></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.trondhuso.no/blog/2010/05/14/php-tip-how-to-fix-problems-with-file-permissions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download direct from ftp-server with php</title>
		<link>http://www.trondhuso.no/blog/2010/04/20/download-direct-from-ftp-server-with-php/</link>
		<comments>http://www.trondhuso.no/blog/2010/04/20/download-direct-from-ftp-server-with-php/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 20:44:26 +0000</pubDate>
		<dc:creator>Trond Husø</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[download]]></category>

		<guid isPermaLink="false">http://www.trondhuso.no/blog/?p=228</guid>
		<description><![CDATA[For a web solution I am currently involved in I had a challenge where files from a FTP-server should be downloaded from the webserver. Thanks to a solution provided by NogDog to cesarcesar @ CodingForums.org in 2007 I managed to solve this. This is the solution: First you connect to your ftp-server $connection = ftp_connect($ftp_server); [...]]]></description>
			<content:encoded><![CDATA[<p>For a web solution I am currently involved in I had a challenge where files from a FTP-server should be downloaded from the webserver. Thanks to a solution provided by NogDog to cesarcesar @ CodingForums.org in 2007 I managed to solve this.</p>
<p>This is the solution:</p>
<p>First you connect to your ftp-server<br />
<code>$connection = ftp_connect($ftp_server);<br />
$login = ftp_login($connection, $ftp_user_name, $ftp_password);<br />
</code></p>
<p>You then check if it was possible to log in. If it wasn&#8217;t, you have to end the script.<br />
<code><br />
if (!$connection || !$login) {<br />
      die('Connection attempt failed!');<br />
}<br />
</code></p>
<p>I then created a local directory (/temp/) where I want these files to be downloaded. Then I created a filename.<br />
For my solution I am getting most values from a database, so here I am only creating a example filename<br />
<code><br />
$localfile = "./temp/example.doc";<br />
$remotefile = "/dir/seconddir/example.doc";<br />
</code></p>
<p>Now we do the actual download and at the same time the download to the visitor:<br />
<code><br />
if (ftp_get($connection, $localfile, $remotefile, FTP_BINARY)){<br />
header('Content-Length: '. filesize($localfile));<br />
header('Content-Type: application/octet-stream');<br />
header('Content-Disposition: attachment; filename="'.basename($localfile).'"');<br />
header('Content-Transfer-Encoding: binary');<br />
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');<br />
readfile($localfile); // send the file<br />
exit;  // make sure no extraneous characters get appended<br />
}<br />
</code></p>
<p>The file <strong>will</strong> be stored locally, and since you don&#8217;t know when the user has gotten the file, set up a cronjob to remove downloaded files so that your area doesn&#8217;t get filled with files you don&#8217;t need.</p>
<p>What you also can do, is to check if the file is downloaded already. </p>
<p><a href="http://www.codingforums.com/showthread.php?t=134463">Link to original post</a><br />
I hope this was of help for someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trondhuso.no/blog/2010/04/20/download-direct-from-ftp-server-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP vs ASP.Net</title>
		<link>http://www.trondhuso.no/blog/2010/01/20/php-vs-asp-net/</link>
		<comments>http://www.trondhuso.no/blog/2010/01/20/php-vs-asp-net/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 08:00:11 +0000</pubDate>
		<dc:creator>Trond Husø</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.trondhuso.no/blog/?p=174</guid>
		<description><![CDATA[Well, this isn&#8217;t really a VS-blog-post, I just had a discovery while reading up on ASP.Net (Professional ASP.Net 2.0) and I see here that PHP has a way to go when it comes to make web development more productive. Yes we have more control on our code and so on, but the .Net Framework and [...]]]></description>
			<content:encoded><![CDATA[<p>Well, this isn&#8217;t really a VS-blog-post, I just had a discovery while reading up on ASP.Net (Professional ASP.Net 2.0) and I see here that PHP has a way to go when it comes to make web development more productive.<br />
Yes we have more control on our code and so on, but the .Net Framework and Visual Studio just makes things quite attractive for web developers.<br />
<em>I never really believed that I would ever write this in a blog post!</em><br />
I mean, there are components for everything.<br />
Want to create a login form? Drag it onto the canvas.<br />
What about a tree of data? Drag it onto the canvas &#8211; change the settings and boom.<br />
Want to create a portal? Use the .Net Portal Framework &#8211; which makes it possible for you to create something like Sharepoint! (well, that what it looked like in the book)</p>
<p>That is, is, is &#8230; awesome (<em>Again, I never really believed that I would ever write this in a blog post</em>)</p>
<p>There are of course cons related to .Net web application development.<br />
Configuring the IIS-server isn&#8217;t quite understandable, and you cannot go to the IIS.conf file to see what has been done to it in order to make it work like it is. So I would give Apache the victory here!</p>
<p>I have been working/maintaining/fixing on some websites that has been depended on .dll-files. One we recently had to upgrade from 1.1 to 3.5, and making it work under 3.5 wasn&#8217;t all that understandable &#8211; well at least not for me &#8211; but then again, I am still a Noob when it comes to .Net Web Application Development.<br />
Again, I&#8217;ll give PHP the advantage here as it is much easier to understand what has been done. the PHP.ini-file and such is easy to either go through or diff against the default PHP.ini to spot differences.</p>
<p>But for rapidness, especially when you start a project from scratch &#8211; ASP.Net gets one point. </p>
<p>This is where PHP must be heading. Yes it is easier to start with PHP. Or at least that is what used to be the best argument to start programming your dynamic web solution with PHP. But dragging, do some coding, and so on, will mean that .Net development will narrow the gap between PHP and ASP.Net.</p>
<p>According to websites PHP is still the most popular language to use when it comes to web development.<br />
A search on PHP and asp on GoogleFight returns:<br />
301.000.000 (301 million) results for PHP and 98.800.000 (98.8 million) results for asp<br />
ASP.net returns 30.400.000 (30.4 million) hits.</p>
<p>TIOBE Programming Community Index for January 2010 tells us that PHP is on the rise. It&#8217;s on third place behind Java and C, but in front of C++. VB is in fifth while C# is on 6th place. I believe I would put those two together to get some ASP.Net figgures.<br />
The two/three languages below:<br />
3  	5  	  	PHP  	10.071%  	+1.19%  	  A<br />
5 	4 		(Visual) Basic 	7.354% 	-1.81% 	  A<br />
6 	6 		C# 	5.767% 	+0.16% 	  A</p>
<p>PHP is still my language of choice, but I will follow ASP.Net closely. .Net 2.0 is dated and so I need a book for 3.5&#8230; (and probably 4.0) to see what&#8217;s new. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.trondhuso.no/blog/2010/01/20/php-vs-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rapid Application Development under Linux</title>
		<link>http://www.trondhuso.no/blog/2009/12/20/development-under-linux/</link>
		<comments>http://www.trondhuso.no/blog/2009/12/20/development-under-linux/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 08:00:21 +0000</pubDate>
		<dc:creator>Trond Husø</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MonoDevelop]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[Basic]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Gamba]]></category>
		<category><![CDATA[Pascal]]></category>
		<category><![CDATA[rad]]></category>
		<category><![CDATA[Visual Basic]]></category>

		<guid isPermaLink="false">http://www.trondhuso.no/blog/?p=115</guid>
		<description><![CDATA[There are a few ways to develop applications under/for Linux. You can write cross platform applications using MonoDevelop, Real Basic and QT (not pronounced Cute, but Q.T. &#8211; yes, sort of like E.T&#8230;.). Or you can use any other language and use IDEs like Komodo, Eclipse and so on. Coming from the Windows side of [...]]]></description>
			<content:encoded><![CDATA[<p>There are a few ways to develop applications under/for Linux. You can write cross platform applications using <a href="http://www.monodevelop.com" target="_blank" title="MonoDevelop">MonoDevelop, <a href="http://www.realsoftware.com">Real Basic</a> and <a href="http://qt.nokia.com">QT</a> (not pronounced Cute, but Q.T. &#8211; yes, sort of like E.T&#8230;.). Or you can use any other language and use IDEs like <a href="http://www.activestate.com">Komodo</a>, <a href="http://www.eclipse.org">Eclipse</a> and so on.</p>
<p>Coming from the Windows side of things and being used to <a href="http://msdn.microsoft.com/en-gb/vstudio/default.aspx">Visual Basic</a> (I probably have the 1.0 floppy somewhere if I start looking!!!), <a href="http://www.codegear.com">Delphi</a> and now lately <a href="http://msdn.microsoft.com/en-gb/vstudio/default.aspx">Visual Studio</a> (It might seem weird that I&#8217;ve just recently been introduced to VS, but I have mostly coded in <a href="http://www.php.net">PHP</a> and <a href="http://msdn.microsoft.com/en-us/library/aa286483.aspx">classic ASP</a> for the last 8-10 years, and then you sort of don&#8217;t need VS), I have been accustomed to drag&#8217;n drop + double click to add code to the application. I have yet to write an application for <a href="http://www.linux.org">Linux</a>, but I have made a few attempts. My first attempt included being introduced to the <a title="Glade - A User Interface Designer" href="http://glade.gnome.org/" target="_blank">Glade</a> application which is/was used to create the layout of the application &#8211; aka GUI. Then you write the code in another IDE.</p>
<p>This was (hm) a while back &#8211; not writing year here, but I can write years if you like&#8230;</p>
<p><strong>The Good</strong></p>
<p>With the introduction of <a title="MonoDevelop" href="http://monodevelop.com" target="_blank">MonoDevelop</a>, <a title="Real Basic" href="http://www.realsoftware.com/" target="_blank">Real Basic</a> and <a title="QT" href="http://qt.nokia.com/" target="_blank">QT</a> we don&#8217;t have to open one application to create the GUI and a second one to attach code. It is all being done (and taken care of) in one development tool. This is, and I&#8217;d like to emphasize on this, the best way to write applications (my humble opinion &#8211; hey my blog!). The tool and GUI-designer is implemented and things can and should work smoothly. Also: You don&#8217;t have to learn two applications and probably also two &#8220;languages&#8221; &#8211; although I am all for having knowledge in as many programming languages as you can. I can now code in C#, VB.Net, Delphi/Pascal (although somewhat very rusty), Perl (briefly, by no means an expert and more or less a novice  and PHP (if that is considered a programming language).</p>
<p>I have tested QT, MonoDevelop and Real Basic. As I am no C++ developer (but I wish I was!), QT would be my choice of  development tool to use when learning that language. Real Basic has only been tested a few times after listening to Bryan Lunduke (Linux Action Show / Computer Action Show) speaking highly of it. MonoDevelop is as of now the tool I use when I&#8217;m now doing some C# stuff on Linux and trying to get the grips of  GTK-development.</p>
<p>I do want to check out <a title="Python" href="www.python.org/" target="_blank">Python</a> as a programming language as I have heard so much positive things regarding the language. But writing an application where you use <a title="RAD using Python and Glade" href="http://www.linuxjournal.com/article/7421" target="_blank">Glade</a> + editor of choice is not something I want to do. Not in 2009/2010. I think I&#8217;ve read somewhere that it can be possible to write applications in Python using QT, but I haven&#8217;t spent to much time getting this to work &#8211; as I don&#8217;t know that much Python &#8211; yet&#8230;</p>
<p>One thing though: By using <a title="Glade - A User Interface Designer" href="http://glade.gnome.org/" target="_blank">Glade</a> and similar applications you separate logic with presentation which can/is a good thing. But there are also drawbacks to this way of designing and developing applications. More below.</p>
<p><strong>The &#8220;Bad&#8221;</strong></p>
<p>I have also tried Android development in Eclipse, and it seems promising. But again: If the only way to create a GUI is to write XML-code, then no thanks. To the developers of development tools out there: Look at the calendar. It is &#8211; as of writing &#8211; saying December 19 in 2009, start creating drag&#8217;n drop applications.</p>
<p>This also goes for creating Web applications (as this is the new term for web pages). DreamWeaver alternatives for Linux? Not even close. Visual Studio + PHP under Linux. Nope.</p>
<p>Two years ago I attended a class to get a jumpstart on C#-development. And I was shown how to create a zebra-striped/styled datalist in VS. The teacher showed me how to do this in three ways: the first one without using any code, the second way with some code and placing the &#8220;plugin&#8221; and the last way by creating the object and so on.</p>
<p>So let&#8217;s say you have never programmed anything in your entire life. Which one would you start using to get going and to be inspired to code more? First one, most likely &#8211; until you understand that it gives you some restrictions and/or problems down the line. But at least you get inspired. You get the application out there to impress friends/boss/yourself quickly.</p>
<p>There are of course drawbacks to this type of applications. No one can argue that DW and such applications creates optimized code. And I am my self a user of Notepad-like applications to generate PHP-code &#8211; that is &#8211; I have moved from Bluefish to <a title="Aptana Studio" href="http://www.aptana.com" target="_blank">Aptana</a>/<a title="Eclipse - Open Source IDE" href="http://www.eclipse.org/" target="_blank">Eclipse</a>. Sometimes I do wish it was a faster way to create forms than the way I do it now &#8211; even though it doesn&#8217;t take that much time.</p>
<p>I have checked out <a title="Zend Studio" href="http://www.zend.com/products/studio/" target="_blank">Zend Studio</a> &#8211; which is now an Eclipse plugin, and I was hoping that ZS would be the way to do the same thing for PHP under Linux/Windows. Nope &#8211; not as I have found out &#8211; yet. It saddens me. Especially because they market this as <em>&#8220;Zend Studio 7.1 is the next generation of our professional-grade PHP application development environment. It has been designed to maximize developer productivity by enabling you to develop and maintain code faster, solve application problems quickly and improve team collaboration.&#8221;</em></p>
<p>I don&#8217;t think they are close to be a next generation professional-grade PHP application development environment. This is 2009 (soon 2010) and 7.1 should&#8217;ve had drag&#8217;n drop datalists, form creation in place. I hope, how ever, that ZS will in the end turn out to become a drag&#8217;n drop Rapid Web Application development (RWAD &#8211; Coined by Trond Husø on December 19, 2009!!!) tool for PHP.</p>
<p><strong>My Dream!</strong><br />
Maybe, in 2010(not likely) we could have a universal Rapid Application Development tool to be used to develop Linux applications that supports Python, Java, Perl, C, C++, PHP (if you want to!), C# and any other programming languages you can think of. And most importantly: The RAD tool should work out of the box. No spending much time on plugins and so on.</p>
<p><strong>Some links:</strong><br />
There are some RAD applications out there and here are some links:<br />
Python<br />
<a title=" href=" href="http://www.zend.com/products/studio/" target="_blank">Dabo</a></p>
<p><strong>Visual Basic</strong></p>
<p><a title="Gambas" href="http://gambas.sourceforge.net/en/main.html" target="_blank">Gambas</a></p>
<p><a title="MonoDevelop" href="http://monodevelop.com/" target="_blank">MonoDevelop</a></p>
<p><strong>Pascal</strong></p>
<p><a title="Lazarus" href="http://sourceforge.net/projects/lazarus/" target="_blank">Lazarus</a></p>
<p>(more links to come &#8211; obviously&#8230; &#8211; please do suggest some!)</p>
<p>Another discussion regarding development under Linux:</p>
<p><a title="RA development" href="https://ldn.linuxfoundation.org/article/putting-squeeze-python-application-development" target="_blank">Putting the Squeeze on Python Application Development</a></p>
<p>(more links to come)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trondhuso.no/blog/2009/12/20/development-under-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web development and Internet Explorer</title>
		<link>http://www.trondhuso.no/blog/2009/11/24/web-development-and-internet-explorer/</link>
		<comments>http://www.trondhuso.no/blog/2009/11/24/web-development-and-internet-explorer/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 00:44:43 +0000</pubDate>
		<dc:creator>Trond Husø</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[IE9]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[Win 7]]></category>

		<guid isPermaLink="false">http://www.trondhuso.no/blog/?p=96</guid>
		<description><![CDATA[I ramble on Internet Explorer and in particular the upcoming IE 9 - date has not been published.]]></description>
			<content:encoded><![CDATA[<p>Everyone who has designed a website knows about the hassles related to Internet Explorer. Now on IEblog.com Microsoft is doing some advertising for it&#8217;s upcoming new version of IE &#8211; <a title="An early look at ie9 for developers" href="http://blogs.msdn.com/ie/archive/2009/11/18/an-early-look-at-ie9-for-developers.aspx" target="_blank">IE 9</a>. One &#8220;feature&#8221; is that it shall be even more standard compliant, and it shall support rounded corners in CSS3. Which is nice &#8211; because I have used rounded corners and gradients on my web page.</p>
<p>It is interesting to follow the discussion on the ieblog which is oh-so-long. Which is not so weird. IE is of great concern for web developers. We have to code for it so that the website looks correct even in IE6 &#8211; which really is making us go mad. Many times I have spent hours and hours to make the website work in IE6 &#8211; both HTML, CSS and Javascript wize.<br />
It is more than annoying to say the least.</p>
<p>One suggestion that comes up in the comments is for Microsoft to move <a title="Trident Layout Engine (Wikipedia)" href="http://en.wikipedia.org/wiki/Trident_%28layout_engine%29" target="_blank">Trident</a> out of IE and in stead start using <a title="Webkit (Wikipedia)" href="http://en.wikipedia.org/wiki/Webkit" target="_blank">Webkit</a>. We all know that&#8217;s not going to happen. And there are a few reasons for this:</p>
<ol>
<li>Trident is Microsofts own rendering engine and is used not only in Internet Explorer, but also in other applications &#8211; not only from MS. Since we also know that IE is tightly connected to the OS, Trident is most likely used in other applications &#8211; like for instance Explorer.</li>
<li>Because the IE is so tightly connected to the Operating System they can&#8217;t change the rendering engine. It will take up a lot of resources, time and effort to make changes in the OS and then in a lot of MS applications that it won&#8217;t make sense.</li>
<li> MS don&#8217;t really want to follow web standards. They will invent in order to fix problems at hand in the Operating System which isn&#8217;t really Web related.</li>
<li>MS has spent much time and effort on the rendering engine. And since they want to say that they have won the Internet (according to Steve Ballmer, source not found (yet)), they don&#8217;t want to give in.</li>
</ol>
<p>I really wish that IE could be decoupled with the OS. It would mean that I &#8211; as a Linux user &#8211; could download and install IE-X on my Linux Laptop to test out the site on the crippled browser. Now I have to run Windows in a Virtual Machine just to make sure that it works properly. And not only do I have to have a VM. I also need to have multiple versions of Internet Explorer running on the installation as well. This so that I can be sure that it works &#8220;perfectly&#8221; on IE6, IE7 and IE8 (and soon IE9).<br />
I am not sure I want to go down that route.</p>
<p>One thing I am sure of is that I am not supporting IE6. That browser is as old as the dark ages, and less people are using it. As more and more people are moving to Vista and Win7 IE6 will fade and hopefully it will be gone.</p>
<p>And hopefully in 2010 we will have a MS-browser that supports CSS3, CSS2.1 and HTML4 and HTML 5.</p>
<p>I do hope that MS keeps on being innovative. But I hope they do this participating with the Web development community and not against them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trondhuso.no/blog/2009/11/24/web-development-and-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter and zend framework</title>
		<link>http://www.trondhuso.no/blog/2009/11/19/twitter-and-zend-framework/</link>
		<comments>http://www.trondhuso.no/blog/2009/11/19/twitter-and-zend-framework/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 20:07:07 +0000</pubDate>
		<dc:creator>Trond Husø</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.trondhuso.no/blog/2009/11/19/twitter-and-zend-framework/</guid>
		<description><![CDATA[# twitter_index.php /** * This code shall update the twitter-status when a new graphic is posted * It will be using the Zend Framework */ $path = &#8216;/Zend/library/&#8217;; set_include_path(get_include_path() . PATH_SEPARATOR . $path); include &#8220;Zend/Service/Twitter.php&#8221;; # include &#8220;Rest/client.php&#8221;; # Connect to the twitter-service try { $twitter = new Zend_Service_Twitter(&#8216;username&#8217;, &#8216;password&#8217;); echo &#8220;that&#8217;s nice \n&#8221;; echo [...]]]></description>
			<content:encoded><![CDATA[<p># twitter_index.php</p>
<p>/**<br />
* This code shall update the twitter-status when a new graphic is posted<br />
* It will be using the Zend Framework<br />
*/<br />
$path = &#8216;/Zend/library/&#8217;;<br />
set_include_path(get_include_path() . PATH_SEPARATOR . $path);<br />
include &#8220;Zend/Service/Twitter.php&#8221;;<br />
# include &#8220;Rest/client.php&#8221;;</p>
<p># Connect to the twitter-service<br />
try {<br />
$twitter = new Zend_Service_Twitter(&#8216;username&#8217;, &#8216;password&#8217;);</p>
<p>echo &#8220;that&#8217;s nice<br />
\n&#8221;;<br />
echo &#8220;Followers: &#8220;.$twitter-&gt;userFollowers();</p>
<p># verify your credentials with twitter<br />
$response = $twitter-&gt;accountVerifyCredentials();</p>
<p># Here you should add:<br />
echo $response-&gt;error;</p>
<p>echo &#8220;That&#8217;s great!&#8221;.$response.&#8221;<br />
\n&#8221;;</p>
<p># echo &#8220;StatusShow: &#8220;.$twitter-&gt;statusShow($response).&#8221;\n&#8221;;<br />
echo &#8220;status: &#8220;.$twitter-&gt;status-&gt;friendsTimeline().&#8221;\n&#8221;;</p>
<p>$response = $twitter-&gt;status-&gt;userTimeline();<br />
$twitterstatus = (string)$response-&gt;status[0]-&gt;text;<br />
echo &#8220;twitterstatus: &#8220;.$twitterstatus.&#8221;\n&#8221;;</p>
<p>echo &#8220;timeline: &#8220;.$twitter-&gt;status-&gt;UserTimeline().&#8221;\n&#8221;;</p>
<p>$response = $twitter-&gt;status-&gt;update(&#8216;My Great Tweet-from PHP&#8217;);<br />
} catch (exception $e) {<br />
echo &#8220;That&#8217;s odd<br />
\n&#8221;;<br />
echo $e;<br />
exit();<br />
} catch (Zend_Service_Twitter_Exception $t){<br />
echo &#8220;Hello there!<br />
\n&#8221;;<br />
echo $t;<br />
exit();<br />
}</p>
<p>?&gt;</p>
<p>Fixed: I had the wrong password.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trondhuso.no/blog/2009/11/19/twitter-and-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A way to prevent SQL-injection</title>
		<link>http://www.trondhuso.no/blog/2009/11/17/a-way-to-prevent-sql-injection/</link>
		<comments>http://www.trondhuso.no/blog/2009/11/17/a-way-to-prevent-sql-injection/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 20:26:42 +0000</pubDate>
		<dc:creator>Trond Husø</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.trondhuso.no/blog/?p=65</guid>
		<description><![CDATA[A little while back I wanted to check if there was another way to prevent SQL-injection than to run the mysql_real_escape_string function and other checks. What I did was to add a user that only had read and write access to the database. The user was not allowed to delete. I ran only a few [...]]]></description>
			<content:encoded><![CDATA[<p>A little while back I wanted to check if there was another way to prevent SQL-injection than to run the mysql_real_escape_string function and other checks.<br />
What I did was to add a user that only had read and write access to the database. The user was not allowed to delete. I ran only a few tests since I am no master on SQL-injections, but those I ran was successful. The injector was not able to empty the database or run other dangerous SQL-queries.<br />
The drawback is that not all server hosts set up two users &#8211; one with restricted access, but I believe they should start doing this. It is a very effective way to stop some SQL-injections.<br />
What it does not stop &#8211; of course &#8211; is for an intruder to fill the database with bogus-data.<br />
Please do discuss this post and test different SQL-injection-queries.<br />
This is of course a method to be used on frontends, not backends as you would need to also delete data in the administration tool, but still it is better than nothing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trondhuso.no/blog/2009/11/17/a-way-to-prevent-sql-injection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

