Hack Your TODO List With Google Keep

Hack Your TODO List With Google Keep

Trying To Keep It Alllll Together…

I’m a big fan of TODO lists. I find that they’re a great way for me to set up a bunch of tasks and feel really productive as I work through them. I’ll make TODO lists for almost anything. What do I need to get done tomorrow morning at work? What groceries do I need to get? What topics am I thinking of blogging about? I’ll get some sort of TODO list going for anything.

The one thing that I need in my TODO list to stay effective is to constantly have it around me to remind me. I was running the Evernote app on my Android phone and recently made the observation that things that I put in there had a much higher likelihood of getting done versus things I put in my work notebook. The reason? I check my phone a lot more than my work notebook. I have my phone with me when I grocery shop. I have it before and after I workout at the gym. It’s my alarm in the morning so I have access to it as soon as I wake up. My work notebook? Not so much.

The problem here is that my important work tasks I want to accomplish were not getting the same treatment my out-of-work tasks were getting. They weren’t getting the same success rate.

Enter Google Keep

I try to meet up with my teammates once a month to discuss their goals or things we need to work through at the office. In my last round of one-on-ones, I was discussing my TODO lists with one of my colleagues, Samantha. She said that she noticed I was using Evernote, but was curious of I’ve ever tried out Google Keep. I admitted that I hadn’t, but she was speaking highly of it. “Why not give it a shot?” I thought. But it hacked my TODO list concept in a big way.

Google Keep has one feature that I think is totally awesome on my phone. I never tried this with Evernote, so I’m not claiming that it can’t do this. The phone widget is truly awesome. Right on my homescreen of my phone, I can see my TODO lists. This takes that first point I was discussing (need to have access to it all the time) to a whole new level. Now instead of having to go to the app itself to get refreshed on what I need to do, almost any time I touch my phone I’m having visibility into my TODO lists.

A second powerful feature is the idea of checkboxes for progress. This probably sounds like it’s not all that important. “Google Keep has checkboxes? Great… I have bullet points in any other app I can get my hands on!” I can hear you saying that now ;) But it’s different. I was using Evernote and keeping bulleted lists, and when I was through with something, I’d just delete the whole bullet point. The idea of checking things off your list is powerful because it shows you that your making progress. I can see that I have only 3 of 10 items left on my list and that gives me a bit more drive to try and knock off the rest. If my list is always just a view of what’s left, it will always feel like it’s never done.

Summary

I’m not trying to push Google Keep or bash Evernote here… I’m just trying to show you how a few simple hacks in my TODO lists were able to provide some real positive benefits. For me, the things I need in my TODO list technology are:

  • Easy to access
  • Ability to access frequently
  • Insight into progress I’m making on the list
  • … Not cost me a cent!

Your list might look a bit different. You could argue that you don’t always want the list in front of you or that you don’t want total transparency into the progress you’re making. I can’t speak for you in terms of what will be most effective, but I highly recommend Google Keep after using it for only a couple of weeks.

Now my only problem is that I look like I’m ignoring people if I’m taking notes on my phone in a meeting! Thanks for the suggestion, Sam!


Refactoring For Interfaces: An Adventure From The Trenches

puzzle

Refactoring: Some Background

If you’re a seasoned programmer you know all about refactoring. If you’re relatively new to programming, you probably have heard of refactoring but don’t have that much experience actually doing it. After all, it’s easier to just rewrite things from scratch instead of trying to make a huge design change part way through, right? In any mature software project, it’s often the case where you’ll get to a point where your code base in its current state cannot properly sustain large changes going forward. It’s not really anyone’s fault–it’s totally natural. It’s impossible to plan absolutely everything that comes up, so it’s probable that at some point at least part of your software project will face refactoring.

In my real life example, I was tasked with refactoring a software project that has a single owner. I’m close with the owner and they’re a very technical person, but they’re also not a programmer. Because I’m not physically near the owner (and I have a full-time job, among other things I’m doing) it’s often difficult to debug any problems that come up. The owner can’t simply open an editor and get down to the code to fix things up.

So there was an obvious solution which I avoided in the first place… Unit tests. Duh. I need unit tests. So that’s an easy solution right? I’ll bust out my favourite testing framework (I’m a fan of xUnit) and start getting some solid code coverage. Well… in an ideal world, like every programming article is ever written, this would have been the case. But that wasn’t the case. My software project does a lot of direct HTTP/FTP requests and interacts with particular hardware on the machine. How awesome is writing a unit test that contacts an HTTP server? Not very awesome.

What was I to do? I need to be able to write unit tests so that I can validate my software before putting it in my customer’s hands, but I can’t test it with unit tests because I don’t have the hardware!

Refactoring for Interfaces

Okay, so the first step in my master plan is to refactor for interfaces. What do I mean by that? Well, I have a lot of code that will call out and make HTTP requests and it has a specific dependency on System.Net.WebRequest. The same thing holds true for my FTP requests I want to make. Because I have that dependency within my classes, it means I have no choice but to call out to the network and go do these things.

I could design it a different way though. What if I abstracted the web requests away so that I didn’t actually have to call that class directly? What if I could have a reference to some instance that met some API that would just do that stuff for me? I mean, my class knows all about it’s on particular job, but it truthfully doesn’t know the first thing about calling out to the Internet to go post some HTTP requests. This means if someone else is responsible for providing me with a mechanism for giving me the ability to post HTTP requests, this other entity could also fool me and not actually send out HTTP requests at all! That sounds like exactly what my test framework would want to do.

