« first day (312 days earlier)      last day (3707 days later) » 

4:00 PM
Monkey acronyms!
 
Time to quit work, ovbiously
 
TTEL
 
My feet hurts... :( I'm developing an app for uni where I need to make a working GPS/location implementation.
 
Uhm... use your car?
 
I don't have a car nor a driver's license, so nope :p
 
4:05 PM
bike?
@BenVlodgi Welcome to 500!
 
Well, I'm not allowed to bike through the university halls, unfortunately.
 
@skiwi roller blades!!
(if they can't catch you, you should be fine)
 
Blades make my feet hurt worse than walking ;-)
 
It's some weird muscle I strained when playing darts in the weekend
 
Anyone wants to chip in?
@Mat'sMug: I get your point. I've added a sentence to make clear that performance, too, is an important aspect in this problem. Yet I don't quite see how the provision of three basic options would make a review of the problem impossible? — simon 4 mins ago
(I'm busy right now)
 
4:19 PM
@Mat'sMug hah.. you knew before I did! thanks :)
 
This meta-answer from @amon has the quote I'm looking for, but I'm not sure pointing the OP to that post would be helpful, given the meta-post's title:
8
A: What to do when working, non-example code is too much code?

amonI put a close-vote on your question, because it's not a good fit here. You are asking a whiteboard-style programming question about how you should design your classes. That's something that probably belongs on Programmers (but read through their help center first). A good indication that you're...

> A good indication that you're not actually seeking a code review is that you phrased your question in a “Solution A versus Solution B – which is better” format. This is generally bad on Stack Exchange because such questions have a tendency to be more opinion-based than objective.
 
Got a comment about to fire... ;-)
 
:o youtube down for anyone else aswell?
 
I just put a bounty on another [good, on-topic] question from that same user that's been zombified.
5
Q: Finding the next higher digital permutation of a number

simonThis is my solution for CodeEval challenge 44. The function followingInteger takes a number in its decimal representation and returns the next higher permutation of the digits of the number. If there isn't a larger permutation of the digits, a '0' may be added to the digits: ghci> followingInte...

 
4:32 PM
0
Q: Any tips for making this C++ vector class faster?

user3058865I've been working on a 3D-vector class which should be as streamlined as possible for use in numerical simulations. It will be used to model 3D-physical vectors. I hoped to design it in a modern and fast way - but one is never perfect. So, I would be interested in some input from your side. Thank...

 
@syb0rg you shall eventually skip a day or two... codereview.stackexchange.com/users?tab=Voters&filter=year
(actually, a whole freakin' week, you're ahead by 150+ votes!)
 
Never!
 
mwahahaha
 
0
Q: Python - Streamlined for-loop for comparing two lists

TaraI'm new to Python and I'm wondering is there a way to streamline this clunky code I've written. Maybe a built-in function I've never come across before? I run through two lists of binary numbers and if the same number appears at the same index in list one and two, do x. So in the example below ...

 
4:48 PM
Perhaps this answer could be improved? It looks borderline and I'm tempted to convert it to a comment.
0
A: Review of PHP prepared statements from security viewpoint

Sebastian RedlWhy do you separate questions and answers into two separate arrays? It seems to me that working with one array of question-answer pairs is much easier. But we'd have to see the code where you use those arrays to be sure.

 
0
Q: Create Excel Document Very Slow

VolearixAttached is a generic code I wrote to create an excel file with x amount of worksheets. The problem I am having is that it's pretty slow, like 5 seconds a sheet. It was my understanding that using a for loop when creating the tables was ideal, but the issue seems to be with tables containing over...

 
@Jamal - that answer came up flagged as NAA... I think it is an answer, but a really crappy one.... it covers the minimal bases.
 
@Jamal It's asking for more code to be revealed, usually a question seen in a comment and not an answer.
 
@syb0rg it is also making the valid point that questions and answers could/should be linked.
 
@rolfl Also true. Stupid grey area answers.
 
4:52 PM
Perhaps the last sentence can be edited out, and the answerer can be told to mention that in a comment.
 
0
Q: Should a Factory ever be generated per request? Or only

Sean AndersonI'm working with AutoFac to do some DI. I think I've got a decent grip on things, but just ran into a question I had with my code and thought I'd check: public class AutofacRegistrations { public static void RegisterAndSetResolver() { // Create the container builder. var ...

 
@syb0rg: I'm not quite sure why he rolled back your title edit. His doesn't quite fit the explanation.
4
Q: check webpage repeatedly over and over

pmgI have a program that gets 5 random dice throws from random.org over and over. In order to avoid doing getaddrinfo() over and over with the exact same data, I moved some of the code to an initialization function (and an unused finalization function). My issues are: is this a bad idea? can bad ...

(and he seems to prefer rolling back instead of making needed revisions)
 
@Jamal I'm not quite sure either. I just left it be so I wouldn't raise the edit count.
Yeah, I've noticed that with him too.
Side-note: I need to implement more xkcd into my answers. Just because.
3
 
ahh the wonderful smell you smell after you get done putting out fires
@syb0rg LOL
 
625 unanswered! Let's try to get it below 620 today! I do wonder how close we are to 96%.
 
5:05 PM
can't believe i hadn't starred that message
 
@Malachi I was just looking at that too.
 
lol
how do I quote in chat?
I've occasionally seen "radar enforced" on speed limit signs, and I can't help but ask: How intense would radio waves have to be to stop a car from going over the speed limit, and what would happen if this were attempted?
—joausc
 
@Malachi 7 edits to that one message. :P
Hello @SimonAndréForsberg
 
how do I quote?
 
Like this?
 
5:09 PM
> Like this?
 
@Jamal yes like that, how?
 
Put a "> " (without quotes) before the text.
 
I did that
 
There should also be a space after the ">"
 
hold on I copied a chat message that time....lol
> I've occasionally seen "radar enforced" on speed limit signs, and I can't help but ask: How intense would radio waves have to be to stop a car from going over the speed limit, and what would happen if this were attempted?
—joausc
ok BTW now...
 
5:12 PM
@Malachi I've written an OO version of your RPSLS, which post would you rather I made it a response to
@Malachi I just assume the first one, because that was specifically about the program as a whole and not just about how clean it was
 
discussion:
0
Q: DI Container Tags

Mat's MugA tag was recently created for autofac, which is an IoC container. The question that created this tag is also correctly tagged with dependency-injection. A long, long time ago I wanted to create a tag for ninject (another IoC container) but I didn't have enough rep back then, and dependency-inje...

@BenVlodgi post it as a question!! tag it with :)
(or you don't want it reviewed / shredded to tiny little pieces?)
 
@BenVlodgi either way it would be awesome.
 
I'm with the monkey
Can you please repeat all that in English? — rolfl 52 secs ago
 
@Mat'sMug I think he might be scared.... (JK)
 
@Mat'sMug takes me so serious.
 
5:23 PM
In software engineering, inversion of control (IoC) is a programming technique in which a dependent object is coupled to the object it needs at run time. Which particular object will satisfy the dependency during program execution typically cannot be known at compile time using static analysis. While described in terms of object interaction here, the principle can apply to other programming methodologies besides object-oriented programming. In traditional programming, the flow of the business logic is determined by objects that are statically bound to one another. With inversion of contro...
 
@Mat'sMug I guess it could be reviewed... but it is my review of other code o_O
reviewception
2
 
@BenVlodgi post it both places(4 places?) Question and Answer
 
3
Q: DI Container Tags

Mat's MugA tag was recently created for autofac, which is an IoC container. The question that created this tag is also correctly tagged with dependency-injection. A long, long time ago I wanted to create a tag for ninject (another IoC container) but I didn't have enough rep back then, and dependency-inje...

 
@Malachi hah, I think I'll post if for review , then as an answer :P
 
that is kind of cheating, I think you should post them simultaneously and let the votes fall where they may
 
5:27 PM
@Malachi will do then
 
I think it should be posted first as an answer, and then as a question, linking to the answer.
 
I say that with a smirk,
@Mat'sMug TS
 
posting a question to get a review of the code you've written for an answer, is perfectly fine
 
or SSTS
 
@SimonAndréForsberg - it seems like DependencyInjection is a snobbish way of saying 'pluggable'.
Like, the Comparator on new TreeSet(Comparator) is a form of manual Dependency Injection.
 
5:29 PM
SOOSSTS = "Star Out Of Stars Shit Theoretical Star"
 
damn that's hard to phrase
 
anyway BTW Again
 
@rolfl I know what DI is, I just thought that the Mug's question was a bit hard to follow.
13 more reputation until I'm hitting 8K
 
@SimonAndréForsberg if DI is done properly, the IoC container has no importance, no one can even tell you're using an IoC container - applies. However the IoC configuration code is extremely container-specific. That was my point... should I edit?
 
0
Q: Creating a pure ruby object (PORO) to email files in a Rails Application

MohamadI wrote a service object that emails a list of files to a list of email addresses. I am unsure about my emails method. It splits a string into an array of emails. It then loops over the array and rejects any elements that do not match the email regex. The return value is an array of valid emails...

 
5:34 PM
PORO's now? Does every single language out there have its little accronym for these classes?
POVB6O doesn't look right.
 
Off-topic:
0
Q: How does this bat. file reboot a remote server?

James JenkinsI have a bat. file that has been passed down a few times. If I run it on my PC it will reboot the remote server 'server04'. It is known to work on windows 2003 servers. Complete code is below double click to run, left click and edit to reboot a different server on the next run. shutdown -r -...

 
0
Q: How does this bat. file reboot a remote server?

James JenkinsI have a bat. file that has been passed down a few times. If I run it on my PC it will reboot the remote server 'server04'. It is known to work on windows 2003 servers. Complete code is below double click to run, left click and edit to reboot a different server on the next run. shutdown -r -...

 
Apparently my voting has been retarded recently
 
@rolfl Why is that?
 
Retarded means slow / delayed...
There was a bunch of Java stuff I missed....
 
5:46 PM
@Malachi Nice comment pointing him here.
 
(welcome to 8K .... )
 
you need some Glitch Hop @rolfl
 
@rolfl Oh, I thought you meant stupid...
 
@rolfl who?
 
@SimonAndréForsberg - 8K022
 
5:47 PM
It's almost too easy to get rep here sometimes :)
Let's give it another try:
Only 81 more rep until rep-max
2
 
I need like 195 more rep for today...lol
 
150 more!
 
200. :-)
 
