« first day (211 days earlier)      last day (3793 days later) » 

12:00 AM
0
Q: Rock Paper Scissors Lizard Spock Revisited

rolflContinuing the spirit of the recent Weekend Challenge, here is a revised version of the RPSLS game. This is a follow up to my previous submission: Rock Paper Scissors Lizard Spock as a code-style and challenge This version is revised to accommodate the following suggestions: Model revised to...

 
@rolfl had you waited 30 more seconds before posting that one, it wouldn't have counted as a zombie in this round's stats!
 
@retailcoder I voted like crazy, I hope the numbers were reduced a bit
 
@retailcoder sorry, was paying more attention to my stomach than my time
Just looked through my calendar.... looks like my next weekend for a challenge will be next year ... :(
 
12:19 AM
mission status updated :)
@SimonAndréForsberg 922 turned into 905!
 
@rolfl At first I thought "Whoa, next year? It's a whole year until then!" but then I realized... "oh, wait.. it's December..."
 
lol
 
@retailcoder Nice. 17 questions in 15 minutes. If only I could keep that speed up...
 
I saw that anyway.
 
lol moved it to the CR Challenge room @rolfl
 
12:26 AM
@retailcoder if I don't have an answer to my re-submission by the next round-up, I will delete my follow-up ... how's that?
 
I'm sure you will! You're not alone in that you know!
@rolfl (ding!)
 
For what it's worth, it seems C# is much more popular than java.... (here anywhay).
 
12:40 AM
@rolfl StackExchange users are not always right ;)
 
The numbers do not back up my claims, but emotionally I feel that there're more eyes on C# than Java.
 
isn't emotionally I feel some kind of pleonasm?
 
Emotionally, I feel that there are more eyes on Java than C# around here.
But most likely there are enough eyes around here for both of them.
 
tautology?
 
Do
really
two
 
12:50 AM
...and the more general stuff on the other side.
@SimonAndréForsberg (dong!)
 
@retailcoder different sounds for different chat rooms?
 
ding-dong felt appropriate :)
ahem. ding-dong emotionally felt appropriate :)
 
@retailcoder you know there are physical feelings too ....
what are you talking about, willis?
 
lol
Milestone: visited 135 days, 50 consecutive
(I'm half-fanatic!)
 
@retailcoder:
member for 32 days
visited 32 days, 32 consecutive
2,165 reputation
 
1:02 AM
@rolfl you Spock!
 
member for 30 days
visited 27 days, 26 consecutive
1,958 reputation
 
1:13 AM
@SimonAndréForsberg told you you'd beat me to 2K!
 
@retailcoder I'm not there yet!
 
Well the 'privileges' that come with 2K are nothing magic on CR ... like, there's nothing flagged, nothing wrong....
 
No but I have 1,841 - not impossible, but unlikely ;)
 
Like being a beat-cop at the north pole - santa's village
Please... someone, do something wrong so I can pull out my whistle!
3
I still don't have my bronze badge for Late Answer review .... there's never been one for me to 'catch'....
Sorry, my low quality badge.... I have reviewed 4 late answers
 
@rolfl I don't have it either. The queue had 390 entries in almost 3 years..
 
1:18 AM
What!? Considering how often we post late answers? Or what is a "late answer" here anyway?
Or perhaps we have too much rep already for our answers to be added there?
I have 2 reviews completed there
 
Santa's village .... That's what we should call this chat room ...
 
no I meant the LQ one
@rolfl lol
 
@SimonAndréForsberg yeah, I said late answer, I meant LQ (I did correct it)
 
Aha, yeah I don't have that one either
 
got 3 late answer reviews :)
 
1:21 AM
So, you pre-2K rep folk .... you do not have a 'Tools' section on the review page?
Or did I miss that tab before I got 2K?
 
nope
"Access to Moderator Tools" is 2K+ only...
like there's no "Review" link before you get access to it
 
OK, and I also gained it on meta.... which I found odd.
 
 
1 hour later…
2:32 AM
@rolfl: At least you can still look at deleted posts in the meantime. :-) You could check if deleted:yes works for you in the search bar.
 
 
4 hours later…
6:18 AM
1
Q: CR Weekend Challenge

retailcoderThose of you that weren't following what's going on in the chat room might have been taken by surprise by a recent avalanche of Rock Paper Scissors Lizard Spock posts. This is how it started: OK, weekend challenge.... we all solve the Rock Paper Scissors Lizzard Spock problem with our 'favou...

 
6:33 AM
Someone told me this one was mine and then I said that I would have said what the existing answer said, but I looked at it again and found something else
0
A: A shorter way to put SQL SELECT statement

