<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dw="https://www.dreamwidth.org">
  <id>tag:dreamwidth.org,2009-05-04:266577</id>
  <title>terriko</title>
  <subtitle>terriko</subtitle>
  <author>
    <name>terriko</name>
  </author>
  <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/"/>
  <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom"/>
  <updated>2024-09-27T18:00:02Z</updated>
  <dw:journal username="terriko" type="personal"/>
  <entry>
    <id>tag:dreamwidth.org,2009-05-04:266577:235243</id>
    <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/235243.html"/>
    <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom/?itemid=235243"/>
    <title>Best practices in practice: Black, the Python code formatter</title>
    <published>2024-09-27T18:00:02Z</published>
    <updated>2024-09-27T18:00:02Z</updated>
    <category term="opensource"/>
    <category term="review"/>
    <category term="bestpractices"/>
    <category term="code"/>
    <category term="python"/>
    <category term="bestpracticesinpractice"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">&lt;em&gt;This is crossposted from &lt;a href="http://curiousity.ca"&gt;Curiousity.ca&lt;/a&gt;, my personal maker blog.  If you want to link to this post, please use &lt;a href="https://curiousity.ca/2024/best-practices-black/"&gt;the original link&lt;/a&gt; since the formatting there is usually better.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I&amp;#8217;m starting a little mini-series about some of the &amp;#8220;best practices&amp;#8221; I&amp;#8217;ve tried out in my real-life open source software development. These can be specific tools, checklists, workflows, whatever.  Some of these have been great, some of them have been not so great, but I&amp;#8217;ve learned a lot. I wanted to talk a bit about the usability and assumptions made in various tools and procedures, especially relative to the wider conversations we need to have about open source maintainer burnout, mentoring new contributors, and improving the security and quality of software.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So let&amp;#8217;s start with a tool that I love: &lt;a href="https://github.com/psf/black"&gt;Black&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Black&amp;#8217;s tagline is &amp;#8220;the uncompromising Python code formatter&amp;#8221; and it pretty much is what it says on the tin: it can be used to automatically format Python code, and it&amp;#8217;s reasonably opinionated about how it&amp;#8217;s done with very few options to change. It starts with &lt;a href="https://peps.python.org/pep-0008/"&gt;pep8&lt;/a&gt; compliance (that&amp;#8217;s the python style guide for those of you don&amp;#8217;t need to memorize such things) and takes it further.  I&amp;#8217;m not going to talk about the design decisions they made but the &lt;a href="https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html"&gt;black style guide is actually an interesting read&lt;/a&gt; if you&amp;#8217;re into this kind of thing.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I&amp;#8217;m probably a bit more excited about style guides than the average person because I spent several years reading and marking student code, including being a teaching assistant for a course on Perl, a language that is famously hard to read.  (Though I&amp;#8217;ve got to tell you, the first year undergraduates&amp;#8217; Java programs were absolutely worse to read than Perl.)  And then in case mounds of beginner code wasn&amp;#8217;t enough of a challenge, I also was involved in a fairly well-known open source project (GNU Mailman) with a decade of code to its name even when I joined so I was learning a lot about the experience of integrating code from many contributors into a single code base.  Both of these are&amp;#8230; kind of exhausting?  I was young enough to not be completely set in my ways, but especially with the beginner Java code, it became really clear that debugging was harder when the formatting was adding a layer of obfuscation to the code.  I&amp;#8217;d have loved to have an autoformatter for Java because so many students could find their bugs easier once I showed them how to fix their indents or braces.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;And then I spent years as an open source project maintainer rather than just a contributor, so it was my job to &lt;em&gt;enforce&lt;/em&gt; style as part of code reviews.  And&amp;#8230; I kind of hated that part of it?  It&amp;#8217;s frustrating to have the same conversation with people over and over about style and be constantly leaving the same code review comments, and then on top of that sometimes people don&amp;#8217;t *agree* with the style and want to argue about it, or people can&amp;#8217;t be bothered to come back and fix it themselves so I either have to leave a potentially good bug fix on the floor or I have to fix it myself.  Formatting code elegantly can be fun once in a while, but doing it over and over and over and over quickly got old for me.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So when I first heard about Black, I knew it was a thing I wanted for my projects. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now when someone submits a thing to my code base, Black runs alongside the other tests, and they get feedback right away if their code doesn&amp;#8217;t meet our coding standards.  It hardly any time to run so sometimes people get feedback very fast.  Many new contributors even notice failing required test and go do some reading and fix it before I even see it, and for those that don&amp;#8217;t fix issues before I get there I get a much easier conversation that amounts to &amp;#8220;run black on your files and update the pull request.&amp;#8221;  I don&amp;#8217;t have to explain what they got wrong and why it matters &amp;#8212; they don&amp;#8217;t even need to understand what happens when the auto-formatter runs.  It just cleans things up and we move on with life.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I feel like the workflow might actually be better if Black was run in our continuous integration system and automatically updated the submitted code, but there&amp;#8217;s some challenges there around security and permissions that we haven&amp;#8217;t gotten around to solving.  And honestly, it&amp;#8217;s kind of nice to have an easy low-stress &amp;#8220;train the new contributors to use the tools we use&amp;#8221; or &amp;#8220;share a link to the contributors doc&amp;#8221; opening conversation, so I haven&amp;#8217;t been as motivated as I might be to fix things.  I could probably have a bot leave those comments and maybe one of those days we&amp;#8217;ll do that, but I&amp;#8217;m going to have to look at the code for code review anyhow so I usually just add it in to the code review comments.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The other thing that Black itself calls out in their docs is that by conforming to a standard auto-format, we really reduce the differences between existing code and new code.  It&amp;#8217;s pretty obvious when the first attempt has a pile of random extra lines and is failing the Black check.  We get a number of contributors using different integrated development environments (IDEs) that are pretty opinionated themselves, and it&amp;#8217;s been freeing to not to deal with whitespace nonsense in pull requests or have people try to tell me on the glory if their IDE of choice when I ask them to fix it.  Some python IDEs actually support Black so sometimes I can just tell them to flip a switch or whatever and then they never have to think about it again either.  Win for us all!&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So here&amp;#8217;s the highlights about why I use Black:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;As a contributor:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol class="wp-block-list"&gt;&lt;br /&gt;&lt;li&gt;Black lets me not think about style; it&amp;#8217;s easy to fix before I put together a pull request or patch.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;It saves me from the often confusing messages you get from other style checkers.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Because I got into the habit of running it before I even run my code or tests, it serves as a quick mistake checkers.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Some of the style choices, like forcing trailing commas in lists, make editing existing code easier and I suspect increase code quality overall because certain types of bug are more obvious.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;As a an open source maintainer:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol class="wp-block-list"&gt;&lt;br /&gt;&lt;li&gt;Black lets me not think about style.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;It makes basic code quality conversations easier.  I used to have a *lot* of conversations about style and people get really passionate about it, but it wasted a lot of time when the end result was usually going to be &amp;#8220;conform to our style if you want to contribute to this project&amp;#8221; &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Fixing bad style is fast, either for the contributor or for me as needed.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;It makes code review easier because there aren&amp;#8217;t obfuscating style issues.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;It allows for very quick feedback for users even if all our maintainers are busy.  Since I regularly work with people in other time zones, this can potentially save days of back and forth before code can be used.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;It provides a gateway for users to learn about code quality tools.  I work with a lot of new contributors through Google Summer of Code and Hacktoberfest, so they may have no existing framework for professional development.  But also even a lot of experienced devs haven&amp;#8217;t used tools like Black before!&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;It provides a starting point for mentoring users about pre-commit checks, continuous integration tests, and how to run things locally.  We&amp;#8217;ve got other starting points but Black is fast and easy and it helps reduce resistance to the harder ones.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;It reduces &amp;#8220;&lt;a href="https://effectiviology.com/bikeshedding-law-of-triviality/"&gt;bike shedding&lt;/a&gt;&amp;#8221; about style.  Bikeshedding can be a real contributor to burnout of both maintainers and contributors, and this reduces one place where I&amp;#8217;ve seen it occur regularly.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;It decreases the cognitive overhead of reading and maintainin a full code base which includes a bunch of code from different contributors or even from the same contributor years later.  If you&amp;#8217;ve spent any time with code that&amp;#8217;s been around for decades, you know what I&amp;#8217;m talking about.  &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;In short: it helps me reduce maintainer burnout for me and my co-maintainers.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So yeah, that&amp;#8217;s Black.  It improves my experience as an open source maintainer and as a mentor for new contributors.  I love it, and maybe you would too?  I highly recommend trying it out on your own code and new projects.  (and it&amp;#8217;s good for existing projects, even big established ones, but choosing to apply it to an existing code base gets into bikeshedding territory so proceed with caution!)  &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;It&amp;#8217;s only for Python, but if you have similar auto-formatters for other languages that you love, let me know!  I&amp;#8217;d love to have some to recommend to my colleagues at work who focus on other languages.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=235243" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-04:266577:151005</id>
    <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/151005.html"/>
    <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom/?itemid=151005"/>
    <title>Mailman 3.0 Suite Beta!</title>
    <published>2014-04-26T18:58:23Z</published>
    <updated>2014-05-01T09:41:10Z</updated>
    <category term="geek"/>
    <category term="pycon"/>
    <category term="mailman"/>
    <category term="code"/>
    <category term="python"/>
    <category term="homepage"/>
    <dw:security>public</dw:security>
    <dw:reply-count>5</dw:reply-count>
    <content type="html">I'm happy to say that...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://wiki.list.org/download/attachments/9961480/global.logo?version=5&amp;amp;modificationDate=1274913696414" alt="Mailman logo" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 2em; "&gt;&lt;a href="https://mail.python.org/pipermail/mailman-announce/2014-April/000191.html"&gt;Mailman 3.0 suite is now in beta!&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As many of you know, Mailman's been my open source project of choice for a good many years.  It's the most popular open source mailing list manager with millions of users worldwide, and it's been quietly undergoing a complete re-write and re-working for version 3.0 over the past few years.  I'm super excited to have it at the point where more people can really start trying it out.  We've divided it into several pieces: the core, which sends the mails, the web interface that handles web-based subscriptions and settings, and the new web archiver, plus there's a set of scripts to bundle them all together.  (&lt;a href="https://mail.python.org/pipermail/mailman-announce/2014-April/000191.html"&gt;Announcement post with all the links&lt;/a&gt;.)&lt;br /&gt;&lt;br /&gt;While I've done more work on the web interface and a little on the core, I'm most excited for the world to see the archiver, which is a really huge and beautiful change from the older pipermail. The new archiver is called Hyperkitty, and it's a huge change for Mailman.&lt;br /&gt;&lt;br /&gt;You can &lt;a href="https://lists.stg.fedoraproject.org/archives/"&gt;take a look at hyperkitty live on the fedora mailing list archives&lt;/a&gt; if you're curious!  I'll bet it'll make you want your other open source lists to convert to Mailman 3 sooner rather than later.  Plus, on top of being already cool, it's much easier to work with and extend than the old pipermail, so if you've always wanted to view your lists in some new and cool way, you can dust off your django skills and join the team!&lt;br /&gt;&lt;br /&gt;&lt;img src="https://avatars1.githubusercontent.com/u/3239368?s=140" alt="Hyperkitty logo" /&gt;&lt;br /&gt;&lt;br /&gt;Do remember that the suite is in beta, so there's still some bugs to fix and probably a few features to add, but we do know that people are running Mailman 3 live on some lists, so it's reasonably safe to use if you want to try it out on some smaller lists.  In theory, it can co-exist with Mailman 2, but I admit I haven't tried that out yet.  I will be trying it, though: I'm hoping to switch some of my own lists over soon, but probably not for a couple of weeks due to other life commitments.&lt;br /&gt;&lt;br /&gt;So yeah, that's what I did at the PyCon sprints this year.  Pretty cool, eh?&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=151005" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-04:266577:138949</id>
    <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/138949.html"/>
    <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom/?itemid=138949"/>
    <title>Book review code</title>
    <published>2013-10-17T23:33:27Z</published>
    <updated>2013-10-19T18:47:44Z</updated>
    <category term="homepage"/>
    <category term="code"/>
    <category term="book"/>
    <category term="hack"/>
    <category term="javascript"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">One of the things that bugs me when I'm doing book reviews is that I prefer it when reviews have a picture of the cover and link to the book of some sort, but I didn't love the output from Amazon's referal link generator, which would have been the easiest solution.  I've been doing it manually, but that's a lot of cut and pasting and I kind of abhor doing tasks that are easy to automate.&lt;br /&gt;&lt;br /&gt;Thankfully, I'm a coder and a user of greasemonkey, so I have all the skills I need to automate it.  Seriously, being able to tweak web pages to suit my own needs is the greatest thing.  &lt;br /&gt;&lt;br /&gt;In the spirit of sharing, here's the script I'm using to generate the code I wanted for my reviews using the book page on LibraryThing:&lt;br /&gt;&lt;br /&gt;&lt;pre style="color:#000000;background:#ffffff;"&gt;
