« first day (839 days earlier)      last day (3179 days later) » 

2:00 PM
reviewing code that has been replaced is not technically on-topic
 
@JeroenVannevel with the edit it's definitely broken
 
No, but exists.
 
because the assumption of the first block is, that 2 is a valid divisor for number
which may or may not be the case..
 
@Legato nope. but does ;-)
 
@SimonAndréForsberg So this... is actually kind of the point I was weakly making about it not being ready..
 
2:01 PM
@JeroenVannevel I am not able to try out Swift code, but that edit he made looks suspicious. And the OP isn't even sure the code gives the correct result for the real question. It is the OP's job to convince me that the code works, not the other way around.
 
SUM(1.2.3.4.5) % 2 == 1
 
lol, legendary spelling
 
@Legato eh, I'm shooting for a tag badge on MSE :)
 
I wouldn't say that code which takes 29 minutes instead of 5 seconds is working code. Code Review isn't a bad idea, but it seems that it is a good SO question as well. — John Coleman 43 secs ago
 
8
A: Typo in "Stack Overflow Thanks YOU!" page

Mat's MugClearly it's intentional, status-bydesign. "teh twitters" wouldn't even be correct as "the twitter", as "twitter" itself should be spelled "Twitter" since it's a registered trademark. Feel free to read it like this: Not on Twitter? No problem. Just add #SOReadyToHelp to your "About Me" on y...

 
2:02 PM
@Vogel612 The edit was made by the OP. It might very well still be broken code if someone with domain knowledge says so but that's not the point here. The point here is about the edit by Malachi which is perfectly fine
 
Haha
 
@JeroenVannevel true that, but the edited code is still borken
 
@JeroenVannevel Not really. There's a big problem here though...
 
@Vogel612 In that case I'll retract my reopen vote (I'm relying on your judgement for the broken code aspect).
 
English is my third language but some of these are embarrassing. I thought I finally made my first genuine tag when I made raspberry-pi, but I spelled rasberry. heh
 
2:03 PM
check back with the newly added code...
 
@Duga Finally they get it.
2
 
@Duga O(n^80)
 
int findNumberOfFactors(int number) {
    int numberOfFactors = 0

    if (number != 1) {
        number = number / 2
        numberOfFactors++
    }

    for (int iterator = 1; iterator <= number; iterator++) {
        if (number % iterator == 0) {
            numberOfFactors++
        }
    }

    return numberOfFactors
}
^ that's about the C# equivalent
the first if-statement is definitely broken
 
Why are you making me do math. I just had my last exam ever today
Why do you hate me
 
0
Q: Android Pass Data between fragments

LauraI have a question about passing data using bundle between fragments. I need to pass the URL from a Product object to the next fragment, so I don't know which is the best approach: to pass only the URL or the whole object? What are the reasons of choosing one over another? Bundle bundle = new Bun...

 
2:06 PM
since 13 is not a number that has 2 factors
 
13 has 2
 
but that function says it is, which means that the code is horribly broken
 
1 and 13 <-- 2 factors
 
soz. the function still reports 3
 
The program says 13 has 3 factors?
 
2:07 PM
because the first if goes through and suddenly number is 6 (thanks integer truncation)
 
That's the first if mething arround with the code
 
And here I thought 13 was prime...
 
@Mast which means it has 2 factors..
 
@Mast Me too
 
so, it's a bad edit, why has no one rolled it back yet?
 
2:08 PM
@Vogel612 I know, and not 3.
 
I usually disregard 1, because it's not a prime-factor
@Malachi because we're discussing
 
Actually, I'm discussing math
 
@Malachi I'm not sure which revision to roll back to
rev 1 might even work, given enough time
 
I usually reject code edits flat out. The code posted by the OP is the OP's intent. Changing the code is obviously against intent.
Unless it's just formatting of-course...
 
revision 1 would go against the OPoster's intent
 
2:10 PM
then again rev. 2 introduces broken code.
 
@Mast If the OP updates his post with new code, then that is his intent
 
@Vogel612 but is what the OPoster wants reviewed
 
@JeroenVannevel Those don't go through the queue...
 
If that new code is broken, then that's on OP
 
@Malachi then it stays like that and is closed
 
2:11 PM
I'm not talking about the queue, I'm talking about the actual post in its entirety
 
