Wednesday, July 22, 2015

Quick Fix: Could not load file or assembly when instantiating XAML component (or IoC component) in a Visual Studio Extension Project

Symptom
You're writing a Visual Studio extension that involves some XAML or IoC code that references a DLL file. When you attempt to instantiate the control, the debugger pops up with "Could not load file or assembly". You've checked the Fusion log and notice it isn't looking in the folder that contains the extension!
Fix
Add the attribute [ProvideBindingPath] to the class that represents the package (the class that implements the Package base class which is often completely empty).
Why?!
Visual Studio's Extension engine usually figures out where your reference .dll's are and binds them easily, however, when a .dll is referenced in XAML or IoC, it isn't explicit enough for Visual Studio to handle proper binding. The ProvideBindingPath attribute tells the extension engine to look in the extension folder when attempting to resolve dependencies. In my case it was a fancy options page that used XAML for its UI rather than the automatically generated UI.

Saturday, June 27, 2015

Stay Frosty Extension Preview - A WPF ShaderEffect for chiseled or beveled text

Stay Frosty
There's always been a retro movement in the programming world. Every time a new tool comes out that reduces the requirement to memorize commands or the complete API of a language, there's many among us who wish we had a green terminal and punch cards. The elite look down upon us folks who love Visual Studio, spouting off about the advantages of vi/vim, emacs and other ancient, though powerful, tools. I came from that era. Screw it. I like my Intellisense and GUI based IDEs. I like defaults that build (most of the time). I like using a keyboard shortcut to fire the whole thing off in a debugger and I enjoy a gargantuan 32-bit text editor.
I use many text editors for lighter-weight work. Sublime is awesome, as is the atom.io editor I'm starting to fall in love with. But my primary language for work and play is C# and Visual Studio has the tooling I need for that work. And if you're going to use a GUI interface for text editing, it might as well be really, really Gooey!
For the last 4 years or so, I've had an extension I wrote for myself to add a simple background graphic to the text editor window. I wrote it for Visual Studio 2010, originally, and since that time there have been many others that do the same thing. I decided late last year to take it a step further.
What, precisely, are you trying to fix?
I used to get Migraine headaches regularly. I had tried triptans (and found out that my body does not metabolize them correctly) and many other medicines. None worked. Thankfully that's in the past, now, but prior to last year I had to figure out how to live my life and do my job while dealing with a very intense headache. I've never let Migraine keep me from living my life. Unfortunately, displays of any kind seem to trigger the worst sensitivities. My only trick was to work in a dim room with the Brightness setting on my display turned down. Unfortunately, many colors become invisible as the brightness drops. My options were limited, so I used the Visual Studio Color Theme Editor extension to keep two themes, one titled Migraine and one titled Normal. The Migraine theme had most of the syntax rules set to the same color, and all of the text was very, very bright. It was not ideal for using day-to-day but it worked when I needed it.
Sometime around 2011 I purchased an 27" iMac. At the time it was the least expensive IPS display at its resolution and it had the added benefit of having a Mini-Display Port plug on the back that would allow you to plug in an external PC. I used it as my monitor and rarely logged into OS X. I did, of course, download XCode and all of the Apple development environment tooling. One morning I woke up with the familiar headache symptoms and began work in my home office. The Windows box had shut down and I was left on my Apple screen, so I powered up the PC and logged into my Mac to waste away the boot time on the web. The last time I had logged in I had left XCode (I think that's what it was) up. I noticed immediately that at the lowest display setting, all of the text was readable. The principal reason for this was a very subtle text chiseling applied to the code editor window. This got me *very* excited -- I could code using my normal syntax highlighting and still read the text at low brightness! A quick look around though spoiled my excitement. There was no ShaderEffect to be found that could apply this chisel. I'd have to write my own. And I'd have to write it in a language that I was unfamiliar with. Having too much to do already, I put it down until late last year.
A Mac-like Chisel Effect
The brilliant folks in Cupertino did something rather simple. The effect was no more than a subtle glow on the bottom and shadow on the top. Surely this couldn't be difficult to reproduce. It turns out, in the end, it wasn't all that difficult. I am not a game developer. I've never written a line of shader code. While I am plenty familiar with C and comfortable with the math, I found myself in hell without a debugger. Something so straight-forward was complicated by subtle requirements WPF imposes on ShaderEffects. Multipass? Nope. Alpha that works like the rest of the libraries I was familiar with? Nope. It's pre-multiplied. I was amazed at the body of knowledge I had to immerse myself in to write a simple ShaderEffect for 2-dimensional text. I wanted, after all, a pixel above and a pixel below the boundaries of the font. I was up against ClearType, DirectX and the fact that in the realm of 3D the concept of a pixel is absent, and of course, GPU parallelism. Fun.
The Stay Frosty Extension
The title is a bit of a joke. I got a chuckle out of Scott Hanselman's comment in the first paragraph of his Visual Studio Programmer Themes blog post and thought I'd swipe it.
The main purpose of the extension is to improve code text readability. WPF has long had a lot of complainers about how it render text. In the version used by Visual Studio 2013, you can tweak the text with several rules around font smoothing, hinting and rendering as well as requiring that the output snaps to the pixels of the device that's displaying it. I've exposed these as settings. You can apply rendering, font smoothing and hinting rules as well as require text to snap to device pixels. I've tweaked the window to allow the placement of a background image and an override to the background color without requiring the aforementioned Theme Editor extension installed (and it'll override whatever theme you've put there, as well). In addition, you can (optionally) apply the ChiseledText ShaderEffect and control the settings around it (described below). I plan to add many, many more capabilities to it and it will be released under the Apache 2.0 license as well, however that's my planned first release.
Here's how it looks in my environment fully customized:
The image above shows the effect at about 50% which is where I like it.
The ShaderEffect
You can download the library complete with the HLSL source and the ShaderEffect class implementation from its BitBucket repo. The effect is simple but could still use some tweaking. It's "good enough" at the moment, but if you have any improvements, I'll gladly accept them!
How it works
Very loosely, it works by layering a darkened and lightened version of the input offset by the size supplied in the size parameter. That's not really how it works, but that's how it appears to work when you use it. In addition to the two layers, the original sampled pixel is mixed in so that parts of the font aren't wiped out as the shadow and glow are offset. Due to pre-multiplied alpha and some blending, the main part of the font remains identical to the input color and the glow/shadow are lighter and darker. As I said, it's very simple.
Usage and Limitations
Reference the library and add the effect to any text element. It'll work with other elements, but the results may not be all that great. I designed it to work with small text since it was aimed at the code panel in Visual Studio but it works fine on large text, as well, provided you tweak the effect settings accordingly. The effect is applied vertically, only. It would be easy to change to allow an angle specified and, in fact, the earliest working prototype I had did this, however it nearly doubled the instruction count and performance suffered. I wanted this thing to work well with software rendering and to be as inexpensive as possible, so that's a trade-off I took and it's the other reason it will start to look less than ideal with large text.
  • Size - This is the size (roughly) in pixels of the effect. This is really the offset of the two layers. The glow layer is usually far more visible than the shadow layer so changing this might have the illusion of only increasing the glow portion of the effect. It's a double, so any fraction is fine. If you use a negative number, the chisel will appear as a bevel. The ideal value will vary depending on the target size of the text. The effect above uses a value of 0.5f which is also the default.
  • GlowIntensity - This increases the intensity of the glow portion of the layer. Remember that the actual color is just a combination of glow and shadow, so increasing the glow will similarly increase the overall brightness of the font, too. Sorry about that. The default value for this is 1.0f
  • ShadowIntensity - Same as Glow, but for Shadow. If Glow and Shadow are the same value, the font in the middle should be about the same color as the input.
  • MixDivisor - It's a terrible name and I will be changing it. At the end of the HLSL, the input pixel and the new values calculated for the two layers are divided by this number. 3.0f is the default and causes the text to barely blend with the background. Increasing this value will make the text and the effect blend more with the background. Use the Intensity and this value together to get the desired result. The text in the picture above uses a value of 3.5 on a background of #FFAAAAAA.
