Unit testing private methods

March 25th, 2014

I have a dirty but simple way to unit test private methods.

I create a wrapper method that I prefix with UT_ and write a comment that is only used for unit testing.
To be honest I haven’t done this on a public API but I wouldn’t hesitate for a public-within-a-company method.

1
2
3
4
5
6
7
8
private int MyMethod( int myParameter ){
    ComplexBusinessLogic...
}

///<summary>This helper method is only used for unit testing. Do Not call it in normal operations.</summary>
internal int UT_MyMethod( int myParameter ){
    return MyMethod( myParameter );
}

I use InternalsVisibleTo to make internals visible to my unit testing project.

One can play with protected methods and inheritance too.

Compile aspnet mvc views (*.cshtml)

January 26th, 2014

To make a long story short one can compile the views in asp net mvc.

It takes considerable time though so I only activate it for release compilations.

Update the build file with


1
<MvcBuildViews Condition=" '$(Configuration)' == 'Release' ">true</MvcBuildViews>

Like so:


1
2
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MvcBuildViews Condition=" '$(Configuration)' == 'Release' ">true</MvcBuildViews>

I am sorry about all &gt; and &lt; but I don’t have the time right now to make everything look pretty. Just replace &gt; with < and &lt; with > and your good to go.
Or follow the links below with the awesome formatting Stack overflow provides.

Honour those who should. Especially this answer that does the only-release trick.

The X-Y-problem

July 31st, 2013

Try to solve X.
You recognise that to solve X you must first solve Y.
You ask for help on how to solve Y.

When you really should ask for help on how to solve X.

More thorough explanation.

I have not solution to the problem but knowing it exists is a good start to avoid it.

There are mainly 2 ways to keep a running project running – change or not

July 31st, 2013

When a project goes live it enters the maintenance phase. Further development changes.

There are mainly two ways to keep said project running.

Great wall of China

The first is to pretend the world is not (r)evolving and keep the project in a stable state.
This means one must consider present and future changes and make sure these don’t affect the system.
Unfortunately this also means changes are slow and expensive; not necessarily because of code base but of management who believes the system will work and not have to be changed because changing costs money.

What often happens is that changes are postponed until a bug or security issue surfaces in the OS, underlying framework and changes must occur. Note that I wrote “OS” and “underlying framework” and not the project specific code. The world did (r)evolve despite intentions.

Continuous change

The other method is to acknowledge that the world changes and change accordingly. The world changes continuously so allow the project to change continuously.

What comes out of this is also that every change becomes cheaper, both in money and in administration and in percieved load for management. Bugs and features are also fixed and implemented faster which benefits the business.

Communicate, communicate, communicate – and how to lure you into reading

June 3rd, 2013

hejdig.

As usual there are development stuff at the top and the fun is at the end to lure You into reading.

/OF

—-8<—-

Code and development

Teaching kids programming

Pluralsight, makers of well known online programming videos, are sometimes giving away videos on chosen subjects.
This time it is about learning kids to program.

Caveat1: I haven’t looked through the whole video – my personal competence is higher and my patience lower.
Caveat2: The freebie might be time limited so by the time you read this you might be too late.

- http://pluralsight.com/training/Courses/TableOfContents/teaching-kids-programming
- http://pluralsight.com/training/Courses/TableOfContents/learning-programming-scratch

Create random test data for database

I am one of those who has released a solution to customer and had good performance.
Until reality hit with 10000 entries in a table and my bad design floated to the surface like a… like a… like a… floater.

So nowadays I keep my test database filled with data.
But there is still a problem – my test data looks rubbish.

I have below linked a gratis online solution to remedy this. Enter fields, their type (name, country, email, phone, date time, domain, words, sentences and many more) and just press Generate.
The data is clearly US centric but the Datetime is, low and behold! ISO format.

If you need to create random credit card numbers there is a link for that too.

- http://www.databasetestdata.com
- http://www.getcreditcardnumbers.com

el.js – create dom objects easier (web)

Creating dom objects with javascript isn’t hard but boring and ugly.
With jquery it is easier but still ugly.
The lib el.js makes it both easier and better looking to create dom elements.

Follow the link for some examples. Googlewithbing for how it is done in jquery.

- https://github.com/markgandolfo/el.js

Aspnet Webforms life cycle events (dotnet,web)

There are more events than I care to remember in Webforms and normally one doesn’t have to remember but a few.
But then one does Master/Content pages and suddenly realise that the order of events is important.
And then one does some code reuse by implementing a custom control and realise the order of events and what to do in which event is crucial.

Good then to have an explanation and cheat sheet.

- http://msdn.microsoft.com/en-us/library/ms178472(v=vs.100).aspx
- http://hemantg.blogspot.se/2010/12/aspnet-event-sequence.html

Visualstudio plugin – Json visualiser (win)

The “visualiser” is the magnifying glass you see when inspecting a variable when debugging in Visual studio.

There are already for text, xml and html. With this download you can also see objects as json.