@All, it's much easier for me ... only 25
 
5:51 PM
I personally think that my recent android answer is better than my recent custom indexOf() answer, but I suppose the indexOf question has gotten a whole lot more attention.
 
@SimonAndréForsberg yeah I didn't read all that code
 
Note sure if you all have seen this or not.
 
@Malachi My OO re-design of RPSLS codereview.stackexchange.com/a/44175/38054
 
Rep-maxed!
Can't believe that worked!
 
5:59 PM
@SimonAndréForsberg - you are going to have to write some answers before you get any more upvotes from me ... ;-)
(and you should be safe from the surt)
 
@rolfl Wow, you have upvoted each and every of my answers? I am flattered!
 
3 hours ago, by Simon André Forsberg
> Wow, what great code you write @SimonAndréForsberg. Let me give you some upvotes. — rolfl 3 hours ago
 
And most of the other answers (if they added value) on questions, and the questions they are on too ;-)
Good contributions get upvotes ;-)
 
Good Monkey, let me go to the kitchen and grab you a banana!
 
There does appear to be an issue with your rep-page though... you have 201 for the day.
 
6:02 PM
@BenVlodgi your ending with the 3 choices is a little messy I think. it's kind of hard to follow. I will look at it again when I get home though.
 
@rolfl What rep-page?
Oh look! A banana.
 
