Tuesday, December 20, 2011

The long road

It's been quite a long road in my studies so far. Six months ago was when I began learning how to program, and wrote my first script to Secret Santa-ing in Ruby. Three months later, I began working at Animoto as their first Software Engineer intern, taking a chair behind front-end development to refine my skills in html, css, and javascript. After many long days (and to many coming!) I was offered a full time position at Animoto as a front end software engineer. I love my job, and moving to programming and the tech field can easily be suggested as one of the better decisions that's been made in the last few years.

As of now, I don't have much to say about hustling. I'm exhausted, yet in a blissful way, and I think my tech talk from work says it best (beware, it looks like ass in anything but webkit).

Starting in January, we're going to see some changes to the blog that basically got my career rebooted. For one, I'm moving in the direction of data. Thomson Nguyen introduced me to data and R a few weeks ago after my interests moved into the direction of "I want answers for these things," and a handful of coworkers sent data analysis and visualization books to read. The blog content, of course, will now be targeting what I learn over the next year as I hope to make a name for myself this new area of focus. It feels like a good fit--it offers a chance to expose creativity in data manipulation, as well as expressing a passion of data design and modeling. So, I suppose, more on this next year.

Another focus and hope is to move the blog off blogger and over to Wordpress, or rewrite it in more dynamic CMS. This is from a love/hate relationship with blogger. After managing a complete re-haul of the Animoto blog, I'd like to take advantage of what's out there and make something that fits me much more and should (hopefully) be easier to maintain. So, soon we'll be saying goodbye to this monospace font and poor design and trading it in for something more desirable.

Finally, in January, there'll be a four-week feature about computer literacy in public school, including lesson plans that, ideally, would fit best in a classroom that address literacy, like an English classroom. This was something that's been in the back of my mind since I really started getting the hang of reading and writing code, and is a great opportunity for all students to be in a foreign literacy scenario before diving into a traditional text. I'll try to design them around 50-minute classes.

Edit: With the sudden influx of IE users, I'm well aware this blog is incredibly ugly in IE6-8. I'm not going to fuss about this now, but will be fixed with the new blog setup--ideally it will be responsive and ready to take 2012 by storm.

Wednesday, October 12, 2011

Habitual

I had a great idea to develop a simple website that lets you see a sample paragraph with a headline and adjust the various points of typography. I looked around on the internet and didn't see anything so I'll put something together eventually and host it at github pages or the home page.

I think my design aesthetic is improving. It's becoming more apparent what I like and don't like, which is certainly a change from "What is this I don't even--"

Also can't seem to shut off work brain.

Monday, September 26, 2011

Back to "school"

I signed up for the three classes being offered for free by Stanford: Machine Learning, Intro to Artificial Intelligence, and Intro to databases. I started watching the lectures today, even though class doesn't "start" until October 10th.

In other news, my order of Hardboiled Design came in, so I've been digging through that as well as the last two books I am reading on design.

JavaScript learning is slow-moving, but moving, none-the-less. Mostly getting excited about my new job that I start next Monday!

Would love to know if any fellow readers are also taking the online courses that have been publicized on Reddit and Hacker News. I'm pumped for these classes and I hope I can directly apply some of this to my job.

Thursday, September 15, 2011

CSS and SVG

While I'm trucking along on the HTML/CSS process (making mockups all day in illustrator, what what!), this link popped up in my twitter feed from Hacker News.

A Farewell to CSS3 Gradients covers the hate in working with gradients, the messy evolution of CSS, and a quick and dirty introduction to SVG, or Scalable Vector Graphics. I don't think it's end all solution (with the speed of the internet these days, we might as well just save gradients as pngs), but certainly a suggestible alternative.

Little more work to do tonight, maybe some JavaScript fun if I can get around to it. I promised myself I'd fix a JQuery bug by tonight or tomorrow morning.

Friday, September 9, 2011

Web Designer Wall

I'm a big fan of this website.

