tag:blogger.com,1999:blog-69765338207786134102024-03-19T17:35:34.502-05:00Incremental CodeBenjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.comBlogger66125tag:blogger.com,1999:blog-6976533820778613410.post-39471059834179752422015-04-08T23:20:00.006-05:002015-04-08T23:20:57.013-05:00What I learned today! tail -f vs. less +FI know, it's been a while. Truth is, after MakerSquare, things got busy.<br />
<br />
In fact, things are still busy, what with the new (or newish) job.<br />
<br />
But that's why I'm back: because things are going so fast that I want to start recording at least one useful thing I learned.<br />
<br />
(Otherwise, as one developer noted today, it's real easy to look back at your old code and not know what's going on.)<br />
<br />
<hr />
<br />
So today I learned about <code>less +F</code>.<br />
<br />
At work, I use <code>tail -f</code> to follow a file as it changes. So, if I'm running a Unicorn server that has a log file and I want to see what's happening in that log, I <span style="font-family: monospace;">tail -f unicorn.log.</span><br />
<br />
But now, according to <a href="http://www.brianstorti.com/stop-using-tail/?utm_content=buffer13c97&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer">this post</a>, I can use the similar <code>less +F</code>, which both follows the file and allows one to look through the file as normal with a Ctrl-C.<br />
<br />
I also learned that you can <code>tail -f</code> multiple files.Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-50249132969903425532014-12-20T09:00:00.000-06:002014-12-20T18:26:07.034-06:00Word frequency counter in ElixirBefore I got into web/software dev seriously, I was pretty serious about literary analysis. (Ask me sometime about how pregnancy and history work in Edgar Rice Burroughs's <i>Princess of Mars</i> and Ursula K. Le Guin's <i>Left Hand of Darkness</i>.) And these two loves came together a few years ago in a new-ish field called "digital humanities": the crunching of literary data with computers. <br /><br />For instance, we could go through an entire writer's work and see what words got used most often--or not at all. (Fun <a href="http://arkhamarchivist.com/wordcount-lovecraft-favorite-words/">trivia for nerds</a>: Lovecraft uses the word "squamous" only once, which is funny because parodies of Lovecraft love that word.)<div>
<br /></div>
<div>
Which is a long intro to explain why I like writing word-frequency counters in new programming languages. So, to count words in Elixir, you could use this:<br /><ol>
<li>defmodule Words do</li>
<li>@doc """</li>
<li>Count the number of words in the sentence.</li>
<li>Words are compared case-insensitively.</li>
<li>"""</li>
<li>@spec count(String.t) :: map()</li>
<li>def count(sentence) do</li>
<li>sentence</li>
<li>|> prep </li>
<li>|> count_words</li>
<li>end</li>
<li><br /></li>
<li>defp prep(sentence) do</li>
<li>sentence</li>
<li>|> String.replace(~r/([^\w-]|_)+/u, " ")</li>
<li>|> String.downcase</li>
<li>|> String.split</li>
<li>end</li>
<li><br /></li>
<li>defp count_words(words) do</li>
<li>Enum.reduce(words, Map.new, </li>
<li>fn(word, map) -></li>
<li>Map.update(map, word, 1, &(&1 + 1))</li>
<li>end)</li>
<li>end</li>
<li><br /></li>
<li>end</li>
</ol>
<div>
<b>Commentary</b>: @doc and """ are for heredocs. Now if I type "h count" into the terminal, I'll get back that info.</div>
<div>
<br /></div>
You'll also note two things: (1) the program is written with two helper functions, in classic modular fashion (and these functions are defined with defp, which makes them private functions, only call-able by functions within the module); (2) Elixir uses pipes (|>) as a way of handling and handing off data. And I love pipes. </div>
<div>
<br /></div>
<div>
Check out prep, a pretty straightforward way to prep a sentence for counting (with line numbers to help follow): </div>
<div>
(14) it takes the sentence; </div>
<div>
(15) runs it through a regex replacer to get rid of anything that isn't a word; </div>
<div>
(16) then runs that new string of just letters through the downcase function; </div>
<div>
(17) then runs that newly downcased string through a split function, which works like all split functions seem to work, taking a string and returning a list of strings. </div>
<div>
<br /></div>
<div>
Now, if I wasn't piping, I would have to include the parameter, like</div>
<blockquote class="tr_bq">
String.split(sentence)</blockquote>
<div>
But when piping, the first parameter is assumed to be whatever is piped in. Now, without piping, I could write this sequence of functions pretty easily, and it would look like this:</div>
<div>
<br /></div>
<div>
String.split (String.downcase (String.replace(sentence, ~r/([^\w-]|_)+/u, " ")))</div>
<div>
<br /></div>
<div>
Which I can read, but which is a little less intuitive, because you have to read it backwards, with every left-side function taking as parameter the output of the right-side function. Yuck.</div>
<div>
<br />Then we get to the heart of the word counter program, the count_words function. This function is doing something interesting--and wasn't my first version of this.<br /><br />My first version:<br /><ol>
<li>defp count_words([], acc), do: acc </li>
<li>defp count_words([head | tail], acc) do </li>
<li>quantity = Map.get(acc, head, 0) </li>
<li>acc = Map.put(acc, head, quantity + 1) </li>
<li>count_words(tail, acc)</li>
<li>end</li>
</ol>
My first version was a fairly standard tail recursive function that went through the list, calling itself until the list is empty. When the list is empty--i.e., when line 1 is called because the first parameter matches the empty list []--it returns the accumulator. If the list is not empty, it processes the word in a pretty standard way: words and values are saved in a map (which is a key-value structure like a Ruby hash), so I pull the old quantity from the map and then update the map with the new quantity for the word.</div>
<div>
<br /></div>
<div>
So let's look again at the second (or third) version:</div>
<div>
<br />Second version:<br /><ol>
<li>defp count_words(words) do</li>
<li>Enum.reduce(words, Map.new, </li>
<li>fn(word, map) -></li>
<li>Map.update(map, word, 1, &(&1 + 1))</li>
<li>end)</li>
<li>end</li>
</ol>
<div>
So, the heart of this is still a Map function; here, we call Map.update with the map to be updated (map); the key to be updated (word); the initial value to be used if the key is not found (1), and a function that tells how to transform the value if the key is found ("&(&1 + 1)").</div>
<div>
<br /></div>
<div>
We could rewrite that to make it clearer for new Elixir users, like: </div>
<blockquote class="tr_bq">
Map.update(map, word, 1, fn(x) -> x + 1 end)</blockquote>
<div>
But the real magic is Enum.reduce, which does all the work of going through a list until it's empty and resolving all the data in that list into a single structure or value. For instance, a classic use of Enum.reduce would be to sum all the numbers of a list:</div>
<blockquote class="tr_bq">
Enum.reduce([1, 2, 3], 0, fn(x, acc) -> (x + acc) end)</blockquote>
<div>
So we have the list to be reduced ([1, 2, 3]); the initial value to use as the accumulator (0); and a function that tells reduce how to resolve all the elements of the list into a single value ("fn(x, acc) -> (x + acc) end").</div>
<div>
<br /></div>
<div>
(P.S. That's the long way to write the function, which I did to make the action clear; i.e., we take two parameters, the element of the list (x) and the accumulator (which starts at 0), and we add each of them. The really short way to say that would be &(&1 + &2). Awesome.)</div>
<div>
<br /></div>
<div>
So the Enum.reduce in this function takes the list of words; accumulates it in an empty map; and the function that it uses to resolve the list into the map is ... the Map.update function that adds one to the value of the word each time it finds that word.</div>
</div>
Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com2tag:blogger.com,1999:blog-6976533820778613410.post-68923379419741190892014-12-13T09:00:00.000-06:002014-12-13T09:00:05.365-06:00Shiny new computer, cruddy old flu, fun new Fizzbuzz in ElixirI just updated my LinkedIn profile, so I might as well update you here: my new job is as a junior developer at Clutch Analytics, the digital invention arm of Windhaven Insurance. And this last week was my first week there.<br />
<br />
Which makes it the perfect week for me to get the flu. Ah well, that's only tangentially related to coding, so I'll leave it at this: a slight fever might, occasionally, be helpful when studying a new language.<br />
<br />
Another issue that's only slightly related to coding, but which I have to bring up here for other junior developers--especially those who come straight out of school without much work experience: starting a new job involves a lot of logistics, including filling out paperwork. (Note to self: fill out paperwork this weekend.)<br />
<br />
So now I have a new(er) computer, set up with my preferred configuration; the lingering effects of a flu; some health insurance paperwork to fill out; and some fun Elixir challenges. To that end, I've (thank god) gotten back to committing to my Github, which has a new repo for Elixir challenges. The first, of course, is <a href="https://github.com/benjaminjb/Elixir">Fizzbuzz</a>.Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-8341574711518997552014-12-06T09:00:00.000-06:002014-12-06T09:13:59.373-06:00Elixir Week, Day Five: Not quite as Elixiry as expectedWhen I titled my last blog post "Day One," I thought I would do a little Elixir each day and report on the fun things I found--<br />
<br />
like the difference between case and cond;
or how the h before a function name actually gets the documentation from the code file<br />
<br />
--but since this week was also my last week home before moving to Austin, I've had quite a few other things to do. Like find a place to live and shower my dog with affection in the form of walks.<br />
<br />
And also look through some Tom Green Country library books. In the future, I will create a page just for the books I've read, with some notes, both general and specific.<br />
<br />
For instance, I read that O'Reilly book on <i>Version Control with Git</i>. (I do love to see which animal gets which book: Version Control is a bat.) So the general remark might be: "In-depth look at Git, more than really necessary for daily use. Excellent chapter on merge control." And some specific remarks might be "Use rm command."<br />
<br />
(For some reason, I've never had reason to rm a file from my git index.)<br />
<br />
And about <i>Learning JavaScript Design Patterns</i>, I'd probably say "Get it for the MV* chapter; though some of the other material feels a little too abstract if you're not trying to apply it to project; and some of it feels a little too concrete if ditto. Not an introductory book to design patterns."<br />
<br />
But that seems to be the way with computer books, I find: there's a lot of danger that they'll be too abstract or too concrete or too in-depth for what you need right now.<br />
<br />
So, you read any good books lately?Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-7599555960311043792014-12-02T09:00:00.000-06:002014-12-02T09:00:03.358-06:00Elixir Week, Day One: books and just-in-time-learningIn a week, I start work at my first engineer/developer job; and so, while I'm trying to wrap up some other projects (including purely logistical (i.e., boring) projects having to do with transportation and shelter, ho-hum), I'm also trying to do some prep work for that job.<br />
<br />
Which involves getting myself up to speed on Elixir, a functional, concurrent language built on top of the Erlang Virtual Machine. (Shout out here to my 10+ year old comp sci class for covering virtual machines. Of course, we couldn't cover Elixir back then, since Elixir is only 2 or so years old.) And so, I'm declaring the first week of December, Elixir Week.<br />
<br />
::fanfare::<br />
<br />
<b>Elixir Week, Day One</b><br />
<br />
Thankfully, I had no trouble installing Elixir with just <code>brew install elixir </code>on my MacBook, which nicely installed Erlang as well. I've seen so many hours gets eaten by some seemingly simple step that I'm always thankful when this first step goes smoothly.<br />
<br />
(If it doesn't for you, there's a few different methods for installing Elixir, some more involved than others, and hopefully one will work for you. See <a href="http://elixir-lang.org/install.html">here</a> for installation instructions.)<br />
<br />
And so I could dive right into the official (I guess) <a href="http://elixir-lang.org/getting_started/1.html">Getting Started</a> guide for Elixir, which starts, as most guides do, by talking about basic types, like integers, strings, and atoms.<br />
<br />
Er, what's an atom? In Ruby, we'd call it a Symbol, but the Elixir guide goes on to define an atom:<br />
<blockquote class="tr_bq">
Atoms are constants where their name is their own value.</blockquote>
And already I know this is a language that Jorge Luis Borges would love. There's a lot more in that getting started guide, but I just want to point out (for myself) some things that will be useful to remember.<br />
<br />
> When talking about a function, the convention is<span style="font-family: monospace;"> name / arity</span>, where arity is how many parameters it takes. So:<span style="font-family: monospace;"> IO.puts/1 </span>refers to a function (IO.puts) that takes one parameter.<br />
<br />
> To get help about a function, type <span style="font-family: monospace;">h </span>and then the function name/arity.<br />
<br />
> Elixir data types are immutable. (Not news, but something I'm going to need repeated.)<br />
<br />
<b>Books and JIT learning</b><br />
<br />
Reading up on Elixir is fun, but reading about a language is, let's say, only the first step in getting to know a language. Trust me: I used to pronounce "awry" as "aw-ree" because I only ever saw it in books.<br />
<br />
I'm not sure if there's an ideal way to learn a language; it probably differs for everyone. For me, I like a little abstract learning and a little getting-my-hands-dirty in equal measure. So while I've been reading the Getting Started guide, I've occasionally turned to my Elixir terminal and tried a few things. "Oh, I can do a boolean AND like this--but can I do it like this?"<br />
<br />
Which is to say that I'm a big fan of just-in-time learning. I can pack my head full of data about a language, but they only start to become real information when I put it into practice. (Or: fail to put it into practice. That's a teachable moment right there.)<br />
<br />
And that's why I have a complicated relationship with many coding books. Give me a book with some coding challenges interspersed and I'm pretty happy. Don't--and I won't be. Which is why right now, while I'm in San Angelo, I'm flipping though a library book on Git. It's not a deep dive into all the mechanics of Git. (Do I really need to know the history of Git to do my job? Probably not.) But it is one of those aforementioned projects that I'm trying to wind down before work starts.Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-77881884685618230022014-11-30T09:00:00.000-06:002014-11-30T09:00:01.374-06:00Post-MakerSquare, Week Two: Keeping your code sharp--and, oh yeah, about that job searchHow do I not have just a plain jane "Coding" tag? Anyway, welcome to the tag family, "Coding"!<br />
<br />
And I want a "Coding" tag here because I want to talk about a website that I have fallen in love with recently: exercism.io.<br />
<br />
It is very much like those other websites where you get coding challenges, e.g., CodeWars, Project Euler, etc. (which I also like). That is, the goal of Exercism.io isn't to build any project (which I still maintain is the best way to really get into the nitty-gritty of a language), but merely to play around with a few challenges.<br />
<br />
I especially like how Exercism.io keeps everything real clean and focused. Rather than running a test online (and oh, how online tests have given me heartache), you run the tests on your computer--as you would normally. Exercism.io also has a nice breakdown of various languages, so that you can try only the Ruby challenges or the Clojure challenges; and after you submit one solution, you can fetch the other. (The interface is not unlike Github, which is another reason I like it.)<br />
<br />
And then, best of all, you get some commentary and feedback on your code. Because, sure, my DNA/RNA transcription agent worked, but the real benefit of using this is I have now discovered a new method--String#tr--that I never used before and wouldn't have used if I hadn't seen someone else use it.<br />
<br />
So, if you want to practice a new language or keep an old language sharp, I recommend at least looking at Exercism.io<br />
<br />
***<br />
<br />
And about that job search, I've been offered and accepted a junior developer position. So I'm off the market for now; and very excited about starting in early December. I will say more about the job and the company--after I reread my NDA and figure out what I can say.<br />
<br />
For now, my new challenge--both for fun and for work--is to learn functional coding. Come on, O'Reilly books, don't fail me now!Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-60617152835259806842014-11-23T09:00:00.000-06:002014-11-23T09:00:04.442-06:00Post-MakerSquare, Week One: Don't be so apologetic on the job search (plus bonus FizzBuzz)"So, one note for you," said a mentor, after I went through a mock technical interview, "is: Stop being so apologetic."<br />
<br />
Which really might be the centerpiece of why I don't love interviewing. I mean: I love talking to people, I love asking questions, I love answering questions. God help me, I even love coding challenges. Ask me to do FizzBuzz in one line, please!<br />
<blockquote class="tr_bq">
Sidebar: How to do FizzBuzz in one line:<br />
<br />
(1..100).each {|num| num % 3 == 0 && num % 5 == 0 ? (puts "FizzBuzz") : num % 3 == 0 ? (puts "Fizz") : num % 5 == 0 ? (puts "Buzz") : (puts num) }
<br />
It's not pretty--or really all that maintainable--but it works in one line. (Note: tested on repl.it; and inspired by a Paul Irish post.)
<br />
Let's break it down:
<br />
<ul>
<li>1..100 -- standard Ruby for an inclusive range</li>
<li>each -- loop over each element in the array/range and slip it into the following block</li>
<li>followed by a cascade of ternary conditionals <ul>
<li>if it's divisible by 3 and 5, put "FizzBuzz", and if not, then </li>
<li>run through the next case (divisible by 3) and if that doesn't work,</li>
<li>run the next case (divisible by 5), and if that doesn't work</li>
<li>just put the number already</li>
</ul>
</li>
</ul>
</blockquote>
But I don't love selling myself. When I'm discussing my projects and my web dev foundation, it's pretty tempting for me to pick at the issues or the lessons (i.e., the mistakes that I made). Largely that's because of where I am in my career--just beginning, with plenty to learn and a big hunger to learn it. I mean, I really liked the early hackathon project we did, but weeks later, I can see some of the holes there.<br />
<br />
Looking at those holes can be very educational and even rewarding. ("Look, ma, I'm learning!") But they don't always make the best interview discussion.<br />
<br />
So, dear mentor, I'm going to try to be less apologetic during interviews.<br />
<br />
And wouldn't we all rather talk about FizzBuzz anyway?<br />
<br />
P.S. For actual information about my job search--well, I'm not going to get into details. Suffice it to say, I'm concentrating on Austin right now, with an eye cast on Chicago; I'm looking primarily for, let's say, middle-end to back-end--anything below HTML/CSS, which I can do, but don't enjoy as much. I've got some leads and had some positive interviews, so I feel OK. But I'll be 100% honest with you: I'd much rather be coding than searching for a job.Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-18221082799413606762014-11-15T09:00:00.000-06:002014-11-15T22:26:37.673-06:00MakerSquare Day 58: And so it begins... or ends... or ends and begins. Or maybe just goes on (12/5)So, today was our last official day at MakerSquare, and after some teary-eyed goodbyes, it became clear that a lot of people will probably be around on Monday.<br />
<br />
Because even though we're done with one step--the immersive, 12-week course--we've got a lot more to do, both in terms of our development as web developers and in terms of our job search.<br />
<br />
That said, I think it's important to take a moment to appreciate how far we've come, both individually and as a group. I remember back to our first day--well, I don't have to remember it, I can just point to my blog post about it <a href="http://incrementalcode.blogspot.com/2014/08/makersquare-day-1-we-are-your-seat-belt.html">here</a>. Back then, we were told to parse a list and the class largely responded with "what a what now?" We were told to model a recipe and I thought about striking a model pose.<br />
<br />
Well, OK, maybe we weren't that clueless, but we were pretty close.<br />
<br />
And now, after 12 weeks of constant and steady work, all of us had several projects that we could show off pretty successfully. Many of us have already posted about our projects (on reddit and elsewhere) or posted our projects online for everyone to use (more or less). We have portfolios.<br />
<br />
Some of us even have interviews and contacts; and all of us have pretty good prospects for the future.<br />
<br />
So, I have a bunch more to do today and beyond, and I fully plan to keep up with my blogging. On a more limited scale of course. As we move away from the daily blog, with me memorializing my time at MakerSquare (for potential and actual students to check), I hope to transition more into helpful bits of code I've discovered or made; and a record of projects that I'm working on.<br />
<br />
I hope the last 12 weeks of blogging have been helpful or interesting. The last 12 weeks have been both for me.<br />
<br />
Also, one last comment about our last day: a week ago, a classmate of mine said that we should have a high-five graduation ceremony, where everyone got to play one song and go around the room high-fiving everyone. At first, I wasn't sure about this idea: is that really how we wanted to go out?<br />
<br />
So let me offer this advice for you: if someone asks you if you want to play a song that's meaningful to you and high-five everyone after working really hard for 12 weeks--you say yes.<br />
<br />
(For those interested, the songs ranged from triumphant for finishing the course; to hopeful for how we're going to get better at this; to joyful. I can't help but jump to Icona Pop's "I Love It," which was one of the songs on repeat during my finals weeks.)Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-26868353737328142212014-11-14T09:00:00.000-06:002014-11-15T22:26:30.770-06:00MakerSquare Day 57: Open House: The real short version (12/4)<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhExeorvxdi8vOiHLGwkR_a2kOlq1kNLB-AQD14DbhtAUWjikW78kiwy3Vtb4PVaB0pjRtKLQRMBTHgAl3fq_o5A6BwoYFRHIQoHyW2DFCm32LCdGiosTLlKusRCZwy86FsuWP50Ybsu5I/s1600/Photo+on+11-14-14+at+8.25+AM.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhExeorvxdi8vOiHLGwkR_a2kOlq1kNLB-AQD14DbhtAUWjikW78kiwy3Vtb4PVaB0pjRtKLQRMBTHgAl3fq_o5A6BwoYFRHIQoHyW2DFCm32LCdGiosTLlKusRCZwy86FsuWP50Ybsu5I/s1600/Photo+on+11-14-14+at+8.25+AM.jpg" height="213" width="320" /></a></div>
<br />
And a good time was had by all. I'll have more to say when I've collected my thoughts, but the slightly longer version of the real short version is--I talked to some people. Everyone was nice. People seemed to like my projects.<br />
<br />
And now, time to get some rest.<br />
<br />
Just kidding: now I want to read a book about Scala and functional programming.Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-22415841053525371562014-11-13T09:00:00.000-06:002014-11-15T22:26:19.230-06:00MakerSquare Day 56: The short version (12/3)For those of you who aren't going to make it to the open house tomorrow, I wanted to present a short, bullet-pointed version of things I may talk about. (It's OK, it's supposed to be terribly cold tomorrow, I get it if you can't make it.)<br />
<br />
OK, so maybe this is just 15 minutes of me trying to articulate this stuff that I've been working on for a while. Starting with...<br />
<br />
About me:<br />
<br />
<ol>
<li>My career(s) and interests have taken some left and right turns, though you'll see a lot of themes running through--</li>
<li>People: <b>I like working with people</b>, I like working out problems with people in discussion, my dissertation was going to be on groups of people working together. Heck, even improv is primarily around being a good teammate. (And, though this is my professional blog, let's add here that I moved from Chicago to San Angelo, TX because my girlfriend got a job there. That too is about my love of people--or at least my love of one particular person.)</li>
<li><b>I like paying attention to detail</b>--and I can tell you at length how close-reading in literature or paying attention to your improv team is a lot like double-checking your code before shipping it.</li>
<li><b>I like innovation and experimentation and getting better all the time.</b> And here's the part where I kind of have to slag on my grad school experience. Not that English departments don't like innovation in certain ways, but those ways are somewhat limited. (Though, again, I can go on about the digital humanities/big data in literature movements.) But in web development, everyone I talk to has some interesting side project or is learning a new language or BUILDING A NEW FRAMEWORK. In a weird way, web development combines my loves of creation and analysis.</li>
</ol>
<div>
About my Chrome extension:</div>
<div>
<ol>
<li>I knew it had to be a Chrome extension since it ran on the back of another site. (Which limits the applicability, but also made it easier to scope the project.)</li>
<li>I spent several days of the development cycle home sick, trying to read up on the subject; but as with most things CS related, reading gives you maybe half of the info--it's usually more informative to just get your hands dirty.</li>
<li>A Chrome extension is a lot like a regular website in terms of stuff in it--HTML, CSS, JavaScript. (You can even put Angular in! Though that didn't seem like a good way to go for my extension.)</li>
<li>But the architecture is very much based on convention rather than configuration: there's a way that things are done and you just have to learn them. So, for instance, content scripts are the only way to affect the DOM, while background scripts are sort of a virtual space where you can pass info from content to the browser itself and the pop-up window.</li>
<li>I played around with the omnibox before deciding on a pop-up interface.</li>
<li>My biggest difficulty was figuring out how to get it to re-run when new tweets get loaded, until I found out about Mutation Observers, which are perfect and new-ish, since they are objects with special methods for watching for changes.</li>
</ol>
<div>
About my ShareCare app:</div>
<div>
<ol>
<li>The idea that I came with, inspired by my experience of sharing responsibility for a dog.</li>
<li>(I even tried to set up and send out a survey inspired by my watching of the Coursera course on Human-Computer Interaction. I did not get a lot of responses.)</li>
<li>My biggest (first) difficulty was exploring some options for tech stacks to use. For instance, I never used Foundation or Bootstrap before, so I wasn't sure which might be better for styling. (I went with Foundation, which I was moderately happy with, except for some bobbles trying to get Foundation and Rails to work nicely together.)</li>
<li>Rails was a lot of fun to work with, in part because it's so smart. You want an AJAX request from a button? Just add "remote: true." You want to separate out your page into modular parts so you can handle each part individually? Let me introduce you to partials.</li>
<li>The second difficulty was thinking about how to best design the database. Just a few days ago I realized I could drop one whole table (Claims) and make the same call by just paying attention to the Task table's "completed" and "user_id" columns. (The lesson, as always: Don't make things more complicated than necessary.)</li>
<li>The greatest lesson of dealing with a big project like this is the modular approach: break it down, and fix one thing at a time.</li>
<li>I probably learned more from this project--both the mistakes and the successes--than any other project.</li>
<li>Also, I have a ton of ideas for how to expand and improve this project. Though as it stands, it fits the need I had of passing info between me and my girlfriend about whether the dog's been fed or not.</li>
</ol>
</div>
<div>
OK, so that took longer than 15 minutes, but it's going to be mighty cold tomorrow, so some Austinites might not make it out.</div>
</div>
Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-53024274626634324392014-11-12T09:00:00.000-06:002014-11-15T22:26:12.899-06:00MakerSquare Day 55: "I have the skills." (12/2)That's my takeaway quote from tonight's alumni panel discussing, well, what it's like to be an alumni of MakerSquare. "I have the skills" was the realization that the alumnus in question had when working out a problem at their job. Maybe they didn't have the <i>knowledge</i>, per se; but from their time at MakerSquare they had the skills to find the answer.<br />
<br />
Though today's panel was only a few hours of the day, with that sort of positive message, it certainly left something of a influence. Or maybe that's just how it is when people share their horrible interview stories.<br />
<br />
(Although, is it wrong that every time I hear an interview story involving a coding challenge--like "reverse a string in JavaScript"--my brain always stops for a moment while I work out how I would do that? I guess the lesson here is, if you need to distract me, give me a fun coding challenge.)<br />
<br />
(Also, it's a lot easier to laugh at horrible interview stories when the people are not employed and happily so.)<br />
<br />
But really, today was spent doing a rather large amount of tasks. Is there anything better than crossing tasks off your task list? I don't think so, which is probably why one of my final projects is all about creating tasks and then marking them as done.<br />
<br />
I also realize that I've been talking very vaguely about my final projects and about things I've learned. Well, OK, I did write about how to make a Chrome extension, both <a href="http://incrementalcode.blogspot.com/2014/11/makersquare-day-49-how-to-make-chrome.html">in general</a> and <a href="http://incrementalcode.blogspot.com/2014/11/makersquare-day-50-how-to-make-chrome.html">in particular</a>.<br />
<br />
But what about Rails, which is what my ShareCare app uses? What about Foundation and HTML and CSS and JavaScript? (OK, not I'm just listing my tech stack.)<br />
<br />
I'm coming to the end of my allotted 15 minute writing time, so I won't be able to get into all of that today. But I will say this: one thing that I've learned through my weeks here is that documentation--even the littlest bit--can make a huge difference. When I go to find a Gem to do something and there are several out there (there's a lot of overlap among Gems), I tend to choose the one with the best documentation.<br />
<br />
Which is why I spent so much time this week working on my Github README files and that's today's lesson: good documentation includes a clear README.Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-22356313021806192012014-11-11T09:00:00.000-06:002014-11-11T09:00:04.971-06:00MakerSquare Day 54: Wherever you go, there you are. And your code is there too! (12/1)We're coming down to the wire here. And as much as I want to look up where that phrase comes from--something about horse-racing, maybe related to a photo finish? or maybe something related to barbed wire and trench warfare in World War I?--I feel a little too busy.<br />
<br />
I would love to slow down a bit and tell you all the stuff I'm learning and trying. "Learning" includes a lot of trial and error, so I'm learning a lot with my final projects.<br />
<br />
Of course, one of the things I'm learning a lot about is me. (Also: Rails and Foundation.) Which reminds me that, a few weeks ago, while the full-time MakerSquare students were filing out and the part-time students were filing in, I made a joke of the form, "I thought I was learning about JavaScript, but I was really learning about myself."<br />
<br />
(If I had had more time to think about it, I might have gone with a Russian reversal joke: "In America, you learn about JavaScript, but in Russia, JavaScript learns about you.")<br />
<br />
Besides getting a laugh (which is the point of jokes, right?), it seems that I might have accidentally said something truthful there (which is the <i>real </i>point of jokes, right?).<br />
<br />
I mean, working on final projects is a reminder of everything good and bad about yourself. I like working in teams or at least talking through ideas with other people. (Brainstorming for other people is one of my favorite things. What do you need? A title? An app idea? A villain for your superhero RPG? Whatever it is, I want to brainstorm with you about it.) So working on a project all by myself--not my ideal situation.<br />
<br />
Similarly, I love doing research before attempting something; but, at least in this situation, I've learned a lot by just getting in there. As I learned as a kid, breaking something is one of the best ways to learn how it works and how to fix it (and how to run faster than my older brother). So that day that I spent reading the docs for Foundation wasn't any more helpful than the hours I've spent wrestling with putting that into practice.Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-53654474402287154022014-11-08T09:00:00.000-06:002014-11-08T09:10:07.541-06:00MakerSquare Day 53: Incremental (11/5)I named this blog "Incremental Code" for the best reason of all: brand consistency. Either that or a lack of ideas.<br />
<br />
See, my other blog--the one where I talk about movies and books (mostly)--is called <a href="http://incremental-catastrophe.blogspot.com/">Incremental Catastrophe</a>. Which is a name I chose years ago to capture that feeling of sudden and irreversible upheaval happening very slowly.<br />
<br />
So when I started this blog to focus on my MakerSquare time*, I went through a few ideas about what to name it before deciding that "Incremental Code" was, you know, <i>good enough</i>.<br />
<br />
Which is how I've discovered that "Incremental Code" is the perfect name for a blog about coding for me.<br />
<br />
MakerSquare's program is accelerated; and there have been times when my knowledge of these issues has gone up sharply. And there have been times when I've felt my knowledge increase barely. But if you were to draw a line of my learning, it would, overall, average out to a very reasonable, incremental increase.<br />
<br />
Which is, coincidentally, how I would describe my coding process. Sure, there are times, usually in the shower or when falling asleep, when I am hit by sudden inspiration about how to solve some problem.**<br />
<br />
But most of the time, I get the work done by sitting in a chair and doing the work. (That's a lesson I take into coding from my time working on fiction.) You move the code forward every day; and even an incremental process can result in a big step forward.<br />
<br />
*Note to future MakerSquare students: writing every day may not be for everyone. But I would set yourself some schedule and stick to it. If you say, "I'll just write when I have something to say," you'll never write.<br />
<br />
If you say, "I will write every week to summarize what I've learned," you'll find--magically--that you do have something to talk about every week. It's almost as if--as if!--putting your butt in the chair and getting to work can be productive and inspiring.<br />
<br />
**Of course, that sudden inspiration only happens because I've been steadily working on that problem before the shower/sleep. Again: incremental.Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-83311712117660567312014-11-07T09:00:00.000-06:002014-11-07T09:37:13.131-06:00MakerSquare Day 52: Ask and ye shall receive, time permitting (11/4)I'm inspired by this recent week, when I really worked on my skills in one particular area: asking questions.<br />
<br />
See, I've always been of the "let me try this for myself" bent. And I still am; but when it comes to web development, I've gotten better about setting myself a time limit. "Let me try this for myself--for a half hour."<br />
<br />
And when that half-hour is up, I go find a peer or an instructor to talk through the issue. Thanks to that half-hour I spent, my questions are less like "Help!" and more like "I'm trying to do X; I've already tried methods Y and Z and wrapped all the way around to A." So really, I'm glad that I try to do things myself.<br />
<br />
But I'm also glad that I've gotten more comfortable asking questions about this.<br />
<br />
I'm also glad that I've gotten more comfortable asking people for help. For instance, I reached out to someone who came to speak to us the other day, and he graciously offered to talk for an hour on the phone about some questions I had.<br />
<br />
That's just one very concrete example of how, if you ask, sometimes you get what you need.<br />
<br />
So, inspired by this last week, I wanted to ask you: do you have any questions?<br />
<br />
<br />Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-10357218821689690752014-11-06T09:00:00.000-06:002014-11-06T09:00:08.082-06:00MakerSquare Day 51: "You don't know what you don't know." (11/3)<div>
A very short blog post today--please, contain your disappointment!</div>
<div>
<br /></div>
<div>
I realize I didn't tell you my plan for this last week before our open house: having finished (for now) with my Chrome extension, I'm going back to my first project, Sharecare, which was really in not the best state.</div>
<div>
<br /></div>
<div>
Which is a shame for a few reasons: reason one, I would actually like something like ShareCare. (And yes, I'm inconsistent with my capitalizations because I haven't decided yet; tonight, I am leaning towards the camel case of "ShareCare.")</div>
<div>
<br /></div>
<div>
Reason two, the closer we get to our graduation, the more we're talking about the upcoming job search. For instance, today we had two lectures by outside consultants: a HR person and a VP of engineering. Which made for a very interesting day, if not totally coherent.</div>
<div>
<br /></div>
<div>
I mean, the HR person might be one of the first people to see our resumes: he's the guy who decides whether our resume goes forward after that first brief glance. (Note: Not <i>him</i>, exactly; he's pretty high-powered.) So he's looking for a certain set of skills on paper; and then, in a behavioral interview, he's looking for a human being to fit a human-shaped hole in the company.</div>
<div>
<br /></div>
<div>
By contrast, the VP of Engineering might not see our resume at first; but he's not only going to be weighing in--and weighing heavily--on whether we've got the actual technical and human skills to fit in with the company on a day-to-day basis. Ultimately, if we get hired, we might not see the HR person, but we'll be working with the Engineering person.</div>
<div>
<br /></div>
<div>
So these two people come to the task of interviewing with a slightly different set of perspectives.</div>
<div>
<br /></div>
<div>
But--and here's my English grad school education to the rescue--I can see the patterns of similarity that run between these two widely disparate views. (If I were writing an English paper, I might call these "themes.") They may differ on some details, but the core advice is mostly what you hear about interviews: be the best version of yourself.</div>
<div>
<br /></div>
<div>
On top of that, both speakers hit the notion that informs today's title: at this stage in our career, we may have some ideas about what we want to do, either technology-wise (front- vs. back-end) or field-wise. But we don't know what we don't know, so we should also think about being flexible, not getting too tied down to any fantasy of what the right job would be for us. The right job might be something we don't even know about.</div>
Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-6084439804872684382014-11-05T09:00:00.000-06:002014-11-05T09:00:04.748-06:00MakerSquare Day 50: How to Make a Chrome Extension, For Real This Time (11/2)<br />
<ol>
<li><b>the manifest.json: </b>This is what makes the Google Chrome extension. This json file keeps track of everything you want to give this extension: all the permissions you give about what Chrome APIs it can access; all the files it has--background, popup, and content; and information about where the extension can run.</li>
<li>a <b>background </b>file, either background.html or background.js: a background file is basically a pretend page--something the user never necessarily sees, but that helps organize all the other files; if you like visual metaphors, I think of the background as a highway interchange in my app: nothing happens there, but it's a useful nexus for talking between the other files (and also between Chrome itself--the background.js is what tells Chrome to show the little icon).</li>
<li>your <b>popup files</b>, if you have any, often a standard mix of HTML, JavaScript, and CSS: many Chrome extensions have little icons and when you press that icon, you get this little popup window. That window is basically a little webpage: mine has HTML to tell what to show, some CSS to tell how to show it, and a lot of JavaScript to tell how it should behave.</li>
<li>a <b>content script</b>: this is not necessary for all Chrome extensions, but is the only way you can have a Chrome extension directly affect the DOM of a particular webpage. So, I can make a new tab and go to a URL with a background file; but if I want to affect that page once I load it, I need a content script.</li>
</ol>
<div>
So if you have all these different parts, how do we get them to work together? Here's a few remarks on my Chrome extension (still available <a href="https://github.com/benjaminjb/twitterblocker/">here</a>):</div>
<div>
<br /></div>
<div>
Basic background: to pass messages between these elements, you need to use a pair of functions--a sendMessage and an onMessage function. So, for instance, when you go to Twitter, my content script runs--because that's what the manifest.json tells it to.</div>
<div>
<br /></div>
<div>
My content script includes this</div>
<div>
<div>
<ol>
<li>chrome.runtime.sendMessage({}, function(response) {</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>storage.get('banned', function(blockedWords) {</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>var tweets = $('li.js-stream-item');</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>runBlockedWords(tweets, blockedWords.banned);</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>});</li>
<li>});</li>
</ol>
<div>
Line 2 here gets something from chrome.extension.storage.sync (which I aliased to the variable storage because I thought I might want to change it to chrome.extension.storage.local). And notice that the storage extension function here involves a callback--because almost every chrome.extension function involves a callback.</div>
</div>
</div>
<div>
<br /></div>
<div>
So we get an object from storage and we call that object blockedWords; but that object itself has a key named "banned"--which is why Line 4 involves blockedWords.banned, which is the value of "banned" inside blockedWords.</div>
<div>
<br /></div>
<div>
Also, note that this is the content script, so I can use jQuery to directly affect and access the DOM. In this case, I'm grabbing all the tweets that match li.js-stream-item--which is all the tweets currently visible.</div>
<div>
<br /></div>
<div>
Now, on the other side, in my background.js, I have</div>
<div>
<div>
<ol>
<li>chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {</li>
<li> chrome.pageAction.show(sender.tab.id);</li>
<li> sendResponse();</li>
<li>});</li>
</ol>
</div>
</div>
<div>
Line 3--as I understand it--sends a response message, which ends that message cycle. As you see, I don't have any actual message to send back, so I'm just sending an empty response.</div>
<div>
<br /></div>
<div>
Line 1 is the important part: it listens for a message. From where? From anywhere, I think. It just so happens that background.js will only hear a message when content.js sends a message--and that will only happen on Twitter.</div>
<div>
<br /></div>
<div>
That's important for Line 2, which is where I tell the browser to show the icon for the Chrome extension--but only on the page that sent the message (sender.tab.id).</div>
<div>
<br /></div>
<div>
And that's how I made (at least part of) my Chrome extension.</div>
Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-75381022843346215302014-11-04T09:00:00.000-06:002014-11-04T09:00:06.563-06:00MakerSquare Day 49: How to Make a Chrome Extension (11/1)This isn't step-by-step instructions for making a Chrome extension. It's not even step-by-step instructions for making the Chrome extension that I made this last week, a spoiler blocker for Twitter.<br />
<br />
But yesterday I solved some final problems I had with my Chrome extension, Shush!, and I wanted to make a few notes about the whole process.<br />
<br />
First, writing a Chrome extension is a lot like writing any code. You start with an idea.<br />
<br />
Then, you realize that your idea is way too big.<br />
<br />
There's no way you can, in the time given, make a program that will scrape data from the internet to find out what words are related to what other words, so that it'll know to avoid "#RedWedding" when you tell it you don't want "Game of Thrones" spoilers. It's doable--and I'm still excited by the idea--but it's not part of the week-long project to make a minimum viable product.<br />
<br />
Other things that are the same when making a Chrome extension: your idea of what it should look like or how it should achieve its goal will change--be prepared to change it. Also, and as usual, every project consists of smaller tasks that are immediately solvable. The key to any project seems to be having that dual-minded approach: remembering the big picture, while focusing on the solvable modular bits.<br />
<br />
And, as with writing web applications more generally, one of your biggest resources is things people have already done. There are a lot of Chrome extensions out there--and Google has a nice library of example extensions that just do one or two things; so when you know the specific task you have to solve, it's interesting to see how other people approached it.<br />
<br />
Anyway, it's not <i>finished</i> finished. For one thing, my mentor just pointed out that I should include some contact information on it. But if you're here, that means you know how to contact me, so, if you want to see the rough but functional code, it's up on Github right now: https://github.com/benjaminjb/twitterblocker.Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-90371891816380944382014-11-01T09:00:00.000-05:002014-11-01T14:01:45.093-05:00MakerSquare Day 48: Second week of final projects wrap-up (10/5)This post is going to be shorter than usual (and also a teensy bit late) because (a) my girlfriend and dog are visiting this weekend; and (b) my midweek sickness really knocked my schedule back. (Also, I am not well yet.)<br />
<br />
But I wanted to record something about this last Friday, the last day of our second week, because (1) after a few days of not really being able to concentrate on learning this new technology/pattern/medium (it's hard to know what to call a Chrome extension), I was able to break down the big problem into very modular issues and solve them to my satisfaction. What a difference enough oxygen to your brain makes; and (2) though there was the typical office despair going around, I was really impressed with everyone's work and with the creativity that went into both coming up with a project and fiddling with the details.<br />
<br />
I guess that means I have to make this Chrome extension really good. So I'm off to do that, while sitting with a puppy at my feet.Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-64616759383797248152014-10-31T09:00:00.000-05:002014-10-31T09:00:08.132-05:00MakerSquare Day 47: Maybe locking myself in my room with the disease wasn't such a good idea after all (10/4)I didn't get a lot of work done (or oxygen to my brain) today, which is a little disappointing. (Well, the oxygen thing is slightly more than disappointing.) But it does bring up something--in a round-about way--that I'm not sure I've talked about but which has been on my mind:<br />
<br />
Why did I leave writing for code?<br />
<br />
Well, I didn't really: I still enjoy writing fiction and plan to continue with it in the future. I just left behind the field of freelance non-fiction writing.<br />
<br />
(Except for blogging, which you may notice I've kept to like a barnacle.)<br />
<br />
As much as I enjoy writing, so much of it is solitary work. And, as I've been reminded by my unintentional quarantine, code can be solitary--but it can also be team-work. Even if you're not in an organized team, you'll find that an open-plan office leads to some interesting cross-pollination.<br />
<br />
At the very least, when I'm at the MakerSquare office, when I hear someone talking about some interesting code--either an interesting solution or an interesting problem--it can sometimes get me thinking about something useful. Or when I run into a problem, there's usually someone around to talk it out, whether the other person provides a solution, a hint, or merely a willing listener while you solve your own problem.<br />
<br />
In writing, that's not so much the case. Don't get me wrong: if you're working on something, you may have people you can turn to, whether it's your writing group or just a friend willing to read something. But there's not really that same sense of team-work and collaboration.<br />
<br />
And that is one reason why I really don't like being stuck at home, sick, right now; and it's one reason why I decided to move into a coding career: I like teamwork.Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-48363654286627081512014-10-30T09:00:00.000-05:002014-10-30T09:00:08.323-05:00MakerSquare Day 46: Hackathon ::cough cough:: (10/3)At MakerSquare, Wednesday and Thursday are given over to a hackathon--late nights, food provided, and lots of coding on the second final project.<br />
<br />
Here at the DevHouse, my Wednesday and (probably) my Thursday are given over to a lot of cold medicine and vitamin C and tea. It's kind of a bummer in the way that minor illnesses during final project weeks are kind of a bummer. I'm supposed to be working my portfolio now, but instead most of my energy goes into getting tea. (Never again will I take my electric kettle--still at home in San Angelo--for granted.)<br />
<br />
Ah well, I guess the only thing I can do now is get better soon.<br />
<br />
That said, during my brief lucid moments--when the cold medicine kicked in--I did find an interesting tutorial <a href="http://minimul.com/modify-an-existing-page-with-a-chrome-extension-built-using-angular-and-yeoman-part-1.html">on using Angular in a Chrome extension</a>.Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-80677881462298329422014-10-29T09:00:00.000-05:002014-10-29T09:59:40.835-05:00MakerSquare Day 45: Final project #2 -- but really home sick (10/2)I went home early on Tuesday, since I've caught that cold that's going around. (Or at least, that my housemate has.) So this'll be a short post, with the sound of me sniffling and coughing in the background.<br />
<br />
Luckily, Tuesday was the first day of our second final project, and I've chosen a manageable project right now / for once: a Chrome extension that will block spoilers on Twitter.<br />
<br />
So I didn't get that much done on Tuesday since my primary goal for the day was to always have a hot tea with me at all times. But right now, here's the minimum viable product plan, some notes on my progress, and some current pain points, along with some extension ideas.<br />
<br />
Minimum viable product:<br />
<br />
<ul>
<li>The user can engage the extension and type in a word or phrase that'll trigger the blocker, e.g., "Game of Thrones."</li>
<li>All tweets with that word / phrase will be hidden (both words and pictures).</li>
<li>The user will be able to show any hidden tweet if they choose to by clicking on the hidden tweet.</li>
</ul>
<br />
Some notes:<br />
<br />
<ul>
<li>At first I looked into grabbing all the children of the container object in the tweet stream:</li>
<ul>
<li>$('ol.stream-items').children()</li>
</ul>
<li>... but then I realized I could just grab the individual tweets directly (and put them into a variable, which I then iterate over):</li>
<ul>
<li>var tweets = $('li.js-stream-item')</li>
<li>for (tweet in tweets)</li>
</ul>
<li>It's not terribly hard to hide the tweets and pictures (though I also thought about other ideas, including detaching the material with .detach() ):</li>
<ul>
<li>$(tweet).find($('.tweet-text')).hide()</li>
<li>$(tweet).find($('.js-media-container')).hide()</li>
</ul>
</ul>
<br />
Some pain points:<br />
<br />
<ul>
<li>Right now, I'm having some trouble putting in a button that'll respond to a user's click to show the hidden tweet. When I put something in the tweet space, it acts like a normal tweet acts when clicked, i.e., it expands.</li>
</ul>
Some extension ideas:<br />
<br />
<ul>
<li>It would be super-neat for this extension to block tweets that had the trigger words, but also to find some related tweets to block. So, e.g., if you put in "Game of Thrones," the extension might also block out certain related words like "Red Wedding."</li>
<li>It would be (slightly less super) neat for this extension to be platform agnostic, so you could block spoilers in, say, Facebook or elsewhere.</li>
</ul>
Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-90338533891677977662014-10-28T09:00:00.000-05:002014-10-28T09:00:00.320-05:00MakerSquare Day 44: A different type of hackathon (10/1)Today we had a hackathon, but not the usual kind. Today was our--<br />
<br />
<b>Resume Hackathon!</b><br />
<b><br /></b>
I'm probably just using bold here to make it sound more exciting. To be clear: the idea of going out on the job market; of going to interviews; of getting my first job in web development--all of that is very exciting to me.<br />
<br />
But writing and revising a resume isn't as exciting as embarking on a lifelong career in a field that I'm kinda crazy about.<br />
<br />
(Have I ever told you guys about meta-programming in Ruby? It's when you write code that then goes and WRITES MORE CODE. As a long time fan of infinite loops, the idea of code writing code makes me very happy.)<br />
<br />
Part of the general (I think) lack of excitement when writing resumes is that resume writing is a lot more cramped than writing code.<br />
<br />
Or rather: if I give you a coding challenge, you could probably think of five ways to code out a solution; and if any way fails, you'll get an error message that tells you how to fix it.<br />
<br />
Man, I love feedback.<br />
<br />
Unfortunately, resumes don't offer the same level of detail in their feedback. You get less "undefined variable" or "stack level too deep" and more "no thanks" and ::crickets::.<br />
<br />
For me, with my big change in career from ex-PhD candidate and education writer to programmer, it's interesting to see how much of my resume is no longer relevant. Although maybe I should leave some of that in. Wouldn't you like to work with a web developer who once taught a class on 19th-century science fiction?<br />
<br />
::crickets::<br />
<br />
(Actually, now that I think about it, I think my teaching experience really does help me with both public speaking and with translating certain concepts into more easily digested forms. So, it's going back in the resume, people! Along with my improv classes at the Second City.)Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-89717415955559912932014-10-25T09:00:00.000-05:002014-10-25T09:00:05.546-05:00MakerSquare Day 43: A very little view of a week's worth of work (9/5)When we did our hackathon, I was in a team of four people; <a href="http://programmingpursuits.wordpress.com/">Kelsey</a> and I had whiteboarded (with our TA Ben's help) the night before and focused on our minimum viable product, with a whole bunch of extension possibilities; and the four of us had pretty distinct responsibilities.<br />
<br />
So when I look at my current project and compare it to my hackathon project, I don't feel terrible that this project is not as advanced. I mean, we had 4 * 2 programmer-days for that, while I've only had 5 * 1 so far for this.<br />
<br />
That said, I'd like to take the focus off of me for a second--just a second, mind--and talk a little bit about the cool things I've seen my peers make. Now, not all of this is ready for prime-time, but I don't think anyone would mind me talking about, for instance--<br />
<br />
A neat little web app for playing pong (all in JavaScript);<br />
The neat front-end design of a recipe box (with some very nicely done CSS);<br />
The figuring out of the interface with Yelp API or Twitter API;<br />
A large content management system service;<br />
A well-constructed financial modeling system;<br />
A way to get info from Steam.com that pays attention to the performance issues;<br />
A front-end only collection of math/science tools with a really nice panel system;<br />
A neat list-sharing app with a great in-place editing system;<br />
The updated and improved version of the hackathon flash card app and the ping pong tournament app.<br />
<br />
Like I said, they're not all done. But when I look back at what my peers have done before and see what we're capable of doing now, I'm very proud.<br />
<br />
Bonus: yesterday we had a meeting with some people from Ivity Labs, an offshoot of SpringBox, including a MakerSquare alum; and today we had a MakerSquare alum from Lou Malnati's in Chicago come by. All of which adds up to this:<br />
<br />
When we started, we weren't that good; now, we're a whole lot better; and with just a little more experience, we have the capacity to be a whole heck of a lot better.Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-42453337872049626842014-10-24T09:00:00.000-05:002014-10-24T09:00:04.484-05:00MakerSquare Day 42: Stone on stone--until ... (9/4)I don't have anything to show you right now. I'm not entirely sure when I will. (There's a possibility that I don't have any website to show you to, but only some screenshots since we build most of our apps on our computers; porting these local "sites" to other sites can be done, but may not be worthwhile at this stage.)<br />
<br />
But rest assured, when you spend several days moving stones, eventually you will have...<br />
<br />
... something resembling a pile of stones.<br />
<br />
That might not sound like much, but I'm actually very excited. Because--and watch this metaphor of stones get extended--sometimes it can feel like you're hitting your head on a stone wall and not accomplishing very much. But sometimes some stones get dislodged with enough hitting. And then you might notice that some stone that you're looking at is actually the perfect shape to rest on this other stone that you just happened to be looking at.<br />
<br />
(I don't want to over-dramatize the importance of happenstance and luck; but if you've spent as much time in libraries as I have, you know sometimes the important book is right <i>next to </i>the book you went to find. Almost the same could be said for coding: you can go research AJAX calls and instead find a cool Ruby gem for editing in place.)<br />
<br />
All you need is time, a head hard enough to survive repeated pummeling, and the will (and curiosity) to keep going on moving stone after stone.<br />
<br />
(To be more--ahem--concrete, today we learned about Promises in JavaScript (which is a way to chain asynchronous calls); and I got my database tables all re-written to do what I know think they should do.)Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0tag:blogger.com,1999:blog-6976533820778613410.post-87779719215458444482014-10-23T09:00:00.000-05:002014-10-23T19:00:53.471-05:00MakerSquare Day 41: Commas; or, Masonry, Part 2 (9/3)Oh, I remembered the joke I was going to use yesterday--and it wasn't actually that good.<br />
<blockquote class="tr_bq">
Oscar Wilde comes into the pub at lunch, looking exhausted.<br />
"Hard morning of work?" asks the publican.<br />
"Yes," says Oscar, "I spent all morning putting a comma in."<br />
Oscar has lunch, leaves, and comes back for dinner, looking exhausted.<br />
"Hard afternoon of work?" asks the publican.<br />
"Yes," says Oscar, "I spent all morning taking that comma out."</blockquote>
There are (as I've said before) some big similarities between comma world and coding world; and, in fact, a lot of today has felt like some version of this Wilde joke. Like:<br />
<blockquote class="tr_bq">
"Oh, I should add in a section on all pages that will be blank unless there's been an error and that section could report the error."</blockquote>
Then, later:<br />
<blockquote class="tr_bq">
"Hey, I just implemented a section for good messages under my section for error messages. Why not just make a section for messages and pass in any messsage--good or bad?"</blockquote>
That's not the only example of an added comma/removed comma shuffle. And I won't lie, I understand why Wilde might be so exhausted after a morning and afternoon wrestling with a comma. He feels--and I feel--exhausted because it is exhausting.<br />
<br />
So why keep doing it? Because Wilde and I are secretly masochists who like torturing ourselves? No. Well, maybe a bit of that. But mostly because this thing that we're so exhausted by--we're making it better by playing with it.<br />
<br />
Alternate possibility: Maybe Wilde just didn't know how to use a comma correctly?Benjamin Blattberghttp://www.blogger.com/profile/03163091516093037765noreply@blogger.com0