I'm gonna take a stab at the last assembly zombie.
It's not in x86 nor MIPS, but it does contain C and C++.
 
0
Q: RPSLS refactored to Object Oriented

BenVlodgiI wrote a couple reviews for this CR post. In my most recent review, I refactored @Malachi 's code to fit OO design. I'm looking for any advice/hints/criticisms on it. Here is the entire dump: using System; using System.Collections.Generic; using System.Linq; namespace RPSLS { class Progra...

 
@BenVlodgi the playAgain variable and the loop it belongs to is a little weird. can't you make this ` playAgain = result == 0;` into this inside the while statement result == 0
 
@Jamal my rep-page is screwed up as well.... it shows 185, but, I am actually at 200 (and maxed).
Very confusing.
 
6:05 PM
@Malachi there is a looping options menu that only breaks when you choose either to quit or to play again
 
@SimonAndréForsberg - when you go to codereview.stackexchange.com/reputation
 
All, thanks for the clues on How does this bat. file reboot a remote server? I now know exactly what it is doing.
 
What does it say for your last day (scroll to the bottom)
 
@BenVlodgi but result comes out of the end. I am writing a review. I will show you what I mean
 
Hey @JamesJenkins
 
6:07 PM
@rolfl it says +200
 
@Malachi Yes you could if you declared result outside the loop... and that is probably what I should do, but I kept it this way to keep it more obvious why it should loop again
 
Glad we could help, @JamesJenkins.
 
@Malachi do it
 
I am considering editiing to bring into scope, now that I know what is doing, I am not sure it is working at it's best.
 
It is a windows command, what do you expect?
;-)
No, I am not really a bigoted person, unless it comes to windows, and, well, C#
 