@Mast That changes the reviews' results. Changing code, even if it is a single line, is a huge no-no to me
 
@nhgrif how does this let thingy work anyway?
 
the latest revision is mathematically broken
 
After the edit, this code is broken. findNumberOfFactors(number: Int) doesn't return the right result. This question is not ready to be reopened. — nhgrif 29 secs ago
 
func findNumberOfFactors( number:Int ) -> Int {
    var numberOfFactors = 0

    if number != 1 {

        let number = number / 2
        numberOfFactors++
    }
    ...
 
2:11 PM
@SimonAndréForsberg It's declaring a variable. Scoped within the if.
 
So suddenly there's two separate number variables?
 
He's double-counting 2.
 
then the code is broken differently to how I thougt it was.
TIL
 
If it compiles, the let declaration hides the outer one.
 
the question is obviously a work-in-progress. leave closed, and walk away. no?
 
2:12 PM
What does the code actually return for 13 ?
@nhgrif yeah, I'm starting to wonder if it compiles.
 
@Mat'sMug Exactly this. That was my whole concern when he's still having to make such drastic edits after posting.
 
@SimonAndréForsberg 5, if @Vogel612's C# equivalent is correct
 
@SimonAndréForsberg should be 3 with what nh says
 
C# != Swift
 
@JeroenVannevel is isn't
 
2:13 PM
@SimonAndréForsberg for some values of "Swift" ;-)
 
@Vogel612 you tricked me!
 
Also, 2 isn't a factor of odd numbers, is it?
 
I'd like to know what the actual Swift code results in, just to learn Swift better. I know C# already
 
I figure it's 3 then
1, 2, 13
 
@nhgrif No odd number has 2 as a factor, no.
 
2:14 PM
since the let doesn't override the passed in number, it's 13 after the block
 
that's what I wanted to see ^^
 
@SimonAndréForsberg exactly
13 has zero factors, right?
 
2
1 and 13
 
^ That
Every prime has 2 factors
 
2:17 PM
1 and 0 aren't primes
 
@nhgrif code that finds 3 factors for a prime, is broken code. that should end it.
 
interestingly the code may produce a correct final result for the challenge
 
@Vogel612 oh boy
 
Well, the real point is...
It's not ready for review.
 
in a horribly broken and dumb way, but... it may
 
2:19 PM
As you stated earlier, it's still a work in progress.
 
@Vogel612 The O.P. may be ready to subtract 1?
 
@nhgrif agreed
 
@IsmaelMiguel if the first triangle number with more than 500 factors is even, then the code may produce the correct result
 
@Vogel612 That's a very specific "environment"
 
@nhgrif Stuff to the right is commenty?
 
2:21 PM
true, but it's the scope of the code
 
no idea
 
Hey I just heard on my favorite online radio DI.FM that they looking for devs; any of you guys interested: di.fm/jobs
(Monking!)
 
0
Q: Project Euler #8 code implementation

