Wednesday, March 25, 2020

Working From Home with Kids

I’ve worked from home a fair bit over my career, occasionally for a week or two at a time. I thought I would share some things that have worked for me. In general, this works well for kids 4 and older, and these strategies, while helpful, may not be as effective with younger kids.
I’ve identified three main themes:

  • Set expectations
  • Be flexible and take advantage of the situation
  • Keep them busy

Set expectations

Typically working parents have two modes: 1) working out of the sight of the child ,and 2) present to the child and available to meet all of their needs. These boundaries are gone. Working from home can be confusing as the parent is visible, but unable to give full and consistent attention. Set boundaries and rules so that the child can better understand. E.g’s:

  • When I’m in my office, I’m working. When I’m outside my office I will be with you.
  • I have a meeting for 1 hour, please don’t be loud or interrupt.
  • I will work for 2 hours then make you lunch.
Over the past year, I’ve had incredibly adorable moments from my then 4 year old.

  • Hearing other voices he quietly tiptoed into my office and quietly whispered “are you in a meeting?”
  • Checking to make sure I would be available: “I have to go poop, will you be able to wipe my butt in a few minutes?”
Likewise, set expectations with your colleagues. More often than not, I find that nobody expects me to work, and that its my own desire to please that influences me to respond to requests after my normal work hours. You can’t be expected to work 12 hours because your home is your office; like Nancy Reagan taught us, “Just say ‘No.’”

With two working parents, consider how you can work around each others responsibilities to set expectations and take turns meeting children’s needs.

Also, despite everyone's best efforts, kids will screw up, you will be frustrated and you may lose your temper, raise your voice and be unfair. Remember to be open and honest about these situations. An adult apologizing when we are wrong is an amazing experience for a child. It builds trust, and sets an example for how they should address their own mistakes.

Take Advantage of the Situation and Be Flexible


My children are my most important responsibility and my relationship with them the most fulfilling party of my life. Working from home provides some amazing opportunities. You can take a 15-30 minute break in the middle of the morning to play Candyland or take a mid-afternoon walk around the block as a family and bask in the sun (sorry Seattle). Also, I find changing my scenery and posture great when I need to be more creative. Watching a squirrel run up a tree is a great input randomizer for diffuse thinking.

In addition, if you find it difficult to get a whole day’s worth of effort in normal working hours, consider other hours. You may find yourself more productive after the kids are in bed and have a 2-4 hours block that you don’t mind working instead of during their working hours.

With two working parents, it may be effective for one parent to work in the morning, another in the afternoon, and both at night, IF it works well for all. As always, speak with your manager, monitor your situation, and adjust if it is unhealthy for you.

Keep them Busy

I'll add details for this item in a future post. But check out some educational resources linked below.

Resources:

Thursday, December 27, 2018

Mastering CloudFormation for API Gateway Deployments

I recently spent a fair amount of time trying to write a CloudFormation template for API Gateway to do precisely what I wanted to do. I struggled to make this happen, and failed to find good community resources to supplement the official documentation. One forum thread seemed to describe exactly what I needed, but the conclusion in the thread seemed to indicate that it wasn’t possible. Nonetheless, it was helpful in understanding some of the problems I was facing. Here is what I wanted CloudFormation to do with API Gateway:
  • Create an API instance 
  • Configure a stage 
  • Deploy API changes from swagger 
Through trial and error and discovering basic concepts in CloudFormation, I was able to get exactly what I wanted. I hope this post helps others write a perfect template for their needs.

Problems I Ran Into

As I attempted different appraoches, I experienced a few common problems:
  • Deployment of revised swagger would not occur 
  • Updating the stack with revised swagger would error with “stage already exists” 
  • No deployment history

CloudFormation Basics

Being new to CloudFormation, I didn’t fully grok some key CloudFormation concepts which was a barrier to getting my template right. The primary concept is that CloudFormation templates dictate desired state, not a set of operations to perform. If a resource is defined in your template, it will be created. If a resource already exists, it will not be created, but can be updated if its properties change. If a resource is removed from the template it will be deleted.

API Gateway Basics

  • Swagger is used to define a REST API. 
  • That REST API is deployed. 
  • A stage references a deployment to make the API available via an endpoint.

The Template

---
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Setup our API Gateway instances

