Friday, May 30, 2014

A Quick Bi-Weekly Re-cap

Week 1: May 19 to May 25

  1. Researched history of OHM project in the mailing list archives and GitHub issues here and here.
  2. First OHM planning meeting on Google Hangouts, synopsis by Robert H. Warren posted at May 22 OHM Hangout Synopsis
  3. Added to Github OHM organziation and (scarily) given push access.
  4. Assigned and began work on microtask of investigating client side rendering.

Week 2: May 26 to June 1 - DRAFT/WIP

  1. Went spelunking through the OHM Rails Port to find where to place the slider (and was later introduced to (and made a small link fix within) the official OHM UI wiki page.
  2. Attended #OPW IRC chat for OPW Interns on May 27 3PM UTC.
    1. We had a round of intros and some general questions
    2. Sumana Harihareswara is now the official "so where do we go after this is over" post-internship planning mentor
    3. Sumana also posted a link to a very helpful article on when to ask for help First You Must Try, Then You Must Ask.
  3. During this week's Google Hangout meeting with my mentor, we reviewed the task from last week and discussed next steps
    1. find a place for the TimeSlider on the OHM site
    2. start finding a way to make input from the TimeSlider feed into the website and request the tiles needed (this one's a higher level task and will break out into other pieces)
  4. I posted mockups of two different ideas for TimeSlider placement:
    1. within the header of the site
    2. attached to the search box on the site

Sunday, May 18, 2014

Seeking An Alternative to The JQuery UI Slider

I've spent most of the weekend digging around in the Open Streetmap code base on GitHub. If our first goal is to develop a slider that will fit in (over?) that code, I'd like to make sure that whatever we create will mesh nicely with what's already in that repository. If I'm reading this correctly, the code already includes JQuery via the jquery-rails gem. What it doesn't have is the JQuery UI. The initial slider(s) that I've been working with both depend on the JQuery UI module, so I went spelunking in the JQuery UI code.

Wow.

There's got to be a better way.
__________________________________________________________

Update (5/20/15): Yes, there is another way. Your mentor finds someone who enjoys the front end piece to build the slider!


Saturday, May 17, 2014

Signed, Sealed, Delivered

I'm yours for the summer, Outreach Project for Women :).

I just successfully (I hope ;) ) uploaded my signed contract for the OPW.

Friday, May 16, 2014

Muggles, Outsiders and Empathy

I was listening to Hanselminutes yesterday. (Yes, yes, I realize that's like Hermione saying she went to the library yesterday.)

Hermione Granger from Harry Potter studying in the library
And what precisely is that supposed to mean?
The guest on Hanselminutes was David Starr, who's especially known for using Agile methodologies, including at home, as part of managing his family. It was an interesting conversation and definitely worth some time. They got to the part where they needed to come up with a gender-neutral term for their better halves. (As in the person you need to explain Trello to and convince to use GitHub for the family shopping list.) Mr. Hanselman suggested the term "non-technical spouse." It doesn't exactly roll off the tongue.

Muggle is the word I use (in my head, at least.) But not just for technical stuff. In my house, we're all rather technically-inclined, but in different areas. Most of us are gamers, one is not (full disclosure: that's me). We're interfaith with a ratio 4:1. One of us can't watch PG-13 movies. Females outnumber males. The young outnumber the old ;). No matter how you slice it or which grouping you choose, there's always going to be someone who's left out. There's always someone who feels a bit like an outsider. There's always a Muggle in our midst.

