Thursday, April 18, 2013

Razor brush for Alex Gorbatchev's SyntaxHighlighter

While I was putting together a new blog post about customizing the Web API Help page I took a look at how to display code in Blogger. SyntaxHighlighter is a popular tool for highlighting code in your blog posts which uses Javascript files and CSS to modify code snippets.

I followed this quick guide to using SyntaxHighlighter with Blogger (tip: don't add script references to brushes that you're not using!) and was generally pleased with the results but sad that no Razor brush is available. After a quick dabble however I have created a quick and dirty Razor brush for SyntaxHighlighter which I hope people find useful!

Example razor syntax:

Monday, April 8, 2013

Customize the ASP.NET Web API Help page with REST style groupings


If (like me) you are keeping up to speed with Microsoft's ASP.NET Web API framework you might have noticed the recent release of the ASP.NET and Web Tools 2012.2 Update. What was exciting for me in this release was the addition of an automatically generated help page which can be configured to use comments in your code for the documentation. What better way to maintain the documentation for a web service than in the code itself?

Although the display of the default help page is pretty comprehensive from the start, I wanted to change the way it grouped items to better suit my implementation of a REST service. 

During the creation of my Web API project I had considered using a separate Controller for each unique request with the 4 standard HTTP methods available (GET, POST, PUT & DELETE). In practice however it seemed neater to consider a Controller as a business entity (e.g. Customer) and to allow for several Actions types within it. This cuts down on the number of separate .cs files needed in the project and provides a logical grouping for developers trying to navigate your API e.g. 
  • Customer/Address
  • Customer/Invoices
  • etc.
In order to update the help page to group by entity/controller and then list action names and available methods I made the following changes;
  1. Areas\HelpPage\Views\Help\Index.cshtml
  2. Areas\HelpPage\Views\Help\DisplayTemplates\ApiGroup.cshtml
  3. Areas\HelpPage\HelpPage.css
1) Update the Index to include Action in the object model and then render a separate table for each Controller. The way the table is implemented in code here is pretty ugly in IMHO but I'm new to the Razor syntax and it works, so...


2) Update the rendering of the Action names to group by HTTP method and only list the action name once per url. Also add an HTTP link back to the service to allow immediate testing of GET's;



3) Beautify the CSS(!)


And that's all there is to it, a self-documenting REST style Web API service which can be maintained by developers, for developers - pretty neat!

Monday, June 4, 2012

The madness of self-funded health plans

Do you have a ‘self-funded’ health plan? You need to know that a self-funded plan is a law unto itself which provides significantly less protection than a normal plan. In my case my ex-employer Ana-data signed up for a health plan using Aetna Signature Administrators and administered by Starmark/ Trustmark which provided a miserable level of service and left me with a large maternity bill. This even though I'm no slouch at navigating the health care system here, having done all of this before with the birth of my first son with an Oxford HSA which all went smoothly.
There are a few major flaws with a self-funded plan which you need to be aware of;
·         Self-funded plans are not covered by state laws which apply to traditional medical insurance plans. This means that you could be denied benefits that your state has otherwise mandated. In my case this meant that Aetna failed to pay my midwife at the in-network rate even though they could offer no in-network midwife themselves who could provide homebirth service.
·         Since these plans are governed only by ERISA law, if you are denied a claim you can only sue for the outstanding amount. No punitive damages and generally no lawyer fees. Obviously this is unlikely to be an option for you unless your medical bills significantly outweigh the court fees you are going to incur!
·         Who’s making the decisions on your claim? An important question and one which I could never get to the bottom of, the responsibility just gets passed around and around. Did Starmark reject the in-network exception? Did Aetna Signature Administrators reject the in-network exception? Was my employer involved in the adjudication at any point? Why can I not talk to anyone about the fact that Aetna do not have any homebirth midwife’s in-network?

I spoke endlessly to Starmark, following all due processes (such as requesting an in-network exception months before birth). I also had our Insurance broker talk with them and I had the midwife talk directly to them. Still when it came around to claim settlement, Starmark failed to pay out at the in-network rate and subsequently lied about our previous correspondence stating for instance that I hadn’t submitted my in-network exception with the claim (we had).
Here's the full breakdown, but in summary - just don’t believe what Starmark tells you;
  • 2010/12 - Starmark states to Insurance broker that "midwives" & "Home births" are a covered benefit
  • 2010/12 - Starmark confirms with Midwife's office that "a home birth with a midwife is a covered benefit" and that an in-network exception can be requested based on the Insurance plans lack of providers for this service
  • 2011/02 - In-network exception pre-certification letter is sent in
  • 2011/02 - Starmark defers pre-certification to when the claim is submitted and requests that a letter requesting the in-network exception be attached to the claim
  • 2011/08 - Claim is sent in to Starmark with the appropriate 'in-network' exception request attached
  • 2011/08 - Claim is paid at the "out-of-network level" with no correspondance provided to address the "in-network" request
  • 2011/09 - Trustmark states (incorrectly) that the provider did not submit the "in-network exception" to the appropriate party and that we must open up an appeal to process an "in-network" claim.
  • 2011/09 - First Appeal letter is mailed in
  • 2011/10 - Appeal is rejected because midwives are available in-network, no mention of the fact that none of them provide a homebirth service
  • 2011/10 - Policy holder contacts Starmark by phone to discuss and is told to submit 2nd appeal
  • 2011/11 - Second Appeals letter is mailed in
  • 2011/12 - Second Appeal is rejected as before
  • 2012/01 - Having escalated back to the Insurance broker, Starmark refer to a telephone conversation with the policy holder prior to delivery which never happened.
  • 2012/xx - Numerous telephone conversations with Starmark to try and get some answers before finally the 3rd rejection letter is sent out stating that ERISA law must now be used to take the matter further.
