AdaBox 008

AdaBox #008¬†arrived this week, and the theme this time was…robots!

dancing robot

I loved building robots in college, so was excited to dive into this box.

The project I chose to start with was a self-driving robotic car that can detect when it’s bumped into things via an accelerometer in the circuit board, reverse, and change direction. Basically a roomba except it won’t vacuum the floor for you.

It does provide great entertainment for cats, though!

(Also pictured – the rainbow slinky that came as a freebie for subscribers!)

One interesting thing about this project is that the code was actually written through MakeCode, which is one of those GUI-based code editors except streamlined for hardware programming. As a software engineer I would rather just write code, but this looks like a great tool for kids and people new to programming who don’t want to mess around with the intricacies of code.

The other cool thing is that the robot frame is built using cardboard. A big theme for all the projects in this box is incorporating cheap materials like cardboard and popsicle sticks, so you can make robotics projects without spending a lot of money. It’s a hybrid of crafts and robotics and I love the approach. The downside, of course, is that the quality isn’t as good; the double-sided foam tape that came with the box didn’t work well and one of the robot’s wheels kept falling off. But overall this box felt fun and creative – more robotics kits should come with bags of googly eyes!

Posted in Electronics | Tagged , | Leave a comment

AdaBox 007

Recently I subscribed to AdaBox, the subscription box from Adafruit that delivers a themed electronics kit every few months. It’s perfect for both people who are new to electronics, and those who aren’t but like the idea of getting relatively inexpensive materials for several fun pre-selected projects.

The box I just got was #007, which fittingly was spy-themed. You can see a couple pictures of the unboxing below; it also came with some hacker zines and a lockpicking set which was awesome.

I ended up doing a simple project with some of the materials – a Software Defined Radio (SDR) tuning knob¬†that worked with the SDR receiver¬†that also came in the box. If you follow the guide for the tuning knob, you can see that the board is coded using CircuitPython. When you turn the knob left or right, it sends input characters to whatever radio software you’re using, which tunes according to the input character.

It was a pretty fast and easy project, although I couldn’t find any working SDR software for Ubuntu that was compatible with the tuner, so I had to switch to a Windows machine and use the Adafruit-recommended¬†SDR-Sharp program.

I did have some difficulty getting the pins on the tuner to stay connected to the board; one pin is supposed to be bent into the center hole, and the two outer pins are screwed down, but the outer ones kept popping out from the screws. If I didn’t want to reuse the board for other projects I probably would have just soldered the pins down.

Here’s the final result and a closeup of the pins.

Overall I really enjoyed this box, there were some more projects to make that I haven’t done yet because I spent so much time on the hacking zines and learning to pick locks, but I’m excited for the next one. If you’re into electronics but don’t have a lot of time to explore and choose projects and buy materials, you’ll probably get a lot of value out of the AdaBox subscription.

Posted in Electronics, Projects | Leave a comment

Advent of Code Takeaways – Making (some of) the Magic Go Away

I did the Advent of Code in Golang last month and overall found it to be an excellent experience. The quality of the problems was good, although some days were too trivial, and it was a great learning experience for getting more familiar with a language Рin my case, Go.

(I did about half of the advent before life happened, but you can check out the solutions to the first half here!)

One of the main takeaways it left me with was how ill-suited Go is in some ways for solving code problems like these. Parsing input and the lack of built-in functions that are standard in other languages like Python wore on me pretty quickly. For example, Go’s STL doesn’t have a lot in the way of collections; if you want a queue, you have to either write your own, or use somebody else’s from Github. I also found myself missing list functions, especially coming from C#.

Rob Pike, one of the creators of Go, gave¬†a talk about the simplicity of Go that notes the lack of features compared to other languages. Pike points out that Go was designed to be a “clean procedural language designed for scalable cloud software”, and as such was built with a minimal set of features to accomplish that goal.

“Uncle Bob”, or Robert C. Martin, of Agile Software Development and¬†Clean Code fame, argued against the reckless use of overly-complex frameworks and languages in “Make the Magic Go Away“. His view seems to be similar to that of the designers of Go.

¬†Perhaps —¬†perhaps¬†— you should just write the little bit of code that you need, instead of importing thousands and thousands of lines into your project. Lines that you didn’t write. Lines that you don’t control. Lines that you probably shouldn’t be putting a whole lot of trust in.

Now, I have a computer science education. I can certainly write my own libraries if needed. And I love avoiding bloat in a codebase. That being said, spending time reinventing the wheel is not always the best option either.

As with any other language, Go is simply a tool. It’s not going to be the best language for every situation; it’s awesome for concurrent tasks and I know a lot of SREs who love it for their work. But for next year’s Advent of Code, I will likely be solving the problems using a language more suited to that kind of problem-solving.

Posted in Coding, Musings | Tagged , , | Leave a comment

