« first day (702 days earlier)      last day (3308 days later) » 

5:05 PM
@CaptainObvious Yummmm... Bacon...
3
 
@sᴉɔuɐɹɥԀ If you mix Bacon with Javascript, is it still good then?
 
0
Q: Calculator in Ruby

KslkghI have created a calculator in Ruby. I am using Ruby 2.1.0. I'm fairly sure that someone will be able to improve this, as I am quite new to Ruby. puts "Welcome to Calc" puts "" puts "Please enter the first number" n1 = gets.to_i() puts "" puts "Please enter the second number" n2 = gets.to_i() ...

 
^^ can we tag this as monthly-challenge?
 
@Vogel612 Why?
 
@Vogel612 Not been chosen as the challenge yet.
 
5:15 PM
I'd say 12 / 6 votes should be okay
 
> At the end-of-day on Thursday, April 9th, the most-voted post will become the next community-challenge.
 
hmm... okay then wait another three days ;)
 
@skiwi Well... Bacon makes basically everything better. Maybe even JavaScript...?
2
 
only if it's real bacon
2
 
questions like this are a better fit on codereview.stackexchange.comcharlietfl 1 min ago
This may be a good fit for Code Review, however you would want to word the title and question to explain what your code does, rather than what you would like reviewed. — Phrancis 41 secs ago
 
5:21 PM
Ohhhhh my first Programmers checky!
 
Wow, just saw a -21 accepted answer on workplace.SE. I think that's the lowest-scored answer I've seen anywhere.
 
He has a bunch of those
Sometimes what he says makes sense. Sometimes it's like a different persion
 
@JeroenVannevel Persion?
 
0
Q: Proper JS MVC / Extending; comments please

Cool ShapeI am looking for some critique / comments / help regarding what I have written so far. Is this proper JS(JQuery)? This is my first crack at a MVC and Extending style setup. There are some standard HTML DIVs (panels) and some styling via CSS (LESS). Panels can be clicked and then move up and dow...

 
JS1
5:37 PM
@SimonAndréForsberg I wrote up an answer for that question.
 
-2
Q: Time Limit Exceeded

nishantFind the sum of product of all numbers in first array with all the numbers in second array. Input Format 1st line contains 2 space separated integers N and M. 2nd line contains N space separated integers Ai. 3rd line contains M space separated integers Bi. Output Format 1 single line conta...

0
Q: Very tricky issue in map-reduce program. (Multi threads, bounded buffers, condition variables)

user4751640Following program works only sometimes unfortunately. I couldn't figure out what causes this problem. I've been staring the code for hours... What would be the cause of this problem? How can I fix it? What am I doing wrong? Any help is appreciated! In the program there are N mappers, R reducers...

 
6:08 PM
0
Q: Creating multiple arrays in PHP

SMWI have a PHP application that generates multiple graphs based on SQL output. I usually use something like the below code to build up arrays ready to be used within the graphs: <?php include("database.php"); $sth = $dbh->prepare("SELECT c1, c2, c3 FROM t1"); $sth->execute(); wh...

 
not suitable for this site, better codereview.stackexchange.comvsoftco 39 secs ago
 
@Duga Couldn't get to it in time... bad question incoming @CaptainObvious...
 
0
Q: Class constructors

NewToThisThis is my first time writing classes and implementing them. The class FileDir will 1) Store file information or directory information (name, size and whether it's a file or directory) 2) Contain public functions to manipulate the files and directories Looking for suggestions for improvement....

0
Q: Calculator that parses S-expressions

Marius MacijauskasThis is my first program I can call 'something'. I would be glad to hear what you think of it, so I wouldn't pick up bad habits further on. It catches errors, but requires numbers to be separated from operators. It ignores a lot of characters, therefor (+ 2 2) is as valid as (+ 2 blargh 2) 100 ...

1
Q: Making a database-module for node.js; can I make it prettier?

MobilpaddeThis will get quite clumsy if I continue down the road with this design, so I'm asking you, enlightened ones, is there a way to make this in a prettier way? Primarily the run-function (Especially in the else if where self.query and self.find are set), also, I want it to be chain-able, with .run b...

 
6:26 PM
@CaptainObvious enlightened ones...? That's pretty funny.
 
7:00 PM
Any android developer here by chance? :D
 
@DJanssens Will Windows Phone work?
JK, I'm not sure.
I've seen a few Android questions, but it seems most Android programmers don't care about writing good code.
 
@Hosch250 I appreciate it ;) But its quite specific. I've been sturggling the past hours with some theme settings. Following online tutorials doesn't seem to result well.
 