Come to think of it… with web essentials there is a “paste json as object” alternative. This way one should be able to get any object’s data, anonymous or not, visualise it as json, copy it as string and then pasting a class. Or sniff the network traffic with Fiddler2 or whatnot. Show the data received as json. Copy and paste it as a class structure.

- http://visualstudiogallery.msdn.microsoft.com/ca9c71b0-111c-48b8-9119-3a41fa9b88ba

Tutorials on the chrome web browser debugger (web)

I use different web browsers not only because my users do but also because the debugging tools excel at different things.

Below are some courses on the debugger in Chrome.
I recommend it if you do web development – even a die hard sooper dooper hard kore hacker like I found a gem. To be precise: it is not because I don’t know but because the user interface is a bit clumsy sometimes and hides its own functionality.

If you continue to browse codeschool there are more courses and after a signup some of them are gratis.

Competence level on courses are between beginner and experienced.

- http://discover-devtools.codeschool.com

Can we ditch jquery? (web)

As per today I reflexively include jquery in my web projects.
But do I need to?

If one can skip IE6 (which one can, depending on target audience) and soon skip IE7 there is a big chance one can write code that runs everywhere without too much shims.

Note that next big version of Jquery doesn’t support IE8 so I am not too far out on a limb here.

Why ditch Jquery then? Because it can be slow. Because it puts on yet a layer.
I have now twice heard/read about people not including Jquery at start but instead using libs and frameworks like Knockout and Angularjs to manipulate the DOM. I haven’t tried Angularjs but my first try at Knockout showed me that the code I thought was easy to read really wasn’t – instead it had been a mix of UI logic and UI manipulation in a way that I never had allowed myself to do in a more controlled (read WPF or even Winforms) environment.

- http://professionalaspnet.com/archive/2013/04/14/Why-Its-Time-to-Sunset-jQuery.aspx

Microjs (web)

I have written about this site earlier but with a different approach.

This time I want You to consider the value of having small pieces to put together instead of one catch-all framework.

Having two or three old and present sites in my head I read through the first 50? rows and came up with 2 or three frameworks that might help/have helped me.

There is el.js to add items to the DOM. There are a couple of IoC frameworks. There is time.js for handling time data – why don’t the world use ISO? There is isMobile for checking for mobiles and 7″ devices – not something one can do with a simple check normally. There is range.js when you need to create ranges of something.

With Visual studio 2012 with web essentials it isn’t much job to bundle and minify the scripts. Well… it is even better; the scripts are kept apart and not minified while debugging and then bundled and minified when Release compiled; best of both worlds.

- http://microjs.com/

Responsive design frameworks (web)

Responsive design is like programming without variables.
It is more like playing a game than a making a real solution.

So to lessen the burden one should use a framework.

- http://www.webdesignerdepot.com/2013/04/really-easy-responsive-design/

Tidying CSS (web)

Getting responsibility of the CSS part of a project is like running around in a pitch black child’s room. Barefoot. With lego blocks on the floor. One wrong step and one is in for a world of hurt.

My GF says it is like applying mascara. Once it is there it must not be removed but only added to.

So tools are needed for CSS.

Caveat: I haven’t tried these but most certainly will as soon as time allows.

Csscss is a ruby solution for looking through a CSS to find duplicated uses. It also does LESS with another gem.

Helim-css runs javascript against real URLs, gathers styles and compares selectors found. The site must be manipulated so it is to be done against a non-live site.

- https://github.com/zmoazeni/csscss – https://github.com/geuis/helium-css

Using Dotnet (mono) on Raspberry pi (dotnet,linux)

Mono, the dotnet port outside windows, can be run on Raspberrypi.
This makes it possible to use your favourite language on a very small and cheap device with a big user base.
Mono does Winforms and Aspnet (which i guess is (a subset of?) web forms.

There is no mentioning of Nancy but as nancy is lighter than Aspnet and does not have any relation to System.Web it should be doable too. Says I who has tried neither Raspberrypi, Mono nor Nancy.

- http://www.amazedsaint.com/2013/04/hack-raspberry-pi-how-to-build.html
- http://techny.tumblr.com/post/36438641616/compile-nancy-applications-on-a-raspberry-pi

Jade – Haml like syntax for html (web)

Check out the text on the landing page.
By using/writing Jade instead of HTML you don’t miss the closing tag or many other typos that are easy to do in HTML.

It is implemented for Node so it is written in Javascript and, of course, open source.

Haml is predecessor for Jade but for the Ruby world.

Then there is Yaml which is a simplified XML which is both faster to write and easier to read. Plus one cannot miss the closing tag since there is none.

- http://jade-lang.com
- http://haml.info

Craftstudio – graphical game programming (win,osx,linux)

A graphics heavy programming environment for games.
30€ is not expensive.

I haven’t tried it myself but the demo vid looks impressive.

- http://craftstud.io/

Two.js – 2D graphics in javascript (web)

2D with animations. Requires backbone and underscore.
Can render in contexts svg, canvas and webgl.

- http://jonobr1.github.io/two.js/

Projects and leadership

Scaling crazily fast

Pinterest scaled to 10 billions page views a month views in 2 years!

From the article:
“They’ve gone from 0 to 10s of billions of page views a month in two years, from 2 founders and one engineer to over 40 engineers, from one little MySQL server to 180 Web Engines, 240 API Engines, 88 MySQL DBs (cc2.8xlarge) + 1 slave each, 110 Redis Instances, and 200 Memcache Instances.”

The article contains lots of lessons learned in a boring and easy to read bullet point way.
I thought it was interesting though I will hardly soon be in a project that grows at that speed.

- http://highscalability.com/blog/2013/4/15/scaling-pinterest-from-0-to-10s-of-billions-of-page-views-a.html

How to draw diagrams – and not

A SimonB has written a not too long article about keeping it simple – diagram wise.

To make the article even shorter here are some bullets:

1) Abandon UML. There is nothing wrong with UML but it is too clumsy to work with. Pen and paper rocks! and coloured crayons keeps the fun alive.
2) There is a System or Context diagram. 10000 meter view without technology. Draw a box of Your system in the middle and small boxes for other systems around. Users are visible from 10000 meter.
3) Containers diagram. A container is something that executes or where data resides; something that needs to be kept alive for the whole System to work. A web site, a service, a database or an application is typically a Container.
4) Components diagram. Draw one Components diagram per Container where applicable; databases often do not need a Components diagram. A Component is typically a visual studio sub project, a service interface or a pure logical abstraction.