My first step was to look at the properties and methods I was using on the WebRequest class. What was shared between the HTTP and FTP requests that I was creating? The few things I had to consider were:

  • Some sort of Send() method to actually send the request
  • A URI to identify where the request is being sent
  • A timeout property

I then created an interface for a web request that had these properties/methods accessible and created some wrapper classes that implemented this interface but encapsulated the functionality of the underlying web requests. The next step was creating a class and interface for a “factory” that could create these requests. This is because my code that needs to make HTTP/FTP requests only knows it needs to make those requests–It doesn’t have any knowledge on how to actually create one.

With my interfaces for my requests and my factory that creates them, I was able to move onto the next step.

Create Mocks for the Interfaces

Now that I had my classes leveraging interfaces instead of concrete classes internally, I could mock the inner-workings of my classes. This would provide two major benefits:

  • I could create tests that wouldn’t have to actually go out to the Internet/network.
  • I could create instrumented mocks that would let me test whether certain web requests were being made.

I started off my writing up some unit tests. I tried to get as much code coverage as I could by doing simple tests (i.e. create an object, check default values, call a method and check a result, etc…). Once I had exhausted a lot of the simple stuff, I targeted the other areas that I wasn’t hitting. I mean, how was my coded test supposed to test my method that does an HTTP request and an FTP of a file under the hood? Mocks.

So this is where you probably draw the line between your integration tests or unit tests and get all pedantic about it. But I don’t care how you want to separate it: I need coded tests that cover a section of my class so that I can ensure it behaves as I expect. But if I’m mocking my dependencies, how do I know my class is actually doing what I expect?

Instrument your mocks! This was totally cool for me to play around with for the first time. I had to create dummy FTP/HTTP requests that met the interface my class under test expected. Pretty easy. But I could actually assert what requests my class under test was actually trying to send out! This meant that if my method was supposed to try and hit a certain URL, I could assert that easily by instrumenting my mocked instance to check just that. Was it supposed to FTP a certain set of bytes? No problem. Use my mocked instance to assert those bytes are actually the ones my class under test is trying to send.

Wrap Up

This was just a general post, and I didn’t put up any code to go along with it. Sorry. I really just wanted to cover my experience with refactoring, interfaces, mocking, and code coverage because it was a great learning for me.

To recap on what I said in this post:

  • Identify the parts you want to mock. These are the things your class or method probably isn’t responsible for creating directly. Going out to the network? Accessing the disk? Accessing the environment your test is running under? Creating complex concrete classes because they hook into some other system for you? Great candidates for this.
  • Create interfaces by looking at the API you’re accessing. You know what classes you want to mock, so look how you’re using the API. If you need to access a few properties and methods, then make that part of your interface. If you see commonality between a few similar things, you might be able to create a single interface to handle all of the scenarios.
  • Inject factories that can create instances for you. These factories know how to create the concrete classes that meet your interfaces. In a real situation, they can create the classes you expect. In a test environment, they can create your mocks.
  • Write coded tests with your mocks! The last part is the most fun. You can finally inject some mocked classes into your classes/methods under test and then instrument them to ensure your code under test is accessing them in the way you expect. Run some code coverage tools after to prove you’re doing a good job.

I hope my experiences down this path are able to help you out!


Leadership: What Does It Mean? – Weekly Article Dump

Leadership: What Does It Mean? - Weekly Article Dump

Leadership

Everyone has their own variation of what leadership means. For me, leadership means empowering others to accomplish their goals and providing assistance when they need it. There were a few articles that came up on LinkedIn this week that I wanted to share with everyone and discuss how they fit into my perspective on leadership.

