<?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>arturmarques.com iLog &#187; dev</title>
	<atom:link href="http://arturmarques.com/wordpress/index.php/category/dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://arturmarques.com/wordpress</link>
	<description>Artur Marques&#039; blog - supporting the arturmarques.com website</description>
	<lastBuildDate>Tue, 07 Feb 2012 11:13:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>My very own ThinkUp 0.8 patch</title>
		<link>http://arturmarques.com/wordpress/index.php/2011/02/02/my-very-own-thinkup-0-8-patch/</link>
		<comments>http://arturmarques.com/wordpress/index.php/2011/02/02/my-very-own-thinkup-0-8-patch/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 09:02:50 +0000</pubDate>
		<dc:creator>am</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[ENG]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://arturmarques.com/wordpress/index.php/2011/02/03/my-very-own-thinkup-0-8-patch/</guid>
		<description><![CDATA[Frustrated with ThinkUp 0.8 beta database errors, I decided to invest a few minutes on the source code, just in case it was something trivial. Here is one common ThinkUp MySQL error, with the most informative parts on bold: Database error! ThinkUp could not execute the following query: INSERT INTO tu_users (user_id, user_name, full_name, avatar, [...]]]></description>
			<content:encoded><![CDATA[<p>Frustrated with <strong><a href="http://thinkupapp.com/">ThinkUp</a> 0.8 beta</strong> database errors, I decided to invest a few minutes on the source code, just in case it was something trivial.</p>
<p>Here is one common ThinkUp MySQL error, with the most informative parts on bold:</p>
<p>Database error!<br />
ThinkUp could not execute the following query:<br />
INSERT INTO <strong>tu_users</strong> (user_id, user_name, full_name, avatar, location, description, url, is_protected, follower_count, post_count, friend_count, favorites_count, found_in, joined, network ) VALUES ( :user_id, :username, :full_name, :avatar, :location, :description, :url, :is_protected, :follower_count, :post_count, :friend_count, :favorites_count, :found_in, :joined, :network )<br />
PDOException: SQLSTATE[HY000]: General error: <strong>1366 Incorrect integer value: &#8216;false&#8217; for column &#8216;is_protected&#8217; at row 1</strong></p>
<p>Here is what I did:</p>
<p>(1) I searched the source code for the <strong>is_protected</strong> string</p>
<p>- I found it at<br />
plugins\twitter\model\<strong>class.TwitterAPIAccessorOAuth.php</strong><br />
and at<br />
plugins\twitter\controller\<strong>class.TwitterPluginConfigurationController.php</strong></p>
<p>(2) I used MySQL Workbench, available from<br />
<a href="http://dev.mysql.com/downloads/workbench/">http://dev.mysql.com/downloads/workbench/</a></p>
<p>to see the database structure for the <strong>tu_users</strong> table of the ThinkUp schema and found that</p>
<p>- the <strong>is_protected</strong> column is of data type &#8220;tinyint&#8221;, meaning it must be a number in the range [-128, 127] as documented in<br />
<a href="http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html">http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html</a></p>
<p><img alt="tu users-2011-02-03 19.40" src="http://arturmarques.com/wordpress/wp-content/uploads/2011/02/tu_users-2011-02-03_19.40.19.jpg" width="100%" /></p>
<p>(3) I payed a closer look to ThinkUp&#8217;s source code and suspected that in instructions like</p>
<p><strong>&#8216;is_protected&#8217;=&gt;$xml-&gt;protected</strong></p>
<p>the <strong>$xml-&gt;protected</strong> value might be <strong>true</strong> or <strong>false</strong>, not exactly 1 or 0, which is FINE for most boolean expressions, since 0 is evaluated as false and everything different from 0, like 1, evaluates to true.</p>
<p>So I suppose the issue is that <strong>MySQL 5.5 strict wants a number in [-128, 127], NOT true or false</strong>, even if in PHP logic they evaluate to the same.</p>
<p>(4) I edited the files found at (1) and inserted some very obvious code patches that ensure that the database will get a true tinyint.</p>
<p>&#8230; <strong>and it works!!</strong>, at least in my system!</p>
<p>So, my ThinkUp is fine.</p>
<p>I should mention that prior to reaching this patch, there were other &#8211; easier to fix &#8211; database errors, related to <strong>no default values for certain fields</strong>, which can addressed withouth editing the PHP code: just by editing the faulty tables and putting in a default value.</p>
<p>Here are the patched files. Replace ThinkUp&#8217;s originals and use at your own risk. They are a solution in my system &#8211; they might not be so in yours.</p>
<p><a title="Artur's ThinkUp 0.8 patch" href="http://arturmarques.com/wordpress/wp-content/uploads/2011/02/thinkup_0v8_beta_arturmarques_dot_com_patch_v2.zip">thinkup_0v8_beta_arturmarques_dot_com_patch_v2</a> (8 KB)</p>
]]></content:encoded>
			<wfw:commentRss>http://arturmarques.com/wordpress/index.php/2011/02/02/my-very-own-thinkup-0-8-patch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips from being WWW&#8217;mugged</title>
		<link>http://arturmarques.com/wordpress/index.php/2011/01/30/tips-from-being-wwwmugged/</link>
		<comments>http://arturmarques.com/wordpress/index.php/2011/01/30/tips-from-being-wwwmugged/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 23:28:47 +0000</pubDate>
		<dc:creator>am</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ENG]]></category>
		<category><![CDATA[sw]]></category>
		<category><![CDATA[wordpress stuff]]></category>

		<guid isPermaLink="false">http://arturmarques.com/wordpress/index.php/2011/01/30/tips-from-being-wwwmugged/</guid>
		<description><![CDATA[I would love to be as superior as Bernie Ecclestone was after being mugged, selling is battered face for a fortune and showing the abusers how to brilliantly volte-face a situation, but of course I am just a nobody and the best turnaround I can ambition is to help at least one person with some [...]]]></description>
			<content:encoded><![CDATA[<p>I would love to be as superior as Bernie Ecclestone was after being mugged, selling is battered face for a fortune and showing the abusers how to brilliantly volte-face a situation, but of course I am just a nobody and the best turnaround I can ambition is to help at least one person with <strong>some lessons learned the hard way, after being WWW&#8217;mugged myself</strong>.</p>
<p><img alt="20110130 bernie mugged volte face" src="http://arturmarques.com/wordpress/wp-content/uploads/2011/01/20110130_bernie_mugged_volte_face.jpg" width="50%" /></p>
<p>The full Bernie story: <a href="http://www.youtube.com/watch?v=b7AiMoOSxlk">http://www.youtube.com/watch?v=b7AiMoOSxlk</a></p>
<p>It is very unpleasant to have a website mugged, or &#8220;hacked&#8221;, for no reason at all but the display of the &#8220;signatures&#8221; of the abusers.<br />
After all these years, here are some tips.</p>
<p>(1)</p>
<p>If you have an ASP.NET web.config global file, yet the system says it can NOT find a valid <strong>web.config</strong> for a particular application, it might be because of wrong permissions on that app&#8217;s file system containing folder.</p>
<p>Since I run IIS6, this page was helpful:</p>
<p><a href="http://support.microsoft.com/kb/317955/">http://support.microsoft.com/kb/317955/</a></p>
<p>It basically says: &#8220;add the <strong>NETWORK SERVICE</strong> user to the app&#8217;s folder&#8221;.</p>
<p>Indeed, every .NET app folder must allow the &#8220;<strong>NETWORK SERVICE</strong>&#8221; user with the permissions:<br />
- read<br />
- read and execute<br />
- list folder contents</p>
<p>(2)</p>
<p>In IIS6 the user <strong>IUSR_TEMPLATE</strong> represents an anonymous web visitor and so must be available for all resources to be made public on the WWW.</p>
<p>Generally, this user <strong>should only have READ permits and nothing else</strong>, for all resources.</p>
<p>If some particular folders require writing, give this user READ and WRITE permits, but *never* WRITE and EXECUTE.</p>
<p>Ideally, the WRITE permit should only be given to out-of-reach-of-the-web-server folders, meaning locations that are nowhere in the tree being made public by IIS, Apache or whatever the http server. But this isn&#8217;t always possible: most Content Management Systems (CMSs) will require at least one writable public folder, for example to where bloggers can upload pictures &#8211; just follow the minimal approach and the *never* WRITE and EXECUTE rule.</p>
<p>(3)</p>
<p>For read-only web presences, if you strictly follow the minimal rule, giving nothing but the READ permit to the web visitor user <strong><em>and</em></strong> no other permits to no other users at all, you&#8217;ll end up with a very secure site, but with some annoyances, e.g. <strong>FTP uploading contents will fail probably with a &#8220;450 can&#8217;t access file&#8221; error</strong>.</p>
<p>In Windows, you can easily fix it by giving &#8220;full control&#8221; to the SYSTEM user at some entry point.</p>
<p>(4)</p>
<p>Some CMSs that support themes, like <strong>Worpress, might display a blank page</strong> after being moved or copied. One very simple solution is to install a new theme, activate it, then return to the original.</p>
]]></content:encoded>
			<wfw:commentRss>http://arturmarques.com/wordpress/index.php/2011/01/30/tips-from-being-wwwmugged/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cassandra vs relational databases</title>
		<link>http://arturmarques.com/wordpress/index.php/2011/01/25/cassandra-vs-relational-databases/</link>
		<comments>http://arturmarques.com/wordpress/index.php/2011/01/25/cassandra-vs-relational-databases/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 18:13:55 +0000</pubDate>
		<dc:creator>am</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[edu]]></category>

		<guid isPermaLink="false">http://arturmarques.com/wordpress/index.php/2011/01/25/cassandra-vs-relational-databases/</guid>
		<description><![CDATA[Some big Web databases are making people more aware of *NO* relational databases alternatives. For example, Twitter and Digg are going Cassandra&#8216;s way &#8211; as Facebook did.]]></description>
			<content:encoded><![CDATA[<p>Some big Web databases are making people more aware of *NO* relational databases alternatives.</p>
<p>For example, <a href="http://www.computerworld.com/s/article/9161078/Twitter_growth_prompts_switch_from_MySQL_to_NoSQL_database?taxonomyId=9">Twitter</a> and <a href="http://about.digg.com/blog/looking-future-cassandra">Digg</a> are going <a href="http://cassandra.apache.org/download/">Cassandra</a>&#8216;s way &#8211; as Facebook did.</p>
]]></content:encoded>
			<wfw:commentRss>http://arturmarques.com/wordpress/index.php/2011/01/25/cassandra-vs-relational-databases/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debugging PHP +curl in Visual Studio 2008 = NO GO!</title>
		<link>http://arturmarques.com/wordpress/index.php/2010/01/29/debugging-php-curl-in-visual-studio-2008-no-go/</link>
		<comments>http://arturmarques.com/wordpress/index.php/2010/01/29/debugging-php-curl-in-visual-studio-2008-no-go/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 15:46:37 +0000</pubDate>
		<dc:creator>am</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[ENG]]></category>

		<guid isPermaLink="false">http://arturmarques.com/wordpress/index.php/2010/01/29/debugging-php-curl-in-visual-studio-2008/</guid>
		<description><![CDATA[I rejected VS.PHP as a viable solution for PHP debugging. It happened in 4 steps. (1) I was trying VS.PHP 2.8 with Visual Studio 2008, when I found that, for curl projects, it is needed to edit the file&#160;php-xdebug.ini located in the&#160;VS.PHP install folder, and then uncomment the use of the curl extension. This means [...]]]></description>
			<content:encoded><![CDATA[<p>I <strong>rejected</strong> VS.PHP as a viable solution for PHP debugging. It happened in 4 steps.</p>
<p>(1)</p>
<p>I was trying <strong>VS.PHP 2.8</strong> with <strong>Visual Studio 2008</strong>, when I found that, for <strong>curl</strong> projects, it is needed to edit the file&nbsp;<strong>php-xdebug.ini</strong> located in the&nbsp;VS.PHP install folder, and then uncomment the use of the curl extension.</p>
<p>This means that at line that writes</p>
<p><strong>;extension=php_curl.dll</strong></p>
<p>it suffices to remove the ;</p>
<p>If a debug session is running, it must be restarted.</p>
<p>(2)</p>
<p>By default VS.PHP, in Visual Studio 2008, uses IE (Internet Explorer) as its browser. I wanted Firefox instead, so I went to the project menu and called for its properties, then I just set the &ldquo;browser type&rdquo; to &ldquo;default browser&rdquo;, which is Firefox in my case.</p>
<p>Again: <strong>project</strong> &gt; &ldquo;<em>project name</em>&rdquo; <strong>properties </strong>, as illustrated below:</p>
<p><img border="0" alt="20100129_vsphp_browser" src="http://www.arturmarques.com/images/blog/20100129_vsphp_browser.jpg" /></p>
<p>(3)</p>
<p>The problem with Firefox was/is that it forbiddens certain exotic ports for browsing. The typical web based debugger will serve content precisely on such ports&hellip;</p>
<p><img border="0" alt="20100129_ffox_stop" src="http://www.arturmarques.com/images/blog/20100129_ffox_stop.jpg" /></p>
<p>The solution is to configure Firefox to allow access to the restricted port. For example, if it was port &ldquo;19&rdquo; all it takes to unblock the situation is to go to the <strong>about:config </strong>special address (type <strong>about:config</strong> at the address bar) and then create a new configuration string named</p>
<p><strong>network.security.ports.banned.override</strong></p>
<p>set to &ldquo;<strong>19</strong>&rdquo;, in this example.</p>
<p><img border="0" alt="20100129_ffox_configure" src="http://www.arturmarques.com/images/blog/20100129_ffox_configure.jpg" /></p>
<p><img border="0" alt="20100129_ffox_key" src="http://www.arturmarques.com/images/blog/20100129_ffox_key.jpg" /></p>
<p><img border="0" alt="20100129_ffox_value" src="http://www.arturmarques.com/images/blog/20100129_ffox_value.jpg" /></p>
<p><img border="0" alt="20100129_ffox_unlocked" src="http://www.arturmarques.com/images/blog/20100129_ffox_unlocked.jpg" /></p>
<p>(4)</p>
<p>But then, to my frustration, I found that VS.PHP is just no good: while trying to enter (debug / step into) a function&rsquo;s code, it just let the browser in a waiting state, like if the function call wasn&rsquo;t happening. What a waste of time.</p>
<div class="bjtags">Tags:  <a rel="tag" href="http://technorati.com/tag/php">php</a>, <a rel="tag" href="http://technorati.com/tag/vs.php">vs.php</a>, <a rel="tag" href="http://technorati.com/tag/curl">curl</a>, <a rel="tag" href="http://technorati.com/tag/visual+studio">visual+studio</a></div>
]]></content:encoded>
			<wfw:commentRss>http://arturmarques.com/wordpress/index.php/2010/01/29/debugging-php-curl-in-visual-studio-2008-no-go/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Opera User Javascript and other ways to customize any page, client side</title>
		<link>http://arturmarques.com/wordpress/index.php/2009/05/11/opera-user-javascript-and-other-ways-to-customize-any-page-client-side/</link>
		<comments>http://arturmarques.com/wordpress/index.php/2009/05/11/opera-user-javascript-and-other-ways-to-customize-any-page-client-side/#comments</comments>
		<pubDate>Mon, 11 May 2009 09:35:55 +0000</pubDate>
		<dc:creator>am</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[ENG]]></category>

		<guid isPermaLink="false">http://arturmarques.com/wordpress/index.php/2009/05/11/opera-user-javascript-and-other-ways-to-customize-any-page-client-side/</guid>
		<description><![CDATA[If you, like me, want to customize some sites you visit, your best tools are Opera User Javascript, for the Opera browser, and GreaseMonkey, for Firefox. I use Opera for the sites I have to visit very regularly &#8211; I usually have 100+ open tabs on Opera, mostly news and finance related. Opera is the [...]]]></description>
			<content:encoded><![CDATA[<p>If you, like me, want to customize some sites you visit, your best tools are <strong>Opera User Javascript</strong>, for the Opera browser, and <strong>GreaseMonkey</strong>, for Firefox.</p>
<p>I use Opera for the sites I have to visit very regularly &ndash; I usually have 100+ open tabs on Opera, mostly news and finance related. Opera is the only browser capable of handling this stress without eating up all the PC&rsquo;s memory and also the only one that allows me to stack the open tabs vertically, instead of an row, making the sessions much more usable.</p>
<p>I use Firefox for casual sites&nbsp; and I rarely open more than 20 tabs on it. Firefox is&nbsp;memory hungry and I still couldn&rsquo;t find a theme that stacks tabs, instead of displaying them in a row.</p>
<p>Helpful links:</p>
<p><a href="http://www.xs4all.nl/~vangeijt/opera/userjs.html">http://www.xs4all.nl/~vangeijt/opera/userjs.html</a>&nbsp;&ndash; My favorite introduction to Opera User Javascript.</p>
<p><a href="http://www.xs4all.nl/~vangeijt/opera/userjs-collection.html#standalone">http://www.xs4all.nl/~vangeijt/opera/userjs-collection.html#standalone</a>&nbsp;&ndash; A collection of Opera User JS scripts.</p>
<p><a href="http://www.opera.com/browser/tutorials/userjs/specs/#availobj">http://www.opera.com/browser/tutorials/userjs/specs/#availobj</a>&nbsp;&ndash; Events and methods related to Opera User JS.</p>
<p><a href="http://operawiki.info/UserJS">http://operawiki.info/UserJS</a>&nbsp;&ndash; User Javascript (User JS) on OperaWiki.info.</p>
<p><a href="http://my.opera.com/hallvors/blog/show.dml/12919">http://my.opera.com/hallvors/blog/show.dml/12919</a>&nbsp;&ndash; Hallvord Steen&rsquo;s post on Opera&rsquo;s user JS.</p>
<p><a href="http://my.opera.com/hallvors/blog/">http://my.opera.com/hallvors/blog/</a>&nbsp;- Hallvord Steen&rsquo;s blog.</p>
<p><a href="http://kyleabaker.com/goodies/opera/userjs/">http://kyleabaker.com/goodies/opera/userjs/</a>&nbsp;&ndash; Kyle on Opera JS.</p>
<p><a href="http://kyleabaker.com/">http://kyleabaker.com/</a>&nbsp;&ndash; Kyle&rsquo;s site, mostly Opera focused.</p>
<p><a href="http://www.greasespot.net/">http://www.greasespot.net/</a>&nbsp;&ndash; Greasemonkey is a Firefox extension using which in can customize any web page, via scripts.</p>
<p><a href="https://developer.mozilla.org/En/AJAX">https://developer.mozilla.org/En/AJAX</a>&nbsp;&ndash; Mozilla&rsquo;s introduction to AJAX.</p>
<p><a href="http://pt2.php.net/HttpRequest">http://pt2.php.net/HttpRequest</a>&nbsp;&ndash; Official documentation for PHP&rsquo;s HttpRequest class.</p>
<p><a href="http://www.nusphere.com/kb/phpmanual/function.httprequest-send.htm">http://www.nusphere.com/kb/phpmanual/function.httprequest-send.htm</a>? &ndash; Some HttpRequest examples.</p>
<p><a href="http://www.bin-co.com/php/scripts/load/">http://www.bin-co.com/php/scripts/load/</a>&nbsp;&ndash; Very good function for URL fetching.</p>
<div class="bjtags">Tags:  <a rel="tag" href="http://technorati.com/tag/firefox">firefox</a>, <a rel="tag" href="http://technorati.com/tag/opera">opera</a>, <a rel="tag" href="http://technorati.com/tag/greasemonkey">greasemonkey</a>, <a rel="tag" href="http://technorati.com/tag/javascript">javascript</a></div>
]]></content:encoded>
			<wfw:commentRss>http://arturmarques.com/wordpress/index.php/2009/05/11/opera-user-javascript-and-other-ways-to-customize-any-page-client-side/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel tip: find how many days of the year have gone by</title>
		<link>http://arturmarques.com/wordpress/index.php/2009/01/11/excel-tip-find-how-many-days-of-the-year-have-gone-by/</link>
		<comments>http://arturmarques.com/wordpress/index.php/2009/01/11/excel-tip-find-how-many-days-of-the-year-have-gone-by/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 18:50:30 +0000</pubDate>
		<dc:creator>am</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[ENG]]></category>

		<guid isPermaLink="false">http://arturmarques.com/wordpress/index.php/2009/01/11/excel-tip-find-how-many-days-of-the-year-have-gone-by/</guid>
		<description><![CDATA[When you are working with cells formatted as having dates, if you subtract them, you get how many days separate those dates. Problems might arise when you are writing a &#8220;date&#8221; on some cell, but you are using a custom format for the year, month and day.Because of the custom format, functions like &#8220;DATEVALUE&#8221;, that [...]]]></description>
			<content:encoded><![CDATA[<p>When you are working with cells formatted as having dates, if you subtract them, you get how many days separate those dates.</p>
<p>Problems might arise when you are writing a &ldquo;date&rdquo; on some cell, but you are using a custom format for the year, month and day.<br />Because of the custom format, functions like &ldquo;DATEVALUE&rdquo;, that return the date&rsquo;s serial number, might not work properly.</p>
<p>Here is one simple situation I faced today:</p>
<p>(1) I have cells with a custom date format: yyyy/mm/dd<br />for example, 2009/01/11 respects that format.</p>
<p>(2) I would like to now how many days have gone by since, say, 2009/01/01, relatively to the content of some cell.</p>
<p>This expression answers that question:<br />Date(2009,1,11) &ndash; Date(2009,1,1) = 10</p>
<p>However, the problem is that Date was not performing correctly with some of my cells, so expressions like Date(referenceToSomeCell) could fail.</p>
<p>(3) My solution was to transform each of the cells with &ldquo;dates&rdquo; to text, stating their&nbsp;date format:</p>
<p><strong>TEXT (referenceToSomeCell, &ldquo;yyyy/mm/dd&rdquo;)</strong></p>
<p>This &ldquo;yyyy/mm/dd&rdquo; format states 4 digits for the year, then a forward slash, then 2 digits for the month, then a forward slash, followed by 2 digits for the day.</p>
<p>Having done this,&nbsp;it is easy to extract the corresponding date&rsquo;s &ldquo;serial number&rdquo;, which is the value that will allow basic math, like computing differences.<br />The function to use is &ldquo;DATEVALUE&rdquo;, that expects a &ldquo;date string&rdquo;.</p>
<p>DATEVALUE (TEXT(referenceToSomeCell, &ldquo;yyyy/mm/dd&rdquo;))</p>
<p>(4) So, the straight to the point formula to my original problem is:</p>
<p><strong>DATEVALUE (TEXT(referenceToCell, &ldquo;yyyy/mm/dd&rdquo;)) &ndash; DATE (2009, 1, 1)</strong></p>
<p>Example:<br />&ndash; imagine cell A9 holds 2009/01/11<br />&ndash; the number of days in 2009, up to then, can be computed by the EXCEL expression<br /><strong>DATEVALUE(TEXT(A9, &ldquo;yyyy/mm/dd&rdquo;)) &ndash; DATE (2009, 1, 1)</strong><br />&ndash; the answer is 10<br />&ndash; if we wanted the answer to be inclusive, ie include day 11 also, the expression would be<br /><strong>DATEVALUE(TEXT(A9, &ldquo;yyyy/mm/dd&rdquo;)) &ndash; DATE (2009, 1, 1) +1</strong></p>
<div class="bjtags">Tags:  <a rel="tag" href="http://technorati.com/tag/excel">excel</a>, <a rel="tag" href="http://technorati.com/tag/tip">tip</a>, <a rel="tag" href="http://technorati.com/tag/dates">dates</a></div>
]]></content:encoded>
			<wfw:commentRss>http://arturmarques.com/wordpress/index.php/2009/01/11/excel-tip-find-how-many-days-of-the-year-have-gone-by/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to run C# binaries, as CGI applications, in IIS</title>
		<link>http://arturmarques.com/wordpress/index.php/2006/11/29/how-to-run-c-binaries-as-cgi-applications-in-iis/</link>
		<comments>http://arturmarques.com/wordpress/index.php/2006/11/29/how-to-run-c-binaries-as-cgi-applications-in-iis/#comments</comments>
		<pubDate>Thu, 30 Nov 2006 01:07:17 +0000</pubDate>
		<dc:creator>am</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[distributed systems]]></category>
		<category><![CDATA[edu]]></category>
		<category><![CDATA[inet]]></category>
		<category><![CDATA[inet tech]]></category>
		<category><![CDATA[sistemas distribuídos]]></category>
		<category><![CDATA[sistemas web]]></category>
		<category><![CDATA[web systems]]></category>

		<guid isPermaLink="false">http://arturmarques.com/wordpress/index.php/2006/11/29/how-to-run-c-binaries-as-cgi-applications-in-iis/</guid>
		<description><![CDATA[If you want to use C# to write CGI applications, you might stumble on some technical difficulties, when using the IIS web server: no matter what are the permissions you set for the folder holding the CGI executable, whenever executing it, the web server doesn’t process the file and tries to serve it as if [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to use C# to write CGI applications, you <strong><em>might</em> </strong>stumble on some technical difficulties, when using the IIS web server: no matter what are the permissions you set for the folder holding the CGI executable, whenever executing it, the web server doesn’t process the file and tries to serve it as if the client had requested its download!</p>
<p>One workaround is to explicitly map some dummy extension, to the EXE that you want to use as the CGI application.<br />
For example, map “.CSX” to the executable that is the output of your C# CGI solution.</p>
<p>The HTML that needs to invoke the CGI, <strong><em>must </em></strong>invoke the dummy (zero bytes) .CSX file, because invoking the .EXE would produce the IIS problem already mentioned.</p>
<p>In order to do the “.CSX” &lt;—&gt; “CGI.EXE” mapping, (1) create one server side directory (virtual or not) to hold the C# CGI solutions.</p>
<p>The picture below shows that, in some computer, the “\cgi-bin\cgi_cs” folder was chosen to hold the C# executables.</p>
<p><img border="0" alt="IIS configuration for C# CGI (1 of 6)" src="http://arturmarques.com/images/blog/iis_cgi_cs_config_01_ok.jpg" /></p>
<p>After (1), make sure that you (2) create an “IIS application” for the folder, having execute permissions for BOTH script and executables.</p>
<p><img border="0" alt="IIS configuration for C# CGI (2 of 6)" src="http://arturmarques.com/images/blog/iis_cgi_cs_config_02_ok.jpg" /></p>
<p>Once the application is created, it is possible to configure it. So, (3) click the configuration button.</p>
<p><img border="0" alt="IIS configuration for C# CGI (3 of 6)" src="http://arturmarques.com/images/blog/iis_cgi_cs_config_03_ok.jpg" /></p>
<p>(4) The relevant tab in “application configuration” is the “mappings” tab. Here, click the “Add” button. This operation is the way to build the aforementioned “.CSX” &lt;—&gt; “CGI.EXE” relation.</p>
<p><img border="0" alt="IIS configuration for C# CGI (4 of 6)" src="http://arturmarques.com/images/blog/iis_cgi_cs_config_04_ok.jpg" /></p>
<p>(5) In the “mapping” dialog, browse to the C# .EXE file that is intended to run as a CGI; then type “.CSX” as the extension; then you can uncheck the “check that file exists” option and, finally, press the OK button.</p>
<p>If the OK button is dimmed/grayed/not enabled, just click once on the executable textbox!</p>
<p><img border="0" alt="IIS configuration for C# CGI (5 of 6)" src="http://arturmarques.com/images/blog/iis_cgi_cs_config_05_ok.jpg" /></p>
<p>(6) After this, the “application configuration” dialog box should list the “.CSX” extension at the bottom.</p>
<p>In order to use the new mapping, restart (stop, then start) the IIS web server.</p>
<p>Having done these six steps, all that is left is to code the right invocation of the CGI. For example, if using forms and its action attribute, point the action to some empty .CSX file.</p>
<p>To build an empty CGI.CSX file, go to the “command prompt” and type “copy con cgi.csx”, followed by ENTER, followed by CTRL+Z (which is the end-of-file character).</p>
<p><img border="0" alt="IIS configuration for C# CGI (6 of 6)" src="http://arturmarques.com/images/blog/iis_cgi_cs_config_06_ok.jpg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://arturmarques.com/wordpress/index.php/2006/11/29/how-to-run-c-binaries-as-cgi-applications-in-iis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

