Comment by Sergio on Javascript Date() converts 29/Feb/2012 to 1/Mar/2012
it's not a bug, it's a feature
View ArticleComment by Sergio on Cannot Implicitly convert type...
@Corey No Idea. As i see in your code you have if (intCounter == 0) statements. You can use em on upper level to determine wich class you want to pass to method call as T. If you are sure that it's...
View ArticleComment by Sergio on Create and share Google Drive folders dynamically
@Endri it's all Google.Apis.Drive.v2. Install that package for solution (it has bunch of dependencies)
View ArticleComment by Sergio on Ajax.ActionLink and "action" parameter - weird behavior
thx for attention, i've found problem source, see my answer above
View ArticleComment by Sergio on Correct Way to Code a Group of Radio Buttons using...
@JonathanWood Btw, what did you do on SO on Jan 1 at 2:56?? Why don't you celebrate New Year? :)
View ArticleComment by Sergio on Correct Way to Code a Group of Radio Buttons using...
@JonathanWood actually i've noticed that it's just a sample. Hope you can figure out how to generate unique id using model metadata and current enum value? Also, you can customize helper the way you...
View ArticleComment by Sergio on What does this Visual Studio (2013 professional) magnify...
I'm afraid of moving icons when I don't know what they do..... If you are paranoic it doesn't mean that nobody is watching you
View ArticleComment by Sergio on Having 1 thread execute multiple methods at the same time
There's no way that can guarantee all your methods will run at the same time. Even if you do over 9000 threads - OS may execute em one by one. Btw Parallel.ForEach is the simplest way to go here
View ArticleComment by Sergio on Insert ignored route first in the route table
Register them at top. So easy, isn't it?
View ArticleComment by Sergio on How to enable user log in from the only one machine(by...
@Yoda, so your call-center app users will be distributed, or they'll work in a single office/some corporate network?
View ArticleComment by Sergio on ModelSate.IsValid returns true when posting to Web Api...
Question itself and @Doug Dawson answer are full duplicates of stackoverflow.com/questions/17923622/…
View ArticleComment by Sergio on Disable a field form based on another field in rails
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post.
View ArticleComment by Sergio on How to create friendly url in asp.net webform with...
Do you really need single route, or just want to generate routes dynamically at app start?
View ArticleAnswer by Sergio for Action Filter to check Session MVC3
Looks like you're trying to do wrong things there. Check your web.config file - it should have section like:<authentication mode="Forms"><forms loginUrl="http://www.your_domain.com/login"...
View ArticleAnswer by Sergio for Anonymous return in ASP.Net WebService
Error is a Content-Type header. Try to remove it from request in Fiddler and you'll see same exception. Browser doesn't send Content-Type: application/json it and your webserice tries to return XML...
View ArticleAnswer by Sergio for JQuery Copy Selected Select option to input
Try this script:$("select").on("change", function () { //when selected value changed $("input[type=text]").val($(this).val()); //change value in textbox})
View ArticleAnswer by Sergio for Binding MVC4 to An Object Containing Arrays
Change all TimesheetEntry[] arrays to List<TimesheetEntry>Try to add constuctor to your model that initialized all fields of model:public class Timesheet{ public Timesheet() { Monday = new...
View ArticleAnswer by Sergio for Beginner JavaScript: change if, else if, else to switch
Change your switch statement to:switch (currAd) { case "pic1": return document.images[0].src = "cvb2.gif"; case "pic2": return document.images[0].src = "cvb3.gif"; default: return...
View ArticleAnswer by Sergio for ambigious column name in sql server
Good practice is using aliases like:SET NOCOUNT ON;SELECT ROW_NUMBER() OVER ( ORDER BY i.[PaymentID] ASC --which table it belongs? put correct alias )AS RowNumber ,i.[PaymentID] ,i.[Name]...
View ArticleAnswer by Sergio for How to Select UNCOMMITTED rows only in SQL Server?
Why do you need to know that? You use TRANSACTION ISOLATION LEVER READ UNCOMMITTED just to indicate that SELECT statement won't wait till any update/insert/delete transactions are finished on...
View ArticleFind and delete inactive tfs branches
Is there any built-in way to find and delete (tf destroy) branches of TFS project that were inactive (I mean there were no check in operations) for a long time, let's say 1 month. Either tfs tools or...
View ArticleAnswer by Sergio for Find and delete inactive tfs branches
Well, whole thing wasn't hard, posting code here, might help someone:private static string _tfLocation; //location of tf.exeprivate static string _tfProject; //our team projectstatic void Main(string[]...
View ArticleAnswer by Sergio for Visual studio 2010- Application as a service in release...
Basicallly you need 3 projects in your solution:Application itselfWinService for productionConsole Application for test purposesSo your application must have some kind of Start() method with e.g....
View ArticleAnswer by Sergio for Managing connection with non-buffered queries in Dapper
I'd offer this repository pattern:public class Repository{ private readonly string _connectionString; public Repository(string connectionString) { _connectionString = connectionString; } protected T...
View ArticleAnswer by Sergio for Javascript - get value from textbox at every keypress
You should try keyup event, because keypress happens before symbol is being input in a textbox
View ArticleAnswer by Sergio for Configuration Error: ASP.NET MVC3
Have you tried the aspnet_regiis tool to register .Net 4.0 for IIS? You can check more at msdn
View ArticleAnswer by Sergio for query is taking long time to execute around 120 seconds
You might want to try this query instead of doing full joins:select count(*) as col_0_0_ from tab4 tab3inner join tab5 tab1 on tab3.id = tab1.resource_idinner join tab6 tab2 on tab2.id =...
View ArticleAnswer by Sergio for Ajax.ActionLink and "action" parameter - weird behavior
The problem lays deep in .NET framework. There's a class RouteValuesHelpers in System.Web.Mvc assembly, that has following methodpublic static RouteValueDictionary MergeRouteValues(string actionName,...
View ArticleAnswer by Sergio for Deserializing XML that has
Yup, you had an error in your xml, it should look like:<recipe><title>Recipe...
View ArticleAnswer by Sergio for Refreshing Google Maps API V3 Layers
Ok, what i've found, and what is mentioned above is that trafficLayer.setMap(null) and trafficLayer.setMap(map) - just switches tiles with drawn traffic to tiles without traffic. Also...
View ArticleAnswer by Sergio for Why does Traffic Layer always use cache?
As i already answered here, there seem to be no legal way to update traffic layer, even maps.google.com page don't autoupdate it. But i've found dirty hack that makes thing work - updating tile images...
View ArticleAnswer by Sergio for ASP.NET MVC session is null. Session Variables are not...
You need to implement (and m.b. leave empty) 2 methods in your global.asax.cs: void Session_Start(object sender, EventArgs e) { } void Session_End(object sender, EventArgs e) { }
View ArticleAnswer by Sergio for Validate attribute names using regular expressions?
Well, as it was said you can't validate attribute names, but you still can go different way and transform your xml to some kind of:<root><element><data name='data-attr1'...
View ArticleAnswer by Sergio for ASP.net cache access causing Collection Modified...
This happens because you're working directly with object, locating in cache. Good practise, to avoid those exceptions and other wierd behavior (when you accidentally modify cache object) is working...
View ArticleAnswer by Sergio for MVC Model Validation From Database
I'd offer a very simple solution for server-side validation of fields that can only have values existing in database. First of all we'll need a validation attribute:public class ExistAttribute :...
View ArticleAjax.ActionLink and "action" parameter - weird behavior
I've got couple Ajax calls in a project using Ajax.ActionLink helper, looking like:@Ajax.ActionLink("Edit", "MyEditAction", "MyController", new {id = item.Id, action = item.Action}, new AjaxOptions...
View ArticleAnswer by Sergio for Check multiple columns for null in SQL Server 2008
You can use COALESCE(DateCreated, DateModified, GETDATE())
View ArticleHandling enum default value as action parameter
I have enum that looks like:public enum MyUrls{ Url1 = 0, Url2 = 1, Url3 = 2}I'm using it to generate urls for some pages on my website.Base url looks like www.mysite.com/part/, also i got 3...
View ArticleAnswer by Sergio for Convert PHP regular expression to c# RegEx pattern
Well, according to this answer, .NET doesn't support possessive quantifiers.So, you need to replace constructions like [0-9]*+ with something like (?>[0-9]*)
View Article
More Pages to Explore .....