aizenPlease review this code of mine... I know this has been asked been before but i just want to know how to improve this code. public class Java { public static void main(String[] args) { String temp = "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801...

 
@CaptainObvious Is that giant string needed?
 
yes
 
2:27 PM
@Phrancis That moment when you read the requirements and you know you don't fulfull any
@Vogel612 But it must be that huge?
 
@IsmaelMiguel complain at Project Euler, will ya?
 
@CaptainObvious The best solution is throwing it all away and start over.
It's so fast, he counts in it ns:
yes... the code perfectly works... and runtime is around 925323ns. — aizen 1 min ago
No sense of reality.
 
@Mast it ain't half bad, actually
 
@Vogel612 Nah, that's not a bad speed at all.
 
~cough
 
2:30 PM
that's like, 0.9 seconds, no?
 
Why he measures in ns though, that's another story.
Yeah, about 0.925ms.
 
@Mat'sMug 1ms...
 
isn't nano 1/1M?
 
1e-9
 
10^-9
 
2:32 PM
so, wtf is wrong with code that completes in < 1ms?
 
@Mat'sMug That wasn't the point.
It's about precision.
 
someone VTC'd it so it must be really bad
 
who the heck VTC'd it anyways??
 
"Code is too fast, must VTC."
 
but how is it broken?
 
2:33 PM
@Vogel612 I'm not complaining. I'm asking.
 
0
Q: Use header application/x-download

SergynyoZend framework 1. Physically, the file does not exist, it is created based on database. Okay so use header? public function downloadAction() { $id = $this->getRequest()->getParam("id"); $optin = new Application_Model_Optin(); //$data = $optin->getCodesFromDownload($id); $data = ...

 
@IsmaelMiguel 'cuz shit programmers will write shitty code then.. also it makes it hard to do cool number processing with a 1k digit number
 
I'm slowly sneaking up on 4,000. I might actually get there before the new rep limits go into effect.
 
@Mat'sMug it's not. not at all. We seem to have a broken user somewhere though...
 
@Vogel612 You can split the number into pieces and join it all together instead of having a giant line
 
2:35 PM
@Donald.McLean With this speed, I might even hit 4k before the new rep limits go into effect.
 
> [Mod] > [timeline] > 8 minutes ago
 
in the famous words of shaggy, "wasn't me"
 
@Mast Stuff to the right is generated by Xcode.
 
@nhgrif Auto-comments by Xcode? Or what's it's purpose?
 
That's from the playground. It shows you the result of executing the code.
 
2:40 PM
@nhgrif So more like debug info?
Neat feature, like an auto-breakpoint-watch
 
@Donald.McLean Same goal, though I'm tempted to post a bunch of bounties all the time.
 
It's not really debug information exactly...
 
if anyone wondered what the [Mod] menu looked like..
user image
5
 
This stuff updates every time you change anything. There's not a run button, nor are there any break points.
It's a playground.
 
2:47 PM
That clears things up, thanks.
 
Does anyone have a Java environment setup with the ability to test something for this quesiton for me?
 
@Mat'sMug lol. convert to hamburger?
 
+1 purely for those captions... — ArtOfCode 22 mins ago
 
@EBrown ideone doesn't cut it?
 
I can @EBrown
What is the something?
 
2:49 PM
@Legato Some code I'm writing for an answer to it.
 
0
Q: C# Async tasks in infinite loop

PlageManI am new with async task in C# and feel insecure about this: I want to create a Windows Service that listen messages from a network (similar to msmq for example), when a message is received, do stuff not CPU bound (call webservices and rest API) without blocking other messages. I created this c...

 
@Mat'sMug Is it the same in countries where they don't eat hamburger?
 
@Mast Didn't even know that was a thing until now.
 
@EBrown compiles fine, output is max : 23514624000
runtime is really damn low
 
@Vogel612 Code I was writing, not his. :P
 
2:50 PM
ohhhh
you don't have a jdk installed?
 
Nope.
Not a Java developer.
 
Heh, I was already but yeah ideone should be fine.
Unless you have some specific parts you'd want to double-check before using it in answer.
 
@SimonAndréForsberg Where are links to the O(n) images?
 
@EBrown \$O(n)\$
it's MathJax
 
That works as well.
 
2:59 PM
I'm voting to close this question as off-topic because it is asking for a code review. Consider instead asking on Code Review. — cdhowie 22 secs ago
 
0
A: Project Euler #8 code implementation

EBrownThe first thing you should do is clean your code up. We should notice that temp.charAt(k)-48 is called no less than once, and no more than twice in the for (int k...) loop. We can fix that (quite easily). Next, we should notice that if we find a 0 in our second loop, we can skip that many numb...

 
if (numbersLoaded == 13) {
     runningProduct /= temp.charAt(i - 13) - 48;
}
^ that's dangerous, you know?
 
@cdhowie This question seems to be stub code, example code or pseudo-code, which is off-topic on Code Review. Code Review is meant for real working code. — Ismael Miguel just now
 
I know it works just fine because you're doing it right in the outer if, but....
 
@Vogel612 Please clarify.
 
3:03 PM
division by zero can happen if taken out of the context of previous code
 
Yeah, but it's in context for a reason. :)
Though, I'll make that point.
 
@Duga Great, someone upvoted that... Stub-code question incoming!
 
@EBrown www.ideone.com
 
@SimonAndréForsberg Yeah, already found it. :)
 
@Vogel612 A little division by zero has never hurt anyone, has it?
3
 
3:05 PM
@SimonAndréForsberg you'd be surprised how many of those I needed to fix in the last half year
3
 
@cdhowie I'm afraid Ismael is correct. Please read A Guide to Code Review for Stack Overflow usersSimon André Forsberg 24 secs ago
 
I added clarification of that line.
 
splendid, would upvote again
 
Heh :)
 
yay MathJax!
 
3:08 PM
Also, I'm not mistaken on the calculation of the Big-O's there, am I?
 
Looks right to me
I haven't tested your code though, but I assume you have that.
 
It compiled and ran in ideone.
I like how he accepts then un-accepts my answer...lol
 
Just a quick question.... is it a good idea to have a (java) class named Out with static methods starting with put? I think it would make it easier to read: Out.put("Hello!");
 
@ambigram_maker I'd maybe call it Logger.info or something, or use a real Logging-framework (such as Log4j), but sure, if you prefer that, do that.
And what's an @ambigram by the way?
 
@SimonAndréForsberg Here you go (ambigram: en.wikipedia.org/wiki/Ambigram)
Also, see my profile for another ambigram
 
3:14 PM
Hello... I have a question...
Little question.
Is there any public API of zip codes of the world?
 
@PaulVargas I don't think anyone of us here knows about one at least.
 
@SimonAndréForsberg Humm... OK.
 
@ambigram_maker But why? If you really wanted you could create a method just called print and have it call System.out.print.
 
@SimonAndréForsberg @Legato I am trying to learn more about creating a foolproof library. Thats why...
 
@SimonAndréForsberg By the way, where are you from? Are you a Java programmer?
 
3:19 PM
@PaulVargas See my profile on Code Review and you will have your answers.
 
You're probably going to need to overload that method a lot, or make it very generic.
 
I was inspired by the stlib from here: introcs.cs.princeton.edu/java/stdlib
(to make a library)
 
Nah, he only got the Java gold tag badge out of luck ;p
2
 
@Mat'sMug Always knew corn-flakes boxes were good for something.
 
Now I need to grab another part of this project and post a new question on it.
Need to surpass 2000 rep today...only 13 away...
 
3:22 PM
Easy.
 
@Legato Hah!
 
@EBrown nice! Welcome to edit at will moderator tools!
 
Thanks, Santa!
 
@Mat'sMug mod tools is at 2k? Holy crap that was a long time ago.
 
IKR
 
3:23 PM
How's this answer? Wanted to get it reviewed myself when I wrote it.
2
A: Print array of sentences vertically

LegatoUse if statements rather than try/catch Your method is understandable, you shouldn't use try catch, instead simply check that the index does not exceed the length. e.g. if (col < matrix.get(row).size()) { // print what you want } else { // print just a space } Better Regex Rather than...

 
@Malachi No idea, I just got a notification.
 
Now I just have to post this Entity/Actor/Player question.
 
Sounds fun, hm.
 
@Hosch250 is it still working?
 
Don't know.
 
3:25 PM
nobody do any reviews. let @Hosch250 do them for a while. :)
 
