<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>Sensitive Circuit</title><generator>Tumblr (3.0; @mekaj)</generator><link>http://blog.sensitivecircuit.com/</link><item><title>"There are a lot of Egyptians whose freedom now depends upon on their ability to communicate with one..."</title><description>“There are a lot of Egyptians whose freedom now depends upon on their ability to communicate with one another through a database owned for profit by a guy in California who obeys orders from governments who send orders to disclose to Facebook.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Eben Moglen’s “&lt;a href="http://youtu.be/-BSLBvwyUEs"&gt;Why Political Liberty Depends on Software Freedom More Than Ever&lt;/a&gt;”&lt;/em&gt;</description><link>http://blog.sensitivecircuit.com/post/16447958654</link><guid>http://blog.sensitivecircuit.com/post/16447958654</guid><pubDate>Tue, 24 Jan 2012 22:52:07 -0500</pubDate></item><item><title>"Computing pioneer Edsger Dijkstra pointed out that computing is the only profession in which a..."</title><description>“Computing pioneer Edsger Dijkstra pointed out that computing is the only profession in which a single mind is obliged to span the distance from a bit to a few hundred megabytes, a ratio of 1 to 10^9…Dijkstra put is this way: “Compared to that number of semantic levels, the average mathematical theory is almost flat.  By evoking the need for deep conceptual hierarchies, the automatic computer confronts us with a radically new intellectual challenge that has no precedent in our history.””&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;strong&gt;Code Complete 2nd Edition&lt;/strong&gt; by Steve McConnell&lt;/em&gt;</description><link>http://blog.sensitivecircuit.com/post/15262136532</link><guid>http://blog.sensitivecircuit.com/post/15262136532</guid><pubDate>Tue, 03 Jan 2012 18:14:47 -0500</pubDate></item><item><title>thebeautyofequality:


Giving Trees at Occupy Wall Street
At...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_lw66eoNRSA1qmucdro1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://thebeautyofequality.tumblr.com/post/14213037628/giving-trees-at-occupy-wall-street-at-zuccotti" class="tumblr_blog"&gt;thebeautyofequality&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;div class="caption"&gt;
&lt;p&gt;Giving Trees at Occupy Wall Street&lt;/p&gt;
&lt;p&gt;At Zuccotti Park, the bare trees have been decorated with not only  lights, but offerings inspired by The Giving Tree. They’re all so filled  with love and dedication, and give me so much hope. Even if this  movement doesn’t change the system that oppresses us, it will change  lives. Friendships and alliances will form, love will be spread, ideas  will be shared, and strength will be built.&lt;/p&gt;
&lt;p&gt;I spoke to one protester at Occupy who said she no longer needs a  cell phone, at Occupy, you can connect with amazing people face to face  and she says that’s the reason she’s stayed so long.&lt;/p&gt;
&lt;p&gt;Another explained that no matter what people say about Occupy, when  you’re there, people are there for you and will help you in every way  possible.&lt;/p&gt;
&lt;p&gt;You can’t go there and not feel that. Even as the air gets colder,  there’s a certain warmth about Zuccotti Park that cannot be matched.&lt;/p&gt;
&lt;p&gt;I have a handful of pictures of some of the things people pledged to  give to the movement, I’ll post them one at a time. If I return to  Occupy, and they’re still there, I’ll be sure to take more pictures, and  leave a pledge of my own.&lt;/p&gt;
&lt;/div&gt;&lt;/blockquote&gt;

&lt;p&gt;That was quite an experience.  I’m glad we did it!&lt;/p&gt;</description><link>http://blog.sensitivecircuit.com/post/14222735528</link><guid>http://blog.sensitivecircuit.com/post/14222735528</guid><pubDate>Wed, 14 Dec 2011 13:53:26 -0500</pubDate></item><item><title>I Work For The Internet</title><description>&lt;a href="http://iworkfortheinternet.org/"&gt;I Work For The Internet&lt;/a&gt;: &lt;p&gt;&lt;a href="http://staff.tumblr.com/post/14169821416/i-work-for-the-internet" class="tumblr_blog"&gt;staff&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;We work for the Internet. And we’re guessing many of you do too. Whether it’s researching, selling, coding, supporting, designing — so many of our careers depend on the Internet.&lt;/p&gt;
&lt;p&gt;One argument that’s been made to Congress is that the &lt;a href="http://staff.tumblr.com/post/14136905560/sopa-update"&gt;Stop Online Piracy Act&lt;/a&gt; (SOPA) is needed to protect American jobs. In truth, the new liabilities this bill would impose on startups could &lt;a href="http://www.avc.com/a_vc/2011/12/freedom-to-innovate.html"&gt;stop American innovation&lt;/a&gt; in its tracks.&lt;/p&gt;
&lt;p&gt;To make this clear to Congress, we’ve built &lt;a href="http://iworkfortheinternet.org/"&gt;IWorkForTheInternet.org&lt;/a&gt; to show the world how many of our careers depend on the Internet.&lt;/p&gt;
&lt;p&gt;If you work for the Internet, please &lt;a href="http://iworkfortheinternet.org/add"&gt;add yourself&lt;/a&gt; and spread the word.&lt;/p&gt;&lt;/blockquote&gt;</description><link>http://blog.sensitivecircuit.com/post/14204082158</link><guid>http://blog.sensitivecircuit.com/post/14204082158</guid><pubDate>Wed, 14 Dec 2011 00:19:32 -0500</pubDate></item><item><title>Disable the enablers of police brutality</title><description>&lt;p&gt;Have you seen the pictures and footage of Lt. John Pike pepper spraying students peacefully protesting at UC Davis? In response a professor there wrote an &lt;a href="http://bicyclebarricade.wordpress.com/2011/11/19/open-letter-to-chancellor-linda-p-b-katehi/"&gt;open letter&lt;/a&gt; calling for Chancellor Linda P.B. Katehi&amp;#8217;s resignation.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;You are responsible for the police violence directed against students on the UC Davis quad on November 18, 2011. As I said, I am writing to hold you responsible and to demand your immediate resignation on these grounds.&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://blog.sensitivecircuit.com/post/13052746472</link><guid>http://blog.sensitivecircuit.com/post/13052746472</guid><pubDate>Sun, 20 Nov 2011 02:45:49 -0500</pubDate></item><item><title>cognitivedissonance:


In this photo from The New York Observer,...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_luu7ymHROD1qcfoo3o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://cognitivedissonance.tumblr.com/post/12955226394/in-this-photo-from-the-new-york-observer-former"&gt;cognitivedissonance&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In this photo from &lt;em&gt;The New York Observer&lt;/em&gt;, Former Philadelphia police Captain Ray Lewis, sits in zip cuffs after being arrested today in conjunction with the Occupy Wall Street protests. Another photo of Lewis protesting can be found &lt;a href="http://cognitivedissonance.tumblr.com/post/12846470830/captain-ray-lewis-ret-of"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Drew Grant of &lt;em&gt;The Observer&lt;/em&gt; &lt;a href="http://www.observer.com/2011/11/former-philadelphia-police-captain-ray-lewis-arrested-ows/"&gt;writes&lt;/a&gt;: “There is simply nothing more bizarre than looking at images of a man in police uniform arrested and handcuffed by people wearing lower-ranking NYPD garb.”&lt;/p&gt;
&lt;p&gt;Lewis’ arrest was caputured on video:&lt;/p&gt;
&lt;p&gt;&lt;iframe frameborder="0" height="315" src="http://www.youtube.com/embed/Yw5l0F-pe78" width="420"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Lewis knew his arrest was a possibility. In a rousing speech last night, Lewis criticized the NYPD and its use of force, along with New York City Mayor Mike Bloomberg. An &lt;a href="http://www.observer.com/2011/11/former-philadelphia-police-captain-ray-lewis-joins-with-occupy-wall-street-protesters-video/"&gt;excerpt&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“You should, by law, only use force to protect someone’s life or to protect them from being bodily injured. If you’re not protecting somebody’s life or protecting them from bodily injury, there’s no need to use force. And the number one thing that they always have in their favor that they seldom use is negotiation – continue to talk, and talk and talk to people. You have nothing to lose by that. This bullrush–what happened last night is totally uncalled for when they did not use negotiation long enough.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;“They complained about the park being dirty. Here they are worrying about dirty parks when people are starving to death, where people are freezing, where people are sleeping in subways and they’re concerned about a dirty park. That’s obnoxious, it’s arrogant, it’s ignorant, it’s disgusting.  &lt;/blockquote&gt;
&lt;blockquote&gt;[The NYPD], they’re trying to get me arrested and I may disappear OK? But as soon as I’m let out of jail, I’ll be right back here and they’ll have to arrest me again. All the cops are, they’re just workers for the one percent and they don’t even realize they’re being exploited.”&lt;/blockquote&gt;
&lt;p&gt;Capt. Lewis truly understands what it means to protect and serve the people, and for that sir, I thank you. &lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://blog.sensitivecircuit.com/post/12959117911</link><guid>http://blog.sensitivecircuit.com/post/12959117911</guid><pubDate>Fri, 18 Nov 2011 00:51:28 -0500</pubDate></item><item><title>Count on it</title><description>&lt;p&gt;I want to write books that teach kids how computers work at their most fundamental level.&lt;/p&gt;

&lt;p&gt;Perhaps the most fundamental concept in computing is how integers are represented and used as a code for the processor.  Before somebody can understand that they need to be familiar with the concept of numerical place value in binary.  Generally K-12 curricula don&amp;#8217;t convey enough about why binary (and hexadecimal) are so useful and fundamental to our digital world. That&amp;#8217;s why I have a plan to improve how kids are educated about numbers.&lt;/p&gt;

&lt;p&gt;Pretend you&amp;#8217;re a young child who doesn&amp;#8217;t yet understand much about numbers.  Now imagine you&amp;#8217;re sitting at a desk.  A rectangular area on the desk&amp;#8217;s surface in front of you and you see a pile of blocks outside the taped area.  You also notice some speakers and a monitor which prominently displays &lt;code&gt;0000&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_luqjxdF3Sj1qjqbpt.jpg" alt=""/&gt;&lt;/p&gt;

&lt;p&gt;You move several of the smallest blocks into the taped area.  Suddenly the monitor changes to &lt;code&gt;0004&lt;/code&gt; and you hear the speakers say &amp;#8220;&lt;em&gt;four&lt;/em&gt;&amp;#8221;.&lt;/p&gt;

&lt;p&gt;Surprised by the change you decide to move the blocks back out of the taped area.&lt;/p&gt;

&lt;p&gt;&amp;#8220;Wow, it&amp;#8217;s back to &lt;code&gt;0000&lt;/code&gt; again!  And it said &amp;#8216;&lt;em&gt;zero&lt;/em&gt;&amp;#8217;.&amp;#8221;&lt;/p&gt;

&lt;p&gt;You add the blocks you just removed.  In response the monitor goes back to &lt;code&gt;0004&lt;/code&gt; and you again hear &amp;#8220;&lt;em&gt;four&lt;/em&gt;&amp;#8221;.&lt;/p&gt;

&lt;p&gt;You repeat the process a few times and decide the monitor and speakers reflect something about the blocks inside the taped area.  But what exactly?&lt;/p&gt;