While the work week ramps up, this page has been really effective in helping me figure out the more advanced things in css, and in turn, creating some really cool experiences (well, I think they're cool) on the web.

Web Designer Wall

Wednesday, September 7, 2011

Short Term Goals

Productive day today. Finally decided to play around with the CSS on the blog. It's not quite the way I want it yet, but it's new and much better than what was there originally.

Few more opportunities arose.

Working with my younger brother to fix up the Citations drum and bugle corps website (aka, teaching him what I know so he can ditch Dreamweaver, and prettying up his designs). It's cool so far. I have much less say in the design, but he's appreciating what I've done so far, like balance out the site to a better grid, clean up the CSS and HTML so it's readable, etc, and I've liked what he's put together too.

Completely redesigned on paper CTDJ. I wasn't happy with the final product that I released to them a few weeks ago, so I went back to the notebook. I think this next design will be much more ideal and a lot more modern.

Finally, working on a structural engineering website for a small firm. I'm really excited for this one because the communication has been solid so far. Also have some really nifty ideas--hoping to maintain and preserve the original website while making it look very portfolio-ish.

JavaScript: Finishing chapter 4 of Eloquent. Realized why I had such a hard time to get through it last time--the examples are nice, but so far it's not very applicable to web design, and I don't think the problems are very clear about where the data comes from, especially since some of it is stored on the webpage without you know what it looks like. Ah well, I'll keep moving forward. It's been easier editing and fixing bugs in javascript already written since it's somewhat easy to follow when formatted okay.

Otherwise, counting eggs sounds good right now.

Night.

Fork Me on Github

Something about this banner always bugs me.


I want to fix it.

Monday, August 29, 2011

Back to JavaScript

I'm getting much more comfortable working around html5 and css3 (I know, behind the times, right?), so I thought I'd spend this week working through Eloquent Javascript. I started it a bit ago, but when the job hunt became much more intrusive to time (as in, frequent interviews and the like), the exercises were put off to the side. Since I'll be working as an intern doing front end development until the end of the year, it makes sense to make JavaScript the language I learn.

Eloquent JavaScript is 14 chapters long, with 2 appendices after. This learning gameplan will be two chapters daily until it's done, then go back and read through the Web Standards curriculum over at Opera for JavaScript, improving my usage with websites.

Next in the book list is Responsive Web Design. I'd like to get to Hardboiled CSS first, but I'm waiting for my hardcopy to come in the mail.

Will try to keep up with the learning part of the blog as I get through the chapters this week. Till then!

Monday, August 22, 2011

Don't Fear the Internet

Since I seem to be in the habit of checking out new tutorials, books, and whatnot, thought this link would be interesting for consistent readers. Don't Fear the Internet is a video-based tutorial designed by Jessica Hische and Russ Maschmeyer to help introduce people to the idea of "the internet" and its composition. The format is plain and simple: weekly videos posted via Vimeo to slowly dive into the world of html and css (and possibly more?). I hope they switch it around so that older videos are located on top, as they should, so that when this gets weeks in, they don't scare off new visitors.
This was shared from Hacker News(HN), so if you frequent them, you probably saw it pop up earlier today.

Tuesday, August 16, 2011

Working.

There's been less time to update the blog because of all the running around that's going on. The about me page was updated today to be a little more in touch with what's happening, particularly the projects that are becoming more of a time consumption.

With that in mind, I finished one book of six to get a fresh look on web design. The next book that was recommended was HTML5 For Web Designers, which was written with HTML5 not being complete in mind. At just under one hundred pages, it should keep me busy for the rest of the week outside of work-related things.

It's been really interesting writing up the code for CTDJ. I've gone through about 4 designs by now, and every time one looks okay, a better one comes up on paper. The plan was to have a workable demo for them by Friday--I'm keeping the current design for now and showing that to them once I work out all the grits.

Thursday, August 4, 2011

Getting around

Learning Python has been interesting so far. I like Zed Shaw's approach (and thus, just like writing the code out all the time to learn), and I'm picking up a few general programming concepts that I hadn't learned before. The biggest thing is importing into the file, writing, etc. This will be more useful once I start exploring the world of code that already exists.

In the meantime, this blog has turned into somewhat of a book review blog. I began reading another book earlier this week called A Practical Guide to Designing for the Web by Mark Boulton. I'm only about six chapters into the book thus far, but at least it's gotten me to go out and buy several different sized notebooks at Muji, which is located north of Canal on Broadway. Boulton reinforced the idea that I should always have something to write in, and while I watch engineers I know do the same and counted all the times I've said, "I wish I had something I could write in right now," it was about time something was actually done about it.

Lastly for today, heypodo.com's index page was finally thrown up. It was coded in an hour or two, and there's plenty of work to still do on it, but it's there and hosted from github.

My goal is to get CT's Most Wanted DJ's website completed by the end of September. I met with the guys a few times so far and things are definitely moving forward. It'll be much easier to get that project rolling once I finish the python book next week.

Monday, July 25, 2011

Productivity++

Trolling through work the last few days, just thought I'd share a few of the things I have done/know I have to do in order to have the best day at "the office."

Sit, or stand. Don't lie down.

Living in Napa was tough. I didn't have a chair to sit in just a futon that was not ideal. I lay down a lot, and that just screams failure. Once I moved to New York, I made sure I either had a) a desk that I could stand at, or b) a chair that is only comfortable with good posture.
Hanging out at the General Assembly can make this difficult with their beautiful (and by beautiful I mean seductive) black couches, but I know it'll be a good work day when I can find a chair or find a place to stand at the bar.

Find a script to get rid of reddit.

I have a ridiculous habit of hanging out on reddit and clicking on imgur links nonstop. There are scripts all over github to disable select websites, so I'm going to turn one on that just says "Problem?" if I attempt to access it. Self-restrain can come later.

Do a warm up.

For now, I do about an hour or so of warm up work each day. Read out of a book and do "write as I tell you to" code; something relatively simple and gets my mind going. It reminds me of when I taught how students complained about doing Daily Oral Language every single day insistent that their writing was "fine", but nonetheless they sucked it up, did it, and after a few months we all slowly began to see improvement. It's a witless activity, but a great reminder that 99% of the errors in code are probably my fault, even to the point that I just didn't copy it correctly. Eventually, I'd like to move onto using this hour to just looking around on github or stackoverflow to learn new code to implement or find questions within reason that I could answer. But for now, I still have a lot to learn.

Make everything on my computer huge.

I started doing this for a couple of reasons. One, as monitors become better and better, the resolution increases, and then everything gets smaller. I'm not getting old, but if I'm reading an ebook online (probably because I was too lazy to take out my kindle, or put the book on it), I like to make the text readable to the point where I'm not squinting or leaning forward--again, something that doesn't promote good posture. On a typical ebook or article, this is at least 2 cmd+'s on Chrome, somewhere between 20-24 lines viewable on a full screen computer. I do the same thing with terminal (2 cmd+'s), and set that to "hacker mode" (pro mode) to contrast the typical black-text-on-white that I see on the web, or even my textmate workables. This all lets me focus more on my work instead of straining to determine where I left off or to find a bug in the code.

Meet someone new.

This I kind of take for granted since I live in New York with 8 million people, but I make it a goal to talk to someone that I haven't spoken to before. This sounds like simple networking, sure, but just a matter of opening my mouth every day for the last two weeks has gotten me two job interviews, plenty of business cards, and chances to meet people I would have never met otherwise.

Work with a goal in mind.

Short term goals seem tame, but any responsible person understands that in order to succeed, you need reachable daily goals. I figured that out the hard way when I would tell myself "I'm going to read these ten articles and then do some crazy stuff with it!" That never happened, and I got frustrated fast. Instead, I'm finding what's doable within a day, getting that done, and taking a break before I try to figure out what my next steps should be.



On that note, I've finished all my CSS review, and what's left on github of my splash page is just garbage. Tomorrow's gameplan: rewrite this from scratch on paper, and start doing the visual designs in inkscape. I'd like to get this page running on just HTML and CSS before I start cruising into javascript land again--or before I implement some anyway.
I also completed the next three exercises in Zed Shaw's book on Python (my current daily warm up). If you haven't checked it out yet, I highly recommend it.

Friday, July 22, 2011

Moving along with Validation

Just a couple things to share today:

HTML review is complete. Probably missing some essentials, but the core is there and I can more on to CSS. Best things I realized:

HTML is all about structure. It should really be all about the framework.
CSS is all about presentation and what I want all this information to look like. The more I break it up with id, class, div, span, the more unique the website can be.
I assume, then, that JS is about interaction. How the website works with the user. This is where the legit coding comes in, and ideally, where I can start using my ruby background to design some really neat things.

Also want to share a couple one page web app links:

Get Skeleton: This is a framework that helps you format a single webpage. All the code you'd ever need.

Node.js Web App: From an up and coming startup founded in New York City (I believe), a founder shares how node can be used to form a solo page for a web app. hij1nx breaks it down fairly clearly--skills coming from his lecturing experience, I think.

Follow my splash page work on github. It's slowly coming along, and I have a much better idea of how to present all this information now. Looking forward to writing all original blog CSS code as well.

Tuesday, July 19, 2011

Interview Week 1 Completed

Just finished the last job interview I had lined up of several since last week. There are two hopefuls; one I'm hoping I'll hear back from soon, the other wants me to come in for round two later this week or next.

I'm meeting with Jon to discuss some website designs for his Disc Jockey business. Hopefully he will approve a couple, get me the things I need from him, and then I can get this website figured out by the end of the month--something to add to my starving portfolio.

In the meantime, working on splash page for heypodo.com (I'm sure everyone has noticed the contents is just a blog for now), and flipping through this article on web standards sent by Chris Korhonen. Another reader suggested I run the webpage through my mac, though I'm looking at more "open" hosting options. I assume I can get through this and write up my own blogger markup for something more interesting than this simple template.

Till then!

Wednesday, July 13, 2011

Back to Ruby; Back to Koans

Took a huge leap in Koans today after hanging out at the General Assembly downtown. Met a few people (due to Mozilla shirt, what what George), but mostly processed a few key ideas in Ruby Koans--now committed to github after someone's recommendation.

Today's chunk was rather huge: Focused on classes, constants, message passing, and methods, as well as finished the Greed game code (which didn't take too long), and the Dice Project code (which was very familiar to Chris Pine's version). One major difficulty I've come across is writing code to someone else's code--it's really frustrating when you have a design idea but it has to work with someone else's idea of how it should be framed.

I left off at Proxy Object Project, realizing I think I need a night to let the learning settle in before I get back at it. I also need to find my coding notebook so write the pseudo-code, since I'm not nearly good enough to just figure it out by writing code straight. This is a lot of calling objects and messages to be sent around--which is everything I read about today--but I just need some time to digest and review before kicking it in. 259/274... so almost done!

Interview week starts off tomorrow, followed by meeting with a startup CEO about another position, and more interviews next week.

Tuesday, July 12, 2011

Final Stretch: Oakdale, CT, and New York, NY

Final travel post tonight, back to the typical rubying schedule tomorrow.

Sunday's twelve hour drive was definitely the worst. Hottest day, longest trip, most traffic and slowest vehicles. While every other day trip took only one stop for gas and stretching, I think this one took at least four stops, two for gas and two for just being tired and restless. We finally made it back after stopping in New Haven for pizza at Frank Pepe, which was totally worth it. Unfortunately neither of us took any pictures of the pizza--we were starving.

Spent Sunday night in Oakdale with my parents and the dog, but only about three hours of sleep since Colleen wanted to get back to lab as early as possible. We took the 6:00 am train from Old Saybrook to finally arrive at Washington Heights around 9:30.

Celebrated with all you can eat sushi in the East Village at night. It feels good to be back on the East Coast, but I will miss California and San Francisco.

Pictures will slowly go up on Flickr, and tomorrow will be back to the norm of programming all day, something I feel like I haven't touched in over a week. Yikes.

I did do some fair reading today. I am following Google's testing blog, and I'm jumping around the internet to learn more about ruby gems, considering the Ruby Talk email group shares knowledge of new ones constantly. I'll do some research about them tomorrow and even try to use one to write something to get this programming biz going again. I have a few interviews over the course of the next week, so it'll be a busy schedule once again. At least I'm not driving anymore.

Saturday, July 9, 2011

The Trip Continues: Kansas City, MO and Columbus, OH

Quite a few days these have been.

We arrived in Missouri three days ago, reentering the murky and humid states I was oh-so-familiar with when I lived in Connecticut years ago. Although the room we had was small, at least the air conditioner worked.

We woke up, unfortunately, to this:
(Excuse the awkward aspect ratio, I don't take video often on my android phone)

I lucked out since there was an overhang near the car. We ended up moving the car there to pack up to avoid the rain since I couldn't find our umbrellas. The rain perpetuated itself for the next few hours, eventually stopping some time before our gas break.

What remained of the bags protecting my bike.

We arrived at Columbus two days ago and hung out with my cousins for the rest of the night. Since then it's been a lot of driving around doing maintenance type of work--oil change the car, figure out clothing for the wedding, find the food we need for the rest of the ride home. Kelly's wedding is today, so we'll be out with family all afternoon and night. Colleen's friend Khanh recommended a place called Thurman's, so we're trying to hit up the food there as well. We leave tomorrow morning for our last stretch of the drive--to Oakdale, Connecticut to my parents for my mother's birthday. Then it's a train ride back to Manhattan for Colleen to get back to work and for me to get cozy for some interviews lined up. Until then!

Friday, July 8, 2011

Selenium 2.0

Selenium 2.0 is out. It features everything I'd probably want for a web app testing solution. Check out the update here.

I'll post an update on the travels in a bit. I need to get my oil changed (almost 2000 miles over, whoops), and find a shirt to wear for the wedding tomorrow. It's going to be 90 degrees and at least 60% humid--in other words, 'uncomfortable.'

Alright, readers, expect at least one more update tonight, either about more rubying, learning about testing, or a fancy travel update.

Tuesday, July 5, 2011

Days 2 - 4: Salt Lake City, UT and Boulder, CO

Driving has been exhausting so far! Today is our "day off" from driving, so it'll be nice to relax and check out what Boulder has to offer.

Coming from San Jose, the trip to Salt Lake City took about 12 hours. The drive wasn't bad at all until we got to Utah, when all of a sudden we got caught in a salt storm (yes, a salt storm). It blew over after about a minute or two, but caught both of us completely off guard.

The stay at Salt Lake City was nice, considering all we really did was get there, shower, and sleep.

The drive to Boulder was much shorter; we left at 7 in the morning and got to Boulder around 3 in the afternoon. I guess we didn't have to stop at Boulder, but the idea was to stay somewhere a bit more 'college'-y. We walked around to find dinner yesterday and ran into offices for Google and Bing, which was a bit unexpected. Finally ended up at Walnut Brewery (one of the only places open) for beers and food, and enjoyed the sounds of fireworks from our hotel room.

It was nice to sleep in today! I meant to take the bike out and do some local biking around, but sleep just felt... nicer.

Off to Kansas City tomorrow! Will likely update again once I get there. In the meantime, I signed up for softwaretestingclub.com, so I could learn more about testing. My profile should be acceptable by sometime tomorrow, but hopefully tonight!

Saturday, July 2, 2011

Day 1: San Jose, CA

Left Napa yesterday, the car completely packed with very little room to spare. We're here in San Jose for Steak Party 2.0, a tradition down with here with friends. Left the car with an audio shop so Colleen could plug in her iPhone, or I my Android.

We leave tomorrow to Salt Lake City! Should have some pictures.

Had an idea to write a script for Amazon.com that would download every free book for the Kindle. Simple concept but need much script writing practice.

That's all for today. The next week's updated might be sparse, considering the road trip. I'll do my best to write and share with everyone (or have Colleen dictate for me).

Friday, July 1, 2011

Late night update

Just a late night update. I started playing around with Watir today, and all I can say is this so far:

The source information is OLD. I understand this is a test app that is probably old now (no updates to Firefox since 3.6? oh boy...), but none of the documentation from online is either written very well or edited. One of the example programs it even came with had a line of code defining a search bar as 'seach,' and then calling on the search later with it spelt correctly. Whoops

This will likely be a great time for me to start digging through a Ruby gem to figure out what is defined in FireWatir's gem and what is not. It'll end up being a week of just testing every little thing that I see, just to see what it does. Oh boy!

I also was introduced to a website today, Weekend Testing. It's a community of testers who do stuff on the weekends, I guess. This weekend will be bad for it--but if the driving schedule goes as planned, I might be able to spend some time on it next Friday and Saturday, just to see what goes down. It looks exciting, none the less!

Getting Zachary's pizza tomorrow. Excited as usual.

Thursday, June 30, 2011

Napa Wrap Up

I'M OUT

...almost.

This week ramps up to a close early upon realizing I need to move out of this apartment by tomorrow afternoon, and still have things to box up tonight. Packing light--and it's nice because I got rid of all my books (woo Kindle, thanks Colleen!)-- and I should be able to fit my whole apartment in to the trunk and backseat of my Altima. It's all increasingly busy, considering this is the first hour (and only hour) I have to myself today. It's been meeting after phone call after meeting since yesterday, and will not end until Colleen and I leave on Sunday morning.

I have had fun testing out two new products that came out recently: turntable.fm and google+. I moderate my own turntable room (dropturntables, aptly named), and we have about 4 - 5 regulars show up. I'm also at the eventbrite one on occasion--great bunch of people there. Google+ I just hopped on last night, and right now it looks like Wave+ with Facebook. Wasn't a fan of Wave, but I'm excited to see how G+ turns out.

I'm reading a new book: Everyday Scripting with Ruby by Brian Marick. It's a programming book written specifically for testers, so I'm hoping I can finish it up by the end of the weekend and I'll have "some" kind of STE chops with improved Rubying. I'm also getting on Watir to work on some web app testing skills. I like the presentation of Watir, and I think it'll help me get those basics I need to have if my interest in testing continues the way it is.

Starting Sunday, it'll be driving about 10 hours a day for a week straight. I'm hoping to use the blogspace to share my trip with some pictures. Would love to hear back from readers: ideas for on the road? Colleen and I have Pandora, but we know how long that lasts! The last car trip I did was the 2006 drum corps tour with the Vanguard---but I was on a bus, and the driving was all at night, so I slept. Post a comment!

Back to packing...

Tuesday, June 28, 2011

Rubying with Regexp

So far Ruby Koans is a lot of review for me. I learned a few new things (a lot about symbols!), but I finally get Regular expressions. This was almost completely new, but I run into the code quite often when looking through examples--most commonly at rubyquiz. Let's see if I can go over all the params from Koans...
Note: Ruby reads from left to right, so it'll return the first string to match from the left. There are some examples of this where you can check for all matches, so I noted those.

''[/text you want to match/] -- checks a string for matching content.
if what you are searching for isn't there, match comes up nil

''[/text you want to match?/] -- the question mark means the last character is optional. so [/oranged?/] checks for orange and oranged, but oranged is optional.

''[/text you want to match+/] -- the plus checks that last character to see if there are more, and will return all of the extra ones.

''[/text you want to match*/] -- asterisk is similar. it's like a combo meal of ? and +, so it returns all of them if that character exists in the string.

array.select { |a| a[/[characters you are checking as options]rest of string/] }
phew that was a long one. this replaces the first character with whatever is in the array. for example, [a/[bcfj]ar/] checks for bar, car, far, and jar.

''[/\d+/] returns all the digits as strings. similarly I could use [/[0-9]+/] as a range.

''[/\s+/] is for whitespace. It claims it's a shortcut, but I don't get that part yet. This is one I need to play around with a bit more.

''[/\w+/] is for words, which is anything A-z and 0-9.

''[/.+/] is for return carriages.

''[/^[characters negated]/] the ^ checks for everything but what's in the match string. Likewise, you can use capitals D, S, and W to negate any of the above checkers.

And for quickies...
[/\Atext/] /A anchors to the beginning, while \z anchors to the end (put \z at the end too!). Likewise, carat (^) and dollar sign ($) anchor to start and end of lines. \b anchors to a word boundary... another one I'd like to test a bit more.

.scan can be used to find all of the matches, and returns them in an array. Useful for finding all the words or numbers in a string.

.sub is used to replace the first, while .gsub is used to replace any time the string is matched.

Okay. That was a lot to take in. I'd like to start looking at more examples of Regexp and how it can be used in context, but in the meantime, back to Koans.

More koans, and bedtime. Maybe.

With my domain registered, might as well put it good use. Here's to an exciting year at heypodo.com (which, for the record, doesn't have an index page yet).

About 1/3 through Koans now. Pine never covered symbols, so this last section was mostly new to me. I never understood the purpose of symbols before because they felt a lot like strings to me, but they clearly are not strings. Aye.

Testing, writing, moving update

I'm approaching my last week here in Napa, and the apartment is progressively getting more empty each day as things get sold and so on. Having less distractions is kind of nice, actually. My last few days have been the most productive since the last work day I had, so going back to living with absolutely nothing but a computer and a bed will be a welcoming change.

Today was filled with a lot of reading. That wasn't its original intention, because I don't like staring at the computer screen unless it's work related, but it was in all good purpose. I did learn a lot about context-driven testing, which appears to be the most common testing concept for software. I think the most informative part of it all was that I do a lot of this stuff already. I remember particularly when I had to make a last minute design call on the drill for Vintage's drumline show 'Rhapsody,' and even though I don't like making last minute changes, it was definitely for the better.

One drill move that Lisa designed clearly wasn't working, and the kids were getting frustrated. Why wasn't it working? Partly because some of the kids were moving too far, too early, and one wasn't moving consistently. I ended up breaking down the move into two subsets, because mathematically, it made sense. We were flipping three diagonals from one side of the gym to make one long one on the other, so I had them split the diagonal to make three short straight lines, and the end result was awesome.

Of course, software testing is a bit different, but I love the idea of critical thinking and just figuring things out. I started Koans about 30 minutes ago, and I'm about 5% into it. Going slower than expected, but it's been a long day. Unfortunately, no work on Rails or HTML today as planned, but I do hope to get out the design notebook and work on some website ideas for Connecticut's Best Disc Jockeys. All in due time.

There was an interesting comment on Hacker News about how Blogger hasn't changed over the last four years, compared to other blogging forms such as wordpress. I strangely have to agree, since I used it for my teaching one about that much time ago, but it's friendly territory. It will be nice to complete my own blogging app, since it'll truly be something I can call 'my own.'

Night everyone.

Sunday, June 26, 2011

Finished a rails app

It took me all day--including several breaks to do some job hunting, updating websites, and buying two domain names--but I finished the whole Ruby on Rails introduction guide, and I understand for the most part what's going on. It seems like Rails is best for multi-user support, which is the main reason why I think startups are so "on it" now, especially the ones that revolve around social networking.

The mvc infrastructure is actually quite a piece of art. Rails is so well integrated within itself that it really isn't that difficult to create and move things around, particularly when you get to writing the different views and methods. Of course, writing views takes some html/js/css knowledge... so I'll get to that. Posted the outcome on github (or should be up shortly after this update).

Gameplan now? Get back to rubying. I fixed up secret santa a bit more so there are 4 less variables and all the data is stored within one array instead of the 4 or 5 I had before. Next step is to implement STDIN to save a group of information into the array, and then it should be at its final stage of development.

Then, it's onto the next ruby quiz I want to check out.

So... new week, new goals. HTML and CSS reviewfest, and if all goes according to plan, get that website cranked out!

Rails for Zombies

It took me about 4 hoursish to get through all of Gregg Pollack's Rails for Zombies training, which is really just a short introduction to its infrastructure, the mvc framework, and some quick guides on making models (which looks like are just Ruby classes) views, and controllers. Honestly, I think it was a bit much for me to do over two days. Pollack suggests learning Ruby code first, which after a couple weeks of Rubying, I honestly feel "okay" with it, but aside from some design details, I don't see much of Ruby in Ruby on Rails. Maybe I'm not looking at it correctly, but it felt like a completely new language to me.

I'm going to review all of this tomorrow and post something a bit more insightful to show what was learned and then design a blog app using my own material instead of Google's. Unless this becomes a complete blunder, expect a transition by the end of this week to a own domain, which will include this blog in Rails, a personalized about me to toss the about.me website, and whatever other nonsense I can come up with for it. Should have a better idea of what that will look like tomorrow. In the mean time, time to continue fooling around with Rails.

Saturday, June 25, 2011

Exceptions! And all that other nonsense.

I puttered through Eloquent JS chapters 4 and 5 after falling asleep last night about half way through chapter 4. Can I blame myself? The majority of the chapter was about cats. I get enough cats on reddit.

Today's valuable lesson, however, was in error management, something I completely suck at (some might say epicfail). I learned about catch and throw, which is useful when certain qualifiers come up, say... an error you expect, and you need the program to zoom through to another block of code, ignoring all previous code.

After reading about that, I said, hey! This is how I'm going to fix my secret santa program! As it turned out, it didn't work the way I wanted it to in Ruby, so I will have to practice catch/throw a bit more to make sure I get it. I tried 'raise' as well, but all that does is shoot out the error that I was already expecting. I imagine raise being more useful when you expect your code to produce an error later if certain parameters are not correct.

So after much strolling around the internet, I ran into my true solution (for now) on tutorialspoint.com, where I learned about something Chris Pine just glanced over when explaining loops. Apparently I can use 'retry' statements to start loops over if something goes wrong--in this case, if the person is left with himself to pick.

I'm going to try mu is too short's solution as well (listed here), because it just dawned on me how simple it would be in comparison.

Tomorrow is Engagement/Peace Love and Firefox at Dolores Park, so I think I'm gonna try and get down there for ice cream and swag.


EDIT: And before I forget, my Secret Santa code is on github here: https://github.com/podopie/startingruby/blob/master/secretsanta.rb Also celebrating +100 hits on the blog, which is awesome since I've only had it for two weeks! Here's hoping to getting at least 1000 hits before the summer ends.

Thursday, June 23, 2011

Method Magic!

After some playing around, I finally got the code to work. Here's the example from Eloquent JavaScript (finding out the *3 +5 equation to a number) written in Ruby.


The real interesting difference was in Ruby, I needed to call the 'goal' variable in both methods. I don't think I could have used an instance variable here, just given the way the code is written. Another simplicity with Ruby is that I don't need the return statement in order to call the variables. Other than that, it's fairly similar.

I also noticed that it was better to put the ' + 5' method before the ' * 3' method, only because the return tended to be shorter. The return the other way around for 24 would be (((((1 * 3) * 3) + 5) + 5) + 5), what a mess! It never gets the chance to say that 3 * 5 is the same as 5 + 5 + 5. How unfortunate.

I imagine it could also be completed using procs? Maybe I'll try that out tonight.

Probably will get one more Eloquent JavaScript chapter done tonight, and I'd like to recode the Secret Santa program if I'm still awake after that. Someone is coming by to purchase my television in the morning, so consider that an opportunity for productivity to increase.

Gordon shared this link with me today: Local variable's memory can be accessed outside its scope?! Also will get to this for reading tonight.

Aye I feel stupid after taking a day off. I'll go climb tomorrow for a bit in the morning, but tomorrow will be a serious reading/hacking day.

Moving on with Eloquent JavaScript

After cruising through Metal Gear Solid last night (such a great critical thinking game!), I read through chapter 3 of Eloquent JavaScript. I'm avoiding my original idea of skipping ahead after reading this chapter; there was some great content that helped explain a lot of the fundamental ideas in Ruby that I already was slightly aware of, but actually took the time to explain them in detail. These would be scope, stacking, and branching, the last of which was brand new to me.

Scope

Scope, to my understanding, is all the different levels of the program. I think the best personal example I can think of is a book. Books consist of the "book," or top-level, chapters, or different methods, and the literature (or just words). Variables can take place on various levels of your scope, so it's important to consider when writing a program the organization and scope of your variables. When I last posted on stackoverflow, I got asked why I used global variables ($), especially because Ruby makes it almost unnecessary. This would be... me not thinking about my scope.

Stacking

I posted my first question at stackoverflow on a stack error. Stacking essentially is Inception, or how many levels deep you go. Fortunately (or unfortunately, depending on how you look at it), computers only allow so many stacks, probably in the tens of thousands. I know you can increase it manually, but most of the time it's not necessary. Anyway, if you're using recursion, and the stacking NEVER STOPS, you'll eventually run into a stack error. They look a little different between Ruby:
SystemStackError: stack level too deep
and JavaScript:
RangeError: Maximum call stack size exceeded
but mean the same thing. Bright side of things: I can create a stackerror on command. The world is mine... recursively.

Branching

If you can figure out stacking pretty well, branching is the idea of working with a flow chart. Eloquent JavaScript adds to this mix or even more lucrative branching, letting more than branch work at the same time using ||, the computer equivalent of "or." I'll post an example of this later tonight in Ruby, borrowing the original example from Eloquent JavaScript just to practice my Ruby skills... or rather translation skills.

Till then! Time to make dinner, and then back to go from learning to using.

Wednesday, June 22, 2011

Started js, so much review

Jameson sent me over to Eloquent JavaScript, (http://eloquentjavascript.net/), and so far, a lot of it is review--to the point of kick in the face. I'll continue skimming along just for the ride, but I'm hoping to coast to where it starts becoming a bit more relevant. It's a really well put together website, but trying to do some of the code examples was a pain because the console wouldn't work correctly. Ah well.

Sent a few more applications in tonight to some startups. I'm really excited for this batch because I'm actually familiar with their products. I've used Meetup for... 2 years now, and Animoto was introduced to me when we had a TAPS presentation in the credential program at Davis.

Tomorrow's gameplan: next stage fixes to the Secret Santa program, and continuing along in the JavaScript book. Secret Santa has been widdled down from over 60 lines of code to now under 30, so I'm pretty proud of that. Just need to get one part working (the end of the loop) perfectly and I can then move this program onto the next stage.

Peace out, readers.

Tuesday, June 21, 2011

Secret Santa code done--for now

I finally got the code to work (it's on github).

So let me explain a few things of what it does. It's not the most efficient thing in the world (log linear), but it works.

1. There's a sorter in here that organizes the lists by last name. I don't remember why I put it in here, but once I can figure out how the code works without it, I'll remove it.
2. Each person gets randomly set to a gift person. As long as it's not a family person (as goes the Ruby Quiz rules), it deletes that person out of the gift array.
3. If the last person ends up with himself, the whole process is restarted.

Occasionally I get errors:

secretsanta.rb:51:in `+': can't convert nil into String (TypeError)

Not sure how to go about fixing that yet, so if I can't figure it out tomorrow, I'll send it over to stackoverflow. The error only comes up less than 1% of the time when using 100 random names, so it can't be too big of a deal.

Goodnight, rubyers! Hopefully I can go back and solve the rock paper scissors game tomorrow; if not, I'll find another rubyquiz hack to work on.

Sunday, June 19, 2011

errors errors errors.

I did about two hours of work so far today on my rock paper scissors game. I've defined a few rules, set the computer's initial select, and created a main menu that's used to process things. I also tried creating a global proc... but it looks like ruby doesn't like those semantics.

The idea was to save space. Why rewrite the same 3 lines of code every time the computer doesn't understand your input? So I came up with this:

didnotget = Proc.new do |goback|
puts 'I\'m sorry, I don\'t follow that command. Please try again.'
goback
end

This proc SHOULD come up any time the computer doesn't understand what's happening, and the variable at the end of the proc is used to recall the method the user was just on. This isn't working the way I wanted it to, because instead I get this error:
rpsgame.rb:91:in `initialize': undefined local variable or method `didnotget' for # (NameError)
from rpsgame.rb:122:in `new'
from rpsgame.rb:122

Ah well, I'll figure it out eventually. For now, I'm going to grab a taco from Casa at the Oxbow in Napa, and then get some quick grocery shopping done. I'll figure this out when I get home.

Saturday, June 18, 2011

Rock, Paper, Scissors, Shoot.

Uploaded a really simple RPS class on github today. I want to figure out how to train the computer to figure out what you're going to pick next. So I'll add an initialize that does the random, and then after that it'll do something like either pick the last one you picked, or anticipate. Should be fun to figure out.

Gordon recommends I avoid looking at js tutorials and just hacking through it. Programming is programming, after all.

Blocks and Procs, or just more neat objects

Finally finished Pine's book! It took me a few extra days, but I thought it was appropriate to at least get through it before I move on to Ruby Quiz over the weekend.

So the last real lesson in the book was on blocks and procedures. Procedures are a lot like methods in that they kind of do the same thing. For example:
def ice_cream excited
'I looooove ice cream! ' * excited
end

puts ice_cream(3)

This method just writes the above statement (which is true!) as many times as it's called. That is, compared to a proc:

ice_cream = Proc.new do |i|
puts 'I loooooove ice cream! ' * i
end

ice_cream.call(2)

This proc does the exact same thing in a different way! This must be what Pine means by "Tim Toady."

The main difference is that for the proc, we call the code in the proc (between do and end) a block. Blocks and procs... clever right? How's that for assonance?
Procs are useful for two main reasons:
1. You can pass procs into methods (you can't pass methods into methods)
2. Methods can return procs (methods can't return methods)

Apparently you can even pass blocks into methods, but that's all sorts of ridiculous. Is it useful? Pine wrote us a proc that determines how long it takes to do a program. So, I'm going to use that to see how long it took my bubble sorter (and shuffler) to sort or shuffle 100 items in an array.

My Bubble sort 100 words: 0.012246 seconds
My Shuffle 100 words: 0.000309 seconds

That's compared to ruby's built in which is...
Ruby Sort 100 words: 1.7e-05 seconds
Ruby Shuffle 100 words: 4.0e-06 seconds

Then I upped it to 1000 words to see if it made a difference.
My Bubble sort 1000 words: 0.987385 seconds
My Shuffle 1000 words: 0.001996 seconds
Ruby Sort 1000 words: 0.000118 seconds
Ruby Shuffle 1000 words: 4.3e-05 seconds

Good to know that Ruby knows what it is doing better than I do. Goodnight, everybody.

Friday, June 17, 2011

Changing existing classes

Getting through that sort method felt pretty good, and I feel much more confident about my writing now than I did a few days ago. Today I wrote up the bubble_shuffle method, but to use some new knowledge as well from reading through the rest of Chris Pine's book, I just modified the Array class to include my shuffle method, despite there already being a shuffle method defined in the class.

Classes make up the big picture. Even though Ruby counts EVERYTHING as an object (and boy do they mean everything!), classes make up those objects. objects have different classes. For example, Integers are a class, Arrays are a class, Hashes (which are like arrays) are a class. Each class has a built in number of methods, and to my knowledge is ever increasing as Ruby gets updated, but you are allowed to edit classes yourself to write your own methods. Pine gives the example of to_eng for the Integer class, which translates integers into written form, ie. 3.to_eng returns 'three'.

Originally he wanted us to just write a shuffle method in the recursion chapter, but I just went ahead and skipped to the newer exercise, which modifies the Array class to include my shuffler. Now I can put in an array and use the method to have it shuffled and returned.



I saw on rubyquiz.com that there's a solitaire cipher quiz. I think I'll work on that one tonight. I definitely feel confident enough to figure that one out on my own, or at least understand the solutions. In the meantime, I have another job application to submit tonight. Until much later tonight, rubyers!

No coding today

After my success story this morning, I spent a lot of time revising my résumé while I begin my job search. I haven't had an interview in two years, and although I know I will likely have hundreds of interviews by the time I retire someday, it's really strange to jump back on the application train. This week has flown by fast enough as it is!

Here's hoping that the summer projects I'm working on will be great additions to the paper trail.

Thursday, June 16, 2011

Finally figured out a sorting algorithm!

Eventually I came to the conclusion that my algorithm was not going to work, so I had to start from scratch. I ended up wiki-ing sorting methods, and tried implementing the first one: a bubble sort. Finally, I just ended up borrowing code from dreamincode.net. Here's my final product for a bubble sorter:



Now the better thing for me to do here is explain what's happening. After you provide your list, it goes through the array two at a time next to each other (hence the i and the j) to see if they are backwards (-1). If they are, it fixes them. It keeps going through the list until it doesn't return a "backwards," the returns the new sorted list. I added a clear method after the return so you can just start a new list again.

In order to get more comfortable with all this, I'd like to check out a few more sort methods and use my cards that I made to go through each one manually so I can understand them better. Apparently bubble sort is incredibly slow and not good for larger patterns.

Last night I almost finished the shuffle algorithm, but I think I'm also going to see if I can find some on the internet already, and then play around with those. I'd like to think you could just use bubble sort with rand and just repeat that 100 times or so.

Back to house kinds of things. I need to start packing for my cross country trip, and this place is a mess.

More recursion

It felt really good figuring out how to get rid of a stack over flow, but I still haven't figured out how to write the sort program properly. I've taken to making flashcards on the ground. I know exactly what needs to happen--heck, I've written it down a million different ways on my notepad--but I keep forgetting something.

Tried playing around with the min method to find the smallest string, push it to the new array, and then delete it, but it's not working the way I want it to. I think what's happening is that it's just deleting the same slot through each run, because all strings come out as 0 for integers, or something along those lines. Either way, it's not deleting the right slot, so I either need to figure out how to make it delete the right slot, or just find the next smallest string in the same array while leaving the original there. min-[i] perhaps?

Late night again. See everyone tomorrow.

Wednesday, June 15, 2011

Chapter 10: Recursion and other nonsense

Up late tonight! This is what I get for sleeping in this morning.

I fixed Pine's psych problem using returns, but now he explains recursion. I asked Jameson if methods can call upon other methods today, to which his response was "duh," and then other utterances. Perfect timing while Pine explains methods calling upon themselves. Very useful if I wanted to rewrite my number guess game.

He uses recursion to find the largest continent in a map drawn by grid. Looking over the code I couldn't find the recursion the first time. But wait a second...


def continent_size world, x, y
if world[y][x] != ' land'
# Either it' s water or we already
# counted it, but either way, we don' t
# want to count it now.
return 0
end
# So first we count this tile...
size = 1 world[y][x] = ' counted land'
# ...then we count all of the
# neighboring eight tiles (and,
# of course, their neighbors by
# way of the recursion).
size = size + continent_size(world, x-1, y-1)


There it is!

I got to write all these chapter 10 programs up tonight. I'm falling behind and really don't want blogger to be an excuse.

Tuesday, June 14, 2011

Writing Methods


Wrapping up chapter 9 right now, finishing the second problem, which was rewriting the previously assignment: an arabic to roman numeral translator. I think I need to work on it a bit more, especially after this surprise:
Quietly raging now. If the picture isn't big enough, ruby is using up almost a gig of memory, and kicked up my VM to 20TB. After forcing it shut, the VM went back to a respectable 140GB, which I'm okay with. Going to make dinner (fresh gnocchi!) and then hopefully fix this crisis and finish up chapter 10 on time.

Monday, June 13, 2011

arrays and ranges

Thomson showed me today I can use a range for the 'do' keyword. so I can do something like...


(0..2).each do |i|


and this lets me create a set loop. I used this so I could use the each command when I wrote up arrays for the table of contents. So my whole program ended up like this:


chapter = ['Chapter 1: Getting Started', 'Chapter 2: Numbers', 'Chapter 3: Letters']
page = ['page 1', 'page 9', 'page 13']
line_width = 70
puts ('Table of Contents'.center(line_width))
chapter = ['Chapter 1: Getting Started', 'Chapter 2: Numbers', 'Chapter 3: Letters', 'Chapter 4: Variables and Assignent', 'Chapter 5: Mixing It Up', 'Chapter 6: More about Methods', 'Chapter 7: Flow Control', 'Chapter 8: Arrays and Iterators', 'Chapter 9: Writing Your Own Methods']
page = ['page 1', 'page 9', 'page 13', 'page 18', 'page 22', 'page 29', 'page 41', 'page 57', 'page 64']
(0..8).each do |i|
puts chapter[i].ljust(line_width/2) + page[i].rjust(line_width/2)
end


I also pushed a number game to github that I wrote as my final project tonight. It (I think) uses everything I've done from yesterday and today. It combines a few different ideas: using sort to organize guesses in an array, joining slots of an array with commas, branching to cover all possible responses with something appropriate. Not yet quite real-life Ruby scenario, but fun.

See you tomorrow!

Get the Git

I joined github yesterday. Should be more useful later on, but for now I'm just using it to watch other coders and challenge myself to figure out what they're doing on paper.

Should have Pine's book down by end of the week. Once ready, goal is to move on to:

1) projecteuler.net to move on to solving problems.
2) learn next languages: ruby on rails, perhaps python or C as well. This will be next week.

One more post tonight after finishing Chapter 8 tonight. I read it last night after having major headaches from staring at the computer all day, but now I want to go back and figure out all of chapter 7's and 8's problems. I'll post something original instead of the solutions. I got stuck on chapter 8 last year, but that was after a couple weeks. Let's see what happens tonight!

Flow Control

if works when it meets the requirement listed.
else works when the requirement doesn't fit the if
elsif is like the next if. I think it can go on infinitely.
Now for an example using numbers instead of strings. This program asks for your coffee size and how much sugar. Too much sugar will get you a beating from the barista.


puts 'What size coffee would you like? S/M/L'
coffee_size = gets.chomp
if coffee_size.capitalize == 'S' || coffee_size.capitalize == 'M' || coffee_size.capitalize == 'L'
puts 'And how many teaspoons of sugar for that coffee?'
sugar_tsp = gets.chomp
if coffee_size.capitalize == 'S'
if sugar_tsp.to_i > 1
puts 'Sir! That is way too much sugar for a small coffee!'
else
puts 'You got it! Coming right up!'
end
elsif coffee_size.capitalize == 'M'
if sugar_tsp.to_i > 2
puts 'Sir! That is way too much sugar for a medium coffee!'
else
puts 'You got it! Coming right up!'
end
elsif coffee_size.capitalize == 'L'
if sugar_tsp.to_i > 5
puts 'Sir! That is way too much sugar for large coffee!'
else
puts 'You got it! Coming right up!'
end
end
else
puts 'I\'m sorry, but we don\'t offer that size.'
end

Sunday, June 12, 2011

Day 1 Complete

This is going to be a fun yet awkward relationship.

# First problem: Program that asks each part of someone's name individually,
# then greets with whole name.
puts 'Hi, what is your first name?'
fname = gets.chomp
puts 'And your middle name?'
mname = gets.chomp
puts 'And your last name?'
lname = gets.chomp
puts 'Well, nice to meet you, ' + fname + ' ' + mname + ' ' + lname + '.'
puts 'My name is Ruby. I\'m very cute, don\'t you think? :*'
#Second problem: Ruby thinks you two are meant for each other.
puts 'So, ' + fname + ', what is your favorite number?'
fnum = gets.chomp
puts 'You like the number ' + fnum + '?'
rnum = fnum.to_i + 1
puts 'Funny, because ' + rnum.to_s + ' is my lucky number.'
puts 'We must be made for each other!'
puts 'RUBY. NOT EVEN ONCE.'

Puts and Numbers

Read chapter 2 today as review after glancing through intro and chapter 1. I installed xcode3.6 and macports 1.8 yesterday to help with compiling.

Puts does exactly what you'd think it does: puts whatever comes after it. You can put text or numbers after the puts command, though as of now I remember that text needs to be in parens in Ruby.

Numbers work two days: float (with decimals) and integers (no decimals... like in math class!). Integers work best for now because they are whole numbers. You can do whatever you want with numbers it seems: add, subtract, multiply, divide, for starters.

Not the most original code in the world, but I divided each of the exercises at the end of chapter 2 with puts commands that explain what each number represents. I don't remember yet how to set numbers to strings, so that'll come later.


puts "hours in a year"
puts 24*365
puts "minutes in a decade"
puts 60*24*365*10
puts "my age in seconds"
puts (60*60*365*25)
puts "The answer to 2.4 tough question"
puts 912000000/60/60/24/365

Nothing really exciting yet. I'll get through another chapter today and try something more original later.

Introduction

With the never-ending pink slips in education, I recently lost my job after two years having my own classroom in California. While filling in unemployment forms and other nonsense, I'm spending my summer to get back to my roots of programming from my high school days of QBASIC.

The material I'm learning from this year--which I started last year and never finished--is from Learn to Program by Chris Pine. My goal is to get through the book effectively, using other sources as well, to become a halfway decent amateur Ruby programmer by the end of my summer: September. Every day I will post some kind of original code and some review for myself so I can remember what I learned each day. This post will probably be my most elaborate; expect shorthand from here on out. Thanks for following!