LOL, I don't need that...
 
Review all the things!
You've got this.
 
So, since it's my birthday I get to renew my license and registration for my car. Better yet, it's in the repair shop because I got rear-ended two weeks ago! What fun.
 
The struggle.
 
Yep.
Have to make a payment on it too.
 
3:29 PM
You're looking for CodeReview if you want to have people evaluate your working code — MaxTheG 53 secs ago
 
Happy birthday, @EBrown.
Don't focus on the gloomy part :)
 
@Hosch250 Thank you. :)
Yeah, I'm just irritated because insurance originally said it would be done today (two weeks ago) then called me Wednesday to say it won't be until next week.
(I've got pictures if anyone wants to see what happens when someone who is texting-and-driving hits you.)
 
Your question is better for CodeReview. — AlG 51 secs ago
 
@EBrown If you don't mind sharing
(Remember to blur out the license plate)
 
@EBrown How did it happen? At a red light, or just "random"?
Happy birthday aswell :)
 
3:36 PM
@skiwi I was moving to the left-hand turn lane, and the guy behind me was texting and never saw me slow down. (It was coming up too a red-light, as well. Which means had I not been there he would have hit whoever was in front of me instead.)
@skiwi Thank you. :)
@IsmaelMiguel Damnit, I was just going to link to one of the Facebook photos...>.>
 
@EBrown Ugh, that sucks
And then you look in your rear view mirror and are like oh crap
 
I never even saw him until he hit me.
He was flying down the road.
 
@EBrown Ahh... yeah, I see
 