&lt;span style="color:#3f7f59; "&gt;// ==UserScript==&lt;/span&gt;
&lt;span style="color:#3f7f59; "&gt;// @name        Book review header generator&lt;/span&gt;
&lt;span style="color:#3f7f59; "&gt;// @namespace   tko-bookreview&lt;/span&gt;
&lt;span style="color:#3f7f59; "&gt;// @description Takes any librarything book page and gives me a nice link to the book with cover and author details&lt;/span&gt;
&lt;span style="color:#3f7f59; "&gt;// @include     &lt;/span&gt;&lt;span style="color:#3f3fbf; "&gt;http://www.librarything.com/work/&lt;/span&gt;&lt;span style="color:#3f7f59; "&gt;*&lt;/span&gt;
&lt;span style="color:#3f7f59; "&gt;// @version     1&lt;/span&gt;
&lt;span style="color:#3f7f59; "&gt;// @grant       none&lt;/span&gt;
&lt;span style="color:#3f7f59; "&gt;// ==/UserScript==&lt;/span&gt;

&lt;span style="color:#3f7f59; "&gt;// Get all the data we'd like to display at the top of a review&lt;/span&gt;
var coverimage = document.getElementById(&lt;span style="color:#ffffff; background:#660099; font-weight:bold; font-style:italic; "&gt;'mainCover'&lt;/span&gt;).outerHTML;
var title = document.getElementsByTagName(&lt;span style="color:#2a00ff; "&gt;'h1'&lt;/span&gt;)[0].innerHTML;
var author = document.getElementsByTagName(&lt;span style="color:#2a00ff; "&gt;'h2'&lt;/span&gt;)[0].innerHTML;
var librarythinglink = document.URL; 


&lt;span style="color:#3f7f59; "&gt;// Trim down the title and author info&lt;/span&gt;
title = title.&lt;span style="color:#7f0055; font-weight:bold; "&gt;replace&lt;/span&gt;(/ *&amp;lt;span .*&amp;lt;\/span&amp;gt;/, &lt;span style="color:#ffffff; background:#660099; font-weight:bold; font-style:italic; "&gt;''&lt;/span&gt;);