Articles

  • Does Your Team Work With You Or For You?Kwame Manu-Antwi opens up the article in an interesting fashion. When I read the title of the article, I figured this was going to be the typical leadership vs management debate. However, Kwame goes into describing a scenario where he had a humbling experience from one of his team that made some sacrifices for him. This was truly an example of working for him.

    The entire second half of the article shares a bunch of leadership traits that I think are really beneficial.  For example, being transparent and encouraging growth in your team members. I think the point that is being made in this article, although I don’t personally feel like it was made as obvious as it could have been, is that as a leader, if you want to feel like your team is willing to make sacrifices (for you, or for the team) then practicing being an excellent leader is the way to get there. Thus, the tips he provides to do so!I’d say there’s a lot of takeaway in his bulleted leadership points.

    If you’re an experienced leader then it’s probably mostly stuff you’ve heard before. However, it never hurts to be reminded of great leadership responsibilities!

  • How Do I Hire A Good Employee: Insights on Leadership Traits: In this article Kendall Matthews talks about the specific things he looks for when interviewing. It’s not about how picking the smartest person in the world or the most skilled person according to Kendall. It’s all about finding people that have that curious drive that can think on their feet. Have you given into the status quo?

    When it comes to leadership and hiring, your responsible for building out a well rounded team. In my opinion sometimes this will require hiring the smartest or most skilled person, but more often than not, you’re just looking for go getters. People that are curious by nature and always looking to push the boundaries make great candidates for your team because they’re adaptable. This means you don’t need to go finding someone with the perfect skill set because you can hire the person that’s willing to evolve into that person.

    Again, it’s not a blanket rule in my perspective. Sometimes your team will require that super-skilled person to be up and running from day one. Being a good leader in charge of hiring requires you to understand your teams needs though.

  • Can Skipping a Meeting Make You a Better Leader?: I find that Ilya Pozin always has some interesting articles up on LinkedIn. If you don’t follow him yet, I suggest you do! This article is all about shaking things up to align them to your leadership strategy (and not just accepting meeting invites and then not showing up).The first part of the article is really about taking charge of your daily routine. If you get into work and your ready to make a big dent in your todo list, then moving meetings until later in the day might have a huge  benefit. Similarly, it helps you plan out and prioritize the rest of your day. For me, I plan the night before and since I’m still largely a developer, I find that if I have meetings in the middle of the day when I’m in my groove then that’s when I have the biggest problems. Try tweaking when your meetings are to suit your leadership style.

    The second part of this article talks about the idea of a devil’s advocate and is personally my favourite part. I can’t stress enough how important healthy debate is for continuously improving. I had a colleague the other day say that he doesn’t like how often he hears “because it’s always been that way”. I jokingly responded, “because we’ve always said that”! But the point is, he’s not sticking to the status quo and doesn’t want to settle. I had another colleague argue against my perspective even more recently, and it really got me thinking about how our perspectives were different and where we might need to go next. Healthy debate is awesome. Your goal is not to put your “opponent’s” face in the dirt, but to understand their perspective as much as possible and ensure they get your perspective as much as possible.

  • Heisenberg Developers: In his article, Mike Hadlow talks about how a new (what seems to be scrum-based approach?) was introduced to a software development team and how it negatively impacted them. Mike’s argument? The process that was put in place took away autonomy from developers–they should be given free reign to implement a feature as they see fit.

    While the general consensus in the comments on his blog indicates that people agree, I actually don’t. I’m well aligned to the first two sentences in his closing paragraph (autonomy and fine grained management) being important, but I think direction is incredibly important. In an agile shop, often the customer proposes features to go into the product (and when the customer isn’t available, product owners acting on behalf of the customer propose the features) and the developers work to get them done. Maybe this wasn’t the implication of the blog post, but I don’t think it makes sense to just let developers randomly choose which of the features to work on next and decide on their own how to do it.

    What works better, in my opinion? Have product owners provide acceptance criteria for what would make the feature successful. Have software testers and software developers mull over the acceptance criteria and bounce ideas back off of the product owners. Did they think of how that would affect feature B? Do they realize it will be a support or regression testing nightmare unless feature C is in place? What’s my point? Collaboration. The article doesn’t even mention it. It’s only about how process takes away from the artistic nature of programming. I feel like people should stick to hobby programming if it’s art they want to express, but when it comes time to business, it’s about delivering rock solid features that the customer wants.

    Back to estimating and tasking out features. Why break a feature down? What’s good about doing it that way? If you hit road blocks or need to pivot, it’s great to have a part of a feature done and realize that in it’s current state it might be classified as acceptable for a deliverable. Maybe it doesn’t match the original acceptance criteria, but perhaps the pivot involves adjusting that and now it’s acceptable. Task breakdown brings insight to the people working on the feature. What’s involved in making it? How are you going to test it? How are you going to support it?

    Autonomy is important. But I think that there needs to be some level of process in place for leadership in management to have insight as to what’s taking place, and there needs to be enough autonomy for developers and testers to do their job to the best of their ability. Sometimes the time invested in collaborating is one of the best investments in your development team.

  • Why The Golden Rule SucksJoaquin Roca has an awesome article on “The Golden Rule” and why it doesn’t apply in leadership. Joaquin starts by discussing why building a diverse team is incredibly important and why you should take advantage of the tensions it can create. So why does The Golden Rule suck? Well… not everyone is like you and not everyone wants to be engaged the same way you are. Everyone is different and it’s important to adapt your ways to the person you are engaging with–especially when your team is diverse. There’s also a cool leadership quiz that he has posted at the top of the article!
  • Did I Make a Mistake in Promoting This Person?!: This article is about something that happens in the tech world all too often. Caroline Samne talks about how skilled professionals are promoted into leadership in management positions–except they don’t have any expertise in this area. I’m actually a prime example of this. I was hired on as a developer early on at Magnet Forensics, and before expanding the team, I was chosen for a leadership position without any past experience. However, like the article says, I had great mentorship through our HR manager and I was empowered to seek learning opportunities to grow in this space. The moral of the story is, just because someone is skilled at X, it doesn’t mean they’ll turn out to be a great (people) leader in this space. Leadership just doesn’t work magically like that.
  • Corporate Hackathons: Lessons LearntChristophe Spoerry‘s article is all about hackathons. It’s a great way to spur some innovation in your organization if you’re allowing it to happen naturally. He shares his learnings from past experiences such as having leaders with past experience in hackathons present and having teams and/or themes picked out ahead of time. Once the hackathon starts, you don’t want to be wasting time with logistics… You want to be participating! Discuss what the outcome of the hackathon will be. Who’s going to take ownership over what was created? How will the outcomes be shared with the other participants or the rest of the organization? Get hackin’!

Thanks for reading! Follow Dev Leader on social media outlets to get these updates through the week.


Techno Security 2014

Magnet Forensics Booth at Techno Security 2014

Techno Security… What’s it all about?