That actually makes it a good thing. Because the borders around our various allegiances shift with every different topic, each of us experiences being the Outsider. And because each of us empathizes with that feeling of not knowing what everyone else is so excited about (or even understanding half of what they're saying), we all can have a lot more compassion and patience with each other. (We can, not that we always do. This is a real family, not a PSA or a very special episode of Jesse.)

The whole world is like this, if you look hard enough. We're all the Muggle sometimes. Imagine what could happen if we all took a little more time to remember this.

Thursday, May 15, 2014

Today

I've been lurking on the Ada Developers Academy website for months, waiting for this day. The application for the September class is posted.

Mod of Edvard Munch's the Scream but with thumbs up
ZOMG!

There are now two logic puzzles (yeay), the Markdown resume, reading assessment, and still the YouTube video requirement (not so yeay) but I've already dug in. Nothing's going to stop me from applying this time.

Most especially myself.

Wednesday, May 14, 2014

Ada Developers Academy is a Gift to Seattle

Yesterday, Emily Parkhurst's interview with Geoffrey Moore was making the rounds on Twitter. Moore's basic argument is that public policy (tax breaks, planning, education, etc) should be more focused on the tech sector and the convergence of UX, data and the cloud and less focused on increasingly less relevant companies (cough, Boeing, cough, cough.)

As if on cue, Code for Seattle hosted a round of presentations by the first cohort of Ada Developers Academy. The night was all about civic apps and (although I was egregiously late) it was a peek into the greatness that ADA is releasing into our city(ies). Three apps were demonstrated tonight:

Where Can I Park?
http://wherecanipark.in/seattle­
Conceived, coded and created by Hsing-Hui Hsu and Liz Rush, this app helps drivers in Seattle make sense of the insanity that is finding a place to park.  Sadly, it doesn't work outside of Seattle (but that's where you really need it, anyway!)

What Do I Do With____?
http://www.wdidw.com/
Created by Audrey Carlsen, WDIDW was inspired by the (rather sad) old King County website that attempted to do the same. It's a really cool app. I wish it had been around the last time I moved! :)

Map My Districts
Map My Districts is a special in-house app that was created by Anne Kimsey for the Seattle City Council in order to cope with the new redistricting that just took place.  My head almost exploded when she showed the polygon math that's going on in the background when drawing the maps!

And these are just three of the capstone projects created by the first cohort of the Ada Developers Academy after 24 weeks of studying. Can't you just imagine what scores of ADA graduates are going to be able to do for Seattle?








Tuesday, May 13, 2014

Let's Do the Time Slide Again!

The official start of my internship with Wikimedia is rapidly approaching, so I've started hacking away at the first listed goal: The TimeSlider.

I've got this as a beginning prototype:

<!doctype html>
<html lang='en'>
<head>
  <meta charset='utf-8'>
  <title>jQuery UI Slider - Range Slider</title>
  <link rel='stylesheet' href='http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css'>
  <script src='http://code.jquery.com/jquery-1.10.2.js'></script>
  <script src='http://code.jquery.com/ui/1.10.4/jquery-ui.js'></script>
  <script>
    $(function() {
      $('#slider-range').slider({
        range: true,
        min: 0,
        max: 500,
        values: [75, 300],
        slide: function(event, ui) {
          $('#amount').val('$' + ui.values[0] + ' - $' + ui.values[1]);
        }
      });
      $('#amount').val($('#slider-range').slider('values', 0) + ' - ' + 
         $('#slider-range').slider('values', 1));
    });


I posted a link to a working model on the Open Historical Streetmap mailing list, the Bugzilla report and on the Github issues page. I've been getting some great (if somewhat conflicting ;) ) feedback, which was just what I needed. I will post more soon!

Monday, May 12, 2014

Baby Steps, Indeed

I just earned the Baby Steps badge on Project Euler. (You earn it after solving three problems.) Yes, it's baby steps but I did it! :) (It's been a nice distraction from the confounding errors in my other project. Yes, I'm getting back to it now...)

BTW, 600851475143 is a very large number. My computer doesn't like doing ANYTHING that many times ;).

Sunday, May 11, 2014

Bug Hunting

So I'm banging my head against an odd error in an RSpec test. In case you missed the last post:

 1) Posts when the user has authenticated when there are posts can be deleted from link on posts page
     Failure/Error: click_link 'Destroy'
     Capybara::ElementNotFound:
       Unable to find link "Destroy"
     # ./posts_spec.rb:71:in `block (5 levels) in <top (required)>'
     # ./posts_spec.rb:69:in `block (4 levels) in <top (required)>'


