« first day (722 days earlier)      last day (3594 days later) » 

00:00
There are 1321 unanswered questions
@Duga BLAST!
00:17
0
Q: Determining winning hand in poker

maaartinusAfter having reviewed this question, I recalled that I haven't solved Project Euler's problem 54. So I did it, however, I fount out that implementing the exact rules is rather tricky. So I implemented just the necessary part. It works, problem solved, so let's call my code working. However, ther...

00:45
@rolfl If I were you, I wouldn't put backdoor on your system - it sounds awful suspicious.
1
Q: Java Bridge Card Game

n0tionSo I'm in the process of creating a simple Contract Bridge in Java. I will be using JavaFX to create the GIU component of the program. For right now I am trying to tackle writing each of the classes needed to run the game. If you're unfamiliar with bridge the short explanation is as follows: you ...

-1
Q: I am getting an error on the 'start' in the (start + finish) at the bottom.

Ethan CotlerI am getting an error on the 'start' in the (start + finish) at the bottom. The only way to fix it is to add "int start = inputFn.nextInt();" below ' Scanner inputFn = new Scanner(System.in);' but that screws it all up. I was able to fix it before but I forgot how I did it. Please help. publi...

@Hosch250 it's not called backdoor.... I must have remembered it wron....
OK.
I wonder when I'm going to get my badge. They've never taken this long before.
backbone.js ?
That's it.
yes.
@Hosch250 Which tag?
@Hosch250 Records show that you are two upvotes short.
you have 98, need 100.
> 98 html × 20
@rolfl Nope, that is from last night - I answered one afterward, and got 4 upvotes.
I have "gotten" the badge about 4 times today before I changed my tracker to C#.
Notice how all tag badges are awarded at 03:00z?
2 mnore hours, bud.
00:56
Thanks.
so what is your question this is not a question as it stands now, it is blog post about writing a bridge game in Java with JavaFX. If you want a code review there is a site specifically for that codereview.stackexchange.comJarrod Roberson 47 secs ago
It's already cross-posted... from there, to here: codereview.stackexchange.com/questions/87992/bridge-card-gamerolfl 11 secs ago
@rolfl quicker than me ;) I guess the user badly wanted an answer!
Are we supposed to close cross-posts, or just warn the OP about them?
Cross posting is ok. Anyway his question on SO will most likely be downvoted and forget.
I voted to close the SO question as Unclear what you're asking".
Because, it is an unclear SO question....
not because of the cross-post.
01:06
I think the "rule" for cross-posting is : if it's on-topic on multiple sites, let it be.
The cross-post rules are fuzzy, but, it is clearly off-topic on SO... and those are clear rules.
Maybe you will have a better luck on codereview.stackexchange.com . — peterh 22 secs ago
PIMP = Please Idolize My Post (?)
BTDT
@rolfl What does that stand for?
01:10
Been There, Done That.
I'm voting to close this question as off-topic because it is asking for a code review! — Jarrod Roberson 34 secs ago
@JarrodRoberson - you should read the help-center for Code Review before recommending that as a site to post to (which you have been doing recently). Broken code (code that does not work) is not on topic there: *I'm having trouble writing the string values of the elements in the vectors. * — rolfl 18 secs ago
I'm going now, I should be back about 3:00Z
bye
Updating my calculator, not fully done, and a little stumped.
is ’1’ if the box is checked and ’0’ if it isn’t. -> I don't like using number for true/false value. I've trouble remembering which is one is which and it's never the same thing when you change language/framework.
01:20
@Marc-Andre I've trouble remembering which is one is which and it's never the same thing when you change language/framework.
It would help if you told us the language..... :(
This is in rails, so in ruby
But it's a <input type='checkbox'>
Google says: defaults to 1 for checked and 0 for unchecked
In 2015 I would hope that we could something more descriptive than 0/1 for true/false.
</rant>
Been a while since I've been in the 2nd monitor, how things are going @rolfl ? You still like to moderate Code Review ?
Yeah, except it is 0/1 for false/true
@rolfl It's exactly my point... I can't remember it correctly...
01:25
Yes, I still like it! It has been hard to find as much time recently, but it goes in swings and roundabouts.
The moderation has been more.... involved, and the answering is less involved.
also, I have done side projects instead of answering.
So my time is spent differently.
My reputation graphs make that obvious.
More importantly, how are you?
Where have you been?
I've checked some of your projects when I had time to look at things at work! Looks nice, I would hope to try your microbenchmarks.
I should have posted a new release, but got sucked in to TV.
I did the commits, but not the test/build.
Well I have a lot of work to do! My project is not going that well so I need to do a lot of things and I've been taking a lot of responsabilities at work. I'm learning ruby and trying to do some interestings project.
I've re-started to do a bit more of moderation on Code Review (editing, closing, etc). There is a lot more activity on the site it's nice to see!
It's a very different side of things when you get in o it.
It sure is, but I like it! It's hard something to determine what is the best course of action but most of time I think I'm doing the right things.
And I've finally fixed the footer of the Cardshifter web site btw!
01:39
If you don't get meaningful answers, maybe you will have a better luck on codereview.stackexchange.com . — peterh 25 secs ago
@peterh - Code Review is for working code, not for debugging issues — rolfl 27 secs ago
02:24
Still half an hour to my badge.
Done with the dishes, I might as well write a paper until it comes in.
02:45
BTW, I've never had trouble remembering 0 == false and 1 == true.
Just remember your truth tables.
Also, I have never seen any language that has it the opposite, including C, C++, C#, Java, Python, JS, and Ruby.
@Hosch250 Unix shell scripts.
Really?
Why don't they follow the standard?
The exit codes of a program are 0 for success, and any other number for failure
So, in a shell script, you can say: if grep fubar somefile ; then
Well, C++ uses 0 for success, but that is probably because there is only one kind of success and a zillion (or brazilian) kinds of failures.
grep returns 0 for a match...
all unix-like systems return 0 for success.
which is why shell scripts make that the true-condition
Also, they set the standard, they don't follow it
02:50
Oh.
Well, I can understand 0 being used for success, but failure isn't just a 1, AFAIK, it has many different values.
@Hosch250 Like clockwork -> COngrats.
@rolfl It IS clockwork.
@Hosch250 The same is true for C.
0 is false, any non-zero is true.
I know how Unix can start using 0 for false.
Instead of asking "Did the program succeed?", they should ask "Did the program fail?".
They wouldn't need to change anything else.
But, the value of he error is significant.
values with bit 8 set are signal failures
other bits indicate core dumps.
often there is a table of error messages related to the numbers.
03:07
So, 0 means the program did not fail, other values say "yes, it failed, here is the problem"
correct
So, they just need to change the questions around.
Hi. I have update my question and add code review section. Can you please check and review my code and guide me If I am wrong. I have create same way that you explained. Thanks :) — Manan 10 secs ago
Probably a bit more complex than that, with updating the docs we smoke and renaming error-handling variables and such.
03:54
Ooh, I'm two posts away from Generalist (if one gets 1 vote and the other 2)!
04:06
@Hosch250 You are overgeneralizing.
6
A: Why is 0 false?

