Reputation
4,382
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
1 10 27
Newest
 Nice Answer
Impact
~285k people reached

Oct
22
comment Can the csv format be defined by a regex?
@9000 See my answer. I used to think the same and invested a lot of time in trying to prove so but -- in the end -- chose an alternative approach. If CSV was strictly a machine-readable format with a very concise context-free format it would be completely do-able with regex alone. In practice, CSV is used as a human-readable format with a lot of (completely valid and acceptable) quirks.
Oct
22
comment Can the csv format be defined by a regex?
@SpencerRathbun Yep. I'm sure I've taken a look at the node-csv source before. It appears to use a typical character tokenization state machine for processing. The jquery-csv parser works on the same fundamental concept except I use regex for terminal/non-terminal tokenization. Instead of evaluating and concatenating on a char-by-char basis, regex is able to match multiple non-terminal characters at a time and return them as a group (ie string). This minimizes unnecessary concatenation and 'should' increase efficiency.
Oct
22
revised Can the csv format be defined by a regex?
added 29 characters in body
Oct
21
comment REST partial bad request
@Kenneth If you want to prevent having to re-send a lot of data, why not just break upload down into a one-image-per-request pattern. That way you can have the status be updated on the client for every image that's successfully loaded and give the user the option to re-send the ones that didn't make it.
Oct
21
answered Can the csv format be defined by a regex?
Oct
21
comment Can the csv format be defined by a regex?
How about a line containing a trailing empty non-terminal, a line containing an escaped newline char(s), multiple variations of newline chars (ie \r, \n \r\n), etc... There is a common standard for CSV data but it's not possible to parse using regular expressions alone. Even if it was, the implementation would be extremely inefficient.
Oct
21
comment Class Design — Multiple Calls from One Method or One Call from Multiple Methods?
Not an answer but a simple tip. If you're going to create a class that extends one of the generic collection classes add the IEnumerable interface to your class and take some time to implement the required methods. That way you'll be able to iterate over your custom collection in a standard/predictable fashion (ex using foreach).
Oct
21
revised Class Design — Multiple Calls from One Method or One Call from Multiple Methods?
deleted 1222 characters in body
Oct
21
revised Class Design — Multiple Calls from One Method or One Call from Multiple Methods?
added 1222 characters in body
Oct
21
comment Class Design — Multiple Calls from One Method or One Call from Multiple Methods?
@Lucas The names used are purely subjective. The point is, the helper methods will never be exposed publicly -- as in they will never be used outside the class definition -- so the naming scheme only needs to make sense to the developer(s) implementing the class. The simple rule being, don't obsess too much over naming/structure when it comes to code private/helper code.
Sep
11
awarded  Yearling
Aug
8
awarded  Revival
Jul
22
awarded  Nice Answer
May
22
comment Why is it a good idea for “lower” application layers not to be aware of “higher” ones?
Ding Ding Ding!!! I think the word you were looking for is 'decoupling'. That's what good APIs are for. Defining the public interfaces of a module so it can be used universally.
May
22
comment Optimal communication pattern to update subscribers
It sounds like you're thinking in 'math' terms. When you're talking about computer scale think bigger. I mean really really big.
May
22
revised Optimal communication pattern to update subscribers
added 852 characters in body
May
22
answered Optimal communication pattern to update subscribers
May
21
comment Is static universally “evil” for unit testing and if so why does resharper recommend it?
let us continue this discussion in chat
May
21
comment Is static universally “evil” for unit testing and if so why does resharper recommend it?
@RobertHarvey The point is, non-static methods can be written in a way where they're completely isolated and free of side-effects. The benefit of static methods is that they're globally accessible. I'm not saying that's a bad thing but from a testing standpoint, it's a definite weakness that needs to be taken into consideration.
May
21
comment Is static universally “evil” for unit testing and if so why does resharper recommend it?
(Cont) Of course, you could always test static methods before instance methods to fix the issue, but what about static methods that call other static methods. Forcing a constraint that tests must be run in a specific order is a serious code smell in the world of TDD. Theoretically, static methods are terrible for testing but in practice people very rarely ever provide 100% test coverage anyway so YMMV.