Malachiyou actually don't have to use the SUM function. I re wrote the first part of your query. SELECT regd , Subject , Section , date , CASE WHEN (Name_of_exam IN ('First Unit Exam','Second Unit Exam','Third Unit Exam')) THEN (Mark_score / Full_mark) *25 END) AS t_scored , CASE ...

 
7:18 AM
@retailcoder, check out my answer, ...... ok I forgot what I was typing
 
 
5 hours later…
12:02 PM
0
Q: Which PHP code is faster?

Mawia HLTime is very important from times immemorial. Doing great things and making it happen in less time is more important as it can mean less effort. So I really like to know which way is faster and more efficient in the following codes, and I would happy to know any other way we can achieve the same ...

0
Q: Exceptions handling, what would you do?

hofmeisterI know that there are several ways to handle exceptions and probably a good way is to keep the handling consistently and use the pattern which feels comfortable for himself, but I would like to get some advice or hints, what would you do in following situation or how I could improve such a case. ...

 
 
1 hour later…
1:29 PM
0
Q: Trying to cut down redundancy in my code

comscisI have created a class that has many methods for sorting an ArrayList of objects. Each method is somewhat similar in that they employ some kind of sort on an ArrayList and then return the arrayList. They are different in that some have different methods of comparison and they also call different ...

 
1:56 PM
0
Q: AES Encryption C# .NET

conorI have written a tool for encrypting string using the AesCryptoServiceProvider in .NET. The folllowing parameters are used: Block Cipher Mode: CBC Initialization Vector: 16 bytes (randomized per encryption operation), stored in last 16 bytes of final message Key/Block size: 128 bit Padding: PKC...

 
 
1 hour later…
3:03 PM
0
Q: java.lang.NullPointerException error when i trying to populate the JTable with data from the SQL database

user32831I am trying to connect to a sqllite database and i am getting this error when i try to populate the JTable with data from the SQL database.I have four classes and I think the error is in the Informatii_evenimente.java class.The program is connecting to the database because he identifies the id an...

 
3:18 PM
7 rep remaining to 2k!
 
4:05 PM
Welcome to 2K, @SimonAndréForsberg
 