lol... I don't think that's limited to Android @Hosch250.
 
@RubberDuck Unfortunately not.
 
7:06 PM
What is spaghetti code anyway?
Something that I don't write (or do I)?
 
Technically, it's code that has far too many and too confusing execution paths. Made popular by the overuse/abuse of GoTo.
 
Oh.
 
Spaghetti code is a pejorative term for source code that has a complex and tangled control structure, especially one using many GOTO statements, exceptions, threads, or other "unstructured" branching constructs. It is named such because program flow is conceptually like a bowl of spaghetti, i.e. twisted and tangled. Spaghetti code can be caused by several factors, such as continuous modifications by several people over a long life cycle. Structured programming greatly decreases the incidence of spaghetti code. == History == It is not clear when the term spaghetti code came into common usa...
 
IMO methods containing multiple return statements is also a sign of bad code practice, but that might just be me.
 
@DJanssens I do that somewhat.
What I do is put a bunch of error-checking at the top of the method, if error-checking is needed, and return/throw whatever I need to return or throw.
Or, sometimes I will have a few different things that should be returned depending on a value, and a default at the bottom.
 
7:14 PM
No
 
@DJanssens That's not a bad practice at all
 
@skiwi first time I actually looked in to that
seems indeed not really a bad practice
some are in favor, some aren't. But the majority seems to be ok with it
 
7:30 PM
@DJanssens if you do it wrong then multiple return statements can be an indicator you are doing it wrong
but mostly they really aren't bad practice
 
I think that "smell" stems from a time long ago when GoTos were the norm.
The "one entry, one exit" thing..
 
meh. it's an indicator that your method has too many responsibilities
but again: if you're already doing it wrong..
nothing speaking against early returns on guard conditions and the like
 
idk... how else would you do this?
    if (foo)
    {
         return "baz";
    }

    return "quack";
 
0
Q: Regex in combination with file compare

Albert RoosI have made a funtion to compare text files line by line, where timestamps and jobnumbers are replaced for a identical string. By lack of experience I'm not sure if this is the best way to do this. if (row < comparedFile.Count) { var regexJobNumber = @"([0...

 
@RubberDuck that's a state-machine...
return foo ? "baz" : "quack";
but it's different if there's an additional statement in there
 
7:34 PM
@Vogel612 true, but that's a really simple case...
That ^^
 
if (!foo) {
    getFooRight();
    return "baz";
}
return "quux";
 
@RubberDuck keeping state indeed and returning the state at the very end. But I do get your point.
 
I hate a forced single point of return in a method
 
on the other hand, spaghetti code often comes with multiple return statements
 
If I read a method, I want to see its logic flow
Part of that are return statements
 
7:37 PM
so what do you think of stuff like:
 
I don't want to reach the end of an execution branch only to notice the return statement at the bottom of the method
It indicates there is still code left to apply when there isn't
 
if (!prerequisite) {
    return null;
}
// processing stuff of doom
return result;
 
> 1995 - At a neighborhood Italian restaurant Rasmus Lerdorf realizes that his plate of spaghetti is an excellent model for understanding the World Wide Web and that web applications should mimic their medium. On the back of his napkin he designs Programmable Hyperlinked Pasta (PHP). PHP documentation remains on that napkin to this day.
2
 
@JeroenVannevel agreed. I don't like forcing it in languages that have return.
 
@sᴉɔuɐɹɥԀ at least give proper attribution, will ya?
 
7:38 PM
@Vogel612 ^^ There you go :p
 
good boy ;)
 
0
Q: Huffman code generator in Haskell

