Archive for March, 2011

You can pass html attributes like "maxlength" or width (via "style") from the view to an editor template using EditorFor.

Here’s how you do it:
View full article »

Confirmation dialog with multiple submit buttons

This article shows you how to easily protect against CSRF attacks using MVC.NET’s ValidateAntiForgeryToken and prompt a user with a confirmation popup using jquery UI when submitting a form to multiple controller actions. Code examples are included for jquery.UI version 1.8.9 with the redmond theme and ASP.NET MVC 3 in a form with two secure submit input buttons to get a neat confirmation dialog:

View full article »

Automagically add jquery datepicker using Editor Templates

You can automagically format dates and add a jquery datepicker to the input box for all DateTime (and nullable DateTime) properties for your view. You just need to add a DateTime.ascx partial view to your Views/Shared/EditorTemplates folder and use the standard Html.EditorFor helper for date properties in your views. Here’s the details:

View full article »

How to debug an employment contract

Some newbie contractors will sign any contract put in front of them because they think it “isn’t enforceable anyways”. Maybe they think they aren’t allowed to change contract proposals. Maybe they don’t even bother reading their contract. Maybe they don’t think they have the knack of negotiating contracts and when they think of good contract negotiators, they have visions of lawyers pounding their fists, shouting across the table demanding concessions. These thoughts are wrongheaded on all counts. Just as a lawyer needs to know the law, a contractor needs to know his contract. If the contract is wrong he needs to fix it before he signs it.

This is a basic primer on how to debug a contract and discusses some lessons and gotchas I’ve experienced over the years that I believe can be applied to a broad range of contract negotiation situations. I’m not a lawyer, I don’t even play one on TV, so be aware that this information is not meant to be legal advice. Laws are different for every state and country, particularly when it comes to default contract provisions that can or can not be implied or overridden in a contract. Be smart and do your research and make your own decisions about contract issues that affect your career. In this article you will learn that you don’t need to be a drama queen to be a good contract negotiator and you don’t need to be a wuss and agree to any nonsense a company throws at you.

View full article »

Is 0.55 minutes 55 seconds or 33 seconds? For those of us struggling with reporting fractions of time, the reason we’re not using metric time is because we’re adhering to legacy counting systems that haven’t been updated in 4,000 years. Here’s the executive summary:

* The equinox day and night is divided into 12 + 12 hours is basically because Egyptian scientists figured out how to easily keep track of a count to 12 with one hand, so their math system was base12 instead of base10.

* We use 60 minutes/seconds because Sumerians were weird and liked the number 60…maybe because it’s easy to figure out fractions because 60 is easily divisible by the first six counting numbers and the other basic numbers 10, 12, 15, and 20, but we’ll have to ask Conan The Barbarian to be sure.

* The second was defined in 1967 as 9,192,631,770 energy transitions of the cesium atom because scientists smoked a lot of pot in the sixties (just kidding, I have no idea why they picked the cesium atom or why 9,192,631,770 energy transitions are obviously superior to 9,192,631,769 or 9,192,631,771).

Here’s the whole story:

© 2017 Robert Corvus