Advent of Code 2017!

As I announced on Twitter…

I’m doing the Advent of Code this year! It’s like an advent calendar, except you have to solve programming problems instead of getting chocolate. (Okay, so maybe a chocolate advent calendar in addition to the advent of code is in order).

Since I haven’t had the opportunity to do much in Go at work lately (mostly been wrangling ElasticSearch and Java), solving these problems in Go should be a good way to keep my Golang skills sharp. Or it’ll just be really annoying. We’ll see!

If you want to follow along, I’ll be posting my solutions each day on my Github.

Posted in Coding | Tagged , , | Leave a comment

Choose Your Technology Community

Technology communities fascinate me. How groups spring up around programming languages or frameworks, and how cultures form within those groups.

Picture the most recent tech meetup or conference you went to. What was it like? What kind of people were there? How did they make you feel?

I was using a particular framework and related language for several years. I liked the technology, but every related event I went to was kind of soul-sucking. Most of the speakers and attendees were very alike. And they were not like me. There was also a strong sense of elitism and aversion to newcomers.

Contrast this with Python groups. Most have a completely different vibe. The community is much more diverse, with friendly and welcoming people.

A community I’ve recently joined is Golang, since I’ve been using it so much at work for creating backend web services and have enjoyed the language. So far the community¬†experience reminds me a lot of Python. This has been a huge factor for me in sticking with Go and transitioning away from the language I previously used.

If you’re new to programming and not sure what what programming languages to get into, in addition to technical considerations, make sure you consider what kind of¬†community you want to join.

And if you’re already in tech, think about which communities you’re a part of, and whether they’re¬†truly healthy ones that you would recommend.

Posted in Career, Musings | Leave a comment

Programming Microcontrollers with Arduino

Recently I went to a workshop on programming microcontrollers with Arduino, hosted by the awesome Stephanie Hurlburt. My expertise being more in software than hardware, I was super excited to try it out.

Turns out it’s pretty easy to get started building a basic circuit – assuming you already have the hardware (microcontroller, breadboard, resistors, USB wire, any LEDs and other¬†doohickeys you may¬†fancy), you just download the right USB driver for your microcontroller and get the Arduino IDE.

I found¬†Ladyada.net’s great Arduino tutorial¬†to be very helpful for¬†getting started. Lesson 1 explains how to configure¬†the Arduino software to work with your particular chip, and how to upload sketches (which are¬†the scripts used to program your microcontroller). Lesson 3 covers the electronics fundamentals behind setting up the breadboard. After that, it’s mostly a matter of learning how to build programs to handle¬†various aspects of the microcontroller – working with the Serial library, using inputs and outputs, and of course making lights blink.

My workshop partner and I created a super simple program that mimics an absurdly fast stoplight. Basically it runs in an endless loop, making first the green light go on, then the yellow light (for a shorter amount of time), then the red light.

20160515_1610022

There’s a picture of the LED stoplight setup. Each LED has a resistor connecting it to a socket on the microcontroller – for example, the lit-up one in the picture, the top green one, is connected to the D4 socket.

So in the setup function in the sketch, the three LEDs are initialized as outputs, which looks like this:

void setup()
{
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
}

Then there’s the loop function turns the LEDs on and off by manipulating the voltage level.

void loop()
{
  digitalWrite(4, HIGH); // This turns on green LED at pin 4
  delay(1000); // Leave the light on for a second
  digitalWrite(4, LOW); // This turns off green LED at pin 4
  digitalWrite(3, HIGH);
  delay(500);
  digitalWrite(3, LOW);
  digitalWrite(2, HIGH);
  delay(1000);
  digitalWrite(2, LOW);
}

And that’s it! Plugging in the microcontroller and uploading that sketch causes the lights to blink in sequence. Yay!

trafficLightGif

Next step for me is buying a ton of parts from Adafruit and experimenting to see what kinds of cool stuff I can create now.

Posted in Coding, Electronics | Tagged , | Leave a comment

Women Who Code 2016 Conference – Takeaways

Last month I had the opportunity to attend the Women Who Code CONNECT conference in Seattle. It was a two-day-long technical conference featuring a ton of awesome technical and career talks from inspiring women in tech, plus workshops and networking and all that good stuff.

All the speakers were fantastic. Some of the highlights for me were Maira Benjamin, Director of Engineer at Pandora, who shared some of the valuable lessons she learned during her 30 years as a woman in tech; Neha Batra from Pivotal Labs, who did a tech talk on pair programming that convinced me that I really want to try it; and Nandini Ramani, VP of Engineering at Twitter, who shared her compelling life story and lessons her grandmother in India taught her.

