Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
6
Impact
~2k people reached

  • 0 posts edited
  • 1 helpful flag
  • 17 votes cast
Jan
26
comment Should we avoid language features that C++ has but Java doesn't to increase maintainability?
You'd be surprised by how fast the differences will bite you (and hard). SomeObject a = previousObject;does very different things in Java and C++. In Java it copies a reference, while in C++ it copies the object. In Java, modifications to a would also affect the previous object. In C++, you have two separate objects.
Jan
13
comment Designing Pricing table in MYSQL
I'd probably end up with a view like this, too. DB permitting, I'd probably structure the underlying table to only have start dates, and let the view create the end dates automatically. Note, that your end date should be exclusive - that is, the end date of one row and the start of the next one should be the same value: conceptually, a price is in effect until the same instant the new one starts. It also makes certain types of queries far easier (like not having to worry about precision mismatch between timestamp and dates).
Jan
13
comment Designing Pricing table in MYSQL
...At least with dates you can use a simple index probe for the price. With something like this, you need a greatest-n-per-group query... and that assumes that the price in effect is always the "most recent". If they were uploaded early you're in trouble.
Jan
8
comment Why was conversion between Instant and Date named the way it was?
"Is this made so because of an expected deprecation of Date" - I suspect this is, maybe, eventually on the table. In which case you wouldn't want to touch the new API when getting rid of the old one, no.
Dec
15
comment Time elapsed between two 8-bit timestamps
...I'd probably start by getting a 16bit timestamp representing milliseconds.
Dec
3
comment Referencing database values in business logic
In the database, the numerical id is being stored for child records, specifically to avoid that problem. This question is about how to interface to a programming language.
Nov
11
comment Manage lock of a software feature
You're talking about DRM. Every major program with DRM has been cracked to get around it (in some cases, "just because"), and this is with millions of dollars spent by other companies. Barring a feature requiring a resource physically under your control, it'll be circumvented. Among other things, what happens if somebody installs your program and then takes their machine off the network?
Sep
27
comment How to sell an application? Licensing problems
Microsoft and other app store operators can only help you with sales tax (and there appear to be additional wrinkles depending on where you live/are incorporated). This is distinct from income tax, which you may also owe, and they can't help you with.
Jun
21
comment How widespread is the use of arabic numerals in Japanese and Chinese?
The interesting ones at the smaller restaurants (I'm in Japan at the moment) are the prices that look like this: 五00 - (the first character is 5). There isn't really a "0" kanji in this context.
Jun
21
comment Why should I use lookup tables at all?
A few things: 1) For the fastest lookup, you want a compact array, but under real-world use your lookups will use non-sequential ids (especially when dealing with internationalized data). 2) There are situations where this stuff is cached application-side, but there are tools/libraries for it (at least in Java). 3) You want this stuff stored in the db (in one or more flavors), because it enables all sorts of query chewy goodness anyways.
Jun
16
comment Injecting locking policy into a class
...at the point where you'd know what your read/write situation is, you could use specialized collections instead of this locking policy. In the second instance it sounds like you want ConcurrentQueue, or maybe to implement the reader/writer interface in System.Collections.Concurrent
Jun
15
comment Injecting locking policy into a class
Note: Dispose isn't guaranteed to be called by the framework, so things could be locked longer than you think. Naming your release-lock method that is going to confuse people no end (that, and while you can safely call Monitor.Enter(...) multiple times, you need the same number of Exit(...) calls). My question was less about the exact implementation of the policy classes, and why you think you need them, or what the code calling them is actually doing.
Jun
14
comment Injecting locking policy into a class
Define "different situations". What particular problem are you trying to solve? Normally wouldn't a locking token have to be shared to be used between threads (ie, can't dispose it afterwards)? It feels like attempting to do this will make you think you're running stuff safely, but at some point you're going to put NoLockingPolicy instead of SimpleLockPolicy, and then...
Jun
8
comment Why pointer symbol and multiplication sign are same in C/C++?
Many older languages (such as BASIC) used the $ in variable declarations. Too, it's usually only available on US keyboards, although I don't know if this consideration would have been important to the original designers.
May
20
comment Knowing when a SQL table is done updating before Querying
If you don't need much maybe just use SQLite? Otherwise, depending on timing, you could simply not send a response back to the 'client' until the insert is complete (essentially, local 'remote' function hasn't returned yet). I'm assuming 'self-hosted' means on the client box, and not a cloud server instance somewhere else.
Apr
24
comment Alternatives to #if when polymorphism doesn't seem possible
What language/platform are you dealing with here? Potentially, you could move the relevant sections to a new .dll or whatever and include a reference.
Mar
17
comment Should I always return an error code from C functions?
Side note - time ranges, like all positive contiguous-range types, should have an inclusive lower-bound (that is, >=). The upper-bound should still be exclusive, though.
Mar
1
comment Single method with many parameters vs many methods that must be called in order
What set of methods are you working on here? I mean, I think the standard is to pass a transformation object (like Java's Affine Transform for 2D stuff) that you pass to some method that applies it. The contents of the transform are different depending on the order you call the initial operations on it, by design (so it's "you call it in the order you need it", not "in the order I want it").
Feb
13
comment Is using digital signatures and bytecode machines a viable technique to make reverse engineering hard?
This is going to be dog slow, regardless. Your scheme still has a fundamental flaw of almost all other DRM attempts - you have to trust the end user to do the decryption, on a standardized machine. Taking your proposal at face value, I could just give my buddy the entire thing, key and all. Pirates also aren't generally interested in getting the source code, anyways (which is effectively impossible for compiled code), but something that runs - which your system has to provide, to be able to run on real, physical hardware.
Feb
12
comment Boss is ordering me to send spam. How to I deal with this issue/what is my options?
Are you sure this is spam, and not legitimate mass-marketing emails? Consider - if the items advertised are your main business line, and the recipients registered customers, they may be waiting with bated breath for their monthly deals.