Category Archives: Miscellaneous Tech Explorations

Push Your Outlook Calendar to Google Calendar with Microsoft Flow

Sometimes you may want your Outlook Calendar events copied to Google Calendar. This can be done with a handful of clicks and Microsoft Flow. Additionally, this is completely free if you have Office 365.

EDIT: Based on some comments, I would like to clarify that this template only works for copying over your calendar events when they are initially created, i.e. inserts. It does not process updates or changes to your calendar events. You will likely have to look into paid software for this functionality. I’ve changed the title from “Sync” to “Push” to reflect this.

What is Microsoft Flow?

Microsoft flow is the third piece of the Microsoft Power Platform:

  1. Power BI – Interactive analytics.
  2. PowerApps – Low-code mobile and web applications.
  3. Flow – User-friendly event integrations.

The Power Platform is a set of tools aimed at business users that want capabilities that were originally limited to professional coders or BI developers.

Out of the three, Microsoft Flow is the weirdest because it’s so granular. The unit of measure for Power BI is the report, the unit of measure for PowerApps is the application, and the unit of measure for Microsoft Flow is the flow or event trigger. And event triggers are really, really tiny.

Essentially, a flow is a trigger and then a series of actions, much like you might map out with a flow chart. It functions similarly to IFTTT or Zapier. I think of it as the glue or connective tissue between different applications.

In this post, we are going to glue together our Outlook Calendar to our Google Calendar.

Why connect calendars?

Back when I worked a normal job, I had two calendars: Office 365 for work and Google for home. Now that I work for myself, that’s a lot more complicated. Sometimes a customer will create an account for me in their network. Sometimes I’ll partner with other consultants and work as part of their team. And of course, I’ve got my own work email at eugene@sqlgene.com.

I need all of these calendars to consolidate to one place. My natural inclination and personal preference is to put it all into Google. Now, there are sync apps available, but this sort of problem is a perfect use case. A calendar event is created in outlook, a flow is triggered, and that information is transferred to Google.

Using Flow

To use Flow, I simply went to https://flow.microsoft.com and searched for Google Calendar. The template search for Flow sorts by popularity, and unsurprisingly the top result was exactly what I wanted.

image

Once I selected the template, then I needed to log into my Google account.
image

Then I just needed to select the calendars from both accounts that I wanted to sync.
image

And that’s it! I was pleasantly surprised how easy it was to do, and I’m interested to see where else I can use Microsoft Flow.

Getting Kubernetes and Containers to “click” for me

Today I had the pleasure of co-hosting the GroupBy Conference. Part of that involved co-hosting as Anthony Nocentino present on Kubernetes. His talk was based on his Pluralsight video on the same topic. After watching his presentation, Kubernetes finally clicked for me. I think I get it.

Before you can get what Kubernetes is about, you need to understand one layer lower and get what containers are about. Aaron Nelson has written a great article on setting up SQL in containers in 5 lines of code. This helped me see how quick and easy it is to spin up a container. Additionally, I see how useful it is to be able to set up a container, kill it and spin up a new one, all in a matter of seconds.

Once you start playing around with containers, you realize you need some way to control and organize them. If you are going to treat them like cattle, not pets, then you need to higher a cattle wrangler. Kubernetes is that cattle wrangler. Or should I call it a kattle wrangler?

I wrote last week about how The Phoenix Project totally altered the way I think about work. It also altered the way I think about deployments and devops. To go fast, to make 10 deploys per day, you need to remove humans as much as possible. You need infrastructure as code. Kubernetes turns your datacenter into code.

I still have some reservations about SQL Server Big Data edition, and I have to wonder when Kubernetes is overkill. But when you need to do dozens of deployments, or blue-green deployments, or implement stateless microservices, it’s a total no-brainer.

Create a Power Query custom data connector in 10 minutes

Getting set up

When I heard about custom data connectors for Power Query, I had assumed there would be a lot of work involved. While there is definitely quite a bit of work in implementing advanced features like query folding,  creating your very first connector is simple.

So, first you need Visual studio installed and the Power Query SDK installed as well. Once you do that, you will see Power Query as an option when creating a new project. Visual studio will also have support for .pq or Power Query files.

