<?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>Web Plant Media</title>
	<atom:link href="http://www.webplantmedia.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webplantmedia.com</link>
	<description>Lubbock Web Design and Web Development</description>
	<lastBuildDate>Tue, 20 Apr 2010 07:03:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Simple Constraint Programming Tutorial</title>
		<link>http://www.webplantmedia.com/prolog/2010/04/simple-constraint-programming-tutorial/</link>
		<comments>http://www.webplantmedia.com/prolog/2010/04/simple-constraint-programming-tutorial/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 07:03:40 +0000</pubDate>
		<dc:creator>ChrisB</dc:creator>
				<category><![CDATA[Prolog]]></category>

		<guid isPermaLink="false">http://www.webplantmedia.com/?p=407</guid>
		<description><![CDATA[A programming language is like a tool. Every tool has a specific purpose. One tool does one job better and another tool does another job better. Programming Languages should be thought of the same way. Why Constraint Programming The N-Queens puzzle is very popular and we were able to find several working examples in C [...]]]></description>
			<content:encoded><![CDATA[<p>A programming language is like a tool. Every tool has a specific purpose. One tool does one job better and another tool does another job better. Programming Languages should be thought of the same way.</p>
<h2>Why Constraint Programming</h2>
<p>The N-Queens puzzle is very popular and we were able to find several working examples in C and in Prolog.  We analyzed, compiled and tested all these programs and weighed all the pros and cons these two types of languages.</p>
<p>Prolog, being a higher level language, is intuitively easier to understand and easier to program. You can think about the problem with more abstraction. The challenge in actually programming in prolog is that you need to be able to correctly “define” and thus “constrain” the program to do what needs to be done. You don’t have to worry about data types, pointers, data structures and other lower level issues. All the prolog solutions we came across were between 40 and 50 lines of code. On the downside, it was inconvenient when trying to test any n size greater than 12. Trying to solve the puzzle for n=13 takes about 148 seconds.</p>
<p>We found one good example of the n queens problem written in C. We compiled it under Visual Studio 2008, and ran it. The obvious upside in the C program was the speed. It could still solve the puzzle in under a second for n=13. That’s a huge difference compared with the prolog program.  The downside is trying to understand the code and trying to write the code. It’s not as obvious to see what’s happening. The level of abstraction is not as narrow as it is in prolog. On top having to worry about correctly implementing a solution, you have to worry about correctly defining a data structure, defining the correct data types, properly handling arrays and pointers, and other lower level issues not in any way related to the puzzle’s algorithm. The C program that we were testing was 400 lines of code. 236 lines if you remove the comments. That’s almost 5 times the size of the prolog program.</p>
<h2>Time Comparisons between Prolog and C</h2>
<table class="stats" border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th width="213" valign="top"><strong>N</strong></th>
<th width="213" valign="top"><strong>Prolog <em>(seconds)</em></strong></th>
<th width="213" valign="top"><strong>C <em>(seconds)</em></strong></th>
</tr>
</thead>
<tbody>
<tr>
<td width="213" valign="top"><strong>1</strong></td>
<td width="213" valign="top">&lt; 1</td>
<td width="213" valign="top">&lt; 1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>2</strong></td>
<td width="213" valign="top">&lt;   1</td>
<td width="213" valign="top">&lt;   1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>3</strong></td>
<td width="213" valign="top">&lt; 1</td>
<td width="213" valign="top">&lt; 1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>4</strong></td>
<td width="213" valign="top">&lt;   1</td>
<td width="213" valign="top">&lt;   1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>5</strong></td>
<td width="213" valign="top">&lt; 1</td>
<td width="213" valign="top">&lt; 1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>6</strong></td>
<td width="213" valign="top">&lt;   1</td>
<td width="213" valign="top">&lt;   1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>7</strong></td>
<td width="213" valign="top">&lt; 1</td>
<td width="213" valign="top">&lt; 1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>8</strong></td>
<td width="213" valign="top">&lt;   1</td>
<td width="213" valign="top">&lt;   1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>9</strong></td>
<td width="213" valign="top">&lt; 1</td>
<td width="213" valign="top">&lt; 1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>10</strong></td>
<td width="213" valign="top">&lt;   1</td>
<td width="213" valign="top">&lt;   1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>11</strong></td>
<td width="213" valign="top">3.5</td>
<td width="213" valign="top">&lt; 1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>12</strong></td>
<td width="213" valign="top">20.3</td>
<td width="213" valign="top">&lt;   1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>13</strong></td>
<td width="213" valign="top">Too long</td>
<td width="213" valign="top">&lt; 1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>14</strong></td>
<td width="213" valign="top">Too   long</td>
<td width="213" valign="top">1</td>
</tr>
<tr>
<td width="213" valign="top"><strong>15</strong></td>
<td width="213" valign="top">Too long</td>
<td width="213" valign="top">4</td>
</tr>
<tr>
<td width="213" valign="top"><strong>16</strong></td>
<td width="213" valign="top">Too   long</td>
<td width="213" valign="top">23</td>
</tr>
<tr>
<td width="213" valign="top"><strong>17</strong></td>
<td width="213" valign="top">Too long</td>
<td width="213" valign="top">Too long</td>
</tr>
</tbody>
</table>
<p>Next, we wanted to discuss the simplicity in solving the n-queens problem in prolog. Let’s define our solution for N=4.</p>
<p>We define our solution by stating that each of the 4 queens must occupy it’s very own row, column, downward diagonal, and upward diagonal on a 4&#215;4 board.</p>
<p><img class="alignnone size-full wp-image-408" title="n-queens" src="http://www.webplantmedia.com/wp-content/uploads/2010/04/n-queens1.jpg" alt="" width="400" height="425" /></p>
<p>And that’s our definition! Now we need to tell prolog to do this and write our constraints.</p>

<div class="wp_syntax"><div class="code"><pre class="prolog" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">%% DEFINE OUR BOARD     </span>
<span style="color: #666666; font-style: italic;">%% sq(y-coord, x-coord, downward-diag, upward-diag) </span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">1</span><span style="color: #339933;">,</span><span style="color: #800080;">1</span><span style="color: #339933;">,</span><span style="color: #800080;">4</span><span style="color: #339933;">,</span><span style="color: #800080;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">1</span><span style="color: #339933;">,</span><span style="color: #800080;">2</span><span style="color: #339933;">,</span><span style="color: #800080;">5</span><span style="color: #339933;">,</span><span style="color: #800080;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">1</span><span style="color: #339933;">,</span><span style="color: #800080;">3</span><span style="color: #339933;">,</span><span style="color: #800080;">6</span><span style="color: #339933;">,</span><span style="color: #800080;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">1</span><span style="color: #339933;">,</span><span style="color: #800080;">4</span><span style="color: #339933;">,</span><span style="color: #800080;">7</span><span style="color: #339933;">,</span><span style="color: #800080;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">2</span><span style="color: #339933;">,</span><span style="color: #800080;">1</span><span style="color: #339933;">,</span><span style="color: #800080;">3</span><span style="color: #339933;">,</span><span style="color: #800080;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">2</span><span style="color: #339933;">,</span><span style="color: #800080;">2</span><span style="color: #339933;">,</span><span style="color: #800080;">4</span><span style="color: #339933;">,</span><span style="color: #800080;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">2</span><span style="color: #339933;">,</span><span style="color: #800080;">3</span><span style="color: #339933;">,</span><span style="color: #800080;">5</span><span style="color: #339933;">,</span><span style="color: #800080;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">2</span><span style="color: #339933;">,</span><span style="color: #800080;">4</span><span style="color: #339933;">,</span><span style="color: #800080;">6</span><span style="color: #339933;">,</span><span style="color: #800080;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">3</span><span style="color: #339933;">,</span><span style="color: #800080;">1</span><span style="color: #339933;">,</span><span style="color: #800080;">2</span><span style="color: #339933;">,</span><span style="color: #800080;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">3</span><span style="color: #339933;">,</span><span style="color: #800080;">2</span><span style="color: #339933;">,</span><span style="color: #800080;">3</span><span style="color: #339933;">,</span><span style="color: #800080;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">3</span><span style="color: #339933;">,</span><span style="color: #800080;">3</span><span style="color: #339933;">,</span><span style="color: #800080;">4</span><span style="color: #339933;">,</span><span style="color: #800080;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">3</span><span style="color: #339933;">,</span><span style="color: #800080;">4</span><span style="color: #339933;">,</span><span style="color: #800080;">5</span><span style="color: #339933;">,</span><span style="color: #800080;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">4</span><span style="color: #339933;">,</span><span style="color: #800080;">1</span><span style="color: #339933;">,</span><span style="color: #800080;">1</span><span style="color: #339933;">,</span><span style="color: #800080;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">4</span><span style="color: #339933;">,</span><span style="color: #800080;">2</span><span style="color: #339933;">,</span><span style="color: #800080;">2</span><span style="color: #339933;">,</span><span style="color: #800080;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">4</span><span style="color: #339933;">,</span><span style="color: #800080;">3</span><span style="color: #339933;">,</span><span style="color: #800080;">3</span><span style="color: #339933;">,</span><span style="color: #800080;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #800080;">4</span><span style="color: #339933;">,</span><span style="color: #800080;">4</span><span style="color: #339933;">,</span><span style="color: #800080;">4</span><span style="color: #339933;">,</span><span style="color: #800080;">7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
&nbsp;
<span style="color: #666666; font-style: italic;">%% CONSTRAINT</span>
<span style="color: #666666; font-style: italic;">%% We define our solution by stating that</span>
<span style="color: #666666; font-style: italic;">%% each of the 4 queens must occupy it’s</span>
<span style="color: #666666; font-style: italic;">%% very own row, column, downward diagonal,</span>
<span style="color: #666666; font-style: italic;">%% and upward diagonal on a 4x4 board.</span>
 chess<span style="color: #009900;">&#40;</span><span style="color: #008080;">A</span><span style="color: #339933;">,</span><span style="color: #008080;">B</span><span style="color: #339933;">,</span> <span style="color: #008080;">E</span><span style="color: #339933;">,</span><span style="color: #008080;">F</span><span style="color: #339933;">,</span> <span style="color: #008080;">I</span><span style="color: #339933;">,</span><span style="color: #008080;">J</span><span style="color: #339933;">,</span> <span style="color: #008080;">M</span><span style="color: #339933;">,</span><span style="color: #008080;">N</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:-</span>
 sq<span style="color: #009900;">&#40;</span><span style="color: #008080;">A</span><span style="color: #339933;">,</span><span style="color: #008080;">B</span><span style="color: #339933;">,</span><span style="color: #008080;">C</span><span style="color: #339933;">,</span><span style="color: #008080;">D</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> sq<span style="color: #009900;">&#40;</span><span style="color: #008080;">E</span><span style="color: #339933;">,</span><span style="color: #008080;">F</span><span style="color: #339933;">,</span><span style="color: #008080;">G</span><span style="color: #339933;">,</span><span style="color: #008080;">H</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> sq<span style="color: #009900;">&#40;</span><span style="color: #008080;">I</span><span style="color: #339933;">,</span><span style="color: #008080;">J</span><span style="color: #339933;">,</span><span style="color: #008080;">K</span><span style="color: #339933;">,</span><span style="color: #008080;">L</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> sq<span style="color: #009900;">&#40;</span><span style="color: #008080;">M</span><span style="color: #339933;">,</span><span style="color: #008080;">N</span><span style="color: #339933;">,</span><span style="color: #008080;">O</span><span style="color: #339933;">,</span><span style="color: #008080;">P</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
 <span style="color: #008080;">A</span><span style="color: #339933;">=</span><span style="color: #800080;">1</span><span style="color: #339933;">,</span> <span style="color: #008080;">E</span><span style="color: #339933;">=</span><span style="color: #800080;">2</span><span style="color: #339933;">,</span> <span style="color: #008080;">I</span><span style="color: #339933;">=</span><span style="color: #800080;">3</span><span style="color: #339933;">,</span> <span style="color: #008080;">M</span><span style="color: #339933;">=</span><span style="color: #800080;">4</span><span style="color: #339933;">,</span>
 <span style="color: #008080;">A</span>\<span style="color: #339933;">=</span><span style="color: #008080;">E</span><span style="color: #339933;">,</span> <span style="color: #008080;">A</span>\<span style="color: #339933;">=</span><span style="color: #008080;">I</span><span style="color: #339933;">,</span> <span style="color: #008080;">A</span>\<span style="color: #339933;">=</span><span style="color: #008080;">M</span><span style="color: #339933;">,</span>
 <span style="color: #008080;">B</span>\<span style="color: #339933;">=</span><span style="color: #008080;">F</span><span style="color: #339933;">,</span> <span style="color: #008080;">B</span>\<span style="color: #339933;">=</span><span style="color: #008080;">J</span><span style="color: #339933;">,</span> <span style="color: #008080;">B</span>\<span style="color: #339933;">=</span><span style="color: #008080;">N</span><span style="color: #339933;">,</span>
 <span style="color: #008080;">C</span>\<span style="color: #339933;">=</span><span style="color: #008080;">G</span><span style="color: #339933;">,</span> <span style="color: #008080;">C</span>\<span style="color: #339933;">=</span><span style="color: #008080;">K</span><span style="color: #339933;">,</span> <span style="color: #008080;">C</span>\<span style="color: #339933;">=</span><span style="color: #008080;">O</span><span style="color: #339933;">,</span>
 <span style="color: #008080;">D</span>\<span style="color: #339933;">=</span><span style="color: #008080;">H</span><span style="color: #339933;">,</span> <span style="color: #008080;">D</span>\<span style="color: #339933;">=</span><span style="color: #008080;">L</span><span style="color: #339933;">,</span> <span style="color: #008080;">D</span>\<span style="color: #339933;">=</span><span style="color: #008080;">P</span><span style="color: #339933;">,</span>
 <span style="color: #008080;">E</span>\<span style="color: #339933;">=</span><span style="color: #008080;">I</span><span style="color: #339933;">,</span> <span style="color: #008080;">E</span>\<span style="color: #339933;">=</span><span style="color: #008080;">M</span><span style="color: #339933;">,</span>
 <span style="color: #008080;">F</span>\<span style="color: #339933;">=</span><span style="color: #008080;">J</span><span style="color: #339933;">,</span> <span style="color: #008080;">F</span>\<span style="color: #339933;">=</span><span style="color: #008080;">N</span><span style="color: #339933;">,</span>
 <span style="color: #008080;">G</span>\<span style="color: #339933;">=</span><span style="color: #008080;">K</span><span style="color: #339933;">,</span> <span style="color: #008080;">G</span>\<span style="color: #339933;">=</span><span style="color: #008080;">O</span><span style="color: #339933;">,</span>
 <span style="color: #008080;">H</span>\<span style="color: #339933;">=</span><span style="color: #008080;">L</span><span style="color: #339933;">,</span> <span style="color: #008080;">H</span>\<span style="color: #339933;">=</span><span style="color: #008080;">P</span><span style="color: #339933;">,</span>
 <span style="color: #008080;">I</span>\<span style="color: #339933;">=</span><span style="color: #008080;">M</span><span style="color: #339933;">,</span>
 <span style="color: #008080;">J</span>\<span style="color: #339933;">=</span><span style="color: #008080;">N</span><span style="color: #339933;">,</span>
 <span style="color: #008080;">K</span>\<span style="color: #339933;">=</span><span style="color: #008080;">O</span><span style="color: #339933;">,</span>
 <span style="color: #008080;">L</span>\<span style="color: #339933;">=</span><span style="color: #008080;">P</span><span style="color: #339933;">.</span></pre></div></div>

<p>Here is our output once we run our program:</p>

<div class="wp_syntax"><div class="code"><pre class="prolog" style="font-family:monospace;"><span style="color: #339933;">?-</span> chess<span style="color: #009900;">&#40;</span><span style="color: #008080;">A</span><span style="color: #339933;">,</span><span style="color: #008080;">B</span><span style="color: #339933;">,</span><span style="color: #008080;">E</span><span style="color: #339933;">,</span><span style="color: #008080;">F</span><span style="color: #339933;">,</span><span style="color: #008080;">I</span><span style="color: #339933;">,</span><span style="color: #008080;">J</span><span style="color: #339933;">,</span><span style="color: #008080;">M</span><span style="color: #339933;">,</span><span style="color: #008080;">N</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
&nbsp;
<span style="color: #008080;">A</span> <span style="color: #339933;">=</span> <span style="color: #800080;">1</span><span style="color: #339933;">,</span>
<span style="color: #008080;">B</span> <span style="color: #339933;">=</span> <span style="color: #800080;">2</span><span style="color: #339933;">,</span>
<span style="color: #008080;">E</span> <span style="color: #339933;">=</span> <span style="color: #800080;">2</span><span style="color: #339933;">,</span>
<span style="color: #008080;">F</span> <span style="color: #339933;">=</span> <span style="color: #800080;">4</span><span style="color: #339933;">,</span>
<span style="color: #008080;">I</span> <span style="color: #339933;">=</span> <span style="color: #800080;">3</span><span style="color: #339933;">,</span>
<span style="color: #008080;">J</span> <span style="color: #339933;">=</span> <span style="color: #800080;">1</span><span style="color: #339933;">,</span>
<span style="color: #008080;">M</span> <span style="color: #339933;">=</span> <span style="color: #800080;">4</span><span style="color: #339933;">,</span>
<span style="color: #008080;">N</span> <span style="color: #339933;">=</span> <span style="color: #800080;">3</span> <span style="color: #339933;">;</span></pre></div></div>

<p>Which means:  { Q1(1, 2) , Q2(2, 4) , Q3(3, 1) , Q4(4, 3) }</p>
<p><img class="alignnone size-full wp-image-409" title="nqueens2" src="http://www.webplantmedia.com/wp-content/uploads/2010/04/nqueens2.jpg" alt="" width="400" height="412" /></p>
<p>Which is of course, the right solution. Here was the other solution.</p>

<div class="wp_syntax"><div class="code"><pre class="prolog" style="font-family:monospace;"><span style="color: #008080;">A</span> <span style="color: #339933;">=</span> <span style="color: #800080;">1</span><span style="color: #339933;">,</span>
<span style="color: #008080;">B</span> <span style="color: #339933;">=</span> <span style="color: #800080;">3</span><span style="color: #339933;">,</span>
<span style="color: #008080;">E</span> <span style="color: #339933;">=</span> <span style="color: #800080;">2</span><span style="color: #339933;">,</span>
<span style="color: #008080;">F</span> <span style="color: #339933;">=</span> <span style="color: #800080;">1</span><span style="color: #339933;">,</span>
<span style="color: #008080;">I</span> <span style="color: #339933;">=</span> <span style="color: #800080;">3</span><span style="color: #339933;">,</span>
<span style="color: #008080;">J</span> <span style="color: #339933;">=</span> <span style="color: #800080;">4</span><span style="color: #339933;">,</span>
<span style="color: #008080;">M</span> <span style="color: #339933;">=</span> <span style="color: #800080;">4</span><span style="color: #339933;">,</span>
<span style="color: #008080;">N</span> <span style="color: #339933;">=</span> <span style="color: #800080;">2</span> <span style="color: #339933;">;</span></pre></div></div>

<p>Which means:  { Q1(1, 3) , Q2(2, 1) , Q3(3, 4) , Q4(4, 2) }</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webplantmedia.com/prolog/2010/04/simple-constraint-programming-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mapped File, Paging and Memory Protection &#8211; C Programming</title>
		<link>http://www.webplantmedia.com/c-programming/2010/04/mapped-file-paging-and-memory-protection-c-programming/</link>
		<comments>http://www.webplantmedia.com/c-programming/2010/04/mapped-file-paging-and-memory-protection-c-programming/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 19:30:21 +0000</pubDate>
		<dc:creator>ChrisB</dc:creator>
				<category><![CDATA[C-Programming]]></category>

		<guid isPermaLink="false">http://www.webplantmedia.com/?p=401</guid>
		<description><![CDATA[This program shows use of a number of system calls such as how to map a disk file in the virtual memory of a process space, divide it into pages, set access protection code such as read_only, write_only, etc to individual pages, read/write individual pages, and copy the file back to disk page by page. [...]]]></description>
			<content:encoded><![CDATA[<p>This program shows use of a number of system calls such as how to map a disk file in the virtual memory of a process space, divide it into pages, set access protection code such as read_only, write_only, etc to individual pages, read/write individual pages, and copy the file back to disk page by page.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
<span style="color: #339933;">#include &lt;sys/mman.h&gt;</span>
<span style="color: #339933;">#include &lt;sys/types.h&gt;</span>
<span style="color: #339933;">#include &lt;sys/stat.h&gt;</span>
<span style="color: #339933;">#include &lt;fcntl.h&gt;</span>
<span style="color: #339933;">#include &lt;errno.h&gt;</span>
<span style="color: #339933;">#include &lt;string.h&gt;</span>
<span style="color: #339933;">#include &lt;unistd.h&gt;</span>
<span style="color: #000000; font-weight: bold;">extern</span> <span style="color: #993333;">int</span> errno<span style="color: #339933;">;</span>
&nbsp;
main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #993333;">int</span> fid1<span style="color: #339933;">,</span> fid2<span style="color: #339933;">;</span>
<span style="color: #993333;">void</span> <span style="color: #339933;">*</span>address1<span style="color: #339933;">,</span> <span style="color: #339933;">*</span>address2<span style="color: #339933;">;</span>
<span style="color: #993333;">char</span> buf<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">10</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> data<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">10</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;edwin c&quot;</span><span style="color: #339933;">;</span>
<span style="color: #993333;">char</span> <span style="color: #339933;">*</span>ptr<span style="color: #339933;">,</span> <span style="color: #339933;">*</span>base<span style="color: #339933;">,</span> data1<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">10</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;baldelomar&quot;</span><span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> i<span style="color: #339933;">,</span> n<span style="color: #339933;">,</span> pagesize<span style="color: #339933;">;</span>
<span style="color: #993333;">struct</span> stat statbuf<span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> inFileSize<span style="color: #339933;">,</span> outFileSize<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>fid1 <span style="color: #339933;">=</span> open<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;alice29.txt&quot;</span><span style="color: #339933;">,</span> O_RDWR<span style="color: #339933;">,</span>  <span style="color: #208080;">0600</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>perror<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;alice open failed&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot; errno=%d <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> errno<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
 <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>fstat<span style="color: #009900;">&#40;</span>fid1<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>statbuf<span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> perror<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;fstat error&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
inFileSize <span style="color: #339933;">=</span> statbuf.<span style="color: #202020;">st_size</span><span style="color: #339933;">;</span>
<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Temp1 file size=%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> inFileSize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>fid2 <span style="color: #339933;">=</span> open<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;temp2&quot;</span><span style="color: #339933;">,</span> O_RDWR <span style="color: #339933;">|</span> O_CREAT <span style="color: #339933;">|</span> O_TRUNC<span style="color: #339933;">,</span>  <span style="color: #208080;">0600</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
 perror<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;temp2 open failed&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #808080; font-style: italic;">/* temp2 is empty file. It has no space. Let us make it 20000 bytes
long by setting pointer to 9999 and then writeing a byte. */</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>lseek<span style="color: #009900;">&#40;</span>fid2<span style="color: #339933;">,</span> <span style="color: #0000dd;">19999</span><span style="color: #339933;">,</span> SEEK_SET<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> perror <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;lseek error&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>write<span style="color: #009900;">&#40;</span>fid2<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;X&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">//write 'X' at end</span>
  <span style="color: #009900;">&#123;</span>perror<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;write error&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> exit<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>fstat<span style="color: #009900;">&#40;</span>fid2<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>statbuf<span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> perror<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;fstat error&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
outFileSize <span style="color: #339933;">=</span> statbuf.<span style="color: #202020;">st_size</span><span style="color: #339933;">;</span>
<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Temp2 file size=%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> outFileSize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #808080; font-style: italic;">/*prints size=20000*/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*----------------------------------------------------*/</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>pagesize<span style="color: #339933;">=</span>sysconf<span style="color: #009900;">&#40;</span>_SC_PAGESIZE<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> perror<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;sysconf failed&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;page size =%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> pagesize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* map source file entirely in memory for reading by possibly
multiple processed, who may share all changes. */</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>address1 <span style="color: #339933;">=</span> mmap<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>caddr_t<span style="color: #009900;">&#41;</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> inFileSize<span style="color: #339933;">,</span> PROT_READ<span style="color: #339933;">,</span> MAP_SHARED<span style="color: #339933;">,</span> fid1<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span>MAP_FAILED<span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>perror<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;mmap failed&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;errno=%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> errno<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;actual mapped address1=0x%x<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> address1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
base <span style="color: #339933;">=</span> ptr <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span>address1<span style="color: #339933;">+</span><span style="color: #0000dd;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">8</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> buf<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #339933;">*</span>ptr<span style="color: #339933;">++;</span> buf<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">8</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #ff0000;">'<span style="color: #006699; font-weight: bold;">\0</span>'</span><span style="color: #339933;">;</span>
<span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Reading Source: %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> buf<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* Following attempt to write to source file should cause segmentation
error, because of read_prot, although the file is onped RDWR.*/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*
ptr = base;
for(i=0; i&lt;8; i++) *ptr++ = data[i]; 
fprintf(stderr, &quot;Writing to source: %s\n&quot;, base);
*/</span>
<span style="color: #808080; font-style: italic;">/*----------------------------------------------------*/</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>address2 <span style="color: #339933;">=</span> mmap<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>caddr_t<span style="color: #009900;">&#41;</span> address1<span style="color: #339933;">,</span> <span style="color: #0000dd;">10000</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span>PROT_READ <span style="color: #339933;">|</span> PROT_WRITE<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>  MAP_SHARED<span style="color: #339933;">,</span> fid2<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span>MAP_FAILED<span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>perror<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;mmap failed&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;errno=%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> errno<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;actual address2=0x%x<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> address2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* Make first page write only */</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>mprotect<span style="color: #009900;">&#40;</span>address2<span style="color: #339933;">,</span> pagesize<span style="color: #339933;">,</span> PROT_WRITE<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;protect write error=%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> errno<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #808080; font-style: italic;">/* make second page read only. */</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>mprotect<span style="color: #009900;">&#40;</span>address2<span style="color: #339933;">+</span>pagesize<span style="color: #339933;">,</span> pagesize<span style="color: #339933;">,</span> PROT_READ<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;protect read  error=%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> errno<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">/* Dump one page of memory space to output file */</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>msync<span style="color: #009900;">&#40;</span>address2<span style="color: #339933;">,</span> pagesize<span style="color: #339933;">,</span> MS_SYNC<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;m-sync error=%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> errno<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
munmap<span style="color: #009900;">&#40;</span>address1<span style="color: #339933;">,</span> inFileSize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//remove memory space</span>
munmap<span style="color: #009900;">&#40;</span>address2<span style="color: #339933;">,</span> outFileSize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">/* I/O is possible using file descriptor, but not through alloacted space now. */</span>
close<span style="color: #009900;">&#40;</span>fid1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
close<span style="color: #009900;">&#40;</span>fid2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.webplantmedia.com/c-programming/2010/04/mapped-file-paging-and-memory-protection-c-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sticky Footer at Bottom of Page using JQuery</title>
		<link>http://www.webplantmedia.com/jquery/2010/04/sticky-footer-at-bottom-of-page-using-jquery/</link>
		<comments>http://www.webplantmedia.com/jquery/2010/04/sticky-footer-at-bottom-of-page-using-jquery/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 06:18:26 +0000</pubDate>
		<dc:creator>ChrisB</dc:creator>
				<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.webplantmedia.com/?p=375</guid>
		<description><![CDATA[I was developing a site for my client and I decided that I wanted to make my footer stick to the bottom of the page regardless of the amount of content. I did a search for &#8220;sticky footers&#8221; and found some good CSS hacks. The problem is that it&#8217;s a little hard to implement once [...]]]></description>
			<content:encoded><![CDATA[<p>I was developing a site for my client and I decided that I wanted to make my footer stick to the bottom of the page regardless of the amount of content. I did a search for &#8220;sticky footers&#8221; and found some good CSS hacks. The problem is that it&#8217;s a little hard to implement once you have a majority of you site structured a specific ways.</p>
<p>I can tell you now that the CSS hacks for a sticky footer doesn&#8217;t cooperate well when you have margins declared in other div classes. I spent about an hour trying to get my footer to work right. It would work well in some pages but in others, would display a vertical scroll bar with 20 pixels or so left to scroll.</p>
<p>I got fed up and decided to try and use JQuery to solve my problems. It worked brilliantly! And it&#8217;s as simple as this. If my window height is greater than my content plus footer height, add the appropriate top padding to the footer that will keep it always on the bottom. If the content height is greater than the windows height, leave the padding as it was previously declared in your css. And just make sure you calculate the top padding on page load and when the window is resized.</p>
<p><img class="alignnone size-medium wp-image-376" title="stickyfooter" src="http://www.webplantmedia.com/wp-content/uploads/2010/04/stickyfooter-300x201.jpg" alt="Sticky Footer" /></p>
<p>Here is the code. Just put it at the end of your page somewhere. Make sure you change the class name &#8216;.footer&#8217; with whatever class or id name you are using for your footer.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	positionFooter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	<span style="color: #003366; font-weight: bold;">function</span> positionFooter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> padding_top <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.footer&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;padding-top&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> page_height <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">body</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> padding_top<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> window_height <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> difference <span style="color: #339933;">=</span> window_height <span style="color: #339933;">-</span> page_height<span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>difference <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> 
			difference <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.footer&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			padding<span style="color: #339933;">:</span> difference <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;px 0 0 0&quot;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>
		.<span style="color: #660066;">resize</span><span style="color: #009900;">&#40;</span>positionFooter<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.webplantmedia.com/jquery/2010/04/sticky-footer-at-bottom-of-page-using-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Turn Off Autocomplete in Aptana Studio</title>
		<link>http://www.webplantmedia.com/web-developing/2010/04/turn-off-autocomplete-in-aptana-studio/</link>
		<comments>http://www.webplantmedia.com/web-developing/2010/04/turn-off-autocomplete-in-aptana-studio/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 04:54:01 +0000</pubDate>
		<dc:creator>ChrisB</dc:creator>
				<category><![CDATA[Web Developing]]></category>

		<guid isPermaLink="false">http://www.webplantmedia.com/?p=348</guid>
		<description><![CDATA[I had the hardest time trying to figure out how to turn off autocomplete in Aptana Studio. Which means only two things: That turning off autocomplete is very straightforward and obvious and it just took me a long time to figure it out. Or that no one has gone to the effort to explain how [...]]]></description>
			<content:encoded><![CDATA[<p>I had the hardest time trying to figure out how to turn off autocomplete in Aptana Studio. Which means only two things: That turning off autocomplete is very straightforward and obvious and it just took <em>me</em> a long time to figure it out. Or that no one has gone to the effort to explain how to do it. I&#8217;m assuming and hoping for the latter. Here&#8217;s how:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Window-&gt;Preferences-&gt;Web-&gt;HTML Files-&gt;Editor-&gt;Typing</pre></div></div>

<p>And then uncheck everything. You should be good to go. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webplantmedia.com/web-developing/2010/04/turn-off-autocomplete-in-aptana-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Width Should I Make my Website?</title>
		<link>http://www.webplantmedia.com/web-developing/2010/04/what-width-should-i-make-my-website/</link>
		<comments>http://www.webplantmedia.com/web-developing/2010/04/what-width-should-i-make-my-website/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 00:00:42 +0000</pubDate>
		<dc:creator>ChrisB</dc:creator>
				<category><![CDATA[Web Developing]]></category>

		<guid isPermaLink="false">http://www.webplantmedia.com/?p=274</guid>
		<description><![CDATA[You have two options when it comes to deciding what width to make your website. You can have it expand the whole width of the viewers browser. Or you can have it set at a fixed size. Even if you have your page expanding the whole width of the browser, you&#8217;ll have to decide on [...]]]></description>
			<content:encoded><![CDATA[<p>You have two options when it comes to deciding what width to make your website. You can have it expand the whole width of the viewers browser. Or you can have it set at a fixed size. Even if you have your page expanding the whole width of the browser, you&#8217;ll have to decide on a minimum width for your display to set to.</p>
<p>Personally, I cater towards a screen size of 1024 x 768. The web page you are viewing now has a fixed width of 900 pixels. Here is a list of widths of what other websites are using:</p>
<table class="stats" border="0" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>Name</th>
<th>Website</th>
<th>Width</th>
</tr>
</thead>
<tbody>
<tr>
<td>Facebook</td>
<td><a href="http://facebook.com">facebook.com</a></td>
<td>980px</td>
</tr>
<tr>
<td>Yahoo</td>
<td><a href="http://yahoo.com">yahoo.com</a></td>
<td>990px</td>
</tr>
<tr>
<td>MSN</td>
<td><a href="http://msn.com">msn.com</a></td>
<td>970px</td>
</tr>
<tr>
<td>New York Times</td>
<td><a href="http://nytimes.com">nytimes.com</a></td>
<td>970px</td>
</tr>
<tr>
<td>Wikipedia</td>
<td><a href="http://wikipedia.com">wikipedia.com</a></td>
<td>100%</td>
</tr>
<tr>
<td>Web Krunk</td>
<td><a href="http://webkrunk.com">webkrunk.com</a></td>
<td>985px</td>
</tr>
<tr>
<td>WalMart</td>
<td><a href="http://walmart.com">walmart.com</a></td>
<td>720px</td>
</tr>
<tr>
<td>NFL</td>
<td><a href="http://nfl.com">nfl.com</a></td>
<td>985px</td>
</tr>
<tr>
<td>Best Buy</td>
<td><a href="http://bestbuy.com">bestbuy.com</a></td>
<td>790px</td>
</tr>
<tr>
<td>Apple</td>
<td><a href="http://apple.com">apple.com</a></td>
<td>985px</td>
</tr>
</tbody>
</table>
<p>Here are some statistics on screen size usage from <a href="http://www.w3schools.com/browsers/browsers_display.asp">w3schools.com</a></p>
<table class="stats" border="0" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th align="left" width="20%">Date</th>
<th align="right">Higher</th>
<th align="right">1024&#215;768</th>
<th align="right">800&#215;600</th>
<th align="right">640&#215;480</th>
<th align="right">Unknown</th>
</tr>
</thead>
<tbody>
<tr>
<td>January 2010</td>
<td align="right">76%</td>
<td align="right">20%</td>
<td align="right">1%</td>
<td align="right">0%</td>
<td align="right">3%</td>
</tr>
<tr>
<td>January 2009</td>
<td align="right">57%</td>
<td align="right">36%</td>
<td align="right">4%</td>
<td align="right">0%</td>
<td align="right">3%</td>
</tr>
<tr>
<td>January 2008</td>
<td align="right">38%</td>
<td align="right">48%</td>
<td align="right">8%</td>
<td align="right">0%</td>
<td align="right">6%</td>
</tr>
<tr>
<td>January 2007</td>
<td align="right">26%</td>
<td align="right">54%</td>
<td align="right">14%</td>
<td align="right">0%</td>
<td align="right">6%</td>
</tr>
<tr>
<td>January 2006</td>
<td align="right">17%</td>
<td align="right">57%</td>
<td align="right">20%</td>
<td align="right">0%</td>
<td align="right">6%</td>
</tr>
<tr>
<td>January 2005</td>
<td align="right">12%</td>
<td align="right">53%</td>
<td align="right">30%</td>
<td align="right">0%</td>
<td align="right">5%</td>
</tr>
<tr>
<td>January 2004</td>
<td align="right">10%</td>
<td align="right">47%</td>
<td align="right">37%</td>
<td align="right">1%</td>
<td align="right">5%</td>
</tr>
<tr>
<td>January 2003</td>
<td align="right">6%</td>
<td align="right">40%</td>
<td align="right">47%</td>
<td align="right">2%</td>
<td align="right">5%</td>
</tr>
<tr>
<td>January 2002</td>
<td align="right">6%</td>
<td align="right">34%</td>
<td align="right">52%</td>
<td align="right">3%</td>
<td align="right">5%</td>
</tr>
<tr>
<td>January 2001</td>
<td align="right">5%</td>
<td align="right">29%</td>
<td align="right">55%</td>
<td align="right">6%</td>
<td align="right">5%</td>
</tr>
<tr>
<td>January 2000</td>
<td align="right">4%</td>
<td align="right">25%</td>
<td align="right">56%</td>
<td align="right">11%</td>
<td align="right">4%</td>
</tr>
</tbody>
</table>
<p>More specific screen resolution statistics from <a href="http://www.w3schools.com/browsers/browsers_resolution_higher.asp">w3schools.com</a>.</p>
<table class="stats" border="0" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th colspan="2" align="center">January 2010</th>
</tr>
<tr>
<th align="left">Resolution</th>
<th align="right">% of Total</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">1280&#215;1024</td>
<td align="right">18.2 %</td>
</tr>
<tr>
<td align="left">1280&#215;800</td>
<td align="right">17.3 %</td>
</tr>
<tr>
<td align="left">1440&#215;900</td>
<td align="right">10.5 %</td>
</tr>
<tr>
<td align="left">1680&#215;1050</td>
<td align="right">10.0 %</td>
</tr>
<tr>
<td align="left">1920&#215;1200</td>
<td align="right">4.6 %</td>
</tr>
<tr>
<td align="left">1366&#215;768</td>
<td align="right">3.6 %</td>
</tr>
<tr>
<td align="left">1920&#215;1080</td>
<td align="right">2.3 %</td>
</tr>
<tr>
<td align="left">1152&#215;864</td>
<td align="right">2.1 %</td>
</tr>
<tr>
<td align="left">1600&#215;1200</td>
<td align="right">1.4 %</td>
</tr>
<tr>
<td align="left">1280&#215;768</td>
<td align="right">1.2 %</td>
</tr>
<tr>
<td align="left">Other</td>
<td align="right">4.8 %</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.webplantmedia.com/web-developing/2010/04/what-width-should-i-make-my-website/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to Select Field Names in Table in CakePHP</title>
		<link>http://www.webplantmedia.com/cakephp/2010/04/how-to-select-field-names-in-table-in-cakephp/</link>
		<comments>http://www.webplantmedia.com/cakephp/2010/04/how-to-select-field-names-in-table-in-cakephp/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 07:33:27 +0000</pubDate>
		<dc:creator>ChrisB</dc:creator>
				<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://www.webplantmedia.com/?p=323</guid>
		<description><![CDATA[In php you can use mysql_field_name to get the field name of the specified field in a result. Someone asked me the following question. If Employee table has three rows id,name and address. How do we fetch those names (id,name,address) using sql query in cakephp? First of all, you can&#8217;t actually use mysql_field_name() in cakephp. [...]]]></description>
			<content:encoded><![CDATA[<p>In php you can use <a href="http://php.net/manual/en/function.mysql-field-name.php" target="_blank">mysql_field_name</a>  to get the field name of the specified field in a result. Someone asked me the following question.</p>
<blockquote><p>If Employee table has three rows id,name and address. How do we fetch those names (id,name,address) using sql query in cakephp?</p></blockquote>
<p>First of all, you can&#8217;t actually use mysql_field_name() in cakephp. But there are workarounds. Say you want to find the field names of the the table &#8216;Post&#8217;. Here is what you can do.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$array</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">find</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'all'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$array</span> <span style="color: #339933;">=</span> Set<span style="color: #339933;">::</span><span style="color: #990000;">extract</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/0/Post'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
pr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$field_names</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_keys</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Post'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
pr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$field_names</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The result of the print statements will display the following</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">Array</span>
<span style="color: #009900;">&#40;</span>
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">Array</span>
        <span style="color: #009900;">&#40;</span>
            <span style="color: #009900;">&#91;</span>Post<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">Array</span>
                <span style="color: #009900;">&#40;</span>
                    <span style="color: #009900;">&#91;</span>id<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">2</span>
                    <span style="color: #009900;">&#91;</span>title<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> A title once again
                    <span style="color: #009900;">&#91;</span>body<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> And the post body follows<span style="color: #339933;">.</span>
                    <span style="color: #009900;">&#91;</span>created<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">2010</span><span style="color: #339933;">-</span><span style="color: #208080;">02</span><span style="color: #339933;">-</span><span style="color:#800080;">08</span> <span style="color: #208080;">07</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">48</span><span style="color: #339933;">:</span><span style="color: #208080;">03</span>
                    <span style="color: #009900;">&#91;</span>modified<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> 
                <span style="color: #009900;">&#41;</span>
&nbsp;
        <span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #990000;">Array</span>
<span style="color: #009900;">&#40;</span>
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> id
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> title
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> body
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> created
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> modified
<span style="color: #009900;">&#41;</span></pre></div></div>

<p>I hope this helps. Feel free to comment on this page. I&#8217;ll get notified immediately. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webplantmedia.com/cakephp/2010/04/how-to-select-field-names-in-table-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Web Krunk, Thanks for the Great Blogging Tips You Provide!</title>
		<link>http://www.webplantmedia.com/blogging/2010/04/web-krunk-thanks-for-the-great-blogging-tips-you-provide/</link>
		<comments>http://www.webplantmedia.com/blogging/2010/04/web-krunk-thanks-for-the-great-blogging-tips-you-provide/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 00:39:54 +0000</pubDate>
		<dc:creator>ChrisB</dc:creator>
				<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://www.webplantmedia.com/?p=275</guid>
		<description><![CDATA[I just wanted to give thanks to Web Krunk for providing very useful information regarding blogging and Search Engine Optimization. Because of Web Krunk, I&#8217;ve been able to: Dramatically increase the rate at which Google crawls my site. Before, Google crawled my site once a month. But Web Krunk provided me with great tips and [...]]]></description>
			<content:encoded><![CDATA[<p>I just wanted to give thanks to <a href="http://webkrunk.com">Web Krunk</a> for providing very useful information regarding blogging and Search Engine Optimization. Because of Web Krunk, I&#8217;ve been able to: </p>
<ol>
<li>Dramatically increase the rate at which Google crawls my site. Before, Google crawled my site once a month. But Web Krunk provided me with great tips and now Google crawls my site immediately after I post new articles.</li>
<li>I was also able to achieve a higher ranking in Google&#8217;s organic search for certain keywords vital to the success of my business. </li>
<li>I have a better understand now on how to use twitter and certain wordpress plugins to increase my traffic.</li>
</ol>
<p>Blogging is one of the best ways for anyone to get ahead of the curve. I never ever pictured myself blogging. But there is a lot power in it if you can utilize it correctly. If you are new to blogging, check out <a href="http://www.webkrunk.com">webkrunk.com</a>. It is really helping me to bring more traffic to my site.</p>
<p>Also, if you know of any other good blogging sites out there, leave a comment. I would love to check it out. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webplantmedia.com/blogging/2010/04/web-krunk-thanks-for-the-great-blogging-tips-you-provide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add a Title to Your Blog Homepage in WordPress</title>
		<link>http://www.webplantmedia.com/wordpress/2010/04/add-a-title-to-your-blog-homepage-in-wordpress/</link>
		<comments>http://www.webplantmedia.com/wordpress/2010/04/add-a-title-to-your-blog-homepage-in-wordpress/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 23:26:11 +0000</pubDate>
		<dc:creator>ChrisB</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.webplantmedia.com/?p=285</guid>
		<description><![CDATA[I came across an interesting problem. When you create a WordPress site and your blog page is you home page, there is no editable page in your administration dashboard. Normally, your title tag in WordPress looks like this: &#60;title&#62; &#60;?php wp_title&#40;'&#38;laquo;', true, 'right'&#41;; ?&#62; &#60;?php bloginfo&#40;'name'&#41;; ?&#62; &#60;/title&#62; &#160; /* * This Generates: * &#60;title&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>I came across an interesting problem. When you create a WordPress site and your blog page is you home page, there is no editable page in your administration dashboard. Normally, your title tag in WordPress looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;title&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;laquo;'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> 
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/title&gt;
&nbsp;
/*
* This Generates:
* &lt;title&gt;
*     Your Blog Name
* &lt;/title&gt;
*
* when you are at you home page. And:
*
* &lt;title&gt;
*     Your Post Title « Your Blog Name
* &lt;/title&gt;
*
* when you are on a post page
*/</pre></div></div>

<p>The problem is that wp_title() doesn&#8217;t have any title to return because your blog page isn&#8217;t an editable page in your dashboard. Here is a small hack to get it to work. You will need to make sure to fill out your tagline in Administration->Settings->General->Tagline. This input will act as your title.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;title&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_home<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> 
        bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'description'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot; &amp;laquo; &quot;</span><span style="color: #339933;">;</span> 
    <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> 
        wp_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;laquo;'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
    <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span> 
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/title&gt;
&nbsp;
/*
* This Generates:
* &lt;title&gt;
*     Your Tagline Description « Your Blog Name
* &lt;/title&gt;
*
* when you are at you home page. And:
*
* &lt;title&gt;
*     Your Post Title « Your Blog Name
* &lt;/title&gt;
*
* when you are on a post page
*/</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.webplantmedia.com/wordpress/2010/04/add-a-title-to-your-blog-homepage-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Things Your Website Must Have</title>
		<link>http://www.webplantmedia.com/web-developing/2010/04/10-things-your-website-must-have/</link>
		<comments>http://www.webplantmedia.com/web-developing/2010/04/10-things-your-website-must-have/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 15:14:34 +0000</pubDate>
		<dc:creator>ChrisB</dc:creator>
				<category><![CDATA[Web Developing]]></category>

		<guid isPermaLink="false">http://www.webplantmedia.com/?p=278</guid>
		<description><![CDATA[A well designed, simple, and scalable logo. Your logo is the heart and soul of your organization. Your website should be designed around the style of your logo. If you want to see what really good logos look like, click here. Unique, well-written, and fresh content. Useful content gives visitors an incentive to return and [...]]]></description>
			<content:encoded><![CDATA[<ol class="top_ten">
<li class="top_ten">A well designed, simple, and scalable logo. Your logo is the heart and soul of your organization. Your website should be designed around the style of your logo. If you want to see what really good logos look like, click <a href="http://logooftheday.com/">here</a>.</li>
<li class="top_ten">Unique, well-written, and fresh content. Useful content gives visitors an incentive to return and refer others.</li>
<div class="image_wrapper_right_250"><img class="imageRight alignleft size-full wp-image-279" title="apple_website" src="http://www.webplantmedia.com/wp-content/uploads/2010/04/apple_website.png" alt="" width="250" height="192" />You feel safe and secured buying a computer from Apple. How you present your website is extremely important.</div>
<li class="top_ten">Simple and obvious website navigation. Make sure your visitors are not getting lost.</li>
<li class="top_ten">A great domain name. A simple and easy-to-remember domain name will help you to build your brand and retain loyal visitors.</li>
<li class="top_ten">Pleasant and simple cross-browser-compatible design. It is important to make sure that your website is accessible for all users regardless of the browser or monitor that is used to view it.</li>
<li class="top_ten">High quality images. Poor quality images will make your website appear amateur.</li>
<li class="top_ten">Fast-loading pages. In the first few seconds of visiting your website, a visitor decides to stay or go. It is important that you site loads quickly enough for them to view your website and make the decision for themselves.</li>
<li class="top_ten">Unique titles, headlines, and meta descriptions for each page. Titles, descriptions, and headlines are important to search engine optimization. This is so critical for the success of your organization. There&#8217;s no point in having a good looking website if no one can find it.</li>
<li class="top_ten">Contact information or a contact form. It is a great idea to display contact information because it inspires trust. As an alternative, you can also provide a contact form which is a great way to capture leads, get feedback, or provide visitors with an easy way to contact you.</li>
<li class="top_ten">Custom error pages. Without fail, visitors will visit pages that do not exist. Perhaps an external website linked to a wrong page. Or maybe they mistakenly entered a url in their browser. By creating custom error pages, you can provide your users with a seamless user experience and provide them quick access to whatever they are looking for.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.webplantmedia.com/web-developing/2010/04/10-things-your-website-must-have/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is the Best Text Editor for Web Development?</title>
		<link>http://www.webplantmedia.com/web-developing/2010/04/what-is-the-best-text-editor-for-web-development/</link>
		<comments>http://www.webplantmedia.com/web-developing/2010/04/what-is-the-best-text-editor-for-web-development/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 02:18:10 +0000</pubDate>
		<dc:creator>ChrisB</dc:creator>
				<category><![CDATA[Web Developing]]></category>

		<guid isPermaLink="false">http://www.webplantmedia.com/?p=218</guid>
		<description><![CDATA[I have been developing websites for 7 years now, and I&#8217;ve gone through so many text editors in my quest for finding the perfect text editor. I will go through now and give you my opinion on all the text editors I&#8217;ve used. Let me say now that this review are for the programmers who [...]]]></description>
			<content:encoded><![CDATA[<p>I have been developing websites for 7 years now, and I&#8217;ve gone through so many text editors in my quest for finding the perfect text editor. I will go through now and give you my opinion on all the text editors I&#8217;ve used. Let me say now that this review are for the programmers who hard code every single line and pixel.</p>
<p><img class="imageLeft" title="dreamweaver" src="http://www.webplantmedia.com/wp-content/uploads/2010/04/dreamweaver.png" alt="Dreamweaver Logo" /><br />
<a href="http://www.adobe.com/products/dreamweaver/">Dreamweaver</a> was the first IDE I ever used for developing websites. It has a nice color scheme and the ftp support is very solid. The only draw back is that it can be a little slow at times to upload and download files. Dreamweaver supports auto-upload on <em>save command</em>. It also nicely synchronizes all your server files with your local files. It feels good to know that I always have the latest back up of my website. What I don&#8217;t like about it is that it&#8217;s a very heavy program. It&#8217;s designed not just for coders, but also for designers. There are more configuration options than I care to think about. It&#8217;s also a very expensive piece of software.</p>
<p><img class="imageLeft" title="notepad++" src="http://www.webplantmedia.com/wp-content/uploads/2010/04/npp.jpg" alt="Notepad++ Logo" width="100" /><br />
Next comes <a href="http://notepad-plus.sourceforge.net">Notepad++</a>. This text editor is so close to being the perfect text editor. If it had a better ftp plugin, I would give this editor a grade of a 100. Sadly though, the ftp plugin is quite annoying. First, if you are editing a file for more than 15 minutes without using the ftp, the plugin will automatically disconnect and collapse your tree structure. I get quite a few errors when trying to run general operations like save or download. There have been a few times where the ftp plugin lost some of my files. When downloading, it would download 80% of the file without displaying an error. So if I was editing code somewhere along the top, and a uploaded the file back to the server, I would lose the bottom 20% percent. If you have WAMP server and you are coding locally, Notepad++ is perfect. But if you have to edit files through ftp, It can be a little frustrating.</p>
<p><img class="imageLeft" title="aptana" src="http://www.webplantmedia.com/wp-content/uploads/2010/04/aptana.jpg" alt="Aptana Studio Logo" /><br />
Next comes <a href="http://www.aptana.org/">Aptana Stuido</a>. I was very excited when I heard and read about Aptana. First, their ftp support is very good. I can actually open up multiple ftp sites, and drag and drop files between them. It also has nice CSS support like Dreamweaver. The downside is that it&#8217;s written in JAVA. Not to say there is anything wrong with JAVA applications, but it can be a little slow at times. Sometimes, I feel like there is a small delay between my keystrokes and the text display. It&#8217;s not the most stable program and Aptana has crashed enough for me to make that comment. Sometimes, the FTP can be slow and I just end up using Filezilla to transfer images and videos. It&#8217;s a bit of a hassel to set up at first because you have to install the PHP and JQuery packages in order to start editing files. But, I&#8217;m just being really picky. Aptana is still a good Web Development IDE and it&#8217;s the application I use when I develop websites on Windows. Although, it&#8217;s definitely not my default text editor. It&#8217;s still a little too heavy to get that kind of treatment. Notepad++ gets that award.</p>
<p><img class="imageLeft" title="Coda" src="http://www.webplantmedia.com/wp-content/uploads/2010/04/coda_logo.png" alt="Coda Logo" /><br />
Finally we have <a href="http://www.panic.com/coda/">Coda</a>! It&#8217;s just a beautiful text editor. It&#8217;s lightweight, but at the same time, you can do so much with it. It&#8217;s FTP support is fast and stable. It almost feels like I&#8217;m browsing a local directory. I just get things done faster when working in Coda, and I also feel happier. This is the difference between free open source software and paying for software. Coda cost a $100 to use. But it&#8217;s true that you get what you pay for. All the other text editors listed above are free. Also take note that Coda is only for Mac OS.</p>
<p>Which now brings up another question. Should you develop websites on a Mac or a Windows PC?</p>
<h3>Honorable Mentions</h3>
<p><img class="imageRight" title="Gedit" src="http://www.webplantmedia.com/wp-content/uploads/2010/04/gedit-logo-copy.png" alt="Gedit Logo" /><br />
<a href="http://projects.gnome.org/gedit/">Gedit</a> &#8211; Gedit is for linux. I feel like I spend more time trying to customize it and make it my perfect text editor than actually programming on it. But it&#8217;s very good.</p>
<p><img class="imageRight" title="UltraEdit" src="http://www.webplantmedia.com/wp-content/uploads/2010/04/ultraedit.png" alt="UltraEdit Logo" /><br />
<a href="http://www.ultraedit.com/">UltraEdit</a> &#8211; This text editor is not free. But it&#8217;s pretty good. I didn&#8217;t actually purchase it because Aptana could do everything I needed to do while still being free. UltraEdit is like Notepad++, but with better support.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webplantmedia.com/web-developing/2010/04/what-is-the-best-text-editor-for-web-development/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