sshimport Data.List data Tree a = Leaf a Int | Internal (Tree a) (Tree a) Int instance (Eq a) => Eq (Tree a) where (Leaf a ac) == (Leaf b bc) = (a == b) && (ac == bc) (Internal a1 a2 ac) == (Internal b1 b2 bc) = (a1 == b1) && (a2 == b2) && (ac == bc) _ == _ = False instance (Eq a) =>...

 
7:54 PM
Why would that ruin it? Not everyone knows C#. Besides, past suggestions have been written hundreds of times before. It wouldn't be hard to find a repo in your language of choice to draw inspiration from. — cimmanon 8 mins ago
 
> The Stack Overflow 2015 community moderator election is underway — nominations now being accepted.
 
> Nominations close in 7 days.
 
Awwww I got excited for a second.
Patiently waiting for ours
So, we can elect the ones we already have...
 
@RubberDuck Good save
 
=;)-
 
8:10 PM
For the record, 2 things:
1. our elections could be a long way away, and our current moderators could be 'weary', who knows
2. I will personally be very strongly suggesting to the CM's that CR has 4, perhaps 5 mods. We are a site which would be in the ballpark of needing that number.
I will personally be disappointed if there's no new blood in the CR moderators.
 
@rolfl Want me to run?
Just kidding, I still Skip in the queues way to often.
 
I want as many people to run as whomever feels they can do a good job.
 
It's not the elections I'm looking forward to so much, but what it means really.
 
Perhaps this will help you a bit. codereview.stackexchange.com/a/85380/64179Vahx 24 secs ago
 
I certainly don't want people to think that the current moderators are not worth running against ...
 
8:13 PM
@rolfl Do you still want to be a moderator?
 
No. You're right. We could use some new blood, but you guys do an awesome job.
 
@SirPython That's complicated to answer.
I don't always want to be a moderator, but, on the whole, yes.
 
What is Roslyn?
 
I don't think anyone real ever always wants to be @rolfl.
 
Apparently, we need to wish it a happy birthday.
 
8:15 PM
Noone wants to be @Rolfl, even me ... ;-)
2
 
You're right. I'd rather be a duck anyday.
2
 
@SirPython - moderating here's one of the best sites to moderate, as far as I can see (based on communicating with other mods on other sites).
The truth is that it is a responsibility, as well as a privilege, and that responsibility sometimes takes away the fun that I was having before.
 
@rolfl I also think we could benefit from having 4 or 5 mods.
 
I am fully confidient that there's a dozen people I can list that would be great mods.
(I won't list them though).
There is no need for me to be one of them.
("need" in the strict sense).
 
I could list a few, too.
 
8:18 PM
I think we would all understand if any of you chose to step down. It is a big responsibility and you've all done your time (and done it well).
 
The site would be more than fine if I were to 'step down'.
 
I could also list a bunch
 
0
Q: Editing calculator program in JavaScript, adding Pi, Sqrt, MS, MR, MC

Yoru-TTo the Following code Below I was suppose to.... a. Add a "pi" button to the calculator for inputting the JavaScript built-in mathematical constant π. b. Add an "sqrt" button to the calculator for directly calculating the square root of the current input. c. Add an "MS" button, an "MR" button,...

 
@RubberDuck If there's one mod I definitely don't want stepping down, it's the monkey!
 
Funny, I think Jamal and 200 are the pillars ;-)
 
8:19 PM
Nobody said we wanted any of them to step down @SimonAndréForsberg, just that we would understand.
@rolfl You all compliment each other well. You all seem to tackle different aspects of the site's moderation.
 
sure I would understand. Heck, we all got a life, don't we? Or... some kind of life at least.
 
That's the theory ^^^^
 
Even if that life consists of getting off work and writing more code.... lol
2
 
Anyway, If an election were to happen in the next few months, yeah, I would most likely run.
If for no other reason than I think there should be some consistency.
on the other hand, things change
 
I won't know for sure if I'm going to run or not until the nominations begin, probably.
 
8:23 PM
What I am really saying, though, is that if people have ideas of being in a strong position for an election, I believe there will be spaces regardless.
 
Perhaps I should nominate @Duga?
 
ALL POWER TO THE BOTS!
5
 
@SimonAndréForsberg I'd vote for you, but I don't know about @Duga. =;)-
 