image

Once you create a new data connector project, you are presented with two main Power Query files. The first one, is simply a test query you can run on demand to test your connector.

image

The other file is your data connector. It has a bit of boilerplate to specify the types of credentials it accepts and publishing details such as beta status. Otherwise there is just a little bit of code defining the actual functionality. In this case we are defining the Contents function, which acts as a hello world:

image

If we run it as is, our test query will be run and we’ll see the results in a testing program.

image

Adding a function

So now, what if we want to add some more functionality? Say maybe a function to square numbers. First, we’ll add a SquareNumbers.Squared function to the main file:

shared SquareNumbers.Squared = (x as number) =>
let
y = x * x
in
y;

Then we update the sample query to call out function:

let
result = SquareNumbers.Square(7)
in
result

And it works as expected:

image

Exporting the connector

Once you have the connector working the way that you want,  run a release build in visual studio. This will create a .mez in the bin/Release folder of your solution. Copy that file to the [Documents]\Power BI Desktop\Custom Connectors folder. You will likely have to create that folder.

Whenever you open Power BI Desktop, it will recognize the connector but won’t let you use it because of security settings.

image

To get around this, go into the options for Power BI Desktop and then security. Under security, select “Allow any extension to load without validation or warning.” Then Restart Power BI Desktop.

image

Now we can see it is available in our list of connectors.

image

By default it will call the Contents function:

image

But we can easily modify the M code to call our squared function as well.

image

Which will give us the output we expect.

image

What next?

If you are interested in going deeper with Custom Data Connectors, such as adding a navigation view or  query folding, check out the TripPin tutorials.

Keeping up with Technology: a Guide to Drinking from the Firehose

I often ask people with more experience than me “How do you stay relevant in our field?”. I joke that I live in perennial fear of being replaced someday, by a 22 year-old with no family commitments. Really, it’s a joke. Really, it’s a fear.

So, let’s talk about how to keep up with technology.

 First, we must grieve.

So here’s the secret to keeping up with technology. You can’t.

There are too many technologies, too many features, too many updates:

  • SQL Server 2017 is coming out this year.
  • Big data technologies are so numerous as to be indistinguishable from Pokemon.
  • PowerBI ships features on a weekly basis.
  • Worst of all, you’ve got NoSQL which is literally the mathematical dual of SQL. It’s everything that SQL isn’t, by definition!

It’s all too much.

This realization is likely to be expressed in the 5 stages of grief.

  • Denial. Other people can keep up, why can’t I? I’m learning tons of stuff all the time! This is easy.
  • Anger. Why they heck are they making releases every month!? When did Microsoft go agile? I thought SQL Server versions every 2 years was bad enough.
  • Bargaining.  Okay, maybe if I stick to core SQL stuff, I’ll be fine. Hadoop seems like a fad. And Azure is never going to be popular with my  company.
  • Depression. This is impossible. I’m going to lose my job when I’m 40 years old and arthritis starts kicking in.
  • Acceptance. There’s more happening than I can ever learn, but Hacker News doesn’t define my success as an IT professional.

This post isn’t about doing the impossible. It’s about making the most of your resources. That’s something that you can do.

Are you asking the right questions?

I would like to propose that it’s not about keep up with technology at all. This is a second-order goal, a proxy of sorts. Really, there are two questions at the heart of things:

  1. How do I keep my job?
  2. How do I keep my friends?

This is why technology causes so much angst. We want to learn enough that we can put food on the table; and we want to do it in short enough time that it doesn’t destroy our personal lives.

Next, we must think.

In order to get ahold of the the problem, let’s use some analogies: investments and radioactive decay.

How learning is like investing

Do you have a retirement account? If so, do you invest primarily in stocks or bonds? Why?

If you are at all young, the you invest primarily in stocks. That’s because stocks have a higher rate of growth than bond. You are trying to outrun inflation, where the value of your money is steadily decreasing. This is like your current knowledge becoming outdated. All that vb6 coding knowledge is like a pile of cash in your mattress. When I was a kid, $20 was a lot of money.