Techno Security is a conference that was hosted by NUIX this year in Myrtle Beach. As that first link suggests, this conference has been bringing IT security professionals together for 16 years now. Techno Security doesn’t aim to be the biggest conference of it’s kind–just the best.

At the Myrtle Beach Marriott Resort this year, Techno Security capitalized on a lot of the hotels real estate. There was a large banquet hall style room that was opened up for a great host of exhibitors. There were so many exhibitors that there was even overflow into the hallways surrounding the main exhibit area. On the other sides of those hallways there were rooms and smaller halls for training sessions. Even the halls in the basement of the hotel were packed with IT security and forensic-related sessions.

First Conference Perspective

This was my first conference not only with Magnet Forensics, but also in my professional career. While I’m not a product manager within our organization, I was selected to go to act as an ambassador for our primary development team. It was a great experience on so many levels.

Firstly, hanging around our booth during the day was absolutely incredible. We were almost always swarmed by people asking about our product or organization. We even had people coming up just to tell us that they love our product or that they wanted to thank us for having great interactions with our team back in Canada. It was almost overwhelming–but in a good way :)

I was able to sit in on some sessions and hear about what some other organizations are doing. There were companies like Berla that I had never even heard of that provided a high level overview of some of the really cool technology they’re working with. There were companies like Cellebrite and NUIX (that I had heard of) that provided really informative sessions on how to use their products and the benefits they offer. Not only were the sessions packed with information, but I really got a feel for what the digital forensics community is like outside of interactions with Magnet. It truly does feel like a tight knit group of people that at the core of it have one common goal–uncovering the truth.

One of the best experiences I had while at Techno Security was the “unofficial social events” that would take place each night after all of the sessions were done and exhibitors were packed up. Our team would get together outside with a couple of drinks in the warm weather–and no, that’s not why this was one of the best experiences–and some experts in the industry would meet up with us to talk. It was great to get to meet some customers and get a glimpse of what their lives are like: dealing with tons of cases, working through murder cases, working through child abuse cases, etc… It’s impossible for me to fully understand what it’s like for them, but getting a peek was more than enough for me. Again, customers were letting us know just how big of an impact Internet Evidence Finder is making in their investigations. Knowing that you’re making a difference for someone is one of the most rewarding feelings, and I hope the Magnet team truly understands that we are having a huge impact.

Closing Comments

Techno Security was not only packed with informative sessions and vendors with really awesome technology–it was filled with people who spend their days trying to get to the truth. It was amazing to hear all of the positive comments from customers and to get a glimpse of what their lives are like performing investigations. I’d love to go back next year to learn more and reconnect with all of the great people I got to meet.

Nick and Jad at the Magnet booth - Techno Security 2014

There’s me providing The Boss Man Jad Saliba with an arm rest at the Magnet booth at Techno Security 2014


Back On The Radar

Back On The Radar

No More Silence.

I’ve been pretty quiet over the past month and a bit, but that doesn’t mean that nothing is going on behind the scenes. I’ve been busy (maybe a little bit too busy?) and I haven’t really put in the time to create or share any content online. When I over commit, something has to give, unfortunately.

Okay, so what’s been happening?

New Hires!

We’ve brought on some amazing talent to help at work, and that’s always incredibly exciting. We had Chris Sippel return to us after finishing up his final portion of school. Chris is a bit quirky (and that’s really why we love him) and started with us in the early days. Pumped to have you back, buddy! We brought on board Jason Gregory and Matthew Beamer who bring a host of skills that are truly going to help our team. Last but not least, we have Graeme Harvey to help ensure that we maintain the highest quality in our software.

Again, I’m excited to having all of the new guys on board. They’re truly going to have a huge positive impact on our team. Oh! Did I mention Graeme has a blog on testing? Check out ITestStuff.ca. It’s still young but I’m sure there will be some cool content going up there :)

Magnet In The News

Of course Magnet Forensics hasn’t been out of the news. Here’s a few cool articles about stuff that’s happened over the last couple of months:

Conferences

Magnet just came back from CEIC in Las Vegas. I wasn’t able to attend, but from speaking with my colleagues, the show was a great success. It’s always awesome hearing customer feedback. Knowing that we’re making a difference is really what drives us. It’s also important for us to hear if users are finding parts of the software hard to use to so we can address it.

This weekend I have the pleasure of being able to join Magnet at Techno Security in Myrtle Beach. This will be my first conference with Magnet, so I’m pretty excited. I’m really hoping to get some of that first-hand customer interaction and hear about how people are using our software. I’m sure I’ll be able to share more once I’m back

Hopefully you’ll see a bit more from me on your radar!


IronPython: A Quick WinForms Introduction

IronPython: A Quick WinForms Introduction

Background

A few months ago I wrote up an article on using PyTools, Visual Studio, and Python all together. I received some much appreciated positive feedback for it, but really for me it was about exploring. I had dabbled with Python a few years back and hadn’t really touched it much since. I spend the bulk of my programming time in Visual Studio, so it was a great opportunity to try and bridge that gap.

I had an individual contact me via the Dev Leader Facebook group that had come across my original article. However, he wanted a little bit more out of it. Since I had my initial exploring out of the way, I figured it was probably worth trying to come up with a semi-useful example. I could get two birds with one stone here–Help out at least one person, and get another blog post written up!