author = author.&lt;span style="color:#7f0055; font-weight:bold; "&gt;replace&lt;/span&gt;(/href=&lt;span style="color:#2a00ff; "&gt;"&lt;/span&gt;&lt;span style="color:#2a00ff; "&gt;/, 'href=&lt;/span&gt;&lt;span style="color:#2a00ff; "&gt;"&lt;/span&gt;http:&lt;span style="color:#3f7f59; "&gt;//&lt;/span&gt;&lt;span style="color:#3f3fbf; "&gt;www.librarything.com&lt;/span&gt;&lt;span style="color:#3f7f59; "&gt;');&lt;/span&gt;
author = author.&lt;span style="color:#7f0055; font-weight:bold; "&gt;replace&lt;/span&gt;(/&amp;lt;hr&amp;gt;/, &lt;span style="color:#ffffff; background:#660099; font-weight:bold; font-style:italic; "&gt;''&lt;/span&gt;);

&lt;span style="color:#3f7f59; "&gt;// Generate the code for this book&lt;/span&gt;
var reviewheader = &lt;span style="color:#ffffff; background:#660099; font-weight:bold; font-style:italic; "&gt;'&amp;lt;a href="'&lt;/span&gt; + librarythinglink + &lt;span style="color:#2a00ff; "&gt;'"&amp;gt;'&lt;/span&gt; + 
   coverimage + &lt;span style="color:#ffffff; background:#660099; font-weight:bold; font-style:italic; "&gt;'&amp;lt;br /&amp;gt;'&lt;/span&gt; +
   &lt;span style="color:#2a00ff; "&gt;'&amp;lt;b&amp;gt;'&lt;/span&gt; + title + &lt;span style="color:#ffffff; background:#660099; font-weight:bold; font-style:italic; "&gt;'&amp;lt;/b&amp;gt;&amp;lt;/a&amp;gt; '&lt;/span&gt; +
   &lt;span style="color:#2a00ff; "&gt;'&amp;lt;em&amp;gt;'&lt;/span&gt; + author + &lt;span style="color:#ffffff; background:#660099; font-weight:bold; font-style:italic; "&gt;'&amp;lt;/em&amp;gt;'&lt;/span&gt;;

&lt;span style="color:#3f7f59; "&gt;// Add code around this for embedding it into the page&lt;/span&gt;
var textbox = &lt;span style="color:#ffffff; background:#660099; font-weight:bold; font-style:italic; "&gt;'&amp;lt;h4&amp;gt;Review Code&amp;lt;/h4&amp;gt;'&lt;/span&gt; +
	&lt;span style="color:#ffffff; background:#660099; font-weight:bold; font-style:italic; "&gt;'&amp;lt;textarea name="embedHTML" onFocus="this.select();" rows="5" '&lt;/span&gt; + 
	&lt;span style="color:#ffffff; background:#660099; font-weight:bold; font-style:italic; "&gt;'style="width: 250px;" wrap="virtual"&amp;gt;'&lt;/span&gt; + reviewheader + &lt;span style="color:#ffffff; background:#660099; font-weight:bold; font-style:italic; "&gt;'&amp;lt;/textarea&amp;gt;'&lt;/span&gt;;


&lt;span style="color:#3f7f59; "&gt;// Find a good spot and add it to the page&lt;/span&gt;
var insert = document.getElementsByClassName(&lt;span style="color:#2a00ff; "&gt;'gap'&lt;/span&gt;)[0];
insert.outerHTML =  textbox + insert.outerHTML;
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Please feel free to consider this open sourced and free for any type of use: alter it to suit your needs as you will!&lt;br /&gt;&lt;br /&gt;Edit: &lt;a href="https://github.com/terriko/webscripts"&gt;Github link&lt;/a&gt;, for those so inclined.&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=138949" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-04:266577:84604</id>
    <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/84604.html"/>
    <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom/?itemid=84604"/>
    <title>How much math do you need to write code?</title>
    <published>2011-11-23T00:11:33Z</published>
    <updated>2011-11-23T00:11:33Z</updated>
    <category term="code"/>
    <category term="math"/>
    <category term="computer science"/>
    <dw:security>public</dw:security>
    <dw:reply-count>6</dw:reply-count>
    <content type="html">I got a really interesting query today that boiled down to, "How much math do you need to write code?"&lt;br /&gt;&lt;br /&gt;The short answer to this is, "Not that much" or perhaps "it depends on what you want the code to do."  But here's part of what I actually wrote back:&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;&lt;br /&gt;To be honest, the level of math required to write code is pretty small.  A grade school understanding is often sufficient; there's a reason we can teach 7 year olds to program! Modern programming languages are much less math-oriented: I once spent an afternoon teaching my then 11 year old sister and her friends how to write dynamic database-driven websites, and the only math they used was to add up the scores on the "what animal are you most like?" quizzes they wanted to write.&lt;br /&gt;&lt;br /&gt;The math in computer science comes a lot later: for deeper analysis of algorithms and running time, we use algebra and mathematical proofs in an academic setting.  But... to tell the truth, relatively few programmers need or use this kind of deeper understanding in their day-to-day jobs.  And in my experience teaching students, many people find this stuff easier to learn by doing, so they only really begin to grasp it *after* they have gotten comfortable writing programs.&lt;br /&gt;&lt;br /&gt;In short: you probably have all the math skills you need to write code, and if you decide you want to do more hardcore CS later, it'll be easier to learn the math along the way anyhow!  &lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;&lt;br /&gt;There's some nuance there that I didn't really tease out -- the deeper understanding of algorithms and program behaviour is what characterizes the real "science" out of computer science.  And maybe the world would be a better place if more programmers did actually use deeper analysis in their day-to-day jobs.  But you don't have to be an academic-style computer scientist to write code!  Still, it's a very interesting question, given that historically programming actually &lt;em&gt;did&lt;/em&gt; require a lot more math, and our perceptions and stereotypes haven't really kept up with the reality of the field.&lt;br /&gt;&lt;br /&gt;Perhaps it's time for me to write another presentation? ;)&lt;br /&gt;&lt;br /&gt;(For context: &lt;a href="http://www.slideshare.net/terriko/how-does-biology-explain-the-low-numbers-of-women-in-cs-hint-it-doesnt"&gt;my old slideshow about women, computing and math&lt;/a&gt; got included in &lt;a href="http://techcrunch.com/2011/11/19/racism-and-meritocracy/"&gt;this TechCrunch post about Racism and Meritocracy&lt;/a&gt;, so I've been getting a lot of mail, including the one that spawned this post.)&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=84604" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-04:266577:71212</id>
    <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/71212.html"/>
    <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom/?itemid=71212"/>
    <title>Upgrading fink from mac os X 10.5 to 10.6</title>
    <published>2011-06-26T16:30:15Z</published>
    <updated>2011-06-26T16:30:15Z</updated>
    <category term="geek"/>
    <category term="open source"/>
    <category term="code"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">More notes from getting myself set up to write code:&lt;br /&gt;&lt;br /&gt;The fink project has &lt;a href="http://www.finkproject.org/download/10.6-upgrade.php?phpLang=en"&gt;a page about upgrading from 10.5 to 10.6&lt;/a&gt; with fink.&lt;br /&gt;&lt;br /&gt;It's very easy to get distracted by the nice step-by-step description that takes up most of the page.&lt;br /&gt;&lt;br /&gt;The &lt;em&gt;pertinent&lt;/em&gt; bit of information is at the top, though:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;you will probably find it easier to do a clean install from source instead.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I probably should have just done that first, since the lovely instructions didn't work at all for me.  Oh well.&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=71212" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-04:266577:71158</id>
    <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/71158.html"/>
    <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom/?itemid=71158"/>
    <title>hasAttribute deprecated? using querySelector.</title>
    <published>2011-06-26T14:58:49Z</published>
    <updated>2011-06-26T14:59:24Z</updated>
    <category term="geek"/>
    <category term="phd"/>
    <category term="open source"/>
    <category term="code"/>
    <dw:security>public</dw:security>
    <dw:reply-count>2</dw:reply-count>
    <content type="html">I have a Firefox add-on I made several years ago to help me explore page composition and generate (theoretical) web security policies, and I decided to pull it out of storage and see if it could still be helpful.  Of course, my browser decided to update Right Then, and I decided it wasn't worth fighting to stop it from doing so.&lt;br /&gt;&lt;br /&gt;So I updated the add-on so that it included versions 5.* and actually, it mostly still worked (despite having been written for, I believe, a very early version of Firefox 3, or maybe a late version Firefox 2?  This is one of my earliest add-ons.) except that apparently hasAttribute/getAttribute doesn't exist anymore.&lt;br /&gt;&lt;br /&gt;I can't seem to find anywhere telling me that they've been deprecated, and more importantly, what I should be using instead, which is irritating.  But the end result is that it doesn't work, so I needed to find something else.  It &lt;em&gt;looks&lt;/em&gt; like the solution for at least some of my code is to instead use a querySelector to look for all elements with that attribute.&lt;br /&gt;&lt;br /&gt;Of course, I never seem to want to do exactly what the darned examples show.  So in case you're like me, the way to search for any tag with a given attribute using querySelector is like this:&lt;br /&gt;&lt;br /&gt;&lt;code style="color:#3A6629; background:#eeeeee"&gt;document.querySelectorAll("*[myattribute]");&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And if you wanted to search just a specific type of tag, then you'd specify that instead of *.  So if you were looking for the alt tags for every image, you'd do...&lt;br /&gt;&lt;br /&gt;&lt;code style="color:#3A6629; background:#eeeeee"&gt;document.querySelectorAll("img[alt]");&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;But I'm concerned by this note in the &lt;a href="https://developer.mozilla.org/En/DOM/Element.querySelectorAll"&gt;querySelectorAll documentation&lt;/a&gt;, which tells me that it "Returns a non-live NodeList of all elements descended from the element on which it is invoked that match the specified group of CSS selectors."&lt;br /&gt;&lt;br /&gt;There's a big warning elsewhere that it's non-live too, unlike other such methods.  So my questions are... why is it non-live, and what do I need to do to get a live list?  For my particular purpose at the moment I don't think I need it to be live, but for some of the older code that I might want to update in the future I probably do.&lt;br /&gt;&lt;br /&gt;I'm mostly just recording this for my own reference later, but if someone happens to be able to tell me if there's another function that more directly replaces hasAttribute, or there's a good way to get a live list of elements with a given attribute, I'd love to know!&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=71158" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-04:266577:42737</id>
    <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/42737.html"/>
    <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom/?itemid=42737"/>
    <title>More pumpkins! More interface hacks!</title>
    <published>2010-10-26T22:51:49Z</published>
    <updated>2010-10-26T22:51:49Z</updated>
    <category term="code"/>
    <category term="geek"/>
    <category term="photo"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">Another flickr interface hack test:&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;&lt;a href="http://www.flickr.com/photos/terrio/sets/72157625236073040/"&gt;Pumpkins chez Dan 2010&lt;/a&gt;&lt;/h2&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112966147/in/set-72157625236073040/" title="IMG_1075"&gt;&lt;img src="http://farm5.static.flickr.com/4128/5112966147_d6e5d8362b_s.jpg" alt="IMG_1075" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113566126/in/set-72157625236073040/" title="IMG_1076"&gt;&lt;img src="http://farm2.static.flickr.com/1185/5113566126_d9aef73533_s.jpg" alt="IMG_1076" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113567202/in/set-72157625236073040/" title="Glowing vodka skull"&gt;&lt;img src="http://farm2.static.flickr.com/1204/5113567202_76c0195919_s.jpg" alt="Glowing vodka skull" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112970115/in/set-72157625236073040/" title="IMG_1080"&gt;&lt;img src="http://farm2.static.flickr.com/1110/5112970115_5a34e5550a_s.jpg" alt="IMG_1080" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112971585/in/set-72157625236073040/" title="IMG_1081"&gt;&lt;img src="http://farm2.static.flickr.com/1422/5112971585_675bd84838_s.jpg" alt="IMG_1081" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112973185/in/set-72157625236073040/" title="IMG_1082"&gt;&lt;img src="http://farm2.static.flickr.com/1196/5112973185_02fa10afcc_s.jpg" alt="IMG_1082" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112974829/in/set-72157625236073040/" title="IMG_1085"&gt;&lt;img src="http://farm5.static.flickr.com/4107/5112974829_49994c1648_s.jpg" alt="IMG_1085" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112976305/in/set-72157625236073040/" title="IMG_1086"&gt;&lt;img src="http://farm2.static.flickr.com/1314/5112976305_a4cb577596_s.jpg" alt="IMG_1086" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113576744/in/set-72157625236073040/" title="IMG_1087"&gt;&lt;img src="http://farm2.static.flickr.com/1314/5113576744_6ab9bd7b4e_s.jpg" alt="IMG_1087" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112980303/in/set-72157625236073040/" title="IMG_1088"&gt;&lt;img src="http://farm2.static.flickr.com/1216/5112980303_69617329d6_s.jpg" alt="IMG_1088" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113579924/in/set-72157625236073040/" title="IMG_1091"&gt;&lt;img src="http://farm5.static.flickr.com/4107/5113579924_36182a6b0f_s.jpg" alt="IMG_1091" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112982793/in/set-72157625236073040/" title="IMG_1092"&gt;&lt;img src="http://farm5.static.flickr.com/4085/5112982793_80565f29f3_s.jpg" alt="IMG_1092" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112984175/in/set-72157625236073040/" title="IMG_1093"&gt;&lt;img src="http://farm5.static.flickr.com/4153/5112984175_3e43d980d0_s.jpg" alt="IMG_1093" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112985627/in/set-72157625236073040/" title="IMG_1094"&gt;&lt;img src="http://farm5.static.flickr.com/4131/5112985627_e78baf464b_s.jpg" alt="IMG_1094" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113585044/in/set-72157625236073040/" title="IMG_1095"&gt;&lt;img src="http://farm2.static.flickr.com/1046/5113585044_411cf51d91_s.jpg" alt="IMG_1095" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113586344/in/set-72157625236073040/" title="IMG_1096"&gt;&lt;img src="http://farm5.static.flickr.com/4145/5113586344_4942d6ac3a_s.jpg" alt="IMG_1096" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113587708/in/set-72157625236073040/" title="IMG_1097"&gt;&lt;img src="http://farm2.static.flickr.com/1316/5113587708_e67fd6c690_s.jpg" alt="IMG_1097" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112990579/in/set-72157625236073040/" title="IMG_1098"&gt;&lt;img src="http://farm2.static.flickr.com/1260/5112990579_3e569ff22b_s.jpg" alt="IMG_1098" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112992119/in/set-72157625236073040/" title="IMG_1099"&gt;&lt;img src="http://farm2.static.flickr.com/1117/5112992119_954dde0969_s.jpg" alt="IMG_1099" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112993387/in/set-72157625236073040/" title="IMG_1101"&gt;&lt;img src="http://farm2.static.flickr.com/1225/5112993387_27da25cca6_s.jpg" alt="IMG_1101" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112994697/in/set-72157625236073040/" title="IMG_1102"&gt;&lt;img src="http://farm5.static.flickr.com/4127/5112994697_cc3434bdde_s.jpg" alt="IMG_1102" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113594528/in/set-72157625236073040/" title="IMG_1103"&gt;&lt;img src="http://farm2.static.flickr.com/1193/5113594528_d2defa16e2_s.jpg" alt="IMG_1103" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113595996/in/set-72157625236073040/" title="IMG_1104"&gt;&lt;img src="http://farm2.static.flickr.com/1195/5113595996_732a8a2e4b_s.jpg" alt="IMG_1104" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112999309/in/set-72157625236073040/" title="IMG_1105"&gt;&lt;img src="http://farm2.static.flickr.com/1073/5112999309_528404ed0f_s.jpg" alt="IMG_1105" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113000979/in/set-72157625236073040/" title="IMG_1106"&gt;&lt;img src="http://farm2.static.flickr.com/1228/5113000979_d557280413_s.jpg" alt="IMG_1106" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113600516/in/set-72157625236073040/" title="IMG_1107"&gt;&lt;img src="http://farm5.static.flickr.com/4133/5113600516_b1f15c6933_s.jpg" alt="IMG_1107" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113602140/in/set-72157625236073040/" title="IMG_1108"&gt;&lt;img src="http://farm2.static.flickr.com/1209/5113602140_75ece1d343_s.jpg" alt="IMG_1108" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113005687/in/set-72157625236073040/" title="IMG_1109"&gt;&lt;img src="http://farm5.static.flickr.com/4151/5113005687_81336906bd_s.jpg" alt="IMG_1109" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113605012/in/set-72157625236073040/" title="IMG_1110"&gt;&lt;img src="http://farm5.static.flickr.com/4145/5113605012_9ed668e635_s.jpg" alt="IMG_1110" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113008233/in/set-72157625236073040/" title="IMG_1111"&gt;&lt;img src="http://farm2.static.flickr.com/1233/5113008233_d41c4f404d_s.jpg" alt="IMG_1111" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113607546/in/set-72157625236073040/" title="IMG_1112"&gt;&lt;img src="http://farm2.static.flickr.com/1150/5113607546_199d93bc0e_s.jpg" alt="IMG_1112" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113010675/in/set-72157625236073040/" title="IMG_1113"&gt;&lt;img src="http://farm5.static.flickr.com/4104/5113010675_7f17b74021_s.jpg" alt="IMG_1113" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113012145/in/set-72157625236073040/" title="IMG_1114"&gt;&lt;img src="http://farm2.static.flickr.com/1088/5113012145_7efb71f2da_s.jpg" alt="IMG_1114" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113013697/in/set-72157625236073040/" title="IMG_1117"&gt;&lt;img src="http://farm2.static.flickr.com/1182/5113013697_c42d94f08a_s.jpg" alt="IMG_1117" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113612612/in/set-72157625236073040/" title="IMG_1119"&gt;&lt;img src="http://farm2.static.flickr.com/1121/5113612612_6f4d83c20b_s.jpg" alt="IMG_1119" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113613488/in/set-72157625236073040/" title="IMG_1123"&gt;&lt;img src="http://farm2.static.flickr.com/1413/5113613488_9e96f58c0c_s.jpg" alt="IMG_1123" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113016021/in/set-72157625236073040/" title="IMG_1124"&gt;&lt;img src="http://farm2.static.flickr.com/1427/5113016021_7de1595c3f_s.jpg" alt="IMG_1124" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113016787/in/set-72157625236073040/" title="IMG_1129"&gt;&lt;img src="http://farm2.static.flickr.com/1360/5113016787_f18fc2ecb1_s.jpg" alt="IMG_1129" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113017737/in/set-72157625236073040/" title="IMG_1131"&gt;&lt;img src="http://farm2.static.flickr.com/1339/5113017737_da57287727_s.jpg" alt="IMG_1131" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113018471/in/set-72157625236073040/" title="IMG_1132"&gt;&lt;img src="http://farm2.static.flickr.com/1256/5113018471_2bbb09a852_s.jpg" alt="IMG_1132" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113019357/in/set-72157625236073040/" title="IMG_1135"&gt;&lt;img src="http://farm2.static.flickr.com/1376/5113019357_0dce5d9a99_s.jpg" alt="IMG_1135" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/terrio/5113618794/in/set-72157625236073040/" title="IMG_1137"&gt;&lt;img src="http://farm5.static.flickr.com/4110/5113618794_4728661d76_s.jpg" alt="IMG_1137" class="pc_img" width="75" border="0" height="75"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This gives me a box with code for entire set of photos as thumbnails in an Nx6 grid.  Again, no clue if it's going to break RSS/layouts/feed readers, so please let me know if it does.&lt;br /&gt;&lt;br /&gt;Here's the code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px solid black; background: #eeeeee; font-size: 0.8em; padding: 1em"&gt;