The next question  is, do you invest in just one stock, like Apple? No, you diversify your portfolio. High growth stocks go up, on average. Some however, tank. High growth means high volatility. A good example is Apache Flex. It used to be a really promising application platform, until Steve Jobs killed Flash.

So we’ve got two risks to our learning portfolio: Losing value in our existing knowledge, and making the wrong choices for our new knowledge. These different risks have different mitigation strategies.

Specialization and generalization

These comparisons to bonds and stocks relates to the challenges of specialization versus generalization. We specializes to pay the bills. We generalize to keep our jobs.

Specialization is how we get paid. The reason anyone pays us is because we have skills or knowledge that is not quickly acquired. The reason consultants like David Klee make gobs of money is that they have taken a subject, like virtualizing SQL, and have gotten really  good at it. To get paid more than minimum wage you are going to need some level of specialization.

Generalization is how we get paid in 10 years. You need to be specialized to get paid right now, it’s a short term investment. However, that investment decays, just like the value of money in your mattress. To get paid a decade from now, you need to broaden your horizons. If you are a data person, it might mean learning R and python. It might mean learning Azure. Heck, it might mean PowerShell and Docker.

The tension here is that you need both. You need paid now AND in 10 years. Kevin Feasel talks about trying to find that right balance. I’m not here to tell you what that balance is. What’s important is that each has different constraints. Specialization requires focus. Generalization requires time. More on that later.

How learning is like radioactive decay

Let’s take another approach.

Our knowledge has a limited shelf-life. Allen White said, in the SQL Data Partners podcast, that you have to retool yourself every 5 years. In college, I remember joking that half of what you knew would be useless in 5 years.

Well, what if we took that literally? How would we model that? How would we think about that?

In nuclear physics, there is the idea of a half-life.  You have radioactive material that decays in half every X units of time. Why not apply this concept to IT? The half-life in this example then would be 5 years.

So the next question is this: if half of what you learn is either irrelevant or forgotten in 5 years, how much do you need to learn in a given year, to keep steady? Let’s ask our friends at Wolphram Alpha.

image

If x is our rate of decay and our half-life is 5 years, we can work backwards from that and solve for x. In this case, x equals 87%.

So, what that means is that if today you know 100 relevant things, then a year from now you’ll only know 87 relevant things. That’s like going from a solid A+ to a weak B+. You just lost a whole grade!  Not good.

Below is a curve showing what this model looks like over 10 years.

image

Changing the math

Well, this isn’t great. What if I want to know 120 things? How can we do that? One option is to learn more things.

Learn more things

If normally we have to learn 13 things each year, then we have to learn another 20 things on top of that. Or, if you are patient, you can learn an extra 4 things each year, and eventually  you will get there.

image

Slow the decay

Another option is to change the rate of decay. Instead of learning more things each year, what if we didn’t have as much decay? If we can slow that rate of decay just a little bit, to a half-life a 6 years instead of 5 years, we’ll have the same effect. That means that instead of brute-forcing things, we might be able to be smarter.

What does this all mean?

So that gives a path forward. We need to either

  1. Increase the number of relevant things you can learn each year
  2. Or, decrease the rate of decay for relevant knowledge

These are the only three knobs we have. Either learn more stuff, learn the right stuff, or learn stuff that lasts longer. Let’s investigate all three.

How do we fix this?

Learning more things

So one solution to our dilemma is to brute force it. Let’s just learn more things and hope that they are the right ones. To do that, we can look at our inputs and constraints.

What are the constraints that affect our learning? There are 3 big ones I can think of:

  1. Time
  2. Energy
  3. Money

If we can increase any one of these, then we might be able to increase how much we can learn in a week.

Time

So, lets say we decide to go the simple route and go for volume.  You’ve got a 168 hours in a week. You can’t make any more hours, and if you try to use all of them in a week, you are going to need some amphetamines.

So, if we can’t create more hours, how can we make more time? One option would be to cut out other activities. If you are willing to quit watching TV or playing video games, that frees up more time for learning. You could use a service like toggl.com to do a time audit and see where all of your time goes.

There is a limit to going down that path, however. You need to sleep. You need to have a social life. You need to have some fun. Like we said, you want to keep your job and keep your friends.

Multitasking