I came away from the conference with a lot of notes and action items. In no particular order, here are some of my takeaways:

  • Monitoring – there was a really good session by Tasneem Minadakis, ¬†who recently implemented a monitoring system at Yelp. Having never built out a monitoring system myself, it was really interesting learning all that goes into it – identifying and visualizing metrics, thresholding, determining alertable metrics, and alerting. I might try making a simple one for¬†one of my apps, just for the experience.
  • Try to meet one new person a week. Emily Carrion talked about this in her Informal Mentorship¬†session – if you meet just¬†one new person a week, that’s 52 people a year! Connections are very very important in this industry (and really any other), so a lot of opportunities can come from that. I’ve been achieving this goal by attending at least one meetup each week.
  • When you’ve learned all you can at your current role, that’s usually a sign that¬†it’s time to leave. Several speakers actually mentioned this. You don’t want to be stuck coasting along after you’ve hit a plateau – you want to be in a position where you are constantly learning and being challenged. It’s nice to be in a comfortable and easy position, but that’s typically not how people grow and improve.
  • Manage your tech career.¬†This was the subject of a whole workshop¬†by Elizabeth Ferrao. The important aspect for me was having a goal of where you want to be in so many¬†years, and a plan for exactly how you are going to achieve that goal – including a)extracurricular activities you can do, and b)identifying skills that will help to get there. For example, I’m always working towards becoming a better software developer. My¬†goal is to become a “senior” software dev – not in title, but in terms of gaining the experience and knowledge necessary to be an excellent¬†software craftsman. So in my case, an extracurricular activity I can do to become a better developer is continue teaching coding/CS concepts to others. A couple¬†skills that I identified as being helpful along the way to my goal are system architecture and design patterns, so I’ve been refreshing myself on those.
  • Pay it forward! I’ve been lucky to have had some awesome people supporting me during my career journey, and I’m looking forward to doing the same for others. During the conference,¬†a few people who were just starting out in their tech careers, or thinking about starting, asked for my advice. It was uncomfortable at first, because I’m really only a few years into my career myself and certainly no expert, but it felt good to pass on some of the things¬†I’ve learned along the way, and hopefully help others out¬†so they don’t have to learn these things the hard way (like I have a few times!). One thing I definitely want to get back into is volunteering, so I’ll be doing that as well.

Overall it was a great and inspiring conference, and I’m looking forward to next year’s!

Posted in Career, Conferences | Leave a comment

No laziness allowed with Entity Framework 7 beta

If you’ve worked with .NET before, you’ve probably run across Entity Framework¬†(EF) – a tool¬†that essentially helps you map entities to data. For example, a project that I’ve been working on in order to get up to speed with the new .NET 5 and EF 7 beta releases is a simple recipe web app that lets you create, edit, and view recipes.

For the recipes to be saved somewhere, I’m using EF to map the recipe model properties to columns in a database table. It’s pretty easy to get started with EF; I hadn’t had much prior experience with it, but there are lots of great tutorials out there, including the¬†official documentation¬†for the beta release.

Unfortunately for those of us just getting started with EF, many of the tutorials based on older versions (which is most of them) no longer apply.

Many of these breaking changes are documented. However, I did run across a few issues that weren’t as easy to find.

One particular issue was that at first my recipe ingredients just weren’t being displayed on the recipe view page, even though the data was there and the code seemed right. I was simultaneously working through a EF6 tutorial¬†to learn the basics (you have to tweak a few things to get it to work with EF7, but most of it is still applicable), and noticed that the same issue was occurring even in the tutorial app.

After some Google-fu I came across a Github issue pointing out that lazy loading is not supported in EF7.

In other words, if you expect related entities to be loaded, you need to explicitly state so by including them. In my recipe ingredient example, I had to add a line of code in the view function in my controller that looks like this:

_context.Recipe.Include(b => b.RecipeIngredients).ToList();

Aaaaand now my ingredients are showing, just like I expected them to originally.

Many of these older EF tutorials (which are, again, nearly all of them since EF7 is still in beta) rely on lazy loading. They don’t even tell you that there are different ways of loading related entities, or what those ways are (MSDN has a good, albeit outdated, article about the¬†different types).¬†It’s just one of those issues that happens when you’re using a beta that doesn’t have full documentation yet, especially of breaking changes.

If you read through some of the other¬†Github issues that have been opened about the lack of lazy loading in EF7, some people consider this to be a¬†really horrible change. But as other commentors pointed out, it’s also a matter of performance – lazy loading can be really bad performance-wise (do you really need all related entities¬†automatically loaded in all your views?!), so it’s probably good to encourage the disuse of it.

That being said, for such a breaking change, some more visibility in terms of documentation would have been helpful, especially for newcomers. I didn’t find anything in the official documentation mentioning the dropping of support for lazy loading. I did, however, find another sort-of-breaking¬†change mentioned in the docs, which is lack of support for many-to-many relationships. This also caused an issue for me that was confusing since it worked just fine in the EF6 tutorial! I actually¬†came across the issue while dealing with a slightly different one, which I posted about on StackOverflow.