6:08 PM
@BenVlodgi Couldn't Dictionary<Tuple<int, int>, string> Rules be a Dictionary<Tuple<Gesture, Gesture>, string> ?
 
Oh, C# is Windows ;-)
 
Tuple.Create<Gesture,Gesture>(Rock,Paper) is more readable I think.
I am not certain whether or not this is an answer:
-1
A: Custom indexOf() without String methods

Jonathan WoodI spent a little time on this myself. In particular, I wanted to implement the Boyer Moore algorithm, which can be much, much faster than a brute-force approach. However, in the end I concluded that IndexOf() likely uses optimized assembly language, which I simply couldn't been with any algorith...

Hey, @nhgrif. How's your UTTT coming along?
 
been way too busy.
 
@BenVlodgi I posted it and I see what you are saying about the variable scope.
 
Because of circumstances, my girlfriend's kid is now staying with us a LOT more than normal.
 
6:11 PM
I can't test it here at work though @BenVlodgi
 
@SimonAndréForsberg yes, that is a very good point. I originally implemented it that way when dealing with @Malachi 's list of strings which were int based. but then never realized to change it to using Gestures
 
@nhgrif Oh, I know that feeling. (the busy one)
 
@Malachi well.. you could ;) it will just look like some terminal work you're doing
 
@BenVlodgi I would write an answer if I didn't were rep-maxxed already, I can give that answer to @Mat'sMug (who probably would have other things to say as well)
 
@Malachi but its cool.. im in no rush
 
6:12 PM
@SimonAndréForsberg - I am not certain about that indexOf answer either.
 
@SimonAndréForsberg you could just write the answer for tomorrow
 
@rolfl When in doubt, C4?
 
@BenVlodgi why do you start your lost variable at -1?
 
I did submit an app for app store approval yesterday though.
3
 
TNT?
 
6:13 PM
Through work.
 
@BenVlodgi Good . <--- that's a point
 
Congrats @nhgrif - all the best!
 
@SimonAndréForsberg I'm not certain at all too
 
@nhgrif I have no more Stars
 
@Malachi it is what I'm used to from my C days.. it doesn't really matter. butI like to mentally visualize a loss as bad so -1, a win is +1, and a tie is inbetween
 
6:14 PM
I think that indexOf answer is a crappy answer because it does not review the code ....well, at all.
 
@SimonAndréForsberg ;)
 
@BenVlodgi I see. well I have to get BTW
 
@Marc-Andre @rolfl I'm going to go with NAA for now, but I'll let @Jamal make the final decision later :)
 
I have an answer on that question too, so I am not exactly objective
 
Damn, neither am I apparently. But I hope that he will improve his answer.
I want it to be an answer, but at its current state; I don't think that it is.
 
6:19 PM
Heh, that question may just become my Malachi!
(my push for populist).
 
@rolfl I assume you mean Populist
In which case it would be your Simon, and not your Malachi.
 
Isn't that what is says....
 
Reversal = Q -5, A +20.
 
And, you have it, but Malachi ... and I, have not ;-)
Oh, am I being dense?
 
Populist = Accepted +11, Another +23
 
6:24 PM
Well, when "Simon Says ......"
 
I'm not too sure about this one, but I did what I can.
0
A: x64 assembly clearmem / zeromem

Jamal The comments in the clearmem procedure for the Linux block look a bit confusing. You could just have a summary of the procedure commented above, and have the individual comments for each line specify the meaning of the assembly instructions. Specifically, the lines that describe the C++ code d...

 
what is populist?
I have been trying for reversal for like 3 weeks or something
 
