How To


Permutations Using R

R has limited support for mathematical permutations, but it's there. Here's what R is capable of accomplishing.

Who's in Charge Now? UI Control and the Interface Segregation Principle

If you adopt the Interface Segregation principle, then you can eliminate (or, at least, control) one of the most annoying problems in creating very useful objects. But following that principle through to its conclusion also inverts the traditional hierarchy of the development team.

Default Access Levels in C# and Visual Basic

It pays to be explicit and not use the emotional defaults of each language.

It's OK To Be Lazy And Defer Creating Objects Until You Need Them

You can write some complicated code to ensure that you don't create any object until you absolutely need it. Or you can use the Lazy object...at least some of the time.

Retain State by Serializing to Disk

If you're looking for an easy way to save the user's current state, the simplest solution is use the Serialize and Deserialize method.

Processing Data with ASP.NET MVC, JSX+React and TypeScript

JSX+React provides a flexible way for you to structure your client-side code to two things you want: dynamically transform your page in response to your user's input, and to integrate with ASP.NET MVC action methods.

How To Write a Function That Returns More Than One Value

Like magic, tuples make the impossible possible. Yep, we're talking here about one little corner in the Standard Template Library that will make it simple to return multiple values from a single function, without "out" parameters -- and it has other uses, too.

Stepping Through Binding Styles Using SpecFlow 2

SpecFlow offers a number of binding styles for bridging business-readable tests with test-automation code.

Saving Data on the Client in ASP.NET MVC

Here's another way to make applications more scalable and more responsive to the user: store some application data on the user's computer.

How the R Language Does OOP

It's not quite like C# or Python, but the R language's object-oriented programming capabilities are getting better with each iteration. Let's take a look at what .NET developers are able do now with OOP in R6.

Experiencing Nothingness in C# and Visual Basic

Nothing and null are one and the same, except in the language of programming.

Creating a Flexible, Extendable Update Process

In any real-world business, updating data isn't simple and changing the rows in the table is just the start of a complex set of processes. Fortunately, you can break those updates down into a bunch of simple processes that can be easily extended.

Use Lambda Expressions in LINQ Includes

You couldn't do it in earlier versions of Entity Framework but, in more recent versions, you can use lambda expressions to save yourself from some runtime errors.

Using the not_null Template for Pointers That Must Never Be Null

Null pointer exceptions can get downright annoying, so who needs that?

Implementing Updates Without Query

The CQRS pattern separates updates from queries, allowing you to create the best process for each of those activities. Effectively, CQRS codifies the standard practice for ASP.NET MVC developers: Here are some strategies for implementing that pattern and improving your application's performance.

Conflicts in C# and Visual Basic

Case matters when moving from one language to another and, often, variable naming conflicts can be as simple as that.

Processing All Properties on an Object

If you ever need to work with all of the properties in some object, you can use GetType and GetProperties to retrieve the object's PropertyInfo objects. After that you can do what you want. Here's an extension method that sets all those properties to their defaults, for example.

Initialize Member Variables in the Order You Declare Them

In part 4 of this series on the C++ Core Guidelines, Kate Gregory reminds you of an oddity in C++ when it comes to initializing member variables, and shows you a best practice that will make sure this oddity never hurts you.

Integrating ASP.NET MVC, React and JSX with TypeScript

Creating a form with TypeScript, React and JSX lets you generate the HTML for your form dynamically, at runtime, and on the user's computer. Here's how to integrate a data- driven form into ASP.NET MVC.

How To Programmatically Customize iOS Keyboards with C#

Developers will always look to customize everything, and keyboards aren't out of bounds. Here's how to customize the iOS keyboard that pops up in your mobile apps to address any shortcomings.

Simplifying Data Retrieval with CQRS in ASP.NET MVC

Data retrieval and updates are very different activities so the CQRS pattern says that the smart thing to do is treat them differently. Here's a variety of solutions for the retrieval side in an ASP.NET MVC application.

Generate TypeScript Classes from C# with TypeScriptSyntaxPaste

When working with TypeScript it's not unusual to need a class that matches an already existing server-side class written in C#. Here's one way to get from C# to TypeScript by doing what you normally do.

Build Interactive Tiles for Microsoft Band

Now that you know how to communicate with the Band apps, here's another twist. Let's get interactive.

Choosing the Right Constructors to Write

In part 3 of this series on the C++ Core Guidelines, we explore constructors and why, rather than writing a default constructor, you should use in-class member initializers, a feature added in C++ 11.

Simplify Code with the Visitor Pattern

You can't make a complicated problem simple. But, by leveraging the right tools in your language (and the Visitor pattern) you can ensure that your code doesn't get as complicated as your problem.

Subscribe on YouTube