The request was really around taking the output from a Python script and being able to display it in a WinForm application. I took it one step further and created an application that either lets you choose a Python script from your file system or let you type in a basic script directly on the form. There isn’t any fancy editor tools on the form, but someone could easily take this application and extend it into a little Python editor if they wanted to.

Leveraging IronPython

In my original PyTools article, I mention how to get IronPython installed into your Visual Studio project. In Visual Studio 2012 (and likely a very similar approach for other versions of Visual Studio), the following steps should get you setup with IronPython in your project:

  • Open an existing project or start a new one.
  • Make sure your project is set to be at least .NET 4.0
    • Right click on the project within your solution explorer and select “Properties”
    • Switch to the “Application” tab.
    • Under “Target framework”, select  “.NET Framework 4.0″.
  • Right click on the project within your solution explorer and select “Manage NuGet Packages…”.
  • In the “Search Online” text field on the top right, search for “IronPython”.
  • Select “IronPython” from within the search results and press the “Install” button.
  • Follow the instructions, and you should be good to go!

Now that we have IronPython in a project, we’ll need to actually look at some code that gets us up and running with executing Python code from within C#. If you followed my original post, you’ll know that it’s pretty simple:


var py = Python.CreateEngine();
py.Execute("your python code here");

And there you have it. If it seems easy, that’s because it is. But what about the part about getting the output from Python? What if I wanted to print something to the console in Python and see what it spits out? After all, that’s the goal I was setting out to accomplish with this article. If you try the following code, you’ll notice you see a whole lot of nothing:


var py = Python.CreateEngine();
py.Execute("print('I wish I could see this in the console...')");

What gives? How are we supposed to see the output from IronPython? Well, it all has to do with setting the output Stream of the IronPython engine. It has a nice little method for letting you specify what stream to output to:


var py = Python.CreateEngine();
py.Runtime.IO.SetOutput(yourStreamInstanceHere);

In this example, I wanted to output the stream directly into my own TextBox. To accomplish this, I wrote up my own little stream wrapper that takes in a TextBox and appends the stream contents directly to the Text property of the TextBox. Here’s what my stream implementation looks like:


private class ScriptOutputStream : Stream
{
  #region Fields
  private readonly TextBox _control;
  #endregion

  #region Constructors
  public ScriptOutputStream(TextBox control)
  {
    _control = control;
  }
  #endregion

  #region Properties
  public override bool CanRead
  {
    get { return false; }
  }

  public override bool CanSeek
  {
    get { return false; }
  }

  public override bool CanWrite
  {
    get { return true; }
  }

  public override long Length
  {
    get { throw new NotImplementedException(); }
  }

  public override long Position
  {
    get { throw new NotImplementedException(); }
    set { throw new NotImplementedException(); }
  }
  #endregion

  #region Exposed Members
  public override void Flush()
  {
  }

  public override int Read(byte[] buffer, int offset, int count)
  {
    throw new NotImplementedException();
  }

  public override long Seek(long offset, SeekOrigin origin)
  {
    throw new NotImplementedException();
  }

  public override void SetLength(long value)
  {
    throw new NotImplementedException();
  }

  public override void Write(byte[] buffer, int offset, int count)
  {
    _control.Text += Encoding.GetEncoding(1252).GetString(buffer, offset, count);
  }
  #endregion
}

Now while this isn’t pretty, it serves one purpose: Use the stream API to allow binary data to be appended to a TextBox. The magic is happening inside of the Write() method where I take the binary data that IronPython will be providing to us, convert it to a string via code page 1252 encoding, and then append that directly to the control’s Text property. In order to use this, we just need to set it up on our IronPython engine:


var py = Python.CreateEngine();
py.Runtime.IO.SetOutput(new ScriptOutputStream(txtYourTextBoxInstance), Encoding.GetEncoding(1252));

Now, any time you output to the console in IronPython you’ll get your console output directly in your TextBox! The ScriptOutputStream implementation and calling SetOutput() are really the key points in getting output from IronPython.

The Application at a Glance

I wanted to take this example a little bit further than the initial request. I didn’t just want to show that I could take the IronPython output and put it in a form control, I wanted to demonstrate being able to pick the Python code to run too!

Firstly, you’re able to browse for Python scripts using the default radio button. Just type in the path to your script or use the browse button:

IronPython - Run script from file

Enter a path or browse for your script. Press “Run Script” to see the output of your script in the bottom TextBox.

Next, press “Run Script”, and you’re off! This simply uses a StreamReader to get the contents of the file and then once in the contents are stored in a string, they are passed into the IronPython engine’s Execute() method. As you might have guessed, my “helloworld.py” script just contains a single line that prints out “Hello, World!”. Nothing too fancy in there!

Let’s try running a script that we type into the input TextBox instead. There’s some basic error handling so if your script doesn’t execute, I’ll print out the exception and the stack trace to go along with it. In this case, I tried executing a Python script that was just “asd”. Clearly, this is invalid and shouldn’t run:

python_error_asd

Python interpreted the input we provided but, as expected, could not find a definition for “asd”.

That should be along the lines of what we expected–The script isn’t valid, and IronPython tells us why. What other errors can we see? Well, the IronPython engine will also let you know if you have bad syntax:

python_error_bad_syntax

Python interpreted the script, but found a syntax error in our silly input.

Finally, if we want to see some working Python we can do some console printing. Let’s try a little HelloWorld-esque script:

python_pass_hello_world

