…on a t-shirt tag. I’ve never thought about putting my t-shirt to a fire, but now I’m kinda curious. Maybe it is made from flash cotton (nitrocellulose)?
2013-03-20
2013-03-04
jQuery.viewSource
I finally released jQuery.viewSource – a jQuery plugin to show the HTML source of current web page, or just a HTML snippet from a page. This is useful for web pages which include HTML/JS/CSS examples and such.
As you can see from the image, the plugin can also highlight the HTML, using google-code-prettify script. You have to include the prettify script and CSS to the page yourself.
There are just two methods:
- Add $(someselector).viewSource(code-to-show-selector); to document.ready() method. This will bind the click event to the element(s) specified by your jQuery selector – i.e. clicking on those elements will show the source.
- Call $().showSource(code-to-show-selector); yourself to immediately show the source.
Note: "code-to-show-selector" is optional selector for the element which code to show. If left empty or passed an empty string, it will default to "html", ie. the whole page.
Download includes both minified and normal version of the script, along with a barebones example. jQuery.viewSource is licenced under Mozilla Public Licence 1.1.
2012-12-14
Microsoft Exam 70-483: Programming in C#
Yesterday I passed MS exam 70-483: Programming in C#. It was not an exam I really needed for MS Visual Studio 2012 certifications, as I already have MCPD (VS 2010 certifications) for both Windows and Web – so I could have done just the two exams required for an upgrade. However, I wanted to ensure I am properly up to date with .NET 4.5.
As of now, there really aren’t any “official” study materials. Microsoft’s Exam Ref 70-483: Programming in C# will come out in April 2013, Wrox’s MCSD Certification Toolkit (Exam 70-483): Programming in C# won’t be out until May 2013. Andreas Hammar has collected study links for the exam in his blog.
I read Pro C# 5.0 and the .NET 4.5 Framework, skipping quite a few sections as it is a very basic introduction (and the attempted humor in the book is just bad). Jeffrey Richter’s excellent CLR via C#, 4th Edition was both more interesting and in-depth – I read only Part II: Designing Types and Part III: Essential Types for the exam, rest will be my Christmas reading (hey, to each his own!).
The exam itself was easy – probably easiest out of all eight Microsoft exams I’ve done so far. That wasn’t really surprising, as I am working daily with those areas covered in the exam. Maybe I should have paid more attention to performance counters, but despite Microsoft pushing those heavily, next to no one uses performance counters, opting for various other profilers instead.
However, what was surprising was how bad the exam questions were. Yes, that is a new, fresh exam – but that is not an excuse for sloppiness. Obviously I cannot go into details of the questions, but several of the questions were ambiguous – i.e. they did not cover all the requirements. Formatting of the code sometimes skipped spaces, i.e. instead of int i there was inti and so forth.
At least one question promoted just horrible way of coding. Yes, the problems are artificially constructed, but whoever prepared the exam should realize a lot of newbie programmers will see the code and think this is the way that particular casting operation should be done – and they will use it in their production code, causing bad performance and hard-to-find bugs.
And even worse, one question about nullable types and LINQ did not have a simplest and most logical answer. Again, this is something I have been working with daily for years, often implementing complex business logic.
I left quite a few comments to the exam review, but unfortunately, I really doubt anyone will actually read those and fix the issues. Which is a shame, as exams (same as study books) should always promote best practices and clean code.
RSS Feed