<?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>Techno-Science &#187; Programmation</title>
	<atom:link href="http://www.excitris.com/category/computer/programmation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.excitris.com</link>
	<description>Science and technology in one sexy package</description>
	<lastBuildDate>Sat, 10 Apr 2010 02:00:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Duplicate entry &#8217;0&#8242; for key 1</title>
		<link>http://www.excitris.com/2006/04/06/duplicate-entry-0-for-key-1/</link>
		<comments>http://www.excitris.com/2006/04/06/duplicate-entry-0-for-key-1/#comments</comments>
		<pubDate>Thu, 06 Apr 2006 11:37:09 +0000</pubDate>
		<dc:creator>Tomzx</dc:creator>
				<category><![CDATA[Programmation]]></category>

		<guid isPermaLink="false">http://excitris.com/2006/04/06/duplicate-entry-0-for-key-1/</guid>
		<description><![CDATA[Making the server switch was an easy task. I uploaded my sql database in it&#8217;s new home and checked if things where fine. At first sight, it looked fine, but when I wanted to post something on my blog, I would get the Duplicate entry &#8217;0&#8242; for key 1 error showing up. Did a little [...]]]></description>
			<content:encoded><![CDATA[Making the server switch was an easy task. I uploaded my sql database in it&#8217;s new home and checked if things where fine. At first sight, it looked fine, but when I wanted to post something on my blog, I would get the <strong>Duplicate entry &#8217;0&#8242; for key 1</strong> error showing up. Did a little search on the subject to find out that my exported database didn&#8217;t contain the auto_increment ability in it&#8230; (I&#8217;m using wordpress 2.0.1 with phpmyadmin 2.6.2 (if I&#8217;m right))

So to make a long story short, here&#8217;s how I fixed it:


<blockquote>1. Go into your phpmyadmin panel.
2. For each tables structure, edit the first entry (which should be a primary key such as ID).
3. Delete the 0 in the default value and select &#8220;auto_increment&#8221; in the drop-down menu next to it (on the right).
4. Save.
5. Go to the next table and do the same.</blockquote>

After doing this, you should not face the problem anymore. Thanks to search engines for the answer <img src='http://www.excitris.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ]]></content:encoded>
			<wfw:commentRss>http://www.excitris.com/2006/04/06/duplicate-entry-0-for-key-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>K2 Optimized</title>
		<link>http://www.excitris.com/2006/03/12/k2-optimized/</link>
		<comments>http://www.excitris.com/2006/03/12/k2-optimized/#comments</comments>
		<pubDate>Sun, 12 Mar 2006 21:05:14 +0000</pubDate>
		<dc:creator>Tomzx</dc:creator>
				<category><![CDATA[My experiments]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://excitris.com/2006/03/12/k2-optimized/</guid>
		<description><![CDATA[Since I began my journey to SEO, I&#8217;ve learned many things such as keyword optimisation, use of tags and much more. One important aspect of SEO is having optimized page, and since I&#8217;m trying to promote my blog, I had to look at this point. With a quick test, I realised that K2 template wasn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[Since I began my journey to SEO, I&#8217;ve learned many things such as keyword optimisation, use of <code><h1></h1></code> tags and much more. One important aspect of SEO is having optimized page, and since I&#8217;m trying to promote my blog, I had to look at this point.

With a quick test, I realised that K2 template wasn&#8217;t optimized to give a fast result, giving many spaces between codes which makes the file size bigger.

Let&#8217;s take this for example:
I went to my <a href="http://excitris.com/2006/03/09/be-different/">Be different</a> post, saved the page using the save as option included in any browser. I opened the page using notepad and looked for empty spaces.

File size at the beginning (no edit): 20.05 KB
File size after empty space removal (edit) : 19.85 KB
File size after Google Anaylitics removal (edit) 19.63 KB

This is 0.30 KB, not big but makes a difference for slow bandwidth users. Also, take into consideration I started with a 20.05 KB page.
0.30 KB over 20.05 equals 1.5% of &#8220;used bandwidth for code&#8221;. Make that go on a 500 KB page and you get 7.5 KB. I know that&#8217;s small gain, but it&#8217;s only one step closer to a smaller file size.

I want my pages to load in less than 2 seconds.

Then I checked at the content in my folder related to this internet file.
I had Google Analytics in my source code so I could get statistics about the users, but the file is 17.6 KB. I decided to remove this part of my code since Google Analytics wasn&#8217;t providing me the kind of statistics I was looking for (even though they are good, but I want public stats).

So far, I&#8217;ve been able to save 17.9 KB from only two modification (one that you might not be able to do though).

<strong>[NOTE]</strong> Not to my surprise, by removing both LiveSearch and AJAX comments in the K2 option panel, my speed improved greatly. LiveSearch wasn&#8217;t that important but AJAX commenting was a nice feature, but not worth the speed improvement I get from removing it.

I also started using <a href="http://dev.wp-plugins.org/wiki/css-compress">CSS Compress</a>. Can&#8217;t really tell how much it is efficent though.]]></content:encoded>
			<wfw:commentRss>http://www.excitris.com/2006/03/12/k2-optimized/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add adsense in your WordPress blog</title>
		<link>http://www.excitris.com/2006/03/09/add-adsense-in-your-wordpress-blog/</link>
		<comments>http://www.excitris.com/2006/03/09/add-adsense-in-your-wordpress-blog/#comments</comments>
		<pubDate>Fri, 10 Mar 2006 02:05:40 +0000</pubDate>
		<dc:creator>Tomzx</dc:creator>
				<category><![CDATA[Programmation]]></category>

		<guid isPermaLink="false">http://excitris.com/2006/03/09/add-adsense-in-your-wordpress-blog/</guid>
		<description><![CDATA[After writing a comment on http://www.problogger.net, I was &#8220;due&#8221; to post it here. I managed doing the same though using a different method. Yes, itâ€™s possible to do something similar using other way. But mine is, I would say, easier to manage. I got the wonderful Acme tech Adsense Deluxe plugin which allows me to [...]]]></description>
			<content:encoded><![CDATA[After writing a comment on <a href="http://www.problogger.net/archives/2006/03/09/how-to-placing-adsense-strategically-between-posts/">http://www.problogger.net</a>, I was &#8220;due&#8221; to post it here.

I managed doing the same though using a different method. Yes, itâ€™s possible to do something similar using other way. But mine is, I would say, easier to manage. I got the wonderful <a href="http://www.acmetech.com/blog/adsense-deluxe/">Acme tech Adsense Deluxe</a> plugin which allows me to plug the ad into the script easily.

My code is only added at 3 different places in the templates files:
1. In the theloop.php, find

<blockquote><code><!--</code>
< ?php trackback_rdf(); ?>
</code><code>--></code></blockquote>

then add this code just before

<blockquote>	< ?php
	if ($adsensevar == 2){
	adsense_deluxe_ads('Midpage');
	$adsensevar = 0;
	}else{
	$adsensevar++;
	}
	?></blockquote>

This code will output a ad every 3 posts (but beware, google TOS says no more than 3 ads per page, so Iâ€™ve warned you).

2. In the sidebar.php
just before the div class clear, add

<blockquote>< ?php adsense_deluxe_ads('Sidebar'); ?></blockquote>

This code output the ad in the sidebar

3. In single post
add

<blockquote>< ?php adsense_deluxe_ads('Midpage'); ?></blockquote>

after the 

<blockquote>< ?php include (TEMPLATEPATH . '/theloop.php'); ?></blockquote>

call.

This will output the ad just before the comments and the comment box.

Using ad sense deluxe (which you should have actived), create a block called MidPage (which would generally contain the code for a 468Ã—60 banner) and a Sidebar (which contains any scrapper kind) and youâ€™re done. Might be a bit long, but itâ€™s easier to manage after. 

Ask any question if there&#8217;s a problem.]]></content:encoded>
			<wfw:commentRss>http://www.excitris.com/2006/03/09/add-adsense-in-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>How the warez scene works</title>
		<link>http://www.excitris.com/2006/03/03/how-the-warez-scene-works/</link>
		<comments>http://www.excitris.com/2006/03/03/how-the-warez-scene-works/#comments</comments>
		<pubDate>Fri, 03 Mar 2006 10:01:19 +0000</pubDate>
		<dc:creator>Tomzx</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Programmation]]></category>

		<guid isPermaLink="false">http://excitris.com/2006/03/03/how-the-warez-scene-works/</guid>
		<description><![CDATA[An article from 2600 that seems to be one of the most well-rounded and informative article&#8217;s about how the Scene works &#38; How warez/other files get spread through the p2p networks.read more]]></description>
			<content:encoded><![CDATA[An article from 2600 that seems to be one of the most well-rounded and informative article&#8217;s about how the Scene works &amp; How warez/other files get spread through the p2p networks.<br /><br /><a href="http://old.wheresthebeef.co.uk/show.php/guide/2600_Guide_to_Internet_Piracy-TYDJ.txt">read more</a>]]></content:encoded>
			<wfw:commentRss>http://www.excitris.com/2006/03/03/how-the-warez-scene-works/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My personal view of the best statistic system</title>
		<link>http://www.excitris.com/2006/03/03/my-personal-view-of-the-best-statistic-system/</link>
		<comments>http://www.excitris.com/2006/03/03/my-personal-view-of-the-best-statistic-system/#comments</comments>
		<pubDate>Fri, 03 Mar 2006 05:56:21 +0000</pubDate>
		<dc:creator>Tomzx</dc:creator>
				<category><![CDATA[Programmation]]></category>

		<guid isPermaLink="false">http://excitris.com/2006/03/03/my-personal-view-of-the-best-statistic-system/</guid>
		<description><![CDATA[Good graphical interface Easy use of templates Easy to modify localization Tons of informations Uniques > Country > Page viewed > Amount of time spent viewing > Bandwidth spent Page views Referee Popular pages > Bandwidth spent Time of the day Keywords Bots In and Out Check for regular users (through cookies) Statistics for a [...]]]></description>
			<content:encoded><![CDATA[	<li>Good graphical interface</li>
	<li>Easy use of templates</li>
	<li>Easy to modify localization</li>
	<li>Tons of informations</li>
<ol>
	<li>Uniques > Country > Page viewed > Amount of time spent viewing > Bandwidth spent</li>
	<li>Page views</li>
	<li>Referee</li>
	<li>Popular pages > Bandwidth spent</li>
	<li>Time of the day</li>
	<li>Keywords</li>
	<li>Bots</li>
	<li>In and Out</li>
	<li>Check for regular users (through cookies)</li>
</ol>
	<li>Statistics for a certain period of time</li>
<ol>
	<li>Hours</li>
	<li>Days</li>
	<li>Months</li>
	<li>Semesters</li>
	<li>Years</li>
</ol>
	<li>Each links on a page are being rewritten to contain the &#8220;Out&#8221; function</li>
	<li>A complete path of each user navigation throught the site</li>
	<li>Use of AJAX to load each statistics and to periodically update itself live</li>
	<li>Send statistics to email</li>

Even though it still lacks of major features, I&#8217;m looking for propositions. I really want this statistic script to be the best out there.]]></content:encoded>
			<wfw:commentRss>http://www.excitris.com/2006/03/03/my-personal-view-of-the-best-statistic-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>For your caching needs</title>
		<link>http://www.excitris.com/2006/02/28/for-your-caching-needs-2/</link>
		<comments>http://www.excitris.com/2006/02/28/for-your-caching-needs-2/#comments</comments>
		<pubDate>Wed, 01 Mar 2006 02:23:07 +0000</pubDate>
		<dc:creator>Tomzx</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Programmation]]></category>

		<guid isPermaLink="false">http://excitris.com/2006/02/28/for-your-caching-needs-2/</guid>
		<description><![CDATA[Your website is attracting a lot of visitor and taking much of your bandwidth? You are the kind of person who submit a lot of content to social bookmarks and get hit by the traffic? Well, you should consider using the cache function provided by PHP. It will save you many downtime and bandwidth by [...]]]></description>
			<content:encoded><![CDATA[Your website is attracting a lot of visitor and taking much of your bandwidth? You are the kind of person who submit a lot of content to social bookmarks and get hit by the traffic? Well, you should consider using the cache function provided by PHP. It will save you many downtime and bandwidth by creating a page which will act like an html in content but will still provide the php functions (posting).

The first option is <a href="http://www.ilovejackdaniels.com/php/caching-output-in-php/">http://www.ilovejackdaniels.com/php/caching-output-in-php/</a>

The first one is a really nice script by Daniel. I loved it. The only problem I had was with

<blockquote>
php_value auto_prepend_file /begin_caching.php
php_value auto_append_file /end_caching.php</blockquote>


due to the fact we can&#8217;t use these in the .htaccess on the server. But I figured a way you could make it still be working. Here is how.

The user make a page and call it loader.php (for example).

In the .htaccess, you use the following: 

<blockquote>RewriteRule ^([a-z]+)$ loader.php?p=$1</blockquote>

This will tranfert to the loader a variable which is the page name. In the loader.php, you use the following:

<blockquote>&lt;?PHP
require_once(&#8220;begin_caching.php&#8221;);
require_once($_REQUEST["p"]);
require_once(&#8220;end_caching.php&#8221;);
?></blockquote>

This way, each time people get on ANY page, they get the loader to add the begin and end cache and loads the page between, without using the use php_value, hope I helped some of you guys <img src='http://www.excitris.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> 

Second option is <a href="http://www.devshed.com/c/a/PHP/Output-Caching-with-PHP/">http://www.devshed.com/c/a/PHP/Output-Caching-with-PHP/</a>

This one is for more advanced programmers because it requires some understanding of the process going on. I&#8217;d rather stick to the first option if you&#8217;re looking for a good caching without getting too much involvement in the script.]]></content:encoded>
			<wfw:commentRss>http://www.excitris.com/2006/02/28/for-your-caching-needs-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eMule Plus programmers&#8217; requirements</title>
		<link>http://www.excitris.com/2006/01/13/emule-plus-programmers-requirements/</link>
		<comments>http://www.excitris.com/2006/01/13/emule-plus-programmers-requirements/#comments</comments>
		<pubDate>Sat, 14 Jan 2006 01:03:12 +0000</pubDate>
		<dc:creator>Tomzx</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Programmation]]></category>

		<guid isPermaLink="false">http://excitris.com/2006/01/13/emule-plus-programmers-requirements/</guid>
		<description><![CDATA[1. Reverse a string (e.g. array of chars) in place. 2. Reverse a linked list. 3. Count all the bits that are on in a byte. 4. Let&#8217;s say we have (fixed size) array of bool, which is filled by false, except one element, which is true. You don&#8217;t have direct access to elements of [...]]]></description>
			<content:encoded><![CDATA[1. Reverse a string (e.g. array of chars) in place.

2. Reverse a linked list.

3. Count all the bits that are on in a byte.

4. Let&#8217;s say we have (fixed size) array of bool, which is filled by <em>false</em>, except one element, which is <em>true</em>. You don&#8217;t have direct access to elements of that array, but have function, IsTrueElementInRange that accepts range of elements (e.g. from n to m) and returns true or false. What&#8217;s the best algorithm for finding <em>true</em> element using that function, and what&#8217;s its name?

5. Let&#8217;s say we have (fixed size) array of int, which is filled by numbers from 1 to 5. Calculate counts of each number in the array (e.g. how many 1&#8242;s there are in array, how many 2&#8242;s and so on). Calculation should be made in single array walk.

6. What&#8217;s the purpose of virtual destructor in C++?

7. What class is the base of all window classes in MFC?

8. What class is the base of most of other classes in MFC and what are the services it provides?

9. How do you walk through vector&#8217;s elements in STL?

10. Let&#8217;s say you created dialog in MFC, put RichEdit control on it, and dialog failed on create. What did you forget to do?

11. What happens if you call <em>new</em> operator to create some object and it fails because out of memory?

12. How do you synchronize two or more threads?

13. Implement simple read-write lock mechanizm, which allows multiple readers simultaneously, but only one writer (of course, while we write, noone can read until we finish).

14. What is the function you call to get new interface in COM?

15. What interface should COM object provide in order to be used in script languages, like VBScript, Javascript?

16. What does a sequence diagram represent?

17. What is the difference between a class and an object?

18. What are the following examples of: Factory, Prototype, Adapter, Bridge, Composite and Iterator?

19. What is a class factory and why would you want to use one?

20. How would you create a singleton in C++? (Show what should be in the .cpp and .h files.)

<strong>Answer only those questions that you know</strong>]]></content:encoded>
			<wfw:commentRss>http://www.excitris.com/2006/01/13/emule-plus-programmers-requirements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My c++ challenge (part 2)</title>
		<link>http://www.excitris.com/2006/01/08/my-c-challenge-part-2/</link>
		<comments>http://www.excitris.com/2006/01/08/my-c-challenge-part-2/#comments</comments>
		<pubDate>Mon, 09 Jan 2006 00:36:37 +0000</pubDate>
		<dc:creator>Tomzx</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Humour & fun]]></category>
		<category><![CDATA[Programmation]]></category>

		<guid isPermaLink="false">http://excitris.com/2006/01/08/my-c-challenge-part-2/</guid>
		<description><![CDATA[So far, I&#8217;ve written about 174 lines with the AI, though it&#8217;s not completed yet. I only need to program what the AI moves will be and it&#8217;s done. Should be done within 26 lines I should be positing the source code when I&#8217;m done, that should be done in the next few day.]]></description>
			<content:encoded><![CDATA[<p>So far, I&#8217;ve written about 174 lines with the AI, though it&#8217;s not completed yet. I only need to program what the AI moves will be and it&#8217;s done. Should be done within 26 lines <img src='http://www.excitris.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I should be positing the source code when I&#8217;m done, that should be done in the next few day.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.excitris.com/2006/01/08/my-c-challenge-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eMule programmers&#8217; wiki</title>
		<link>http://www.excitris.com/2006/01/04/emule-programmers-wiki/</link>
		<comments>http://www.excitris.com/2006/01/04/emule-programmers-wiki/#comments</comments>
		<pubDate>Wed, 04 Jan 2006 07:44:39 +0000</pubDate>
		<dc:creator>Tomzx</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Programmation]]></category>

		<guid isPermaLink="false">http://excitris.com/2006/01/04/emule-programmers-wiki/</guid>
		<description><![CDATA[Since I&#8217;ve got a lot of free time during my vacation, I started learning C++ (which I had previously learned), but this time, with in depth understanding. I don&#8217;t have much knowledge about the language yet though but I can understand pretty well what&#8217;s going on if you give me a bit of code. I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[Since I&#8217;ve got a lot of free time during my vacation, I started learning C++ (which I had previously learned), but this time, with in depth understanding. I don&#8217;t have much knowledge about the language yet though but I can understand pretty well what&#8217;s going on if you give me a bit of code.

I&#8217;ve setup a temporary wiki at <a href="http://djzarek.com.ru/wiki/ ">http://djzarek.com.ru/wiki/</a> in order to get more info about each specific file and with a hope that some emule modders, programmers will come and help out filling this wiki that might be useful for their community later on.]]></content:encoded>
			<wfw:commentRss>http://www.excitris.com/2006/01/04/emule-programmers-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My c++ challenge (part 1)</title>
		<link>http://www.excitris.com/2006/01/03/my-c-challenge-part-1/</link>
		<comments>http://www.excitris.com/2006/01/03/my-c-challenge-part-1/#comments</comments>
		<pubDate>Wed, 04 Jan 2006 02:19:28 +0000</pubDate>
		<dc:creator>Tomzx</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Humour & fun]]></category>
		<category><![CDATA[Programmation]]></category>

		<guid isPermaLink="false">http://excitris.com/2006/01/03/my-c-challenge-part-1/</guid>
		<description><![CDATA[Done, with 124 lines. Look at the file for yourself]]></description>
			<content:encoded><![CDATA[Done, with 124 lines. <img src='http://www.excitris.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> 
<a href="http://excitris.com/wp-content/uploads/2006/01/TicTacToe.cpp">Look at the file for yourself </a>]]></content:encoded>
			<wfw:commentRss>http://www.excitris.com/2006/01/03/my-c-challenge-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