Python interpreted our simple Hello World script.

Summary

This sample was pretty short but that just demonstrates how easy it is! Passing in a script from C# into the IronPython is straight forward, but getting the output from IronPython is a bit trickier. If you’re not familiar with the different parts of the IronPython engine, it can be difficult to find the things you need to get this working. With a simple custom stream implementation we’re able to get the output from IronPython easily. All we had to do was create our own stream implementation and pass it into the SetOutput() method that’s available via the IronPython engine class. Now we can easily hook the output of our Python scripts!

As always, all of the source for you to try this out is available online:

Some next steps might include:

  • Creating your own Python IDE. Figure out some nice text-editing features and you can run Python scripts right from your application.
  • Creating a test script dashboard. Do you write test scripts for other applications in Python? Why not have a dashboard that can report on the results of these scripts?
  • Add in some game scripting! Sure, you could have done this with IronPython alone, but maybe now you can skip the WinForms part of this and just make your own stream wrapper for getting script output. Cook up some simple scripts in a scripting engine and voila! You can easily pass information into Python and get the results back out.

Let me know in the comments if you come up with some other cool ideas for how you can leverage this!


Happy St. Patty’s Day – Weekly Article Dump

Happy St. Patty's Day - Weekly Article Dump (Image by http://www.sxc.hu/)

Happy St. Patty’s Day!

I hope everyone who was celebrating St. Patrick’s Day was able to not only have fun but stay safe doing so. Of course, when there is drinking associated with a holiday it can be easy to get carried away. It’s always a great idea to have driving arrangements or the option to sleep at a friend’s place set up before you head out to celebrate.

This year I was able to celebrate with a handful of my university friends that I don’t get to see as often as I’d like. I haven’t been drinking much at all now for nearly half a year, so I stuck to my one Irish coffee to meet my liquor allowance. We all had a blast discussing where our lives have taken us so far, and it’s great to see everyone doing so well. I was excited to hear that more people are hoping to relocate into or closer to Waterloo!

Happy (belated) St. Patty’s Day everyone, and I hope the recovery has gone smoothly today.

Articles

  • Empower Your Visionaries: Steve Faktor talks to us about who the visionaries are in your company and why you should be empowering them. Steve says that the visionaries within our organizations are frustrated by bureaucracy and will often leave to go start their own Next-Big-Thing. So what should we be doing with them? What can we do with them? Well… challenge them! Challenge them to make their radical ideas a reality. Extend the boundaries you’ve placed on them so that they can try to make their vision a reality and make them feel comfortable with the possibility of failure. Wouldn’t it be great if they’re next big thing was the next big thing for your organization?
  • Don’t Forget Me! Ensuring Distributed Team Members Aren’t Left Out: In this article, Gary Swart touches on how to make sure remote employees are kept engaged. Working remotely can be difficult not only for the person offsite, but for the people that are supposed to interface with the person offsite. Timezone differences, cultural differences (i.e. different holidays, for example), and the fact that you can’t interact in person are all things that make remote team members a lot trickier to work with. Gary suggests using the ICE (Identify, Clarify, and Extend) principle, which he outlines in his post. He also suggests using things like video conferencing so that you can pick up more on body language when you’re meeting remotely and even ensuring that you try to keep your technology homogeneous so that information can be shared easily.
  • Inspire Creativity at Work With All 5 of Your Senses: A good friend of mine shared this with me the other day, and I thought it was worth passing along. Many people don’t pay attention to it, but if you work a traditional office job, you spend a lot of time in the office. Even if you can get a little boost from your environment, it can potentially go a long way over time. This mashable is an infographic about how different colors and ambience in the office can be used to enhance (or restrict) different aspects of your thinking and interaction. If your work environment isn’t playing into your senses, you may be missing out on a positive effect!
  • Great leaders aren’t afraid to take risks: According to Alex Malley, risk taking is a very important part of leadership. He has a handful of suggestions for gearing yourself up for taking risks in your leadership role such as separating the personal aspect of failure from your role. If you’ve set yourself up with talented people, you have open communication with your manager, and you’re prepared for the “worst case”, then you should feel more comfortable taking risks.
  • The complete guide to listening to music at work: I’ve personally given up on listening to music at work during core hours due to the nature of my role (I’ve been told this is “humblebragging“, but realistically I’m just making myself more approachable). However, when I’m cranking through some development work on my own and I know I’m not going to be approached by anyone, I love to turn up some tunes. I thought Adam Pasick had a pretty cool write up about the different aspects of listening to music at work. Essentially, different styles of music may be better for different tasks at work.  I think it’s worth a read if one of the first things you do when you get into the office is strap on your headphones!

Thanks for reading! Follow Dev Leader on social media outlets to get these updates through the week.


Snow Tubing with Team Magnet – Weekly Article Dump

Snow Tubing with Team Magnet - Weekly Article Dump

Snow Tubing

First off… If you haven’t ever gone snow tubing, get off your computer and get to your nearest snow tubing park.

Now that you’re back from that, we’re all on the same page. Friday was another one of Magnet Forensics‘ staff events and we were fortunate enough to go tubing at Chicopee Tube Park. I hadn’t been snow tubing before–only water tubing–and I haven’t even been on a ski hill or anything for years. To be honest, snow tubing to me seemed like a bit of a glorified crazy-carpet experience which would be fun, but get boring after a couple of runs.