Insurance originally estimated damage at $6200, then upped it to $7200 Wednesday.
 
That's more than just a damaged bumper then
 
3:39 PM
Oh yeah.
 
@skiwi What do you expect when you get hit by an airplane?
 
Isn't text-and-drive illegal?
Happy birthday @EBrown!
 
are you getting notifications @Hosch250?
 
Where's this photo?
 
Well, I got one yesterday.
 
3:42 PM
Won't let me upload it, need to downsize it.
 
@Hosch250 there was a review in the queue
 
I found it.
But, I'd forgot to go to the page after another review.
 
@EBrown It's always a good thing to blur such informations.
 
I have mine set to 15 second reloads. I think I defaulted it 30 seconds....I should make sure I set it back after testing....
 
@Mat'sMug Should be, isn't everywhere.
@Mat'sMug Thanks Mat! :)
 
3:44 PM
@EBrown were you stomping the brakes when you were hit?
 
1
Q: Chess in Python. Assessment

RafailI have programmed for 2 months, and I began writing chess. I am a beginner programmer in Python, so I would be grateful if you assess my code which is below. (Classes and definitions are in the same indentation because it is easy way to copy code to Stack Overflow, I am sorry for this holdback.) ...

 
@Donald.McLean Thanks a lot!
 
@Mat'sMug Nope.
 
his car is probably totalled
 
@EBrown That looks pretty bad :/
 
3:47 PM
whoa bummer
 
Did you rear window survive? Or already replaced?
 
Happy Birthday, @EBrown
 
It looks like it opened its mouth and is showing a bunch of teeth.
 
@Hosch250 there is another in the review queue
 
@EBrown It looks.... nice.... That hit probably hurted a lot!
 
3:49 PM
@Malachi I'd forgot to go back to the page again!
Close him.
I'm on the review page now.
 
Happy birthday @EBrown
 
@Malachi Thank you! :)
@Heslacher Thank you as well. :)
@Mat'sMug His front end was destroyed.
They had to tow his car, mine still drove.
 
@EBrown Your car is missing a few pieces.
 
@skiwi That window survived, but one of the rear-corner windows did not.
@Mast You should see the pictures insurance took.
 
But it looks like you can drive it home indeed.
 
3:51 PM
@EBrown So his client-side was messed up, but your server-side was?
 
I did, when I had the car.
It's been in the shot two weeks.
@Hosch250 Yeah.
@IsmaelMiguel I was actually unharmed, physically.
 
-1
Q: System.ExecutionEngineException C#

user5210505I am a beginner of C#/Selenium/Specflow. I am getting System.ExecutionEngineException when public void ClickMyAccountLink is executed. I cannot figure out what causes this issue from my code. Your feedback and advice are much appreciated. Here is my code. [Given(@"I click SignIn link in H...

 
@EBrown But still, you probably felt the impact. Right?
 
@IsmaelMiguel A little.
He actually hit my car so hard that the owners manual flew out of the glove box and landed in the passenger seat.
 
@CaptainObvious Burn.
 
3:53 PM
Though I only felt a little jolt on me.
 
Weird... And the other guy's car?
How was it?
 
Decimated. He had no more front end.
 
3 mins ago, by EBrown
They had to tow his car, mine still drove.
 
His focus looked like a Fiesta after he hit me. ;)
 
3:54 PM
The back-end of a car is kinda sturdy.
 
I don't get the joke
 
The Focus is a bigger car.
The Fiesta is a compact.
 
Oh, now I get it
 
Do you have Nissan's in Portugal? If so, think Sentra -> Versa.
 
@EBrown Yes, we have. But I don't understand much about cars
 
3:57 PM
The size is the important part.
It flattened his front-end when he hit me.
 
@EBrown Are those crosses marking the damage? Because, well, you know... It's hard to miss it...
 
Lol. Am I in the right chatroom?
 
@RubberDuck Maybe. Looking for awesomeness? Then yes
 
Maybe a room owner can move this to the Nth monitor. No offense guys.
How is everyone today btw?
 
I managed to implement my sorter_traits and an hybrid_sorter. Now I have to write the documentation...
 
3:59 PM
@RubberDuck No offense, but that's Nth monitor material as well.
 
@RubberDuck Just doing paperwork. All sorts of joy.
 

« first day (839 days earlier)      last day (3179 days later) »