« first day (391 days earlier)      last day (3633 days later) » 

12:00 AM
I probably could've gotten it for First Posts, but I wasn't too concerned about that queue.
 
is this a bad answer? it's showing up in the moderation tools under "lowest voted"...... and it's a zombie question. Should I put a bounty on the question?
same here
0
A: Exporting data in a WordPress widget

brasofiloNormally, Output Buffer functions are not needed in a WordPress context, here neither. We'll just hook on admin_init to intercept our $_POST action, output the export file and exit. The browser doesn't even reloads the page. The form needs a security field, with wp_nonce_field(), and a hidden on...

and here
0
A: Video rental store application design

VoiceOfUnreasonI think you are getting lost in a bunch of methods you are implementing before you have a real justification for them. So let's just ignore those for the moment, and concentrate on the bits that you have a handle on (in the expectation that things will become clearer). private double calculate(...

ah, reload
+1 but it's Mortal Kombat, with a "K" ;) — Mat's Mug 12 secs ago
@Jamal nice question (I upvoted it a while ago, came back to see the new answers)
(hard-coded hangman)
 
@Mat'sMug That's weird. I would normally expect that from downvoted posts.
 
2 close votes on that one, what's up with that?
7
Q: Find the duplicate in a sorted array In less-than O(n)

MulderAssumptions The array is sorted. There is only one duplicate. The array is only populated with numbers [0, n], where n is the length of the array. Example array: [0,1,2,3,4,5,6,7,8,8,9] Here is my implementation: public static int DuplicateBinaryFind(int[] arr, int left, int right) { ...

lol "Mortal Combat" was edited!
and we have 40,003 users!
 
Just think of all that voting power...
 
unexploited
 
12:15 AM
Revised, and ready for action ....
2
Q: Making an array editable by user

Coder 314What I want to do: Let users add data to an array through an input field and add button. HTML: <body> <input type="text" id="input"> <button type="button" id="btnAdd">Add Number</button> <div id="outputBox"></div> JS: <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery....

 
If every single user upvoted just one post, the voting spike would be enough to wake up Grace Note. :-)
 
Well, which one post would that be ... I have some suggestins ... ;-)
 
I'll close my eyes and choose one.
 
@rolfl I don't think @Jamal meant everyone upvotes the same post...
 
Yeah, not the same post. Any post.
 
12:17 AM
Did I see a RELOAD?
Does that mean .......
 
oh gosh
 
564
A: Why is Stack Overflow so negative of late?

Mysticial Why is Stack Overflow so negative of late? I hate to pile on, but I couldn't resist summarizing the problem. And I apologize ahead of time for any potentially offensive language that I might use. Basically there are 4 camps of users on Stack Overflow: The "caretakers" who want to keep the...

 
That diagram is all kinda of genius.
 
the answer's wording is a gem!
> Basically there are 4 camps of users on Stack Overflow:

The "caretakers" who want to keep the site clean and with good content.
The "help vampires" who flood the site with bad/duplicate questions who only want their question answered and care nothing for the site.
The "repwhores" who answer everything they can (or can't).
The ones who no longer give a shit.
 
12:24 AM
I'm mostly #1. Everyone hates me. :-)
 
on SO, I'm clearly in #4
 
I do feel that CR is sort of free of whores and vampires. Not so much of "REVIEW MY CODEZ ALREADY!!!" and there's no shame in reviewing "easy" code.
 
yeah......... we have our own kind of whores. I think I'm one.
276 answers.. I wonder how many I've posted in chat.
 
I'm a caretaker and a whore. :-/
So, I guess that means I hate myself.
 
yeah, but you suck at whoring so good wins out
 
12:29 AM
Nah, on CR the relationships are different. There's so much lovin' going on, the only group getting hate is the apathics
 
Should I be watching the game?
 
0-0 so far, Rangers seem to have momentum
 
@rolfl phew
Incoming JDQ!
 
0
Q: Validate fields in Python dictionary using dictionary of lambdas

MFBI would love some feedback on this. I use it to validate web-form objects before persisting them in the dangerously-lazy MongoDb. I have a class and many validators for each of my collections. Is there a better way to write or go about this? class ValidationError(Exception): pass cla...

0
Q: Circular queue implementation

JavaDeveloperImplemented simple thread safe circular queue. Looking for code review, optimizations and best practices. public class CircularQueue { int[] queue; int front; int rear; int currentSize; int size; public CircularQueue(int size) { this.queue = new int[size]; ...

 
this may be the best answer ever posted on MSO — Jeff Atwood ♦ Apr 27 at 7:05
 
12:39 AM
lol how did I miss that one!
 
@Mat'sMug Close second?
 
LOL!!
 
His profile description is hilarious, too.
 
0-0 end of first
Are ++ and -- thread-safe/atomic in JAVA?
Seriously, JD should start posting JDA's. His code is couldn't-be-cleaner.
 
@Mat'sMug What I do know is that JAVA has the CLASS keyword and execution starts in MAIN().
 
12:54 AM
Same here ;)
 
When I post my first Java question, I'm tempted to put JAVA as the title tag:
"<some program description> JAVA"
 
You could do that. And then Jamalize it within the grace period ;)
 
It'd be more fun if someone else removes it. :-) It'll really make me feel like a beginner again.
 
it has to happen after the grace period to leave a trace :)
 
It'll be my first time using , too.
 
1:10 AM
I'd use that tag too if I were to post a piece of code
 
Give it a try!
 
hmm
(installing VS Express 2013)
 
:D
Santa + 1 more good answer = 12K
 
Acquiring: Microsoft Visual C++ 2013 x64 Debug Runtime...
 
I've finally figured out how to land in Kerbal Space Program.
 
1:25 AM
that looks like a nice project.. the game is currently under heavy development
and a fun game too
The computer needs to be restarted before starting the product
and 1-0 NY
 
1:42 AM
Anyone want 200 rep?
3
Q: How would I go about fixing this "Segmentation Fault: 11"?

syb0rgI am trying to get the flite speech synthesis library to work on my Mac, but my sound architecture isn't supported within the flite library. To fix that problem, I am using PortAudio to playback the synthesized audio; so I had to do a little bit of hacking within the audio.c file to get flite to...

 
2:11 AM
@Mat'sMug are you still here?
user image
4
 
Hello, world!
 
2:35 AM
1
Q: A Ruby sorting program for multiple criteria

MohamadThis code review expands on an earlier one that deals with generating a football table from match data. This review deals with ordering said table based on several criteria. Your opinions/refactorings are welcome. Given a table with columns name, goals_for, goal_diff, and points, the program so...

 
</season>
@Malachi haha
 
2:54 AM
0
A: How could Magneto stop the bullet fired at the police officer's head?

ottoMagneto is probably using the dualism of electricity and magnetism in relativity theory. So by thinking relativily he is also able to create electric potentials inside the bullet and in the air which cause the bullet to slow down and move around. Simple applied physics, no voodoo here.

 
Well, @Mat, it sucks, but thank goodness I am done with the stress for the year. I don't even officially support the habs.
 
oh well, we made it pretty far this year!
wow turns out the JDQ did spawn plenty of answers!
 
3:11 AM
@Mat'sMug I found that on Google+
someone went to town Voting on my answers earlier, Thanks Santa
 
JDQ napalm'd
 