I tried modifying the way the Capybara test selects the 'Destroy' link.  Instead of:
         within 'tr:last-child' do
            page.driver.accept_js_confirms!
            click_link 'Destroy'
         end

I tried:
    within 'tr:last' do
            page.driver.accept_js_confirms!
            click_link 'Destroy'
         end

That delivered a new kind of error:
     Failure/Error: within 'tr:last' do
     Capybara::Webkit::InvalidResponseError:
       SYNTAX_ERR: DOM Exception 12
     # ./posts_spec.rb:69:in `block (4 levels) in <top (required)>'

So, that didn't work. There are two other places in the spec where the tutorial I'm using said to use "tr:last" instead of "tr:last-child" because of a Capybara bug. I see now why the tutorial didn't have us change the middle describe block.

So I went back and took a shot in the dark and tried giving an id of "destroy-link" to the <td> containing the 'Destroy' link. Capybara didn't like that:
     Failure/Error: within '#destroy_link' do
     Capybara::ElementNotFound:
       Unable to find css "#destroy_link"
     # ./posts_spec.rb:69:in `block (4 levels) in <top (required)>'

The 'Destroy' link is actually in a child of the td, so in hindsight I'm not too surprised that it didn't work. Looking at the code a second (fourth? fifth?) time, though, I had an idea. Can I select the td>tr ? 

Apparently not.
     Failure/Error: within 'tr>td' do
     Capybara::ElementNotFound:
       Unable to find css "tr>td"
     # ./posts_spec.rb:69:in `block (4 levels) in <top (required)>'

I tried it with and without the spaces on either side of the child '>'. No dice. Time for more digging through StackOverflow ;). 'Night, all!




Saturday, May 10, 2014

A Year Ago Today

A year ago today, I pushed up my first commits to win-deck. It's not my oldest commit on Github; that honor goes to Mini-Paint. I barely knew how to use Git back then. If memory serves me, I even copy and pasted some of the code directly into the edit window on Github.com. Win-deck was a hacky little mod of Zurb's orbit.jQuery. Zurb doesn't even support it anymore (and didn't last May 9th, either, but it was simple and fit my needs.)

Why did I build this little thing? I had heard on Twitter that HaikuDeck was hiring web developers. I knew some Javascript and HTML and thought I'd apply for a Junior Dev position. The application process included creating a HaikuDeck demonstrating why you're awesome and should come work for them. The hitch: at the time, HaikuDeck didn't work on Windows. With the exception of my ancient, missing-half-its-keys G4, all I had to work with was Windows. So, I hacked together my own little version of a HaikuDeck, using that old deprecated version of orbit.jQuery. (Thank you, Zurb!)

Needless to say (so why say it?), HaikuDeck didn't hire me. I did get a very nice rejection response email (which speaks volumes about how awesome HaikuDeck is as a company and served to make me want to work with them even more!)

I didn't want to admit it at the time, but the rejection broke my spirit for a long while. You can see it in my Github graph, and in my activity charts on Codecademy, my then-primary learning platform. Slowly, I built myself back up to keep trying.

Those 4 commits have remained on my Github graph for, well, a year now. They've been a reminder to not let rejection crush me again. Every time I visit Github, that giant block of grey that follows them stares back at me, reprimanding me for all those lost chances to create something.

Those two green boxes from May, 2013 are about to fall off my chart. I will be left with 21 weeks of empty squares.

I know this is the last time I'll have such a swath of blanks on my chart. The green squares pick up again in October when I started to work through the public portions of the Ada Developers Academy curriculum. And with a few dips here and there (most notably during the Retail Hell Month of December), nearly every week has at least a few commits.

And it's only going to get better from here. My internship with Wikimedia officially starts in just over a week. I can't wait to see where this path goes. I guess we'll find out together.

Starting The Weekend Off Right

I'm starting the weekend off right!

