<?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>Fahlstad Design &#187; Programming</title>
	<atom:link href="http://fahlstad.se/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://fahlstad.se</link>
	<description>WordPress Unlimited</description>
	<lastBuildDate>Wed, 20 Jul 2011 22:11:05 +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>Working on a Twitter plugin</title>
		<link>http://fahlstad.se/2011/07/working-on-a-twitter-plugin/</link>
		<comments>http://fahlstad.se/2011/07/working-on-a-twitter-plugin/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 16:50:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://fahlstad.se/?p=1045</guid>
		<description><![CDATA[I have decided that the Twitter plugins for WordPress don&#8217;t fulfill my very (low) demands. Everyone seems to be overthrown with options and stuff I dont&#8217;t want or need for that matter. So what do I do? As the solution oriented person I am I write my own of course. This plugin has only 2 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://fahlstad.se/wp-content/uploads/2011/07/screenshot1.png"><img class="alignleft size-full wp-image-1048" title="screenshot" src="http://fahlstad.se/wp-content/uploads/2011/07/screenshot1.png" alt="" width="136" height="160" /></a>I have decided that the Twitter plugins for WordPress don&#8217;t fulfill my very (low) demands. Everyone seems to be overthrown with options and stuff I dont&#8217;t want or need for that matter.</p>
<p>So what do I do? As the solution oriented person I am I write my own of course. This plugin has only 2 options: your Twitter screen name and how many tweets to show. Nothing fancy like re-tweets and mentions and stuff like that. Just the latest tweets.</p>
<p>I&#8217;m going to add a sidebar widget to this plugin. As of now there is just a template tag.</p>
<p>This is still in beta and I&#8217;m tweaking and optimizing and when I&#8217;m done I&#8217;ll make it available for download. Interested in this plugin? Let me <a href="http://www.fahlstad.se/contact">know</a>. and I&#8217;ll send you a copy for testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://fahlstad.se/2011/07/working-on-a-twitter-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rounded corners with jquery</title>
		<link>http://fahlstad.se/2008/10/rounded-corners-with-jquery/</link>
		<comments>http://fahlstad.se/2008/10/rounded-corners-with-jquery/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 21:37:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Webdesign]]></category>

		<guid isPermaLink="false">http://www.fahlstad.se/?p=680</guid>
		<description><![CDATA[Everybody loves rounded corners in a web page but it&#8217;s a hassle to accomplish, multiple divs and different images aligned in the corret way. I&#8217; gonna show you how to do it with just a couple lines of javascript using the jquery framework. First go grab a copy of the jquery framework and the jquery.borders.js [...]]]></description>
			<content:encoded><![CDATA[<p>Everybody loves rounded corners in a web page but it&#8217;s a hassle to accomplish, multiple divs and different images aligned in the corret way. I&#8217; gonna show you how to do it with just a couple lines of javascript using the <a href="http://www.jquery.com">jquery </a>framework.<span id="more-680"></span></p>
<p>First go grab a copy of the jquery framework and the <a href="http://www.methvin.com/jquery/jquery.corner.js">jquery.borders.js</a> plugin.</p>
<p>Let&#8217;s go and create an index.html file and add some basic markup and text to it.  A div containing some text and a single paragraph. The &#8220;rounded&#8221; div is the one we are going to apply the rounded corners to.</p>
<pre lang="HTML4STRICT" line="1">
<body>
<div id="rounded" style="background:#ccc;">

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

</div>

</body>
</pre>
<p>The style is just to make the div visible.<br />
It should look like this:</p>
<div id="rounded" style="background:#ccc;">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</div>
<p>Next add the javascript files to the header between the head tags. Make sure the src is set to the path of the js files.</p>
<pre lang="HTML4STRICT" line="1">
<head>
	<script type="text/javascript" src="jquery.js "></script>
	<script type="text/javascript" src="jquery.corner.js "></script>
</head>
</pre>
<p>Now let&#8217;s add the javascript code that actually make the corners rounded. Just below the javascript src files in the header we add:</p>
<pre lang="HTML4STRICT" line="1">
<script type="text/javascript">
	$(function(){
		$("#rounded").corner();
	});
</script>
</pre>
<p>Now it should look like this:</p>
<p><img class="noborder" src="http://www.fahlstad.se/wp-content/uploads/picture-31.png" /></p>
<p>Complete code listing.</p>
<pre lang="HTML4STRICT" line="1">
// Doctype etc
<html>
<head>
	<script type="text/javascript" src="jquery.js "></script>
	<script type="text/javascript" src="jquery.corner.js "></script>
<script type="text/javascript">
	$(function(){
		$("#rounded").corner();
	});
</script>
</head>
<body>
<div id="rounded" style="background:#ccc;">

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

</div>

</body>
</html>
</pre>
<p>Yupp, thats all. Easy isn&#8217;t it? You can specify the corner style and radius in the corner call. For example:</p>
<pre lang="HTML4STRICT" line="1">
$("#rounded").corner("10px"); // 10px radius
$("#rounded").corner("tl tr 10px"); // Rounds top left and top right 10px
</pre>
<p>There&#8217;s loads more of styles, take a look at the <a href="http://www.methvin.com/jquery/jq-corner-demo.html">demo</a> page.</p>
<p>Have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://fahlstad.se/2008/10/rounded-corners-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Security issues in WP Forum fixed</title>
		<link>http://fahlstad.se/2008/09/security-issues-in-wp-forum-fixed/</link>
		<comments>http://fahlstad.se/2008/09/security-issues-in-wp-forum-fixed/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 14:26:22 +0000</pubDate>
		<dc:creator>di0fref</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.fahlstad.se/?p=492</guid>
		<description><![CDATA[All security issues in this report is fixed. New version is 1.7.6 Excerpt from the report Description: Some vulnerabilities have been discovered in the WP-Forum plugin for WordPress, which can be exploited by malicious users to conduct script insertion attacks, and by malicious people to conduct cross-site scripting and SQL injection attacks. 1) Input passed [...]]]></description>
			<content:encoded><![CDATA[<p>All security issues in <a href="http://secunia.com/advisories/28567/">this report</a> is fixed.</p>
<p>New version is 1.7.6</p>
<h4>Excerpt from the report</h4>
<blockquote><p>
Description:<br />
Some vulnerabilities have been discovered in the WP-Forum plugin for WordPress, which can be exploited by malicious users to conduct script insertion attacks, and by malicious people to conduct cross-site scripting and SQL injection attacks.</p>
<p>1) Input passed to the &#8220;user&#8221; parameter in the WordPress installation&#8217;s index.php script (when &#8220;forumaction&#8221; is set to &#8220;showprofile&#8221; and &#8220;page_id&#8221; to a page with the &#8220;&#8221; tag) is not properly sanitised before being used in SQL queries. This can be exploited to manipulate SQL queries by injecting arbitrary SQL code.</p>
<p>Successful exploitation of this vulnerability allows e.g. retrieving usernames, password hashes, and e-mail addresses for all users and administrators, but requires knowledge of the database table prefix.</p>
<p>2) Input passed to the &#8220;forum_query&#8221; parameter in the WordPress installation&#8217;s index.php script (when &#8220;forumaction&#8221; is set to &#8220;search&#8221;) is not properly sanitised before being returned to the user. This can be exploited to execute arbitrary HTML and script code in a user&#8217;s browser session in context of an affected site.</p>
<p>Successful exploitation of this vulnerability requires that the target user has valid user credentials.</p>
<p>3) Input passed to the &#8220;forumtext&#8221; parameter in the WordPress installation&#8217;s index.php script (when &#8220;forumaction&#8221; is set to &#8220;post&#8221;) is not properly sanitised before being stored. This can be exploited to insert arbitrary HTML and script code, which is executed in a user&#8217;s browser session in context of an affected site when the malicious data is viewed.</p>
<p>Successful exploitation of this vulnerability requires that the attacker has valid user credentials.</p>
<p>The vulnerabilities are confirmed in version 1.7.4. Other versions may also be affected.</p>
<p>Solution:<br />
Edit the source code to ensure that input is properly sanitised.</p>
<p>Provided and/or discovered by:<br />
1) websec Team<br />
2, 3) FeDeReR and sinner_01</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://fahlstad.se/2008/09/security-issues-in-wp-forum-fixed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ajax tutorial</title>
		<link>http://fahlstad.se/2006/10/ajax-tutorial/</link>
		<comments>http://fahlstad.se/2006/10/ajax-tutorial/#comments</comments>
		<pubDate>Fri, 20 Oct 2006 21:38:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.fahlstad.se/2006/10/20/ajax-tutorial/</guid>
		<description><![CDATA[This tutorial is intended to give the reader some initial understanding of the power of using Ajax as a tool on a web page. The web pages are growing larger and larger due to more and more bandwidth around the globe. This is nice since the web is getting more readable and more visual appealing. [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial is intended to give the reader some initial understanding of the power of using Ajax as a tool on a web page. The web pages are growing larger and larger due to more and more bandwidth around the globe. </p>
<p>This is nice since the web is getting more readable and more visual appealing. But if your web host have a traffic limit per day the size of the total files requested by each visitor becomes critical, at least if you have many visitors.<br />
<span id="more-425"></span><br />
Ajax is a way to update a part of a web page without the nessisity to reload the whole page. This can save you a lot of bandwidth, if used wisely. So we are going to create a simple html page with dynamic content. We are going to use the prototype framework which is a javascript framefork for a numerous action, including Ajax calls. So start by downloading <a href="http://prototype.conio.net/">prototype.js</a> and <a href="http://script.aculo.us/downloads">script.aculo.us</a>. Place all the files on your server.</p>
<p>For this tutorial we are going to create three files:</p>
<ul>
<li>index.html</li>
<li>tutorial.js</li>
<li>page.html</li>
</ul>
<p>Let&#8217;s start with the markup<br />
<cite>index.html</cite></p>
<pre class="brush: php; title: ; notranslate">&lt;html&gt;
&lt;head&gt;
&lt;script src=&quot;js/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;js/scriptaculous.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;js/tutorial.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
	&lt;h1&gt;This is a demo page using Ajax&lt;/h1&gt;
	&lt;h2&gt;Click on the link&lt;/h2&gt;
	&lt;a href=&quot;javascript:getit();&quot;&gt;Click me&lt;/a&gt;
	&lt;div id=&quot;update&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;/pre&gt;
We start by including all the nessesary javascript files, tutorial.js is our file we are about to create. All this page has is a link and a div. When the link is clicked the javacript function getit() is called and is located in tutorial.js. So let's take a look at tutorial.js.
&lt;cite&gt;tutorial.js&lt;/cite&gt;
&lt;pre lang=&quot;javascript&quot; line=&quot;1&quot;&gt;
function getit(){
	var url = &quot;page.html&quot;;
	new Ajax.Updater('update', url);
}
</pre>
<p>Small huh? Well since we are going to fetch data from another file we need to declare the file which in this case is page.html. This is the page the Ajax.Updater is fetching for us and outputs it to the &#8216;update&#8217; div without reloading the whole page. The Ajax.Updater takes two parameters which is the id of the div to be updated and an url from where we fetch our data.</p>
<p><cite>page.html</cite></p>
<pre class="brush: xml; title: ; notranslate">
&lt;ul&gt;
	&lt;li&gt;Apples&lt;/li&gt;
	&lt;li&gt;Oranges&lt;/li&gt;
	&lt;li&gt;Elephants&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>All put together there is not much code to get this working and there are endless possibilities. I&#8217;ve set up a <a href="/wp-content/tutorials/ajax/ajax.html">demo</a> where you can see the action live. Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://fahlstad.se/2006/10/ajax-tutorial/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WordPress image gallery fGallery released</title>
		<link>http://fahlstad.se/2006/03/wordpress-image-gallery-gallery-released/</link>
		<comments>http://fahlstad.se/2006/03/wordpress-image-gallery-gallery-released/#comments</comments>
		<pubDate>Mon, 20 Mar 2006 22:32:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.fahlstad.se/2006/03/21/wordpress-image-gallery-gallery-released/</guid>
		<description><![CDATA[My new WordPress plug in announced in the previous article is now released and the corresponding page with download can be found here.]]></description>
			<content:encoded><![CDATA[<p>My new WordPress plug in announced in the previous article is now released and the corresponding page with download can be found <a href="/wp-plugins/fgallery">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fahlstad.se/2006/03/wordpress-image-gallery-gallery-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress image gallery plugin on the way</title>
		<link>http://fahlstad.se/2006/03/image-gallery-plugin-on-the-way/</link>
		<comments>http://fahlstad.se/2006/03/image-gallery-plugin-on-the-way/#comments</comments>
		<pubDate>Fri, 17 Mar 2006 14:09:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.fahlstad.se/2006/03/17/image-gallery-plugin-on-the-way/</guid>
		<description><![CDATA[iI&#8217;m about to finish a new image gallery plugin with a lot of features such as: Direct upload from WordPress admin. Language selection. Images ordered by albums and with the ability to exclude images from an album without deleting it. Easy managment of images and albums from the WordPress admin interface. Edit CSS in the [...]]]></description>
			<content:encoded><![CDATA[<p>iI&#8217;m about to finish a new image gallery plugin with a lot of features such as:</p>
<ul>
<li>Direct upload from WordPress admin.</li>
<li>Language selection.</li>
<li>Images ordered by albums and with the ability to exclude images from an album without deleting it.</li>
<li>Easy managment of images and albums from the WordPress admin interface.</li>
<li>Edit CSS in the WordPress admin, resetting CSS if something went wrong.</li>
<li>Support for gettext, which means that you can generate your own language files with gettext.</li>
<li>Swedish and english languages included.</li>
</ul>
<p><strong>Update 1:</strong> Russian translation.</p>
<p><strong>Update </strong><strong>2:</strong> I have set up is a small demo of the galleries, you can watch it <a href="/wp-content/plugins/fgallery/fim_photos.php">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fahlstad.se/2006/03/image-gallery-plugin-on-the-way/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>I just got myself a new laptop</title>
		<link>http://fahlstad.se/2006/02/i-just-got-myself-a-new-laptop/</link>
		<comments>http://fahlstad.se/2006/02/i-just-got-myself-a-new-laptop/#comments</comments>
		<pubDate>Tue, 14 Feb 2006 21:21:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://www.fahlstad.se/2006/02/14/i-just-got-myself-a-new-laptop/</guid>
		<description><![CDATA[My well used IBM Thinkpad R50e had to go yesterday to a friend who always wanted a laptop. I sold this one due to the low max resolution of the screen (1024 x 768). I have discovered that this is not enough for designing or programming. I sure need a lot of space. So I [...]]]></description>
			<content:encoded><![CDATA[<p><a class="imagelink" href="http://www.fahlstad.se/wp-content/pics/2006/08/b_225thumbnail.jpg" title="b_225thumbnail.jpg"><img id="image264" src="http://www.fahlstad.se/wp-content/pics/2006/08/b_225thumbnail.jpg" alt="b_225thumbnail.jpg" align="right" /></a>My well used <a href="http://www,ibm.com">IBM</a> Thinkpad R50e had to go yesterday to a friend who always wanted a laptop. I sold this one due to the low max resolution of the screen (1024 x 768). I have discovered that this is not enough for designing or programming. I sure need a lot of space. So I sold it and since I&#8217;m very happy with the quality and realability of the IBM:s I bought another one, a n <a href="http://www5.pc.ibm.com/se/products.nsf/$wwwPartNumLookup/_UN3AQSW?OpenDocument">R52</a> with max screen resolution of 1400 x 1050.</p>
]]></content:encoded>
			<wfw:commentRss>http://fahlstad.se/2006/02/i-just-got-myself-a-new-laptop/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Beginner&#8217;s QT GUI tutorial</title>
		<link>http://fahlstad.se/2005/10/qt-tutorial/</link>
		<comments>http://fahlstad.se/2005/10/qt-tutorial/#comments</comments>
		<pubDate>Mon, 17 Oct 2005 22:10:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Stuff]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.fahlstad.se/?p=38</guid>
		<description><![CDATA[As a programmer/computer engineer I thought I should share some of my knowledge to you who are interested. In this tutorial you will learn to create a simple program with a graphical user interface. For this we will use the exelent QT which is a API from the Norwegian TrollTech who emulates the graphical API [...]]]></description>
			<content:encoded><![CDATA[<p>As a programmer/computer engineer I thought I should share some of my knowledge to you who are interested. In this tutorial you will learn to create a simple program with a graphical user interface.<br />
<span id="more-38"></span><br />
For this we will use the exelent <a href="http://www.trolltech.com">QT </a>which is a API from the Norwegian <a href="http://www.trolltech.com">TrollTech </a>who emulates the graphical API on the target machine. We will write this in Windows, but as it is designed to work between diffrent platforms we could compile the same code in Linux or whatever platform QT is available for. You can download a trial of the <a href="http://www.trolltech.com/download/qt/evaluate.html">commercial API</a> or a <a href="http://www.trolltech.com/download/qt/windows.html">free GPL licenced one</a>. If you are using Linux you can download the full <a href="http://www.trolltech.com/products/qt3/x11.html">schmeck </a>for free. If you use Windows you have to satisfy with the trial or the older GPL licenced.</p>
<p>Anyway we will create a simple Hello World program in C++, the classical program for any programmer newbie. To begin with we will create the user interface using as you can see, a very small amount of code. </p>
<pre lang="cpp" line="1">
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
       QApplication app(argc, argv);
        QPushButton hello("Hello world!");
        hello.resize(100, 30);
        hello.show();
        return app.exec();
}
</pre>
<p>Lets go through the code line by line.</p>
<p>This line includes the QApplication class definition. There has to be exactly one QApplication object in every GUI application that uses Qt. QApplication manages various application-wide resources, such as the default font and cursor.</p>
<pre lang="cpp" line="1">
#include <QPushButton>
</pre>
<p>This line includes the QPushButton class definition. For each class that&#8217;s part of the public Qt API, there exists a header file of the same name that contains its definition.</p>
<p>QPushButton is a GUI push button that the user can press and release. It manages its own look and feel, like every other QWidget. A widget is a user interface object that can process user input and draw graphics. The programmer can change both the overall look and feel and many minor properties of it (such as color), as well as the widget&#8217;s content. A QPushButton can show either a text or a QIcon.</p>
<pre lang="cpp" line="1">
  int main(int argc, char *argv[])
</pre>
<p>The main() function is the entry point to the program. Almost always when using Qt, main() only needs to perform some kind of initialization before passing the control to the Qt library, which then tells the program about the user&#8217;s actions via events.</p>
<p>The argc parameter is the number of command-line arguments and argv is the array of command-line arguments. This is a standard C++ feature.</p>
<pre lang="cpp" line="1">
 QApplication app(argc, argv);
</pre>
<p>The app object is this program&#8217;s QApplication instance. Here it is created. We pass argc and argv to the QApplication constructor so that it can process certain standard command-line arguments (such as -display under X11). All command-line arguments recognized by Qt are removed from argv, and argc is decremented accordingly. See the QApplication::argv() documentation for details.</p>
<p>The QApplication object must be created before any GUI-related features of Qt are used.</p>
<pre lang="cpp" line="1">
QPushButton hello("Hello world!");
</pre>
<p>Here, after the QApplication, comes the first GUI-related code: A push button is created.</p>
<p>The button is set up to display the text &#8220;Hello world!&#8221;. Because we don&#8217;t specify a parent window (as second argument to the QPushButton constructor), the button will be a window of its own, with its own window frame and title bar.</p>
<pre lang="cpp" line="1">
  hello.resize(100, 30);
</pre>
<p>The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the windowing system). We could call QWidget::move() to assign a specific screen position to the widget, but instead we let the windowing system choose a position.</p>
<pre lang="cpp" line="1">
 hello.show();
</pre>
<p>A widget is never visible when you create it. You must call QWidget::show() to make it visible.</p>
<pre lang="cpp" line="1">
   return app.exec();
</pre>
<p>This is where main() passes control to Qt. QCoreApplication::exec() will return when the application exits. (QCoreApplication is QApplication&#8217;s base class. It implements QApplication&#8217;s core, non-GUI functionality and can be used when developing non-GUI applications.)</p>
<p>In QCoreApplication::exec(), Qt receives and processes user and system events and passes these on to the appropriate widgets.</p>
<p>You should now try to compile and run this program.</p>
<p>The tutorial examples are located in Qt&#8217;s examples/tutorial directory. They are automatically built when you build Qt.</p>
<p>If you have typed in the source code manually, you will need to follow these instructions: To compile a C++ application, you need to create a makefile. The easiest way to create a makefile for Qt is to use the qmake build tool supplied with Qt. If you&#8217;ve saved main.cpp in its own otherwise empty directory, all you need to do is:</p>
<p>    qmake -project<br />
    qmake</p>
<p>The first command tells qmake to create a project file (a .pro file). The second command tells it to create a platform-specific makefile based on the project file. You should now be able to type make (or nmake if you&#8217;re using Visual Studio) and then run your first Qt application!</p>
<p>From <a href="http://www.trolltech.com">www.trolltech.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fahlstad.se/2005/10/qt-tutorial/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Simple PHP image gallery &#8211; a tutorial</title>
		<link>http://fahlstad.se/2005/10/simple-php-image-gallery/</link>
		<comments>http://fahlstad.se/2005/10/simple-php-image-gallery/#comments</comments>
		<pubDate>Mon, 03 Oct 2005 07:18:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.fahlstad.se/?p=59</guid>
		<description><![CDATA[In my first programming tutorial I will show you how to create a simple image gallery with PHP. For this program to work you need to upload your images in two separate folders on your server. One folder containing the thumbnails and one folder with the full size images. The names for the images should [...]]]></description>
			<content:encoded><![CDATA[<p>In my first programming tutorial I will show you how to create a simple image gallery with <a href="http://www.php.net">PHP</a>. For this program to work you need to upload your images in two separate folders on your server. One folder containing the thumbnails and one folder with the full size images. The names for the images should be the same for the full size image and the corresponding thumbnail.<br />
<span id="more-59"></span><br />
This is what the code looks like.</p>
<pre lang="php" line="1">
$thumbs_dir = "./thumbs/";
 $fullsize_dir = "./full/";
 $dir = opendir($thumbs_dir);
 while ($file = readdir($dir)) {
      if ($file != "." &#038;&#038; $file != ".."; ) {
           echo "<a href='$fullsize_dir$file' target='new/>";
           echo "<img src='$thumbs_dir$file' /></a>";
     }
}
</pre>
<p>Lets&#8217;t take a look at the code. First on line 1 and 2 we decalare variables for the thumb and fullsize folders. Then on line 3 we open the thumbs folder for reading then on line 4-9 we loop through all the images in the thumbs directory and outputs the thumbnails with a link to the full size image. Now that wasen&#8217;t that hard was it?</p>
<p>All you have to do is change the folder names for $thumbs_dir and $fullsize_dir to suite your installation. The output looks something like this. (Example from my <a href="/moblog">moblog </a>thumbnail folder).</p>
<p><img src='/wp-content/pics/simple_gall_tut.jpg' alt='Screenshot' /></p>
]]></content:encoded>
			<wfw:commentRss>http://fahlstad.se/2005/10/simple-php-image-gallery/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to stop guestbook spam?</title>
		<link>http://fahlstad.se/2005/09/how-to-stop-guestbook-spam/</link>
		<comments>http://fahlstad.se/2005/09/how-to-stop-guestbook-spam/#comments</comments>
		<pubDate>Wed, 14 Sep 2005 16:33:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.fahlstad.se/?p=12</guid>
		<description><![CDATA[I have an other site called Karlstad offroad where guys and girls can meet and ride dirt bikes together on track or on gravel roads. However the guestbook is the main meeting ground where people announce their intention to ride and anybody can come along. I little while ago I started to get spam, mostly [...]]]></description>
			<content:encoded><![CDATA[<p>I have an other site called <a href="http://karlstadoffroad.com">Karlstad offroad</a> where guys and girls can meet and ride dirt bikes together on track or on gravel roads. However the <a href="http://karlstadoffroad.com/theone.php">guestbook </a>is the main meeting ground where people announce their intention to ride and anybody can come along. </p>
<p>I little while ago I started to get spam, mostly about porn but I didn&#8217;t think I was a buggle to go in manually and remove those occasionally. No however I can have up to 50 spams every day and it is getting a little annnoying. I have tried to change name and location of the guestbook but it  didn&#8217;t hold for long and the users were getting tired if the relocation all the time. Anybody out there having any ideas how to get rid of this spam. Since Karlstad offroad is very local the site language is Swedish.</p>
]]></content:encoded>
			<wfw:commentRss>http://fahlstad.se/2005/09/how-to-stop-guestbook-spam/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
	</channel>
</rss>

