<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ref="http://purl.org/rss/1.0/modules/reference/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://www.spikesnell.com/rdf.php/rss.rdf">
		<title>spikesnell.com</title>
		<link>http://www.spikesnell.com/rdf.php/index.php</link>
		<description><![CDATA[© 2011]]></description>
		<items>
			<rdf:Seq>
				<rdf:li resource="http://www.spikesnell.com/rdf.php/index.php?entry=entry111229-201847" />
				<rdf:li resource="http://www.spikesnell.com/rdf.php/index.php?entry=entry111013-120000" />
				<rdf:li resource="http://www.spikesnell.com/rdf.php/index.php?entry=entry111001-162000" />
				<rdf:li resource="http://www.spikesnell.com/rdf.php/index.php?entry=entry110814-215819" />
				<rdf:li resource="http://www.spikesnell.com/rdf.php/index.php?entry=entry110806-131310" />
				<rdf:li resource="http://www.spikesnell.com/rdf.php/index.php?entry=entry110704-145943" />
			</rdf:Seq>
		</items>
	</channel>
	<item rdf:about="http://www.spikesnell.com/rdf.php/index.php?entry=entry111229-201847">
		<title>Happy Holidays</title>
		<link>http://www.spikesnell.com/rdf.php/index.php?entry=entry111229-201847</link>
		<description><![CDATA[I&#039;ve been working on a small perl script to generate random asscii characters and fill the screen. So far I&#039;ve used this as a screensaver, to generate garbage test files, and to print out and use as wrapping paper.<br /><br />The Code:<br /><br /><pre>#!/usr/bin/perl<br /># simulated snow<br />for (;;) {<br />  my $r = int(rand(93)+33);<br />  print chr($r);<br />}</pre><br />Nothing too fancy going on this time, but thought its worth a mention as I&#039;ve been having a lot of fun with it because of its simplicity and interesting aesthetic appeal.<br /><br />I&#039;ve also made <a href="http://www.youtube.com/watch?v=TxK9LcmjnfY" >this video</a> of the script running in a terminal while playing some of the music I work on under the alias Cheesy Nirvosa as mood music behind it.]]></description>
	</item>
	<item rdf:about="http://www.spikesnell.com/rdf.php/index.php?entry=entry111013-120000">
		<title>Copying and Piracy</title>
		<link>http://www.spikesnell.com/rdf.php/index.php?entry=entry111013-120000</link>
		<description><![CDATA[Computing has brought with it the ability to copy and distribute information at a speed much higher than ever seen before in history and this is presenting us with many legal and ethical challenges. We find ourselves in an age where sharing an artist&#039;s entire life&#039;s work can take merely a <a href="http://www.neurope.eu/blog/copyright-law-turns-kids-criminals-reform-will-enrich-artists-and-public" >single twitch of a finger</a>. This post addresses just a few of the main ethical distinctions on copying and piracy that are<a href="http://consumerist.com/2010/04/is-it-okay-to-download-a-pirated-copy-of-a-book-you-already-own.html" > not entirely clear</a> prima fasciae.<br /><br /><strong>Piracy vs. Copying:</strong><br /><br />The media often addresses digital copying and piracy as if they refer to the same concepts but this is clearly not the case. Piracy refers to copyright infringement where an unauthorized copy of a creative work is created. Copying someone else&#039;s work can often be authorized. One example of authorized copying is the right people have to make one backup copy of software they bought for their own personal archival purposes. Another example of authorized copying is when the copying falls under fair use as described in 17 U.S.C. § 107. What ultimately determines fair use is often up to the courts to decide upon.<br /><br /><strong>Copying vs. Theft:</strong><br /><br />People who hold copyrights often incorrectly equate copying with theft but these are distinctly <a href="http://www.youtube.com/watch?v=IeTybKL1pM4" >different concepts</a>. The difference lies in the fact that theft takes away a product that could potentially be sold. Copying something leaves the original product intact and does not remove it from any marketplace. Many studies have found that the same people who copy and share the most content are also the <a href="http://boingboing.net/2011/07/31/french-copyright-enforcers-pirates-are-big-spenders-on-legit-content.html" >biggest financial contributors</a> to this same material that they enjoy.<br /><br /><strong>Constructive Solution:</strong><br /><br />People will naturally tend toward the best solution available for accessing and enjoying the content that they want to consume. The best way for copyright holders and artists to ensure that their products remain financially viable is for them to embrace new business models that utilize the best content distribution channels that are currently available. Online movie and music streaming services such as <a href="http://www.netflix.com" >Netflix</a> and <a href="http://www.spotify.com" >Spotify</a> have already demonstrated that people are willing to spend money when a legitimate service is providing them with the content that they want more effectively and efficiently than through any other means. Change can be hard, but in the arena of piracy and copying only a drastic and proactive paradigm shift on content delivery models will be able properly address the profitability concerns that copyright holders are currently faced with.<br /><br />A final thought: <br /><br /><em>&quot; When public libraries were introduced in Europe 150 years ago, the<br />book publishers were very much opposed to this. The argument they used<br />was the same one that is being used today in the file sharing debate:<br />If people could get access to books for free, authors would not be<br />able to make a living, and no new books would be written. &quot; - <a href="http://www.techdirt.com/blog/?tag=christian+engstrom" >Christian Engstrom</a></em><br /><br />- Spike]]></description>
	</item>
	<item rdf:about="http://www.spikesnell.com/rdf.php/index.php?entry=entry111001-162000">
		<title>Simple Binary Bash Clock</title>
		<link>http://www.spikesnell.com/rdf.php/index.php?entry=entry111001-162000</link>
		<description><![CDATA[I&#039;ve been meaning to post this for a while, but recently I made a small binary clock in bash in order to add it to my <a href="http://conky.sourceforge.net/" >conky</a> configuration.<br /><br />The script that follows below basically all it does is get the current hour minute and second fields and then convert it to display in binary.<br />It then clears the screen and updates once a second to look exactly like I want it to.<br /><br /><pre><br />#!/bin/bash<br />while true;<br /> do<br />   clear<br />   hour=$(date +%H)<br />   minute=$(date +%M)<br />   second=$(date +%S)<br />   hour_binary=$(echo &quot;ibase=10;obase=2;$hour&quot; | bc)<br />   minute_binary=$(echo &quot;ibase=10;obase=2;$minute&quot; | bc)<br />   second_binary=$(echo &quot;ibase=10;obase=2;$second&quot; | bc)<br />   printf &quot;%06d\n&quot; &quot;$hour_binary&quot;<br />   printf &quot;%06d\n&quot; &quot;$minute_binary&quot;<br />   printf &quot;%06d&quot; &quot;$second_binary&quot;<br />   sleep 1<br /> done<br /></pre><br /><br />Here is an example of the clock in action with the font blown way up:<br /><br /><img src="images/exampleBinary.gif" width="300" height="278" alt="" /><br /><br />The more I work with <a href="http://en.wikipedia.org/wiki/Scripting_language" >scripting</a> things the more ways I can think of to apply scripts. <br /><br />Its an ongoing cycle.<br />]]></description>
	</item>
	<item rdf:about="http://www.spikesnell.com/rdf.php/index.php?entry=entry110814-215819">
		<title>Pi Memorization Javascript</title>
		<link>http://www.spikesnell.com/rdf.php/index.php?entry=entry110814-215819</link>
		<description><![CDATA[I&#039;ve been memorising <a href="http://www.geom.uiuc.edu/~huberty/math5337/groupe/digits.html" >digits of pi</a> off and on for years now. Not really sure why other than it is a fun challenge to be able to recite a long string of numbers.<br /><br />A while back I had found a program that helped me memorise more digits by having a little box to enter the numbers into which would validate each digit as you typed it. The main thing I didn&#039;t like about it was that it would erase the entire field of digits if you got one wrong. This was fine up until I got over about 150 digits or so and it just became too painstaking to retype the first hundred or so digits each time to get to the ones I was stuck at.<br /><br />I decided to use a few days at the end of this summer vacation to put together this <a href="http://spikesnell.com/pi.html" >web based pi memorisation tool</a> with Javascript. View the <a href="http://pastebin.com/yL8kHZSf" >source here</a>.<br /><br />I&#039;ve added such features as a digit counter to show what place you are at, tips for what the next digits would have been if you make a mistake, and the ability to go back variable amounts when you get one wrong.<br /><br />I&#039;m totally up for ideas on how to add to this more or make it more useful. I&#039;ve tested it on multiple browsers but would be very curious to know if its still having bugs with anyone&#039;s particular setup. <br /><br />&lt;brag&gt; And with the added encouragement of making and testing this tool I&#039;m now up over 200 digits. &lt;/brag&gt;]]></description>
	</item>
	<item rdf:about="http://www.spikesnell.com/rdf.php/index.php?entry=entry110806-131310">
		<title>Python Code looks so beautiful</title>
		<link>http://www.spikesnell.com/rdf.php/index.php?entry=entry110806-131310</link>
		<description><![CDATA[Case in point:<br /><pre>def fahrenheit(celsius):<br />    fahr = (9.0/5.0)*celsius + 32<br />    return fahr<br />for temp_c in range (0, 41):<br />    temp_f = fahrenheit(temp_c)<br />    print temp_c,&quot;C&quot; , &quot;| %.1f F&quot; % temp_f </pre><br />Its almost like too-perfect of a language. I feel like I avoid using it because it is just too nice. Its like some sort of super perl that transforms everything into awesomesauce.<br />]]></description>
	</item>
	<item rdf:about="http://www.spikesnell.com/rdf.php/index.php?entry=entry110704-145943">
		<title>Weather Grabber</title>
		<link>http://www.spikesnell.com/rdf.php/index.php?entry=entry110704-145943</link>
		<description><![CDATA[For the last couple of days I have been working the chat server and client that I made last semester. Adding additional features to it has been slow but satisfying work.<br /><br />A weather function has been at the top of my list for things I wanted to see myself implement, so last night I decided to get to working on making something to retrieve the weather.<br /><br />I&#039;ve been using the <a href="http://en.wikipedia.org/wiki/Bash_%28Unix_shell%29" >bash</a> script below to get weather information for months now: <br /><br /><code>#!/bin/bash<br /><br />var_url=&quot;http://www.google.com/ig/api?weather=72959&amp;hl=en&quot;<br /><br />var_weather_wget=`wget -q $var_url -O -`<br />var_weather_xml=`echo &quot;$var_weather_wget&quot; | sed &#039;s/&lt;forecast_conditions&gt;.*//&#039;`<br />var_weather=`echo &quot;$var_weather_xml&quot; | sed &#039;s/&gt;&lt;/&gt;\n&lt;/g&#039;`<br />var_date=`echo &quot;$var_weather&quot; | grep -e &#039;&lt;forecast_date&#039; | \<br />sed -e &#039;s/&lt;forecast_date data=&quot;//&#039; -e &#039;s/&quot;\/&gt;//&#039;`<br />var_city=`echo &quot;$var_weather&quot; | grep -e &#039;&lt;city&#039; | \<br />sed -e &#039;s/&lt;city data=&quot;//&#039; -e &#039;s/&quot;\/&gt;//&#039;`<br />var_condition=`echo &quot;$var_weather&quot; | grep -e &#039;&lt;condition&#039; | \<br />sed -e &#039;s/&lt;condition data=&quot;//&#039; -e &#039;s/&quot;\/&gt;//&#039;`<br />var_temp_f=`echo &quot;$var_weather&quot; | grep -e &#039;&lt;temp_f&#039; | \<br />sed -e &#039;s/&lt;temp_f data=&quot;//&#039; -e &#039;s/&quot;\/&gt;//&#039;`<br />var_temp_c=`echo &quot;$var_weather&quot; | grep -e &#039;&lt;temp_c&#039; | \<br />sed -e &#039;s/&lt;temp_c data=&quot;//&#039; -e &#039;s/&quot;\/&gt;//&#039;`<br />var_humidity=`echo &quot;$var_weather&quot; | grep -e &#039;&lt;humidity&#039; | \<br />sed -e &#039;s/&lt;humidity data=&quot;//&#039; -e &#039;s/&quot;\/&gt;//&#039;`<br />var_wind=`echo &quot;$var_weather&quot; | grep -e &#039;&lt;wind&#039; | \<br />sed -e &#039;s/&lt;wind_condition data=&quot;//&#039; -e &#039;s/&quot;\/&gt;//&#039;`<br /><br />echo &quot;Date: $var_date - City: $var_city&quot;<br />echo &quot;Condition: $var_condition&quot;<br />echo &quot;Temp: $var_temp_c C&quot;<br />echo &quot;$var_humidity&quot;<br />echo &quot;$var_wind&quot;</code><br /><br />This has been working well, but I wanted to make something more extensible with Java that I could add to my chatserver and run with any zipcode instead of just having it set to one location.<br /><br />After finagling around a little I was able to come up with something I&#039;m liking pretty well that fit great into the server I&#039;m putting together: <br /><br /><pre>/*   &lt; &lt;  Current Weather &gt; &gt;      |<br />    Forecast from Google&#039;s API     |<br />           Spike  Snell            |<br />               2011                |<br />----------------------------------*/<br /><br />import java.io.*;<br />import java.net.URL;<br />import java.util.regex.Matcher;<br />import java.util.regex.Pattern;<br /><br />public class weather {<br /><br />	public static void main(String[] args) throws Exception {<br /><br />		if (args.length &gt; 0)<br />			System.out.println(toString(args[0]));<br />		else<br />			System.out.println(&quot;Please enter a valid 5 digit zipcode. Example: java weather 72701&quot;);<br /><br />	}<br /><br />	public static BufferedReader read(String url) throws Exception {<br />		return new BufferedReader(new InputStreamReader(new URL(url).openStream()));<br />	}<br /><br />	public static String toString(String zip) throws Exception {<br />		<br />		// variables to hold the weather<br />		String date = null;<br />		String city = null;<br />		String condition = null;<br />		String tempC = null;<br />		String humidity = null;<br />		String wind = null;<br />		<br />		// declare the pattern and matcher<br />		Pattern p;<br />		Matcher m;<br />		<br />		// check to make sure the string is the right number of characters<br />		if (zip.length() != 5) <br />			return &quot;Please enter the correct number of digits.&quot;;<br />		<br />                // and make sure all 5 of the characters are numbers<br />		p = Pattern.compile(&quot;\\d{5}&quot;);<br />		m = p.matcher(zip);<br />		if (m.find() == false)<br />			return &quot;Please enter a valid 5 digit zipcode.&quot;;<br /><br />		// open up a connection to google&#039;s weather API<br />		BufferedReader reader = read(&quot;http://www.google.com/ig/api?weather=&quot;+ zip);<br />		String page = reader.readLine();<br /><br />		// get the date<br />		p = Pattern.compile(&quot;&lt;forecast_date data=\&quot;(.*?)\&quot;/&gt;&quot;);<br />		m = p.matcher(page);<br />		if (m.find() == true)<br />			date = m.group(1);<br /><br />		// get the city<br />		p = Pattern.compile(&quot;&lt;city data=\&quot;(.*?)\&quot;/&gt;&quot;);<br />		m = p.matcher(page);<br />		if (m.find() == true)<br />			city = m.group(1);<br /><br />		// get the condition<br />		p = Pattern.compile(&quot;&lt;condition data=\&quot;(.*?)\&quot;/&gt;&quot;);<br />		m = p.matcher(page);<br />		if (m.find() == true)<br />			condition = m.group(1);<br /><br />		// get the temperature in C<br />		p = Pattern.compile(&quot;&lt;temp_c data=\&quot;(.*?)\&quot;/&gt;&quot;);<br />		m = p.matcher(page);<br />		if (m.find() == true)<br />			tempC = m.group(1);<br /><br />		// get the humidity<br />		p = Pattern.compile(&quot;&lt;humidity data=\&quot;(.*?)\&quot;/&gt;&quot;);<br />		m = p.matcher(page);<br />		if (m.find() == true)<br />			humidity = m.group(1);<br /><br />		// get the humidity<br />		p = Pattern.compile(&quot;&lt;wind_condition data=\&quot;(.*?)\&quot;/&gt;&quot;);<br />		m = p.matcher(page);<br />		if (m.find() == true)<br />			wind = m.group(1);<br /><br />		// if the date is still null there was a problem<br />		if (date == null) {<br />			return &quot;There was a problem retrieving the weather.&quot;;<br />		}<br /><br />		else {<br />			// return the forecast<br />			return city + &quot; - &quot; + date + <br />			       &quot;\nCondition: &quot; + <br />			       condition+ &quot;\nTemp: &quot; + <br />			       tempC + &quot; *C\n&quot; + <br />			       humidity + &quot;\n&quot; + <br />			       wind;<br />		}<br />	}<br />}<br /></pre><br /><br />What it does is taken in a command line argument for the zipcode and after a bit of error checking (Making sure the zipcode is actually 5 numbers) it grabs the data from <a href="http://blog.programmableweb.com/2010/02/08/googles-secret-weather-api/" >google&#039;s weather API</a>, runs it through some regexes to grab the data I want and then returns everything as a string.<br /><br />Here is an example of it in use:<br /><pre>nrg@AKIRA ~/Desktop $ java weather 72701<br />Fayetteville, AR - 2011-07-04<br />Condition: Mostly Cloudy<br />Temp: 27 *C<br />Humidity: 74%<br />Wind: S at 5 mph</pre>Any feedback on improving this code or any other comments about it would be much appreciated.]]></description>
	</item>
</rdf:RDF>