My comments are:
Keep the diagrams easy to update.
Don’t necessarily keep them 100% correct – humans will read them anyway.
Keep the diagrams visible.

- http://www.infoq.com/articles/agile-software-architecture-sketches-NoUML

How Spotify does devops

Devops is about removing the wall between Devs and Ops. It is also about getting decisions from the meeting room into the final customers’ hands as quickly and safely as possible.

Below is linked a somewhat length article about Spotify’s take on the subject.
TL;DR: They have Team lead, Project owner and Agile coach which cooperate.

- http://www.infoq.com/articles/monthly-devops-03-spotify

Products and releases

Opera is going Webkit and Google is forking Webkit (web)

What does this mean?

(I am only covering the desktop landscape here)

Lets start with Opera.
It is know as the standards compliant browser with too few users.
It has since the dawn of time (that is, since the Information Highway became the Internet) run its own rendering engine (Presto) and its own javascript engine.

Now it has changed to the Webkit renderer which makes it behave like almost everyone else (but IE as normal).
Good: one less browser to test
Bad: the html renderer gene bank is getting thin

Opera uses V8 as its javascript engine, just like Chrome.

Which would make Chrome and Opera render and behave similarly.

But…
Google is forking Webkit

and as Google is paying Opera for being the pre chosen web searcher a good bet is that Opera is following the Google fork path Blink.

- http://www.quirksmode.org/blog/archives/2013/04/blink.html
- http://www.webdesignerdepot.com/2013/04/google-forks-webkit/
- http://prng.net/blink-faq.html
- http://slashdot.org/story/13/04/03/238258/opera-confirms-it-will-follow-google-and-ditch-webkit-for-blink

Glimpse supports EF5&6 and adonet (web,dotnet)

Glimpse is an awesome tracing tool for web.
Gratis.
I guess even open source.

Latest release supports tracing from the web browser all the way to calls to the database.
The architecture is pluggable so more can be achieved with some elbow grease.

Latest release supports calls from EF3,4,5 and even 6 (still a bet) and with some tweaks also Adonet-calls.

12USD phone

How does one make a 12USD cellular phone?
Besides child labour and not caring about the ecology i mean.

The original site, Boingboing is as much about freedom as about sharks with lasers, so it was strange to find the article linked below being not about abuse of people and nature but more of a “it can be done – yeah!”

- http://boingboing.net/2013/04/18/how-is-a-12-phone-possible.html

Bittorrent sync

Every backup strategy has its own pros and cons and I won’t dive into them but instead present a new player; Bittorrent sync

The solution linked below seems simple. The traffic is encrypted for your and your only use. It uses bit torrent as protocol.

Runs on Win, Mac, *nix.
It does not look like it is open source.

- http://labs.bittorrent.com/experiments/sync.html

Check under Developer tools to. I don’t understand everything but it looks like some kind of bit torrent with the browser as GUI.

Code digger – analyze code to create test data à la Pex (win)

Creating input for unit tests is boring.
Pex is an experimental software from Microsoft that helps with that. Now there is also Code digger that analyses code to make better educated guesses about what data is worth testing.

There is a limitation though – it only walks public code and only portable such.

- http://www.infoq.com/news/2013/04/code-digger
- http://pex4fun.com

Markdowndeep – c# markdown implementation (dotnet)

# Markdown

## Contents

Markdown is a very simple format for simple formatting. If you ever have shared something on Stackoverflow then you have also used a Markdown variant.

Personally I have adopted markdown for communicating with my customers.

I haven’t tried Markdowndeep myself – I am just a fan of the format.

- http://www.toptensoftware.com/markdowndeep/
- http://www.toptensoftware.com/markdowndeep/dingus

Privacy, security and rights

Microsoft / Live has two factor authentication

Set it up!
Now!