The background and foreground of the text play a huge role in how the effect looks. As you can see from the picture above, the darker text has almost no effect. This was what I wanted for XML comments in my solution. Colors where the values of R, G and B are all very close to the 0xFF or 0 have little to no effect. Colors on backgrounds that are close to 0xFF and 0 have little to no effect. Placing the text on a variable background works excellently for some and terribly for others, so you'll need to experiment with it. Play around with MixDivisor and Intensities and you should be able to make it work, but like all things related to shaders, it works by optimized optical illusion.
I also strongly recommend a font with some meat on it. Mac OS renders fonts differently than Windows. They're chunkier and cleaner. Google mactype if you want similar results in Windows, or use a very high-quality OTF font. I use Source Code Pro Medium, free from Adobe, and it works quite well. I'll write up some more later explaining the effect in detail. I won't waste much time on the C# code required to use the shader, it's very simple.
As far as the Stay Frosty extension, I'm writing it in some very limited free time. It's nearly done except for a few issues around settings that I'd like to sort out.

You can download the entire library with its code from its public BitBucket repo. It has the path to fxc.exe hardcoded in the pre-build. You'll need to ensure you have the Windows 8 SDK or the DirectX SDK and you'll need to modify the path accordingly. That was a time trade-off for me.

Monday, May 11, 2015