Another option is to multi-task. There is a lot of learning you can do that while doing other things. Things like podcasts are more about exposure than mastery. You can still get value out of them, even while mildly distracted. There are a number of times you could listen to a podcast:

  • Commuting
  • Exercising
  • Washing dishes

This is a way to take back time you are spending on other things without giving up all your free time.

5 minute learning

Another way of reusing your time is taking advantage of those weird breaks in time. Those breaks that are too small to get anything meaningful done. The 15 minutes at the doctor’s office. The 5 minutes waiting for a meeting.

Feed readers are a great way to take advantage of these weird units of time. With Feedly, I’m able to to read a blog article during the 5 minutes I’m waiting. This is way more useful than playing candy crush or reading twitter.

Focus/energy

Okay, so let’s say you’ve managed to find more time in the day. Unfortunately, not all learning takes the same amount of energy. Reading Twitter is mindless. Configuring a homelab requires focus. Listening to a podcast is mindless. Making a presentation takes focus.

One way of getting more focus is to prioritize the harder learning for when you naturally have focus. For some people this is early morning. For many people this is the weekend. I know that after a long day of work, I’m wiped out.

Part of that is learning to take care of yourself. Eat healthy. Exercise. Get sleep. Focus is so easy to destroy by poor lifestyle.

Finally, if you schedule time consistently and push everything out, you can have more focus. I also find having a separate office/learning space helps with this too. Cut out the distractions. Install StayFocusd for Chrome to block timewasters.

Money

If you are anything like me, money is your most plentiful resource of all 3. When I was kid, I had no money at all, but tons of time. When I was in college, I had pretty much no money, and a good bit less time. Now that I have been working for a while, that equation has flipped. I’ve got plenty of money, but no time to use it.

If you are an average DBA, you make plenty of money. According to the Bureau of Labor Statistics, the median salary for DBA’s is $85,000. The median for all occupations is $37,000. Think about that, that’s like 2.5x as much.

Now you may say “Hey, I don’t live in San Francisco.” or “Hey, I just got started.” Let’s take those factors into account. The market here in Pittsburgh is terrible, salary-wise. Even if you are just getting started in the field, you are probably making at least  40K.

image

Let’s do a little math on this. If you make 40K per year, you make roughly  $20 per hour. that means your time is worth $20 per hour. If you can spend $5-10 to save an hour of your time, do it.

If a $50 book saves your 5 hours of Googling, buy it. If a Pluralsight subscription saves you 30 hours per year of frustration, buy the subscription. Don’t be afraid to spend money to save yourself time and energy.

Consider budgeting your money

If you don’t feel like you have a lot of money, I would deeply urge you to start budgeting. I used to look at my checking account to see if I had money. Then if there was money there, I would spend it. This would work until my car insurance bill would come in, and suddenly I needed $600. And just as suddenly, I didn’t have nearly as much money as I thought

Get a budgeting program. There’s some free one’s out there, but I use You Need a Budget.

Learning the right things

So we covered how to learn more things. An alternative is to learn the right things. If you learn the right thing, you’ve have less wasted effort.

Lean on curation

Sturgeon’s law says that 90% of anything is crap. That’s certainly true of learning materials. Not only is there a lot of bad training out there, but there’s a lot of content in general that just isn’t relevant. It’s cool that someone wrote an OS in Rust, but it’s probably not relevant to your job in any significant way.

If you are time poor or focus poor, you need a gatekeeper so the flood of possibilities doesn’t overwhelm you. This means depending on curation.

That curator could be you, first off. One of the reason I suggest a feed reader over Twitter is that you are able to heavily curate the content that hits your eyes. You are the one picking the blogs to read instead of the pachinko ball machine of social media and fate. You are the one deciding what’s relevant to you.

Another options is to depend on professionals in the field that you trust. Find people to follow that consistently have good material or recommendations.

The third option is to pay money. Sure, there’s some paid crap out there. But general it does act as a quality filter. Things like written books and video libraries are far less likely to be total crap, because those things have editors and investors and such. Someone was being paid to make sure it was worth making. Additionally, the author worked hard to condense the knowledge into a concise format. Be willing to pay money.

Having a plan

