ASP.NET News from Blogger:
K. Scott Allen
Total News: 540
ECMAScript Harmony is the future of JavaScript, and something you can experiment with using the stable builds of Chrome (my machine is currently running 18.0.1025.152 m, but that is subject to change ...
Soon I'll be giving a group of developers some code and asking them to do some refactoring. The bad news is the code is hard to read. Some might say it's intentionally obfuscated, but let's not assu...
"The Lords of Finance" includes a story about famous economist John Maynard Keynes, who was diagnosed with a chronic cardiac condition and needed medical help*. In 1939, he fell into the hands ...
Here is some code similar to other code I've seen that has a severe bug. The Entity Framework model configuration is setup to allow optimistic concurrency checks via a movie's Version property. publ...
Continuing from the previous post about MapReduce with MongoDB, we can clean up the code a bit using an extension method that takes a single string parameter. var db = server.GetDatabase("mytest")...
It's been my observation that the worst architectural decisions are made when technical people meet by themselves in a room with a whiteboard. I'm not saying the decisions are always bad, or wrong, bu...
One reason some people don't like JavaScript, I think, is because idiomatic JavaScript favors fewer keystrokes and CPU cycles over readability. There is a large amount of script code that is hard to r...
ASP.NET MVC 4 allows you to bundle multiple JavaScript or CSS files into a single "bundled" download, and optionally minify the bundle to reduce the download size. John Peterson has a good introduct...
Most remote LINQ providers can handle simple projections. For example, given a Movie class with lots of properties, and a MovieSummary class with a subset of those Movie properties, you can write a LI...
If you work with relational databases and someone says "data aggregation", you immediately think of a GROUP BY clause and the standard aggregation operators, like COUNT, MIN, and MAX. MapReduce wi...
The Chrome Developer Tools are a bit quirky, but for script debugging I currently like them the best. Here is a quick brain dump on some areas of interest (these are all in the stable build 17.0.963.7...
I've been working with a base class like the following to dig data out of MongoDB with the 10gen driver (install-package mongocsharpdriver). public class MongoDatastore : IDisposable
{
protected...
One of the scenarios that I always demonstrate during an ASP.NET MVC class is how to create a mass assignment vulnerability and then execute an over-posting attack. It is a mass assignment vulnerabili...
I started working with Mongo again recently and needed to fiddle a bit to retrieve existing data using the official 10gen driver. Let's say you have the following persisted in a Mongo collection: {...
A few people have asked me how to keep their cascading style sheets under control. This isn't a question related to LESS and SASS, although both of them can help build maintainable styles, but more of...
It's always been difficult to have nicely formatted source code in a PowerPoint slide, but with HTML it's fairly easy to paste code into a pre block. <pre>
<code>
var start = function...
Popcorn.js is a JavaScript library for working with HTML 5 video and audio in a web page. It's part of Mozilla's Popcorn project, and it already has a bonanza of plugins available. Part of Popcorn's...
When I started thinking about adding animations to the slide presenter I pictured a few different types of animations simple animations to make items appear one by one, but also animations to pan, zo...
When starting into the animations I decided it was time to refactor. One problem was the little "updateState" calls floating around inside conditional logic always a bad sign. A second problem was ...
Once upon a time there was a pure JavaScript model. The model sang songs about simplicity in a land full of complexity and confusion. The model's clear and beautiful voice comforted many hearts in the...
I tried to think of everything a web developer should know about HTTP, then recorded those things into a Pluralsight course: HTTP Fundamentals. In the course you'll look at HTTP messages, message hea...
It's happened to everyone. You thought you typed "Use Ruby To Capture Screen Shot" into a slide, but somehow you hit the i key instead of the o key and didn't notice. Now the slide is presenting its...
Occasionally it's useful to print a slide deck onto paper, or export a slide deck to PDF using a print driver. Unfortunately, printing the slide show in it's current form will only display the single,...
What happens if someone using an old web browser wants to view our slides? We can add the following div outside of the section elements containing the slide content. <div id="warning">
Y...
Company A I've worked with company A on a number of interesting commercial products over the years. After months of trying to find more good engineers in the local area, they recently decided to star...
The current presenter will show one slide at a time, but the slides keep moving down the page since all the <section> elements are in the normal flow of the browser. The slides also appear and d...
The slide show project currently only shows one slide. I know a number of people who can talk for 75 minutes using one slide, but fortunately they've all retired from university life and taken their o...
In this series of posts we'll iterate on an HTML slide show. When I say "HTML", I mean we'll use all the buzzwords technologies that I kept out of the title of this post to avoid attracting attentio...
Microsoft unveiled Windows 8 at the //build/ conference in September. Since then I've spent time seeing how to put together Windows 8 metro applications with HTML and JavaScript. The Sublime The fo...
The HTML 5 DOM interface for a video element allows you to get the underlying video's width and height in pixels, but, be careful not to ask for the dimensions too early. If you ask as soon as the DOM...
The canonical example for fluent configuration with the Entity Framework is to take a few simple entity definitions: public class Product
{
public int Id { get; set; }
public string Name { ge...
In the last post we looked at feature detection with Modernizr. Before moving forward, let me answer a few questions that came up. First, you can build a custom Modernizr download containing only th...
From Wikipedia: The tragedy of the commons is a dilemma arising from the situation in which multiple individuals, acting independently and rationally consulting their own self-interest, will ...
As we saw in a previous post, Modernizr allows you to work with the new HTML 5 elements, like nav, and still support browsers that don't know anything about a nav, or HTML 5. However, HTML 5 is more...
Modernizr.js is a little library that will help "modernize" old browsers. As an example, let's say you create a new ASP.NET MVC 3 application with the "Use HTML 5 semantic markup" checkbox selec...
When I was making the switch from C and assembly to C++ I did quite a bit of reading on object oriented programming. It's hard to find material on OOP that doesn't praise the classical pillars of enca...
Imagine (or dream) that you have some IronRuby code to execute. require 'net/telnet'
host = Net::Telnet.new(:Host => 'localhost')
#...
#...
#...
return data
One way to execute the code and c...
The second part of my C# fundamentals course is available for subscribers on Pluralsight.com. Part 2 introduces you to the variety of programming styles supported by the C# language. At its core,...
Someone asked about the circular div I used for magnification in an earlier post. There are no primitives in CSS for building arbitrary shapes, but like most things on the web, that doesn't stop anyon...
Magno is a something I put together because well, just because. The idea is to provide a magnifying lens effect using a background image and background position animation. The lens tracks the positio...
2 column layouts are rather popular on the web, and there are 1,001 ways to make them work. The approach you choose really depends on the type of content you have, and how you want images and backgrou...
mouseleave is simple to understand: Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. How hard could it be? http://jsfiddle.net/JP6aV/ $...
Liam told me about Underscore.js some time ago. From the home page: Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would exp...
From the Clojure home page: Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system. Clojure is predominantly a functional programming language, ...
Victor Brumble is writing code again, and this time he's writing a jQuery plugin. His plugin makes alert boxes easy, because Victor loves pointless, model dialogs. (function ($) {
var settings ...
It's easy to make a DOM element draggable and droppable with jQuery, but it's not as obvious how to make it stop. It turns out every widget includes a set of standard methods, and one of the standard ...
Using Alt+Ins in the Solution Explorer window is one of those ReSharper shortcuts that probably saves me hours over the course of a year (Alt+Ins is the "Create File From Template" command). There i...
Several people have asked me about using data annotations for validation outside of a UI framework, like ASP.NET MVC or Silverlight. The System.ComponentModel.DataAnnotations assembly contains everyth...
This post is a play on Phil's "A Better Razor Foreach Loop". If you aren't familiar with templated delegates in Razor, you can follow the links in Phil's post. Something I don't like to see in a v...
workplace [n] - a place where work is done Over the years I've worked with developers in cubicle farms and private offices, in open spaces and cloistered bureaus. And once there was a basement room a...
View Other bloggers