Parameters:
  StageName:
    Type: String
    Default: 'example_stage'
    Description: 'The name of the stage to be created and managed within our API Gateway instance.'
    
Resources:

  Api:
    Type: AWS::ApiGateway::RestApi
    Properties:
      Name: ExampleApi
      EndpointConfiguration: 
        Types: 
        - REGIONAL

      # The body should contain the actual swagger
      Body: $SWAGGER_DEFINITION$

  # Timestamp is added so that each deployment is unique. Without a new timestamp, the deployment will not actually occur
  ApiDeployment$TIMESTAMP$:
    Type: AWS::ApiGateway::Deployment
    DependsOn: [ Api ]
    # we want to retain our deployment history
    DeletionPolicy: Retain    
    Properties:
      RestApiId:
        Ref: Api
      
  ApiStage:
    Type: AWS::ApiGateway::Stage
    DependsOn: [ApiDeployment$TIMESTAMP$]
    Properties:
      RestApiId:
        Ref: Api
      DeploymentId:
        Ref: ApiDeployment$TIMESTAMP$
      StageName: {Ref: StageName}
      MethodSettings:
        - ResourcePath: "/*"
          HttpMethod: "*"
          LoggingLevel: INFO
          MetricsEnabled: true
          DataTraceEnabled: true
          
Outputs:
  Endpoint:
    Description: Endpoint url
    Value:
      Fn::Sub: 'https://${Api}.execute-api.${AWS::Region}.amazonaws.com'          


Key Points

The deployment resource can specify a StageName and StageDescription. If this is done the deployment will implicitly create a stage that is not managed by CloudFormation. If we attempt to create a stage with the same name we’ll get an error that it already exists. Instead we’re better off creating a deployment that doesn’t prescribe anything about the stage and explicitly defining a stage resource.

Each deployment needs a unique id. Otherwise, CloudFormation will determine the deployment already exists and will not create a deployment. Without a new deployment, changes to our REST API will not be visible. Furthermore, we set a deletion policy on our deployment to retain the deployment. Otherwise, when the timestamp on our deployment changes, CloudFormation will want to delete the old deployment. If this deletion occurs, the deployment is removed from our stage deployment history. With this policy, the deployment is removed from the stack but not deleted from API Gateway.

EDIT:
A script must be written to preprocess the the template and replace the $TIMESTAMP$ token with the timestamp WITHOUT any separators e.g. 05012019355 Thanks to somebody for pointing this out in the comments.


Disclaimer: I wrote this post as an enthusiast. The content is not the official position of Amazon or AWS.

Saturday, February 10, 2018

Doing taxes on a virtual machine

A few years back I started using a virtual machine (VM) to run my tax software. I hope by sharing my motivation and method, those new to virtual machines will gain some exposure and find them useful in other endeavors. Since this tackles some advanced configuration, it may also be helpful to those trying to use VirtualBox outside its default configuration. Virtual machines are essentially a completely different computer running as software on a physical computer. They allow you to run a different operating system, test software without affecting your regular machine, and easily snapshot your machine state and restore it at a later time. One limitation is that running a VM will use about twice as much memory, since you're running another instance of an operating system and whatever applications. Another limitation is that performance can be reduced for certain things, for example graphics intensives tasks like games or 3D visualization.

VMs
Two different VM's running on my machine

