2,632 reputation
1022
bio website
location
age
visits member for 3 years, 6 months
seen 21 hours ago

1d
comment Should all HTTP requests including credentials be made using a POST even if it is actually just a request for data?
I would usually refer to "HTTPs only" cookies as "secure" cookies (to avoid implying contrasting with HttpOnly cookies). Also, I would recommend using a secure, HttpOnly cookie. HttpOnly cookies are not accessible via javascript.
Jul
21
answered How should I include jQuery in a library?
Jul
21
comment How should I include jQuery in a library?
Part of being a good citizen is being careful about licensing. Sure, the author of a FOSS project probably won't be attacked legally, but those who wish to use such code legally will have a much easier time of it if the author handles licensing properly.
Jul
18
comment Does CC0 allow sublicensing of derived works?
MIT License: Why isn't it considered viral? discusses the viralness of the MIT license. Also pay attention to the comments.
Jul
18
comment Print the next smallest from 2^i * 5^j where i,j >= 0
@Snowbody: The op's question is an algorithms question, so it's somewhat irrelevant. Ignoring that, your first concern should be dealing with very large integers, as this becomes a problem far sooner than garbage collector overhead.
Jul
18
comment Print the next smallest from 2^i * 5^j where i,j >= 0
+1 While this is roughly equivalent to my second snippet, your use of immutable edges makes it clearer how the edge count grows.
Jul
17
revised Print the next smallest from 2^i * 5^j where i,j >= 0
deleted 84 characters in body
Jul
17
awarded  Nice Answer
Jul
17
revised Print the next smallest from 2^i * 5^j where i,j >= 0
deleted 30 characters in body
Jul
17
revised Print the next smallest from 2^i * 5^j where i,j >= 0
added 675 characters in body
Jul
17
revised Print the next smallest from 2^i * 5^j where i,j >= 0
added 675 characters in body
Jul
17
answered Print the next smallest from 2^i * 5^j where i,j >= 0
Jul
15
answered Cannot explain to the customer that he is taking the project wrong way
Jul
3
comment Is it a good idea to return a default value if a field in a query cannot be found?
In the context of data readers, it is especially dangerous to return default values for value-types (e.g., default(int)). Whereas default values for reference types will tend to eventually throw NullReferenceException, default values on value types will often not trigger visibly broken behavior quite so immediately. E.g., int NewId = getProductId(arg);setProductLabel(NewId,NewLabel); might very well silently corrupt (or discard) your data without any sort of warning or error. Database constraints can mitigate this issue, but cannot eliminate it entirely.
Jun
20
comment How should I unit test a bitmap modifying method?
@EugenePodskal: Well, if the images tend to fail binary equality tests due to complex, mostly imperceptible (to humans) differences, a diff that tests for near-equality might work. E.g., PerceptualDiff. If your application supports dependency injection, injecting a randomization service with hard-coded values or seeds should allow your system to maintain binary equality (well, unless randomness is also introduced by parallelization artifacts and the like).
Jun
18
comment Why was C# made with “new” and “virtual+override” keywords unlike Java?
See also this answer to Why all java methods are implicitly overridable.
Jun
18
comment Why was C# made with “new” and “virtual+override” keywords unlike Java?
Eric Lippert discusses this in detail in his post, Virtual Methods and Brittle Base Classes.
Jun
12
comment Is method overriding always a violation of Liskov Substitution Principle?
Non-private members (function signatures, properties, fields) are also part of the contract. Generally, statically typed languages enforce this during compilation.
Jun
4
comment Is ASP.NET MVC too much overhead for smaller projects?
@gnat: Meh, I think that's a bit unfair. While the wording of the title makes it sound like an opinion-based question, I think the core question is answerable without this being a problem. Specifically, whether or not, for small projects, MVC has more overhead than WebForms. There is a little bit of subjectiveness in this question, but it strikes me as Good Subjective. The good thing about this question is that the OP provided a narrow enough X vs Y question for it to actually be answerable.
Jun
2
comment Is this simple XOR encrypted communication absolutely secure?
Or you know some of the plain text because you know what protocol the user is using. There's plenty of room for evil when editting the standard, predictable headers of an http response.