I’ll be the first to admit I was dead wrong. Snow tubing was probably the most awesome way for the entire Magnet family to cut loose this quarter. Most people either love or hate the snow, so finding a big group activity for a company to participate in outside in the Canadian winter can be tricky. Snow tubing was perfect though. It wasn’t too intense that people had to shy away from it and it was exciting enough to keep us entertained for the few hours we were there.

Kelly, you did a great job coordinating the staff event! It was great to see everyone come out and have a blast. Thanks for being awesome, Team Magnet.

Articles

  • The Difference Between Managers and Leaders: In this article by Ilya Pozin, he touches on some of the differences between managing and leading. In my opinion, there’s often the idea that managing people is terrible and leading people is the best thing you can ever do. I get that kind of vibe from this article, so I wanted to point it out right at the beginning. I think that a good way to look at it is like this: Being a manager does not make you a leader, but being a good leader sets you up to be a great manager. Leading and managing are different things, and the better you get at leading the better you can become at managing. With that said, I think the article touches on a lot of great leadership points.
  • 5 Ways to Finish What You Start (and Why You Often Don’t)Susan Perry writes about something that a lot of us likely experience pretty regularly. You pick up something new only to end up abandoning it not too much later. Starting a new project or hobby is exciting and it can be really easy to dive head first into something for this very reason. However, if you find that you always start things and never finish them, it might be worth paying attention to some of Susan’s suggestions.
  • 15 Benefits Of Being An Intelligent Misfit: Isaiah Hankel talks to us about what an “intelligent misfit” is in this article. The idea is that swarm thinking is more about just reacting to things, and that’s not overly beneficial. By being unique and standing out, you actually attract others that are unique like yourself with shared interests. As a result, you end up building a network of people that are truly like you instead of conforming to a group. Isaiah goes on to list 15 benefits to standing out in his article and it’s certainly worth the read.
  • Build the perfect teamPeter Mitchell talks about what ingredients you need to build your perfect team. Establishing a common culture and attitude are things that are definitely among the top. Creating clear goals and objectives for your team will also help pave the way for success. One of the most important parts of creating a team is coming up with complementary skill sets. This can be difficult because you want to create a team with people that think alike but have different skills–and often this is hard for people to separate.
  • Fire, Being Tired.: John Hope Bryant gives us a different perspective on what it means to be tired. He says that it’s not just about lacking energy to do something or not getting enough sleep. Being tired is more about losing interest in something. Why? Well even when you’re run down or low on sleep the things that you’re truly interested in can get you excited. John’s suggestion is stick to things that truly interest you–be honest with yourself. Don’t stay in a job where you’re watching the clock for the end of the day. Find your drive and your motivation.

Follow Dev Leader on social media outlets to get these updates through the week. Thanks!


Recognition: One of Team Magnet’s Masterminds

Recognition: One of Team Magnet's Masterminds (Image by http://www.sxc.hu/)

Background

At Magnet Forensics, I lead an awesome team of people with the mission of creating forensics software to help investigators around the world solve crimes. We’re stacked with incredible people–and not only on the team I’m on, but company-wide. We do a great job of recognizing our achievements as an organization and as a team, but also on an individual level. If someone has gone above and beyond, we don’t keep that a secret.

I’ve been trying to make more of a conscious effort to recognize the people I work with, especially in ways that are unique to my own style. I think recognizing people in person is important, but you also need to consider your setting. Sometimes recognition in a public forum isn’t actually appreciated or isn’t nearly as effective as appreciating in a one-on-one setting. I find even for myself that I get uncomfortable when being recognized in a public setting.

With that said, I wanted to recognize an individual I work with without shining too much of a spotlight directly her. Thank you, Christine, for all of your hard work.

Broken Retrospectives

At Magnet, we try to adhere to some agile philosophies.  It lets us pivot pretty quickly to customer needs–which keeps them quite happy–and still lets us deliver rock solid software. We develop in short cycles called “sprints” and at the end of every sprint we have a retrospective to look back at what worked well and what didn’t. That way in the next sprint we can make improvements. Keep the good stuff, drop the broken stuff and try out a thing or two that’s new. This is excellent for continuous improvement unless…

They don’t work.

We would run our retrospectives religiously, but it seemed like nobody really wanted to be there. It was a seemingly forced meeting where I felt a lot of the time I was trying to stir up conversation. By the end of the meeting, just about everyone would have chimed in, but there weren’t a lot of ideas being generated. It was long, boring, and didn’t accomplish any of the goals we wanted it to. Thus, our development cycles stayed basically the same for a while. They worked and they didn’t appear to be broken enough that people wanted to see change.

Things remained the same until I received some input from Christine. When Christine read an article on LinkedIn called I Like, I Wish, I Wonder, she thought it might have some positive carry-over to our development process. If Christine thought that it might spark a change in our retrospectives, that was more change than I was hearing from the team in general (including myself, to be fair). So I decided we’d give it a shot.

Annnd we haven’t looked back since.

I won’t go too in-depth on how I Like, I Wish, I Wonder has rocked our retrospective world because I want to save that for a separate write-up. The point is that it did, and it’s all thanks to Christine for digging it up for us. We’ve started to completely overhaul different aspects of our development process now that retrospectives are effective. I really started to realize just how big of an impact it had when I was explaining some of the development process changes to our CEO. I remember thinking “Wow… If we wouldn’t have switched our retrospective process, we’d be nowhere near as efficient”.