@JamesJenkins Hey, sorry I missed you coming in.
Hello @Sathya
 
@syb0rg heya.
 
on this one ▼▼▼▼
13
A: Stored Procedure logically or coding

Malachiyou have a lot of if statements in your SQL, this screams at me that you are doing something in your SQL that should be done in the application, and that this SQL should be separated into two distinct stored procedures. the benefits faster stored procedures use an actual coding language to d...

 
6:35 PM
Hey, @Sathya! Another fellow mod. :-)
 
@Jamal ah you're the pro-tem for this site
too many sites & too hard to keep a track on who's for what :)
and from Austin, too. very cool. Miss Austin
 
One of them, yes. The other two haven't been too active lately.
 
aha
anyway - I was just dropping by. Time to sleep, have a good day~
 
Later!
 
If I say "Laters Baby", who will choke on their Coffee?
 
6:40 PM
@Sathya Come again!
 
@BenVlodgi Even Better Answer just Edited
 
@syb0rg wilco
 
@rolfl I switched to Diet Mountain Dew already
0
A: RPSLS refactored to Object Oriented

Malachione thing to start with. I would get rid of your playAgain variable and replace the while statement like this Original Code: do { Game.Play(me, computer); Console.WriteLine("Your scorecard: " + me.GetScoreCard()); int result; do ...

▲sure I missed something that will break this, that always happens to me ▲
BTW again
 
0
Q: Utility object for setTimeout

Dan TangI was using setTimeouts for a project where a callback will be called after a duration, but the user has the options of extending, pausing or stopping the timeout. I felt using the default setTimeout was a bit clunky, especially since I needed to remember the timeout ids, and I decided to create ...

 
You are all a bunch of poorly-read, or alternatively, smart people... ;-)
 
6:46 PM
of*
:P
 
fixed ;-)
 
@rolfl SOOSSTS
 
@SimonAndréForsberg And it's not even what Stack Overflow is about (referring to the comment of Jonathan Wood). Even at Stack Overflow people would ask about the same things that we do ...
I feel like this is auto-promotion of his article and I don't like it
but that's my impression
 
@Jamal - just checking... and I searched MSO, but it is hard to track down the right answers.... Can I trust that my reputation will be correctly calculated for today? codereview.stackexchange.com/users/31503/rolfl?tab=reputation ?
 
@rolfl If you're unsure, check codereview.stackexchange.com/reputation. At the very bottom, it'll allow you a recalc (once per day) if one is needed.
 
7:00 PM
The recalc button was removed in December ;-)
 
D:
 
That page clearly shows:
 2     44165 (10)
 2     42636 (5)
 2     44106 [5]
 2     44022 [0]
 2     44024 [0]
 2     44106 [0]
-- 2014-03-12 rep +200  = 17605

** rep today: 200
But my profile clearly shows an un-accept that the other reputation page does not.
 
Well, the rep should be correctly recalculated at some point.
 
@Jamal For what it's worth, I've added a bit more, mostly about the actual code. codereview.stackexchange.com/a/44183/489
 
@Malachi Yes that does break it :D however I think I have a solution that will fit well and satisfy you haters of my loops
 
7:03 PM
@BenVlodgi I just think a loop inside of a loop there is a little clunky. how does it break there?
 
@JerryCoffin I was just about to comment on that. :-) Would my answer still work, or does the vector stuff not work here?
 
@BenVlodgi I see
so it doesn't really break it. it changes some logic a little bit
 
@Malachi well it results in logic that I didn't want for the menu
@Malachi I could have written it much simpler, but I was going for a hub feel with that menu
@Malachi I think of the inner loop more of a hold up until processing can continue, just like in the PromptForNumber
@Malachi but don't worry I have a fix for it
 
@BenVlodgi I see what you are saying.
 
@Jamal You should be able to use the vector instructions to write to the memory, regardless of the source syntax used to allocate it. That said, a pointer-based interface is simpler/more obvious from the assembly side of things. Honestly, the whole thing's generally pointless--std::fill_n will typically produce code that's plenty fast (and may even already use SSE/AVX instructions).
 
7:09 PM
@SimonAndréForsberg yeah, I'll take a look later tonight ...after I review the ocean simulation post
 