What, Habs lost? :-(
 
yup
 
Oh poop, well I guess they have plenty of time to get ready for next season...
 
Hey, you mean the leafs will be more prepared than the Habs next time?
 
3:21 AM
If you factor in probabilities, I guess that's the case
 
when was the last time Toronto won the cup again?
(1967)
 
I was about to say that
 
this would have been the Habs' 25th
Toronto is no match for Montreal :p
 
SELECT DATEDIFF(DAY, '1967-05-02', CURRENT_TIMESTAMP);
Result: 17195 days
Been a long time since the 'Leafs won the cup ;-)
 
I'm not sure, is 17195 days more impressive than 47 years?
 
3:32 AM
Marginally, only in that the number has more digits.
 
1,485,648,000,000ms
 
You get the idea!
To be approximately exact, 1485660885 seconds.
 
what's that "1" digit called? One ______ four hundred and eighty five billion, six hundred and fourty-eight millions.
 
Trillion
 
duh (facepalm)
 
3:36 AM
67 rep until I overtake Sepp2k
104 until I overtake Jesse C. Slicer
 
still 89 tiny little points behind @Simon
 
89 tiny little points... what she said...
 
it was ~800 two weeks ago :)
 
You must have been learning a new language or something! Grats @Mat'sMug
 
not even... credit goes to @Simon for taking two weeks [pretty much] off!
(and @Santa)
 
3:42 AM
@Mat'sMug you're apparently doing something right. Now you should take two weeks off so I can get up there too :-P
(that should give me time to learn PHP lol)
(particularly how to concatenate SQL into PHP for max efficiency/security/ worst best practices)
 
Congrats on the bronze [badge:c++], @Edward!
(I know he hasn't been in here recently, but I won't superping him for that)
 
Aw, is one vote short :(
 
is 2 away for me.
@Mat'sMug cough
 
:)
you got your ! congrats @Jamal!
 
:-)
 
3:53 AM
SET @name = 'Jamal; SELECT 'Congratulations' + @name;`
 
@Phrancis and send that over an HTTP POST ;)
 
Still working on getting the back tick to work, but I'll put that next on the list ;-P
OH, I forgot one apostrophe...
`SET @name = 'Jamal'; SELECT 'Congratulations' + @name;`
Bah, function that.
 