Anyway, I’m not sure whether or not lazy loading will eventually be included with EF7,¬†but I can’t wait until it’s officially out of beta and there is full documentation! Although, it is really fun to follow along with a beta framework and watch all the changes it goes through.

Posted in Coding, Educational | Tagged , | Leave a comment

The new ASP.NET 5 and why it’s awesome

So Microsoft is coming out with a new version of the ASP.NET framework, and I am excited! Here’s why:

  1. It’s open-source.¬†That’s awesome, and a pretty radical shift for Microsoft.
  2. Web Forms are going away. Need I say more?
  3. It’s cross-platform.¬†Meaning it can now run on Linux, yay! (Mac too, for you Apple fans.)
  4. It’s lightweight and modular.¬†No word yet on just how much more so, but it looks promising.
  5. It’s got more support for front-end stuff.¬†Grunt, Gulp, Bower, NPM… it’s all supported.
  6. Dependency injection!¬†This is now baked straight in to ASP.NET; you don’t have to use¬†third-party frameworks. This is probably the change I’m looking forward to the most.

For you other .NET nerds, do you plan on giving the beta version a try?

Edit: As of January¬†2016 (really November 2015, but I’m late to updating), ASP.NET 5 Release Candidate (RC) 1 is out! We’ve been using this on a project at my work, and it is fantastic. Still a few things to iron out (for example, we encountered¬†a few snafus in¬†publishing to IIS) but overall I am really happy with the new features and overall direction the framework has gone in.

Here’s a link to the current documentation:¬†http://docs.asp.net/en/latest/conceptual-overview/aspnet.html

Posted in Musings, Uncategorized | Leave a comment

What you didn’t learn in your CS program

When I started my first software development internship a few years ago, I was immediately overwhelmed by just how unprepared I was. There was a whole environment to set up with lots of tools I’d never heard of, a large unfamiliar codebase, and layers of abstraction in the code, not to mention SCRUM processes and meetings.

Sure, I’d learned a bit of version control (in class¬†it was the rather outdated CVS, although I dabbled a bit with Git in my own time since I’d heard it was useful), and the concept of abstraction had maybe been mentioned by a teacher.

But a computer science program, especially ones that focus mostly on theoretical CS, like my school did, can leave you quite unprepared in many ways for the realities of software development in the professional workplace.

An internship is the perfect place to get a jumpstart on learning on all these new things before you graduate and start work, so if you’re still in school, I highly recommend snagging an internship.

Otherwise, it’s¬†important¬†to¬†take the initiative to learn on your own. Go to tech meetups, read blogs and articles, talk to other students who have already done internships.

A few of the most important lessons I’ve learned about software development that I didn’t learn in school:

  1. It is vital to think ahead when writing code. This is important in a few ways; for one, of course it’s good for error handling, scalability, etc. to plan for the future when developing a solution to something. But I also mean that you should think about maintainability. In school, we tend to work on a project once and never look at it again. In the workforce though, once your code goes into production it may be there for years to come, and not just you, but other people will usually end up maintaining it.¬†Make sure that¬†your code is clear and readable, and that you are proud of it.
  2. Be familiar with¬†Agile.¬†Many companies follow some form of agile development. In my experience most places don’t follow it to the letter; they adapt it to their company’s or team’s needs, so your experience may vary, but you should at least be familiar with the basic concepts of sprints and daily standups.
  3. Development is usually done by teams. Occasionally in school we do team projects, but at least for me, most development was done solo. And I’d grown accustomed to the stereotype of¬†coding being a solitary activity. But in the workforce, development is usually done by teams, and many companies even have an “open floorplan” sort of design to encourage collaboration even more. You may not end up doing pair programming, but you will be usually be working with multiple other people on projects, and discussing problems/solutions with them. Also this is another great reason to get familiar now with source control: if you are working on the same codebase with multiple other people, you will often run into and need to resolve conflicts when checking in code.¬†On that note,
  4. Know how to use source control. Git is by far the most commonly used version control system these days so I would highly recommend learning some basic Git commands and concepts. You can get a free account on github.com¬†and go through a basic tutorial there. Be sure you have some school or personal projects pushed to your profile,¬†and put the link on your resume, because many employers want to see that you have a Github profile. As mentioned above, it’s also good to know how to do conflict resolution and merges which happens frequently when working with teams, so try contributing to an open source project or working on a project with some friends if you get a chance.

There are lots other lessons learned, but these are some of the ones I’ve found to be most helpful when first starting my career.

Here’s a blog post I read recently that inspired this topic: http://blog.newrelic.com/2014/06/03/10-secrets-learned-software-engineering-degree-probably-didnt/

Posted in Career, Educational, Musings | Leave a comment