200_successYou should consider that alternative systems can also be acceptable design decisions. Shells: 0 exit status is true, non-zero is false The example of shells treating a 0 exit status as true has already been mentioned. $ ( exit 0 ) && echo "0 is true" || echo "0 is false" 0 is true $ ( exit 1 ) &&

@200_success Either that, or limited experience.
BTW, thanks, whoever gave me a vote on an [tag:algorithm] question, that is one I needed for my Generalist badge!
@Hosch250 You're welcome, and your answer taught me something (hmmmm)
Wow.
Boy.
well, I was about to downvote it, but then I thought I would check, and you were right.
Really wow.
Yeah, I wrote that completely based on the doc and Ideone.
04:09
I did not know that System.out.format existed.... I thought it was only System.out.printf
You almost got a -1 and a comment, but the documentation indicates they are aliases.
Lol.
An invocation of this method of the form out.printf(format, args) behaves in exactly the same way as the invocation

     out.format(format, args)
Java does not commonly have aliases for methods.... not sure why I missed this one
@200_success Thanks for the link, it was educational.
I've learned a lot today.
I need to learn about streams in C# more. I'm not sure if I know more C++ or C#, and I'll be learning more of both soon.
Anyway, I'm off to get ready for bed.
See you!
I found an old, old, old, old zombie - almost a year old.
I'm going to try answering it.
See you later.
 
