<?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>Notes (beta)</title>
	<atom:link href="http://notes.ericjiang.com/feed" rel="self" type="application/rss+xml" />
	<link>http://notes.ericjiang.com</link>
	<description>Eric Jiang</description>
	<lastBuildDate>Sun, 09 Jun 2013 03:42:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Batch organize photos by date</title>
		<link>http://notes.ericjiang.com/posts/656</link>
		<comments>http://notes.ericjiang.com/posts/656#comments</comments>
		<pubDate>Sun, 09 Jun 2013 03:41:47 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://notes.ericjiang.com/?p=656</guid>
		<description><![CDATA[I wanted to get a pile of jpegs organized by the year, and then the day. For example, IMG00001.JPG would go in 2013/06-04 based on its EXIF creation date. The handy exiftool can do this, via its own virtual &#8220;Directory&#8221; tag. The &#8220;Directory&#8221; tag is not an actual EXIF tag, but exiftool will move the [...]]]></description>
				<content:encoded><![CDATA[<p>I wanted to get a pile of jpegs organized by the year, and then the day. For example, IMG00001.JPG would go in 2013/06-04 based on its EXIF creation date. The handy <strong>exiftool</strong> can do this, via its own virtual &#8220;Directory&#8221; tag. The &#8220;Directory&#8221; tag is not an actual EXIF tag, but exiftool will move the photo if you write to it.</p>
<p>Here&#8217;s two snippets, one to <strong>copy</strong> photos to a new directory based on the date (<code>-o dummy/</code> forces a copy):</p>
<p><code>exiftool -o dummy/ -d %Y/%m-%d "-directory&lt;datetimeoriginal" /path/to/unorganized/photos/*.JPG</code></p>
<p>And one to <strong>move</strong> photos to a new directory based on the date:</p>
<p><code>exiftool -d %Y/%m-%d "-directory&lt;datetimeoriginal" /path/to/unorganized/photos/*.JPG</code></p>
<p>This will automatically create directories called <code>$PWD/year/day</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.ericjiang.com/posts/656/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using bcrypt in CakePHP 2.3</title>
		<link>http://notes.ericjiang.com/posts/642</link>
		<comments>http://notes.ericjiang.com/posts/642#comments</comments>
		<pubDate>Sun, 23 Dec 2012 22:54:41 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://notes.ericjiang.com/?p=642</guid>
		<description><![CDATA[CakePHP 2.3 adds native support for the bcrypt hashing algorithm, which is often recommended because of the amount of analysis that&#8217;s gone into it and its configurable cost function. Using it isn&#8217;t obvious, however. The 2.3 migration notes merely say, You can now use Blowfish in your $authenticate array to allow bcrypt passwords to be [...]]]></description>
				<content:encoded><![CDATA[<p>CakePHP 2.3 adds native support for the <a href="http://en.wikipedia.org/wiki/Bcrypt">bcrypt</a> hashing algorithm, which is often recommended because of the amount of analysis that&#8217;s gone into it and its configurable cost function.</p>
<p>Using it isn&#8217;t obvious, however. The 2.3 migration notes merely say, <q>You can now use Blowfish in your $authenticate array to allow bcrypt passwords to be used.</q></p>
<p>Due to limitations in how Auth works, a new authentication type was added in addition to a new hash type. So to use bcrypt, your $authenticate variable should look like this:</p>
<pre class="brush: php; title: ; notranslate">
$this-&gt;Auth-&gt;authenticate = array(
            AuthComponent::ALL =&gt; array(
                'scope' =&gt; array('User.active' =&gt; 0)
            ),
            'Blowfish',
        );
</pre>
<p>That only affects checking the password. To hash passwords using bcrypt, you also need to modify your model because <code>Auth::password</code> won&#8217;t work.</p>
<pre class="brush: php; title: ; notranslate">
    public function beforeSave($options = array()) {
        if (isset($this-&gt;data[$this-&gt;alias]['password'])) {
            $this-&gt;data[$this-&gt;alias]['password'] =
                Security::hash($this-&gt;data[$this-&gt;alias]['password'], &quot;blowfish&quot;);
        }
        return true;
    }
</pre>
<p>Note that you can configure the cost by using <code>Security::setCost</code> (the default is 10).</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.ericjiang.com/posts/642/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Googling for bugs: hundreds of date-formatting mistakes</title>
		<link>http://notes.ericjiang.com/posts/637</link>
		<comments>http://notes.ericjiang.com/posts/637#comments</comments>
		<pubDate>Sun, 16 Dec 2012 18:26:59 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Internets]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://notes.ericjiang.com/?p=637</guid>
		<description><![CDATA[Here&#8217;s something really easy to screw up: Spot the mistake? The &#8220;m&#8221; format code can only mean one thing, which is &#8220;months&#8221;, not &#8220;minutes&#8221;. Yet, when you&#8217;re writing code in a hurry, it&#8217;s so easy to quickly write this code and assume it works. After all, it raises no errors or warnings, and always generates [...]]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s something really easy to screw up:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
echo date(&quot;Y-m-d H:m:s&quot;);
?&gt;
</pre>
<p>Spot the mistake? The &#8220;m&#8221; format code can only mean one thing, which is &#8220;<u>m</u>onths&#8221;, not &#8220;<u>m</u>inutes&#8221;. Yet, when you&#8217;re writing code in a hurry, it&#8217;s so easy to quickly write this code and assume it works. After all, it raises no errors or warnings, and always generates valid datetime strings. It&#8217;s just wrong.</p>
<p>Googling for <a href="https://www.google.com/search?q=site%3Agithub.com+%22Y-m-d+H%3Am%3As%22+php">&#8216;site:github.com &#8220;Y-m-d H:m:s&#8221; php&#8217;</a> returns hundreds of examples of mistakes. I tried to fix a <a href="https://github.com/OpenWebGlobe/GlobeGame/pull/1">couple</a> <a href="https://github.com/aardalo/ArduinoEnergyMeter/pull/3">instances</a> but realized that there&#8217;s so much abandoned code on Github that it would&#8217;ve been useless.</p>
<p>This is a prime example of something that static analysis could warn about: just look for &#8220;H:m:s&#8221; or &#8220;h:m:s&#8221; in the first argument to <code>date</code>. This mistake isn&#8217;t limited to PHP, of course, as <a href="http://stackoverflow.com/questions/4772425/format-date-in-java">this Java example</a> shows.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.ericjiang.com/posts/637/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We don&#8217;t remember your startup</title>
		<link>http://notes.ericjiang.com/posts/627</link>
		<comments>http://notes.ericjiang.com/posts/627#comments</comments>
		<pubDate>Wed, 17 Oct 2012 20:23:57 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://notes.ericjiang.com/?p=627</guid>
		<description><![CDATA[Yeah, your startup. You know, the one that had the nifty HTML5 responsive launch page? The one that promised big things and nifty features? The one where we typed in our email address so we could be notified when it launched? You spent the last five months working your butt off to productionize and bugfix [...]]]></description>
				<content:encoded><![CDATA[<p>Yeah, your startup. You know, the one that had the nifty HTML5 responsive launch page? The one that promised big things and nifty features? The one where we typed in our email address so we could be notified when it launched? You spent the last five months working your butt off to productionize and bugfix your startup, and when the time came, you crafted together a short but sweet email asking us to try out the beta.</p>
<p>Thing is, you forgot to remind us what your startup does. So I get this email from some website with a sufficiently hip name asking me to check them out right this instant. I don&#8217;t recall ever seeing them before, so it must be spam, and the few seconds I have before my train arrives, I trash it and move on to the next piece of mail.</p>
<div id="attachment_628" class="wp-caption center" style="width: 310px"><a href="http://notes.ericjiang.com/wp-content/uploads/2012/10/divshotpromo.png"><img src="http://notes.ericjiang.com/wp-content/uploads/2012/10/divshotpromo-300x293.png" alt="" title="Divshot announcement email" width="300" height="293" class="size-medium wp-image-628" /></a><p class="wp-caption-text">What is a divshot and why should I care about it?</p></div>
<p>After working on your startup for the last year and spending every waking moment thinking and talking about it, it&#8217;s easy to assume people know about what you&#8217;re doing.</p>
<p>But for the rest of us, it wouldn&#8217;t be too much work to include your one-line pitch, would it?</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.ericjiang.com/posts/627/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Have you ever been computer illiterate?</title>
		<link>http://notes.ericjiang.com/posts/604</link>
		<comments>http://notes.ericjiang.com/posts/604#comments</comments>
		<pubDate>Fri, 31 Aug 2012 18:50:51 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Internets]]></category>

		<guid isPermaLink="false">http://notes.ericjiang.com/?p=604</guid>
		<description><![CDATA[If you&#8217;re like most hackers, you&#8217;ve spent so much time on the computer that the jargon and lingo have become natural. You instinctively know where the OK and Cancel buttons are, and get upset when they&#8217;re switched around for no apparent reason. You scan dialog boxes and make the right decision in a second, because [...]]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re like most hackers, you&#8217;ve spent so much time on the computer that the jargon and lingo have become natural. You instinctively know where the OK and Cancel buttons are, and get upset when they&#8217;re switched around for no apparent reason. You scan dialog boxes and make the right decision in a second, because who hasn&#8217;t seen <em>&#8220;Do you want to set Firefox as your default browser?&#8221;</em> a million times?</p>
<p>We are perplexed when users click through confirmation windows without a second thought. We sigh when someone doesn&#8217;t know where to find their terminal emulator. We become frustrated when people complain about poor performance but can&#8217;t even tell us whether they&#8217;ve maxed out their RAM and have swapping.</p>
<p>Look at these words! We&#8217;ve churned out so many abbreviations and neologisms that other developers can&#8217;t even understand us! But what about our users? What if they&#8217;re not computer professionals with 10+ years of Internet experience? What if they don&#8217;t know what we&#8217;re talking about? Or what if they&#8217;re using your product in something other than their native language? <strong>Why aren&#8217;t our users like us?</strong></p>
<p>Try this. Switch your software into a language that you don&#8217;t know very well. If you took Spanish throughout high school or a couple years&#8217; German in college, switch your computer to that. It&#8217;s very easy to do in OS X and iOS, and almost as easy on Ubuntu. Google products can be switched by adding the &#8220;hl&#8221; param to most Google URLs. For example, &#8220;hl=ja&#8221; switches the page to Japanese.</p>
<div id="attachment_621" class="wp-caption aligncenter" style="width: 438px"><a href="http://notes.ericjiang.com/wp-content/uploads/2012/08/changegengo.png"><img class="size-full wp-image-621" title="Setting language preferences in Mac OS X" src="http://notes.ericjiang.com/wp-content/uploads/2012/08/changegengo.png" alt="" width="428" height="251" /></a><p class="wp-caption-text">Just drag&#8217;n'drop another language to the top.</p></div>
<p>It&#8217;s a completely different experience.</p>
<p>Don&#8217;t just switch back after a day. Force yourself to <em>use</em> your computer in another language. After all, there are millions of people who simply <em>can&#8217;t</em> switch their computer to their native language. Use your now-alien computer, and you&#8217;ll find your habits changing.</p>
<p>Your eyes don&#8217;t immediately zero in on the correct list item any more. You avoid using the menu bar until you know you have to, and when you do, you&#8217;re still guided by a spatial-positional &#8220;feel&#8221; of where things are. And if it&#8217;s a rare need, like changing your accessibility settings, you sit there and slowly read each menu item until one of them vaguely sounds like what you&#8217;re looking for.</p>
<p>And it&#8217;s not just an issue of knowing words. You might <em>know</em> the words, for some superficial meaning of the word &#8220;know&#8221;, but when ordinary words are applied to computers, it often takes mental processing to understand their new meaning.</p>
<p>When you click &#8220;Cancel&#8221; in a dialog box, what are you cancelling? Is it cancelling in the same sense that you would cancel a reservation or a plane ticket? (We are all guilty of genericizing &#8220;OK&#8221; and &#8220;Cancel&#8221; as the default dialog-box buttons.) When I see &#8220;Ventana&#8221;, I think of a big hole in my wall filled with a glass panel. I can&#8217;t help it—that&#8217;s the meaning I learned—and it takes a second or so to recognize that that&#8217;s where I should go to find a list of my terminal instances. And when I first saw &#8220;終端&#8221;, which could be defined as &#8220;end extremity&#8221;, it was only by recognizing its icon that I knew it meant &#8220;terminal&#8221;.</p>
<p>Why would expect people to know that &#8220;terminal&#8221; means that little window with monospace text and funny symbols? We don&#8217;t even think to ourselves that historic terminals were the <em>endpoints</em> for mainframe communications.</p>
<p>So notice how your usage changes in an unfamiliar environment. You&#8217;re afraid of clicking words you don&#8217;t understand, because it might be even harder to undo your changes (e.g. setting your keyboard to &#8220;드보락&#8221;). When you don&#8217;t know how to get the functionality you need, you&#8217;d rather work around the problem or Google for the answer, because you can&#8217;t skim long drop-down menus very quickly. And textual documentation is useless, because the time and energy it takes to decipher the documentation is more than you&#8217;re willing to spend on your problem anyways.</p>
<p>Suddenly, customizing your computer becomes a chore, made worse by the nagging uncertainty of being able to remember how to reset those options. You notice subtle differences in localization between vendors as well—why is it that you some times 复制 and other times 拷贝 to send the selection to your system clipboard? You tend to stick to applications you&#8217;re familiar with, because you&#8217;d much rather get things done than spend so much time figuring out a new interface. You can feel your textual comprehension speed drop by a factor compared to what you&#8217;re used to.</p>
<p>And when you&#8217;re not sure, you rely on visual cues to confirm your guesses. The System Preferences icon to change your language back might be &#8220;言語とテキスト&#8221;, but it looks especially promising because it has a wavy UN flag as its icon. (A globe or a couple characters from different character systems would be great too.) The default options in dialog boxes, along with their positions, become important too, because you don&#8217;t feel like reading the actual message, and you&#8217;re likely to pick the rightmost or highlighted option anyways.</p>
<p>You like things with fewer options, because it takes less time to read them all, and it means fewer chances to mess something weird up. Visual layouts help with understanding things, because you can draw analogies to what you know. And it&#8217;s not always obvious which things are action widgets that you can click on, especially if they&#8217;re not styled like a button (I&#8217;m looking at you, Android).</p>
<p>So go ahead, change your system language and use it for a month. You might be surprised at what you&#8217;ve taken for granted.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.ericjiang.com/posts/604/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP&#8217;s wonderful pseudo-functions</title>
		<link>http://notes.ericjiang.com/posts/599</link>
		<comments>http://notes.ericjiang.com/posts/599#comments</comments>
		<pubDate>Thu, 23 Aug 2012 00:58:37 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://notes.ericjiang.com/?p=599</guid>
		<description><![CDATA[There is a pseudo-function in PHP called empty, that tells you whether a variable is &#8220;empty&#8221; for someone&#8217;s definition of empty. The empty string, zero, null, and undefined variables are all considered to be empty. Well, how did they make it work for undefined variables? They made empty a language construct, not a function, so [...]]]></description>
				<content:encoded><![CDATA[<p>There is a pseudo-function in PHP called <code>empty</code>, that tells you whether a variable is &#8220;empty&#8221; for someone&#8217;s definition of empty. The empty string, zero, null, and undefined variables are all considered to be empty.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$x = null;
echo empty($x); // prints &quot;1&quot;
echo empty($nothere); // prints &quot;1&quot;
</pre>
<p>Well, how did they make it work for undefined variables? They made <code>empty</code> a language construct, not a function, so that its argument isn&#8217;t evaluated before the empty check happens. This leads to some great errors:</p>
<pre class="brush: php; title: ; notranslate">
$x = 0;
echo empty($x); // prints &quot;1&quot;
echo empty(0); // PHP Parse error:  syntax error, unexpected T_LNUMBER in php shell code on line 1
</pre>
<p>Or better yet,</p>
<pre class="brush: php; title: ; notranslate">
function y() { return 0; }
echo y(); // prints &quot;0&quot;
echo empty(y()); // PHP Fatal error:  Can't use function return value in write context in php shell code on line 1
</pre>
<p>PLT is basically magick.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.ericjiang.com/posts/599/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing Minecraft on Ubuntu with OpenJDK</title>
		<link>http://notes.ericjiang.com/posts/583</link>
		<comments>http://notes.ericjiang.com/posts/583#comments</comments>
		<pubDate>Mon, 16 Apr 2012 17:58:44 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://notes.ericjiang.com/?p=583</guid>
		<description><![CDATA[Minecraft! On Ubuntu! It actually runs great, once you actually get it to run, but there were two little things mere mortals can&#8217;t be reasonably expected to debug. Can&#8217;t connect to minecraft.net My Internet connection worked, minecraft.net was up, friends were able to connect just fine, but I couldn&#8217;t. Running it from the terminal via [...]]]></description>
				<content:encoded><![CDATA[<p>Minecraft! On Ubuntu!  It actually runs great, once you actually get it to run, but there were two little things mere mortals can&#8217;t be reasonably expected to debug.</p>
<h3>Can&#8217;t connect to minecraft.net</h3>
<p>My Internet connection worked, minecraft.net was up, friends were able to connect just fine, but I couldn&#8217;t. Running it from the terminal via <code>java -jar minecraft.jar</code> showed the error message <code>java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty</code>.</p>
<p>Basically, Minecraft uses SSL to protect your login, but Java didn&#8217;t have the certificates needed to verify. The Minecraft launcher really should give a better error message, but this was really Ubuntu&#8217;s fault. You need the ca-certificates-java package installed, but on my Ubuntu install, it was broken. Try doing <code>ls /etc/ssl/certs/java/cacerts</code>. If it comes up missing, then you need copy it from a friend or a different Unix machine. You don&#8217;t want to copy security files from strangers…</p>
<h3>Black screen</h3>
<p>Looking in the terminal showed the error <code>java.lang.UnsatisfiedLinkError: ...: libjawt.so: cannot open shared object file: No such file or directory</code>. There&#8217;s no good reason why an OpenJDK install can&#8217;t find its own damn libraries, but you can manually set your LD_LIBRARY_PATH variable to contain it.</p>
<p>Try doing <code>locate libjawt.so</code>. You&#8217;ll want to set your LD_LIBRARY_PATH to include one of the directories it gives you (just the directory, not included the file). Depending on whether you have OpenJDK 6 or 7, you&#8217;ll do something like:</p>
<p><code>LD_LIBRARY_PATH=/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/ java -jar minecraft.jar</code></p>
<p>Again, check the results of locate versus your OpenJDK version (if you&#8217;re not sure, run <code>java -version</code>).</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.ericjiang.com/posts/583/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Getting the Sparkfun EL Escudo to work</title>
		<link>http://notes.ericjiang.com/posts/570</link>
		<comments>http://notes.ericjiang.com/posts/570#comments</comments>
		<pubDate>Sun, 15 Apr 2012 04:54:33 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Embedded Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://notes.ericjiang.com/?p=570</guid>
		<description><![CDATA[I&#8217;m really disappointed in Sparkfun. I recently purchased the EL Escudo shield for driving EL wire with a microcontroller, and woe be upon anybody who doesn&#8217;t do hours and hours of Internet research before plugging the thing in. There were 3 years of questions from poor customers with only a few answers, and the few [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m really disappointed in Sparkfun. I recently purchased the EL Escudo shield for driving EL wire with a microcontroller, and woe be upon anybody who doesn&#8217;t do hours and hours of Internet research before plugging the thing in. There were 3 years of questions from poor customers with only a few answers, and the few answers that were there were often contradictory. Here are my conclusions from my Internet research, and the amazing Will Byrd helped me finally get it to work. Long story short, Sparkfun sets you up to fail and hasn&#8217;t fixed things in 3 years.</p>
<p><a href="http://notes.ericjiang.com/wp-content/uploads/2012/04/elescudo_inverter_sm.jpg"><img src="http://notes.ericjiang.com/wp-content/uploads/2012/04/elescudo_inverter_sm.jpg" alt="" title="3V inverter connected to an EL Escudo on an Arduino Mega" width="540" height="304" class="alignleft size-full wp-image-579" /></a><br />
<span id="more-570"></span></p>
<h2>Buy everything you need</h2>
<p>You&#8217;ll want stackable headers for Arduino: two 8-pin headers and one 6-pin header. You also need an inverter to provide high-voltage AC current. I ordered the 3v inverter that Sparkfun sells (COM-10201).<br />
<a href="http://notes.ericjiang.com/wp-content/uploads/2012/04/inverter.jpg"><img src="http://notes.ericjiang.com/wp-content/uploads/2012/04/inverter.jpg" alt="" title="3V inverter" width="540" height="261" class="alignleft size-full wp-image-575" /></a></p>
<h2>Don&#8217;t fry your inverter</h2>
<p>Vin on the EL Escudo feeds straight into your inverter. If you got a 3v Inverter, and power it from your Arduino&#8217;s 9v barrel jack, you&#8217;ll fry your inverter. Do what I did, and clip the Vin pin and instead wire a jumper between +3.3V and Vin.</p>
<p><a href="http://notes.ericjiang.com/wp-content/uploads/2012/04/elescudo_pins_sm1.jpg"><img src="http://notes.ericjiang.com/wp-content/uploads/2012/04/elescudo_pins_sm1.jpg" alt="" title="The Vin pin clipped from the EL Escudo" width="540" height="173" class="alignleft size-full wp-image-577" /></a></p>
<h2>Fix the provided code</h2>
<p>If you&#8217;re using Arduino, the provided code is not only too old for Arduino 1.0 to open, but it&#8217;s wrong. The original author uses <code>digitalWrite(channel, LOW)</code> to turn on a wire, which not only doesn&#8217;t make sense, but doesn&#8217;t work (at least for me). I think HIGH and LOW might depend on how you&#8217;ve grounded your inverter output.</p>
<p>Luckily for us, somebody has embraced the Github way and updated the code for Arduino 1.0: <a href="https://github.com/pkrakow/EL-Escudo">https://github.com/pkrakow/EL-Escudo</a>. Using that code, the provided blink program works, although I am still having trouble getting <code>all_on()</code> and <code>all_off()</code> to work.</p>
<h2>Ground your inverter&#8217;s output if needed</h2>
<p>If you&#8217;re using an inverter that has its own power, you might need to wire a lead from HVGND (the right Inverter Output pin) to GND. This is hearsay from the EL Escudo page, but you can simply check with a multimeter whether you need to do this or not.</p>
<p><a href="http://notes.ericjiang.com/wp-content/uploads/2012/04/elescudo_3v_sm.jpg"><img src="http://notes.ericjiang.com/wp-content/uploads/2012/04/elescudo_3v_sm.jpg" alt="" title="EL Escudo with manually grounded inverter" width="540" height="367" class="alignleft size-full wp-image-578" /></a></p>
<h2>Check that your inverter&#8217;s output pins are correct.</h2>
<p>The two black wires in mine were swapped. Plugging in a strand of EL wire directly into my inverter would work, but I was getting something like 5V or 15V on EL wire jacks A through H instead of the 180V I should have been getting. Somebody else figured this out for the EL sequencer, but it wasn&#8217;t anywhere on the EL Escudo page.</p>
<p>Pull out the two black wires from the jack of your inverter and swap them if you&#8217;re getting the symptoms above.</p>
<p>Hopefully this helps somebody out there. If you still can&#8217;t get it to work, my advice would be to get a degree in Electrical Engineering.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.ericjiang.com/posts/570/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu works great with the MSP430 Launchpad</title>
		<link>http://notes.ericjiang.com/posts/562</link>
		<comments>http://notes.ericjiang.com/posts/562#comments</comments>
		<pubDate>Tue, 10 Apr 2012 15:59:54 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Embedded Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://notes.ericjiang.com/?p=562</guid>
		<description><![CDATA[I got my MSP430 TI Launchpad more than a year ago simply because of the price. It was (and still is) $4.30 (with free shipping!) for a development board, two MSP430 microcontrollers, external crystal, and USB cable. Unfortunately, Windows was the only supported OS at launch time with a couple proprietary bundled IDEs. It still [...]]]></description>
				<content:encoded><![CDATA[<p>I got my <a href="https://estore.ti.com/MSP-EXP430G2-MSP430-LaunchPad-Value-Line-Development-kit-P2031.aspx">MSP430 TI Launchpad</a> more than a year ago simply because of the price. It was (and still is) $4.30 (with free shipping!) for a development board, two MSP430 microcontrollers, external crystal, and USB cable. Unfortunately, Windows was the only supported OS at launch time with a couple proprietary bundled IDEs. It still is the only officially supported OS, but setting up Ubuntu 11.10 and newer for the msp430 has become trivial:</p>
<p><code>sudo apt-get install gcc-msp430 gdb-msp430 mspdebug</code></p>
<p>To test your Launchpad, try compiling &#8220;blink&#8221; from <a href="https://github.com/mrothe/ti-launchpad">https://github.com/mrothe/ti-launchpad</a>.</p>
<p>The build process goes something like:</p>
<p><code>msp430-gcc -Os -mmcu=msp430x2012 -o main.elf main.c<br />
msp430-objcopy -O ihex main.elf main.hex # generate hex file<br />
mspdebug rf2500 "prog main.hex" # download to the launchpad</code></p>
<p>Do mind your O, o, and 0.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.ericjiang.com/posts/562/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why are you bankrupting yourself for college?</title>
		<link>http://notes.ericjiang.com/posts/537</link>
		<comments>http://notes.ericjiang.com/posts/537#comments</comments>
		<pubDate>Thu, 15 Mar 2012 02:51:48 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Education]]></category>

		<guid isPermaLink="false">http://notes.ericjiang.com/?p=537</guid>
		<description><![CDATA[What do universities want? The same as what everybody else wants, really. Power. Fame. Money. Well, the money&#8217;s actually a means to the first two, because you obviously don&#8217;t become powerful and famous (sorry, &#8220;prestigious&#8221;) without money. How do universities rise up? They hire and sponsor press-worthy research and researchers, and save up money to [...]]]></description>
				<content:encoded><![CDATA[<p>What do universities want? The same as what everybody else wants, really. Power. Fame. Money. Well, the money&#8217;s actually a means to the first two, because you obviously don&#8217;t become powerful and famous (sorry, &#8220;prestigious&#8221;) without money.</p>
<p>How do universities rise up? They hire and sponsor press-worthy research and researchers, and save up money to build shiny new buildings every so often. That takes a lot of cash, so they have to keep the dough rolling in.</p>
<p>Universities generally rely on four or five sources of funding:<span id="more-537"></span></p>
<ul>
<li>endowment investments—if the stock market and economy do poorly, this drops</li>
<li>public funding—this is subject to politics (haha, we&#8217;re screwed) and the state budget, and applies to public universities</li>
<li>private giving—students are paid to call alumni and beg for money. In a bad year, this could drop as well.</li>
<li>research grants—research funding is hugely taxpayer sponsored, but private corporations also invest in university research.</li>
<li>tuition—sorry undergrads</li>
</ul>
<p>Guess which one of those the school has the most control over?<br />
So schools crank up tuition to <a href="http://www.finaid.org/calculators/tuitionanalysis.pdf">make up for shortages</a> in their other income sources.</p>
<p>Public schools can&#8217;t always extort their in-state students (University of California aside) so they&#8217;ve looked overseas. There are plenty of wealthy families in China, Korea, India, and elsewhere that don&#8217;t mind paying some cash for their kid to get an American diploma. Besides, the schools in their native country are often awful or hard to get into. Have you been seeing a lot more international students around campus?</p>
<p>&#8220;But wait,&#8221; you say, &#8220;I learned in econ that the free market keeps prices under control!&#8221;</p>
<p>Haha, except the undergrad diploma market is so ****ed up that it&#8217;s not much of a free market anymore. With every employer expecting a 4-year college degree and the college-education Kool-aid we&#8217;ve all drunk, universities have realized that they can just keep raising prices. Parents don&#8217;t want to tell their only-average kids that they can&#8217;t go to NYU because it&#8217;s very (very) expensive, even though they were ecstatic about getting in. Kids don&#8217;t have a clue about money anyways (nor about college, for that matter). And the best part is, the government has made sure you can borrow as much money as you need to attend. It&#8217;s almost as if the banks make <em>more</em> money if you take out <em>more</em> loans.</p>
<p>It&#8217;s criminal. The supply of Cool Universities is constrained and demand for Cool Universities is higher than ever, while the money issue is &#8220;solved&#8221; by student loans. &#8220;Johnny is going to <em>Cool University</em>&#8220;, the parent says before Johnny will be forever haunted by debt collectors about a debt he didn&#8217;t understand when he signed up and that he can&#8217;t pay back because his Literature and French double-major isn&#8217;t helping him a whole lot in the job hunt. The only other ways out of student debt are death and debilitating injury. (Actually, marrying rich doesn&#8217;t sound like a bad idea either.)</p>
<p>And let&#8217;s get that bullshit that expensive schools feed you out of the way.</p>
<p>When you took a tour of Cool University, what did they show you? Student traditions, the interesting architecture of the new CyberBioTech School, and the fancy new computer labs/lounges/beanbag chairs&#8230; why were we going to college again?</p>
<p>Oh, right. You&#8217;re going for the world-class faculty and education. Let me tell you something. Schools like to keep around celebrity professors for that &#8220;fame&#8221; thing we discussed earlier. Half of those Nobel laureates probably have already retired after a long career of teaching undergrads. Oh wait, I mixed up the Nobel Prize with the Not-A-Prize for teaching excellence. The Nobel Prize is for research, and at any school that has &#8220;research&#8221; somewhere on its Wikipedia page, research is the main priority. Or rather, it&#8217;s a means to fame, like when your Facebook friends all reshare some HuffPo blarticle about the new Nano AI Laser Quadcopter Cancer Cure from the research labs of Cool University.</p>
<p>So you&#8217;ll probably never have a class with that Nobel laureate. They&#8217;ll probably never even acknowledge your existence, much less discuss the effects of colonialism in Africa with you. And even if you do get a class with Professor Cool, you&#8217;ll probably find out that fame is not at all correlated with the ability to teach. Prof Cool has grad students to manage and grants to write, and that doesn&#8217;t leave a lot of time for preparing lesson plans or practicing public speaking for the N classes he or she is teaching that semester (N ≤ 1). Just let the grad student teach, nevermind the poor English.</p>
<p>Is there a difference between the rigor and depth of curricula between different schools? Absolutely. Is one school&#8217;s EE program $200,000 better or even $70,000 better than another&#8217;s? That&#8217;s much harder to decide. (Oooh, I know! Do <em>both</em> programs and let us know!) But if you were worried about finding a job with an Uncool degree, consider the idea that what you do outside of the classroom matters a lot more than what you do inside the classroom. Ironic, isn&#8217;t it, that the greatest parts of college usually aren&#8217;t the classes you take.</p>
<p>Lead a philanthropic organization! Do research! Start a company!</p>
<p>Wait a sec, aren&#8217;t the people who did those things in high school the ones that got into Harvard, Yale, Princeton, Stanford, and MIT? Could ambition and motivation be the actual keys to success? Could it be that the admissions officers were only looking for duckies who were already going to be successful? Could colleges rank highly simply because top students go there because the college ranks highly? Could I get a Conspiracy Keanu up in here?</p>
<p>College is 70% what you put into it, and I&#8217;m not talking about money. A big school, no matter where it is, will have more than enough to keep you entertained for four years, after which, you&#8217;ll be sick of your school anyways and will want to get a job or go to grad school somewhere else.</p>
<p>Some people have colored this as a public/private issue, but it&#8217;s really about making sane decisions with your money. Public schools usually are cheaper, but if you get a good deal to Harvard/Yale/Princeton/Stanford, then why not? Ultimately, it&#8217;s <em>your</em> desires and <em>your</em> finances, but the idea that high schoolers with barely a clue about the real world or even about college are making a hundred-thousand dollar decision is frightening.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.ericjiang.com/posts/537/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
