background preloader

Tech reference

Facebook Twitter

A Complete Guide to Flexbox. Developers who use spaces make more money than those who use tabs - Stack Overflow Blog. Credit Card Number Generator & Validator. .net - C# Equivalent of SQL Server DataTypes.

Shiny stuff

C# & MVC. .NET. SQL. Catalog. You have constructors on subclasses with mostly identical bodies. Create a superclass constructor; call this from the subclass methods. more… Two subclasses have the same field. Move the field to the superclass. more… You have methods with identical results on subclasses. Move them to the superclass. more… A field is used only by some subclasses. Move the field to those subclasses. more… Behavior on a superclass is relevant only for some of its subclasses. Move it to those subclasses. more… You have conditional code that is unnecessarily verbose and does not use the most readable Ruby construct. Replace the conditional code with the more idiomatic Ruby construct. more… Remove Assignments to Parameters The code assigns to a parameter. Use a temporary variable instead. more… You have a variable that is acting as a control flag for a series of boolean expressions. Use a break or return instead. more… A class is doing too much simple delegation.

Get the client to call the delegate directly. more… more… Remove it. more… CodeBetter.Com - Stuff you need to Code Better! Learn Lua in 15 Minutes. Right-Click, Create Unit Tests - MSDN Malaysia. For those who are disappointed with the removal of the "Create Unit Tests... " context menu in Visual Studio 2012, here are few methods for you to re-enable the feature: Method 1 - Command Window If you find hard enough, you will discover that the command to invoke the Create Unit Tests... is actually: EditorContextMenus.CodeWindow.CreateUnitTests You can actually type that in the Command Window to invoke the Create Unit Test Wizard. If you find it too verbose, you can actually create an alias for it. alias ut EditorContextMenus.CodeWindow.CreateUnitTests Then just type ut to launch the wizard. Method 2 - Keyboard Shortcut The next method is to go to Tools->Options->Environment->Keyboard and set a shortcut key of your preference.

Method 3 - Re-enable the Create Unit Tests... Context Menu. This is by far the best method ever. To re-enable the Create Unit Tests... menu, go to Tools->Customize... to launch the Customize dialog. Java - REST vs RESTful vs "normal" web service - the same or not? Herding Code 189: Gary Bernhardt on The Birth and Death of JavaScript. Visual c++ - Difference between Windows and Console application. Game of life: Code solution in C# Download Game Of Life - 25.1 KB Introduction Let us start with an introduction to the GAME OF LIFE problem. As per wiki “The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.”

The "game" is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, live or dead. Any live cell with fewer than two live neighbours dies, as if by loneliness. The initial pattern constitutes the 'seed' of the system. Problem The inputs below represent the cells in the universe as X or - . Block pattern Boat pattern Blinker pattern Toad pattern It is important to note that in Output D, the two new rows have been due to Rule #4 i.e. Background The other catch is the need of implementation in Object oriented fashion which is a bit tricky.

History.