If you're zeroing memory often enough that even slow code to do it causes a significant bottleneck, chances are really high that you're doing something else wrong to need to zero memory that much/often.
 
@BenVlodgi you should have a would you like to continue inside of the if statement that will set the Result to one of the other choices.
@BenVlodgi I will check out the rest of the code again later. I just skimmed it all from the answer to my question, I will read the entire code tonight though.
I guess I am just thinking about it now, why would you reset your score if you are just going to quit anyway?
@rolfl I saw that too. WTH
 
@JerryCoffin I've only once been exposed to assembly and C, so I was unsure about this one. I agree about the pointers, but I'm still in the C++ mindset regarding C-style arrays. :-) Your answer does have much good stuff, and I can learn from the assembly side of things.
@JerryCoffin: For this other question:
5
Q: Any tips for making this C++ vector class faster?

user3058865I've been working on a 3D-vector class which should be as streamlined as possible for use in numerical simulations. It will be used to model 3D-physical vectors. I hoped to design it in a modern and fast way - but one is never perfect. So, I would be interested in some input from your side. //t...

Am I missing something, or is a vector of size 3 not the same as a 3D vector?
 
@Jamal I looked at that earlier. My only guesses are that 1) he just doesn't know what he's talking about, 2) made a silly mistake, or 3) the "3D" reference is really to something like a single point in 3D space. But ultimately you're right: it's not a 3D vector (or really even similar to one either).
 
I'm tempted to go with the former. He must've not tested this first if he now wants to know how to make it faster.
I wonder if I should spill the news in a comment, or review this as a single point in 3D space.
 
7:19 PM
@Malachi that is a whole nother question instead of just returning to the main menu
 
@Jamal I was kind of planning on the latter.
 
I'm adding a comment anyway, just in case the OP wants to delete it. As it stands, it's just a run-of-the-mill vector implementation.
 
It is interesting how beginners often get very wrapped up in performance. I've lost count of the number of SO questions about "why is A so much faster than B", where the answer was: "because you compiled with optimization turned off." (and actually, optimization in general, with the compiler's optimization turned off).
2
 
@BenVlodgi if you had more options I could see doing that. but what other options do you have?
 
There's one huge problem here: this is a 1D vector of size 3, not a 3D vector. This looks more like a single point in 3D space, while a 3D vector would have nested vectors (and that syntax would look rather nasty). Do you still want this reviewed as is? It could still help you in general. — Jamal 23 secs ago
 
7:24 PM
186 more rep needed
 
@Malachi You could add whatever options you wanted right there like... clear computer score, or play with 2 humans, or have another sub options menu
@Malachi point is... it is easily scaled
 
@BenVlodgi did you see the comment I added???
 
@Malachi yah :)
 
I like it.
 
@Malachi thanks... my first main was pretty sloppy, mostly just there to get the job done
 
7:33 PM
@BenVlodgi Ho ho ho
 
@Malachi and I was trying to make it an end game menu instead of just a mainmenu
sup @syb0rg
 
@BenVlodgi Oh, that was the Santa within me speaking.
He gave you some "presents".
 
;)
@Malachi do you think I shouldn't update the OP? I did because I didn't want people reviewing the previous crap... I know I could post a whole nother question, but I didn't think it was worth for such a small part of the code
 
@BenVlodgi update it, but add the update at the end as an edit, kind of like you did, except the other way around.
 
@Malachi kk
 
7:36 PM
13
A: Stored Procedure logically or coding

Malachiyou have a lot of if statements in your SQL, this screams at me that you are doing something in your SQL that should be done in the application, and that this SQL should be separated into two distinct stored procedures. the benefits faster stored procedures use an actual coding language to d...

 
@Malachi Santa already visited that one ;)
 
@syb0rg dang it I need like 7 more still.... (:
@BenVlodgi you should change it in the answer to my question though for sure
 
@Malachi very true
@Malachi fixed
 
7:55 PM
0
Q: Count number of each char in a String

statiusYou guys will probably laugh at the way that I implemented this simple task. I know there is a simpler way of doing this but I just really cant think of it right now. Can you guys please help me out? A fellow member of stack exchange recommended me to the Code Review Thanks in advance, -Jia ...

 
@StackExchange Holy mother of variable declarations!
 
8:14 PM
0
Q: Latency problem for keyboard remoting from android phone

sallamaniaaI'm writing a simple remote PC app (mouse-keyboard).Android is client and it's connect with wifi to Java PC Server. I'm using TCP but I see a bit of latency compared to other remote apps. Then I used UDP and didn't see any latency or wrong data. UDP look like it's working well. I'm sending a Stri...

 
Anyone who wants to vote for this answer, please hold your votes until tomorrow :)
 