Okay, so now you are investing your time and energy into quality materials, but are you learning the right things? Are you learning the things that are right for you? You need to have a career plan. You need 1 and 3 year goals. Otherwise your career plan will be a spread out mess.

Figure out where you want to focus, figure out where you want to go. Pick a specialization. More of what you learn will be relevant if you know what that is.

Learning things that last longer

Okay, so we are learning more things and more of the right things. But we still have the problem that our knowledge is decaying whether from atrophy or irrelevance. This is the last step in the funnel and the last thing we can optimize.

Improving retention

One way to keep ahold of knowledge for longer is to lean on active learning. If something goes in through your eyes and ears and back out your fingers and mouth, you will retain it for longer.

If you want to specialize and go deeper, you need to do things like blogging, presenting,coding, etc. Reading isn’t enough. Writing isn’t enough. if you truly want to learn, you have to do.

Reddit and hacker news are good for exposure to a topic, but exposure fades quickly. Use exposure to get a lay of the land, then go deep once you find the right things to learn. If you focus on mastery, you are going to learn things in a way that last longer.

Avoiding planned obsolescence

Another issue is that certain areas of knowledge just have a faster rate of decay. Some of these are facts tied to a specific version of a technology. Another thing are unproven technologies that might turn out to just be fads. Big data is still in this phase, where there are so many technologies that will be gone forever in 5 years.

People change far more slowly than technologies, so skills relating to them last far longer. Soft skills never go out of style. Communications skills never go out of style. If you learn how to write an abstract today, that knowledge will still be relevant 40 years from now.

The fundamentals last longer too. The core basics of computer science are far more establish than this weeks JS framework. If you have solid underpinnings, you can take your knowledge of C++ to Go, for example. If you understand how a ACID and CAP theorem, The new consistency models of Cosmos DB will make sense. Under understanding of one layer beneath will allow you to jump to new technologies far quicker.

Putting it all together

To summarize what we talked about:

  • Take advantage of multitasking to get back more time. Listen to podcasts while you drive or exercise.
    • Invest in a pod catcher. I use itunes and an iPod nano.
    • Invest in a feed reader. I use Feedly.
  • Take care of yourself, physically. Diet, sleep and exercise will all improve focus.
  • Schedule time to maintain focus. Treat focus as your most precious resource. Don’t browse twitter when you are firing on all cylinders.
  • Be willing to spend money on curation. There is a good chance that you have more money than time or focus. Be willing to spend money to avoid wasting time.
  • Understand exposure versus mastery. Spend your time on exposure and your focus on mastery.
  • Pick a specialization. Have a plan on what technologies you need to go deep on. You won’t get there by accident.
  • Learn things that last. Learn the fundamentals. Learn internals. Learn people skills. Do home labs.

Starting a todo app: part 2, technologies

Last week, I wrote about my desire to make a todo app. this week, I’m going to talk about the technologies I’m using and what I think so far.

Currently, I’m building this app on the following technologies:

  • C#
  • Asp.net
  • Azure
  • DocumentDB
  • Xamarin

Notice any pattern? I am a giant Microsoft shill. My career focuses on Microsoft SQL server and Power BI, so It’s in my best interest to learn surrounding technologies.

Of course Microsoft keeps doing weird things like including Git in Visual Studio, or putting SQL Server on Linux. So the surrounding technologies get a big broader these days.

C#

I really like C#, but I don’t feel like I “get it” just yet. I think it’s clean and understandable as a language, but it feels like 80% of the language is learning about random libraries and classes. And if you don’t know that image

I can’t say I have a good idea when to choose between one or the other within a project. It seems like 3 very different modes of working and routing.

Azure

Azure is to today what virtualization was 5 years ago. The cloud is just going to keep getting bigger and bigger and bigger. If you aren’t learning about it now, you are going to be very remiss about it 5 years from now.

Unfortunately most of us don’t have a need for cloud hosting. You probably don’t have a need for your own personal Azure Active Directory or Hadoop Cluster. So a lot of times, that means doing projects and labs to learn it preemptively. If you are waiting until it comes up at work, it’s going to be too late.

DocumentDB