1 hour later…
05:28
0
Q: Haskell Sudoku solver using bactracking

sshThis solves Sudoku by using backtracking. Accepts one grid where 0 represents a missing number. Here are some examples: http://norvig.com/easy50.txt The program is quite slow. Input is stdin. import Data.Char (isDigit) import Data.List (intersperse, delete) printGrid [] = [] printGrid x = (int...

 
2 hours later…
07:30
0
Q: unique_ptr not disposing

MattMattOk, so I have an SDL_Wrapper working almost perfectly : only problem remaining is that I don't get a log message that my unique_ptr (or shared_ptr) gets disposed at the end of my program. Maybe because the unique_ptr gets disposed when my console window is already closed ? Tell me if it doesn't ...

I'm voting to close this question as off-topic because it seems more appropriate for codereview.stackexchange.com or programmers.stackexchange.com — Peter Duniho 8 secs ago
07:50
Thanks. I have posted this question in Code Review. Hope you are more interested in answering and not just closing questions. — elysefaulkner 49 secs ago
0
Q: Yet Another Java GUI Calculator

h.j.k.In the spirit of April 2015 Community Challenge, I have created two Java-based calculators with the following codebase layout: An interface Calculeightor for describing how values can be appended into a stream and then reduced to a single result given an operator. An enum Operator to represent ...

0
Q: Why do we need extra arrays while finding longest increasing subsequence?

tiannachavezHere is an algorithm which finds longest increasing up sequence. However, I can't figure out what the tailIndices and prevIndices are doing in the following C++ code. This is taken from this link http://www.geeksforgeeks.org/construction-of-longest-monotonically-increasing-subsequence-n-log-n/ ...

08:07
0
Q: Yet Another Java CLI Calculator

h.j.k.In the spirit of April 2015 Community Challenge, I have created two Java-based calculators with the following codebase layout: An interface Calculeightor for describing how values can be appended into a stream and then reduced to a single result given an operator. An enum Operator to represent ...

08:42
If this is working code that you would like feedback on, consider codereview.stackexchange.comjonrsharpe 21 secs ago
I'm voting to close this question as off-topic because it should be migrated to codereview.SE — Anony-Mousse 6 secs ago
09:07
If the 'main macro' was poorly written, it may involve code commands like Range("A1").Select which will throw your Worksheet_SelectionChange into conniptions. If you cannot rewrite the code to remove inefficient code like that, use Application.EnableEvents = False at the very beginning and Application.EnableEvents = True before the macro exits to ensure that everything gets turned back on. Consider Code Review for advise on improving the 'mainmacro'. Great site for improving inefficient (but working) code. — Jeeped 10 secs ago
0
Q: Code separation in MVC

cramarFirstly I am not a professional programmer and I am just learning C#, MVC and Web Development. Much of what I describe here is self taught and comes from lots of googling and posts on Stack Overflow. I have adopted the approach outlined in Mike Brind's recent blog post Can some of you with mor...

0
Q: Area of an irregular polygon

