Archive for the ‘Idea’ Category

Denver Dev Day 2017 – Giving Back to the UWP Community

Step one, put down the controller…  I’ve been REALLY busy.  After Denver Dev Days then it was FULL BORE into Comic Con mode.  And I had to do THAT blog (because I said I would) pretty much right after the con otherwise I would forget things.  At least with this blog, I get to follow along with the slides as I hope you’re doing too.


My talk was part of the June, 23rd 2017 Denver Dev Day.  I thought I was going to type up a blog BEFORE the talk as practice and get my head straight, but that didn’t happen since Comic Con was looming in the distance as well.  So this blog is more of what I talked about, more or less.  And YES it’s incredible that I’m doing ANOTHER blog merely DAYS after the Comic Con one.  I think that affords me a LEAST a year off from blogging.

You can download the entire project or JUST the Power Point slides from this GitHub repository.

Go ahead and SKIP that first slide.  Well at least GLANCE at it since they DID sponsor the event.  If you’re not familiar with my speaking style, I tend to put things in all caps for emPHAsis.  It’s too hard to ctrl-B twice for bold on and off when the caps lock key is easier to hit.  So don’t think of it as shouting unless the entire sentence is all caps.

Slide 2 – Giving Back

This was a general overview of what I’d be talking about.  About my journey to contributing to the UWP Community Toolkit out on GitHub.

Slide 3 – Emmet Speech  I included Emmet’s Speech to level set people.

YES, it’s true…  I may not be a Master Builder.
I may not have a lot of experience fighting, or leading, or coming up with plans.
Or having ideas in general.
In FACT, I’m not all that SMART.
And I’m NOT what you call a creative type.
Plus…  Generally, unskilled.
Also… Scared and cowardly.
I know what you’re thinking.  He is the LEAST qualified person in the world to lead us.  And you are RIGHT.
There was about to be a buuut.

I watch this video quite a bit.  Emmet really doesn’t think he’s all that special, which in reality with respect to the universe we’re all pretty tiny and insignificant.  BUT in the end we end up actually kicking ass and BEING The Special.

Slide 4 – Technically I’m Not Exactly a Master Builder Yet.

At the end of that movie you get to meet the boy’s dad.  Holy CRAP!!  I’M that DAD!!  Aaaahh!!  I like my stuff in its place and if you use it then PUT IT BACK!  (that was shouting).

This talk was supposed to be a lightening talk, but I think they did away with those and Shawn asked if I could turn this into a full blown 75-minute talk.  SURE!  I think that email that was approving speakers was about 2 weeks before the talk so I had some WORK ahead of me.

You can’t know EVERYTHING.  Just like Emmet said “In FACT, I’m not all that SMART”  And there is ALWAYS somebody out there that knows more than you do, so it’s better to be humble and show your skills by DOING and not talking about them.

The Lego Movie is NOT JUST a movie, but possibly a metaphor for LIFE!

Slide 5

Ah yes, the introductions.  I’m old.  I was one of two people at Mines that owned a Macintosh which put me in the default position of Mac Evangelist.  I worked for Apple for the duration and I taught classes and showed that I could do everything on my Mac that everybody else could do on their TI PCs (except for display in color).  My Mac could plug into the Motorola 68000 boards in the Green Center and I could download the Morse Code interpreter right from my machine.  AWESOME!

Somewhere I caught the Windows bug.  I was introduced to SO many other windowed systems at Intergraph that I got used to resizing my windows from any edge.  When I got back to my Mac at home (now a Mac IIx) I was not able to do this.  It was always a combination of moving the window and resizing.  PLUS, Macs were (and still are) pretty damn expensive and I didn’t have my student discount anymore.

My title at NCM is Enterprise Solutions Architect, but I feel I’ve done the same things since I’ve started there 10 years ago.  I solve problems, help people, and learn new technology and put it to good use.  Sure, my title has changed over the years and more projects under my belt, but I just try to come to work and kick ass every day.

Don’t forget to download all of this from GitHub.

Slide 6 – Table of Contents