@SimonAndréForsberg its tough to hold back on the best answer
 
lol, good point @BenVlodgi. And thanks :)
A couple of months ago, I would have used the HashMap approach. But I guess a certain primitive monkey has rubbed off on me.
@rolfl - both a primitive monkey, and a monkey that likes primitives...
 
The above question has some bad indentation...
 
I was going to give both solutions in my answer but then before I could even finish one they were both up. And wow I forgot how annoying Maps in java are.
#SpoiledByC#
 
8:20 PM
@Jamal Yup. I'm hoping that whoever answers that will not primarily focus about the TCP/UDP issue.
@BenVlodgi Yeah, I guess C# would just use a bit of LINQ here and it would be done. Perhaps @skiwi knows if there's a good new Java 8 technique that can simplify it...
 
Haha. I'd leave a comment about that, but I feel it won't be helpful. It also doesn't appear to be a copy/paste issue.
 
@SimonAndréForsberg even just the sugar all over C# has spoiled me... like... with a Dictionary, counters['a'] instead of .get() which is also for some reason lowercase
java: counter.put(s.charAt(i), counter.get(s.charAt(i)) + 1 );
C#: counter[s[i]]++;
 
C# is better. Proof ^^
 
:)
Hi @Marc-Andre!
Bye @Marc-Andre!
 
8:26 PM
@Mat'sMug Mugs should be silent. Proof ^^
2
 
hmmmm, I should edit someones question... get 2 more rep
too late
 
I think you have another 2.5 (3.5?) hours to get those 2 points :)
 
@Mat'sMug mhmm... but I was reading it wrong, didn't realize downvotes count against your capped up rep
so I have maxed out
 
Get @Malachi to give you a checkmark, the +15 isn't subject to rep-cap.
wait you already got Mortarboard!
 
just got it!
someone did mark me ans the answer
3
A: Is there a better way to insert an enum into a set without macros?

BenVlodgiYou can iterate over the enum and insert each one individually. for ( int i = FIXED_VOLTAGE1; i != FIXED_VOLTAGE4; i++ ) { m_modules.insert(CreateAndUseIniFile::static_cast<iniFileValues>(i)); } Note: This will work with your specific case... don't do this if you have enums with set values...

 
8:31 PM
your total says 198 for today.. maybe it's the caching..
 
this^is probably true
 
gotta go now, see you later!
 
@Mat'sMug adios!
 
(Mug silenced)
 
Thanks Santa! (slightly belated)
 
8:38 PM
^^ Finally
:)
 
hmmm, should I actually work today?
 
Nah.
 
thats what I'm thinking
 
It is messy I know it. But what can I do for improve it? Why I'm getting latency , I think It's not about messy. Is it possible sending a string , server side or key press? — sallamaniaa 4 mins ago
 
1
Q: Dijkstra-like routing algorithm

MartijnI've got the following code which was written for an exercise, and I'm looking for things to improve my general Scala style. What I currently have: object Graphs { case class Node[T](value : T) case class Edge[T](from : Node[T], to : Node[T], dist : Int) def shortest[T](edges : Se...

 
8:54 PM
Whats the maximum amount of votes you can cast in a day?
nevermind
I just rtfm
 
It seems like the number of questions has picked up recently.
 
you are about to be Malachi'd ▼▼▼▼▼
 
I think instead I'm going to leave work early after a nice productive day
half of that was sarcasm ;)
 
1
Q: Enigma simulator performance

StuRHere is my implementation of a simple 3 rotor Enigma machine in C++: #include <iostream> #include <cstring> using namespace std; char alpha[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char rotors[3][27] = { "EKMFLGDQVZNTOWYHXUSPAIBRCJ", "AJDKSIRUXBLHWTMCQGZNPYFVOE", "BDFHJLCPRTXVZNYEIWGAKMUSQO" };...

 

« first day (312 days earlier)      last day (3707 days later) »