Caridorc""" Provides a way to caculate the area of an arbitrary n-sided irregular polygon. """ import doctest import math def heron(a,b,c): """ Uses the heron formula to calculate the area of the triangle where `a`,`b` and `c` are the side lengths. >>> heron(3, 4, 5) 6.0 >>>...

09:28
0
Q: Memoized Prime Generator

yasarHere is my code: def odd_numbers_from(n): if n % 2 == 0: n = n + 1 while True: yield n n = n + 2 def takeWhile(pred, lst): for item in lst: if pred(item): yield item else: break def takePrimes(iterator): for n in...

I'm voting to close this question as off-topic because SO is not for code reviews. — MrTux 14 secs ago
This is a better fit for Core Review SE indeed. — Lucas Trzesniewski 6 secs ago
Thx for pointing to code review site. I will ask it there. — Vadims Samsinovs 24 secs ago
09:49
0
Q: Please help optimizing code and make it dynamic

Vadims SamsinovsI have this piece of code which I know can be improved greatly, but I simply don't know how. I've been googling for a little while, but truth to be told, I'm not really sure what I should be even looking for. Please help me make it more dynamic, make it cleaner!!! Any help is much appreciated. p...

10:11
0
Q: Improving texture managing with smart pointers

MattMattOk, so I have an SDL_Wrapper which is working perfectly (it is not broken)! If anyone could suggest how I could improve performance, and how I could make my unique_ptr(s) dispose automatically, It would be great ! so far, I call my class like this : CWindow window = std::make_unique<CWindowWrap>...

10:28
I'm voting to close this question as off-topic because it's a code review (of a large amount of code, BTW). — John Saunders 42 secs ago
Monking
Best... refactoring... ever... All my unit tests were working, I refactored some logic, and now everything fails!
10:54
I think your Q really belongs to codereview.stackexchange.com ... — Fox 15 secs ago
Exploding bear trap.
To my kind reviewers: Please note that I am not a professional programmer, but that I very much enjoy programming in the course of my research. As a result, no-one ever sees my code and I am very insecure about it. When I first found out about this site I was very excited as it seemed a perfect remedy for my lonely predicament. I have a strong desire to learn to be a good citizen of this community. If I err, as I no doubt will, please try tell me how I can improve as clearly as you can. I will listen. — milos 2 hours ago
My tests are passing again, what a good start of the day
0
Q: Is my hashtable correct?

DerekSI'm working on a simple hashing program for a class and would love if somebody could verify if mine is correct or not. The hash function I'm using is key % tableSize and the rehash function is (key + 3) % tableSize. The table size is 20 and the values being hashed are, in this order: 66, 47, 87, ...

11:13
    self.assertEqual(Decimal(2), calculator.evaluate("6 / 3"))
AssertionError: Decimal('2') != Decimal('0.5')
6 / 3 does not equal 0.5
How does that even happen cuz?
Take a look here...
Reverse Polish notation (RPN) is a mathematical notation in which every operator follows all of its operands, in contrast to Polish notation, which puts the operator in the prefix position. It is also known as postfix notation and is parenthesis-free as long as operator arities are fixed. The description "Polish" refers to the nationality of logician Jan Łukasiewicz, who invented (prefix) Polish notation in the 1920s. The reverse Polish scheme was proposed in 1954 by Burks, Warren, and Wright and was independently reinvented by F. L. Bauer and E. W. Dijkstra in the early 1960s to reduce computer...
At the Posfix Algorithm
At some point you need to pop two values of the stack
If there's a stack with 2, 1, 5 from top to bottom, then they "Pop two values (1, 2) and push result (3)"
How is 1 popped before 2?
Ah ha! Okay. Gotchya now.
I'm confused, because Wikipedia can't be wrong, right, wrong, right?
@skiwi you might be pushing them the wrong way round...
and sure wikipedia cna be wrong...
11:28
That ^ and that ^^
So, in your code, 3 gets pushed last and popped first, when it should be pushed first and popped last.
I'm not sureif I'm right that Wikipedia is wrong though
> Else, Pop the top n values from the stack.
Evaluate the operator, with the values as arguments.
Unless popping "top n" values needs to be interpreted differently?
> "6 3 ÷" in reverse Polish both evaluate to 2, whereas "3 6 ÷" in reverse Polish notation would evaluate to ½).
def test_rpn_division(self):
    calculator = Calculator()
    expected = [
        ValueToken(Decimal(6)),
        ValueToken(Decimal(3)),
        OperatorToken('/')
    ]
    self.assertListEqual(expected, calculator.to_rpn(calculator.tokenize("6 / 3")))
It's as 6 3 / in RPN
That part seems to be correct over here
Oh cool @Duga that's also just a GitHub repository linked into here? That's awesome
But... @rolfl that means you convinced the SE team to add a hook?
It appears so...
Man. This class is killing me. Every time I think I'm going to have some time to work, more material is released.
0
Q: Breakout game using Java 8 & Slick

Calculus5000I’ve written a basic implementation of Breakout using Java 8 & Slick (~400 lines of code). Please let me know of any design/OOP improvements that can be made (any improvements in general are welcome, but I’m specifically looking for design & OOP improvements). Game - the main class package brea...

@skiwi @Duga is polling for updates to the SEDE. There is no hook that has been added.
12:19
@SimonAndréForsberg Ah okay
@JorgeCampos It sounds like this question is asking for help with implementation which makes it off-topic for Code Review. CR is only for code that already works as expected. — Simon André Forsberg 34 secs ago
@Anony-Mousse If you think it should be migrated, then flag it for migration with a custom flag. "Voting to close because it should be migrated" is contra-productive. Also, as I said in my comment above, this question does not seem to belong on Code Review. — Simon André Forsberg 24 secs ago
0
Q: Interval multiplication - faster version

overexchangeFor the below given problem from this assignment: Q4. In passing, Ben also cryptically comments, "By testing the signs of the endpoints of the intervals, it is possible to break mul_interval into nine cases, only one of which requires more than two multiplications." Write a fast multiplicatio...

0
Q: Conways game of life in Haskell

kufiI started with Haskell some months ago, but didn't really use it since then. As a simple training I implemented Conways game of life. What/How could it be improved? module Main where import Control.Monad.State data CellState = Dead | Alive deriving (Eq) data Cell = Cell CellState Int deriving ...

12:34
THis question has been auto-flagged for: More than 20 comments posted in the past 3 days I can see there has been a lot of discussion, and I would like to continue that discussion, but in our chat room instead. Please join us in the 2nd monitor community chat room. — rolfl ♦ 26 secs ago
Monking everyone.
hi
hola señors
hola
Hey there.
what does monking mean?
12:37
It's a local "meme".
let me get a link for it.
thanks
18
A: What's a Zombie? And what are the many other memes of Code Review?

Vogel612Meme: Monking Originator: Morwenn Cultural Height: The 2nd Monitor Background: A morning greeting to the Monkey doing his monkey-business, in other words: monking Examples: A small chat search Variations: Monkernoon, Monkevening, Monknight, ... Important is only that it begins with Monk... ;...

ha
thanks for that
About your question, I am trying to figure out how to tell you nicely that I don't think you will be able to make it on-topic here, and, even if you did, it would still have to be closed. I don't think there is a nice way, so I will just have to explain it carefully instead.
yes please
12:39
and also explain what your alternatives are,.
ok
in particular
how is it possible that a question cannot be made on topic?
S, let me explain why, even if you make it on topic, it will still need to be closed....
not even in principle?
ok
and don't be nice
you're already kind enough
On Code Review, if a quesiton has an answer, then changing the question will likely make the answer wrong. We don't like that, so, in general we do not allow people to change their questions after answers are given
it hasn't changed
and it hasn't been answered
12:41
1
A: Frontmost window of the current application that passes a predicate check

milosThere is a way of improving the code as desired in that it is possible to constrain the type T to T: NSWindow. Upon introducing this change, however, the function will indeed return the first NSWindow in the current ordering, whether or not it is of subtype T (too check this you must construct a ...

The answer ^^^ (whether it answers the question you want it to answer, or not).
sorry didn't get that
Ahh, I just noticed that it is your answer .... that may change things a little bit
please reconsider the entire sage of this wretched question
it has not been considered off topic
until
Martin R wrongly tested the code
later he found that out himself
which is fine
it's just not fine
that my question had to go though all of this
Actually, it was me who closed your question as off topic, and I have different reasons....
oh
12:45
Well, his close vote got your question in to the review queue, and in that queue I saw it, and assesed the question as being offtopic for "code not yet written".
Let me explain that.
it is a working code, you do know that?
it can be copy/pasted into a project as is
On Code Review we have a lot of questions saying: my code works, but it just needs to do one little other thing too....
and it solves a tricky problem
that does not sound like my code works
Some feature that is missing, that the author wants to implement, but is not sure how to implement,
it sounds they need a solution for it to work
my question precisely follows the guidelines
12:47
We consider code to be working not only when it compiles, and runs, but it also has to produce the output in the way the design/specification requires, etc.
i'm not sure how is that relevant
totally works
> What bothers me about the second convenience method is that I cannot constrain it to only protocols. Is this possible to do in Swift?
my code
yes?
That last sentence in your question is what bothers me....
ok?
it is only the last sentence, yes!
that method works rather beautifully
12:49
then before that, you have:
> But it bothers me that with the first of the two convenience methods I'm accepting any T. In other words, it bothers me that type checker won't complain if I write: App.frontmost(Int)
So, your first code does not restrict your inputs the way you want them to.....
are these both a problem?
Yes, because what it boils down ti, is that your question is not looking for a code review.
how?
what it boils down to instead?
your question is looking for an answer abou a specific programming problem you are encountering in Swift.
how to define your parameters to constrain them in a way that you want (but don't yet have)
...
12:51
should it not be specific?
It should be, if this was Stack Overflow, but it is not stack overflow.
Your self answer would even be decent there....
No
this is not a broken code
this is a rather elegant code
that works very well
have you tried it?
@milos Not everything on Stack Overflow is broken code.
0
Q: Calculates Number of Possible Combinations to Make $100 With All US Denominations

aebkeaI know that this could be made much more efficient, I am just not sure as to how. package main; public class Cycle { int penny = 0; int nickle = 0; int dime = 0; int quarter = 0; int halfdollar = 0; int onedollar = 0; int twodollar = 0; int fivedollar = 0; in...

@rolfl Can't try it--he doesn't have OS X.
12:53
but it is working!
I was talking about an implementation detail that
would make the api more robust
this is not a SO question
Stack Overflow's scope also covers things like explaining how or why specific code behaves in a particular manner (explaining code if off-topic on Code Review). These would be questions in which the code in the question falls under "but it is working!"
A detail that your current implementation does not yet have.
let me explain...
if you need access to your main window
in the app that is
Stack Overflow's scope also covers things like "My code is doing A, B, C, D, and E, but I also need it to do F." Note in that question, for points A, B, C, D, and E, the code falls under "but it is working!" But questions asking to extend a code's features are off-topic for Code Review.
no longer active
then this methods would give you that
exactly
no problem
in what sense would this fit SO
you know that my question would immediately flagged as not appropriate
12:55
@milos Because that is not the critical part of your question.
exactly
my desire is for my code to be reviewed
I'm not saying it does or doesn't fit. I'm saying that just because it is working code doesn't mean that it's not fit for SO. I'm also, (more relevant to this discussion) saying, that just because it's working code doesn't mean it's inherently on-topic for Code Review.
so that I can learn from programmers better than me
31 secs ago, by milos
my desire is for my code to be reviewed
^^^^ No it is not
12:57
@milos You say your desire is for the code to be reviewed, yet you have been extraordinarily defensive any time anyone but yourself points out issues with the code.
like?
At least, not according to the definitions we have of reviewed here on Code Review.
@nhgrif - let me deal with one thing at a time.
Okay.
there were no pints about the code itself except the mistake by Martin R
@milos - you have code, it compiles, runs, and even does what you want it to do.
That is great.
That code is ready for review.
I agree.... but....
But even though the code works, it does not work the ay you want it to work because, for example it lets you compile with broken input.
It lets you pass an Int to the method when it should be constrained to a protocol, or whatever
That is code which does not do what you want it to do.
12:59
no
my main method
is working exactly
i was asking if anyone can improve it
the other two methods
are sugar

« first day (722 days earlier)      last day (3594 days later) »