4:41 PM
@sim 2013!! Congratulations! (told you you'd beat me to it!)
 
5:04 PM
@Malachi here?
 
@rolfl yeah
 
Just re-commented on the SQL...
We are both right, both wrong.
 
I saw that.
 
The original select is too broken to make a good answer...
 
I agree.
 
5:05 PM
I think the intent of the original SQL is to 'transpose' the data, and, to do that, he needs a group-by.
and SUM(...)
 
or MAX
 
Any aggregation will do...
His Original GROUP-BY is so broken though it makes the transpose useless.
But, perhaps he does not want a transpose, in which case, everything I suggested is wrong
 
but I am thinking that the OP wanted to do Arithmetic on two columns if another column in the row held certain information, but he didn't give a case else statement
 
The 'else' part is to not return a value at all, whihc aggregates (sums) as 0.
 
OP didn't put anything in there for if the division on those columns is 0 either
 
5:09 PM
Assumption: The table contains 1 record per student per test.
There are week/term/final tests
He wants the student score and possible score in seperate columns for each student, but
he wants Sudent-details, weekly score, weekly total, term score, term total final score, final total.
So he wants to filter the values that make it to each aggregation using the case statement.
 
@rolfl that sounds about right. but then he wouldn't need the case statement at all. just a SUM
 
He cannot sum the ginal score in the term total.
s/ginal/final/
etc.
he needs to filter the rows that are used in each aggregate
 
(Mark_score / Full_mark) *25 is all OP needs for the first statement
 
No, he can't becase that will contain the final test results in it too
3
Q: SQL/Knime - Transpose Table with "Group By"

colithiumThe title is horrible but that's the best I could do. What I have is something like this: Country Tag Weight ----------------------- 1 1 20 1 2 30 1 3 77 2 1 10 2 2 11 2 3 100 Or, in a human readable form: Country T...

There's a worked xample of what he wants to do.
 
that is what he has written in the query though
 
5:14 PM
See answer with SQL
Meh, his SQL is broken, so there's not much point (and this is why we should not review broken code).
 
I started a close vote
 
Shouldn't it be closed then? Has anyone commented on the OP's post about the query being broken? This is MySQL, IDK MySQL but with SQL Server this doesn't run.
@Malachi I second
 
@retailcoder I also assume that it doesn't run, I don't have MySQL set up on my computer so I can't test it, but my comment made it clear that we need more information
 
It should run, but the answers will have little meaning..... (at least on Sybase/DB2)
@retailcoder - yeah, I did comment....
 
5:37 PM
0
Q: Trying to find reason for segfault 11 in coroutine library using setjmp

user30806I am trying to build a header only coroutine library using setjmp and c11. I am running into a segfault issue when trying to yield between two tasks. Here is a link to my source code for the coroutine library. The simple test case to reproduce the issue is: #include "libcoro.hpp" static void yi...

 
6:20 PM
92%!!!
2
 
@Jamal so, the user deletes himself, but the question stays?
-1
Q: Trying to find reason for segfault 11 in coroutine library using setjmp

user30806I am trying to build a header only coroutine library using setjmp and c11. I am running into a segfault issue when trying to yield between two tasks. Here is a link to my source code for the coroutine library. The simple test case to reproduce the issue is: #include "libcoro.hpp" static void yi...

 
@rolfl: Yes, that could happen. A good use for that is if a question is valuable, but the OP no longer wants to be associated with it. In this case, since it's already off-topic, deletion may be warranted as this may now look too localized.
 
@Jamal CR @ 92% answered! (ok that's a rounded figure.. but still!) -- at this rate we'll be at 95% before x-mas!
 
Congrats, you've gained the privilege – access to moderator tools – learn more
yay :)
Thank you thank you, @rolfl and @retailcoder.
 
Happy Christmas! (our XMas tree is currently being erected)
Carols are wailing out the hi-fi
 
6:29 PM
@SimonAndréForsberg: Congrats! As rolfl mentioned before, you may not find much to do with your new tools. It seems most flags around here are custom, which obviously are only seen by diamonds. The lists could be useful, though.
 
the meta-post is on the community bulletin; if it gets to 10 upvotes I'll take it as a green light!
 
@Jamal I guess I have to convince @retailcoder to start behaving badly so that we can flag something.
 
0
Q: Is this appropriate for codereview.SE?

Aseem BansalI had some confusions about a particular piece of code that I wrote: Thoughts on refactoring a generic DAO. I placed it on programmers.SE when I thought it was just a design thing. Now I am thinking that it may need a code review also. So I want to know: is such a question appropriate for the site?

 
More common flags are auto ones from questions being closed without comment. Those are raised by Community (annoying bugger).
 
6:46 PM
@SimonAndréForsberg I'm in Quebec, but I'm not a mayor, you can't corrupt me.
 
 
1 hour later…
7:53 PM
@Jamal how is the %answered on the front page calculated? 1-[is:question answers:0]/[is:question] = 1-946/10563 = 91.04% ...what am I missing?
 
Skip closed?
 
1-[is:question closed:no answers:0]/[is:question closed:no] = 1-855/10044 = 91.49% I think this is it @rolfl
 
0
Q: How to call various functions with various arguments from one function

talkturkeyI got a program, where the user can select from various functions (QComboBox), type in the arguments (SpinBoxes, LineEdits..) and run it by clicking the RUN button (one Button for all, space for widgets is limited). Now the way I implemented this seems a bit cumbersome and error-prone, especially...

0
Q: Shortest distance from one word to another. eg: cat -> cot -> dot -> dog

JavaDeveloperLil' preparation before the interview. This is my solution to the problem in title. The code is pretty straight forward. Requesting suggestions for improvement and also verification of complexity, which I guess is O(26n) public class CatToDog { static Set<String> dictionary; st...

 
We're actually at 91.487455197132616487455197132616% answered, precisely. Well, as precise as the Win8 scientific calculator :)
 
-1 not precise enough. :P
 
8:05 PM
0
Q: Learning to code a graph

Tyler HillsThis is my first attempt at putting the conceptual knowledge I've gained about graphs into code. When searching for examples they all seem overly complicated, and searching for a tutorial or introduction leads to conceptual information. So here I am trying to code a very simple graph and this is ...

 
Is this question not clear? I upvoted it, but everytime I try an answer I keep hitting a "damn would be nice to have more code" wall.. or is it just me?
2
Q: C# WinForms - Custom Application.Run Bootstrap Routine

bbergerI've got to maintain a legacy application (actually a number of applications) and currently most of the startup-settings (like upgrading App.config when the version has changed, check Database against Datasets, etc.) happens in the MainForm or in a Singleton object called "ApplicationController" ...

 
8:23 PM
@retailcoder Indeed, it looks like improvable code but you can't quite be sure. I'm not a C# guy, but the way Run is overridden looks awkward to me – the Strategy Pattern Alert went off in my head. Notice how overriding (and calling) the base method does not guarantee that the original args reach the CreateInstance call. OTOH this might all be desirable. What is your take on it?
 
0
Q: F# parallel.For function, optimisation review

Stuart GordonI am trying to add parallelism. The following function works... for testing purposes calculating chunckLength is fine. However, when i allocate more cores, it seems to slow down significantly which seems due to massive overhead. The visualisation shows the average core utilisation during execut...

 
8:35 PM
@amon I think the args are simply ignored. The mentions the init code is either in a firm or in another module, but provides neither. I think there's no way of seeing what the pros and cons of his approach are without seeing what is being wrapped...
*the OP nentions... ^^
*mentions ^^
 
0
Q: F# parallel.For function, optimisation review

Stuart GordonI am trying to add parallelism. The following function works... for testing purposes calculating chunckLength is fine. However, when i allocate more cores, it seems to slow down significantly which seems due to massive overhead. The visualisation shows the average core utilisation during executio...

 
I'd also like to see what OurApplicationContext is, and what it does with the form it's given.
 
@retailcoder good point(s). But it isn't unclear what OP is asking, its just that there is too little context to answer that question. Sounds like a situation for a custom close reason.
 
9:07 PM
@amon I've voted to close as unclear what you're asking - the message does mention about adding more details.
 
seems sensible.
 
9:38 PM
0
Q: block comment parser implementation for "monadic parser combinators"

JavranI'm reading monadic parser combinators. On the page 23, they leave an exercise for defining a Gofer block comment parser, and I try to implement it in Haskell. My code is here: (module MPC.Core is just all necessary functions defined in that tutorial, can be found here ): -- White-Space, Commen...

 
10:05 PM
0
Q: How should I go about bringing this code under test?

Benjamin HodgsonI'm working on an open-source test framework. 90% of my codebase has good test coverage. My main problem area is the command-line entry point. This module began life as a very short script for calling into the domain model (see the call to _run_impl()) and exit with code 1 if the test run failed...

 
10:32 PM
0
Q: Ruby 1.9 interner

Chris Jester-YoungI'm currently implementing an interner in the style of Guava's Interner, where: an intern pool is maintained for an immutable class whenever a new instance of that class is created, it's checked to see if it's equal to an existing instance in the intern pool if such an existing instance is foun...

 
@rolfl @SimonAndréForsberg I answered a question!! :)
2
0
A: Exceptions handling, what would you do?

