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 | 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 | 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

The magic of PHPMailer

Recently I updated the website for my club, the Association for Women in Computing at WWU, to send e-mails via PHPMailer. We have a contact form with the usual subject, content, name, etc. and want to send all that to our e-mail address. The previous e-mail system went through the school’s network  and was very much broken, so it was in need of a good fix.

It was easier than I thought it would be, mostly just building some basic PHPMailer code. Add the script to your site, create a new instance of PHPMailer, and set the various properties on that instance. For example, if your mailer is $mail, you set the subject of the email like so:

$mail->Subject = “E-mail subject here”;

Then once you’re done adding all the properties, you do $mail->Send, and you’re good to go!

For the server, I ended up just creating a new Gmail e-mail address so I could use Gmail as a host. So our host property looked something like this:

$mail->Host = “smtp.gmail.com”

And then you use the Gmail address and login for the Username and Password properties. Simple and easy!

PHP does already have a built-in mail function, conveniently called mail(), which is fine for super simple e-mails but PHPMailer makes it easy to do more complicated things, like adding an attachment or using SMTP to send the e-mail. So unless you only want to do very basic things with mail in PHP, I’d stick with a library.

Official instructions and examples can be found on their Github.

Posted in Educational | 1 Comment

Generating one-time passwords using the SHA-256 hash function

A one-time password (OTP), in the realm of computer security, is a password that is only valid once and expires as soon as it is used. OTPs are important because they provide an added layer of security to many systems, especially since they are invulnerable to replay attacks.

My latest project was to make a Java program that could generate OTPs using the SHA-256 hash function. SHA, designed by the NSA, stands for Secure Hash Algorithm and serves to hash a dataset of any size into a fixed-size output (256 bits, in this case).

I incorporated GUI into my program to better simulate a real-life usage of OTPs. I used Swing (a GUI widget toolkit used with Java) to create a system that displayed two windows. The first window was simply for generating and displaying an OTP. The second window was for inputting an OTP and verifying if that OTP was valid.

The basic program design was to first generate a (psuedo)random number using Java’s SecureRandom class, which is cryptographically strong and far more secure than the typical util.Random class. This was provided as a seed to the SHA-256 hash function, and the producing hash was converted into a six-integer-long number (e.g. 123456), the OTP. This hash would then be passed in to the hash function for the next generation of an OTP, and so on.

So for example, say we are a bank and want to give our customer a temporary password so the customer can log in to their account with this password and reset their login info. The customer can click on the button in the first window to generate the password. (In reality, a distribution method such as sending a text with that password to the customer would probably be implemented, but let’s go with this simple illustration.) Now that the customer has the password, s/he can input the password into the input box in the second window, click the verification button, and the program for the second window will calculate the next OTP and compare that with the input. If it matches, the user is granted access – otherwise, the user is denied.

Fairly simple, but the crux lies in keeping both “windows” in sync. Each program calculates the next hash function output, and therefore OTP, separately and keeps track of how many times a password has been generated. So what happens when someone clicks on the generate password button twice and the verify password button only once? Well, the verification program is still expecting the first password. So in my program I created conditional branches for if the count in one of the programs is higher or lower than the other, and instructions to the lower-count program to go through enough password generation cycles to reach the count of the other program. This only applies to counts that are within 100 difference of each other, though – we don’t want an attacker doing this a whole bunch of times and analyzing what happens so they can find ways to break in.

If you are interested in viewing the code for this project, I have a sample up on Github: https://github.com/aschlesener/SHA-256HashOTP

Stay tuned for an update that will include pictures of the GUI windows in action!

Posted in Projects | Tagged , , , , , , | Leave a comment

An Intro to Linux Mint

First released in 2006, Linux Mint is a “flavor” of the Unix-like operating system Linux that has gained widespread popularity and continues to be one of the easiest versions of Linux for beginners to use.

Mint is based on another popular and widely-used Linux flavor, Ubuntu, but differs in that it comes with pre-installed software and plugins so that it is functional directly out-of-the-box. This feature is extremely appealing to new users of Linux who don’t want to experience the hassle of figuring out how to download and install this software themselves on an unfamiliar new environment.

Some of the most useful pre-installed software: GIMP, a free alternative to Photoshop; LibreOffice, a free alternative to MS Office; Banshee, a media player similar to iTunes that you can sync with your Android, iPod, or what have you; essentially everything that someone used to the Windows/Mac GUIs might be looking for.

On a personal note, while I now prefer Ubuntu for my daily work, Mint was definitely the right choice when I was starting out, mostly due to the clean and simple Windows-like look. Plus, the gray and green color scheme is gorgeous!

Mint distro

If you’re really interested in the technical differences between Linux distributions, distrowatch.com is a great resource (thanks to my old dentist, who recommended it during a discussion on our favorite distros!). Here is their article on Mint.

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