&lt;font color="GREEN"&gt;&lt;i&gt;// ==UserScript==
&lt;/i&gt;&lt;/font&gt;&lt;font color="GREEN"&gt;&lt;i&gt;// @name           Blog flickr set
&lt;/i&gt;&lt;/font&gt;&lt;font color="GREEN"&gt;&lt;i&gt;// @namespace      tko-flickr-set
&lt;/i&gt;&lt;/font&gt;&lt;font color="GREEN"&gt;&lt;i&gt;// @description    Make cut and paste code for blogging entire sets of flickr photos as thumbnails
&lt;/i&gt;&lt;/font&gt;&lt;font color="GREEN"&gt;&lt;i&gt;// @include        http://www.flickr.com/photos/*/sets/*
&lt;/i&gt;&lt;/font&gt;&lt;font color="GREEN"&gt;&lt;i&gt;// ==/UserScript==
&lt;/i&gt;&lt;/font&gt;
&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; thumbsHTML &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; document&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;getElementById&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;'setThumbs'&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; allImages &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; thumbsHTML&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;getElementsByTagName&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;'a'&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;
&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; title &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; document&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;title&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;replace&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;/&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;-&lt;/font&gt; a set on Flickr&lt;font color="BLUE" size="+1"&gt;/&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;,&lt;/b&gt;&lt;/font&gt; ''&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; code &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; '&lt;font color="BLUE" size="+1"&gt;&amp;lt;&lt;/font&gt;h2&lt;font color="BLUE" size="+1"&gt;&amp;gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&amp;lt;&lt;/font&gt;a href&lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt;&lt;font color="PURPLE"&gt;"' + location.href + '"&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&amp;gt;&lt;/font&gt;' &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; title &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; '&lt;font color="BLUE" size="+1"&gt;&amp;lt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;/&lt;/font&gt;a&lt;font color="BLUE" size="+1"&gt;&amp;gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&amp;lt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;/&lt;/font&gt;h2&lt;font color="BLUE" size="+1"&gt;&amp;gt;&lt;/font&gt;'&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