retailcoderI'm into C#, but I don't think there's much of a language barrier here. In that function I catch four exceptions, what would you do in this situation? To me your method smells like something that either has to succeed, or fail with an explanation. Therefore, I wouldn't return a boolean; rat...

 
Meh, @SimonAndréForsberg - why do you think @Jamal converted that perfectly good answer to a comment?
It was a great answer.
@retailcoder - there are a few problems there... the question is not particularly well answered by your answer..... and you throw an exception, not return it.
@retailcoder you'll need 2K to see that convered answer .... ;-)
 
10:53 PM
0
Q: Making a yahtzee game using dice arrays

user32838Specifications: Part 1: Writing the DiceArray Class 1. Create a project named proj5 that contains a DiceArray class and an application class called Project5. The DiceArray class should contain:  Instance variables: o an array reference that will refer to an array that will store the face value o...

 
@rolfl: It looked mostly like a link-only answer and not much of a review. If you disagree, I can always undelete it.
 
11:17 PM
@rolfl oops brainfart, I meant to throw it if course!
 
@Jamal - I would have upvoted that answer for it's elegant conciseness. It identified the problem, pointed out the language revision (with reference) that was designed specifically to solve the OP's situation, and ..... in fact, if I had got there forst I wuld have said pretty much exactly what he did ....
then he gave suggetions for better error handling too
 
@rolfl: In that case, I'll undelete it.
Done. And thanks for pointing that out. Moderators can still be wrong, too. :-)
 
11:44 PM
@Malachi What answer got converted?
@rolfl What answer got converted? (Sorry @Malachi, wrong ding!)
 
OK
Well, it's not a terrific answer, but well... I don't think it's worthy of deletion.
In 13 minutes, I will get a new badge on Stack Overflow
 
Well, I'm glad it was disputed anyway.
Fanatic?
 
I'll get my Fanatic badge on MSO in 12 more days.
 
11:52 PM
@rolfl you're right - I deleted that answer, it turns out another (much, much better) answer was mentioning it:
1
A: Exceptions handling, what would you do?

David HarknessFirst, I would separate loading the certificate from storing it. They are independent concerns. It allows multiple ways to load a certificate. It improves testability. As Kinjal suggests, logging the error is a good alternative when failure is recoverable. However, I would throw a custom exce...

 
@SimonAndréForsberg - accepted your answer, don't think anyone else is going to jump in.
 

« first day (211 days earlier)      last day (3793 days later) »