Category Archives: Software Development

Book Review: Becoming a Better Programmer

Becoming a Better Programmer: A Handbook for People Who Care About Code Book Cover Becoming a Better Programmer: A Handbook for People Who Care About Code
Pete Goodliffe

This book may serve as your mentor in case you do not have a large network of successful and experienced ones.

It covers most of the topics you will experience in life of a professional software engineer: programming, testing, practicing, working with people and being more efficient at your job. I've found Part III Getting Personal and first chapter of Part IV Getting Things Done useful, but it just me. Your mileage may very - depending on your experience and time spent in the software industry,

Few important things are missing from this book: politics of large and small organizations, climbing corporate ladder & truly achieving amazing results as a software engineer.

But to get you started, this book will be good enough.

Book Review: “Learning to Program”

Learning to Program Book Cover Learning to Program
Steven Foote

I don't even know where to start, but let me try.

With the growth of the web and an influx of neophytes from all walks of life there is an infinite demand for books to get you off the ground and start "coding." These are the books better known as "Learn X in 24 hours" and "Y for dummies". This work continues the proud tradition started during the glorious plastic-pants CEO days of Dot-com bubble of the late 1990s.

Of course, it starts with "Hello World" to get you going fast. It also talks about how "your computer is stupid" and talks about "short-term" and "long-term memory". Unsurprisingly, it uses JavaScript as a programming language and fails to explain "how software works", even though the full chapter 2 is dedicated to this topic. On page 31 the author explicitly states that "you don't need to know the details of how your code becomes binary (sic!), but you do need to know that it happens".

Do I need to mention that the term "Algorithm" is absent from table of contents?

I guess this book can get  you going with basic web development, but the amount of bad patterns & misconceptions that need to be corrected years into career are making it a poor choice.

There is really no shortcut to learn programming, take CS50 from Harvard instead, it is free and teaches things in a proper way without omitting fundamentals. Oh yeah, and professor Malan is amazing.

A Case for Mechanical Keyboards

Lead-In

After many years of using various ergonomic keyboards both at work as well as home I finally had had enough. It was time to go back to good old mechanical switches. Having some free time and enough courage I researched and finally bought old-school mechanical keyboard.

The first step was to order a Cherry MX Switch Tester from WASD Keyboards.

6 Cherry MX Switches

The tester comes with 6 switches of which 4 are smooth (clear, red, black and brown) and 2 are actually clicky (blue, green). I didn’t like any of the smooth switches as they were all reminding me of a regular keyboard except a little more precise as each key has an individual switch (duh!).

I ended up liking Cherry MX Green best as it is more clicky and resitant than Cherry MX Blue. When you compare these two the difference is very clear: the green ones just feel more precise and even sturdy.

The Keyboard I chose

As Cherry MX Green was the best choice, I wanted to purchase magnificent CODE keyboard that has the best design – clean and simple, that simply allows you to focus on work & typing. It was out of stock! What was surprising is how rare the MX Green keyboards are! Only the CODE had a decent layout (i.e. not extra buttons/knobs and other pseudo-professional bells-n-whistles), but it was not available which was a huge disappointment.

The next best option was Cherry MX Blue-based Das Keyboard Model S ordered on Amazon during their Prime Day. So far so good: satisfying typing experience, the keyboard is a heavy, sits nicely on the desk and reminds me of heavy IBM keyboards from childhood. Overall build is good, it looks like a high-quality product except for the stupid functional keys that fortunately are mixed shared with functional keys.

Mechanical keyboards may not be for everyone, but software engineers should definitely give them a try for few weeks and see if they like them.

Configuring Eclipse IDE for Algorithms, Part I (Coursera)

Coursera is offering great algorithmic courses Algorithms, Part I and Part II by Robert Sedgewick. The only problem with them is Dr. Java IDE they recommend. It is free, usable but completely impractical when it comes to debugging.  I’ve configured Eclipse IDE and my productivity increased significantly, especially when it comes to debugging.

Here is how to configure Eclipse on Windows machine for Algorithms, Part I/part II:

  1. Uninstall any instances of Java from your machine
  2. Follow step 0 from http://algs4.cs.princeton.edu/windows/ to install algs4.exe
    • only follow step 0, skip the rest as we will use Eclipse instead of Dr. Java
  3. Download stdlib.jar and algs4.jar to permanent folder
  4. Download Eclipse IDE for Java Developers
    • At the time of this blog post I had Eclipse Luna SR1 4.4.1 on my machine
  5. Follow instructions in eclipse.pdf to configure Eclipse.
    • The instructions are long and little tedious but well worth it
    • Here’s how you create a User Library in Eclipse: go to Window > Preferences > Java > Build Path > User Libraries, create New library and add algs4.jar and stdlib.jar from step 3 (I called it Coursera): 0UserLibraries
    • Whenever you create a new Java project you need to add newly created user library : right click on project, Build Path > Add Libraries 1AddLibrary 2AddLibrary
    • Here’s what your Java project in Eclipse will look like after adding this library:3Project