So, thank you for the retrospective idea, Christine. For anyone else looking to flip retrospectives around, try out the I Like, I Wish, I Wonder scheme.

Personalities

I can imagine a lot of people in the development world don’t think too much about personalities. I know I didn’t. Sure, everyone is different. Everyone has their own effective ways of communicating, things they like, things they don’t like, and optimal situations for working. I get it. Now let me go do my work and you go do your work. In an ideal world, you just assume everyone can figure out everyone else that they’re working with, and things will just be fine. Except things are never ideal, and it never hurts to put in a bit more effort to make sure you can get your team up to speed.

So we tried something out. I worked with my HR manager (read: communicated a potential scenario for our development team, let her run free with her awesome creative ideas, and then helped her where she needed it) to roll out a Myers-Briggs personality test for a small sub-team of our development team. If you aren’t familiar with the tests or the concept, check out the link and read up on it! We figured it would be best to try this kind of thing out on a small part of the team to see if they would find value in it, and if so, we’d try the whole team.

After we rolled out the Myers-Briggs results with the small team, the benefits were immediately noticeable. We didn’t even have to leave the room before seeing the benefits. We knew there was some potential here, so we were already excited to try it out with the rest of the team. With everyone being aware of how other individuals may act and react when communicating and working, it makes a big difference in how particular scenarios are approached.

Thank you, Christine, for making differences in personality something to be cognizant of and then supporting our roll-out of Myers-Briggs. For anyone reading this that manages a team or is part of one… Consider the personality types of the people you work with. Maybe you don’t need a formalized Myers-Briggs plan, but it’s worth raising awareness of it.

Thank You, Christine

Christine, you’ve made a lot of great contributions to the team and I’d like to thank you for them. Our development processes have been able to greatly improve thanks to your initial suggestion. I’m sure we would have adapted over time, but your suggested tweaks have certainly acted as a catalyst. Your furthered support with the personality type analysis and subsequent rollout was also greatly appreciated. You were able to participate in our mini-experiment and offered great feedback to turn it into a success for the entire team.

Thank you. I’m looking forward to what this year will bring!


Swamped But Ready To Push Forward

Swamped But Ready To Push Forward (Image by http://www.sxc.hu/)

Mini Update

Just thought I’d get a quick one out there to say I’m still here. To be honest, I haven’t kept up to speed with my weekly updates or even sharing articles on social media like I try to do on a regular basis. But that’s just how life has been the past few weeks, and there’s no sense beating myself up over it. Time to acknowledge it, and time to push forward.

Work has kept me swamped with things to do. I’ve been busier than normal the past few weeks and it’s largely due to things going on at work. But I’m not complaining. I actually prefer times at work when I feel nearly overwhelmed. The added pressure (whether artificially inflated by my own doing or not) really helps me buckle down and become productive. It’s a great feeling to be able to reflect on a week’s worth of work and know that a lot got done. It’s even better to see the culmination of your work after several months and how far it’s come. If work weren’t enjoyable, I’m sure I’d have a completely different take on this one!

I’ve noticed that my post on creating a tabbed Android user interface has still kept up with a ton of traffic. I’m actually getting some private requests for help outside of public forums regarding this post, and I’ve been falling a bit behind on those too. It’s great to see people are actually benefiting from this blog post though!

What I’ve Been Doing

Not blogging. But you already knew that!

Well I mentioned work has been pretty busy. Magnet Forensics has launched another update to Internet Evidence Finder, so we’re now on version 6.3 of the product. Even though our process for launching a new release has come a long way, there’s still a ton of extra work and stress that comes with any release. Any potential bug that shows its face has to be closely considered for whether or not it should block the software from being released. Any odd behaviour with the application needs to be acknowledged and documented if it won’t be fixed for the release–So if customers contact us, our tech support can easily guide them through workarounds. Of course while that’s happening, the development team is already hashing out how to solve it for the next release.

There’s a lot involved for a release. It’s hectic but it’s exciting. Reflecting on everything that went into the latest release of our software, I’m still amazed. Every time we put out a new version we always make the previous release seem like it was a minor update. I’m extremely proud of the development team at Magnet for being able to rally and put together an awesome product, and of everyone at Magnet for being able to have an awesome version launch.

Thanks Team Magnet!

What’s Around The Corner

So I had actually started on a few things–I swear. I just didn’t get around to finishing them:

  • I have a recognition blog post I want to rework and get put out. This one is long overdue, but it’s near completion.
  • Two assorted leadership/startup-esque blog posts are in the works. These ones still need a ton of work.
  • My leadership blueprint blog post! I mentioned a while back now that I wanted to do a post on this, but I haven’t started yet. I’m really looking forward to this one.
  • Actually posting and sharing on social media again. Sorry!
  • Weekly article dumps. Again, once I start sharing, I can get back on track with these!

There’s a whole lot on the way!


  • Nick Cosentino

    Nick Cosentino

    I work as a team lead of software engineering at Magnet Forensics (http://www.magnetforensics.com). I'm into powerlifting, bodybuilding, and blogging about leadership/development topics over at http://www.devleader.ca.

    Verified Services

    View Full Profile →

  • Copyright © 1996-2010 Dev Leader. All rights reserved.
    Jarrah theme by Templates Next | Powered by WordPress