July 2011
21 posts
7 tags
5 tags
Supercharged JavaScript Graphics 2-4 with simple... →
Taking example 2-4 a bit further to achieve consistent FPS with a timer.
;
(function($) {
$.fn.bouncyPlugin = function(option) {
option = $.extend({}, $.fn.bouncyPlugin.defaults, option);
var DHTMLSprite = function(params) {
var width = params.width,
height = params.height,
imagesWidth = params.imageWidth,
$element =...
Supercharged JavaScript Graphics Example 2-4 →
Example 2-4 takes example 2-3 and wraps it into a nice jQuery plugin.
;
(function($) {
$.fn.bouncyPlugin = function(option) {
option = $.extend({}, $.fn.bouncyPlugin.defaults, option);
var DHTMLSprite = function(params) {
var width = params.width,
height = params.height,
imagesWidth = params.imageWidth,
$element =...
4 tags
Supercharged JavaScript Graphics 2-3 (jsfiddle) →
Now with some added fancy animations!
var DHTMLSprite = function(params) {
var width = params.width,
height = params.height,
imagesWidth = params.imageWidth,
$element = params.$drawTarget.append("<div/>").find(":last"),
elemStyle = $element[0].style,
mathFloor = Math.floor;
$element.css({
position: "absolute",
width: width,
...
5 tags
Supercharged JavaScript Graphics 2-2 (jsfiddle) →
Example of Chapter 2-2 done on jsfiddle.
1 tag
4 tags
4 tags
Step by Step on how to Upgrade MVC2 to MVC3 with...
1) The first thing you will want to do is download the ASP.NET MVC3 Application Upgrader tool on codeplex.
http://aspnet.codeplex.com/releases/view/59008
This tool will take the pain out of updating references and upgrading the web.config, the tool also does the following:
Create a backup of your entire solution
Update all Web Applications and Test projects to reference System.Web.Mvc...
2 tags
5 tags
4 tags
4 tags
EF Code First and Lazy Loading
After I got my simple model and context setup I wanted to look into doing some Lazy Loading.
Example
public class Inbox
{
[Key]
public int Id { get; set; }
public string Name { get; set; }
public ICollection<Message> Messages { get; set; }
}
public class Message
{
[Key]
public long Id { get; set; }
public string Subject { get; set; }
public string CreatedBy { get; set; }
public Inbox Inbox...
Getting ELMAH to work with MVC quickly →
If you use ELMAH with MVC you might notice that the errors are not being captured correctly if you have the HandleErrorAttribute setup on your controller or as a global filter. This answer on stackoverflow offered a very quick way to handle this problem.
public class ElmahHandledErrorLoggerFilter : IExceptionFilter
{
public void OnException (ExceptionContext context)
{
// Log...
3 tags
7 tags
Method Tracing with Unity Interception
Everyone loves tracing and logging when developing an application, however in no time your code begins to look like a hot mess and you cant figure out where the tracing stops and the business logic begins.
public DidSomeLogicResult DoLogic(DoLogicCommand command)
{
Debug.Write("DoLogic Start");
Debug.Write(string.Format("DoLogicCommand: {0}", command.Number));
int magicNumber =...
5 tags
How To: Cisco VPN with Snow Leopard via .pcf File →
Worked, perfectly!