Oskar Gewalli's blog articles

0
comment
on 2/21/2014 12:21 PM
Explicit use of computed? What does a computed expression like this: this.isBusy = ko.computed(function() { return self._isBusy() || self._queryIsBusy(); }); have to do with <div data-bind="visible: _isBusy() || _queryIsBusy()" ></div> Internally knockout creates a computed out of an expression in a bindinghandler. Ko does not parse the expression in the html above to register the variables _isBusy or _queryIsBusy. Consequenses What does this mean for your code? If you have something below [...]
>> Read the full article
.
0
comment
on 2/6/2014 9:59 AM
For many projects I’ve been using the pattern: ns.CtorFunction = function(){ var self = this; this.doStuff = function(){ // do stuff and use self in order to get the object variables } } Turns out that this pattern is good for small sites with jQuery (that makes use of this in other ways). For larger code bases where you have lots of code this construction sometimes makes it difficult for the garbage collector. If you have a large single page app, then this might be an issue. What [...]
>> Read the full article
.
0
comment
on 12/9/2013 4:22 AM
There is a perfectly good solution for installing services:<blockquote class="tr_bq"> sc create</blockquote> No need to inherit from the install util specific classes in your .net code. The problem with installutil is that it’s not appropriate when automating install with a local service account. You also get a lot of extra code very tied to installutil.
>> Read the full article
.
0
comment
on 10/27/2013 7:41 AM
Since I liked the ruby version for parsing phone numbers, I ported it to c#. In order to avoid having to rewrite to much I did the following:<ol> To begin with, the entire project was using ruby name convention. This simplifies things. Whenever there is a missing method where the behavior of the method is not the same as the c# one, I added an extension method. For instance I implemented a variant of gsub. The behavior of this gsub uses $1 for matching groups (since it's more natural to remove a bit of cod[...]
>> Read the full article
.
0
comment
on 10/20/2013 2:47 AM
I’ve done some small tests while writing the library to handle readonly objects in c#. Turns out that getting the value of a sub expression can be costly (since you have to compile the expression and execute). When just setting one property there can be a performance benefit of using the following syntax:<blockquote class="tr_bq"> new MyClass(1, "2").With(m => m.MyProperty, 3) </blockquote> There might be some way of optimizing the code in order to get better performance for the form:<blockquote class="tr_[...]
>> Read the full article
.
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper