Welcome...
...All those moments will be lost in time, like tears in rain....- soliloquy from Blade Runner
Bits and bytes do get lost, awash in the rain of data flow that is Internet. They slip away from us, never to found again... some of them will be captured here, many more will not... like tears in rain... |
Wednesday, July 30, 2014
Searching for something in dbml
So far, I've found 2 ways to find something in dbml:
1) through designer generated code, usually happens by using ReSharper
2) using properties panel - if you are visual mode, there is a dropdown on the top of the properties panel, which will show you all objects in the dbml diagram.
1) through designer generated code, usually happens by using ReSharper
2) using properties panel - if you are visual mode, there is a dropdown on the top of the properties panel, which will show you all objects in the dbml diagram.
Friday, July 11, 2014
Entity Framework 4.4
Old versions of Entity Framework were really more trouble than they were worth.
Case to the point - if you are using version of EF that does not support foreign keys, you are actually better of not having them defined on the table at all, because then they are treated as any other value in the table.
If they are defined as foreign keys, then you have to go to extra trouble and retrieve them, as they would be recognized as unsupported property and have value of null.
Case to the point - if you are using version of EF that does not support foreign keys, you are actually better of not having them defined on the table at all, because then they are treated as any other value in the table.
If they are defined as foreign keys, then you have to go to extra trouble and retrieve them, as they would be recognized as unsupported property and have value of null.
Friday, January 10, 2014
Javascript - Empty space in numeric field
I run into the issue when isNaN was returning false for empty string.
Turned out this is by design, because isNan is comparing coerced values - coercing empty string into 0, and of course, not having issue with 0 not being a number.
To make sure that user has to enter 0, I added this to the check:
isNan(parseInt(field))
Of course, this is not comprehensive solution, Douglas Crockford has more to say on this topic, especially on recognizing the numbers, but it worked for simple validation I was aiming for.
Turned out this is by design, because isNan is comparing coerced values - coercing empty string into 0, and of course, not having issue with 0 not being a number.
To make sure that user has to enter 0, I added this to the check:
isNan(parseInt(field))
Of course, this is not comprehensive solution, Douglas Crockford has more to say on this topic, especially on recognizing the numbers, but it worked for simple validation I was aiming for.
Friday, November 15, 2013
How to force dropdown to open in javascript / jquery
Force dropdown to open
$("#selSizes").attr("size", "5")
$("#selSizes").attr("size", "5")
Monday, November 4, 2013
Difference between call and apply in JavaScript
Here's the main difference - do you know the number of arguments beforehand?
1) Use
2) Use
1) Use
apply if you don't know the number of arguments you
will be passing, (or if they are already in an array or array-like object).2) Use
call otherwise, since there's no need to wrap the arguments in an array.f.call(thisObject, a, b, c); // Fixed number of arguments f.apply(thisObject, arguments); // Forward arguments var args = []; while (...) { args.push(some_value()); } f.apply(thisObject, args); // Unknown number of arguments
Thursday, October 31, 2013
Knockout and ()
I have to put post-it note somewhere:
PUT ( ) on every binding that's part of the expression!
It's so misleading - if you have regular data binding to the something like this:
<div data-bind="text: customer.name"></div>
that works without parenthesis.
If you have expression, don't forget your ()!
'class': $root.currentColor().name() === $data.name() ? ...
PUT ( ) on every binding that's part of the expression!
It's so misleading - if you have regular data binding to the something like this:
<div data-bind="text: customer.name"></div>
that works without parenthesis.
If you have expression, don't forget your ()!
'class': $root.currentColor().name() === $data.name() ? ...
Subscribe to:
Posts (Atom)