@RubberDuck I would also vote for @Simon!
 
1
Q: Rescind close vote

dotancohenI put an incorrect close-as-dupe vote on this question, which is preventing the OP from offering a bounty. How might I remove this vote to allow the bounty to be placed? I've checked in the flag menu (the same menu used to close vote) but I see no option there or elsewhere to rescind.

 
8:26 PM
@Duga I'd flag you!
 
Great answer: 100 gunmen in a circle kill next person http://codereview.stackexchange.com/a/86043?atw=1 #python
What the hell, CR? We're supposed to look good to the outside world
2
 
@JeroenVannevel That answer is incredibly good!
 
@SimonAndréForsberg @Duga doesn't have enough Rep to run for Moderator
 
@Lyle'sMug - have you seen how many elections just started?
 
@rolfl no I haven't, ironically I have been trying to work, but not getting far....lol
 
8:38 PM
As far as I can tell, at least 4 elections just started.
 
which sites? I don't really pay attention to much outside of CodeReview on a regular basis, otherwise I will have too many mice on the wheel.
wasn't the 100 gunman problem done on Code Review before?
I actually have been answering questions on SO as well today....
 
- [RPG](http://rpg.stackexchange.com/election?cb=1)
- [SO](http://stackoverflow.com/election/6)
- GD - I thought, but was wrong.
Hmm, I thought there was a 4th, and my inside info on gamedev seems wrong.
 
like this simple answer --> stackoverflow.com/a/29478404/1214743
there is a candidate scoring system now! I like that.
 
0
Q: Dealing with input and output in Matlab

HBeelI just wrote a program which performed some elementary set operations as you can see below. It's the first time I have used input and output of text files so I am mainly looking for critique on that, and also how I use cells. clear all; clc; fileID = fopen('inputseto.txt','r'); data = textscan(...

 
8:58 PM
I should've known it wouldn't be simple to use sudo at school (I was trying to install valgrind). When I got the particular permission denied message, I almost pissed myself.
 
The trick is to use sudo sudo <cmd> instead
That way you override the system
#TheMoreYouLearn
 
@JeroenVannevel What do you mean by "override the system"?
 
NotSureIfSeriousOrTakingThePiss
 
I did sudo yum install valgrind.
 
0
Q: Functions using Pointers

Olivio Mishaka Di MaslinariI am new to c++ and programming in general. So please explain as "for dummies". to the question: Write a function that takes a pointer to int named pi, and verifies if the value pointed to by pi is odd or even, and displays a message saying which one it is. I have #include <iostream> using n...

 
9:01 PM
I at least checked what, which stated that valgrind wasn't already installed.
 
@Jamal - if you do not have root access, it's often possible to install packages in a sub-folder you do have permissions to.
It often requires some hackery, but, are you sure you need it, and that it's not installed?
 
I didn't try for root access, but I imagine I don't have it. No, I don't really need it here, but I thought I could finish all my assignment testing here.
 
DefinitelyTakingSomePiss
 
0
Q: Reducing complexity in custom view's event handling code which mimics how Finder.app selects multiple icons

boyfarrellMy Cocoa event code always tends to descend into madness, I need to advice on how to reduce complexity. I've spend a few hours putting this example together. CanvasView is a layer hosting subclass of NSView which uses Cocoa's eventing handling (-mouseDown:, -mouseDragged:, -mouseUp:) to enable c...

-1
Q: This will create a fully dynamic stack application. I know there is something wrong. I can't find it

codeStack.c: #include "stack.h" int current = MAX; struct stack_struct { ElemType *items; int height; }; SPointer stk_create(){ SPointer s = malloc(sizeof(struct stack_struct)); s->items = malloc(sizeof(ElemType) * MAX); s->height = -1; // stack initially empty retur...

 
Hmm, election posts don't one-box.
Quite a few good-looking candidates so far!
 
9:20 PM
Perhaps the best place to as is in Code ReviewMauro Baraldi 1 min ago
If the code works as intended and you'd like a review of your code, yes this would be a good question for Code Review. You are welcome to post your question there, if you do so it is best to delete this one so we don't have duplicates. — Phrancis 32 secs ago
 
9:34 PM
@rolfl I don't see any of the current mods on SO re-nominating themselves yet; is that a coincidence or is it not allowed?
 
Once elected, you are in until you step down voluntarily,.
you don't stand again from year to year. You keep your position
As a result, no mod would ever have to run again (unless they took a break).
 
Ohhh, ok. So these are 3 new mod positions?
 
Only on beta-to-grad elections do the pro-tems have to run again.
Yes, three new positions.
as far as I know, no SO mods are leaving, so they are aiming for 20 mods in total.
 
Good, nice to see SO is expanding then! I'm sure it's quite a daunting task to moderate such a big site.
 
Given that Code Review has 3, 20 doesn't seem nearly enough for Stack Overflow.
2
 
9:37 PM
OK, word on the street is that at least 2 of the 3 are replaceements.
Two of the previous mods have become full-time employees
 
@rolfl What? I thought new moderators were elected each year?
 
On SO, there's often elections each year.
but, that is only because there is a need to either add, or replace moderators.
Few sites have elections every year.
 
@SimonAndréForsberg Do you have a blog with an RSS feed? Or does anyone else have a programming related blog with RSS feed?
 
@nhgrif nope, I don't.
 
9:51 PM
wow. three years between elections
are there at any point elections for just one moderator? Or is there a lowest required amount before elections are held?
 
There have been occasions where a moderator becomes unavailable shoirtly after an election, and people have been 'called up'.
^^^ see that for example.
 
Why are there nominations versus people just volunteering to run?
 
You can nominate someone else.
They then need to accept.
 
Interesting question (and answers) on PPCG:
15
A: Programming Languages Through The Years

Scimonster2013 - Snap! Snap! is a language based on Scratch, made at Berkeley University. It is an upgrade to Scratch featuring first-class data and custom blocks (functions). Like Scratch, it is not text based, but rather done by visual "blocks" that snap together. Snap!, written in JavaScript, is the s...

 
10:08 PM
0
Q: how to make ellipse move so that it covers each and every square in the grid and detects a orange square?

robo1I am working on a project in which I have robots that move in a grid system and detect fire. For that I have to travel each and every square in the grid till it finds fire(that is orange color square). How can I do that?This part of the code works perfectly but I am not able to traverse each and ...

 
So yeah
About those IDE tags...
... can we get rid of them yet?
That question is off-topic and a good example of why IDE tags need to go.
 
@Phrancis, would there be a way of moving it there without deleting? — Tochi Obudulu 16 mins ago
^^ OP has already received and accepted an answer... Would someone respond to them? Not really sure what to do...
 
Is the existing answer a good answer for Code Review?
 
It would be an okay CR answer
Not particularly good though.
Gotta go for a bit
 
26
Q: How can I tell the difference between a rabbit and a cat?

Chef_CodeI received a shipment of prefabricated skinned rabbit last week and the shipment seemed unusual, rabbits have a very close resemblance to a cat once there "hair" and skin has been removed. Is there a telltale sign that I working with a Bugs Bunny and not Sylvester? I have a suspicion that Elmer...

 
10:23 PM
0
Q: Swapping multiple variables

Olivio Mishaka Di MaslinariI am trying to write a function which swaps 3 variables as follow: z=x; x=y; y=z; what I get is: void swap(int& x,int& y,int& z) { int az=z; z=x; x=az; int ti=y; y=x; x=ti; int toi=y; y=z; z=toi; } however it does not work properly. I can see that there is a problem with the function swap...

 
10:50 PM
@nhgrif I agree that they're abused, but what about questions about plug-ins?
I'd also like to see the .Net tag go... It's useless.
 
Gut says .NET isn't entirely useless.
I don't know, maybe is useless for Code Review. You can't compile different languages into the same DLL.
But, at the same time, if your code is writing a DLL library meant to be easily used with all .NET languages, tag might be appropriate.
@RubberDuck You know there are some tricky spots when trying to use a VB.NET DLL from C# and vice versa.
 
Fair enough I guess, but it minimally needs a lot of clean up.
 

« first day (702 days earlier)      last day (3308 days later) »