DocumentDB is… interesting. Brent Ozar mentioned that he is using NoSQL for a new project. He picked Amazon DynamoDB over DocumentDB. I’m picking DocumentDB as a way to learn Azure.

So, why go the NoSQL route? Partly it’s something new to learn, but there are a couple of advantages. I think Document databases when you want to store lists of things or hierarchical data. In my app, I have lists for times of day, task categories, and tools/contexts. I want to be able to do filtering on these things, which can be clunky in SQL.

Things I like

Some other things I like so far are the dynamic schema, dynamic serialization, and TTL. Normally I appreciate have a well-defined structure to my data. However, this is a design that’s constantly evolving and changing. It’s hard to plan it up front. With Document DB, I can add a field to my model class in C#, set a good default, and that’s it. Now I have a due date field

The other thing I like so far is the TTL feature. I can mark completed tasks with a ttl of a week. Then, if I don’t touch them for  a week, they will self-destruct. That is a really cool feature.

Things I don’t like

One of my big pet peeves with DocumentDB is that collections are billing containers not logical containers. This to me just seems silly. If I want to have different types of objects, such as summary data, I have to store them all in the same place or pay 2-4x as much. That approach feels really messy.

Another thing that’s an issues is case sensitivity.  Because it’s a dynamic schema, if I get a column name wrong, it won’t tell me I screwed up. So I have to remember if my columns start with a capital or not. Also, if I do a contains I have to get the case right for that as well. This is more of a mindset shift than an actual issue with Document DB.

Finally, because it’s JSON there isn’t a date standard. C# does a great job of serializing and deserializing things. However, if I want to store the dates in a human writable way, I have to find another option. For all of my pure dates I’ve been using an integer for now. So September 11th would be 20160911. It requires an extra step to convert or add days to a date, but at least it’s easy to edit. Additionally, because it’s an int, it allows for range filtering.

Xamarin

Xamarin technology is pretty exciting. I absolutely love the idea of being able to write C# and deploy it to a bunch of platforms. It’s especially exciting because my phone is a great place to run a todo app.

That being said, if understanding C# is difficult, then understanding C# that’s a thin wrapper on Java is even worse. I am finding the learning curve on Xamarin to be a bit difficult.

Starting a personal todo app

Todo apps and gamificiation

Todo apps have been done to death. If you go on Google Play, there’s at least 200 of them. There’s even a website that uses todo app tutorials to compare Javascript frameworks.

Still, I’m a huge fan of David Allen and Getting Things Done. I love the idea of tracking all your “open loops” and the next action on everything. I love the idea of context aware lists that take into account location, time and energy.

I’m also a huge fan of gamifying your life. If video game developers can use psychological tricks to get me to play more video games, why can’t I use the same concepts to get me to be healthy and accomplish more.

A great example of this is Beeminder. It’s this really cool application where you set a goal and track the goal on a daily basis, sometimes automatically. If you don’t meet it, they take your money, and then restart with higher stakes. I love it. If there was a single startup idea I wish I had thought of, this would be it.

The problem with Beeminder is you either need to pick just a few simple goals, or you need to guarantee you have an even workload. If your day-to-day has a lot of ups and downs, it can be stressful.

Finally, I like the idea of externalizing my executive function. I seem to run into the problem of having to many things I want do to, have trouble choosing, and do none as a result. It’s very frustrating. If I can outsource that analysis paralysis, I think I would get more done.

The idea for the app

This is actually the second time I’ve tried to make a todo app. The first time had more of a gamification feel and I called it EugeneQuest. I figured if I was going to be paying someone to motivate me to do things, why not pay myself. It worked out decently well, but I mostly broke my addiction to Magic The Gathering by accident.

Despite how that went, it’s still really important to me to have personal projects. I think personal projects are the best way to learn and I’m desperate to learn C# and Azure. So I’m trying again, but focusing more on filtering tasks by time and energy. So far it seems promising.

Next week I’ll talk about the technology I’m using and what I’ve learned so far.

Jumping back into gamedev with Unity

My motivation

As I’ve been getting older, I’ve found a simple trick for introspection: look at yourself a decade ago and ask that person what makes him happy. The core parts of you, the essential parts of you, probably haven’t changed much. For me it was 3 things: boardgames, video game programming, and first-person shooters. Those are the only things that would regularly get me out of my own head.