My main motivation for using a virtual machine to do my taxes was that I wanted to be able to use the software from either my laptop or my desktop interchangeably. Normally, one might choose to install on the desktop then simply remote desktop into the desktop. However, I also wanted to be able to access the software while other people were using desktop. Allowing multiple users at the same time on a single machine with Windows normally requires a server edition or modifying Windows in a way that is not consistent with your license agreement (e.g. https://www.serverwatch.com/server-tutorials/remote-desktop-connections-for-multiple-users-on-windows-10-and-windows-server-2012.html).

Another perceived benefit was not having to untidy my desktop with new installations every year. Instead these are all within the virtual machine. Even better, if installing one version uninstalls the previous years software, I would only have to restore a snapshot to retrieve a state that had the correct software installed to amend a return.
Snapshots of a VM, showing multiple states that were "saved", that can be restored or branched from































One key feature I need to enable for my use case of using the virtual machine from any machine inside my house is Remote Display. This is a setting directly on the VM (not the guest OS) that allows me to directly Remote Desktop into the VM, even when somebody is using the host machine.

Another huge reason I chose to use a VM is because it is fun experimenting and playing with new and different things.

Next year, I might play with using a EC2 instance for this so that I don't need to dual purpose my gaming machines for this and worry about memory management.

Prologue

Another drawback of VMs, having to keep additional machines up-to-date:







Monday, December 25, 2017

Give to those less fortunate, today!

Walking from the parking garage to my office in the wee hours of the morning, I usually pass a couple homeless people, still asleep, on the sidewalk. I've felt a desire to make a positive impact in their lives, something big and personal, but haven't really known what I can do that is within my means and would make a lasting positive impact. When I brought the whole family to see downtown and my office on a bitter cold night, over dinner I explained that the people they saw were homeless and had to sleep outside. My five and seven year old kids, too young to be touched with any jade, immediately wanted to step in and do something. They suggested we bring them home, or let them sleep in our car. I wish I could.

With the impending tax changes, I will be most likely going from a situation where I can claim itemized deductions to one where I will claim a standard deduction. Since for every dollar I donate, I will have to pay about 30 cents less in tax, its effectively a 30% discount on any charitable contributions I make in 2017 that I won't get in 2018. You may be in a similar situation if you plan to itemize your deductions (which usually only makes sense if your state/local taxes, mortgage interest, and charitable donations exceed $6,350 if filing single or $12,700 if filing jointly).

Combining my desire to help with my strong compulsion to optimize, I just gave to a couple charities that I hope will make a difference in the lives of those I pass nearly every day downtown. I don't say this to brag, but because I think that giving is contagious. I hope that my giving encourages others to do the same. I'm also hoping the knowledge that this might be the last opportunity to take advantage of the current tax law will encourage others to give too, especially those that have been meaning to, but haven't gotten around to it. Hurry up and get that donation in before the year is over!

Friday, November 17, 2017

Writing Culture, Listening Commute

The other day at work, there was a meeting for all the hires in the past year. It included a panel of some experienced employees and the opportunity for us new hires to ask questions about the organization and company culture. The topic of our writing culture came up. The narrative documents we create were described as not only being key to informing the reader, but it was stressed that the process of creating the document ensures that the writer is fully thinking through and understanding the problem space. This really resonated with me, as I think it says something pretty similar to what I stated in my previous post:

"There is something about writing that ... makes reflection more deliberate and effectual."

To me, this validated my position. Its nice to know you're not crazy, and better yet, get a little confidence to help boost your motivation. Writing prompts and forces you to answer questions that are too easy to miss or ignore otherwise. That said, I haven't done any more reflective writing, but I will.

Since I have a rather long commute, I've been taking advantage of podcasts to educate and entertain myself. I though I'd share my list of favorites:

  • Revisionist History by Malcom Gladwell
    • Revisiting and understanding historical incidents
    • Just listen, its great. if you don't like the first one you listen to, try another. Its a really amazing podcast.
  • S-Town
    • Amazing true story about a brilliant guy in a backwoods town. He contacts a reporter to investigate a murder that the town in covering up.
  • Java Pub House by Freddy Guime
    • The production quality isn't amazing, but I really appreciate the content and am using it to help kickstart my journey towards Java mastery.
  • Mission to Zyxx
    • Think improvised Star Wars parody. I've laughed out loud... alone in my car. I think people saw me.

A couple of these were recommended by a great guy I used to work with. He's a smart guy, you should check out his blog.

I'm planning a post that will refer to one of the episodes of Revision History, Miss Buchanan's Period Of Adjustment. Have a listen, and you'll have better context when I get around to posting about it.

I've also spent a bit of time lately playing PLAYERUNKNOWN'S BATTLEGROUNDS (PUBG) in addition to my old standby, Rocket League. For those not in the know, PUBG is a multiplayer online game that starts with about 99 players dropping out of an airplane onto a multi-kilometer island, scavenging for weapons and equipment, and fighting for their life as the playing area gets increasingly smaller. The goal: Be the last man standing. I've played games where I've gone 20 minutes without seeing anybody only to be picked off by a sniper rifle when I'm one of 14 people left. Other games involve running into somebody right at the beginning while you're both still weaponless. It's intense and fun. I've felt enough adrenaline from it that I don't play when I know I want to be asleep within an hour.

Cheers

Thursday, October 12, 2017

And.... we're back!

I decided to try to resurrect this blog again. The biggest hurdle isn’t getting started, it's finishing a post; finally having it good enough. I’ve started several posts over the past few years, but never finished. Realizing this though, the knowledge I may never publish starts to becomes an impedance to starting. I’ll try to overcome that through high-level outlining and shorter posts, breaking things up if necessary.


On the way home from work yesterday, I decided I wanted to do more reflective writing. To me this means: Looking at my life, deciding what I want to do or change, coming up with a plan if possible, and documenting it. There is something about writing that I think makes reflection more deliberate and effectual. Without it, I think a train of thought can become interrupted and trail off without any resolution. I used to do this often in college but haven’t done much of in the past 15 years. This post serves as a public version of it.


I also decided I wanted to focus on trying to do three things on a regular basis: Learn, Do, and Write


I feel like I’ve done well with learning. I’ve completed a lot of MOOC courses (I recommend starting with Learning How To Learn on Coursera) and reading (currently reading Thinking, Fast and Slow) but I’d like to continue and increase this.


“Do” more or less means projects, mostly software, but it could be some sort of hobby building or community service. I’ve started but abandoned a few things. I will probably pick a couple of them back up, specifically an engine for the board game Sorry that I can develop AI / Machine Learning players to simulate against each other as well as a machine learning approach to playing Ultimate Tic Tac Toe. Ultimately, I’d like to do something that is more widely beneficial but this will be a start.


Lastly writing is a way to share what I learn and do, as well as accomplish my goal of more reflective writing. Again, this blog provides an avenue to do such.


Some things I might post about soon include:
  • Things I like about my new house
  • My new job and commute
  • Plan and progress on my personal software projects

Thanks for reading

We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.

Thursday, April 7, 2016

Maintain System Responsiveness when Running a Parallel Visual Studio Build

The recent addition of encryption to laptops with spinning platter drives has proven painful for many developers on my project. A big complaint has been the lack of responsiveness of the system while doing a parallel build. Tasks that should be nearly instantaneous take several second to nearly a minute. Since some of these tasks such as switching between files or applications might need to occur many times in a minute to complete a larger activity; these delays stack and take away the opportunity to be productive doing other things like preparing slides or creating documentation. This article provides a work around to solve this problem until SSDs are available to all developers who need them. Note that improving your system's responsiveness while building will increase the time that it takes to build.

This method works by lowering the I/O priority of the processes doing the build. This is not possible using the built in Windows Task Manager. Instead use either Process Explorer, which is available for free from Microsoft, or Process Lasso, which has a free evaluation but requires a paid license for commercial use. Process Lasso also has a neat feature that I'll go into more detail about later that automatically changes the priority of the processes any time a build start.

Using Process Explorer you can change the priority of all MSBuild.exe1 processes to Background (Low I/O).

Using Process Lasso you can change the I/O priority of all MSBuild.exe1 processes to Very Low. You can do this "Current" which will only affect the currently running processes, or do it always which will modify any MSBuild.exe process currently running or created in the future while Process Lasso is running. It took some work to get this to work, I had make sure I had it configured to control all users processes, then make sure I closed and reopened Process Lasso after installing. If you want this feature to work, play with it and make sure it is.

A few things to note: If you work on some unrelated code and want to build a small project while a big parallel build is running, it will take a really, really long time for that small project to build. Get around this by cancelling your large build and letting your small project build then resuming your large build. Remember, the solution described here is just a work around, if you want to do things in a reasonable way, you're going to need an SSD. Also, if your system is unresponsive while building, you'll probably notice other times that it is unresponsive during heavy I/O as well. If you your system to always be snappy, you're going to need an SSD. And, once again, if you are using this method to do other things it will make your build take longer. If you want to be able to work while building and still have reasonable build times, you're probably going to need an SSD.

One other thing I noticed is that Intellisense can take a long time to run and its heavy I/O exacerbates the problem. I disabled Intellisense until I get an SSD which will make Intellisense usable again.


1. Its necessary to do this to the MSBuild.exe processes because they are always started at normal priority, despite their priority of their parent process