`it's picky at times `
(that's \`)
test
oh.. it's not picky
other markdown is though
anyway TTGTB
'night @all!
 
Night!
 
Goodbye, Mat
 
4:06 AM
I got 3 revival badges about 4-5 hours ago!
 
cough
 
thank you
 
I should keep looking at the One Vote Short query. Lots of forgotten posts short of a badge.
 
@Jamal Post like to One Vote Short query please?
Ugh, link* not like*
 
4:27 AM
Well I'm off to writing music accompaniments to sub-par pop songs. SELECT TTQW'
 
Later!
 
5:10 AM
@SimonAndréForsberg After having sifted through some of the "relevant" meta questions on this my stance is: Nothing, because they hardly know it themselves
programmers had revised it's topic in 2011 which lead to some confusion inside the community, many are fed up with the way it works now and there are also many who are proud of the high close vote ratio (and say we should wait for SO to catch up when their CV queue has cleared)
also note that the current state of the closevote ratio seems to be an improvement (it must have been much worse immediately after the reorientation)
 
5:32 AM
aaand I would agree with most of the closevotes that have been cast on the questions that I saw on the list right now
 
0
Q: Optimize this solution : Finding given element in minimum steps from matrix

vaibhava N*N size matrix is entered. The condition is Each element of the matrix is greater then elements above it and left to it. OR Can say, All the elements in right side and down side must be greater then the element entered. example : for 4 sized(4*4) matrix 1 10 15 30 5 12 18 35 7 14 20...

 
6:16 AM
Most of the SE network could stand to have more close votes in my experience. All of the high traffic sites have a major quality problem :/
 
6:30 AM
0
Q: JFreeChart Dynamic Scatter Chart

uros calakovicI have a model that consists of a 100 'agents' that change their x and y coordinates randomly. I use JFreeChart scatter chart to represent agents' locations. Here is the code: package jfreecharttest; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Array...

0
Q: Abstract factory code for. Is their any thing wrong

user3651810 namespace WindowsFormsApplication1 { public interface ICarfactory { ICar getCar(CarType carType); } public interface ICar { } public class Sedan: ICar { } public class Hatchback : ICar { } public cla...

 
6:50 AM
0
Q: Implement Stack using queue

JavaDeveloperImplemented a stack using a queue. Complexity: Time O(n) - push, where n is the number of elements in the queue O(1) - pop Space: O(n) - n is the number of elements in the queue. Looking for optimizations, code review and best practices. public class StackUsingQueue<T> { private Q...

0
Q: Error 193 while running a small program using subprocess.call in Python

alpsThe following code works when used with cmd prompt: C:\gdal_calc.py -A C:\a.tif --outfile=C:\result.tif --calc="A+1" When I want to run the same code with subprocess: import subprocess subprocess.call(['C:\\gdal_calc.py', '-A', 'C:\\a.tif', '--outfile=C:\\result.tif', '--calc="A+1"']) The ...

 
 
3 hours later…
9:29 AM
Morning
 
Good morning
 
How are you?
 
9:45 AM
s/morning/monking/
Monking
fine, a little hungover...
 
@Vogel612 I just wasted some time on that question...
I thought why even use two queues, but meh it needs to be done that way
btw I wouldn't really advice to "implement Stack"
It's quite a legacy class, which is by default synchronized and which is no interface but a class
Then again, waht the OP aws doing isn't really nice either
So it may be appropiate in this situation
I wish they could just kill those old implementations and give us a proper Stack interface back
 
Java kill old baggage? That would be the day!
 
I'd say there are chances, but not anywhere soon
Short version is: If they don't do it, then another language will rise and take over their dominance
Might take a while before that ^ happens though
 
10:02 AM
0
Q: I want to simplify if else code of python that looks ugly

user2734570How can I simplify and optimize this code if type(variant_list) == dict: style_color_if(variant_list[style_colors_main], variant_list) else: for variant in variant_list: if type(variant[style_colors_main]) == dict: json_key_getter(variant[style_colors_main], variant) ...

 
Nibjubg @SimonAndréForsberg
 
@skiwi that thing is a finger-stretch, so I figured he'd better do it "right"
0
A: Abstract factory code for. Is there any thing wrong

VaxFirst thing that pops in my head is that camel case for methods (getCar) is not actually usable in C#, in my opinion it looks really ugly and belongs to Java. You should use pascal case (GetCar) More info: http://msdn.microsoft.com/en-us/library/x2dbyw72(v=vs.71).aspx

what to do with that answer....
 
Anyone knows a better name for playerThatIsTakingTurn?
 
10:18 AM
Thor
Monking all!
activePlayer
 
Monking @rolfl
 
@rolfl ^^^^ that
meh still wrong...
 
activePlayer would be a 90% match... but I suppose it'll do compared to the length fo the other method name :P or variable name
 
@Mat'sMug AFAIK, no. There's AtomicInteger for thread-safety ++ and --.
@skiwi Nibjubg!
 
Shouldn't it be Nibjubf?
<-- not using 10-finger system
 
10:20 AM
@skiwi currentPlayer
@Vogel612 If the left hand is on the right place, but the right one is moved to the left, it's Nibjubg.
 
@SimonAndréForsberg figures....
 
It's hard to purposefully make mistakes
Nibjubg
 
It's happened though, and I got 7 stars for it:
May 23 at 13:49, by Simon André Forsberg
Nibjubg
 
I know... So I'm not first
I always thought that @Nonnull, etc. annotations without runtime checking would be useless... but I do think they're useful now if they're private or package-private methods
Would anyone be able to help me out with a little unit testing issue?
Consider the code here: pastebin.com/aJiGz3HS , I just added the activePlayer stuff
In a Player I can inject what it does during a turn (can be literally anything)
How on earth will I test the get getActivePlayer method?
Should I inside the TurnAction check the current active player in the game maybe?
 
@skiwi Create a game, assert that the method has the starting value, play something / change turn, assert that it has another value. Or is that not what you want?
 
10:34 AM
@SimonAndréForsberg The issue there is that I cannot control playing the turn of self and opponent
I can't say: play turn self, check active player, play turn opponent, check active player in my test
 
Call some methods? Mock it?
Why can't you do that?
 
public void play() {
    assertConstructed();
    while (!self.isDead() && !opponent.isDead()) {
        playTurn(self);
        playTurn(opponent);
    }
}
I can't put my own assertions after playTurn(self) and playTurn(opponent)
 
Why not?
In a @Test method you can, IMO
 
I'm not following it here
that method is from my Game class, how could I do that in my @Test then?
 
Why is the playTurn method private?
That complicates things
Imagine if you would have an UI for this, should that method really be private then?
 
10:41 AM
private void playTurn(final Player player) {
    Objects.requireNonNull(player, "player");
    activePlayer = Optional.of(player);
    player.playTurn();
}
It's more or less a wrapper around player.playTurn(), and the TurnAction is public and is injectable
 
What TurnAction? I don't see a TurnAction referenced there
 
public void playTurn() {
    assertConstructed();
    turnAction.performTurn(this);
}
(That's of Player)
I think I did find a way though, running tests to check it now
This is the easiest way I found so far:
@Test
public void testGetActivePlayer() {
    Game game = new Game();

    AtomicReference<Player> selfReference = new AtomicReference<>();
    Player self = Player.createFromConfiguration(playerConfigurationBuilder
            .turnAction(player -> {
                player.decreaseHitpoints(10);
                assertTrue(game.getActivePlayer().isPresent());
                assertEquals(selfReference.get(), game.getActivePlayer().get());
            })
            .build(), "Self");
    selfReference.set(self);
Where playerConfigurationBuilder has the other required data to construct the player
And yes, the code looks evil
 
Yeah, that does not look pretty.
It would be a whole lot easier if you didn't use the game.play method there, and instead called playTurn manually
 
The thing is really checks is that when a player is playing his turn, that he is set as active player
But I need to check that game.play performs as expected? Or did I make a mistake there
 
At the moment, it will be really interesting to see how you are going to make a UI for this...
 
10:50 AM
It shouldn't be too difficult (I hope)
 
@Donald.McLean I don't know why that came up, but I can indeed speak French fluently.
 
The UI can hook into any event that happens
 
@Morwenn We were talking about a song that is in French. I liked the song but was lamenting that my skill in the language were just way too rusty since I last studied it in 1981.
 
@skiwi Isn't the UI supposed to cause some events? (by executing methods on the game)
 
@SimonAndréForsberg Ahh that part, that will be somewhat more tricky indeed
Huh
[ERROR] Failed to execute goal org.eluder.coveralls:coveralls-maven-plugin:2.2.0:jacoco (default-cli) on project TCG: Processing of input or output data failed: Report submission to Coveralls API failed with HTTP status 500: Internal Server Error (Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
I'm wondering now if it's my code that caused the Coverage submission to fail or the Coverage site itself
Is this a handmade message? (On SO)
 
11:18 AM
No, it's autogenerated when flagged or VTC'd for being duplicate
 
So he's probably still right that he didn't VTC ;)
It is an interesting qustion itself though
how do you define "the closest color" to another based on RGB
 
You loop through the known colors and find out which one is closest, based on it's RGB value
 
If you know a way to "which one is closest" ;)
 
Where the closeness to another value is based on Math.abs(r - other.r) + Math.abs(g - other.g) + Math.abs(b - other.b);
 
I wonder if that formula would always work though
 
11:23 AM
Why wouldn't it?
 
I'm thinking about a small set of known colors (akin to Java's Color.*)
if a color isn't really close to anything, then it would cause weird things I suppose?
 
It would pick whichever one was closest
Of course, if you have YELLOW and only have the known colors BLACK or WHITE, it would pick WHITE.
 
Yeah ok I agree there
 
And if you have 0x7f7f7f it would pick BLACK, but if you had 0x808080, it would pick WHITE
A color isn't perhaps always "really close to anything", but when it's not "really close to anything", it will still pick whatever is closest.
 
And then the discussion comes whether RGB or HSB or etc. is better :P
 
11:28 AM
If you have two options that are equally distant though, then that would be interesting. Such as if you have WHITE and have to pick between RED, GREEN and BLUE
 
Which I have no clue, though they say other schemes are a more realistic interpretation of the real world
@SimonAndréForsberg Might opt for red if you are doing proper RGB checking :P
 
Yeah, that discussion is always there of course. But I think this would work using another system as well, you just have to use the HSB components in the formula instead of RGB.
I can't come up with an example color that would be different though, depending on which system you use for checking.
 
I'm not that experienced in color things either
Btw, do you think that on github I should make it more clear what issues are open for others to help on?
Currently the only indication is that I haven't assigned them to myself
 
You could do that, yes.
I've noticed that you are often very fast in fixing things and updating your issues list. There's a lot of mail in my inbox xD
 
:P
(Lucky I don't have mails)
 
11:33 AM
Is it perhaps possible to switch to daily notifications or something? So that I instead only get one mail per day, with a summary of what you have done?
 
The generics is still open for when you have itme and I'm interested to see how the pull request/merge work :P
I hope so
 
The Event-generics? Yeah, I'd like to help you with that, but I have so many things to do on my own TCG at the moment xD
 
I can always return the help at some point :P
I'm growing a bit tired of all unit tests though
Especially repetative ones
 
@skiwi Very tempted in pinning that!
 
hehe
But I don't want to break my policy of committing the class + unit tets at some time either
 
11:39 AM
I'd gladly have some help in my TCG. You can write my unit tests :P
 
hehe
You have a severe lack of unit tests...
I'm at 423 here
 
No, seriously, there's actually a whole lot of things more than that to do around here. It might take a bit of time to understand my code though.
 
Would there be a way to ease the understanding?
 
Playing around with it, debugging it and see what paths the code takes. Or me adding some documentation, erhm...
2
 
I shouldn't probably document mine as well at some point
It shouldn't be too difficult
for the general structure
 
11:42 AM
And perhaps most importantly: Ask me questions.
@skiwi shouldn't, or should? :)
 
Even though for some reason I already have 35 classes...
@SimonAndréForsberg I might want to have said should
@rolfl, you might want to fix this
> A Queue, by definition, (Computer Science Definition, not Java interface) is a FIFO device. A Stack, by definition, is a FIFO device. They are significant opposites of each other.
 
35 !? That's nothing! My component-based approach alone has 51 classes. The Hearthstone-specific code has 78.
 
@SimonAndréForsberg A load is still missing though ;)
And it's without test classes
 
@skiwi Thanks
 
Right, when counting the your test classes alone, you have more classes than I've ever written in my life.
 
11:46 AM
@rolfl Do moderator edits not show up on posts btw?
@SimonAndréForsberg It's probably just the double of the general classes :P
 
So each general class has 2 test-classes? (on average)
 
every general class has one test-class
might have worded it wrongly there
 
@skiwi In before the 5-minute grace period
 
monking
 
@rolfl Ah that explains
monking @BenVlodgi
 
11:50 AM
Monking, and Monkout!
TTGTW
 
nooooo
 
I like how that guy thinks something similar to me...
I don't like that I posted almost the same 20 minutes earlier..
0
A: Abstract factory code for. Is there any thing wrong

Eoin CampbellI would take a slightly different approach and consolidate your factory stuff by an extra parameter. I'd also compose and base class your definition of a car differently. Rather than having base classes for each car type and inheriting, car type would just be another property of a BaseCar abstra...

 
12:31 PM
monking!
@SimonAndréForsberg 34 little rep points on the wall, 34 little rep points... ;)
 
@Mat'sMug 34 !? How did that happen!?
 
I'd blame Santa...
 
Monking
 
12:54 PM
0
Q: Threaded pipeline

Dieter LückingI have a threaded pipeline with single producers and (possible) multiple consumers. A producer might wait or not, depending on the policy provided. A problem here is valgrind (helgrind) is reporting a race condition where no race condition should be possible (If so, my code is wrong). #include <...

 

« first day (391 days earlier)      last day (3633 days later) »