Other things, however, have changed in the last 10 years. First, for some reason I seem to have a 1/5th of the leisure time that I used to have as a kid. Second, someone now pays me to program 8 hours a day. Suddenly, the idea of spending 2 hours every night working on video games seems onerous, burdensome. It’s just not as fun when you spend every day programming stuff.

But, as I said, your core self rarely changes. Just because you don’t have the time or energy to be passionate doesn’t change what gives you joy. Growing up is kinda like being a pokemon and going through evolutions. You are still some Blastoise

Adulthood. It’s like having cannons coming out of your shell.

Since I got married, I’ve started playing a boardgame every night with my wife. It’s really been beautiful to watch. It’s great seeing a hobby you thought was lost forever, come back to life. It reminds me of the signs at the dormant

Your passions. Not dead, just dormant.

Now that boardgaming has come back to life for me, next up is reviving game development. Of course, since it’s been 7-10 years since I’ve really been into video game programming, my analogy is more like the

Jumping means my game is inherently better than Stanley Parable

It’s not a lot, but I can already see a lot of the power and appeal of the tooling. Additionally, the tutorials are top notch and very easy to follow. I really expected working with 3d to be a lot more intimidating.

Overall thoughts

Even after working with Unity for less than an hour, I have a few first impressions.

It’s easy to get started

The first tutorial takes just over an hour to complete. At that point you’ve created the minimal definition of a 3d game. It would probably have taken me a week to do all of that from scratch, hand writing OpenGL calls.

It’s also got a very quick debug cycle. You code something, test it, make a tweak, test it again. It’s literally as simple as hitting play on the scene. Additionally, much of the details are accessible as GUI controls. This is especially cool when it’s your own custom scripts. All public variables on your scripts become editable. You can even drag and drop, if the variable is a game object. For example, for the camera controller we drag and drop the player object.

image

It seems really well polished

I don’t know if there is any one thing I can point to, but overall a couple of things stick out:

  • The UI seems fairly easy to navigate.
  • There are a ton of features regarding components or physics.
  • I can see right away how I could use the power of C# instead of being limited.
  • It makes adding behavior to an object super simple. Just a few lines of code and your object is controllable.

It just seems like a quality piece of software. I’ll be interested to see how it looks after 100 hours isntead of just 1.

It’s different than what I’m used to

Unity does things very differently than I have in the past. Using components over inheritance is new to me. I can see how it makes it really easy to add behavior or functionality to entities.

Another thing is there seems to be a heavy focus on encapsulation and separation of concerns. Components have functions for the event cycle: start, update, fixedUpdate, lateUpdate, onDestroy, etc. The components know only as much as they need to, and you have to work to go outside of that. I’m used to one giant loop of logic and processing behavior manually.

My way or the highway

One of the downsides of using a framework or engine is that there is usually a “right” way to do things. The downside of having guard rails is when you want to go out of them. Working with Unity, I definitely get a vibe that there is a “Unity way” of doing things. Not in any way that is a problem at first. But I immediately have a few questions in my mind:

  • How do you determine which entities get processed first in an event? Do you have any control?
  • How do you handle mass interactions between entities?
  • What if you want to use a different physics engine?
  • What if I don’t want to use scenes?
  • What if my whole game is procedurally generated?

It’ll be interesting to see if it presents a problem or not.

Final thoughts

Overall, I’m very excited to be learning Unity and see where it takes me. It’s used by tons of indies and has a lot of potential.

Why the Raspberry Pi 2 is my main computer

So this here is my primary personal computer.

pi_picture

Did you miss it? I don’t blame you. It’s the exact same size as my mouse.

pi_picture2

[Left: A multi-purpose Linux computer. Right: A logitech mouse.]

I’m using the Raspberry Pi 2 for most of my computing computing needs at home, even though I’ve got two laptops that are loads more powerful. So the question is, why would I choose the raspberry pi over a beefier Lenovo Thinkpad or HP Pavilion?

1. Because I can!