&lt;font color="RED"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;i &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; &lt;font color="BROWN"&gt;0&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt; i &lt;font color="BLUE" size="+1"&gt;&amp;lt;&lt;/font&gt; allImages&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;length&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;&lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;&lt;/font&gt;i&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;&lt;b&gt;{&lt;/b&gt;&lt;/font&gt;

	code &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; '&lt;font color="BLUE" size="+1"&gt;&amp;lt;&lt;/font&gt;a href&lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt;&lt;font color="PURPLE"&gt;"' + allImages[i].href + 
	'"&lt;/font&gt; title&lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt;&lt;font color="PURPLE"&gt;"' + allImages[i].title + '"&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&amp;gt;&lt;/font&gt;' &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;
	allImages&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;[&lt;/b&gt;&lt;/font&gt;i&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;]&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;innerHTML &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; '&lt;font color="BLUE" size="+1"&gt;&amp;lt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;/&lt;/font&gt;a&lt;font color="BLUE" size="+1"&gt;&amp;gt;&lt;/font&gt;'&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

	&lt;font color="RED"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;i &lt;font color="BLUE" size="+1"&gt;&amp;gt;&lt;/font&gt; &lt;font color="BROWN"&gt;0&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;&lt;font color="BLUE" size="+1"&gt;&amp;amp;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&amp;amp;&lt;/font&gt;&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;i&lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;&lt;font color="BROWN"&gt;1&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;%&lt;/font&gt; &lt;font color="BROWN"&gt;6&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; &lt;font color="BROWN"&gt;0&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;&lt;b&gt;{&lt;/b&gt;&lt;/font&gt;

		code &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; '\n'&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;
	&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/font&gt;
&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/font&gt;

&lt;font color="GREEN"&gt;&lt;i&gt;// Insert after the date
&lt;/i&gt;&lt;/font&gt;&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; insertPlace &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; document&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;getElementsByClassName&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;'vsDetails'&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;[&lt;/b&gt;&lt;/font&gt;&lt;font color="BROWN"&gt;0&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;]&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; newBox &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; '&lt;font color="BLUE" size="+1"&gt;&amp;lt;&lt;/font&gt;h4&lt;font color="BLUE" size="+1"&gt;&amp;gt;&lt;/font&gt;Embed Code&lt;font color="BLUE" size="+1"&gt;&amp;lt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;/&lt;/font&gt;h4&lt;font color="BLUE" size="+1"&gt;&amp;gt;&lt;/font&gt;' &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;
	'&lt;font color="BLUE" size="+1"&gt;&amp;lt;&lt;/font&gt;textarea name&lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt;&lt;font color="PURPLE"&gt;"embedHTML"&lt;/font&gt; onFocus&lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt;&lt;font color="PURPLE"&gt;"this.select();"&lt;/font&gt; rows&lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt;&lt;font color="PURPLE"&gt;"5"&lt;/font&gt; ' &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;

	'style&lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt;&lt;font color="PURPLE"&gt;"width: 250px;"&lt;/font&gt; wrap&lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt;&lt;font color="PURPLE"&gt;"virtual"&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&amp;gt;&lt;/font&gt;' &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; code &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; '&lt;font color="BLUE" size="+1"&gt;&amp;lt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;/&lt;/font&gt;textarea&lt;font color="BLUE" size="+1"&gt;&amp;gt;&lt;/font&gt;'&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

insertPlace&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;innerHTML &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; insertPlace&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;innerHTML &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; newBox&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;



&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=42737" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-04:266577:42328</id>
    <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/42328.html"/>
    <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom/?itemid=42328"/>
    <title>Pumpkin photo and my flickr interface hack</title>
    <published>2010-10-26T21:49:49Z</published>
    <updated>2010-10-26T21:49:49Z</updated>
    <category term="photo"/>
    <category term="geek"/>
    <category term="code"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">&lt;div style="margin: 10px;"&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112973185/in/photostream/" title="IMG_1082"&gt;&lt;img src="http://farm2.static.flickr.com/1196/5112973185_02fa10afcc.jpg" alt="IMG_1082" style="border: solid 2px #000000;" /&gt;&lt;/a&gt;&lt;br /&gt; &lt;span style="font-size: 0.9em; margin-top: 0px;"&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/terrio/5112973185/in/photostream/"&gt;IMG_1082&lt;/a&gt; &lt;br /&gt;by &lt;a href="http://www.flickr.com/photos/terrio/"&gt;Terriko&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;br clear="all" /&gt;&lt;br /&gt;&lt;br /&gt;I'm testing out my greasemonkey script which generates boxes with the HTML for posting a flickr photo with title/caption, so you all get a picture of a pumpkin.  It &lt;em&gt;is&lt;/em&gt; the end of October, after all!&lt;br /&gt;&lt;br /&gt;The script is still brittle if the interface changes, but it is just a little interface hack so I'm not too concerned about it.  I'll just rehack if necessary, after all!  What it does is makes a set of 3 boxes down the right hand side of the page containing HTML for cutting and pasting the photo with the title as a caption (the default code Flickr gives you doesn't include a caption, and I find the menus kind of irritating if I'm posting a lot of photos in one day).&lt;br /&gt;&lt;br /&gt;Here's the script.  You should be able to cut and paste it into greasemonkey if you want to use it yourself.  (And here's to hoping that all these font colour, size and layout tricks won't break everyone's feed readers/friends pages/layouts!)&lt;br /&gt;&lt;br /&gt;&lt;div style="background: #cccccc; font-size: 0.8em"&gt;&lt;br /&gt;&lt;pre&gt;
&lt;font color="GREEN"&gt;&lt;i&gt;// ==UserScript==
&lt;/i&gt;&lt;/font&gt;&lt;font color="GREEN"&gt;&lt;i&gt;// @name           Flickr Blog HTML
&lt;/i&gt;&lt;/font&gt;&lt;font color="GREEN"&gt;&lt;i&gt;// @author         Terri Oda -- http://terri.zone12.com
&lt;/i&gt;&lt;/font&gt;&lt;font color="GREEN"&gt;&lt;i&gt;// @namespace      tko-flickr
&lt;/i&gt;&lt;/font&gt;&lt;font color="GREEN"&gt;&lt;i&gt;// @description    Adds a box with cut-and-paste code for blogging images
&lt;/i&gt;&lt;/font&gt;&lt;font color="GREEN"&gt;&lt;i&gt;// @include        http://flickr.com/*
&lt;/i&gt;&lt;/font&gt;&lt;font color="GREEN"&gt;&lt;i&gt;// @include        http://www.flickr.com/*
&lt;/i&gt;&lt;/font&gt;&lt;font color="GREEN"&gt;&lt;i&gt;// ==/UserScript==
&lt;/i&gt;&lt;/font&gt;

&lt;font color="GREEN"&gt;&lt;i&gt;// Get all that necessary photo info
&lt;/i&gt;&lt;/font&gt;&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; img &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; document&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;getElementsByClassName&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;&lt;font color="PURPLE"&gt;'photo-div'&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;[&lt;/b&gt;&lt;/font&gt;&lt;font color="BROWN"&gt;0&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;]&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;getElementsByTagName&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;&lt;font color="PURPLE"&gt;'img'&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;[&lt;/b&gt;&lt;/font&gt;&lt;font color="BROWN"&gt;0&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;]&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; title &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; document&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;getElementsByClassName&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;&lt;font color="PURPLE"&gt;'photo-title'&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;[&lt;/b&gt;&lt;/font&gt;&lt;font color="BROWN"&gt;0&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;]&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;innerHTML&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; url &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; location&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;href&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;
&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; imgsrc &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; img&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;src&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;replace&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;/&lt;/font&gt;_z\&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;jpg&lt;font color="BLUE" size="+1"&gt;/&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;,&lt;/b&gt;&lt;/font&gt; &lt;font color="PURPLE"&gt;'.jpg'&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt; 
	&lt;font color="GREEN"&gt;&lt;i&gt;// we want the smaller of the medium photos for most blogging purposes

&lt;/i&gt;&lt;/font&gt;
&lt;font color="GREEN"&gt;&lt;i&gt;// find the username for credit
&lt;/i&gt;&lt;/font&gt;&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; userHTML &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; document&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;getElementsByClassName&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;&lt;font color="PURPLE"&gt;'username'&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;[&lt;/b&gt;&lt;/font&gt;&lt;font color="BROWN"&gt;0&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;]&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;getElementsByTagName&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;&lt;font color="PURPLE"&gt;'a'&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;[&lt;/b&gt;&lt;/font&gt;&lt;font color="BROWN"&gt;0&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;]&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; user &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; userHTML&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;innerHTML&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;
&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; userUrl &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; userHTML&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;href&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;


&lt;font color="GREEN"&gt;&lt;i&gt;// Make that cut and paste-able code
&lt;/i&gt;&lt;/font&gt;&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; code &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; &lt;font color="PURPLE"&gt;'&amp;lt;div style="float: right; margin-left: 10px; margin-bottom: 10px;"&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;
	&lt;font color="PURPLE"&gt;'&amp;lt;a href="'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; url &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; &lt;font color="PURPLE"&gt;'" title="'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; title &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; &lt;font color="PURPLE"&gt;'"&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;

	&lt;font color="PURPLE"&gt;'&amp;lt;img src="'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; imgsrc &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; &lt;font color="PURPLE"&gt;'" alt="'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; title &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; 
	&lt;font color="PURPLE"&gt;'" style="border: solid 2px #000000;" /&amp;gt;&amp;lt;/a&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;

	&lt;font color="PURPLE"&gt;'&amp;lt;br /&amp;gt; &amp;lt;span style="font-size: 0.9em; margin-top: 0px;"&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; 
	&lt;font color="PURPLE"&gt;'\n&amp;lt;a href="'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; url &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; &lt;font color="PURPLE"&gt;'"&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; title &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; &lt;font color="PURPLE"&gt;'&amp;lt;/a&amp;gt; &amp;lt;br /&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; 
	&lt;font color="PURPLE"&gt;'by &amp;lt;a href="'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; userUrl &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; &lt;font color="PURPLE"&gt;'"&amp;gt;'&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; user &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; 
	&lt;font color="PURPLE"&gt;'&amp;lt;/a&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;br clear="all" /&amp;gt;'&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; codeSmall &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; code&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;replace&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;/&lt;/font&gt;\&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;jpg&lt;font color="BLUE" size="+1"&gt;/&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;,&lt;/b&gt;&lt;/font&gt; &lt;font color="PURPLE"&gt;'_m.jpg'&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt; 
	&lt;font color="GREEN"&gt;&lt;i&gt;// I'm amused how small is _m, but whatever works!

&lt;/i&gt;&lt;/font&gt;&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; noExtras &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt;&lt;font color="PURPLE"&gt;'&amp;lt;a href="'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; url &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; &lt;font color="PURPLE"&gt;'" title="'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; title &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; &lt;font color="PURPLE"&gt;'"&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;

	&lt;font color="PURPLE"&gt;'&amp;lt;img src="'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; imgsrc &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; &lt;font color="PURPLE"&gt;'" alt="'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; title &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; &lt;font color="PURPLE"&gt;'" /&amp;gt;&amp;lt;/a&amp;gt;'&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

&lt;font color="GREEN"&gt;&lt;i&gt;// figure out where to put it
&lt;/i&gt;&lt;/font&gt;&lt;font color="GREEN"&gt;&lt;i&gt;// this puts it right after the "this photo belongs to..." so I don't have to scroll much.
&lt;/i&gt;&lt;/font&gt;&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; insert &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; document&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;getElementsByClassName&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/font&gt;&lt;font color="PURPLE"&gt;'secondary-contexts-label'&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;[&lt;/b&gt;&lt;/font&gt;&lt;font color="BROWN"&gt;0&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;]&lt;/b&gt;&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

&lt;font color="GREEN"&gt;&lt;i&gt;// Make the actual box
&lt;/i&gt;&lt;/font&gt;&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; newBox &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; &lt;font color="PURPLE"&gt;'&amp;lt;h4&amp;gt;Embed Code&amp;lt;/h4&amp;gt;&amp;lt;h5&amp;gt;Medium&amp;lt;/h5&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;

	&lt;font color="PURPLE"&gt;'&amp;lt;textarea name="embedHTML" onFocus="this.select();" rows="5" '&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; 
	&lt;font color="PURPLE"&gt;'style="width: 250px;" wrap="virtual"&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; code &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; &lt;font color="PURPLE"&gt;'&amp;lt;/textarea&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; 
	&lt;font color="PURPLE"&gt;'&amp;lt;h5&amp;gt;Small&amp;lt;/h5&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; 
	&lt;font color="PURPLE"&gt;'&amp;lt;textarea name="embedHTML" onFocus="this.select();" rows="5" '&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;

   &lt;font color="PURPLE"&gt;'style="width: 250px;" wrap="virtual"&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; codeSmall &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; &lt;font color="PURPLE"&gt;'&amp;lt;/textarea&amp;gt;'&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;
&lt;font color="RED"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/font&gt; noExtrasBox &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; &lt;font color="PURPLE"&gt;'&amp;lt;h5&amp;gt;No Extras&amp;lt;/h5&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;

	&lt;font color="PURPLE"&gt;'&amp;lt;textarea name="embedHTML" onFocus="this.select();" rows="5" '&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt;
   &lt;font color="PURPLE"&gt;'style="width: 250px;" wrap="virtual"&amp;gt;'&lt;/font&gt; &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; noExtras &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; &lt;font color="PURPLE"&gt;'&amp;lt;/textarea&amp;gt;'&lt;/font&gt;&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

&lt;font color="GREEN"&gt;&lt;i&gt;// Add it to the page
&lt;/i&gt;&lt;/font&gt;insert&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;innerHTML &lt;font color="BLUE" size="+1"&gt;=&lt;/font&gt; newBox &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; noExtrasBox &lt;font color="BLUE" size="+1"&gt;+&lt;/font&gt; insert&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/font&gt;innerHTML&lt;font color="BLUE" size="+1"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/font&gt;

&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=42328" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-04:266577:18049</id>
    <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/18049.html"/>
    <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom/?itemid=18049"/>
    <title>Backing up Dreamwidth entries using DWSM</title>
    <published>2010-01-17T08:03:10Z</published>
    <updated>2010-01-17T08:03:10Z</updated>
    <category term="backups"/>
    <category term="code"/>
    <category term="geek"/>
    <dw:security>public</dw:security>
    <dw:reply-count>10</dw:reply-count>
    <content type="html">I decided it was time to start backing up my dreamwidth entries.  After &lt;a href="http://wiki.dwscoalition.org/notes/Compatible_clients"&gt;looking at some of the available clients&lt;/a&gt; I decided the quickest way to do this was probably going to be a shell script, and thankfully &lt;a href="http://zvi.dreamwidth.org/477997.html"&gt;there was a list of tools for the purpose of backing up livejournal entries&lt;/a&gt;.  &lt;br /&gt;&lt;br /&gt;So, I chose the one that seemed to back up the most stuff, &lt;a href="http://ljsm.feechki.org/index_en.html"&gt;LJSM&lt;/a&gt;, and tweaked it for Dreamwidth.  This wasn't that much work (I needed to change livejournal.com to be dreamwidth.org in one place, then I needed to fix it so the titles were set correctly in the index) but in case anyone else wants it, here's my modified version, DWSM:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://terri.zone12.com/code/dwsm.pl"&gt;http://terri.zone12.com/code/dwsm.pl&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I'm sure I'm not the only lazy person out there who'd do more backups if they didn't have to think too much about it. I think everyone's new year's resolutions should include "make more backups" and I'm doing my part to make this a reality.  So here you go: one less excuse! &lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Instructions&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Download DWSM: &lt;a href="http://terri.zone12.com/code/dwsm.pl"&gt;http://terri.zone12.com/code/dwsm.pl&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Basically, you need perl and you need to know how to run stuff from the command line.  If this makes no sense to you, you might want to ask someone else for help.  For those you know what I'm talking about, you'll want to run something like:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;./dwsm.pl -a -u terriko:password terriko&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Only you need a real password and probably you'll want to supply your own username in both places.  Or only the first if you really want a copy of my journal.  Or you can set the second one to any journal name if random acts of backup are your thing.  Grab all your friends' journals and print a newspaper!  Automate it to run every day and never think about backups again!  Whatever.  You have fun there!&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=18049" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-04:266577:13657</id>
    <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/13657.html"/>
    <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom/?itemid=13657"/>
    <title>Coding brain != reading brain?</title>
    <published>2009-10-14T04:17:21Z</published>
    <updated>2009-10-14T04:17:21Z</updated>
    <category term="photo"/>
    <category term="geek"/>
    <category term="javascript"/>
    <category term="code"/>
    <dw:security>public</dw:security>
    <dw:reply-count>12</dw:reply-count>
    <content type="html">The exhaustion/stress from fixing crud and trying to get my thesis done at the same time hit me hard today, so I came home at 4pm and immediately fell asleep. &lt;br /&gt;&lt;br /&gt;As these things usually go, this resulted in me awakening sometime later, still feeling like a zombie, but unable to go back to sleep.  I completely failed to read a magazine because I found myself skimming before I'd read a couple of sentences.  So I figured I'd go mess about with flickr... time flies, and I find I've written a greasemonkey script making it easier for me to blog photos.  Which is fine, except how the heck does it work that I can't concentrate long enough to read two sentences, yet I can write JavaScript code just fine?&lt;br /&gt;&lt;br /&gt;I am concerned that in the dystopian future, some evil megacorp will take advantage of this and generate worker drones who are incapable of reading but perfectly good at writing code.&lt;br /&gt;&lt;br /&gt;No, wait, that's just the exhaustion talking.  In that spirit, though... Have some tentacles, and I'm going back to bed:&lt;br /&gt;&lt;br /&gt;&lt;div style="margin: 10px;"&gt;&lt;a href="http://www.flickr.com/photos/terrio/4004840733/" title="Tentacles"&gt;&lt;img src="http://farm4.static.flickr.com/3525/4004840733_bc375a792a.jpg" alt="Tentacles" style="border: solid 2px #000000;" /&gt;&lt;/a&gt;&lt;br /&gt; &lt;span style="font-size: 0.9em; margin-top: 0px;"&gt;&lt;a href="http://www.flickr.com/photos/terrio/4004840733/"&gt;Tentacles&lt;/a&gt;&lt;br /&gt;by &lt;a href="http://www.flickr.com/photos/terrio/"&gt;Terriko&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;br clear="all" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=13657" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-04:266577:7133</id>
    <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/7133.html"/>
    <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom/?itemid=7133"/>
    <title>Why DON'T we teach computer science earlier?</title>
    <published>2009-08-14T06:29:49Z</published>
    <updated>2009-08-14T06:29:49Z</updated>
    <category term="women"/>
    <category term="geek"/>
    <category term="teaching"/>
    <category term="code"/>
    <dw:security>public</dw:security>
    <dw:reply-count>18</dw:reply-count>
    <content type="html">My friend &lt;a href="http://compscigail.blogspot.com/"&gt;Gail&lt;/a&gt; and I stopped by the &lt;a href="http://vv.carleton.ca/web/campSites/2009/Girls/"&gt;Girls@VV&lt;/a&gt; (the girls-only version of a local science/engineering summer camp) to give them a presentation on computer science.  Gail already has an excellent &lt;a href="http://compscigail.blogspot.com/2009/08/teach-me-computer-science-earlier.html"&gt;write-up of our chat with the girls on her blog&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;One of the things we asked the girls about is what we could do to encourage more young women to explore computer science, and a very prominent suggestion was that we start teaching it earlier, so people have some idea of the possibilities.&lt;br /&gt;&lt;br /&gt;So it got me thinking, why &lt;span style="font-style:italic;"&gt;don't&lt;/span&gt; we start earlier?  I taught my sister how to program when she was in elementary school.  One of my friends always asserts that I shouldn't generalize based on my sister and her friends, who are incredibly smart and exceptional people, but honestly programming isn't that difficult.  My brother and I learned at 13 from a book for kids.  So why don't the schools teach it?&lt;br /&gt;&lt;br /&gt;Here's some reasons I've been told in the past:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Teachers don't have the time.  This is especially true at the elementary level, as illustrated by &lt;a href="http://sdscaiff.wordpress.com/2008/12/18/have-you-ever-wondered-why-your-childs-elementary-teacher-looks-so-tired/"&gt;Diane Scaiff's excellent summary of teachers work hours in Ontario&lt;/a&gt;.  Adding stuff to the curriculum takes time that many teachers just don't have.&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Schools don't have equipment.  Computers are expensive to buy, maintain, and they are common targets for theft.&lt;br /&gt;&lt;br /&gt;&lt;li&gt;People think computer science is hard.  Often they think it requires advanced math. &lt;b&gt;You do not need significant math skills to program&lt;/b&gt;, despite this perception.  When I was teaching basic programming to my sister's friends, we started with web quizzes.  The only math was simple addition.   But this perception intimidates a lot of people who haven't tried it.&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Teachers don't have the knowledge and skills required to teach computer science.  And, as stated before, they don't have time to learn and may be intimidated by the perception that computer science is incredibly difficult.  This is especially true since many elementary school teachers feel that they are weak in math (at least according to the gentleman who started &lt;a href="http://jumpmath.org/"&gt;JUMP math tutoring&lt;/a&gt;). &lt;br /&gt;&lt;br /&gt;&lt;li&gt;People don't think kids will be able to do more "advanced" stuff.  This irks me.  Kids are a whole lot smarter and more capable than many people take them for.&lt;br /&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;As you might guess, this isn't just relevant to computer science.  My parents, who are biochemists, hit some of the same roadblocks when they wanted to make sure I got a good science education from a young age.  They found ways around it and ways to supplement my education.  &lt;br /&gt;&lt;br /&gt;And what you might not realise (but I think the girls did) is that because this stuff isn't taught in the schools, girls especially aren't getting exposed.  Guys often seem to get exposed to computer science in other ways, but more women rely upon the curriculum.  (A recent study suggests that &lt;a href="http://www.impactlab.com/2009/07/26/girls-have-less-free-time-to-game-than-boys/"&gt;girls may have less spare time than boys&lt;/a&gt;, which is one reason that might explain this.)  So while this extra education could help all children, it's likely to be especially helpful to girls.&lt;br /&gt;&lt;br /&gt;So, I'm going to leave you all with two questions:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Why else don't we teach younger children computer science?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;What can we do to alleviate these problems?&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;I obviously have opinions and suggestions on number 2 (For example, freely available materials like the &lt;a href="http://csunplugged.org/"&gt;CS Unplugged&lt;/a&gt; activity we ran this morning!), but I'd like to see what other people think first.&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=7133" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-04:266577:6333</id>
    <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/6333.html"/>
    <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom/?itemid=6333"/>
    <title>And disappearing error messages too!</title>
    <published>2009-08-07T20:31:08Z</published>
    <updated>2009-08-07T20:31:08Z</updated>
    <category term="code"/>
    <category term="work"/>
    <category term="geek"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">I forgot to mention my &lt;em&gt;favourite&lt;/em&gt; issue in my &lt;a href="http://terriko.dreamwidth.org/5911.html"&gt;previous post about JavaScript and Firefox extension development&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Sometimes, magically, your entire log on the error goes poof!  'cause, you know, it wasn't hard enough to debug.&lt;br /&gt;&lt;br /&gt;I'm pretty sure the error log goes poof if you try to print something undefined to it, but there may be other cases where it does.&lt;br /&gt;&lt;br /&gt;Special.&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=6333" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-04:266577:5911</id>
    <link rel="alternate" type="text/html" href="https://terriko.dreamwidth.org/5911.html"/>
    <link rel="self" type="text/xml" href="https://terriko.dreamwidth.org/data/atom/?itemid=5911"/>
    <title>Writing Firefox Extensions in JavaScript (or possibly in the dark ages)</title>
    <published>2009-08-07T19:15:02Z</published>
    <updated>2009-08-07T19:15:02Z</updated>
    <category term="geek"/>
    <category term="work"/>
    <category term="web"/>
    <category term="code"/>
    <dw:security>public</dw:security>
    <dw:reply-count>8</dw:reply-count>
    <content type="html">I'm working on a Firefox extension. &lt;br /&gt;&lt;br /&gt;For those of you who have not attempted this, let me tell you a few things about the experience:&lt;br /&gt;&lt;br /&gt;(a) I'm working in JavaScript.  JavaScript likes to fail gracefully, which means that it doesn't tend to spew error messages every time something goes wrong. That's nice if you're using it, but annoying when you're trying to track down an error.&lt;br /&gt;&lt;br /&gt;(b) And then, in case it wasn't quiet enough, I put it into an add-on, where it's even more silent, and on top of that I can't bring my usual JavaScript debugging tools to bear on it because they only operate on the code in a web page.&lt;br /&gt;&lt;br /&gt;So basically, I've been programming for the past few days without all the usual modern coding conveniences.  I have been reduced to debugging almost entirely from the equivalent of printf or echo.  Thank goodness I at least have syntax highlighting.  To use a terrible analogy, this is akin to writing everything on a typewriter -- better than a quill and ink perhaps, but still not quite up to the modern computer when it comes to the easy fixing of mistakes.&lt;br /&gt;&lt;br /&gt;I've lost track of the number of times where I've deleted my non-working code, retyped it all, only to find that this time, it works.  The problem before was almost certainly a typo, but it was less trouble to re-write than try to find the missing character.  Incredibly frustrating.&lt;br /&gt;&lt;br /&gt;That said, I actually kinda like Firefox extension development, even if the minutiae are irritating.  It's incredibly satisfying when it works, and I can then try my code out on any web page I want, really easily.  So much data.  And the idea that other people will be able to install my code is surprisingly appealing.  (Well, perhaps not that surprising -- I used to write IRC scripts back in the day.) &lt;br /&gt;&lt;br /&gt;But I do feel a little like I'm the dark ages here, and I find it hard to believe that other people placidly program in this environment.  So I'm guessing there are tools out there, I just don't know them. Last time I tried any was probably pre Firefox 2.0, and I wasn't thrilled, but I'd be happy to take some recommendations now if things have gotten better now that we're up to 3.5!&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=5911" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
</feed>