** GAME OVER **

If you’re still fighting for your health insurance rights with Starmark, Trustmark, Aetna Signature Administrators or indeed your employer good luck to you and you may find these additional links helpful;
Excerpt 8: Self-Funded Plans > A Battle on Two Fronts (Copyright 2010, The Carcinoid Cancer Foundation and Laurie Todd)
http://healthinsurance.about.com/od/faqs/f/selffund.htm
http://www.julianarts.com/component/content/article/48-general/64-ny-state-supports-homebirth

Tuesday, October 11, 2011

MTA Posters could be easier to read

It's the weekend, you're late to meet up with your friends and you run down the subway stairs only to be confronted with a poster covered in text. It takes valuable seconds to run through all of the information, to visualize a calendar in your head, to check what date it is, what time it is... meanwhile a train pulls in across the platform and you don't know whether you should take it!

I'd like to propose that we do away with most of the text that the MTA put on posters in favour of visual elements, after all - doesn't a picture tell a thousand words? I'd like to think that this type of poster would also be useful for those who don't speak English, since it should adequately explain the basic information without using words.

Here's an original poster from my line;


and here's an alternative version I propose;




Comments, improvements welcome!

Monday, October 3, 2011

Baby Cam/ Web Cam

Hagan's room is now available live! 

UK viewers may have some luck watching him play in his crib around 6am our time, 11am GMT. Otherwise he'll usually be napping at 1pm (6pm GMT)

Monday, June 13, 2011

Shoe shelving display via an Ikea hack


So the wife wanted some more shoe storage for *ahem* not her shoes, but mine! Unsatisfied with most of the storage solutions out there I came up with a plan to kill two birds with one stone. Building shelves which would take up a minimum of space and also cover up our unused ugly hallway door which has about 11 layers of paint on it (but probably a beautiful wooden door underneath!)

As luck would have it, IKEA were having a special on Ekby Laiva shelves for $1.99 each:
http://www.ikea.com/us/en/catalog/products/30178704
(they might still be if you're lucky!)

After some measuring, designing and number crunching we came up with a plan to cut the shelves in half lengthways, leaving a nice narrow shelf for a single pair of shoes, using the other half as an anchor for the shelves so that no brackets are needed. As you can see each piece mounted to the door also helps prevent the shelf below it from pivoting upwards;

The whole project took me around four hours, but I'm pretty pleased with the results and can happily report that the raw materials cost a mere $30!

Oh yes, and I also had to repair the door jamb first to re-hang the door;


There was a lot of sawing but luckily I have a circular saw :)


Here I am, part way through. Drilling pilot holes so as not to split the particle board (or MDF as we like to say in the UK). On the right hand side you can see the wood glue ready for the next shelf. My first couple at the bottom were a little wibbly so I used a more generous amount for the rest.


And here we have the finished product !



Sunday, December 26, 2010

Custom Headboard with storage (IKEA hack)

Here's my IKEA hack for building your own head board with plenty of storage space within. We've been looking around for a solution which would fit into our bay windows and after our experience with IKEA bathroom hacks I came up with this plan after discovering that a custom job would cost more than a grand!
Shopping List
  • MOSJO TV Unit - 39.99
  • BESTA Shelf unit/height extension - 70.00
  • VIKA AMON Table Top - 39.99
  • LACK Wall shelf - 29.99
Project Total - $180

The basic idea was to take two TV stands which are the same depth and rotate them 90° so that they become storage boxes. Then custom cut a table top to fit on top of them, within the bay windows.

After assembling the BESTA frame I felt that the edge should be thicker to attach the LACK shelf. Since we weren't going to use the two shelves that came with the TV stand anyway, I cut them down to about 3" deep and screwed them to the inside, level with the edge (arrowed) to provide more support.



Attaching the LACK frame was then straight forward;

Here are the TV stands, in position (plant to be moved later!)


I've always wondered what the 'paper filled' IKEA wood looks like and now I know! About an inch of chipboard with an inner core of corrugated cardboard. For our purposes this is just fine because these edges are never seen (they face the wall) and this constructions helps the wood stay lighter for lifting on and off.

Two angled cuts to the table top and voila, here is the assembled piece with the top in place and the shelf attached to provide something to lean against...

and here's Hagan presenting the big picture the next day ;)

Happy Hacking!