I pretty much read this over and touched over each subject.  Remember, you’re supposed to be following along with the slides.  This is mostly to prepare people for what’s coming up.

Slide 7 – Goals

Certainly I’d like to inspire MORE than one person to help the UWP Community, but maybe that is a tall order.  But maybe you’ll help ANY community and that’s JUST as good in my book.  You know, like that annoying shampoo commercial.  You tell two people and they tell two people and so on and so on and so on…  Yeah.  THAT annoying commercial.

Slide 8 – What This is NOT

It’s not my goal to help people with UWP, GitHub, or Twitter.  I pretty much just read the slide on this one.  Are you following along?

Slide 9

There certainly is NEVER enough time in the day.  Even with this blog.  Will I finish it tonight?  Why would I help out the community?

Had to take a vacation day for this talk.  My company doesn’t pay me to do this.  It just felt right to give back and do this talk as well as the one back in October.  I figure I know some stuff and doing these Denver Dev Day talks is a great way to give back to the programming community.

It feels good to give stuff away.  Write a free app or website or give stickers away at Comic Con.

I would say the major reason I gave back to the community was that I needed the functionality.  It was GREAT that MOST of the functionality was already in the toolkit, but I needed latitude and longitude on Tweets so I put it in.  Even if you end up giving back for purely selfish reasons that’s STILL giving back.  I would say that’s been my driving force for many of the times that I’ve given back.  I was HAPPY to do it.  There was so much that I DIDN’T have to build, because there are others that came before that gave back.

The running joke at work is “You’re royalty, why do you work?”.  I’m 9 generations away from King Kamehameha 1st

Slide 10

Well it all started with GitHub.  I signed up last year some time.  It’s a great place for your offsite backups and small projects to share with the world and collaborate as well.  I was working on a .Net Core project for work and I noticed that the DataTable was deprecated.  I needed a way to send a User Defined Table Type as a parameter to a SQL stored procedure.  THAT’S where I found the N-RECO repository.  I needed that recordset object so I grabbed it.  I needed a way to set up the object using the CodeFirst / attributed syntax so I wrote a snippet of code that helped me do that and then used the Nreco recordset to get me the UDTT I needed to send to the Entity Framework Core stored procedure.  I ended up sending that snippet back to the Nreco people and they gave me a contributor’s credit.

THIS of course was WAY out of process.  No pull request, no merges, no nothing.  Sorry about that.  BUT…  Giving back is giving back.

Slide 11 – A Little History Lesson

