<?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>Kris Range</title>
	<atom:link href="http://blog.krisrange.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.krisrange.com</link>
	<description>Web development</description>
	<lastBuildDate>Sat, 04 Sep 2010 09:03:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Facebook Graph library for ActionScript 3</title>
		<link>http://blog.krisrange.com/2010/09/facebook-graph-library-for-actionscript-3/</link>
		<comments>http://blog.krisrange.com/2010/09/facebook-graph-library-for-actionscript-3/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 09:03:37 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=101</guid>
		<description><![CDATA[The company I work for just released an open source ActionScript 3 library for the Facebook Graph APIs! Check out our blog post as well as our Github and ADDocs: Dareville library for Facebook Graph APIs Github library ASDocs]]></description>
			<content:encoded><![CDATA[<p>The company I work for just released an open source ActionScript 3 library for the Facebook Graph APIs! Check out our blog post as well as our Github and ADDocs:</p>
<p><a href="http://www.dareville.com/post/facebook-graph-as3-api-give-that-baby-a-spin/">Dareville library for Facebook Graph APIs</a><br />
<a href="http://github.com/Dareville/Facebook-Graph">Github library</a><br />
<a href="http://labs.dareville.com/api/facebookgraph/asdoc/">ASDocs</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/09/facebook-graph-library-for-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Throttle RTMP connections</title>
		<link>http://blog.krisrange.com/2010/08/throttle-rtmp-connections/</link>
		<comments>http://blog.krisrange.com/2010/08/throttle-rtmp-connections/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 17:46:38 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[flash video]]></category>
		<category><![CDATA[ipfw]]></category>
		<category><![CDATA[rtmp]]></category>
		<category><![CDATA[throttle]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=94</guid>
		<description><![CDATA[At work, we use Charles to throttle our connections while working locally to help test real life connections. Charles is an amazing program but the one thing that it doesn&#8217;t do is throttle RTMP connections (Flash streaming). If you ever need to throttle RTMP connections while debugging your Flash/Flex applications, here is nice code snippet [...]]]></description>
			<content:encoded><![CDATA[<p>At work, we use <a href="http://www.charlesproxy.com/">Charles</a> to throttle our connections while working locally to help test real life connections. Charles is an amazing program but the one thing that it doesn&#8217;t do is throttle RTMP connections (Flash streaming). If you ever need to throttle RTMP connections while debugging your Flash/Flex applications, here is nice code snippet that one of my coworkers found to do so. I&#8217;ve also converted here to a quick BASH script for OS X terminal. </p>
<p>It takes 2 parameters: First is the speed in kbytes; Second is the port to throttle (I usually just use 80)</p>
<pre class="brush: plain;">
throttle()
{
	sudo ipfw pipe 1 config bw $1KByte/s &amp;&amp;
	sudo ipfw add 1 pipe 1 src-port $2
}

rmthrottle()
{
	sudo ipfw delete 1
}
</pre>
<p>Example terminal output:</p>
<pre class="brush: plain;">
...$ throttle 150 80
Password:
00001 pipe 1 ip from any 80 to any
...$ rmthrottle
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/08/throttle-rtmp-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inserting keywords/variables in Subversion with auto-props</title>
		<link>http://blog.krisrange.com/2010/07/inserting-keywordsvariables-in-subversion-with-auto_props/</link>
		<comments>http://blog.krisrange.com/2010/07/inserting-keywordsvariables-in-subversion-with-auto_props/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 07:18:17 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[auto_props]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=56</guid>
		<description><![CDATA[Spent a little time this week investing how to get keyword variables related to our Subversion repositories (version, last modified by, date, etc) automatically inserted into our code when we commit. My end goal was to have our code looking like the sample below with an initial comment header including our SVN information: /** * [...]]]></description>
			<content:encoded><![CDATA[<p>Spent a little time this week investing how to get keyword variables related to our Subversion repositories (version, last modified by, date, etc) automatically inserted into our code when we commit. My end goal was to have our code looking like the sample below with an initial comment header including our SVN information:</p>
<pre class="brush: as3;">

/**
 * ------------------------------------------------------------
 * Copyright (c) 2010 Some Company.
 * This software is the proprietary information of Some Company
 * All Right Reserved.
 * ------------------------------------------------------------
 *
 * SVN revision information:
 * @version $Revision: 82 $:
 * @author	$Author: kris $:
 * @date	$Date: 2010-07-10 08:36:02 +0200 (Sat, 10 Jul 2010) $:
 */
package com.somecompany.common.somepackage
{
	import flash.display.MovieClip;

	/**
	 * SomeClass description
	 *
	 * @author krisrange
	 */
	public function SomeClass
		extends MovieClip
	{
		/**
		 * Constructor
		 */
		public function SomeClass()
		{
			super();
		}
	}
}
</pre>
<p>As you can see, the SVN revision version, last modified author and last modified date show up in our headers. This is really important as a developer can look at the header and quickly know who last modified the file and who to talk to in case the initial author of the file may not be the developer who last updated functionality.</p>
<p>I will be writing this from the perspective of working on MacOS but most of this information is transferrable directly to a Windows machine except a few things like directory structures.</p>
<p>We need to make sure that files are setup to have their properties changed. The best thing to do is to change this globally for new files/repositories and then go back into any previous projects you have worked on and recursively loop through and add this functionality. </p>
<h3>Modifying the Global Setting:</h3>
<p>On MacOS, go into your home directory and open the &#8220;Config&#8221; file that lives in the hidden folder &#8220;.subversion&#8221;. Once you have this text file opened, uncomment the &#8220;enable_auto_props&#8221; variable in the &#8220;[miscellany]&#8221; section and set it&#8217;s value to &#8220;yes&#8221;. Then add the file types you would like include in the &#8220;[auto-props]&#8221; section with the value of &#8220;svn:keywords=Date Revision Author Id&#8221;. See sample below where I&#8217;ve set auto_props to modify all *.as and *.mxml files:</p>
<pre class="brush: plain;">

[miscellany]
### Automatic properties are defined in the section 'auto-props'.
enable-auto-props = yes

### Section for configuring automatic properties.
[auto-props]
*.as = svn:keywords=Date Revision Author Id
*.mxml = svn:keywords=Date Revision Author Id
</pre>
<h3>Modifying Previous Projects</h3>
<p>In order for previous projects to gain access to this information, we need to set the properties on all the files we have already committed to set the properties on themselves when they are committed into our repositories. To do this, just type the following command for every file type that you want to have auto_props enabled for.</p>
<pre class="brush: plain;">
find * -type f -name '*.as' -exec svn propset svn:keywords &quot;Date Revision Author Id&quot; {}  \;
</pre>
<h3>Getting the Values to Show Up</h3>
<p>After that is all setup, just insert the values in your document based on the corresponding ID. So for example, if you wanted to insert the Last Modified Author, insert it like below and SVN will replace the content inbetween the word &#8220;Author&#8221; and &#8220;$:&#8221; with the actual value:</p>
<pre class="brush: plain;">
$Author: $:
</pre>
<p>For more information on what keywords/properties are available, there is good <a href="http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html">documentation from Subversion</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/07/inserting-keywordsvariables-in-subversion-with-auto_props/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Spotify url validation</title>
		<link>http://blog.krisrange.com/2010/05/spotify-url-validation/</link>
		<comments>http://blog.krisrange.com/2010/05/spotify-url-validation/#comments</comments>
		<pubDate>Mon, 31 May 2010 06:28:13 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[spotify]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=43</guid>
		<description><![CDATA[I created this class for a project I am working on where I need to validate Spotify playlist and track URLs. I hope someone will get some use out of it or maybe improve it. It provides two static methods for validating and allows you to specify the return type which currently is a HTTP [...]]]></description>
			<content:encoded><![CDATA[<p>I created this class for a project I am working on where I need to validate Spotify playlist and track URLs. I hope someone will get some use out of it or maybe improve it. It provides two static methods for validating and allows you to specify the return type which currently is a HTTP or Spotify URL format.</p>
<p><a href="http://www.krisrange.com/code/SpotifyUtil.as">SpotifyUtil</a></p>
<p>Here is an example of how to use the method which will convert the link variable below to &#8220;spotify:user:user_name:playlist:3WbWswJtOPIdKBQmZs9pGr&#8221;:</p>
<pre class="brush: as3;">
var link : String = &quot;http://open.spotify.com/user/user_name/playlist/3WbWswJtOPIdKBQmZs9pGr&quot;;

var validUrl : String = SpotifyUtil.validatePlaylist( link, SpotifyUtil.URL_FORMAT_SPOTIFY );

if( validUrl )
{
	trace( link );
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/05/spotify-url-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ANT with JavaScript</title>
		<link>http://blog.krisrange.com/2010/05/ant-with-javascript/</link>
		<comments>http://blog.krisrange.com/2010/05/ant-with-javascript/#comments</comments>
		<pubDate>Thu, 20 May 2010 16:55:49 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=26</guid>
		<description><![CDATA[Recently at work we had the need to build an application that could both be run over the network and on the local filesystem. Well, this doesn&#8217;t work with the Flash security setup as SWF files can only be run on one or the other. Like many other developers, we use ANT to build our [...]]]></description>
			<content:encoded><![CDATA[<p>Recently at work we had the need to build an application that could both be run over the network and on the local filesystem. Well, this doesn&#8217;t work with the Flash security setup as SWF files can only be run on one or the other. Like many other developers, we use ANT to build our projects and would like setting this property to be built into our build files. The SDK compiler has a nice property called &#8220;use-network&#8221; which can easily be set to true or false depending on your need which solves this situation nicely. The problem we ran into was with ANT and dealing with IF/ELSE target statements.</p>
<p>What we wanted to do was to use the same build SWF targets but for both situations without having to modify our process. Our solution was a nifty trick that used JavaScript inside ANT. I had never seen this technique before but some searching for a solution led us in this direction.</p>
<p>As you can see below, we have two initial targets, one which builds for local file system and one which builds for network use. We can then run either target first, which sets a property in our ANT file and then run our normal SWF build targets as normal, with this property set to the &#8220;use-network&#8221; property. Really looking forward to exploring some more complexities with JavaScript integration (as well as other languages from what I&#8217;ve read).</p>
<pre class="brush: xml;">
&lt;target name=&quot;compile_local&quot;&gt;
	&lt;script language=&quot;javascript&quot;&gt;
	&lt;![CDATA[
		presenter.setProperty( &quot;use-network&quot;, &quot;false&quot; );
	]]&gt;
	&lt;/script&gt;
&lt;/target&gt;
&lt;target name=&quot;compile_network&quot;&gt;
	&lt;script language=&quot;javascript&quot;&gt;
	&lt;![CDATA[
		presenter.setProperty( &quot;use-network&quot;, &quot;true&quot; );
	]]&gt;
	&lt;/script&gt;
&lt;/target&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/05/ant-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just launched SNOOP420.COM</title>
		<link>http://blog.krisrange.com/2010/04/just-launched-snoop420-com/</link>
		<comments>http://blog.krisrange.com/2010/04/just-launched-snoop420-com/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 21:28:23 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[launch]]></category>
		<category><![CDATA[420]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[snoop]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=20</guid>
		<description><![CDATA[Check it out! Props go out to our team for all the work that went into it! SNOOP 4:20]]></description>
			<content:encoded><![CDATA[<p>Check it out! Props go out to our team for all the work that went into it!</p>
<p><a href="http://www.snoop420.com/">SNOOP 4:20</a></p>
<p><img src="http://media.tumblr.com/tumblr_l172aeLbmD1qa1ofo.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/04/just-launched-snoop420-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bay Area: See you in less than 24 hours!</title>
		<link>http://blog.krisrange.com/2010/04/bay-area-see-you-in-less-than-24-hours/</link>
		<comments>http://blog.krisrange.com/2010/04/bay-area-see-you-in-less-than-24-hours/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 21:30:17 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[travel]]></category>
		<category><![CDATA[los angeles]]></category>
		<category><![CDATA[san francisco]]></category>
		<category><![CDATA[snoop]]></category>
		<category><![CDATA[stockholm]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=22</guid>
		<description><![CDATA[Taking a quick break from Stockholm these next few days to do some work in San Francisco and Los Angeles.]]></description>
			<content:encoded><![CDATA[<p>Taking a quick break from Stockholm these next few days to do some work in San Francisco and Los Angeles.</p>
<p><img src="http://media.tumblr.com/tumblr_l09egrmYrC1qa1ofo.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/04/bay-area-see-you-in-less-than-24-hours/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inserting build version numbers into Flash and Flex Applications</title>
		<link>http://blog.krisrange.com/2010/04/inserting-build-version-numbers-into-flash-and-flex-applications/</link>
		<comments>http://blog.krisrange.com/2010/04/inserting-build-version-numbers-into-flash-and-flex-applications/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 09:16:12 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=12</guid>
		<description><![CDATA[For an ActionScript project I am currently working on (and for future projects), we wanted to be able to include the ANT build number into our applications when we do development and production quality releases to clients. The added value in this is that it is extremely helpful if you are constently pushing releases. It [...]]]></description>
			<content:encoded><![CDATA[<p>For an ActionScript project I am currently working on (and for future projects), we wanted to be able to include the ANT build number into our applications when we do development and production quality releases to clients. The added value in this is that it is extremely helpful if you are constently pushing releases. It saves time so that we can easily tell what version our clients are running on their development and production servers. This helps avoid unneeded debugging time making sure that the versions are correct. We also wanted this to happen automatically, or as much as possible, without the need for us to modify text files or add compiler variables.</p>
<p>Ok, lets get started! First, all of these instructions assumes you have a good knowledge in how ANT works. It also assumes you will be building an ActionScript or Flex project. In this case, we are going to be creating a custom ContextMenu but you can really do this for anything. This will allow anyone us to see the version numbers when they right click on our application.</p>
<p>Ok, so how is this done? Open up your build.properties file for the project and add the following lines:</p>
<pre class="brush: as3;">
project.major	  = 1
project.minor     = 0
project.revision  = 0
project.version   = ${project.major}.${project.minor}.${project.revision}
</pre>
<p>The projet will act as our properties for figuring out the project major, minor and revision. These could probably be automated in some way but for now I am ok with manually setting these values since I will know when these versions change. We will also need to include a build number into our build so just add the following before anything else into your build file. Also note that if this file does not exist, ANT will create it for you so no need to concern yourself with what the contents are. Let ANT do the dirty work!</p>
<pre class="brush: xml;">

&lt;buildnumber file=&quot;${basedir}/build/build.number&quot; /&gt;
</pre>
<p>Next, we are going to want to copy our classes to a temporary directory so that we can modify them without harming the source. As you can see I have some temp.outdir and classes.dir properties</p>
<pre class="brush: xml;">

&lt;target name=&quot;copyClasses&quot; description=&quot;Creates a temporary directory where the code will be duplicated so we can modify and build without harming the original files&quot;&gt;
	&lt;mkdir dir=&quot;${temp.outdir}&quot; /&gt;
	&lt;copy todir=&quot;${temp.outdir}&quot;&gt;
		&lt;fileset dir=&quot;${classes.dir}&quot;/&gt;
	&lt;/copy&gt;
&lt;/target&gt;
</pre>
<p>Now that our classes are copied, we need to do a search on them for particular strings that we will end up replacing with the project version. In my case, I have a ContextMenu class which has a string value defined as &#8220;[PROJECT_VERSION_NUMBER]&#8221; so I do a regular expression replace in ANT to find that value and replace it.</p>
<pre class="brush: xml;">

&lt;target name=&quot;projectversion&quot; description=&quot;&quot;&gt;
	&lt;replaceregexp match=&quot;[PROJECT_VERSION_NUMBER]&quot; replace=&quot;${project.fullname} : ${project.version}.${build.number}&quot; flags=&quot;gs&quot;&gt;
		&lt;fileset dir=&quot;${temp.outdir}&quot; includes=&quot;**/*.as&quot;/&gt;
	&lt;/replaceregexp&gt;
&lt;/target&gt;
</pre>
<p>And that is it. Now we have our build number plus project version automatically showing up in our application.</p>
<div style="text-align: center;"><img src="http://media.tumblr.com/tumblr_l0792hZFA61qa1ofo.png" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/04/inserting-build-version-numbers-into-flash-and-flex-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>new site launch</title>
		<link>http://blog.krisrange.com/2009/09/new-site-launch/</link>
		<comments>http://blog.krisrange.com/2009/09/new-site-launch/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 08:51:34 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[launch]]></category>
		<category><![CDATA[new site]]></category>

		<guid isPermaLink="false">http://d7892152.u108.c8.ixwebhosting.com/?p=4</guid>
		<description><![CDATA[Spent the weekend getting a new version of my portfolio site up and running. Much props goes to Alex Pines for doing the design for me! In the next few days I will be adding a bunch of more features as well as getting back to posting on this thing. In the meantime, please check [...]]]></description>
			<content:encoded><![CDATA[<p>Spent the weekend getting a new version of my portfolio site up and running. Much props goes to <a title="Alex Pines" href="http://www.alexpines.com/" target="_blank">Alex Pines</a> for doing the design for me! In the next few days I will be adding a bunch of more features as well as getting back to posting on this thing.</p>
<p>In the meantime, please check out my updated <a title="portfolio" href="http://www.krisrange.com/portfolio/" target="_self">portfolio</a> section!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2009/09/new-site-launch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
