9,124 reputation
1636
bio website
location
age 33
visits member for 4 years, 5 months
seen 26 mins ago

C:>If you're happy and you know it, syntax error! Syntax error

C:\>If you're happy and you know it, syntax error!
Syntax error

C:\>If you're happy and you know it, then you really ought to show it.  If you're happy and you know it, syntax error!
Syntax error

Mar
26
comment Would there be any benefit to writing synchronous code using the syntax of promises
@stimpy77 I don't quite understand how you derived that conclusion. If you're using bluebird or q, you can simply choose to not update your library if you don't want problems caused by "newer runtimes that no longer support promise-sequencing syntax." That said, this is a bit like saying that you shouldn't use functions in javascript because future ecma versions may no longer have the same syntax. I think you're fairly safe on that front, at least for the immediate future.
Mar
25
comment Objects or primitives as arguments
What I mean was that if the purpose of Point is purely to pass a parameter to a method, I have to question the usefulness of Point. However, you should generally tend to prefer the use of objects like Point over passing two primitives, but only if you intend to make use of Point. This is, afterall, the scope of object-oriented programming in the first place. If your library is going to accept Point just to take the x and y components and put them in some array immediately afterwards, you shouldn't accept Point at all.
Mar
25
comment Objects or primitives as arguments
I think the use of Point is fine, assuming you use Point, and not break it down into its x and y primitives immediately afterwards. That would mean creating an instance only to not use it is somewhat silly. Consider also that Point can always be extended to include useful calculation methods with other points in the future. To achieve the same effect with integer parameters, you'd have to create the instance in the method that requires these calculations.
Mar
23
comment When is it a good idea to force garbage collection?
@usr Frankly, I don't see why you couldn't have both. It makes sense to want to garbage collect prior to performing a heavy calculation that would require a bit of memory, however if such a request were a bad idea to do at the time, only the garbage collector would truly know.
Mar
20
comment When is it a good idea to force garbage collection?
What is the point of allowing a programmer to call a method that is, in all likelihood, a bad idea? That's like implementing a "CauseMeltdown" method in a NuclearPowerPlant API. If it is okay to call, but only in specific moments, then they should have made the call a request, and not a command. I suppose the point is that the sharp edges should be removed. If it is something you shouldn't use all the time it is one thing, but something that should never be run shouldn't be available. Not a critique at you, mind you.
Mar
18
answered How to store integer array in mysql database
Mar
13
answered Can i write html on one line only in my php code?
Mar
12
comment Options for repeated distributed task
Ok, added my answer. Good luck!
Mar
12
answered Options for repeated distributed task
Mar
12
revised What about source code homogeneity?
added 1 character in body
Mar
12
answered What about source code homogeneity?
Mar
12
comment Options for repeated distributed task
These types of things get complicated in a hurry. My advice is to depend on cron or windows task scheduler to perform routine operations. Alternatively, you could try to find a library that specializes in this. I wouldn't attempt to implement a scheduler. It has been done enough times that it doesn't merit the risk you'd take to try it yourself.
Mar
11
comment Options for repeated distributed task
I would try to eliminate the necessity for you to consider when the task occurs and just focus on the how. You could easily schedule a task to trigger once a day that simply tells the server to perform this check. If you have multiple servers, just make sure you only have one task per database. Did that answer your question? I'm still not convinced that I've understood your dilemma.
Mar
11
comment Options for repeated distributed task
That makes things unnecessarily complicated. Have you considered writing a line in a messages table indicating the creation of a new client, and inside the program, once a day it searches for new messages and groups those that share the same message type?
Mar
11
comment Options for repeated distributed task
I'm not sure I understand the necessity to use timed tasks. If you want a message to be present once a new client is created, why wait?
Mar
11
comment Unfamiliar Array line of code in doPost() method
@DigitalDave We're not creating the array, technically. Split is creating the array and returning it, and we're simply taking the returned array and assigning it to variable dobArray. However, if you were to take a look at how split is implemented, you'd see a line similar to type arrayName = new type[length];
Mar
10
revised Unfamiliar Array line of code in doPost() method
added 153 characters in body
Mar
10
comment Unfamiliar Array line of code in doPost() method
@bowmore You're right, good point. Fixing now.
Mar
10
revised Unfamiliar Array line of code in doPost() method
added 23 characters in body
Mar
10
answered Unfamiliar Array line of code in doPost() method