ReBuildAll Blog
Thoughts (mostly) on .NET development

Comments

Murali Re: jQuery validate and the comma decimal separator
Instead of changing it you could follow this.

The problem is deal with globalization. So i recommend you to follow Hansleman post http://www.hanselman.com/blog/GlobalizationInternationalizationAndLocalizationInASPNETMVC3JavaScriptAndJQueryPart1.aspx
Robert Re: WCF service namespaces (getting rid of tempuri.org)
Worked like a Charm, thank you!.
Hocine Re: jQuery validate and the comma decimal separator
the method to fix the problem with MVC4 :

In the jquery.validate.js, find range: function et number: function and replace like that :
range: function (value, element, param) {
var globalizedValue = value.replace(",", ".");
return this.optional(element) || (globalizedValue >= param[0] && globalizedValue <= param[1]);
//return this.optional(element) || ( value >= param[0] && value <= param[1] );
}

number: function (value, element) {

// return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);
return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:[\s\.,]\d{3})+)(?:[\.,]\d+)?$/.test(value);
}
Brian Re: Merging WSDL and XSD files
I'm guessing this doesn't support web services exposed via NET.TCP bindings?
wirol Re: ASP.NET MVC and virtual views
This is a very nice approach to use dynamic virtual views.
But how could we use the dataannotaion/validation attributes in this scenarios?

Or how should we design the model validation for virtual views?

Thanks.
Michael Moser1 Re: Merging WSDL and XSD files
Hi - I found your page using Google search.

I may be missing the obvious, but where can I download this tool?

The referenced download section is empty.

I found the source area, but do I really first have to install Mercurial, download the source, obtain VisualStudio and install it, compile the whole thing, etc.? No easier way to try out the tool?

Cheers,
M.
KolDand Re: jQuery validate and the comma decimal separator
It worked like a charm, thanks man!
Stefan Re: jQuery validate and the comma decimal separator
Lenard,

This is awsome, I came upon so many different and complicated proposed solutions and I spent two hours before I found your great article. You saved me!
If you ever come to Serbia, I promise you a free beer or rakija(great national drink)!!!

Thanks,
Stefan
Hi,

Glad to read this post, I have the exact same thoughts. I didn't write lot of code those last three years, but dug into the last frameworks to keep up-to-date, and for some small projects.

My thought is that each time I try to use modern frameworks, I just pull my last hair off because those try to make things easy, but for a small detail I loose even more time to try to find an inelegant workaround.

This applies to MEF which doesn't let me choose which plugins I want to instanciate, and how many times each, or Linq to SQL which doesn't let me map by code the table names, I forgot the others.

I don't want to create XML mapping files to handle with after deploying an application, I want to pass a string argument in the constructor of my object, which it will be using then to prefix the table names, that's not so complicated !!!

I read in your last comment that there is a good way to prefix easily in EF, could you post a link to an article or other documentation about that to help me get started ?

Thanks a lot !
r.w. Re: Overriding virtual methods at runtime
never mind, i got it...
r.w. Re: Overriding virtual methods at runtime
Hello LennardG,
I do have problems with replacing the GetWebRequest.
Is there some additional trick to override the method if it is generated via ServiceDescriptionImporter ?

Btw: great article :-)
Re: Serve MVC Views from a ZIP file
This is a great article and I have used it in my applicaiton.
I have a slight issue though, maybe you can help me with it.

I have used your example to pull the views from the database. They are pulled in fine, but they have no layout associated with them. I have tried specifying a layout but it get an error "The view 'Guidelines' or its master was not found or no view engine supports the searched locations. The following locations were searched:".

How can I get it to just continue using the current layout?
Marcos Lima (marcoslimagon) Re: ASP.NET MVC and virtual views
I will try to implement this post using MVC 3 + RAZOR + caching and also trying run the controller by some kind of F# "Engine", to make a easy to go approach... this post gave me useful crazy ideas =)

Thanks!
Everton Re: jQuery validate and the comma decimal separator
Very nice,
this saved my time!
Thanks.
turkmame Re: jQuery validate and the comma decimal separator
thanks LenardG,this saved my time
Thanks for the link, I will check it out, although my Linq to SQL usage has dropped to zero in favour of EF.

I actually had been using Entity Framework a lot lately. When using code first Entity Framework, you can create table prefixes easily, just by overriding the entity names when the model is being created (OnModelCreating() method of the DbContext.

I am not sure how to achieve the same when you use the designers though.
Lenard Gunda Re: jQuery validate and the comma decimal separator
It is indeed possible, although I would advise to create a brand new validator class that you can use. I might do a blog post on that actually in the coming days.
runner Re: jQuery validate and the comma decimal separator
is it possible that I can have the currency symbol in a decimal field without the client side validation saying this is not a number

your help is much appreciated
It had been a long while since the post so I am not sure if you are still looking for a solution to dynamic table name problem with LINQ.

Any way, I have just found a solution recently and like to share it with you. Check it out "http://www.codeproject.com/Articles/333249/Dynamic-Table-Mapping-for-Linq-to-SQL"
Weimin Xiao Re: Running .NET threads on selected processor cores
The code works. I used it to make a parallel loop implementation, and saw CPUs can be clear targeted using the DistributedThread class.

The only thing to pay a bit attention is that ProcessorAffinity assignment for CPU 0, 1, 2, 3, ..., N is 1, 2, 4, 8, ... 2^N.
daniel Re: Variations on Http Handlers
"Code in another assembly" section was really helpful for my projects.
Thanks for sharing !
Øyvind Re: jQuery validate and the comma decimal separator
Worked like a charm. Needed the same for the min function, but it was easy to fix given your example.

Thanks a lot.
Lenard Gunda Re: jQuery validate and the comma decimal separator
Alex, are you sure you have included jquery.validate.js (or the .min version) and jquery.validate.unobtrusive.js (or the .min version)? Before you use the code I showed in the article?

In the newer ASP.NET MVC project templates, these files are not included in the _Layouts.cshtml (for Razor) file. Instead, they are referenced from individual .cshtml files when you generate an editor template (or something that required validation)?

If you use the default generated way, you need to add the code in my article AFTER those includes.
Lenard Gunda Re: Running .NET threads on selected processor cores
Jannik, automatic properties have been around since C# 3.0 (.NET 3.0). I did not really point out which version of the code was written for. If you are using an earlier version of the .NET Framework (1.1 or 2.0), you will need to define a backing field for the property as follows:

private int _processorAffinity;

public int ProcessorAffinity
{
   get { return this._processorAffinity; }
   set { this._processorAffinity = value; }
}

Alex Re: jQuery validate and the comma decimal separator
This does not work for me :-(

Get a browser error:
Uncaught TypeError: Cannot read property 'methods' of undefined

Any idea?