&lt;p&gt;The taped area has no blocks and &lt;code&gt;0000&lt;/code&gt; illuminates from the monitor.  Unsure what to think you decide to move small blocks into the taped area one at a time.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code&gt;0001&lt;/code&gt; (&lt;em&gt;one&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0002&lt;/code&gt; (&lt;em&gt;two&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0003&lt;/code&gt; (&lt;em&gt;three&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0004&lt;/code&gt; (&lt;em&gt;four&lt;/em&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Your memory stirs.  &amp;#8220;Oh, that&amp;#8217;s the one I saw before.&amp;#8221;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code&gt;0005&lt;/code&gt; (&lt;em&gt;five&lt;/em&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You recall your parents saying the same words as they touch each of your fingers.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code&gt;0006&lt;/code&gt; (&lt;em&gt;six&lt;/em&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&amp;#8220;That symbol changes every time I move a block.  Will it change if I take away some blocks?&amp;#8221;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code&gt;0005&lt;/code&gt; (&lt;em&gt;five&lt;/em&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&amp;#8220;Five, yeah, I just saw that one!&amp;#8221;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code&gt;0004&lt;/code&gt; (&lt;em&gt;four&lt;/em&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&amp;#8220;I remember four too.&amp;#8221;&lt;/p&gt;

&lt;p&gt;After more experimentation it would be clear that these symbols and sounds map to the real world concept of quantity.  Even better, the relationship between the three is continuously reinforced.&lt;/p&gt;

&lt;p&gt;Now suppose all the blocks are taken away and replaced with rods.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_luqkd4rjA21qjqbpt.jpg" alt=""/&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code&gt;0040&lt;/code&gt; (&lt;em&gt;forty&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0000&lt;/code&gt; (&lt;em&gt;zero&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0040&lt;/code&gt; (&lt;em&gt;forty&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0000&lt;/code&gt; (&lt;em&gt;zero&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0010&lt;/code&gt; (&lt;em&gt;ten&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0020&lt;/code&gt; (&lt;em&gt;twenty&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0030&lt;/code&gt; (&lt;em&gt;thirty&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0040&lt;/code&gt; (&lt;em&gt;forty&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0050&lt;/code&gt; (&lt;em&gt;fifty&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0060&lt;/code&gt; (&lt;em&gt;sixty&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0050&lt;/code&gt; (&lt;em&gt;fifty&lt;/em&gt;)&lt;br/&gt;&lt;code&gt;0040&lt;/code&gt; (&lt;em&gt;forty&lt;/em&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Doing the same thing with the rods results in different sounds, but the symbol changes are remarkably similar.  In fact, they&amp;#8217;re the same changes except that the position of the symbol that changes is different.&lt;/p&gt;

&lt;p&gt;You&amp;#8217;re given a rod&amp;#8217;s length of unitary blocks back.  Soon you realize that either adding all those unitary blocks or adding a single rod results in the same feedback from the monitor and speakers.  From what you can tell this is true regardless of how many rods are already in the taped area.  Eventually you conclude that a rod and &lt;em&gt;ten&lt;/em&gt; unitary blocks represent the same quantity.&lt;/p&gt;

&lt;p&gt;Place value in the base 10 numbers would become intuitive with enough experimentation.  This system is flexible enough to work with other bases, including binary.&lt;/p&gt;

&lt;p&gt;Going from that point to explaining how a 32-bit &amp;#8216;word&amp;#8217; gets processed by a CPU isn&amp;#8217;t that hard.&lt;/p&gt;</description><link>http://blog.sensitivecircuit.com/post/12872085957</link><guid>http://blog.sensitivecircuit.com/post/12872085957</guid><pubDate>Wed, 16 Nov 2011 00:50:00 -0500</pubDate><category>math</category><category>education</category><category>computer science</category><category>teaching</category><category>interactive learning</category><category>binary</category><category>numbers</category><category>decimal</category><category>hexadecimal</category><category>projects</category></item><item><title>thanks for commenting on my post!! i understand completely what you are saying - i know some people who speak acknowledging their own lack of understanding about the topic. of course this is understandable and acceptable - how can you expect a person to be 100% politically correct/aware when they know themselves they aren't? however, what bothered me about my Stats professor was his obvious ridicule towards people who believe gender-portrayal as a choice. that's what i thought was inappropriate.</title><description>&lt;p&gt;No problem!  I like reading what people have to say about these issues.&lt;/p&gt;

&lt;p&gt;Unfortunately not everyone makes an effort to reach out and learn about these issues.  To me feminism is a rational, egalitarian way of looking at the world and it disappoints me when people don’t see it that way.  Through talking to people who aren’t acquainted with feminism I’ve realized that a lot of people are “blissfully ignorant”.  Your stats professor may be so confused and ignorant that he didn’t know any better.  The blissfully ignorant might come off as jerks to some people, but they don’t necessarily mean to be.  Granted I wasn’t there to witness how ridiculous he was about it, but generally I think it’s worth trying to give people the benefit of the doubt until it’s made painfully clear that they’re intentionally being hurtful.&lt;/p&gt;

&lt;p&gt;Pretend for a minute that in your entire life you only ever knew the word “gender” to mean “sex”.  You’ve used the word this way for years and years and it’s always seemed to work and make sense.  In fact, even the printed text books you use to teach students reaffirm in your mind that “gender” means “sex”.  Now suppose somebody comes up to you during a lesson where the material printed in black and white is called into question because of it’s use of “gender” over “sex”.  They point out that the book really means “sex” because “gender” is something different.&lt;/p&gt;

&lt;p&gt;I don’t know about you, but my first thought would be, “Huh?  Clearly the editors would have gotten this right and I’ve known this word my whole life!  This person is out of their mind!”  It would seem utterly absurd!  Until somebody gently sits me down, preferably in private to avoid embarrassment, and explains that many people distinguish between “sex” and “gender”, I’d be oblivious.  Even worse, until somebody sets me straight I’d continue perpetuating the very notions that are bothering you.&lt;/p&gt;</description><link>http://blog.sensitivecircuit.com/post/10151500462</link><guid>http://blog.sensitivecircuit.com/post/10151500462</guid><pubDate>Mon, 12 Sep 2011 22:39:00 -0400</pubDate></item><item><title>Girl + Computer = ?: Gender Neutrality in Statistics Class, Please!</title><description>&lt;a href="http://girlpluscomputer.tumblr.com/post/4073553882"&gt;Girl + Computer = ?: Gender Neutrality in Statistics Class, Please!&lt;/a&gt;: &lt;p&gt;&lt;a href="http://girlpluscomputer.tumblr.com/post/4073553882" class="tumblr_blog"&gt;girlpluscomputer&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The only thing that was kindof wacky about the example was it used the term “gender” to mean “sex.”&lt;/p&gt;
&lt;p&gt;…&lt;/p&gt;
&lt;p&gt;It wasn’t a big deal, except then my professor went on a small rant about how in a previous semester a student of his had a big blow-up to him about it saying “sex is biological, gender is a choice!” He said all of it so mockingly, and even went on to say sarcastically, “I’m a dude because I chose to be.”&lt;/p&gt;
&lt;p&gt;…&lt;/p&gt;
&lt;p&gt;I found it rather inappropriate for a math professor to be speaking this way to a room full of students. I wonder if he considered the fact that he might have seriously alienated some students by his comment?&lt;/p&gt;
&lt;p&gt;…&lt;/p&gt;
&lt;p&gt;Should I even have to ask for some gender-kindness in my classrooms??
Thoughts?!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Yeah, you may need to ask for it, but hopefully it won’t be because people are knowingly being rude.  It could be that they aren’t interpreting their words the same way you are.&lt;/p&gt;

&lt;p&gt;Check out definition 2a for &lt;a href="http://www.merriam-webster.com/dictionary/gender"&gt;gender&lt;/a&gt;.  Many people (possibly even most) use “sex” and “gender” interchangeably to distinguish individuals within a species based on certain physical attributes.  Often those who are in tune with the social issues at stake prefer to use the definitions you use.&lt;/p&gt;

&lt;p&gt;When a word has multiple definitions people can often discern what definition was intended based on the context.  For instance, when I ask, “what is your sex?” and “how often do you have sex?” it’s clear which definition I’m using in both cases.  Knowing which definition of “gender” a speaker intends is particularly difficult because usually both are applicable.  For example, if a bubble sheet for a standardized test asks for your gender it’s unclear whether it means physical sex or expression of self-identification.  Whenever the definitions of “gender” the listener and speaker have in mind differ, somebody will probably feel alienated.&lt;/p&gt;

&lt;p&gt;I’ve identified as a feminist for several years, even before I took a gender studies class in college.  Despite that I have to admit it wasn’t until that class that I learned the useful distinction between “sex” and “gender”.  Prior to that there may have been times where I was unknowingly as offensive to some people as your statistics professor was to you.  Fortunately I know now how to avoid that mistake.&lt;/p&gt;

&lt;p&gt;Keep your mind open enough to realize that not everyone is speaking the same language.  When it seems like some translation is in order, step in and educate.  Empathize with those who simply don’t know.  It’s not their fault.  You might even be able to replace apparent ignorance and insensitivity with mutual understanding.  As an experiment maybe you could try speaking with this professor during his office hours.&lt;/p&gt;

&lt;p&gt;Keep writing!&lt;/p&gt;</description><link>http://blog.sensitivecircuit.com/post/10143075086</link><guid>http://blog.sensitivecircuit.com/post/10143075086</guid><pubDate>Mon, 12 Sep 2011 19:38:00 -0400</pubDate><category>engineering</category><category>gender</category><category>gender neutrality</category><category>statistics</category><category>technology</category><category>transexual</category><category>transgender</category><category>feminism</category></item><item><title>How does biology explain the low numbers of women in computer science? Hint: it doesn’t.</title><description>&lt;a href="http://geekfeminism.org/2009/10/17/how-does-biology-explain-the-low-numbers-of-women-in-somputer-science-hint-it-doesnt/"&gt;How does biology explain the low numbers of women in computer science? Hint: it doesn’t.&lt;/a&gt;: &lt;blockquote&gt;
&lt;p&gt;It comes up a lot in discussions of women in computer science, women  who write code, women in open source.  Eventually, someone brings up the  fact that women score slightly lower on math tests.  Clearly, they  claim, this biological inferiority must explain why there are fewer  women in math heavy fields.&lt;/p&gt;
&lt;p&gt;It sounds like a compelling reason, and it gets a lot of play.   Except, you know what?  It’s a lie.&lt;/p&gt;
&lt;p&gt;I’m a mathematician.  I’ve looked at those numbers, I’ve read some  papers.  The research into biologically-linked ability is fascinating,  but it simply isn’t significant enough to explain the huge gender gap we  see in the real world.  I used to do this presentation on the back of a  napkin for people who tried to spout this misconception to my face, and  I finally put it online:&lt;/p&gt;
&lt;a title="How does biology explain the low numbers of women in CS?  Hint:  it doesn't." href="http://www.slideshare.net/terriko/how-does-biology-explain-the-low-numbers-of-women-in-cs-hint-it-doesnt"&gt;How does biology explain the low numbers of women in CS?   Hint: it doesn’t.&lt;/a&gt;&lt;/blockquote&gt;</description><link>http://blog.sensitivecircuit.com/post/9986456986</link><guid>http://blog.sensitivecircuit.com/post/9986456986</guid><pubDate>Fri, 09 Sep 2011 00:59:45 -0400</pubDate><category>biology</category><category>computer science</category><category>maths</category><category>feminism</category><category>gender</category><category>patriarchy</category><category>people suck at math</category></item><item><title>UNIX' Russian Roulette</title><description>&lt;p&gt;&lt;a href="http://fooyeahcode.tumblr.com/post/9914641813" class="tumblr_blog"&gt;fooyeahcode&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;sudo [ $[ $RANDOM % 6 ] == 0 ] &amp;amp;&amp;amp; rm -rf / || echo “You live”&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;/p&gt;</description><link>http://blog.sensitivecircuit.com/post/9933021237</link><guid>http://blog.sensitivecircuit.com/post/9933021237</guid><pubDate>Wed, 07 Sep 2011 18:29:43 -0400</pubDate><category>unix</category><category>russian roulette</category><category>I'm feeling lucky</category></item><item><title>Rick Santorum, bigot or hypocrite?</title><description>&lt;a href="http://swampland.time.com/2011/09/02/rick-santorum-vs-the-apa/"&gt;Rick Santorum, bigot or hypocrite?&lt;/a&gt;: &lt;p&gt;I so wish I could have been there to point out the irony in his stance.  Here’s what I would say.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Mr. Santorum, you claim it’s unfair for people call you a bigot when you’re simply representing the views of the Catholic church. Did you realize your inability to consider that the American Psychological Association could have scientifically sound studies demonstrating something contrary to your beliefs is just as short-sighted? In other words, do you realize your argument makes you a hypocrite?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sorry, you can’t have your cake and eat it too.&lt;/p&gt;</description><link>http://blog.sensitivecircuit.com/post/9724671987</link><guid>http://blog.sensitivecircuit.com/post/9724671987</guid><pubDate>Fri, 02 Sep 2011 20:04:00 -0400</pubDate><category>rant</category><category>politics</category><category>keeping-them-honest</category></item><item><title>malism:


Kilauea volcano lava flow spitting into the air and...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_lqcew7fE9j1qi4ya7o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://malism.tumblr.com/post/9305473787"&gt;malism&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a title="Kilauea volcano lava flow spitting into the air and ocean" href="http://www.flickr.com/photos/slworking/4180579845/"&gt;Kilauea volcano lava flow spitting into the air and ocean&lt;/a&gt; by &lt;a href="http://www.flickr.com/photos/slworking/"&gt;slworking2&lt;/a&gt; on Flickr.&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://blog.sensitivecircuit.com/post/9507550653</link><guid>http://blog.sensitivecircuit.com/post/9507550653</guid><pubDate>Sun, 28 Aug 2011 13:34:30 -0400</pubDate></item><item><title>Source code repository server</title><description>&lt;p&gt;My new Mac Mini has been useful as a workstation, but sometimes I need a server dedicated  to distributing media files or storing the source code for my programming projects.  I&amp;#8217;ve set out to address latter issue first, and this post documents my progress.&lt;/p&gt;

&lt;p&gt;Here are the requirements for the source code repository server:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;Long term persistance

&lt;ul&gt;&lt;li&gt;VM still works when copied to another machine.&lt;/li&gt;
&lt;li&gt;VM is backed up at least once per week and tested, either manually or automatically.&lt;/li&gt;
&lt;li&gt;Each repository is backed up by cloning it to a physical machine at least daily.&lt;/li&gt;
&lt;li&gt;All backups are verified with some kind of automated consistency check.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Security

&lt;ul&gt;&lt;li&gt;Repositories can only be accessed from other machines (physical or virtual) via a secure channel like SSH.&lt;/li&gt;
&lt;li&gt;Repositories are stored in a specialized account managed only by the repository server administrator (me).&lt;/li&gt;
&lt;li&gt;Physical machines in my local network can request a working copy of a repository.&lt;/li&gt;
&lt;li&gt;Source control interactions with repositories are regulated by access control lists managed by the repository administrator.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Extensibility

&lt;ul&gt;&lt;li&gt;Centralized repository supports hooks for automated standardization of code formatting, preventing commits that break tests or build script, or various other quality assurance measures.&lt;/li&gt;
&lt;li&gt;Supports executing build scripts on a regular basis for specific repositories and storing dated copies of those builds.  It should be known exactly what code was used to make the build, perhaps using a hash for tracking repository state.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;h1&gt;Long term persistance&lt;/h1&gt;

&lt;p&gt;I&amp;#8217;ve often used &lt;a href="http://www.virtualbox.org/"&gt;VirtualBox&lt;/a&gt; to address any virtual machine needs, but eventually I got annoyed with configuring everything in the GUI.  VirtualBox does have an API and ways to make this easier for those who want more consistent control, but I couldn&amp;#8217;t yet justify delving that deep.&lt;/p&gt;

&lt;p&gt;Fortunately somebody else must have felt the same because there&amp;#8217;s a great utility called &lt;a href="http://vagrantup.com"&gt;Vagrant&lt;/a&gt; for creating and managing many virtual machines.  Underneath it uses VirtualBox.  For now I&amp;#8217;m using Vagrant to manage the source code repository VM on my Mac Mini.  I haven&amp;#8217;t tested whether all the long term persistance requirements will be satisfied yet.  Not too worried, though, because everything I&amp;#8217;ve read and tried with Vagrant makes this seem realistic.  Of course I&amp;#8217;ll come back to those requirements after addressing bigger concerns.&lt;/p&gt;

&lt;h1&gt;Security and Extensibility&lt;/h1&gt;

&lt;p&gt;These two requirement categories are lumped together because they both hinge on a critical decision:  What source control management tool should I use?&lt;/p&gt;

&lt;p&gt;A company called SourceGear recently made a new distributed version control system (DVCS) called &lt;a href="http://veracity-scm.com/"&gt;Veracity&lt;/a&gt;.  There&amp;#8217;s an interesting, free book by the founder of SourceGear about using various DVCSs called &lt;a href="http://www.ericsink.com/vcbe/"&gt;Version Control By Example&lt;/a&gt;, and it discusses Veracity.  I spent a fair amount of time experimenting with Veracity, and I really like where it&amp;#8217;s going.  It doesn&amp;#8217;t currently meet my security requirements yet.  I&amp;#8217;d consider adding the necessary features to Veracity, but I want to get up and running with my repository server.  Maybe someday Veracity will have those features, or I&amp;#8217;ll feel up to hacking on it.  Not yet though.&lt;/p&gt;

&lt;p&gt;Git works well for me.  I&amp;#8217;ve been using it in my personal projects for the past couple years, but have found my work isn&amp;#8217;t easily accessible from all my computers.  This isn&amp;#8217;t git&amp;#8217;s fault because it&amp;#8217;s easy to clone a repository from another machine.  What I really need is a centralized server that&amp;#8217;s up nearly all the time.  Github is good for that, but I don&amp;#8217;t necessarily want all my projects hosted publicly.  Yes, they have paid plans, but they seem far more expensive and restrictive than I&amp;#8217;d like.  Hence the need for this project.&lt;/p&gt;

&lt;p&gt;Supposing I use Git, how can I satisfy both the security and extensibility requirements?  Git supports hooks, so the SCM part of the extensibility requirements is automatically addressed.  The protocol support in Git is pretty good, and includes SSH.  I could make a new user on the repository server itself and attempt to manage the file permissions correctly for each project, but that seems a tad painful.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/sitaramc/gitolite"&gt;Gitolite&lt;/a&gt; comes to the rescue.   It uses concise access control lists to dictate who has what rights to which repositories.  Transactions occur over SSH.  Seems like just what I need.&lt;/p&gt;</description><link>http://blog.sensitivecircuit.com/post/9506410321</link><guid>http://blog.sensitivecircuit.com/post/9506410321</guid><pubDate>Sun, 28 Aug 2011 13:04:00 -0400</pubDate><category>server</category><category>vm</category><category>source code</category><category>repository</category><category>vagrant</category><category>git</category><category>ssh</category><category>gitolite</category><category>veracity</category></item><item><title>Video</title><description>&lt;iframe width="400" height="299" src="http://www.youtube.com/embed/HiaOFOMPOBc?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://blog.sensitivecircuit.com/post/7698077095</link><guid>http://blog.sensitivecircuit.com/post/7698077095</guid><pubDate>Sat, 16 Jul 2011 16:30:00 -0400</pubDate><category>epic music</category><category>bond</category><category>string instruments</category><category>dance</category></item><item><title>Improving bus schedule accessibility</title><description>&lt;a href="http://www.chrisnorstrom.com/2011/07/creation-laminated-bus-stop-schedules-my-weekend-experiment/"&gt;Improving bus schedule accessibility&lt;/a&gt;: &lt;p&gt;Can’t help but smile when people spend time and money making innovative improvements to the world around them.&lt;/p&gt;</description><link>http://blog.sensitivecircuit.com/post/7690187878</link><guid>http://blog.sensitivecircuit.com/post/7690187878</guid><pubDate>Sat, 16 Jul 2011 11:55:15 -0400</pubDate></item><item><title>Introducing Tumblr's New API</title><description>&lt;a href="http://engineering.tumblr.com/post/7541361718"&gt;Introducing Tumblr's New API&lt;/a&gt;: &lt;p&gt;&lt;a href="http://staff.tumblr.com/post/7542221895/tumblr-api-v2" class="tumblr_blog"&gt;staff&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Along with a sharp new &lt;a href="http://engineering.tumblr.com/post/7541351386/welcome-fellow-nerds"&gt;Engineering Blog&lt;/a&gt; and a beautifully organized new &lt;a href="http://www.tumblr.com/developers"&gt;Developer Center&lt;/a&gt;. Enjoy!&lt;/p&gt;&lt;/blockquote&gt;</description><link>http://blog.sensitivecircuit.com/post/7549555253</link><guid>http://blog.sensitivecircuit.com/post/7549555253</guid><pubDate>Tue, 12 Jul 2011 18:49:19 -0400</pubDate></item><item><title>A few weekends ago I went to a dance camp called Pinewoods for...</title><description>&lt;iframe width="400" height="300" src="http://www.youtube.com/embed/eYlJH81dSiw?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;A few weekends ago I went to a dance camp called &lt;a href="http://www.pinewoods.org"&gt;Pinewoods&lt;/a&gt; for the first time.  Periodically people performed casually for everyone else, usually by playing instruments, singing, or dancing.  In fact, I did a small poi performance and ended up teaching a lot of people how to do it in my downtime.&lt;/p&gt;

&lt;p&gt;One fellow got up and sang “I’m My Own Grandpa.”  It was the first time I heard the song, but I liked it a lot.  It tells a story from the perspective of a guy who simply married a woman and through a complex sequence of marriages and births he becomes his own grandfather.  Check out the video.  It draws out the relationships visually so you can at least try to follow it all.&lt;/p&gt;

&lt;p&gt;The folk song got me wondering whether anyone has ever tried demonstrating these complex relationships in &lt;a href="https://secure.wikimedia.org/wikipedia/en/wiki/Prolog"&gt;Prolog&lt;/a&gt;, a programming language for satisfying constraints in a rule-based system.  Perhaps the thought hit me because the stereotypical example for introducing people to these kinds of languages is modeling family trees and relationships between particular people.&lt;/p&gt;

&lt;p&gt;After a short while curiously searching I found this &lt;a href="http://stackoverflow.com/questions/1429887/how-can-i-implement-i-am-my-own-grandpa-in-prolog"&gt;Stackoverflow post&lt;/a&gt;.  Apparently a computer science book published in 1976 was inspired by the song and is now inspiring Prolog teachers to assign the problem for homework.  I like when some of my seemingly unrelated interests cross paths like that.&lt;/p&gt;</description><link>http://blog.sensitivecircuit.com/post/7422671061</link><guid>http://blog.sensitivecircuit.com/post/7422671061</guid><pubDate>Sat, 09 Jul 2011 13:09:35 -0400</pubDate><category>folk music</category><category>family tree</category><category>prolog</category><category>pinewoods</category><category>dance</category></item><item><title>Type-safe mathematical vectors</title><description>&lt;h1&gt;The Challenge&lt;/h1&gt;

&lt;p&gt;Program an implementation of &lt;a href="https://secure.wikimedia.org/wikipedia/en/wiki/Euclidean_vector"&gt;vectors&lt;/a&gt; for all dimensions with the following in mind.&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;Binary operations on vectors like addition don&amp;#8217;t make sense when the vectors have different dimensions.&lt;/li&gt;
&lt;li&gt;People using your implementation shouldn&amp;#8217;t have to write boilerplate code to accommodate how you choose to handle dimension mismatches.&lt;/li&gt;
&lt;li&gt;Rather than failing silently by handling input incorrectly, the implementation should alert the programmer as early as possible about their mistake.&lt;/li&gt;
&lt;/ol&gt;&lt;h2&gt;Case Study: Python&lt;/h2&gt;

&lt;p&gt;Let&amp;#8217;s give this a try in &lt;a href="http://python.org/"&gt;Python&lt;/a&gt;.  To account for the arbitrary dimension requirement, we&amp;#8217;ll have the constructor take a single parameter called &lt;code&gt;components&lt;/code&gt;.  The plan is to pass an array of numbers such as &lt;code&gt;[-3.0, 8.24, 2]&lt;/code&gt; or &lt;code&gt;[42]&lt;/code&gt;.&lt;/p&gt;

&lt;pre class="brush: python"&gt;
class Vector:
    def __init__(self, components):
        self.components = components

    def __add__(self, v):
        pairs = zip(self.components, v.components)
        return [ sum(axis_pair) for axis_pair in pairs ]
&lt;/pre&gt;

&lt;p&gt;In case you&amp;#8217;re not familiar with &lt;code&gt;zip&lt;/code&gt; it helps you easily match up elements from different arrays at the same index.  It&amp;#8217;s useful in situations like this where we&amp;#8217;re trying to sum vector elements component-wise.&lt;/p&gt;

&lt;pre class="brush: python"&gt;
&amp;gt;&amp;gt;&amp;gt; zip([1, 2, 3], [4, 5, 6])
[(1, 4), (2, 5), (3, 6)]
&lt;/pre&gt;

&lt;p&gt;Let&amp;#8217;s tinker with this implementation a bit.&lt;/p&gt;

&lt;pre class="brush: python"&gt;
&amp;gt;&amp;gt;&amp;gt; a = Vector([-3.0, 8.24, 2])
&amp;gt;&amp;gt;&amp;gt; b = Vector([10, 9, 8])
&amp;gt;&amp;gt;&amp;gt; a + b
[7.0, 17.240000000000002, 10]
&lt;/pre&gt;

&lt;p&gt;Not bad.  What about this?&lt;/p&gt;

&lt;pre class="brush: python"&gt;
&amp;gt;&amp;gt;&amp;gt; c = Vector([3.14159])
&amp;gt;&amp;gt;&amp;gt; a + c
[0.14158999999999988]
&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;Gasp!&lt;/em&gt;  The implementation accepts adding vectors from different dimensions.  That&amp;#8217;s because the &lt;code&gt;__add__&lt;/code&gt; implementation relies on &lt;code&gt;zip&lt;/code&gt;, which truncates all the input arrays to the length of the shortest one.  Guess we better validate the input to &lt;code&gt;__add__&lt;/code&gt;.&lt;/p&gt;

&lt;pre class="brush: python"&gt;
def __add__(self, v):
    if len(self.components) != len(v.components):
        raise ValueError
    pairs = zip(self.components, v.components)
    return [ sum(axis_pair) for axis_pair in pairs ]
&lt;/pre&gt;

&lt;p&gt;Now there&amp;#8217;s an error when we try adding vectors with different dimensions.&lt;/p&gt;

&lt;pre class="brush: text"&gt;
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
  File "vector.py", line 7, in __add__
    raise ValueError
&lt;/pre&gt;

&lt;p&gt;We&amp;#8217;re not getting wrong output anymore!  The downside is we&amp;#8217;ll have to depend on the programmers to check the dimensions themselves or handle the exception properly.  Aside from that, we also have to raise an error on every vector operation where there&amp;#8217;s a dimension constraint violation.  Bugs like to creep in when there are maintenance constraints like this.&lt;/p&gt;

&lt;p&gt;The core problem with the Python implementation above is all Vectors, regardless of their dimension, have the same type.  We could have tried getting around that by making distinct Vector classes for several dimensions, but we&amp;#8217;d probably end up with either too many or too few supported dimensions.  It wouldn&amp;#8217;t be fun maintaining those all those Vector implementations.  Plus, using an array in the constructor won&amp;#8217;t work unless the length of the array is validated against the dimension associated with the class.  How could we dynamically build up constructors for each dimension vector type to accept the right number of arguments?  I can imagine potential solutions in some dynamically typed languages with certain metaprogramming constructs.  Maybe I&amp;#8217;ll go into that further in a later post.  Let&amp;#8217;s move on for now.&lt;/p&gt;

&lt;h2&gt;Case Study: D&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://www.d-programming-language.org"&gt;D&lt;/a&gt; deserves a brief introduction because it&amp;#8217;s not quite as popular as Python.  It&amp;#8217;s a systems language resembling C++ and, at least syntactically, modern VM-based incarnations like Java and C#.  The preprocessing engine that executes before compilation supports constructs far more expressive than &lt;code&gt;#define&lt;/code&gt; or &lt;code&gt;#ifdef&lt;/code&gt;.  As a result it&amp;#8217;s possible to do some interesting metaprogramming without losing the benefit of compile-time static checking or relying on potentially slower runtime operations.&lt;/p&gt;

&lt;p&gt;Before we continue, here&amp;#8217;s a quick note of attribution:  Some of the following code was taken from the &lt;a href="https://github.com/gcharnock/phoboslinalgebra"&gt;phoboslinalgebra&lt;/a&gt; project.  Many thanks to Gareth Charnock for sharing his code on GitHub.  Alright, let&amp;#8217;s dig in, shall we?&lt;/p&gt;

&lt;p&gt;A &lt;a href="http://www.digitalmars.com/d/2.0/phobos/std_typetuple.html"&gt;&lt;code&gt;TypeTuple&lt;/code&gt;&lt;/a&gt; is a specific-length list where each entry corresponds to a particular type.  For example, &lt;code&gt;TypeTuple!(int, double, string)&lt;/code&gt; describes the type for lists containing three elements where the first is an &lt;code&gt;int&lt;/code&gt;, the second is a &lt;code&gt;double&lt;/code&gt;, and the third is a &lt;code&gt;string&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;An &lt;code&gt;n&lt;/code&gt;-dimensional vector is represented by nothing more than a list of &lt;code&gt;n&lt;/code&gt; values where each is an element of the vector space&amp;#8217;s &lt;a href="https://secure.wikimedia.org/wikipedia/en/wiki/Field_%28mathematics%29"&gt;field&lt;/a&gt;.  To represent an &lt;code&gt;n&lt;/code&gt;-dimensional vector in D we could really use a &lt;code&gt;TypeTuple!(T, T, ..., T)&lt;/code&gt; where &lt;code&gt;T&lt;/code&gt; is the field type and there are &lt;code&gt;n&lt;/code&gt; of those &lt;code&gt;T&lt;/code&gt;s.  How can we tell D we want the type for 3D vectors of floats, 2D vectors of ints, or 1000D vectors of mySuperSpiffyNumericType?  The answer is to recursively build a type definition for our &lt;code&gt;TypeTuple!(T, T, ..., T)&lt;/code&gt;.&lt;/p&gt;

&lt;pre class="brush: c++"&gt;
import std.typetuple;

template TypeNuple(T, size_t n) {
  static if (n == 0) {
    alias TypeTuple!() TypeNuple;
  }
  else {
    alias TypeTuple!(T, TypeNuple!(T, n-1)) TypeNuple;
  }
}
&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;TypeNuple&lt;/code&gt; template uses the &lt;a href="http://www.d-programming-language.org/version.html#staticif"&gt;static if&lt;/a&gt; to dynamically generate code during the early stages of compilation.  Notice that the implementation recursively builds up a type tuple of &lt;code&gt;T&lt;/code&gt;s until it has &lt;code&gt;n&lt;/code&gt; elements.  We&amp;#8217;re using recursion to dynamically generate the types we need at compile time!&lt;/p&gt;

&lt;p&gt;Now let&amp;#8217;s create a struct that utilizes our recursively defined list of types.&lt;/p&gt;

&lt;pre class="brush: c++"&gt;
struct Vector(Field, uint D) {
  alias TypeNuple!(Field,D) ArgList;

  Field[D] components;
  
  this(ArgList argList) {
    foreach (i, arg; argList) {
      components[i] = argList[i];
    }
  }
}
&lt;/pre&gt;

&lt;p&gt;The alias call makes &lt;code&gt;ArgList&lt;/code&gt; a tuple of &lt;code&gt;D&lt;/code&gt; elements, each of which has type &lt;code&gt;Field&lt;/code&gt;.  Suppose we&amp;#8217;re making a 3D vector of &lt;a href="http://www.digitalmars.com/d/2.0/d-floating-point.html"&gt;reals&lt;/a&gt;.  In this context, &lt;code&gt;ArgList&lt;/code&gt; has type &lt;code&gt;(real, real, real)&lt;/code&gt; and an example instance could be &lt;code&gt;(3.14159, 2.71828, 0)&lt;/code&gt;.  Notice how the constructor iteratively initializes the &lt;code&gt;components&lt;/code&gt; attribute array with the values from the provided &lt;code&gt;argList&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now we&amp;#8217;ll overload the binary operators &lt;code&gt;+&lt;/code&gt; and &lt;code&gt;-&lt;/code&gt; to take two &lt;code&gt;Vector!(Field,D)&lt;/code&gt; values and produce a new &lt;code&gt;Vector!(Field,D)&lt;/code&gt;.  For convenience we&amp;#8217;ll alias that type as &lt;code&gt;VecType&lt;/code&gt;.  The following code goes inside the struct defined above.&lt;/p&gt;

&lt;pre class="brush: c++"&gt;
  alias Vector!(Field,D) VecType;

  VecType opBinary(string op)(VecType vec) {
    if (op == "+" || op == "-") {
      VecType result;
      for (int i = 0; i &amp;lt; D; i++) {
        mixin("result.components[" ~ i.stringof ~ "] ="
              "this.components[" ~ i.stringof ~ "]" ~ op ~
              "vec.components[" ~ i.stringof ~ "];");
      }
      return result;
    }
  }
&lt;/pre&gt;

&lt;p&gt;The &lt;a href="http://www.digitalmars.com/d/2.0/mixin.html"&gt;&lt;code&gt;mixin&lt;/code&gt;&lt;/a&gt; construct makes it easy to assign each element in the resulting vector to the sum of the corresponding elements in the two other vectors.&lt;/p&gt;

&lt;p&gt;Let&amp;#8217;s make a &lt;a href="http://www.digitalmars.com/d/2.0/unittest.html"&gt;unit test&lt;/a&gt; that adds a 3D real vector to itself and checks the result:&lt;/p&gt;

&lt;pre class="brush: c++"&gt;
unittest {
  alias Vector!(real,3U) VecR3;

  VecR3 v = VecR3(3.14159, 2.71828, 0);
  VecR3 v_doubled = v + v;

  assert(v_doubled.components[0] == 3.14159 + 3.14159);
  assert(v_doubled.components[1] == 2.71828 + 2.71828);
  assert(v_doubled.components[2] == 0 + 0);
}
&lt;/pre&gt;

&lt;p&gt;When we run the unit test there&amp;#8217;s no output.  That tells us it&amp;#8217;s working!&lt;/p&gt;

&lt;pre class="brush: bash"&gt;
$ rdmd -unittest --main vector.d
$
&lt;/pre&gt;

&lt;p&gt;If you&amp;#8217;re skeptical that no news is good news, try changing the asserts so they come out to false.  &lt;code&gt;rdmd&lt;/code&gt; will cry tears of garbage.&lt;/p&gt;

&lt;p&gt;What happens when we add two vectors with different field types or dimensions?  You&amp;#8217;ll get an error at compile time.  Yeah, that&amp;#8217;s right&amp;#8212;kill those bugs before they have a fighting chance.&lt;/p&gt;

&lt;pre class="brush: bash"&gt;
vector.d(56): Error: incompatible types for ((r2) + (r3)): 'Vector!(real,2u)' and 'Vector!(real,3u)'
&lt;/pre&gt;

&lt;p&gt;I imagine there are other languages that give you the same expressiveness and safety, but haven&amp;#8217;t tested the theory.  What other languages can generate recursively defined types for you at compile time?  Can they also easily support useful binary operations on those types to produce a new value of the same type?&lt;/p&gt;</description><link>http://blog.sensitivecircuit.com/post/7062591903</link><guid>http://blog.sensitivecircuit.com/post/7062591903</guid><pubDate>Wed, 29 Jun 2011 20:12:00 -0400</pubDate><category>d</category><category>programming</category><category>recursive types</category><category>type safety</category><category>math</category><category>linear algebra</category></item><item><title>Organizing these techy obsessions (part 1)</title><description>&lt;p&gt;Anybody who knows me well is aware that I cycle through short-lived technical obsessions.  Maybe I&amp;#8217;ll dabble with some software for a few hours or a programming language for a few weeks.  Sometimes I latch onto something and keep with it for a long time, but for the most part it&amp;#8217;s about the thrill of learning and exploration.&lt;/p&gt;

&lt;h1&gt;Negative side-effects may include&amp;#8230;&lt;/h1&gt;

&lt;p&gt;Each of these short bursts requires startup time and has a learning curve.  Even worse, when I move from one project to the next I often don&amp;#8217;t take enough time to organize and backup what I&amp;#8217;ve accomplished.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m not terribly concerned that I&amp;#8217;m not focusing on a single project over the long term.  The most important ones eventually stick.  But what I am concerned about is not being organized enough to easily make progress on an old project or synthesize previously disparate projects.  Enduring the exact same start up process over and over is clearly a waste of time.  Plus, anticipation of wasted time deters me from returning to old projects, thereby making the projects suffer from bit rot.&lt;/p&gt;

&lt;h1&gt;System requirements&lt;/h1&gt;

&lt;p&gt;Many projects require me to use software.  Even when I&amp;#8217;m developing my own software, I depend programming tools.  It&amp;#8217;s inescapable.  And every piece of software will only work if its requirements are respected.  Those requirements may even include other software packages with their own requirements.  Eep!&lt;/p&gt;

&lt;h2&gt;Package managers&lt;/h2&gt;

&lt;p&gt;Open source operating systems like Linux address this problem by including package managers.  These nifty tools let you say, &amp;#8220;I want application X to run on my machine,&amp;#8221; and it tries to make that happen by installing all the dependencies and then finally application X.  Doing this by hand is a pain, so it&amp;#8217;s a good thing package managers exist.&lt;/p&gt;

&lt;p&gt;So why am I complaining?  I could just use a package manager, right?  No, it&amp;#8217;s not quite that simple.  Before I can install an application from the package manager, the software developers would have to first package up the software for the package manager.  And then the maintainers of the package manager have to include the package.  The net result is my package manager won&amp;#8217;t always let me install the software I need.&lt;/p&gt;

&lt;h2&gt;Can haz codez, plz?&lt;/h2&gt;

&lt;p&gt;Usually the next step is to download the source code to &lt;code&gt;/usr/local/src&lt;/code&gt; and compile it directly.  Of course I have to do the same thing for any dependencies the package manager can&amp;#8217;t handle.  This isn&amp;#8217;t too bad when the software developers document the dependencies properly.  Still, it&amp;#8217;s cumbersome if there are enough dependencies.&lt;/p&gt;

&lt;p&gt;Programmers like myself prefer to build on the latest releases of software because sometimes the newer version will behave differently than the older software.  Unless the changed behavior is identified as a regression bug, the newer version better reflects where the technology is going.  Who would want their precious new code to be &lt;em&gt;obsolete&lt;/em&gt; from day one because it depends on deprecated behaviors?  Certainly not me.&lt;/p&gt;

&lt;p&gt;The requirement to work with the latest releases poses a few problems for minimizing startup time.&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;Previous projects on the same machine may depend on now obsolete behaviors.  Installing a newer version of the software may break old projects.  Isolating what broke the old project or making changes until it works may not be easy.&lt;/li&gt;
&lt;li&gt;Installing the latest release of software can require compiling a lot from source, which can be time consuming.&lt;/li&gt;
&lt;li&gt;Some software needs to be installed using a specialized package manager, such as &lt;code&gt;gem&lt;/code&gt; for Ruby libraries.  Package managers affect global state of the system, sometimes in the same directories, so the distinct package managers can clash.  There&amp;#8217;s no standard way to resolve these collisions&amp;#8212;it requires experimentation and research time.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;All these problems can be resolved by limiting the scope of these global changes.  What I mean by global scope here is each problem affects the state within the operating system, but not beyond that.  If I had a different operating system for each project, the potential for these sorts of collisions would be non-existent.  I couldn&amp;#8217;t afford to buy a new computer every time I move on to a new obsession.  It&amp;#8217;s also silly to keep repartitioning my hard drives to support more operating systems.  Instead I could simulate that effect by installing a new virtual machine on my computer for each project.&lt;/p&gt;

&lt;p&gt;In the next post I&amp;#8217;ll explore whether virtual machines are a good solution or just another problem.&lt;/p&gt;</description><link>http://blog.sensitivecircuit.com/post/6919982215</link><guid>http://blog.sensitivecircuit.com/post/6919982215</guid><pubDate>Sat, 25 Jun 2011 20:34:00 -0400</pubDate><category>obsessions</category><category>organizing</category><category>package management</category><category>projects</category><category>virtual machines</category><category>programming</category></item></channel></rss>

