<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Thoughts on Design</title>
	
	<link>http://www.jamischarles.com/blog</link>
	<description>Thoughts on Web Design and Front-end Coding. Served up Monthly by Jamis Charles</description>
	<lastBuildDate>Wed, 25 Apr 2012 12:09:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/jamischarles/ThoughtsOnDesign" /><feedburner:info uri="jamischarles/thoughtsondesign" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>How to get WordPress on an external page without hacking the db</title>
		<link>http://feedproxy.google.com/~r/jamischarles/ThoughtsOnDesign/~3/8oONhJP33dA/</link>
		<comments>http://www.jamischarles.com/blog/get-wp-posts-without-hacking/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 12:01:03 +0000</pubDate>
		<dc:creator>jamis</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.jamischarles.com/blog/?p=230</guid>
		<description><![CDATA[How to add 5 full WordPress posts on an external html page is one of the most popular posts on this blog. For that reason I&#8217;ve decided to post some more on this topic. I&#8217;ve discovered a way to pull in blog titles and links on an external page without having to access the database [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jamischarles.com/blog/how-to-add-5-full-wordpress-posts-on-an-external-html-page/">How to add 5 full WordPress posts on an external html page</a> is one of the most popular posts on this blog. For that reason I&#8217;ve decided to post some more on this topic.</p>
<p>I&#8217;ve discovered a way to pull in blog titles and links on an external page without having to access the database directly. The former approach is somewhat of a hack which makes it brittle. If the WordPress team decides to change their database structure that approach could fail to work. That&#8217;s why using approved APIs is generally considered a much safer alternative whenever possible.</p>
<p>To make the internal WP functions available on the external page, add the following at the top of your non-WP .php page (in my case index.php):<br />
<script src="https://gist.github.com/2489082.js?file=index.php"></script></p>
<p>Now let&#8217;s define the actual function that will use WordPress commands to fetch recent posts and any data we want. Add the following to functions.php theme file (WP Admin Dashboard -&gt; Appearance, Editor -&gt; Theme Functions):<br />
<script src="https://gist.github.com/2489082.js?file=functions.php"></script></p>
<p>Finally, we need to call that function in the html of our external page (index.php):<br />
<script src="https://gist.github.com/2489082.js?file=index_later.php"></script></p>
<p>Hope you enjoy it. Let me know if you have any issues.</p>
<h3>Related posts:</h3>
<p><a href="http://www.jamischarles.com/blog/how-to-add-5-full-wordpress-posts-on-an-external-html-page/">How to add 5 full WordPress posts on an external html page</a><br />
<a href="http://www.jamischarles.com/blog/how-to-add-recent-wordpress-posts-on-an-external-html-page/">How to add recent WordPress post excerpts on an external html page</a></p>
<img src="http://feeds.feedburner.com/~r/jamischarles/ThoughtsOnDesign/~4/8oONhJP33dA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jamischarles.com/blog/get-wp-posts-without-hacking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jamischarles.com/blog/get-wp-posts-without-hacking/</feedburner:origLink></item>
		<item>
		<title>Automating the next-episode button in Netflix</title>
		<link>http://feedproxy.google.com/~r/jamischarles/ThoughtsOnDesign/~3/cSUfN9-wDLA/</link>
		<comments>http://www.jamischarles.com/blog/automating-netflix/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 21:11:49 +0000</pubDate>
		<dc:creator>jamis</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.jamischarles.com/blog/?p=213</guid>
		<description><![CDATA[I&#8217;ve long since been frustrated by the inability to queue Netflix episodes. A few weeks ago came the final straw: My 2yr old woke up at 3am and refused to go back to bed. The kid requested Shaun the Sheep, which happens to be 20 minutes long. So I can either stay up with the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve long since been frustrated by the inability to queue Netflix episodes. A few weeks ago came the final straw: My 2yr old woke up at 3am and refused to go back to bed. The kid requested Shaun the Sheep, which happens to be 20 minutes long.</p>
<p>So I can either stay up with the kid, or go to bed and risk getting woken up every 20 minutes to fulfill my duty as the next-episode-button-pushing-man. I&#8217;ve been going with option 2, which is no way to live (or sleep).</p>
<p>So I&#8217;d had it, from 3-5am, with my kid on my lap, I resolved to find some sort of solution. Certainly SOMEBODY has written an app to solve my problem. Turns our there was only 1 could find, and it was Windows only, so it wasn&#8217;t a viable option for our iMac in the loft.</p>
<h2>My solution:</h2>
<p>I found a neat program called <a href="http://www.sikuli.com" title="Sikuli" target="_blank">Sikuli</a> (Open Source and written by MIT students) which handles GUI automation. I wrote a python script for it, which now looks for the &#8220;next episode&#8221; button and clicks it (for as many times as I specify). Works like a charm.</p>
<p>Here is the project on Github:<br />
<a href="https://github.com/jamischarles/autoplay_net" title="Autoplay-net" target="_blank">Autoplay-net</a></p>
<p>Here is the source of the script:</p>
<pre class="python">
#setThrowException(False)

#function exit the script
def exitScript(event):
    popup("You've managed to close Autoplay. Script will abort.")

    #kill the program (this is native python)
    import sys
    sys.exit()

#how often has next button been pressed?
counter = 0

#prompt user with input
numEpisodes = input("How many more episodes should this run for? \nexample: 4     |     Press Ctrl + F1 to cancel.")
#default success message that will play after script ends successfully
popMessage = "Done auto-playing episodes!\n" + str(counter) + " played."

#select a region
region = Screen().selectRegion("Where should the mouse-pointer go after autoplaying?")

#take a screenshot, then click that one
#scrnShot = Screen(0).capture("take a screenshot")

#add key listener. Listen for this key combo to exit the script.
Env.addHotkey(Key.F1, KeyModifier.ALT+KeyModifier.CTRL, exitScript)

#loop through looking for the next for the # of times specified by user through input above
for x in range(int(numEpisodes)):
    #look for the button every 5 seconds (easier on CPU)
    while not ("PlayNextEpis.png"):
        wait(5)

    #Check for button existence (for 1 hr)
    if exists("PlayNextEpis.png", 60 * 60 ):
        click(exists("PlayNextEpis.png")) #(first click for focus)
        wait(2) #wait for load
        click(exists("PlayNextEpis.png")) #click again if still there (since we now certainly have focus)

        #increment the counter to show how many were played
        counter += 1
        #update play count here for how many episodes have played
        popMessage = "Done auto-playing episodes!\n" + str(counter) + " episodes auto-played."

        try:
            #move moouse to rest after clicking next episode. This was user selected earlier.
            mouseMove(region.getTopLeft()) #move to place selected
            #popup("found")

        except:
            #upon failure to find a valid region specified, pop this up, before terminating the script.
            popMessage = "Region selected earlier was invalid. So mouse move didn't work.\n" + str(counter) + " episodes autoplayed."
            #pass # we miss it
            #pass is just a placeholder.

    else:
        popMessage = "Auto-play aborted! Next button wasn't found for 1 hour. \n"
        break #terminate the loop

#popup before script ends with success or failure message.
popup(popMessage)
</pre>
<p>Enjoy. Bear in mind I&#8217;m a total Python newb. If you have any improvements / suggestions please let me know.</p>
<img src="http://feeds.feedburner.com/~r/jamischarles/ThoughtsOnDesign/~4/cSUfN9-wDLA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jamischarles.com/blog/automating-netflix/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.jamischarles.com/blog/automating-netflix/</feedburner:origLink></item>
		<item>
		<title>Lessons learned from Apple's Design Process</title>
		<link>http://feedproxy.google.com/~r/jamischarles/ThoughtsOnDesign/~3/VIuyv93qvgg/</link>
		<comments>http://www.jamischarles.com/blog/lessons-learned-from-apples-design-process/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 00:23:49 +0000</pubDate>
		<dc:creator>jamis</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Interaction Design]]></category>
		<category><![CDATA[Creativity]]></category>

		<guid isPermaLink="false">http://www.jamischarles.com/blog/?p=187</guid>
		<description><![CDATA[Some time ago I ran across a BusinessWeek article about Apple&#8217;s design process: Every week, the teams have two meetings. One in which to brainstorm, to forget about constraints and think freely. As Lopp put it: to &#8220;go crazy&#8221;. Then they also hold a production meeting, an entirely separate but equally regular meeting which is [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago I ran across a BusinessWeek article about <a href="http://www.businessweek.com/the_thread/techbeat/archives/2008/03/apples_design_p.html">Apple&#8217;s design process</a>:</p>
<blockquote style="background:none;"><p>Every week, the teams have two meetings. One in which to brainstorm, to forget about constraints and think freely. As Lopp put it: to &#8220;go crazy&#8221;. Then they also hold a production meeting, an entirely separate but equally regular meeting which is the other&#8217;s antithesis. Here, the designers and engineers are required to nail everything down, to work out how this crazy idea might actually work.</p></blockquote>
<p>This really struck me as quite profound. I&#8217;ve participated in brainstorming sessions, creative sessions, (or whatever else you want to call them) where the goal of the meeting was to come up with creative ways to solve problems and restrictions. <strong>The most successful of these meetings followed something similar to Apple&#8217;s process</strong>.</p>
<h2>Why is this?</h2>
<p>There seems to be something intensely paralyzing about trying to find creative solutions while at the same time trying to remember all of the constraints of the tiny square you&#8217;ve painted around yourself. Trying to find solutions that solve all of the problems while staying inside of the constraints of the box is an unproductive ritual of self-guessing.  You end up shooting yourself down on every idea you come up with. &#8220;This won&#8217;t work. That won&#8217;t either&#8230;&#8221;</p>
<h2>A lesson to be learned from authors</h2>
<p>Authors write a rough draft. They just kind of vomit everything out, and then write and write until they run dry. Then they go back and refine parts that need refining. Many authors will do 9 or 10 rewrites until the finished book ends up being very different from the original draft. The rough draft gets their ideas out on paper. They can improve it. They can show it to others who can critique it.</p>
<h2>Designer&#8217;s Block</h2>
<p>Just like writers have &#8220;writer&#8217;s block&#8221; so do designers. I find the best remedy to this (after sketching and doing the normal research) is to simply open up photoshop and start pushing pixels. Overwhelmingly, after 10 minutes or so of this, I can see a solution and am excited to finish the piece.</p>
<h2>Summary &amp; Conclusion</h2>
<p>Have 1 meeting where anything goes. Everybody&#8217;s idea is appreciated. There are no dumb ideas. This is a meeting for trying to find ways an idea <strong>could</strong> work.</p>
<p>Have a 2nd half or separate meeting where you shoot holes in those ideas. You then usually end up with the really good ones.</p>
<p>A word of caution before I end. There is such a thing as getting input from too many people. With most brilliant ideas, many people don&#8217;t recognize them as such. There will often be opposition. Show it to the right people you trust. Not too many. Design by committee is useless. Now go forth and be brilliant.</p>
<img src="http://feeds.feedburner.com/~r/jamischarles/ThoughtsOnDesign/~4/VIuyv93qvgg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jamischarles.com/blog/lessons-learned-from-apples-design-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jamischarles.com/blog/lessons-learned-from-apples-design-process/</feedburner:origLink></item>
		<item>
		<title>On why I started another Redesign when I had just finished one.</title>
		<link>http://feedproxy.google.com/~r/jamischarles/ThoughtsOnDesign/~3/EZvU6dyhwz4/</link>
		<comments>http://www.jamischarles.com/blog/on-why-another-redesign/#comments</comments>
		<pubDate>Mon, 18 May 2009 12:50:10 +0000</pubDate>
		<dc:creator>jamis</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Rationale]]></category>
		<category><![CDATA[Redesign]]></category>

		<guid isPermaLink="false">http://www.jamischarles.com/blog/?p=159</guid>
		<description><![CDATA[Tired. That about sums up how I feel. The many hours I&#8217;ve spent in the wee of the morning before work. The weekends spent doing nothing but crafting this puppy, taming the beast we call WordPress. I&#8217;m finally happy enough to launch it. So here it is. Of course I&#8217;ll be polishing the site some [...]]]></description>
			<content:encoded><![CDATA[<p>Tired. That about sums up how I feel. The many hours I&#8217;ve spent in the wee of the morning before work. The weekends spent doing nothing but crafting this puppy, taming the beast we call WordPress.</p>
<p>I&#8217;m finally happy enough to launch it. So here it is. Of course I&#8217;ll be polishing the site some more over the coming months, but I&#8217;m itching to move on to other projects that have been kept waiting.</p>
<div class="right full">
<img class="seven" src="http://www.jamischarles.com/images/folio/jamischarles_scrn.jpg" /></p>
<p class="caption">My previous design</p>
</div>
<h2>Why a new site?</h2>
<p>I had just finished my <a href="http://jamischarles.com/sub_oldversions/v4/">previous design</a>, and was very proud of it. I showed it to my brother who just threw up all over it. At first I was just going to ignore his comments, but then I really thought deeply about what he&#8217;d said, sifted through his comments, and extrapolated what he really meant when he said certain things.</p>
<p>It made me realize that I had gone about the entire design process for that site completely wrong. I needed to seriously rethink my methodology. So I pondered and looked to where I could make improvements.</p>
<h2>Goals</h2>
<p>I thought about what the purpose of the site was and what I was trying to accomplish. Once I set my goals, I realized my current design wasn&#8217;t achieving them, primarily because I hadn&#8217;t thought very hard about what the site should do. I had just sat down and started running. I think I still came up with something pretty, but pretty isn&#8217;t always meaningful. I want design that is meaningful. That will make an impact. That will achieve results. </p>
<p>I don&#8217;t like it when people tell me that I&#8217;m here to &#8220;paint pretty pictures&#8221;. I solve problems. I solve business needs. I bring results. It often happens to be pretty. But pretty isn&#8217;t the goal. Effective is.</p>
<h2>A time to think</h2>
<p>I appreciate these times because I get to reflect on my design process and really think about what is working and what isn&#8217;t. I looked around the web. I thought hard. I tried to see what other designers were doing, and meditated some.</p>
<p>So I came up with a new process. It seemed to me that the designers I really respect seem to spend a lot more time thinking about their Design before they start and along the way. They can explain why made their choices. So I tried the same thing. I thought. It thought a lot more at each step of the way. I tried to have good design rationale for everything I did. Some things of course, I just did because I wanted to, but that&#8217;s part of the fun of it. I think it worked better for me. You be the judge.</p>
<p>In the next few weeks I&#8217;ll be talking about my new design process. I&#8217;ll be taking a look under the hood of thise and talk about what went into building it. Starting at custom built RSS feeds, Image Replacement, Grid based design <strong>and</strong> CSS etc.</p>
<p>Until then&#8230;</p>
<img src="http://feeds.feedburner.com/~r/jamischarles/ThoughtsOnDesign/~4/EZvU6dyhwz4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jamischarles.com/blog/on-why-another-redesign/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.jamischarles.com/blog/on-why-another-redesign/</feedburner:origLink></item>
		<item>
		<title>Why I chose Bluehost for cheap, reliable hosting (review)</title>
		<link>http://feedproxy.google.com/~r/jamischarles/ThoughtsOnDesign/~3/6KoZFWSjwl0/</link>
		<comments>http://www.jamischarles.com/blog/why-i-chose-bluehost-for-cheap-reliable-hosting-review/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 12:08:44 +0000</pubDate>
		<dc:creator>jamis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://www.bluebreeze.net/blog/?p=36</guid>
		<description><![CDATA[I am a web designer/developer. I need a reliable host. About 6 months ago I got fed up with my old host because of the excessive down-time I was experiencing. So I decided to look around. I finally settled on Bluehost. Fast forward 6 months later, and I couldn&#8217;t be happier. I haven&#8217;t had a [...]]]></description>
			<content:encoded><![CDATA[<p>I am a web designer/developer. I need a reliable host. About 6 months ago I got fed up with my old host because of the excessive down-time I was experiencing. So I decided to look around.</p>
<p>I finally settled on <a href="http://www.bluehost.com/track/jamis/postlink1">Bluehost</a>. Fast forward 6 months later, and I couldn&#8217;t be happier. I haven&#8217;t had a single entire day of downtime. I remember having minutes of downtime maybe once. It&#8217;s been a great experience. I&#8217;m very pleased with the additional control I get over the server too. Besides that I have access to PHP, Ruby on Rails, SSH, and lots of stuff that usually doesn&#8217;t come standard.</p>
<p class="ulTitle">A list of their features (from their site):</p>
<ul>
<li>UNLIMITED Hosting Space (NEW!)</li>
<li>UNLIMITED File Transfer (NEW!)</li>
<li>web hostingHost UNLIMITED Domains!!!</li>
<li>2,500 POP/Imap Email Accounts</li>
<li>SSH (Secure Shell), SSL, FTP, Stats</li>
<li>CGI, Ruby (RoR), Perl, PHP, MySQL</li>
<li>2000/2002 Front Page Extensions</li>
<li>Free Domain Forever!</li>
<li>Free Site Builder (NEW)</li>
<li>24/7 Superb/Responsive Sales/Support</li>
</ul>
<p>They only have 1 price. It&#8217;s not the cheapest plan, but I thought the added value was definitely worth it. <a href="http://www.bluehost.com/track/jamis/postLink2">Give it a try</a>.</p>
<img src="http://feeds.feedburner.com/~r/jamischarles/ThoughtsOnDesign/~4/6KoZFWSjwl0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jamischarles.com/blog/why-i-chose-bluehost-for-cheap-reliable-hosting-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jamischarles.com/blog/why-i-chose-bluehost-for-cheap-reliable-hosting-review/</feedburner:origLink></item>
		<item>
		<title>Break; and continue; in javascript loops</title>
		<link>http://feedproxy.google.com/~r/jamischarles/ThoughtsOnDesign/~3/15RL9nnmdOw/</link>
		<comments>http://www.jamischarles.com/blog/break-and-continue-in-javascript-loops/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 14:40:22 +0000</pubDate>
		<dc:creator>jamis</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://www.bluebreeze.net/blog/?p=35</guid>
		<description><![CDATA[Break; and continue; statements are essential when working with complex loops. They can be very useful. You can use them to end a loop prematurely, or skip the rest of the loop to start over at the beginning. Here is how you implement it: &#60;script type="text/javascript"&#62; //build our array var array1 = new Array(); array1[0] [...]]]></description>
			<content:encoded><![CDATA[<p>Break; and continue; statements are essential when working with complex loops. They can be very useful. You can use them to end a loop prematurely, or skip the rest of the loop to start over at the beginning. Here is how you implement it:</p>
<pre class="js">&lt;script type="text/javascript"&gt;
//build our array
var array1 = new Array();
array1[0] = 0;
array1[1] = 1;
array1[2] = 2;
array1[3] = 3;
array1[4] = 4;

var numArray = array1.length;
for(var i=0; i&lt;numarray ; i++){
	if (array1[i] == 2){
		continue; //skip to the end of the for loop, then start over after incrementing by 1
	}else if (array1[i] == 3){
		break; //end the for loop, and execute code after the loop
	}

	alert("still in for loop: " + i);
}
	alert("after for loop: " + i);
&lt;/script&gt;</pre>
<p>The above code should have created popups for the numbers &#8220;0&#8243;, &#8220;1&#8243;, and &#8220;3&#8243;. This is because the &#8220;continue;&#8221; statement makes the code skip to the end of the loop, not executing any of the rest of the loop code, then starts over at the beginning of the loop after incrementing i by 1.</p>
<p>The &#8220;break;&#8221; statement causes the loop to end and the code after the loop to be executed. i is NOT incremented anymore and thus remains at 3.</p>
<p>You can also use &#8220;return;&#8221; to just end a function prematurely.</p>
<img src="http://feeds.feedburner.com/~r/jamischarles/ThoughtsOnDesign/~4/15RL9nnmdOw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jamischarles.com/blog/break-and-continue-in-javascript-loops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jamischarles.com/blog/break-and-continue-in-javascript-loops/</feedburner:origLink></item>
		<item>
		<title>Writing a prototype function in JavaScript</title>
		<link>http://feedproxy.google.com/~r/jamischarles/ThoughtsOnDesign/~3/p50u8Mpgp8I/</link>
		<comments>http://www.jamischarles.com/blog/writing-a-prototype-function-in-javascript/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 13:53:56 +0000</pubDate>
		<dc:creator>jamis</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.bluebreeze.net/blog/?p=34</guid>
		<description><![CDATA[This has been tested in FF3, IE7. Say you wanted to add a function that would be inherent to an element, say you wanted to write an &#8220;arrayName.clone()&#8221; method (as found in java, but not JavaScript). Here&#8217;s how: &#60;script type="text/javascript"&#62; Array.prototype.clone = function (){ var newArray = new Array(this.length); for(var i=0; i &#60; this.length; i++ [...]]]></description>
			<content:encoded><![CDATA[<p>This has been tested in FF3, IE7.<br />
Say you wanted to add a function that would be inherent to an element, say you wanted to write an &#8220;arrayName.clone()&#8221; method (as found in java, but not JavaScript). Here&#8217;s how:</p>
<pre class="js">&lt;script type="text/javascript"&gt;
Array.prototype.clone = function (){
	var newArray = new Array(this.length);

	for(var i=0; i &lt; this.length; i++ ){
		newArray[i] = this[i];
	}

	return newArray;
}

&lt;/script&gt;</pre>
<p>This would have the same effect as the following code:</p>
<pre class="js">&lt;script type="text/javascript"&gt;
function cloneArray(oldArray){
	var newArray = new Array(oldArray.length);

	for(var i=0; i &lt; oldArray.length; i++ ){
		newArray[i] = oldArray[i];
	}

	return newArray;
}

&lt;/script&gt;</pre>
<p>The difference here being that for the prototype function you call it by using &#8220;arrayName.clone()&#8221; and for the second function you use cloneArray(arrayName). The both functions return the same thing.</p>
<p>Why not just use the following code below, you might ask? Because what you are doing below is just creating a new reference to the same array object. So if you made changes to oldArray, newArray would reflect those same changes. The functions above actually create and return a brand new array.</p>
<pre class="js">
var oldArray = new Array();
var newArray = oldArray;
</pre>
<img src="http://feeds.feedburner.com/~r/jamischarles/ThoughtsOnDesign/~4/p50u8Mpgp8I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jamischarles.com/blog/writing-a-prototype-function-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jamischarles.com/blog/writing-a-prototype-function-in-javascript/</feedburner:origLink></item>
		<item>
		<title>Designing with a concept</title>
		<link>http://feedproxy.google.com/~r/jamischarles/ThoughtsOnDesign/~3/9VIIXHUpZ9E/</link>
		<comments>http://www.jamischarles.com/blog/designing-with-a-concept/#comments</comments>
		<pubDate>Mon, 05 May 2008 12:13:13 +0000</pubDate>
		<dc:creator>jamis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Concept]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://www.bluebreeze.net/blog/?p=30</guid>
		<description><![CDATA[I recently completed my typography course here at school as I am working on B.S. in Information Systems. The most valuable thing I can remember from my course is the idea of having a concept. Having a concept before you start sketching, before you think the layout, or the colors, or the fonts. Why a [...]]]></description>
			<content:encoded><![CDATA[<p>I recently completed my typography course here at school as I am working on B.S. in Information Systems. The most valuable thing I can remember from my course is the idea of having a concept. Having a concept before you start sketching, before you think the layout, or the colors, or the fonts.</p>
<h2>Why a concept?</h2>
<p>A concept gives a designer a vision to work with. A theme to follow. A goal to aim towards. It is the subconscious end that will(should) guide all of your decisions. If your concept is &#8220;A rainy day&#8221;, you will font that expresses that. You might choose blue as your main color. You might choose a layout or certain effects that make you think of sadness and rain. Suddenly you find yourself having ideas based on this concept, and you have a definite direction to go towards. If you have new ideas, you can always compare them to the concept, and see if it fits.</p>
<p>Your concept will guide and inspire the sketching process. You won&#8217;t choose blue because you like blue, or a 1 column layout because you like it, but because it fits with your concept. Suddenly, you have a completed piece, with it&#8217;s fitting parts that make up that piece. Not just different parts that are trying to fit like puzzle pieces that don&#8217;t belong together. The difference is immediately apparent and powerful.</p>
<h2>How do you get a concept?</h2>
<p>If happen to be designing a page about an artist, you need need to research that artist. Write down words that come to mind. Words like powerful, dressing, provocative, words that are descriptive. I have found time and again, that I will write these words down, until the words cause images to flash in my head. Images of possible designs. I then sketch these images on paper, and explore those options if I like them. If I don&#8217;t I keep going on with my concept.</p>
<p>Once I have my concept, I should try to stick with it as much as I can. The finished piece will be better if I do, because each part will have a sense of belonging. It will feel like it is adding to the piece by being there. Not just there as decoration, or as a crutch, but because it helps express the overall theme or emotion of the piece.</p>
<img src="http://feeds.feedburner.com/~r/jamischarles/ThoughtsOnDesign/~4/9VIIXHUpZ9E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jamischarles.com/blog/designing-with-a-concept/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.jamischarles.com/blog/designing-with-a-concept/</feedburner:origLink></item>
		<item>
		<title>document.getElementById().innerHTML + IE7 can cause problems</title>
		<link>http://feedproxy.google.com/~r/jamischarles/ThoughtsOnDesign/~3/gtcwBItLah0/</link>
		<comments>http://www.jamischarles.com/blog/documentgetelementbyidinnerhtml-ie7-can-cause-problems/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 13:35:01 +0000</pubDate>
		<dc:creator>jamis</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[IE7]]></category>

		<guid isPermaLink="false">http://www.bluebreeze.net/blog/?p=29</guid>
		<description><![CDATA[It seems that Firefox and IE7 can use and replace the innerHTML of a DIV just fine. However when you try it with a table or a tbody tag (among others, I&#8217;m sure), it just breaks apart miserably in IE7 (Firefox works just fine). You&#8217;ll most likely get a JavaScript error that states &#8220;Unknown runtime [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that Firefox and IE7 can use and replace the innerHTML of a DIV just fine. However when you try it with a table or a tbody tag (among others, I&#8217;m sure), it just breaks apart miserably in IE7 (Firefox works just fine). You&#8217;ll most likely get a JavaScript error that states &#8220;Unknown runtime error&#8221; and then point to the line that uses the innerHTML of the element that isn&#8217;t a DIV.</p>
<p>The solution? There are 2 possible workarounds. 1) Use a DIV, or 2) use appendChild(). I will show how to use appendChild here. I&#8217;ve tested this in IE7, FF, and Safari (Mac) and it should work. Thanks to <a href="http://domscripting.com/blog/display/99">Jeremy Keith</a> I was able to figure it out after hours of struggling.</p>
<p>The following code should probably be within a function you call.</p>
<pre class="js">&lt;script type="text/javascript"&gt;

var output = "dynamic output from earlier should go in this variable";

//first, create the table row and the table cell
var newtr = document.createElement("tr");
var newtd = document.createElement("td");

//place the output variable within the table cell, innerHTML here works because it's not on the page yet
//then, append the cell to the row, basically places the "&lt;td&gt;output here&lt;/td&gt;" tags within the &lt;tr&gt;&lt;/tr&gt; tags
newtd.innerHTML = output;
newtr.appendChild(newtd);

//last, append the whole thing to the element, here it'll find the element with the "tbody_one" id, go inside, and make it the last child
document.getElementById("tbody_one").appendChild(newtr);

&lt;/script&gt;</pre>
<img src="http://feeds.feedburner.com/~r/jamischarles/ThoughtsOnDesign/~4/gtcwBItLah0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jamischarles.com/blog/documentgetelementbyidinnerhtml-ie7-can-cause-problems/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.jamischarles.com/blog/documentgetelementbyidinnerhtml-ie7-can-cause-problems/</feedburner:origLink></item>
		<item>
		<title>How to apply javascript to one specific browser (browser sniffer)</title>
		<link>http://feedproxy.google.com/~r/jamischarles/ThoughtsOnDesign/~3/BaYnL6Fy9pA/</link>
		<comments>http://www.jamischarles.com/blog/how-to-apply-javascript-to-one-specific-browser-browser-sniffer/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 14:11:08 +0000</pubDate>
		<dc:creator>jamis</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Browser Sniffer]]></category>

		<guid isPermaLink="false">http://www.bluebreeze.net/blog/?p=28</guid>
		<description><![CDATA[What if you have JavaScript that only works in one browser? What if you&#8217;re using IE and Firefox. Well, you need to write one statement that will execute in IE, then another statement to run in the Firefox. This is also called a browser sniffer. Here&#8217;s how you can do it. First we&#8217;ll show you [...]]]></description>
			<content:encoded><![CDATA[<p>What if you have JavaScript that only works in one browser? What if you&#8217;re using IE and Firefox. Well, you need to write one statement that will execute in IE, then another statement to run in the Firefox. This is also called a browser sniffer.<br />
Here&#8217;s how you can do it.<br />
First we&#8217;ll show you how to write a catch so it&#8217;ll run 1 statement if it is IE, and another if it&#8217;s any other browser.</p>
<pre class="js">
&lt;script type="text/javascript"&gt;
var browser = navigator.appName; //find the browser name

alert(browser); //popup with the browser name

if(browser == "Microsoft Internet Explorer"){
    alert("You are using IE");
}else{
    alert("you are using a different browser than IE");
}
&lt;/script&gt;</pre>
<p>Usually the code above suffices, because most JavaScript will either work in IE or the other browsers.</p>
<img src="http://feeds.feedburner.com/~r/jamischarles/ThoughtsOnDesign/~4/BaYnL6Fy9pA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jamischarles.com/blog/how-to-apply-javascript-to-one-specific-browser-browser-sniffer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.jamischarles.com/blog/how-to-apply-javascript-to-one-specific-browser-browser-sniffer/</feedburner:origLink></item>
	</channel>
</rss>