If you use Gmail you should have set it up a long time ago.
Other wise.
Set it up!
Now!

Simplified; What happens is that you get an SMS ever 30 days or so for making sure you are the right user of the account. I have used this for a long time on gmail and it is a hazel nut of a hassle for a full container of security.

- http://blogs.technet.com/b/microsoft_blog/archive/2013/04/17/microsoft-account-gets-more-secure.aspx
- http://www.hanselman.com/blog/SettingUpTwoFactorAuthenticationForYourGoogleAccountANDMicrosoftAccount.aspx

Miscellaneous

Twine – create your own interactive stories

Twine is a downloadable application for creating interactive stories. The interactivity consists of hyper links which can make a story fork and allow the reader to choose his/her own adventure. There are also normal hyper links to make the old fashioned book proven linear reading more colourful; or at least linkful.

It is based on TiddlyWiki which is a downloadable wiki engine/application.
TiddlyWiki can be though of as a normal editor with link capability and it can save its output as HTML to copy as static pages to a web server. (Using it as a stand alone help document springs to my mind too.)

- http://www.gimcrackd.com/etc/src/
- http://tiddlywiki.com

US war aircraft 360 cockpit online viewer

Especially if you are a war aircraft nerd this link is nice.
It is 360 interiors from the US warfare aircrafts from WW1 to the cold war. In the latter there is as much electronics as there are little in the earlier.

But that is only a little.
“Walk” inside the museum and look at the exterior of the aircrafts too.

- http://www.nationalmuseum.af.mil/virtualtour/cockpits.asp
- http://www.nmusafvirtualtour.com/full/tour-std.html

Remote controlled quad copter with stabilised camera

Still a bit expensive but prices are most certainly coming down.
Unless the stupid US patent system puts a halt to innovation; as it tries over and over again.

( There is another way to stabilise the camera image and that is to move each picture in the movie around afterwards. The amount of shake tolerated is the amount of border allowed to be wasted. )

- http://www.gizmag.com/dji-phantom-vision-zenmuse-quadcopter/27028/

Foldable rubber boots

As the title says.

I used to have boot overshoes that where thin enough to fit inside a toilet paper roll. I had them constantly in my bag to bring forth at rainy days. This way I could have nice looking shoes at dry days while still being dry at rainy. They have unfortunately been worn down and I have found no replacement.

The boots linked below are bigger than my old overshoes but also nicer looking.

- http://www.werd.com/19884/foldable-japanese-rubber-boots/

Calvin and Hobbes: The movie

Not.
Don’t be afraid.
Calvin and Hobbes is, to my knowledge, not begin abused as a cheesy Hollywood production to render some income and stain the history of the awesome cartoon.

Instead:

A bunch of guys calling themselves GrittyReboots did their own take on Calvin and what happens when he grows up.

The same guys also did Goodnight moon which is a children’s story but remade as a horror short story. A good one.

- http://www.youtube.com/watch?v=17qyaXOFZXg

Funny public bath rooms

…or rest rooms as they are called.
Or lavatories.
Or loos.

- http://strangebathrooms.tumblr.com

Wringing a wet towel in space

Nothing special.
Just a nice presentation about water and surface tension.

- http://www.youtube.com/watch?v=o8TssbmY-GM

Electric power outlet design

Power outlets are ugly
but we have gotten so used to them that we don’t see them any more.

Below are linked some improvements on the design.

- http://www.allidesign.com/13-creative-plugs-and-cables/

Next time I will mention TV sets
that are even uglier.
A big black square in prime place in the living room.
Who came up with that idea?

Coffee shop ambient sound in office

Do you have a hard time concentrating when it is quiet?
Tune in and crank up the ambient sound of a coffee shop.

The sound is proofed to not have any 16 year old girls chatting too loudly about nothing and facebook. Ditto boys.

- http://www.coffitivity.com

Sketch like Escher online

An online F/OSS solution for drawing kaleidoscope.

If one could combine the kaleidoscope mechanics with artistry like pencils, styles and other fluffy values we might have something really cozy to play with.
It is open source so feel free to grab my ideas above and implement.

- http://levskaya.github.io/eschersketch/

Online gratis manga

If you like manga, here is a gratis resource.
Or if you are curious…
…here is a gratis resource.

I have read a couple.
But I still don’t like manga.

But I do like Miyazaki but can’t find anything free.

- http://mangafox.me/directory/

*EOF*

Domain models and the database schema

May 24th, 2013

TL;DR

A domain model does not have to look like the database schema.

They can resemble each other but they don’t have to.

 

A domain model is for handling domain problems while a database is for storing and retrieving data. Let each tool do what it is best at; a hammer for nails and a screw driver for screws.

Testing internal classes without making them public

May 15th, 2013

When doing automatic tests one often wants to get to the internal classes.

The possibly simplest way is to use InternalsVisbleTo and write

