| bio | website | |
|---|---|---|
| location | Europe | |
| age | ||
| visits | member for | 6 months |
| seen | 19 hours ago | |
| stats | profile views | 21 |
A developer by day, a coder by night.
|
May 12 |
answered | What are the downsides of mixing tabs and spaces? |
|
May 7 |
awarded | Notable Question |
|
Apr 17 |
comment |
Readable regular expressions without losing their power? Just now noticed how both [\\d]+ and [0-9]+ should be just \\d+ (well, some may find [0-9]+ more readable). I'm not going to edit the question, but you may want to fix this answer. |
|
Apr 17 |
accepted | Readable regular expressions without losing their power? |
|
Apr 16 |
comment |
Readable regular expressions without losing their power? @SK-logic Well, one being supported natively or by standard library, while other is not, is kind of a reason. But why don't you add an answer showing an example of PEG in action in a mainstream language, it would certainly fit within the question scope. |
|
Apr 16 |
comment |
Readable regular expressions without losing their power? @BenLee Named capture groups is a good catch, not mentioned in any answer yet as far as I can see. If you can turn that into a short answer with example, I can promise one upvote at least :). If you want to work with the regexp in the question, capture group names could be "hour", "min", "sec", "fracs", that's what they actually are meant to be. |
|
Apr 16 |
awarded | Popular Question |
|
Apr 16 |
awarded | Good Question |
|
Apr 15 |
comment |
Readable regular expressions without losing their power? +1 for the simple translator/comment stripper idea |
|
Apr 15 |
awarded | Nice Question |
|
Apr 15 |
comment |
Readable regular expressions without losing their power? By "simpler blocks" mentioned at the start of the answer, do you mean just string concatenation, or something more advanced? |
|
Apr 15 |
asked | Readable regular expressions without losing their power? |
|
Apr 14 |
awarded | Custodian |
|
Apr 14 |
reviewed | No Action Needed Architecture for asp.net app in tiers with linq or any ORM |
|
Apr 8 |
comment |
Non Blocking Sockets vs Blocking sockets - UDP - C&linux @m4n07 Well, for ring buffer implementation, this question has example answers about ring buffer. Other than that, google... But I'd create first version without threads, just isolating the UDP packet handling to a function which takes just one struct as argument (so you can easily move it to another thread once single-threaded code works). |
|
Apr 7 |
comment |
Non Blocking Sockets vs Blocking sockets - UDP - C&linux @m4n07 point of select is, you don't need thread per socket, you can use for example a thread pool. So when your select loop in main thread gets an UDP packet, you put it to a queue and notify worker threads to pick it up. If you have a static number of sockets, you can create thread per socket, each working independently (with blocking read, or a select loop in each thread). |
|
Apr 5 |
comment |
php oop design structure I feel compelled to add one thing to that article: "composition over inheritance". Unless there is a good reason, do not inherit from a class implementing an interface. Instead, just implement the interface, and put the other class as private member, and add delegate methods. When you do use inheritance, prefer having an an abstract base class to inherit from, do not inherit from a concrete implementation class. |
|
Apr 5 |
revised |
Non Blocking Sockets vs Blocking sockets - UDP - C&linux Added a paragraph about using threads |
|
Apr 5 |
comment |
How do I take responsibility for my code when colleague makes unnecessary improvements without notice? @Mikey What's wrong with it is combination of that "if" you say, combined with there being a better way. Just because cutting trees with an axe used to be how it's done, modern chainsaw is still better, and a must if you do it professionally. Using a VCS systems which does not support easy branching and merging, or not using those features in team projects, is a lot like using an axe instead of a chainsaw, in my experience-based opinion (how to use them right is then a broad subject, and they can be used wrong, of course). |
|
Apr 4 |
revised |
Non Blocking Sockets vs Blocking sockets - UDP - C&linux added 220 characters in body |