<?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>David Phillips &#187; Comp Media for the Web</title>
	<atom:link href="http://davidphillips.us/category/icmweb/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidphillips.us</link>
	<description>Hiya!  I&#039;m a recent ITP graduate student living in New York.  I am hybrid of both designer and front end developer.  I make a mean Keynote too.</description>
	<lastBuildDate>Thu, 19 Jan 2012 18:44:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ICM Web Final: Food Logging site!</title>
		<link>http://davidphillips.us/2009/12/icm-web-final-food-logging-site/</link>
		<comments>http://davidphillips.us/2009/12/icm-web-final-food-logging-site/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 04:57:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Comp Media for the Web]]></category>

		<guid isPermaLink="false">http://davidphillips.us/?p=216</guid>
		<description><![CDATA[Nutritio.us was created out of laziness. I went to a nutritionist a few weeks back and she suggested I write down what I ate every single day, in order to find out how I interact with my food. I know &#8230; <a href="http://davidphillips.us/2009/12/icm-web-final-food-logging-site/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Nutritio.us was created out of laziness.  I went to a nutritionist a few weeks back and she suggested I write down what I ate every single day, in order to find out how I interact with my food.  I know that I&#8217;m bad at small daily tasks, but I&#8217;m much better with reminders.  I decided to create a website that would do it for me.  After mentioning it to multiple people, I learned that other people would love to use the site as well.  So, I started to create an entire login system.  After logging in you could enter the daily report or check out the stastics of your meals, ie-how often you eat at various restaurants, figure out your caloric intake.  This would involve PHP &#038; SQL.  Meanwhile, a cron job would run, sending you e-mails that you should login to your site and write down your daily meals.<br />
<span id="more-216"></span><br />
Creating the databases was fairly easy.  My hosting didn&#8217;t allow me to create databases in PHPMyAdmin, instead they have a SQL Databases section where you set them up and create the username and passwords.  This was not discovered without a bit of difficulty.</p>
<p>I initially went off of a login system tutorial that I found on nettuts.com, and I proceeded to write code for a login, forgot password, register, activate, and logoff page.  This took up an obscene amount of time.  I decided to only use the login page for the sake of deadlines and showing the proof of concept.  There was one issue: the tutorial was unfinished.  The code didn&#8217;t work and I didn&#8217;t know how to login into the database.  I went through and realized my hosting plan adds a prefix to my login.  But the code wasn&#8217;t working.  I met up with Rune and I learned a bunch.<br />
1.The initial code I went through had all of the table names with single quotes.  There didn&#8217;t need to be any quotes at all.<br />
2.The echo&#8217;s that were placed through all the login to state the errors were impeding the ability to login.  Apparently the login can&#8217;t have echo interruptions. Rune showed me that I could create an empty variable with double quotation marks and that would act the same as an echo,</p>
<p>Example Code:  $message = “”; and then call it later, $message = &#8220;The password you supplied did not match the username.&#8221;;</p>
<p>Huzzah!  The next step was to learn Google Visualization!<br />
I chose Google Visualization on the recommendation of my classmate Sebastian.  I went through the website and they had fairly straightforward code, however, for the multiple variations on chart styles, they each have their own code. You also need to sign up for an API key, which is fine, I&#8217;ll be sure to use it later for&#8230;something.  I started initially working with a barchart and then&#8230;doubt.  What if my Time data wouldn&#8217;t work?  I decided it would be smarter, just to have a simple table show my breakfast  preferences and show the frequency in which I ate at those restaurants.</p>
<p>Well, it didn&#8217;t work.  So I debugged.  This is when I Literally discovered the GV code has different code for each type of chart.  So I went through and cleaned it up.  Then I couldn&#8217;t get it to show the frequency.  I worked on the code and then scoured the web for answers.  There, I learned about the COUNT function that will add up the frequency of a table and then you can rename it</p>
<p>Example Code: SELECT break_where, COUNT(break_where) AS frequency FROM foodreports GROUP BY break_where.  </p>
<p>I needed to create a Cron Job.  After learning my hosting doesn&#8217;t allow for cron functions through Terminal(after spending a day getting Terminal opened up), I figured out they have a cron job section on the hosting that is not intuitive, but doable.</p>
<p>There was another issue with the tutorial: it had my username and password into my website contained on the login page and not on a secure page.  </p>
<p>I know this because my site got hacked.  Not just the one site, but every single index page and js page in my hosting.  I host 13 sites.  I&#8217;m still going through and cleaning all the sites.  The hackbot added a section of code at the bottom of each of those pages that seems to send a call to xtube-com.blogger.com.pornorama-com.bluejackmusic.ru</p>
<p>I know, awesome, right?</p>
<p>But a good learning experience.  I took my final down as soon as I realized it was in every single js file, which I did not figure out initially.</p>
<p>So, there you have it.  I have lost my adoration of hackers (technically, it probably a hackbot) and I will be next learning about PHP/SQL security&#8230;in my spare time.</p>
<p>Since I had to take down the site, I will simply provide screenshots.  </p>
]]></content:encoded>
			<wfw:commentRss>http://davidphillips.us/2009/12/icm-web-final-food-logging-site/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Midterm! &#8211; Wear Where. An iPhone app.</title>
		<link>http://davidphillips.us/2009/10/midterm-wear-where-an-iphone-app/</link>
		<comments>http://davidphillips.us/2009/10/midterm-wear-where-an-iphone-app/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 01:24:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Comp Media for the Web]]></category>

		<guid isPermaLink="false">http://davidphillips.us/?p=152</guid>
		<description><![CDATA[So, for my midterm, I wanted to create an agitprop website designed for a teenage demographic.  It would be called &#8220;Wear Where?&#8221; and it would let them know if their clothes were made in sweatshops or not. I was terrified &#8230; <a href="http://davidphillips.us/2009/10/midterm-wear-where-an-iphone-app/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_154" class="wp-caption alignleft" style="width: 330px"><a href="http://davidphillips.us/wp-content/uploads/2009/10/wearwhere-1.jpg"><img class="size-full wp-image-154 " title="wearwhere-1" src="http://davidphillips.us/wp-content/uploads/2009/10/wearwhere-1.jpg" alt="Front page" width="320" height="480" /></a><p class="wp-caption-text">Front page</p></div>
<p>So, for my midterm, I wanted to create an agitprop website designed for a teenage demographic.  It would be called &#8220;Wear Where?&#8221; and it would let them know if their clothes were made in sweatshops or not.</p>
<p>I was terrified of the complexity, but I was committed to making it happen.  My fears were seriously unfounded.  Due the popularity of the iPhone, there are a ton of tutorials.  The one that matched my needs the most was from <a href="http://nettuts.com" target="_blank">nettuts.com</a>.  I finished the tutorial and now it was time to implement my code.  I have grand plans to let Wear Where? to be a native app with the capability to do barcode recognition, but for now, the easiest implementation is a drop down menu that correlates with either a PHP script for a MySQL database.  After discussing it with Corey the resident, the best way to organize it is with multi-sub-folders and then correlating id tags with a php script that changes the image and body text source with the correlating brand names.</p>
<p>When the user chooses the Gap for their brand name, the results page takes Gap with an id tag of &#8216;gap&#8217; and throws it into my images and content lines of code, <strong>&lt;</strong><strong>? echo &#8216;&lt;img src=&#8221;brands/&#8217; . $brand . &#8216;/img1.jpg&#8221; alt=&#8221;logo&#8221;&gt;&#8217;; ?&gt;</strong>.  I had to be careful not to use double quotes within single quotes.  I also had issues with calling the <strong>$brand</strong> variable within the image source code, I had to take on the whole img tag to get it to work.  Not sure why, but it was an easy enough fix.  For the content, I wanted either a happy or sad mascot icon, but I ran out of time and just hardcoded the image in.</p>
<p>I spent some (re: too much) time on the logo/mascot, the happy wire hanger, and getting the background to work.  I was having issues the jQuery images aligning to the right, thus forcing my user to scroll to the right and ruining the vertical flow, so I made the background a repeatable image, which was fun cuz I&#8217;ve never used the offset tool(ultimately I just created vertical lines instead of diagonal, even though it&#8217;s not as cool.  Also had to kill my gradient.)  I also had issues with getting the background to stay constant when the user scrolled down, but again, it was a time issue.</p>
<p>In future versions, I hope to combine with a non-corrupt labor organization or some other NGO, get a thorough listing of sweatshop conditions, pay rates, etc and create a native app that allows for barcode recognition so it can be actually used in stores, in addition to a contact form to get further information or to submit new brands to look for.  But, this being my first semi-big project, we&#8217;ll see how it goes.<br />
<span id="more-152"></span></p>
<p>Screenshots:</p>
<div id="attachment_155" class="wp-caption alignleft" style="width: 330px"><a href="http://davidphillips.us/wp-content/uploads/2009/10/wearwhere-2.jpg"><img class="size-full wp-image-155" title="wearwhere-2" src="http://davidphillips.us/wp-content/uploads/2009/10/wearwhere-2.jpg" alt="Results page with first image" width="320" height="480" /></a><p class="wp-caption-text">Results page with first image</p></div>
<div id="attachment_156" class="wp-caption alignleft" style="width: 330px"><a href="http://davidphillips.us/wp-content/uploads/2009/10/wearwhere-3.jpg"><img class="size-full wp-image-156" title="wearwhere-3" src="http://davidphillips.us/wp-content/uploads/2009/10/wearwhere-3.jpg" alt="results page with 2nd image and Read More jquery button" width="320" height="480" /></a><p class="wp-caption-text">results page with 2nd image and Read More jquery button</p></div>
]]></content:encoded>
			<wfw:commentRss>http://davidphillips.us/2009/10/midterm-wear-where-an-iphone-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ICM Week 6 &#8211; Using js to control Physical Devices</title>
		<link>http://davidphillips.us/2009/10/icm-week-6-using-js-to-control-physical-devices/</link>
		<comments>http://davidphillips.us/2009/10/icm-week-6-using-js-to-control-physical-devices/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 23:17:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Comp Media for the Web]]></category>

		<guid isPermaLink="false">http://davidphillips.us/?p=146</guid>
		<description><![CDATA[The Challenge: Use the web to control a physical device or vice versa.  I decided to combine the homework pieces of the serial lab and video objects to ultimately to control the volume of a Quicktime video with a potentiometer. &#8230; <a href="http://davidphillips.us/2009/10/icm-week-6-using-js-to-control-physical-devices/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Challenge: Use the web to control a physical device or vice versa.  I decided to combine the homework pieces of the serial lab and video objects to ultimately to control the volume of a Quicktime video with a potentiometer.</p>
<p>I struggled with the homework considerably.  Quicktime video have a limited number of video controls, but I was sure that there would be audio levels.  Quicktime itself provides a series of control options on their websites, plus I was able to find two different ways of controlling the audio.  One used javascript and the other used rewriting the QT in javascript as opposed to an object embed.  Javascript was already controlling the play, pause function in the demo, so I figured I could piggyback the volume control into the timerran code and  finally came up with this:</p>
<pre style="word-wrap: break-word; white-space: pre-wrap;">document.bushfinger.SetVolume(inByte);</pre>
<p>The real issue was &#8220;bushfinger.&#8221;  That is the object id.  The issue is the code being used for the video also includes a jpg as it&#8217;s intro image.  I was unsure if the id tag on that correlates to just the jpg or the entire object and thusly assumed you needed to give the video it&#8217;s own id tag.  Course, I couldn&#8217;t find an id tag, but I could find a videoname tag.  Someone mentioned that videoname was the same thing as id.  They were wrong, but understandably.  Also, understandably, it didn&#8217;t work with the videoname reference in place of the id.  Here is the finished page.  It won&#8217;t really work for anyone who does not have the Arduino, the Arduino code and a potentiometer setup.  Luckily, I have a youtube video that will do the work so you don&#8217;t have to.  Cuz I&#8217;m a nice guy.</p>
<p><a href="http://davidphillips.us/icmweb/w6-jsstearns.html">http://davidphillips.us/icmweb/w6-jsstearns.html</a></p>
<p><a href="http://www.youtube.com/watch?v=s0j9Y4knd2M&#038;fmt=18">www.youtube.com/watch?v=s0j9Y4knd2M</a></p>
<p>This video isn&#8217;t the best at proving the concept, but the talking that you hear is the video and then it diminishes with the turn of the potentiometer.  Which is awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidphillips.us/2009/10/icm-week-6-using-js-to-control-physical-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ICM Web Week 5: PHP Strings</title>
		<link>http://davidphillips.us/2009/10/icm-web-week-4-php/</link>
		<comments>http://davidphillips.us/2009/10/icm-web-week-4-php/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 03:26:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Comp Media for the Web]]></category>

		<guid isPermaLink="false">http://davidphillips.us/?p=112</guid>
		<description><![CDATA[This is me testing to see how the excerpt works, I'll let you know how it goes. <a href="http://davidphillips.us/2009/10/icm-web-week-4-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Heya there team,</p>
<p>So, I am unsure how to call up the last part of an array that I&#8217;ve placed in a text file.</p>
<p>The goal is to have the end-user input their zip code and then tell them what the what the temperature is going to be in their city.</p>
<p>I&#8217;ve got all the pages in order, per se.</p>
<p><a style="color: #336633;" href="http://davidphillips.us/icmweb/weather.html" target="_blank">http://davidphillips.us/icmweb/weather.html</a></p>
<p>which gets processed here:<br />
<a style="color: #336633;" href="http://davidphillips.us/icmweb/process_form.php" target="_blank">http://davidphillips.us/icmweb/process_form.php</a></p>
<p>which goes into this text file:<br />
<a style="color: #336633;" href="http://davidphillips.us/icmweb/zipcode_data.txt" target="_blank">http://davidphillips.us/icmweb/zipcode_data.txt</a></p>
<p>and can be seen here:<br />
<a style="color: #336633;" href="http://davidphillips.us/icmweb/display_comments.php" target="_blank">http://davidphillips.us/icmweb/display_comments.php</a></p>
<p>How can I get the last zip code to plug into this page:<br />
<a style="color: #336633;" href="http://davidphillips.us/icmweb/w5-php.php" target="_blank">http://davidphillips.us/icmweb/w5-php.php</a></p>
<p>Here&#8217;s the code:</p>
<blockquote><p>&lt;?</p>
<p>function myGrabs($stringStart) {<br />
$zipCode = 10010;<br />
$weather_source = &#8220;<a style="color: #336633;" href="http://weather.yahooapis.com/forecastrss?p=" target="_blank">http://weather.yahooapis.com/forecastrss?p=</a>&#8221; . $zipCode;<br />
$weather_data = file_get_contents($weather_source);</p>
<p>//        $stringStart = &#8220;temp=\&#8221;";<br />
$stringEnd = &#8220;\&#8221;";</p>
<p>$startPos = strpos($weather_data,$stringStart);<br />
$startPos += strlen($stringStart);<br />
$endPos = strpos($weather_data,$stringEnd,$startPos);<br />
$tempString = substr($weather_data,$startPos,$endPos-$startPos);<br />
return($tempString);            //this allows the future calls of the function to nab the result of the function.<br />
}</p>
<p>$myTemp = myGrabs(&#8220;temp=\&#8221;");<br />
echo(&#8220;The weather is currently &#8221; . $myTemp);<br />
$myCity = myGrabs(&#8220;city=\&#8221;");<br />
echo(&#8220;in the lovely and underappreciated city of &#8221; . $myCity . &#8220;.&#8221;);<br />
?&gt;</p>
<p>So, to sum up, I want to get the last placed array from the text file or from the first page, and plug it into the final page as the $zipCode.</p></blockquote>
<p>All the pages are pretty in line with the notes code.<br />
Preferrably, this could all be done in 2 steps and not 5 or whatever, but that&#8217;s beside the point.</p>
<p>I hope you are all having luck with your pages!</p>
<p>Sincerely,</p>
<p>David</p>
]]></content:encoded>
			<wfw:commentRss>http://davidphillips.us/2009/10/icm-web-week-4-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ICM Web &#8211; Week 3 Homework</title>
		<link>http://davidphillips.us/2009/09/icm-web-week-3-homework/</link>
		<comments>http://davidphillips.us/2009/09/icm-web-week-3-homework/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 15:38:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Comp Media for the Web]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[Fortune]]></category>
		<category><![CDATA[Hana]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[Teller]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://davidphillips.us/?p=76</guid>
		<description><![CDATA[Hana and I started working on a fortune teller for the web last week and I finally got mine up and running. THE ITP FORTUNE TELLER!! Any critiques or comments are appreciated. Thanks again, David]]></description>
			<content:encoded><![CDATA[<p>Hana and I started working on a fortune teller for the web last week and I finally got mine up and running.</p>
<p><a href="http://davidphillips.us/icmweb/origami.html" target="_blank">THE ITP FORTUNE TELLER</a>!!</p>
<p>Any critiques or comments are appreciated.</p>
<p>Thanks again,</p>
<p>David</p>
]]></content:encoded>
			<wfw:commentRss>http://davidphillips.us/2009/09/icm-web-week-3-homework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ICM Web Week 2 pages</title>
		<link>http://davidphillips.us/2009/09/icm-web-week-2-pages/</link>
		<comments>http://davidphillips.us/2009/09/icm-web-week-2-pages/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 21:05:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Comp Media for the Web]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[icm]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://davidphillips.us/?p=57</guid>
		<description><![CDATA[Alright, so I tried to do something really cool (a Pacman image going across the screen with it&#8217;s mouth closing), but apparently that involves a javascript library? Maybe? So, that was awesome. I spent an obscene amount of time getting &#8230; <a href="http://davidphillips.us/2009/09/icm-web-week-2-pages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Alright, so I tried to do something really cool (a Pacman image going across the screen with it&#8217;s mouth closing), but apparently that involves a javascript library? Maybe? So, that was awesome.  I spent an obscene amount of time getting everything to work on just the normal graphic, then I went through and modded everything.  <a title="Not so brills." href="http://davidphillips.us/icmweb/week2.html" target="_blank">Here is the link to my homework</a>.  As you can see, I&#8217;m also making sure to learn proper CSS at the same time.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidphillips.us/2009/09/icm-web-week-2-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