Reliving the Past - The Visitor Access Kiosk

Every once in a while I like to google myself as past posts will show. One thing I have never looked for was a small promotional video that Global Crossing had sent to a few folks about a project I handled for them. We had a new office being built in Rochester, NY around the time that we were involved in a program with Microsoft for helping them improve the developer experience around Lync.
Before this sounds horribly boastful
This project was a defining moment for me as a developer. I had, up to this point, been mostly focused in Web/Database applications that were used internally. I had quite a few wins in this area, but nothing that ever extended beyond the walls of the company (beyond a project a few years ago that was sold to a vendor of ours whilst we were in the throws of Bankruptcy).
Stupidly, I had never thought to just "google it". At the time, Global Crossing didn't put videos on YouTube, and I'm not entirely sure how it even got there. It was a *monumental* task and I was *not* the right developer to be doing it, but I love code and I love solving hard problems (from time to time). In this case, the VP of our department (an awesome guy who's name I'm omitting because I haven't asked for his permission), asked if I could create a kiosk that would allow a visitor to contact someone in the office from a secure visitor lobby, have a video/voice conversation with them (one way video, inbound to the employee only), would print a one-day-use badge with their picture, name and relevant information and give them a way to sign out when their visit was over. This was to replace the need for a dedicated receptionist, or a pen/paper log-book.
Some implementation details
Unfortunately, the only copy of the original whitepaper has been removed from Microsoft's site -- it was for Office Communicator 2007 R2 (technically we ran it on this version, but it was developed targeting the pre-release of R2), so I'll include that here
I implemented it as a WPF application, touch-only (at a time when a 1024x768 SAW touch screen was $1500). I used a barcode scanner, a simple label printer attached to a USB -> Ethernet device, a Logitech camera, and a ThinkCenter PC running Windows XP (stripped of everything unnecessary, including the Explorer shell.  All of the code was my work (that's a statement of fact, not pride -- I would be embarrassed by that code today).  My good friend and former coworker George Morell and I handled the operating system hardening -- when you have a guy at your disposal that can tell you the location of every obscure OS registry setting from Windows 2000 to Windows 8.1, you defer to that incredible expertise. And our security guys did some network hardening to ensure that if someone took a sledgehammer to the device and grabbed its ethernet port, it'd be worthless to them.

Most of the application was written in C# (.Net 3.5, I think, I remember thinking ... "generics?" ... like "templates in C++?"... no ... not exactly) with some bits in C and one really nasty bit in C++ (it was the camera interface). It was not a difficult thing to write, but at the time, it was a difficult thing fore me to write.
Without further ado, the Visitor Access Kiosk.

 The guy in the video is my former boss, he worked out of the Rochester, NY office where it was filmed. I had nothing to do with the video or its upload to YouTube. Who knows, it may get taken down, but for the time being, I wanted to have a link to it that I could refer to.

I had to laugh while watching it. The UI is comical today, but keep in mind that this was developed at a time before Windows 7 was released. Windows Vista and Windows XP's "chrome" were the inspiration behind the design. And I had some fun with XAML.

Monday, April 6, 2015

FIX: Fix Plex Media Server Remote Access / Unable to Connect to Plex from The Internet (code=-52)

Symptoms
You've opened the ports on your firewall and verified that they are open via an open port check tool on the Internet.
You've tried Why am I locked out of Server after password reset or device token removal. You've successfully pulled out many locks of hair (optional).
You've even turned on UPnP on your router, just to test (you can turn it off, just make sure the port is opened and forwarded correctly).
Error 52 / code=-52
Your log has this line:
WARN - MyPlex: Invalid response when mapping state (code=-52)
What's happening
Some part of the Remote Access registration process fails if the host operating system is configured to use Jumbo Frames. If you don't know what that means, that's OK. I'm running an OpenSuSE Linux box as my Plex server and I am not a Linux expert, so I can't even really tell you where to go (if you know, leave a comment, please!).
For OpenSUSE, do the following:
$ sudo yast
... Your password ...
In yast, go to Network Devices and select Network Settings.
Select each network adapter and choose Edit.
Go to the General tab and change the MTU to a value that will prevent Jumbo Frames (1400 is a safe test value for most people, but you can google your optimal based on the kind of broadband you subscribe to).
Exit and try it all again (I restarted the plex server as well, just for good measure).

Monday, March 30, 2015

Nermerle, Nitra, Parsing and Functional Programming

Functional Programming
I started looking into Functional Programming about ten years ago and when F# 1.0 came out, I decided to start paying attention again. I initially explored it as part of a project I had embarked upon to parse a DSL and provide a suitable development environment that a non-developer could use to customize my application. It was a lofty goal and ultimately was scrapped in favor of a much stripped down model that was driven via web forms and a small subset of the features, but the DSL was still available for more complex needs.
Parsing HLSL
Recently that need arose again. I've been messing around with WPF Shader Effects and 2D sprites. No, I'm not developing a game (sorry, no real interest here). The biggest frustration for me has been the lack of debugging information available. My usual process for exploring new languages is a combination of reading/research and poking/reverse engineering. I was the kid that took apart every piece of broken/outdated electronics growing up. After picking up "The Basics", I usually dive right in and write some (terrible) code to see what it does. I'll also read/step through open source code that I think I conceptually understand to validate my understanding.
Hlsl makes my learning process more difficult. I can't step through the code; I can't watch. The way it encodes colors into float4 values is sufficiently different from what you'd expect that predicting what the value would be requires you to know about things like Premultiplied Alpha, mapping textures to float values between 0 and 1. Your college calculus class will come in handy even if you did poorly as most things related to programming/math require you to have a good understanding of how it works even if you don't remember the details. Wolfram|Alpha will will help you if you've forgotten the specifics.
Built-in IDE tools provide barely any information when the HLSL files are rendered by WPF. I'm not sure how valuable they are outside of that, but they're useless here. The larger tools available from NVidia/Intel are overkill and mostly don't cover the areas I was hoping (the NVidia product simply didn't support most of its features on my particular GPU ... Notebooks).
Building a narrow-purpose IDE
I started out exploring WPF ShaderEffects using the wonderful Shazzam. Unfortunately, at the time of this writing, downloading the tool from his site isn't possible but a slightly outdated version (in code only) can be acquired from CodePlex. I tweaked it a bit for my purposes and created a shader effect that I mostly liked. Getting to the fine details, though, was difficult and I knew I'd need more insight into what was going on.
Enter Nemerle, F# and Nitra
The first thing I wanted was better parsing of the code before compile. I went digging around and found a syntax highlighting definition for HLSL. The language has some unique elements, such as Vectors whos parts are accessed via array notation, or .xyzw .agbr notation. It's quite elegant, but my eyes weren't naturally parsing it coming from languages that didn't do that.
The rabbit hole began there. The editor used by Shazzam was a way old version of that used by SharpDevelop. It's since been updated and the core text editor can be grabbed independently from NuGet as AvalonEdit. It works quite differently from the version offered by Shazzam, and syntax highlighting is much more powerful. So I created a Syntax Highlighting Definition for AvalonEdit that would color the .argb items as a variant of gray, red, green and blue and used shades of gray with underlining for the wxyz (I'll get the definition out on GitHub when I have a chance and link to it here).
The Shazzam tool was also missing Intellisense and some of the code signals that Visual Studio provides, so I went looking for a solution there knowing that my old friend F# was probably going to find a way back into my life for this one.
Surprisingly, it was Nemerle and the [Nitra Project from JetBrains]|(http://blog.jetbrains.com/blog/2013/11/12/an-introduction-to-nitra/) that got my attention this time. Tom Jones' Getting Started with JetBrains Nitra specifically covered parsing HLSL! Thanks for that!
It lacked the ability to understand shader2D and had no preprocessor support, but after adding shader2D, I now had a library that easily integrated with AvalonEdit to provide syntax highlighting failures and guidance for repair... All from a concise syntax file.
I wanted something a little more. Inspired a while ago by Bret Victor's Ted Talk, I decided to see if I could create an IDE that would give useful feedback about how the program works while it is being developed. HLSL is a limited purpose language, and WPF ShaderEffects limitations limit it even further. It's the perfect target for an IDE that gives intelligent feedback about the program being written while it is being written. By providing sample inputs and the ability to provide custom inputs for the function, a person can see what the outcome of the code would be in various scenarios,... as close to live as possible.
At this point, I'm building a new HLSL parser specifically targetting the limitations imposed by WPF to ensure that code syntax and rules are followed carefully.
I'm then going to start evaluating ...
Enter the God Awful Visitor Pattern
I'm an OOP guy most of the time. The pattern fits well much of the time and most .Net programmers are comfortable with it. However, The Visitor Pattern hurts my brain.
C# lacks Multiple Dispatch without the DLR. I'm not interested in passing type safety all the way to runtime. The Visitor Pattern is the way around that problem. The pattern is relatively straight forward, but figuring out its intent by looking at the code is painful. F# and Nemerle have pattern matching capabilities and allow multiple dispatch. The resulting code is readable with a small reference to the syntax (Nemerle is easier to read coming from C# than F#, IMHO) and the amount of resulting code is substantially less.
My Plan for Next Time
Unfortunately, this is not my day job. It's Saturday/Sunday Early Morning/Late Evening work. I have no code samples at the moment because I just moved my F# code to Nemerle (and it's so much easier to understand). I hope to spend some time with the parser next weekend when I will have a little more time to poke at it. If I get it to the point I want it, I'll write it up and thow it out on GitHub.
Until then ... Don't panic!
Nemerle documentation can be found here.
Nitra syntax, not terribly well documented, but somewhat easy to follow after going through the Nemerle documentation.

Tuesday, March 24, 2015

HOWTO: Add Code Syntax Highlighting to your Blogger / BlogSpot Blog

Solving my own problems
Last year I decided to poke about in my blog again and managed to utterly destroy the template along with all of my past customizations. I've decided to take the time to figure this out and then document it so that I can do it again when I decide to "code in production" again. So in the typical, slimmed down style, here's how it's done.
  1. Get to your blog's dashboard (log in, select blog from blogger dashboard).
  2. Select Template on the left hand navigation and Edit HTML on the screen that loads
  3. Locate the </head> tag (side note for testing later: better to not put this in head because it will prevent page from displaying until loaded).
  4. Paste the (hopefully now highlighted) code below. We're using cdnjs as the host for the .js scripts. I've read other instructions that suggest hot-linking directly to the author's site. I checked the install instructions on the site and he specifically asks you to copy the files locally.
Template Code
Here's the code I added to <head>:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shCore.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushPlain.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushCSharp.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushBash.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushJScript.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushXml.js"></script>
<script type="text/css" src=""></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/styles/shCore.min.css" rel="stylesheet" type="text/css" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/styles/shThemeMidnight.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
 SyntaxHighlighter.config.bloggerMode = true;
 SyntaxHighlighter.all();
</script>
And the Html
I've included the exact HTML used to render the above. Note that the "<"'s are all replaced with &lt;. That's a limitation I've decided to accept rather than using the alternative <script> block style.
<pre class="brush:js">
&lt;script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shCore.min.js">&lt;/script>
&lt;script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushCSharp.min.js">&lt;/script>
&lt;script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushBash.min.js">&lt;/script>
&lt;script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushJScript.js">&lt;/script>
&lt;script type="text/css" src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushXml.js">&lt;/script>
&lt;link href="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/styles/shCore.min.css" rel="stylesheet" type="text/css" />
&lt;link href="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/styles/shThemeMidnight.min.css" rel="stylesheet" type="text/css" />
&lt;script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushXml.js"></script>
&lt;script type="text/javascript">
 SyntaxHighlighter.config.bloggerMode = true;
 SyntaxHighlighter.all();
&lt;/script>
</pre class="brush:js">
Customizing for your purposes
SyntaxHighlighter can be customized. At this point, there's many available syntaxes to choose from. Find the brush you want and visit the cdn.js page for SyntaxHighlighter to get the link.
There's also plenty of themes. Find what you want, visit the cdn.js page for a link and add it to the scripts above.

Saturday, February 14, 2015

Weekend Adventures in Coding - Visual Studo Customization - Order of Adornment Layers

When Visual Studio 2010 came out, I started looking into customizing the environment a little beyond what was able to be done with existing extensions. I was looking for the ability to place a background image underneath code and fix some issues with font rendering (particularly around the input font). I had succeeded in getting the background properties set through an extension I wrote (similar to ClaudiaIDE, but with a simple property set instead of adding an adornment layer -- it served my purposes but with some limitations). This morning, I tweaked my extension and brought it up to support 2013 (wow, was that easier than I expected!).

Font rendering was helped by re-running the OSes Clear Type configuration and installing Text Sharp. If this sort of thing is important to you, you also want this free gem: MacType. It causes Windows to render fonts in a way that is more similar to a Mac which I find improves readability substantially. Unfortunately, it doesn't work perfectly everywhere, but some of Visual Studio is affected.

I've decided today to see if I can apply the last bit, a white shadow to text. This is a common effect throughout MacOS/iOS and I find it improves readability (particularly for high-contrast backgrounds).

Here's what I'm looking to apply (apologies for formatting, I'll get the code formatter working again, soon).
item.Effect = new DropShadowEffect
           {
            Opacity = 0.34,
            ShadowDepth = 9,
            Direction = 542,
            BlurRadius = 9,
            Color=Colors.White
           };
Finding an efficient way to do this (preferably without having to hack about with Reflection) has been frustrating, but I've managed to apply all kinds of effects elsewhere while I was attempting to fill in the gaps of the documentation with some reverse engineering.
Default order of Adornment Layers
While poking about, I thought it might be helpful to know the order of the default adornment layers. I just started (re-)evaluating OzCode and it was picked up by the "Exp" (temporary debug instance), so some of these belong to that. I'm also on CU4 so any that aren't documented may belong to that (search PredefinedAdornmentLayers or hit F1 for the documented ones).

CodeBackgroundTextAdornment
vsMergeHighLightSpaceAdornment
Outlining
DiffernceChanges
Difference Space
BraceCompletion
DeltaFullLineAdornment
DeltaNegativeSpaceAdornment
HtmlProvisionalTextHighlight
CurrentLineHighlighter
VsTextMarker
TextMarker
HighlightCommentAdornment
SelectionAndProvisionalHighlight
Inter Line Adornment
Squiggle
LineSeparator
CollaborationMethodEndorsement
ScriptDebuggerSectionDivider
Text
PinnedLayer
vsMergeHighlightSpaceAdornmentAboveText
SmartTag
DragDropAdornmentLayer
Intra Text Adornment
VisibleWhiteSpace
Caret
SimplifyVisualController
PinnableTips
InitialDifferenceWaitingAdornmetLayers
HtmlChrome
I have no idea what I'll be doing with these, but that's the fun of reverse engineering. If you have to do such a task, OzCode is very helpful. It allows searching the contents of objects through several layers and can surface interesting bits to play with. This is, of course, experimental and likely will break between updates, but they've made extending Visual Studio so easy, it's not that bad to tweak between updates/versions. More to come if I figure this out!

Saturday, February 7, 2015

Another chapter after 17 years

On to new things!
After 17 years, I have decided to resign my position at Level (3). 17 years. That's a lifetime in IT. I started at a small telecom located in Southfield, MI and ended up at an international telecom with a headquarters in Broomfield.
What a ride
I started as a desktop tech, within a half-year I was doing servers. Ultimately Allnet was purchased by Frontier, Frontier by Global Crossing and then the bottom fell out. For the remaining years until about last year, I worked for a company that was effectively a start-up in a very competitive sector. Layoffs every year were normal while Global Crossing struggled (and ultimately succeeded) with survival. Level 3 purchased Global Crossing in 2011. For 15 of those 17 years, I rode the wave down and for the last two I've been riding it back up. It was strange working for a company that was not operating in survival mode.
It was 17 years for me, but nearly every year I was given a new position, more responsibility and new and interesting projects. Mix in the fact that I was working amongst, what I considered to be, some of the best people in our industry.
Onto Development
I'd always been a programmer. I'm not sure why I took the ops route originally, but within two years I was writing code that was changing the way our employees worked and I knew right away that this is what I was made to do. I love programming...love it. Over the years I was given the freedom to code, experiment and learn. I quickly jumped on the C# bandwagon, missing the days of hacking about in C and Pascal/Delphi and fell in love. And I learned...
So why now?
After 17 years, I've discovered that it's time for me to move on. During my time at Level 3, I had the privilege of working on some special projects involving Lync and Office Communications Server. This was my first exposure to an API that I couldn't simply Bing (there's one for you, MS) a million answers from people who had just learned the API. The APIs I was working with were pre-release, but after release the situation wasn't much better. For some reason, I enjoyed this immensely!
What now?
I had sent my resume out to Modality, a Microsoft Partner and a company with a very successful business in the Lync space, earlier last year. This wasn't unusual for me. If someone mentioned a job that sounded interesting to me, I usually prepped my resume, took and interview and turned down the job. It's happened so many times over the years that I almost expected to make the same decision when Modality had a position available to me. After talking to the guys over there, much to my own surprise, my mind was made up.
I'll be a US based, "work from home" (I prefer remote) employee working for a company that sells services and software for an application that, since 2008, has been the reason I could work effectively as a remote employee for Global Crossing and ultimately Level 3. Being a part of a company that was an early adopter--eliminating all phones on PCs and replacing them with USB headsets and speakerphones was far less of an adjustment than anyone could imagine---was great for me. The quality and effectiveness of audio conferences suddenly made it possible to have a workforce that was distributed far and wide without losing much other than water-cooler conversation.
Finally
Farewell, my Level 3 coworkers and friends! You are among the best and many thanks for the help, support and just-plain-fun you've given me over the last 17 years.

Thursday, November 20, 2014

Watching a Delta Jet Land Directly Overhead from the Beach in St. Martin (Sunset Beach / Airport Beach)

I just returned from my vacation and am not yet ready to post the "big review" quite yet. But I had to share this. Earlier this week I wrote "Today, I had a plane pass over me so close, I could lick it."

Here's the video.  It doesn't do the experience justice.  At the end, you'll hear the roaring wind that's all around us. The phone's microphone is totally overwhelmed.  It was just neat!

If you're interested in doing this yourself, find any Eastern Caribbean cruise that visits St. Maarten/St. Martin island. Take a cab from nearly anywhere to Airport/Sunset Beach, the rates are set by the government, for us it was $20.00 USD for my wife and I to get there.  Watch a few puddle jumpers land to position yourself, and enjoy.

I'll post the other videos I grabbed from less ideal locations, but here's the best one:


Wednesday, November 5, 2014

FIX: T-Mobile Wireless (WiFi, not 3G) CellSpot / ASUS TM-AC1900 Port Forwarding Not Working

Problem
You try to forward ports on your new $25 deposit ASUS Wifi awesome-router and it doesn't work. Neither does UPNP. Or maybe it works but not for very long.
What's happening
Those clever folks at ASUS added a NAT acceleration capability. Unfortunately, as best I can tell, it basically does nothing much better than crash regularly. This is why you may have noticed that forwarding works occasionally after reboot. I, personally, found this to be very rare. I've also found that the NAT acceleration isn't noticed when it's disabled. I don't have Google internet, but I'm pulling 80/20 and the router is doing fine.
Fix
Go to LAN -> Switch Settings. It will probably hang. Worry not, your router probably just crashed. You likely lost internet. Give it a full minute and refresh.
Go to LAN -> Switch Settings. Set any setting that has the word Acceleration (or NAT) in it to Disabled. Your router will reboot and your ports will be forwarded.

Update: Around December, for no apparent reason, my NAT rules all stopped working again. Nothing had changed on the router (well, as far as I know ... we rarely need that functionality). See the comments for what I did to repair, but I'll summarize: Factory Reset and some other steps.
I couldn't find better information to help with this, so I went nuclear and blew away the entire configuration. It worked, but ... yuck!