Probably the biggest reason I do it is because it feels silly. There is something just wrong about being able to run Linux on a computer I can fit into my pocket. It just shouldn’t be possible. Every time I look at the board, I think “This can’t be it. Nope, this must be a joke.” And best of all, it has 4 cores, so the desktop can be responsive even if something else is running slow.

3. Because I surf the web too much!

It turns out that most of what I do now is in a browser. I think that’s true for a lot of people these days. That’s why you see things like the Chromebook taking off.  Once you get browsing to work, you’ve hit 80% of people’s computing needs. And as I said, Iceweasel runs very well on the Pi 2, giving me modern HTML support.

4. Because forced simplicity is good.

It’s amazing how many things you can do with a modern computer and how much crap you can install on it. I’ve definitely had the problem of being on my laptop to do Serious Things©, but instead I just surf Hacker news. With the Pi, at least I’m being intellectually honest. Either I’m surfing the web or coding something in vim. That’s it.

When I need to use iTunes, or Steam, or play around with SQL Server, I go to a different computer. As a result, my brain gets context clues about what I’m doing. If I’m on this computer I must be working on something. If I’m on my Pi I’m probably relaxing. That sense of clarity is nice.

5. Because I need to justify impulse buying.

Did you know I have 4 Raspberry Pi’s? I keep telling myself I’m going to do something with all of them but I just haven’t. There’s something sad about buying tiny little $35 dust collectors. By using the Pi as my primary computer I can tell myself that at least one of those expenses was worth it.

6. Because I want a change of pace

Finally, it’s nice to just have a change of pace. I work with the Microsoft stack all day and after a while it can get tiring. It’s nice having a completely different environment for leisure than for work. Linux on a credit card size computer is a sizable leap, for sure. This also provides me a nice way to learn Linux and diversify my skillset a bit.

Runaway Transaction Log: part 1

Last week I wrote about an idea to create labs for when things go wrong in SQL Server. They are partly inspired by the TechNet Virtual Labs, which are a great resource available for free. Another motivating factor is a desire to do something with Windows Azure. I’m new to the virtualization world and want to learn more about it. For someone like me who doesn’t have a lot of lab resources at home, it offers some exciting opportunities. Finally, I’m just plain frustrated with the fact that most DBA training involves frantically struggling when something goes wrong in production.

Today, we are going to create a SQL Server virtual machine. Later on we will misconfigure it with a runaway transaction log. This article covers just the basics. If you want to learn more, you may want to read  Getting Started with SQL Server in Windows Azure Virtual Machines

First log into your Azure account. If you don’t have one, you can create one pretty easily and you will have $200 in credits to play with the first month. Be aware that after the first month you will be paying for storage, even if your machines are turned off. Once you are logged in, go to virtual machines:

image

Then on the bottom left corner, select NEW –> Compute –> Virtual Machine –> From Gallery

image

The gallery has a lot of options available and even more if you know the cheat codes to find the hidden VM Depot. If we take a look at the SQL server category, we see images available for 2008 R2, 2012 and 2014 CTP.  This lab should work for any of those, but in this case we will be picking SQL Server 2012 Standard.

image

Once you’ve chosen your image, click on the next arrow. On the next screen you are going to pick some configuration details. I would pick the latest release date. Medium size should work for out needs regarding compute. WARNING: Be aware that Standard on a medium instance will cost you $0.73 per hour.  If you accidently leave it running all day, that can be $18 per day. I’ve done that before, so be careful.

image

Next we need to set the cloud service. You can think of this as a sort of container for the VM’s. In our case, we’ll make a new cloud service. You are going to want to pick a region close to you.

image

Finally, we are going to set the endpoints so we can talk to the machine.

image

Once you are done with all of that, it’ll take about 10 minutes to provision the machine. Go take a walk and come back.

Are you back? Okay, let’s go back to virtual machines and take a look at our machine.

image

It looks like it’s up and running.  Next, we are going to create a very small data disk for us to fill up. If you want more information, this article covers attaching a disk in more detail.

Select the machine and click attach at the very bottom. Then select attach empty disk.

image

We want to select 1 GB as this is the smallest size we are allowed.

image

Now we have everything we need to log in and start breaking the machine. Next week we’ll configure the machine to run into some transaction log issues!