1
[assembly:InternalsVisibleTo("MyTestingProject.With.FullName)]

in the testee’s AssemblyInfo.cs

Or one can write just before the namespace declaration too

1
2
3
4
[assembly:InternalsVisibleTo("MyOtherProjectNameLikeExampleAbove")]
namespace Whatever{
class Hello{
...

<shrugging shoulders>Thats all there is to it.</shrugging>

The namespace is System.Runtime.CompilerServices.

One can decorate InternalsVisibleTo with keys and stuff to harden who gets to the internals but why bother? As long as it is dotnet some reflection can get passed the threshold anyway.

Another way I have used is to make a wrapping class “UT_Customer” or method “UT_Create” that 1) wraps the internal class/method, 2) is public and 3) is clearly marked with something conspicuous like “UT?_”. If a drive by programmer sees a method with a weird name and doesn’t bother to read the xml comments and still uses the method and fails; I consider it his fault, not mine. Not that I would use an undocumented method, no never.

Minfied respond.js does not work in unpatched IE7

May 14th, 2013

I haven’t the full reason for the problem – exactly which implicit line ending that goes wrong – or whatever else that is broken.  But the (almost) fix is – don’t use the minified version.  At github you can get either version as (respond.min.js or respond.src.js).  Go for the latter, it is the non-minified one.

In my unlatched IE7 I get a somewhat stocastic behaviour.  When just browsing it first fails but a reload makes the page load properly.
When I debug both the debugger and IE freezes at a regular javascript row in respond.js.  ”document = doc.documentElement”.  This is also where I give up.

Other browsers – including Safari/Ipad and built-in/Android seems to work alright with the minified version.

Communicate, communicate, communicate – and the old layout with the same awesome information

April 2nd, 2013

hejdig.

Last letter I tried to create a better layout.
It worked. But the links crashed.
So I go for the old and tried layout below again.

In normal order it starts with Development stuff and then continues with Leadership followed by Products and Security to be ended with Miscellaneous.
And if there is one chapter you should read it is the last one. Why? Because it contains all the fun links.

Today’s top article are about
* Java 6 and 8
* Noda, Joda, CLDR, NLDR which are time and culture resources for global solutions
* Regex testing in several languages
* Yet a brief explanation of which element goes where in HTML5
* MS web tools 2012
* Why budget planning is counter productive
* Glimpse (and elmah and minprofiler)
* HDMI debunked
* The size of the universe

/OF

—-8<—-

Code and development

Top javascript MVC frameworks (web)

If javascript is the soil and frameworks the crop; then it is a good time to be a farmer in Javsacriptland. No other developer biosphere is as fertile IMHO.

MVC/MVP/MVVM is the hoot nowadays. Read my lips: Do Not Develop Client Side Javascript Without Framework Support.

Below is linked to several such frameworks.
Of these I am only familiar with Knockout, hands on wise.

Note: Backbone builds on Underscore – a lib you should look into whether you do MVC/MVP/MVVM or not.

- http://www.infoq.com/research/top-javascript-mvc-frameworks

End of line for Java 6 in March (java)

If you haven’t updated your Java from v6 you are a dinosaur. And the meteor is about to hit.

- http://www.infoq.com/news/2013/01/jdk6-retirement

Information about Java8 (java)

Java 8 is scheduled for September this year.
There are several new things and this article I found was easy to read.

- http://www.techempower.com/blog/2013/03/26/everything-about-java-8/

Learn F#, gratis, online (dotnet)

Microsoft has released a site for learning F#.

- http://www.tryfsharp.org
- http://www.infoq.com/news/2013/01/tryfsharp

Noda Time – date/time library ported (dotnet)

Joda Time, a date/time lib in the Java world has been ported to Dotnet.

- http://www.infoq.com/news/2012/11/Noda-Time-1-0

GIT integrated in TFS service (win)

“Sweet men du ligger efter i GIT-TF informationen. Från och med i torsdags är GIT integrerat i TFS Services och det finns fullt GIT-support i en Visual Studio CTP. Så du kan numer välja att köra TFS VCS med TFS språk (Check Out/In, o.s.v.) eller köra TFS GIT med GIT språk (Push, Pull, Commit).”

In short this means you can mix and mingle GIT and TFS as you want.

Will this mean you don’t have to buy a license to write to the TFS store any more?

- http://blogs.msdn.com/b/bharry/archive/2013/01/30/git-init-vs.aspx

Tipthanks //E

CLDR – database over formats etc. in different countries

If you ever have done a multi language / multi culture solution you have stumbled upon all the ways to represent date, time, currency, numbers and whatnot.

Below is linked a project to create a big database of all this.
It is an open project so help is appreciated.

- http://cldr.unicode.org

ncldr.com – dotnet port of cldr, a database for globalisation data (dotnet)

The Time and Date namespaces in dotnet are plenty but not perfect. There are cultures missing and there is no information about currency, names of weekday and no rules for spelling of number or capitalisation.

So therefore we have the Unicode CLDR project which I have written about before.
Ncldr linked below is a dotnet port of CLDR.

- http://www.ncldr.com
- http://cldr.unicode.org

Multiple carets in Visual studio (win)

Since version 2010 it has been possible to alt-arrow or alt-mouse a caret (cursor, insättningspunkt, whatever you call it) to a vertical line and to “box inserting”.
With an add-on this is taken further so one can alt-mouse to different places in the document.
Look at the animation behind the link – an animated GIF is more worth than a thousand words.

- http://www.hanselman.com/blog/SimultaneousEditingForVisualStudioWithTheFreeMultiEditExtension.aspx

HTML5 and elements – what to use where (web)

With HTML5 coming we’ve got to read up on which element to use where. I still haven’t grokked it but below is linked a flowchart to help me. And You as I write it here…

- http://html5doctor.com/downloads/h5d-sectioning-flowchart.png

Isotope – javascript/css lib for stacking squares (web)

Say you have a text box. Say you have several.
Say you want to show them on a web page.
Then you want to add new ones, and remove, and change size and and and… and you want them to stack themselves.
This is where you give up until you read this.

Metafizzy has Isotope, Masonry and, as of late, Packery.

Packery does more intelligent packing. I see lots of use for this, say for instance you are moving and filling one and only one lorry with stuff.

- http://metafizzy.co
- http://isotope.metafizzy.co
- http://metafizzy.co/blog/packery-preview/

BCL is an immutable lib (dotnet)

BCL is a lib still in experiment for doing immutable stuff.
“Immutable stuff” are stuff that doesn’t change, instead you have to create a new instance. Often in parallel computing, which is coming fast, you want to have immutable objects for having thread safety.

- http://www.infoq.com/news/2013/01/Immutable-BCL

Micro formats and schema.org (web)

There is something called Microformat. It is using (X)HTML for creating semantic data. If you need to send Person data to someone, why invent a new format? Instead reuse.

- http://en.wikipedia.org/wiki/Microformat
- http://schema.org

Introduction to Rx – dotnet reactive framework (dotnet)

Rx (Reactive Extensions) is a dotnet library for using IObserver and IObservable. With Rx you can get events when a collection is added to or removed from. It is like having a form *inside* your app. Sort of. Liksom.

The site below is an introduction and tutorial for this.

- http://introtorx.com

Online regex testing in several languages

Every language has its own implementation of regex and they might differ. So when googlingwithbing for an online regex tool one has to make sure the right language is used.
For instance is the very good Rubular.com written in Ruby. Most are written in Javascript. No usable was written in dotnet.
Until now.

Through the link below is linked to online Regex testers in 10 different languages.

- http://www.regexplanet.com

Windows shell commands as… commands (win)

As heavy Win developers we are aware of %temp%, %appdata%, %systemroot%, and %programfiles% as shortcuts for c:… but what about “shell:”?
Open a prompt or the Explorer address bar and write “shell: cookies” to get to cookies, “shell: common startup” for the common startup and “shell: startup” for user user’s or “shell: system” for the system path etc. You get get idea.

Follow the link below for more information.

- http://sqlblog.com/blogs/john_paul_cook/archive/2013/02/13/windows-shell-commands.aspx

Six hours of video for getting started at aspnet programming

Building web apps with aspnet jump start: 6 hours of free aspnet video.

- http://weblogs.asp.net/jgalloway/archive/2013/02/28/building-web-apps-with-asp-net-jump-start-over-6-hours-of-free-asp-net-video-training.aspx

Getting the name of the calling method in dotnet (dotnet)

Anyone hacking WPF should read this.

When doing logging it is sometimes nice to know the caller so instead of

1
2
3
public void MyFunction(){
MyLogger.Write( "MyFunction", "Start");
...

one can write

1
2
3
public void MyFunction(){
MyLogger.Write( "Start" );

All it takes is to call a stack walking method like so:

1
2
3
4
public static class MyLogger{
public static void Write( string message ){
Console.WriteLine( CompulsoryCat.CallingMethodName() + ":" + message );

That is the reason I wrote CompulsoryCat which is a helper lib to, among other, get meta data out of methods.
It is my plans to move it to CompulsoryCow but maybe I won’t since some of the functionality already exists in Dotnet4.5. Since Microsoft has a grab on the compiler in a fashion I don’t they could also make the syntax nicer.

1
2
3
4
public static class MyLogger{
public static void Write( string message, [CallerMemberName] string callingMethodName = null ){
Console.WriteLine( callingMemberName + ":" + message );

Now think INotifyPropertyChanged, made famous of MVVM and WPF. If you program in WPF then you know of INotifyPropertyChanged. And then you know of all the hard coded property names.
That can be made a thing of the past with Dotnet4.5 and above syntax.

Well… to be honest- one can get to the property names through lambda which makes part of the problem disappear.

- http://code.google.com/p/compulsorycat/
- https://github.com/LosManos/CompulsoryCow
- http://10rem.net/blog/2013/02/25/using-callermembername-for-property-change-notification-in-xaml-apps

Advanced Html/Css and polyfills (web)

Advanced. Html. Css. Shiv. Shim. And how to use.

Do not read if you are a Html newbie – the crooked and confused way of Html and Javascript might scare you off to more well paved paths.

For the die hards – the site contains more advanced stuff.

- http://learn.shayhowe.com/advanced-html-css/feature-support-polyfills

CSS tools – noise texture (web)

Noise is not something you want in an image. But when hipsters design blank areas of colour, noise is suddenly in demand.

Below is linked a tool that does what the head line says.
Plus a gradient generator, the-most-awesome-thing-of-html5 rounded corners and box shadows.

- http://www.cssmatic.com/noise-texture

Web tools 2012 (dotnet)

Update for your Visualstudio. Syntax highlighting for Coffeescript, must ache, handlebar and jsrender (like query templates but without the DOM), more odata, more signalr, mvc like routing in web forms, device dependent page name in web forms just as in mvc, 4 new spa templates, more azure and more functionality.

It is an update of earlier release with more functionality than I care to write about.

Did I say it is gratis?

- http://weblogs.asp.net/scottgu/archive/2013/02/18/announcing-release-of-asp-net-and-web-tools-2012-2-update.aspx
- http://visualstudiogallery.msdn.microsoft.com/07d54d12-7133-4e15-becb-6f451ea3bea6

Webpagestest.org – hit your site with a hoard of speed tests (web)

How fast is your site?

Enter your site’s URL in the site below and behold the answer.

- http://www.webpagetest.org

Kulmedkod – site om att lära barn programmera

Med lite ojämna mellanrum dyker nyheter upp på siten nedan.

Den är inte en-site-för-all-info-om-att-lära-barn-att-programmera tyvärr; jag har fortfarande inte hittat en sådan site. Men letar. Och när jag hittar få ni reda på det.

Under tiden har jag kulmedkod i min RSS-feed (och min twitter).

- http://kulmedkod.wordpress.com

How to version and write release notes – a proposed standard

For versioning of a program the semantic versioning has risen to an almost standard.
But how does one write release notes?

Semantic release notes is a proposed standard (in the same way as Markdown is a standard) for writing release notes. I haven’t tried it but I will because I do write release notes and I do have to compile them later. Having an almost standard would help my work.

Even if you aren’t interested in semantic release notes, do look into semantic versioning.

- http://www.semanticreleasenotes.org
- http://semver.org

Projects and leadership

Jämför lån- och sparkonti

Jag hittade snabbt ett sätt att låna pengar till 838% effektiv ränta, “vardagslånet”. Det skall jag inte ta.
Även om man inte ser hela sanningen så är det ett intressant projekt.

Man kan också jämföra sparkonti och jag fann raskt ett sparkonto som ger mycket mer än det bästa min bank erbjuder.

- http://www.bank24.nu

Compare more CMSs than you have ever heard about

There are tons of CMSs out there. How to find the right one?
Use the link below to compare the ones that interest you.

- http://www.cmsmatrix.org/matrix/cms-matrix

Planning a budget is sub optimating

Have you read Valve’s Personal handbook? It is good.
Have you read your own company’s Personal handbook? It most certainly sucks.

Valve did something different, instead of writing the same boring handbook as every other company; they decided to make something good out of it.

The same counts for how Vale hires employees.

The same with The blogging terrier. He is co owner of a company and decided to go for equal salary. At first it felt like a bad idea but it soon became an advantage. Read more through the link below.

- http://jockeholm.wordpress.com/2013/03/08/am-i-a-socialist-how-a-small-consultancy-approach-the-tricky-questions-surrounding-power-and-money/

How Valve hires, fires and pays

I have earlier written about Valve’s awesome personal handbook.

You know the concept your company has with rules and regulations and policies and stuff? The concept that is out of date, impossible to understand, too long to read and presumably signed by all employees.
Valve has one too. But their is awesome!

I still haven’t read the personal handbook for where I am employed. But I have read Valve’s. That is how awesome it is.

Now to today’s subject. Valve’s routine of hiring people. And firing. And the salary in between. This isn’t in a handbook though but in the mind of the People. Awesomeness in life.

- http://www.gamasutra.com/view/news/187296/How_Valve_hires_how_it_fires_and_how_much_it_pays.php

Daily Sync for five teams

Scrum meetings in a team isn’t that difficult. But how does one do the scrum of scrums? the synchronisation between teams I mean.

Should one do the scrum of scrums before the scrum? If one does; one can send the helicopter view back to the teams. On the other hand, if one does the scrum of scrums after the team scrums one has better input for the oval guiding.

MarcusH doesn’t have the answer but some good insights.

- http://www.marcusoft.net/2013/03/daily-sync-for-five-teams-and-get.html

Producing open source software book

Running an open source software project is not easy.
Below is linked a book on the subject to read digitally or as tree killer.

I have not read this book, just glanced through some pages.

- http://producingoss.com

Products and releases

Phonegap with WinPhone8 support (mobile)

As the head line says

- http://www.infoq.com/news/2013/01/phonegap-2-3-0

Discourse

The guys at Stackoverflow revolutionised the Q&A webs. Before Stackoverflow every Q&A site was bad. Now everyone know what a Q&A site _should_ look like.

Not being content with creating the world’s best Q&A site they have looked at discussion sites, forums. Think phpBB. They equally suck in one way or another or more usual several ways.
So they set out to fix this.

Discourse.org is their product.
I have great beliefs in it. If it is half as good as Stackoverflow it will still be the world’s best forum.

Did I mention it is free? Free like in Libre.

- http://www.discourse.org
- http://www.youtube.com/watch?v=Xe1TZaElTAs

Which does hold the most RAM, Win8Pro or MacAir?

TL;DR

It’s equal.

Longer

There has been some mud slinging about this and it boils down to two things.
1) Whether one counts a megabyte in 1000s of bytes or 1024s of bytes.
2) Fanboys.

Next time someone throws you some data about one or the other and the amount of RAM; return this link to them. It is a lengthy article about calculations and how to get more even more RAM and just plain old debunking.

- http://www.zdnet.com/surface-pro-versus-macbook-air-whos-being-dishonest-with-storage-space-7000011009/

Lorempixel – lorem ipsum but for images (web)

When you need place holder text you go looking for lorem ipsum.
But when you need images? There are several solutions for this, like bing. Another is lorempixel. One can choose image size by tweaking the URL and even image category (sport, cats etc.)

- http://lorempixel.com
- http://lorempixel.com/400/200/sports/

Open source HTML5 game engine (web)

Somewhere HTML or Javascript means a product has to be open source. So with this one. It’s a game engine for HTML5.

- http://www.gameclosure.com

FullCalendar – jquery plugin web calendar (web)

A web calendar with drag and drop implemented as plugin to jquery.

I haven’t tried it so I can’t tell if it only does US datetime or also more international ones.

- http://arshaw.com/fullcalendar/

Glimpse 1.2 (dotnet)

If you do asp net programming you should already have looked into Glimpse.

It is like a procto camera into your web server.
Do like this: install it in your web project through nugget. There are a few lines added to web.config. Then surf to your site and to the page Glimpse.axd. Press the button shown.
Now, when you surf your site you see not only network information but even database calls! (well… you have to do EF or something else Glimpse compatible but anyhow: it is cool as hell is hot)

If you like it.
Correction.
When you like it.
Search for Elmah and MiniProfiler.
Equally awesome.

- http://blog.getglimpse.com/2013/03/19/glimpse-1-1-released-with-support-for-mvc-4/

Miscellaneous

Devops reactions – say it in moving pictures

Small flicks of fun showing my working day in both glory and fail.

- http://devopsreactions.tumblr.com

Tipthanks Anonymous

Why all HDMI cables are the same – debunking

Warning audiophiles. Don’t read further or you will feel cheated. Your 100€/m HDMI cable isn’t better than mine.

- http://news.cnet.com/8301-17938_105-20056502-1/why-all-hdmi-cables-are-the-same/
- http://reviews.cnet.com/8301-33199_7-57540275-221/still-more-reasons-why-all-hdmi-cable-are-the-same/

The universe is big. It is even bigger than that. And then plus some.

Following the link below might give you some clues about how big it is. Note “might”. Because all I got was headache.

If the video doesn’t show – click in the sidebar to the right “How big is the universe compared with a grain of sand”.

- http://www.guardian.co.uk/science/video/2013/feb/11/how-big-universe-sand-video1

Play house model “big”

Some with air conditioning(!)

- http://imgur.com/a/8Dqv8

Remote controlled paper plane

A battery. A rod. An airscrew. A wind rudder. For about 30€.
Just add a folded paper.

Geniously!

Me gonna buy for sure.

- http://www.nyteknik.se/popular_teknik/teknikrevyn/article3637689.ece

Tipthanks Lasse

Blanda egen spolarvätska och dyr är inte bättre än billig

Jag kan underteckna att Statoils gördyra spolarvätska luktar Mycket.
Enligt test är den dessutom dålig.

Miljöpåverkan har inte testats.

Bosse bildoktorn blandar egen, billigare och säkert bättre också.
Dessutom har han moussserande vin för festligare tillfällen(!)

- http://www.teknikensvarld.se/2013/02/24/38288/billig-spolarvatska-battre-an-dyr/
- http://www.youtube.com/watch?v=m8Yjw0QqXAs

Tipstack Lasse

A ridiculously large swing

Disregarding the fact that I would piss in my pants I still want to go!

- http://www.youtube.com/watch?v=fdJc1_IBKJA

William Gibson Alien iii script

William Gibson is a good writer.
Alien is a good file series.

Together…

It is a film script so it is a different read than a normal novel.

- http://home.online.no/~bhundlan/scripts/alien3/gibson.htm

*EOF*

Tip when using DebuggerDisplay in Dotnet/Visual studio

March 7th, 2013

When debugging and watching an object one only sees the name of the type in the debugger.

1
MyProjectNamespace.Meeting

The quickest solution is to click the little plus sign or use the keyboard right arrow to show the properties. This is ok to do once or twice but doing this for every comparison is a waste of time at best.

Better then is to use SystemDiagnostics.DebuggerDisplay like so:

1
2
3
[DebuggerDisplay("ID:{ID}, UID:{UID}, Name:{Name}, Type:{this.GetType()}")]
public class Meeting : BaseClass {
...

to get

1
ID:1, UID:234abc, Name:XYZ, Type:MyProjectNamespace.Meeting

The Tip was to use {this.GetType()} in the argument of DebuggerDisplay.