Failures:

  1) Posts when the user has authenticated when there are posts can be deleted from link on posts page

     Failure/Error: click_link 'Destroy'
     Capybara::ElementNotFound:
       Unable to find link "Destroy"
     # ./posts_spec.rb:71:in `block (5 levels) in <top (required)>'
     # ./posts_spec.rb:69:in `block (4 levels) in <top (required)>'


Now to figure out why Capybara can't find an element that I can see when I run the site locally. Hermm...

As a side note, earlier today I did successfully learn that running

n = # some really big number
Prime.each(n/2) do |prime|
    prime_list.push(prime)
end

is quite effective if you wish to freeze up your computer to the point of hard reboot. ;) I wasn't seriously expecting it be fast but WOW, I need to work on my algorithms. That code knocked my little laptop down on its ass.


Thursday, May 8, 2014

[REDACTED]

I had a blog post ready to publish and then I read this:

We hope that you enjoyed solving this problem. Please do not deprive others of going through the same process by publishing your solution outside Project Euler. If you want to share your insights then please go to thread 2 in the discussion forum. -- From Project Euler site 

I'll have something for you later.

Wednesday, May 7, 2014

Taking A Break

No, it's not what you think! :D

Some time ago (January 2012, to be more precise), I started working on the very first problem on Project Euler. It was a lot of fun and I felt like I was playing a game. I finished the first problem, read the next and then abandoned Project Euler for lack of time. But I kept thinking about it.

And then I read Aja Hammerly's slides from last night's Seattle Ruby Brigade monthly meeting. Seattle.rb is having a programming contest to see who can complete the most Project Euler problems in the month of May. You can see where this is headed...

I signed up. So much time had passed since the last time I signed on to the PE site that I had to ask for the little username reminder email. Immediately after I crtl-v'd Aja's friend code into the little box I regretted it. How on earth would I find the time to work on this? Wasn't time the thing that had kept me away for the past two (plus) years?

I mulled on this all morning at work and then it hit me. I have been lamenting how short my lunch breaks are and how they aren't really enough time to get any significant project work done. (Particularly since I have no access to wi-fi at work and no place to secure my laptop when I'm not on a break.) But thirty minutes is a fairly decent amount of time to spend with a little pseudo code or an algorithm. Thirty minutes a day for five days a week is even better. ((rubs hands together with an excited grin)) I can take a break and do something at the same time!

This isn't to say that I expect to have a real chance at winning. But the rules of the contest require that at least ten people participate, so even if I get just a few solved this month, I'll be contributing to the quorum needed for there to be a winner. That's worth making time for. (That and playing with code is just plain fun!)

Tuesday, May 6, 2014

A Tiny Rant (Confession?) About Typos

I spent hours today slaying typo bugs. Silly, stupid, asinine one or two character typos that I shouldn't have made in the first place, or at least should have caught as I was typing them. There's one more out there in the wilds of my code that I'm going to spend twenty minutes looking for tonight. If I can't find it by then, I'm switching tasks and hitting it again in the morning. (Alarm's already set for 4am.)

I know that one solution is to sleep more. I've been around the block enough times to know that I make stupid mistakes when I'm overtired. Another solution is to drill my typing more. I have a plan for the latter: Typing.io is a freemium online typing tutorial that uses actual code for typing practice. I'm going to do a quick drill tonight right before bed and plan to build it in to my am/pm routine.

The former is a bit more difficult. I'll chew on that while I type tonight.

P.S. Oh, and there's this great one-liner for debugging Capybara that the great Philip Crawford introduced me to. Add save_and_open_page as a breakpoint in your failing test. It will give you a little snapshot on what on earth is going on. For more, see: Jeff Kreeft Meijer's blog post.


Monday, May 5, 2014

Strange Errors Are Good

Or, How I Learned to Stop Worrying and Love the Feedback.

((crickets chirp))

Well, then. Ahem. 

I've been plowing through a few RSpec tutorials (here and here), trying to increase my understanding and decrease my mind-numbing fear of all those error messages. Intellectually, I understand that error messages are our friends. The kind of friends who want to make us better and are willing to use some tough love to get us that way. Deep down inside, there's still that little part of me that makes my heart jump when I see a screen of errors go flying by. It's the same little panicky part that I successfully subdued into calm at the sight of the command line. I subdued the panic then and I will do it again.