Eclipse worked well for me and as I mentioned previously increased my productivity which made studying fun again.

Good luck and let me know if you have questions!

Unshelving TFS shelveset to a different location or branch

  1. Install Microsoft Visual Studio Team Foundation Server 2013 Power Tools, then open command line and cd into a location where you have your TFS workspace otherwise TFTP will show error
    C:\Windows\System32>tfpt unshelve
    Unable to determine the workspace.
  2. Run tfpt unshelve /?
    c:\Source\Project\tfpt>unshelve /?
    tfpt unshelve - Unshelve into workspace with pending changes
    
    This command has two separate modes of operation:
    
    1. Migrate: allows migration of shelved changes from one branch into another
       by rewriting server paths.
    
    2. Undo: allows changes from an already-unshelved shelveset to be undone,
       cleaning up pending adds, and preserving other existing pending changes in
       the workspace.
    
    Usage: tfpt unshelve /migrate /source:serverpath /target:serverpath
                         [shelvesetname[;username]] [/backup]
    
           tfpt unshelve /undo shelvesetname[;username] [/batchsize:num]
                         [/recursive] [filespec...]
    
     shelvesetname          The name of the shelveset to unshelve
     /backup                Creates a backup shelveset
     /migrate               Rewrite the server paths of the shelved items
                            (for example to unshelve into another branch)
     /source:serverpath     Source location for path rewrite (supply with /migrate)
     /target:serverpath     Target location for path rewrite (supply with /migrate)
     /undo                  Undo pending changes from an unshelved shelveset
     /batchsize:num         Set the batch size for server calls (default 500)
  3. The option you need to execute is unshelve /migrate. Specify /source, /target and shelvesetname – that should be enough. You may need to resolve conflicts, in most cases AutoMerge in the pop up dialog will do the trick.

 

Netstat and System.Net.HttpListenerException (0x80004005)

Recently I was developing web service with several Web APIs. After few check-ins I decided to step through the code.

The service wouldn’t start. What? “It worked on my machine” just few hour ago. What’s wrong?

The exception was coming out of System.Net.HttpListener (I write in C#) and the message was following: System.Net.HttpListenerException (0x80004005): The process cannot access the file because it is being used by another process.

Maybe there is a bastard process from the previous run? I checked Process Explorer – nothing. I also have ISS up and running – which I decided to stop:

iisreset -stop

I couldn’t do that either, it would throw a an error. “That’s getting more interesting”, I thought. Well, most likely something is using ports that my web service is listening on. Which port would it be? I had only 80 and 8080 ports opened on my web service. But what is it?

C:>netstat -ano | findstr :80 | findstr LISTENING
  TCP    0.0.0.0:80      0.0.0.0:0  LISTENING       6112

OK, so the PID of the server is 6112, let’s take a look what it is. Skype! Wow, that’s interesting – it was running in the background and I never had issues with it, but for whatever reason it started to listen on that port. I killed skype process and moved on to debugging my code.

18 months in Xbox security team

Year and a half ago I accepted an offer from Xbox security team.

It is very important to reflect on your career at least every year and this post is not exception. That said, in the past 18 months I was fortunate to help ship Xbox One gaming console, my experience is detailed in this top answer on Quora.

Xbox One Controller

Overall, it was a great experience. Coming from mobile OS world it was both exciting and challenging time in which I learned to:

  • design & ship security services for millions of customers
  • build advanced security solutions
  • deploy and monitor Xbox Live services
  • investigate issues in production and deliver quick fixes
  • get used to being on call 24/7 for a week at a time (we use Pager Duty)

It is hard to imagine that I would move back to client development with long development cycles and at least a year before customers will see your work. Services is incredibly fast-moving part of the company and is like a drug: once you’re hooked you keep coming for more.

Another interesting aspect of my past 18 month was to observe well-oiled team of high-caliber developers delivering security solutions at a rapid pace. The amount of learning and productivity is multiplied and you have a feeling that anything can be solved. Now, It is indeed a very hard task to hire a great team and keep reports challenged and happy, but I will cover that in the future posts.

But it all just the beginning as we every day there are new challenges, new interesting things to work on so the learning continues.