So it didn’t JUST start with the Nreco repo.  As far back as I can remember I’ve been giving back in the form of code.  My step brother and I REALLY wanted a new Apple ][ plus so our promise was to write software for our parents AND of course play games on it.  We ended up writing a power fence inventory program for them in BASIC.  Ugh.  I remember there were NO numeric formatters so we had to write some so we could have trailing zeroes on the invoices.  That was probably the trickiest part.  It was all A B C menu driven, pretty “basic” stuff (pun intended).

Working at Intergraph I helped with a proof of concept using XmMotif.  All of that code came from M.I.T., but there was some wonkiness to it and needed some minor tweaks.  I don’t know if any of those changes made it back to M.I.T., but I like to think so.

When I needed comic book shop data I turned to The Master-List website maintained by Mark.  I wrote my first screen scraping bot to gather up ALL of the data I could from that website and put it into, ahem, an Access database.  This was back in 1997 and all I had access to was Access so I dealt with it.  When I got a hold of Mark, he said he maintained the data just by editing the HTML pages.  I GAVE him all of the data that I gathered and sent it to him in a spreadsheet.  I didn’t have time to redo his website for him, because my HTML skills were still pretty basic.  I keep in touch with him and I think he’s still doing things the old-fashioned way.

Another screen scraping bot that I built was to hit eBay.  I wasn’t sure what comic books to sell so my bot would scrape eBay and look for the items that I had and cross reference that with what was selling, when, and for how much.  This was back in 1998 and I thought I could help eBay out.  It was REALLY hard to get a hold of them back then (and it STILL is today), there was only ONE conversation where I basically told them what I was doing.  I wasn’t expecting much.  They didn’t follow up after that conversation.  They were either working on tools like that or NOW they were GOING to.  Since I didn’t see tools like that show up until MANY YEARS later, I figured they were firing up that branch of eBay to work on those analytics for sellers like me.

The sticky Tweet?  Maybe Twitter was already working on something like that, but it took them a while to get it done.  I tweeted that I wanted a Sticky Tweet (MY pinned/sticky tweet now) back in 2013, and a few years later I saw that they implemented it.

Slide 12 – WWJD?

Part of why I started doing the talks was primarily due to Jerry Nixon.  What would JERRY do?  He is always SO enthusiastic about Microsoft technology and about tech in general.  He donates his time to the Visual Studio User’s Group and is always there for those Microsoft functions.  I’m sure it’s in his job description, but there is a TON that he does outside of that box.  So I’ve GOT to thank Jerry for that inspiration.  Unfortunately, he was not in the room when I said all of that.  I had an extra Star Trek pin that was stuck to my college work out bag back in the day, and I gave it to him.  He IMMEDIATELY put it on and wore it all day.

Slide 13 – Follow the Process (or don’t)

After integrating the UWP Toolkit into my code and realizing that I needed latitude and longitude, I forked the toolkit repo and got to work.  I made sure that I followed their style and did not break any API.  Things were up and running in only a couple of hours due to the fact that SO MUCH of the infrastructure was already there.  I also updated the sample program that would allow you to enter a lat/long combo OR you could use the location services to find that for you.  In their tweet list display I also added the lat/long there if it was attached to the tweet.

I submitted the pull request and begged for forgiveness.  As it turns out the PR was nearly PERFECT.  I missed the part of updating the documentation since I didn’t really know where that was.  If you look at their guidelines you should submit an ISSUE FIRST, which is something that I missed because I didn’t read the guidelines.

The UWP team allowed me to keep going and I was able to submit an issue and then provide another update.  I’ve got more plans for this section of the toolkit and will contribute as time permits.  Both pull requests are in the links below:



Slide 14 – Ways to Give Back

If you stumble across something that blows up or just doesn’t feel right take the time to report a bug or provide feedback.  It doesn’t take that long and it help tremendously.  I am now part of the Alpha group on the Xbox OS release schedule and I’ve been submitting things for a while now.  I’m sure I would not have made it to the Alpha group if I had just kept my mouth shut in the previous groups.

You could mentor at school or work.  I’m sure that ANY school would love to have somebody representing the software industry come talk or teach some extracurricular activities.

You can always ask Jerry or Shawn and submit yourself when they “call for speakers” either for Denver Dev Day or at the User Group meetings.

Free stuff is always nice.  Write an app and GIVE it away!

Slide 15 – What Would YOU Do?

I polled the audience to see what they might do to give back.  Reporting bugs seemed to be the easiest way to give back.

Slide 16 – Questions / Contact

I just wrapped up with questions and I forgot what questions were asked.  I think I finished up with about 3 minutes to spare and we could all hit lunch a bit early and get a jump on the lines.


Idiot Driver 2.0

My FIRST thought is WHY did this TAKE so (expletive deleted) DAMN long?  All right, all right.  I’ll cut you some slack Microsoft.  You DID give me the App Dev account for FREE.  I’ll give you that.  PLUS, you’re making sure my code isn’t stealing somebody’s password or doing something malicious to their phone.

That’s the timely news.  But if we warp back to two weekends ago, I would have been throwing QUITE a few expletives towards Twitter.  It was rainy and overcast and was the perfect time to update Idiot Driver to 2.0 and apply the “metro” look to the main page.

I have a few custom controls that I wrote for the settings page that prompt for input.  The first one is just a single field with Ok and Cancel all placed on a modal background.  I can adjust THAT font size so it’s a bit bigger (I know, it should be even BIGGER – next version).  Most of the default text blocks are pretty small.  Call it programming for the blind.  Which I am.  Oh sure, I can SEE, but I need a powerful prescription to see WELL.  I added a small “drop arrow” to the metro button so it looks more like a drop down list.  WHY Microsoft didn’t make this style a default is beyond me.

This modal field was NOT wrapping the text and was seriously annoying so I fixed that.  AND I intercepted the “Back” button in the modal field so it wouldn’t dismiss the entire page and go back to the previous page or exit you out of the application.  If the modal is displayed, the first press of the back button will dismiss the keyboard and the next press of the back button will dismiss the field.  A minor technicality, but definitely a LOT less annoying.

Raj sent me some code that he found on the net which basically adds the tilt effect to EVERY control that can do it.  So I added these tags to the top of each page and it just WORKED.  I was pretty happy about that, but the highlight color is pure white which is pretty ugly.  Maybe not ugly enough to try to change it before the next release, but I’ll get to it.


 I added <<MYTAG>> substitution which is similar to the <<TAG>> substitution but it replaces the <<MYTAG>> with YOUR license plate it you’ve defined it.

The name change was pretty easy too.  Just make sure that all or your application name references are changed (including the manifest).  By doing that, the name will change in the Windows Marketplace.  I think that’s what took so long with certification and then the subsequent publishing to the WM.

The thing that REALLY got me all steamed was the fact that Twitter changed their REST (Representational State Transfer) response.  Everything above, including the manifest change, took me about 3 hours.  I was all set to test things on thephone (versus testing on the emulator).  That means I had to re-authenticate with Twitter.  This is where things failed.  I was able to get to the Twitter Authentication page, but once I pressed OK the navigation events would trigger and the response came back compressed.  The code I had was definitely NOT expecting this and spit out some graphical characters in the error box.  This meant that TEXT was definitely NOT coming back from Twitter and I had a long road ahead of me to try to figure out what was going wrong.  I Bing’d a bit and found that Twitter had made an announcement a while back that they WOULD be doing this.  GREAT!  I just get my application out to the marketplace just in time for Twitter to change their
minds AGAIN.  Just like with the first Twitter hurdle, the posts are REALLY old and out of date.  Although I saw something that looked promising.  “All I had to do was set two properties in the request and everything worked!”  This was coming from some post.  So I tried it, and I got nothing.  I was still getting compressed data in the response.  I figured I was going to have to decompress it myself.

I ended up using a GzipInputStream in one of the libraries that I was already using.  There was quite a bit of setup because you have to take the “character” data and convert it to bytes.  Then put the bytes into a MemoryStream.  THEN hand the MemoryStream off to the GzipInputStream.  I tested it and I got “bad magic”.  No.  SERIOUSLY.  “Bad Magic” means that the first two bytes of the data were NOT correct.  Not the correct “magic” (or completely arbitrary) numbers that mean THIS data stream is “Gzip Compressed”.  For data that has been gzipped those magical first two bytes are 13 and 139.  The stream that was coming back from Twitter was 13 and 253.  I tried quite a few permutations of properties and spitting things out to the debug window and I could ONLY debug the stuff ON my phone.  PHUN!!

if (response.Headers[“Content-Encoding”] == “gzip”)
    // MAGIC: First byte (13), second byte (139)
    // BOGUS coming back from Twitter: First byte (13), second byte (253)

    byte[] bytes = StringToByteArray(content);

    //bytes[1] = 139;

    using (MemoryStream stream = new MemoryStream(bytes))
        using (GZipInputStream gzipStream = new GZipInputStream(stream))
using (StreamReader reader = new StreamReader(gzipStream))
StringBuilder builder = new StringBuilder();

                while (reader.Peek() > -1)
                    int theByte = reader.Read();


                content = builder.ToString();

    Debug.WriteLine(string.Format(“content = ‘{0}'”, content));

I tried different Gzip libraries that Hammock might recognize to NO avail.  SIX hours later I figured I needed to head back to Bing.

I ran across a thread on a Twitter API forum that took me back to CodePlex.  REALLY?  I had gotten just about every library from CodePlex so why not some SOURCE?  I grabbed the source for Hammock and SharpZipLib.  That didn’t work.  I was getting reference errors and the namespaces were out of whack.  More Binging…  I found and downloaded the source from there.   I scooped those pre built DLLs from the projects and plopped them into my project.  BOOM!  Object reference not set.  AGAIN!  REALLY?  I stepped through the code and bit and saw something out of alignment.  So I brought the Hammock AND SharpZipLib project into MY project and hoped for the best.  I ABSOLUTELY could NOT believe it.  All of the source compiled and loaded onto my phone.  It actually WORKED!!  I threw my arms up in the air.  TOUCHDOWN!!  WOOO!!  I could NOT believe it.  I was hopeful, but wasn’t expecting even THIS to work.  So if I initially had ALL of the source in my project then…   “All I had to do was set two properties in the request and everything worked!”

I apologize to my friends that aren’t nerds who actually stuck it out to the end of this.  My brain hurt for quite a few hours, at least YOURS can hurt for a few minutes reading this.  😉

Crazy Driver 1.0

You know how it is.  You’ve got your to-go cup of coffee and you’re blaring KBPI on the radio.  Things are going smooth until you’re out of the neighborhood and down by the post office.  Then you see him behind you.  A big old pickup racing up behind you.  Apparently poor planning on HIS part BECOMES your problem.  He SLAMS on his brakes.  DUH!  We’re at a stoplight you dumbass.  The traffic slowly starts moving again right past the Walgreens.  Yeah, they’re EVERYwhere, aren’t they?  And just as you expect, the guy behind you cuts over and passes you in the right hand lane that just opened up.  But of course HE didn’t see the other guy pull out up ahead.  I’m expecting this.  You HAVE to expect this.  And he swerves into MY lane.  I glance at his license plate “DUMBASS”.  OK.  That’s NOT what it said, but it SHOULD have.  Or at least ID10T.  You raise your hands and yell some obscenities.  They’re GOLDEN.  But nobody heard you.  The guy in front of you is already flicking his cigarette out his window and has swerved back to the right.

That’s when it hit me.  I want to push a button on my phone and through the Blue Tooth integration in my stereo the radio mutes and a digitized voice comes across the speakers.  “This is Crazy Driver, what would you like to rant?”  I say “License plate D-U-M-B-A-S-S.  Ranting why the hell did you cut me off you idiot?!”  The app thinks for a second and then fills in the appropriate fields and parses out the tweet “Why the hell did you cut me off you idiot #CO_DUMBASS #CrazyDriver.”  I glance at my screen and the tweet is scaled up so I can read it on the tweet tile.  I’m good with that since I don’t feel like stopping at the next light to add the question mark and five exclamation points (remember the disclaimer?).  I hit the tile and it’s sent.  I feel better.  Not as good as activating a 0.50 caliber machine gun on my roll cage and blowing the guy off the road, but better.

So after signing up with Microsoft’s 30 Days To Launch event I got a free developer account and was able to publish Crazy Driver.  It didn’t take a whole lot to build, because I was able to find code on the net that did the tweeting.  But there was still some learning curve.  If I got my application to certification by a certain date then I could have won a new Windows Phone, but that didn’t happen.  I have a regular development job and I was working on Mass Effect 3 too.

Not bad for my first Crazy Driver blog post.  I’ll post what I’ve learned and where you can find the oAuth code since the first snippet of code that I found didn’t work and I had to Bing again.

Kinect Driven Projectors

Wouldn’t it be cool if there was a Kinect emitter on projectors?  No?  Ok.  So let me draw you a picture.  The Kinect emits a series of dots and the processor in the Kinect hardware can detect distances using those infrared dots.  So why couldn’t the projector that is toted around from conference room to conference room have a TRUE auto-adjust feature.  You’d push a button and the legs would move to adjust the screen size and height based on un-interrupted wall space.  The keystone could be measured along with any other rotation that would be needed.  At the push of a button everything would work in harmony to produce the BEST possible picture for the wall that you want to display on.

C’mon Microsoft, get with the program!  Where’s Johnny when you NEED him?