In the meantime, I'm learning great things about RSpec though my little detour in tutorial-land.

Today I learned:
1.  You can run all of the tests in your spec/ directory by typing rspec spec (or rake exec rspec spec in Rails) on the command line. Frying pans! Who knew?

And, more importantly:
2.  Yes, at least at this point in my experience and training, it is totally worth the time to read through the entire tutorial first. It's tempting to just jump in and start hacking, but ultimately it's much more frustrating when I try to follow along. I typically end up hacking away and then I don't scroll down to see that the error message I think is due to some mistake on my part is really all part of the whole BDD/TDD plan. And, yes, I should have learned this lesson quite some time ago but it was hammered in today when I read through the tutorial before even opening my editor. I saved myself a ton of time and tears.

Sunday, May 4, 2014

Lesson #1 From TDD: Do Not Fear Errors

Test-Driven-Development is really a bit of a misnomer. It's really more like Error-Driven-Development. In a (nearly over-)simplified form, you write and then run your tests, read the error messages and then write the code that will prevent those errors and failing tests.

The first lesson for me (and perhaps for you, too) is to resist the gut reaction of "oh, no, I suck at this" when errors and test failures come up instead of automatically passing tests. Theoretically, I understand that we're going to get more failures than successes in TDD. It's convincing my subconscious that all of those 'F's really are expected and OK.

I've been working through the Ruby for Newbies: Testing with RSpec tutorial over at Nettuts+. That brings me to my first lesson for TDD tutorials: read the entire tutorial first! I spent nearly an hour trying to figure out why I was getting a strange error when running the first test, only to scroll down a bit and see that we're supposed to get that error at that point of the tutorial. That's when I remembered a nearly identical problem (same problem, different error) while working through Michael Hartl's Rails Tutorial. Sigh...

Tee Design by CoryWayDesign

Enough introspection. Back to the fray!

Saturday, May 3, 2014

Two Steps Back === A Better View

After finding some success with shot-in-the-dark code snippets from StackOverflow, I'm listening to Vizzini and going back to the beginning.

Luckily, I'm in a bit better shape than Indigo up there. But I'm just as far from my goal.
Back to the beginning, because blindly typing in the code from various tutorials and guides is simply not giving me any understanding and leaving me in utter confusion when I get errors.

I've put a few RSpec books on hold at my terrific local library and cast about for an online tutorial in the mean time. I found one by Jeff Nyman that I've actually tried before but was foiled by problems with Watir-Webdriver. CodeSchool has a paid course on RSpec, but I'm looking for the cheapest option here. There's a well-reviewed tutorial on NetTuts that's next on my list to kick around. I'll post my success or failure with it tomorrow.

Friday, May 2, 2014

Stubbing My Toe

Sorry about the yolk. I thought it was punny.

I'm still fighting my way through a series of failing tests in Rspec. Via this question over on StackedOverflow, I found a snippet of code that adds the create method to FactoryGirl. It got me past a few of the scenarios in the failing Rspec tests, but not all of them.
Next on the error stack is the missing email method. So, back to work for me.

Thursday, May 1, 2014

Practice Plus A Smidge of Inspiration

Today is the kind of day that I typically wouldn't blog about. (Ed. Every attempt to end that sentence with acting other than a preposition sounded silly, so I left it.) I didn't make the time to code because I had a very high-stakes VIP visitation at work today. The visit did not go well. It could have gone worse but it did not go well and certainly didn't turn out the way I worked so hard to make it. Overall, it has been a depressing day.

I'm blogging because it's a new day. I have no wisdom to impart. Tomorrow will be better, though, so I should have something interesting to say then.

Edited to add: The Complete Flake's Guide to Getting Things Done by Sonia Simone just popped to the top of my Pocket queue. Even if you're not a flake, there are some gems in there and it's definitely worth a look.