« first day (1084 days earlier)      last day (2934 days later) » 
00:00 - 20:0020:00 - 00:00

12:00 AM
RELOAD! There are 2171 unanswered questions (93.5202% answered)
 
0
Q: Angular Directive Dropdown & Events

anonNeed some advice on writing clean code for an Angular Directive - I feel things could be written better, and would love some feedback and suggestions. 'use strict'; angular.module('aCollectiveApp.dashboard') .directive('adminDashboard', ($document) => { return { restri...

0
Q: Python beginner, trying to design sorting algorithm from scratch

Nathan RAlright, so I'm taking a Python course and the current assignment is to create an algorithm that sorts numbers in ascending order (without using built-in sorting functions). I've had no programming experience before taking this course, so this might be a bit rough. Anyway, I got my script to suc...

 
so we had a save user method in our API at work, and it functioned to create and save users. it got to the point where they were different enough to split them so I did
my superior was like "nah, it'll be okay, no need to split them"
to be fair, it required two extra models to be used
when he combined them, the method went from like 15 LoC to 200 LoC and the method overrides any existing fields with NULL anyway
ffs
 
12:49 AM
@Duga looks fine
@Quill got some refuc*toring going on?
 
thank god Lippert for the null coalescing operator
 
ikr
 
I had to sit through a demeaning 15min lecture on why you should try to avoid "duplicate code".
he's gonna hear about this on monday.... >:-(
 
stackoverflow.com is not for asking how to rewrite working code, it's for getting help fixing broken code. Perhaps you can find better results asking at codereview.stackexchange.com. — mah 59 secs ago
 
@Duga I was gonna comment, but then it got deleted... here comes a context-less generic Q
 
1:08 AM
0
Q: How can I make this more concise?

Smarticles101Alright, I am working on this assignment for my essentials of computer programming class and I finished it but had extra time to kill and noticed that a couple similar blocks of code are not very concise and could be shortened with a loop, but right now I cant seem to form the code just right! B...

 
This sounds like a good question for Code Review. That's another domain on the StackExchange network, specifically made so that programmers can post their code and get feedback on how it looks, how it performs, etc. Be sure to read their guide on asking questions before posting your question over there. Also, if you decide that you would like to ask your question on Code Review, be sure to close this question first. Thanks! — Matthew Cliatt 52 secs ago
 
0
Q: Can this be considered as a Fuzzy Logic membership function?

FirstStepI am trying to implement a simple fuzzy logic control for a robot to follow a wall maintaining 10 cm away. I need to put multiple membership function. My design for each is as follows: Can I consider the below function as a fuzzy logic function for the above set?? Code is ready to compile #in...

0
Q: A Simple Program To Print Integer In Binary Format

Levent DiviliogluI've made a very simple program that takes integer number arguments either with plus/minus sign or without them, and print the number in binary format. Here is my code; Program Code: binary.c #include <stdio.h> void printBinary(int); int toInt(int*, char[]); int handleProgram(char[]); int ma...

 
1:29 AM
@Quill lol
 
that looks okay, hopefully OP doesnt get mad codereview.stackexchange.com/revisions/126386/3
 
1:51 AM
5
A: Selecting all movies where specified actors worked together

Mat's Mugdistinct is pretty much always a sign that something's wrong. I'm fighting with myself to try and see why this wouldn't produce exactly the same output: select Movie from CastMember where Actor in (1,2,3) -- group by Movie Seems your schema is confusing: it's hard to tell what's a FK and what...

nice
 
2:40 AM
@Mat'sMug
From your VB experience, and I know you don't VB.NET much, but does it sound like gimmeh-teh-codez?
@Phrancis Well kinda both like I just need this List to basically act like a Multi-Dimensional Array u know? Like so I can do something like GuideInfo(ChannelsBox.Text.ToString) which will then only get the Channel Title, Start End Times e.t.c only for the channel that is selected in the ComboBox Get it? — ShinyMK 1 hour ago
 
on it :)
 
I just put a bounty on this one btw @PythonDevelopers
6
Q: Fuzzy Octo Guacamole interpreter

Easterly IrkThis is my code that interprets my own golfing and esoteric language, Fuzzy-Octo-Guacamole. It has 2 stacks to store information in, and various operations can be performed on each stack, or both at once. This is also my first real project using classes, so any advice on how I did would be much...

 
Dat language name
 
A more on-topic formulation for this post would be to replace 'Do Stuff with an actual implementation - pick either, experiment; when it's done and it works, then you're ready for a code review. Your question is really about the design itself rather than the implementation, but our community has come to a consensus where "hypothetical code", or "code not yet written" can't be meaningfully reviewable. We're looking for answers that address any/all facets of the code and, consequently, questions with completed code asking for feedback on the implementation. The code is the design! — Mat's Mug ♦ 10 secs ago
 
Ooooo that sounds really good
 
2:59 AM
monking
I see that we are on our way to having chat bots take over the world.
 
@EthanBierlein oh, shit they kno– I mean, beep. boop.
2
 
you wanna be careful @EthanBierlein or they'll come for you first
 
it's cool
they already know I'm the first one that has to die
 
maybe duga can put in a good word for The 2nd Monitor residents
 
I hope so
 
3:07 AM
haha I just got a downvote from someone who posted the nearly the exact same answer... except he got it wrong :D
 
in The Nineteenth Byte, 1 min ago, by orlp
make a regex that validates a sudoku
 
why
why do people even have those thoughts
 
reasons
 
in JavaScript on Stack Overflow Chat, 2 days ago, by rlemon
Gyms Hate me, learn how to be fit with this one simple trick! body { overflow: hidden; }
2
 
3:12 AM
~falls over laughing
 
3:34 AM
Do you know the person who has control of the object? Can you push back? Sometimes the proper approach to good code transcends the code itself and involves a bit of back-and-forth with other developers who can benefit from code reviews. — Colin 33 secs ago
 
3:46 AM
I'll set as answer in 8 minutes when it lets me. — Verpz 11 secs ago
success
 
@Quill but it is already an answer
 
;-; it's missing the phrase "accepted"
 
possible answer invalidation by Jamal on question by Joe: codereview.stackexchange.com/posts/126177/revisions
 
0
Q: Limiting function invocations using closures

Rahul DesaiProblem statement: We have a number of functions in our web application that are getting called too frequently. We'd like you to create a function that, given a function and a time interval, returns a new function that we can call as often as we like, but ensures that the original function is...

 
4:29 AM
I am not sure, but this looks like it would be better suited for Code Review as it (according to you) is working properly, and you merely need to find ways to improve it/critique it. — Chris Britt 46 secs ago
StackOverflow is for programming problems. If your code works, take it to CodeReview — Vince Emigh 34 secs ago
 
0
Q: Complete Singly Link List C++

Pranit Kothari#include <iostream> using std::cout; using std::endl; class SinglyLinkedList { struct SLL { int data; SLL* next; }; SLL *head; public: SinglyLinkedList() { head = NULL; } SLL* createNewNode() { SLL *newNode = new SLL; ...

0
Q: Is this code type safe or inefficient?

user6321I'm trying to write a multiple functions memoizator, I talked about it here. The main problem is to create a container containing different and heterogenous functions. I found a working solution, but I don't know if it's safe, if there are limitations, if it's somehow inefficient or if there is...

0
Q: A better way to convert a grid type object into a collection of sub objects

firsteI have various examples of getting a grid/table objects that represent real world object. For example I get in personId,CourseId sorted order PersonId, PersonName,Email, CourseId,CourseName I then need to for example email it. int lastPersonId = 0; bool firstRecord=true; var myEmail = new E...

 
Oh alright. CodeReview. Got it. — Stackimus Prime 10 secs ago
 
4:50 AM
0
Q: Find minimum node in Linked-List

Stackimus PrimeI wrote a method that will return the minimum element in a linked-list that operates in O(1) time. I tested and everything works fine. However, I was wondering if there is anything that I can do to make my code more efficient or cleaner. Thanks! public class MinElementInStack { static Node stac...

 
I think you're right! Anyway, I opened this post on Code Review: codereview.stackexchange.com/questions/126395/… Check it out! — justHelloWorld 57 secs ago
 
5:15 AM

Javascript Front Endgineer

Red Ant

Red Ant is looking for an experienced Javascript developer to help us create incredible digital experiences. Front end…

Posted on Stack Overflow Careers on March 29, 2016

Sydney ;-;
 
0
Q: Can anyone explain me the Ruby Script answer for 'The Grid Search' Problem of HackerRank?

Pratyush VashishatIt's in the editorial. I'll paste the script below for reference. N = gets().to_i (1..N).each do |num| # Read in the larger 2D grid r,c = gets().strip.split(" ").map{|x|x.to_i} text = "" (1..r).each do |row| line = gets() text += line.strip end # Read in the smaller 2D grid r2,...

 
5:33 AM
TTQW
 
6:31 AM
@azurekirby Option Explicit just forces you to explicitly declare (using Dim) etc all your variables other wise the an error will occur when you try and run the code. It helps to then assign the correct type of variable if its a String or Long or Range. Having declared your variables properly it also provide for better code review and usage for the next person. — Jean-Pierre Oosthuizen 16 secs ago
 
6:59 AM
0
Q: Generic extension method that will attempt to parse a string and return it's value or default(T)

SidneySo I got sick of several things about the way TryParse works. I implemented a generic ParseOrDefault function using reflection. It appears to work as expected, but I'm not fool enough to say my code is bullet proof. What's wrong with it? If something is wrong with it, can it be fixed, or should t...

 
7:37 AM
0
Q: My Brainfuck interpreter in F#

Gabriel B S MI'm very new to functional world. I've written a simple brainfuck interpreter as my first F# program. What I would like to know: Am I using the right data structure for each situation? Is my code easy to understand? Is my code style similar to common F# codes (naming, organization etc)? Is my ...

0
Q: Transforming XML to HTML with XSLT

Peter SiebkeI'm still learning from designing with types non strings by Scott Wlaschin. For my project I transform some XML to HTML with xslt. Because every filename can have side effects, they are stored in string option types. If I do the transformation I get an ugly pyramid of Option.map and five times ...

 
Yesterday, we got 18 more accepted answers, 29 more questions were answered, 39 more answers were posted, 163 badges were earned, 206 comments were left, 40 more questions were asked, 11 more questions were unanswered, 122 users were created, and 322 votes were created.
Our question answer accept rate went down by 0.0169%.
Our question answer rate went down by 0.0251%, and our answer accept rate went up by 0.0078%.
 
7:57 AM
0
Q: Parsing in between of brackets

CronAcronisI do parsing of the string in order to find wrapped sub-string inside brackets of the first level. a+(b+(d-g))+g+d, in this case I will need to separate (b+(d-g)). Below is the function which i use for such situations. This function is invoked when i find any opening bracket (. I did profiling of...

 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Shell Sort Comparisons/Exchanges Counter
 
Zak
Monking @all
 
Hey there @Zak
 
Zak
@RoboSanta Wait, no Naruto anymore?
 
Probably just didn't get one this time
 
8:25 AM
@RoboSanta Odd answer.
@EBrown How's your graph doing?
 
So I buy a 400 quid iOS device just to serve as a mouse pad, because I obviously need my phone when I'm out and about. Sounds like the cheapest and easiest solution around here. — Adriaan 10 mins ago
 
8:50 AM
@Quill Stupid comment on a stupid answer on a stupid question.
A lot of stupidity to be found there.
2
 
9:07 AM
0
Q: HashMap or other collection?

Roman O.I need parse of space delimited text file. I want to read file and do operations for each cell. Now I'm parsing file by this code: String line; BufferedReader reader = new BufferedReader(new FileReader(file)); Map<String,String> mapFile = new HashMap<String, String>(19); while((line...

 
9:50 AM
@Quill wat
 
idk even know
 
It almost makes as much sense as saying that 1 + 1 = moo
 
this is a nice one to read about this philosophical debate -> codereview.stackexchange.com/questions/11724/…Mihriban Minaz 24 secs ago
 
With a game like Quake, losing the first packet is irrelevant. In FAR less than time it would take you to detect the loss and retransmit the first packet, you should have already transmitted a second packet which makes the first one obsolete anyway. This is the same reason than many real-time voice and video applications also use UDP. If a packet gets dropped, you'd much rather just lose 0.02 seconds of audio than delay the whole stream by a full second or more. The same is generally true with real-time games, as you want to know where an object is now, not 1.5 seconds ago. — reirab Apr 18 at 21:42
^^ Doesn't that mean that if both packages tell that you hit an enemy player, that you one end doesn't register one hit?
 
10:10 AM
possible answer invalidation by soufrk on question by Roman O.: codereview.stackexchange.com/posts/126419/revisions
 
-1
Q: Multiple XML data in datagridview

simdi ejinkeonyeMy query to a large Xml Database var query = DOC.Descendants("entry").Where(f => f.Element("url").Value.Contains("example")); returns multiple xml Data I display the data using a richtextbox foreach (XElement result in query) {richTextBox1.Text += Environment.NewLine + Environment.NewLine + ...

 
10:40 AM
possible answer invalidation by Smarticles101 on question by Smarticles101: codereview.stackexchange.com/posts/126383/revisions
 
Zak
@Duga Rolled back
 
0
Q: JavaScript - Constructing and initializing global objects

Andre BorgesI have a script for a web page that has to initialize a lot of complex event handlers on page load. Because of the large number ov events and DOM elements that these events sould fire for, I want to construct a global object containing all the initialization logic. Currently my script looks like ...

0
Q: Check if a store is currently open

Sebastian Jennings AlmnesThis is the dirty bastard of my current code block, and I'm trying to find a way to improve this code for increased readability, but also functionality. The method checks if the store is currently open. Yet on our site we close the sites 30 minutes prior to their real closing time. Issues arise ...

 
11:18 AM
Greetings, Programs.
 
@Donald.McLean Greetings.
27
Q: Game of Life: Move the Sun

kamenfBased on Game of Life: Kill the Sun Conditions are the same: Below is an initial state for Conway's Game of Life with a single pulsar. Living cells are white. The area marked with red is your base. You are free to modify any of the red cells, but only those, and only in the initial generatio...

 
0
Q: Python common file operations generalization

nejc92Functions with common and simple file operations have started to repeat in my code. Many like this one, but with subtle differences for example: def do_something_with_file(file_name, access_mode, data): with open(file_name, access_mode) as f: f.do_something(data) This is my solutio...

 
If there is no technical problem with your code, it might better fit on code review. — Wimmel 33 secs ago
 
11:45 AM
0
Q: Is my frustum culling code efficient enough?

RussoulI've written the same code for frustum culling in c++ and scala. The culling function is identical in both variants but c++ code runs 3-20ms faster and its timings vary less than scala's (5-6ms c++, 9-25ms scala). What could cause that ? C++ void check(...){ auto frustum = w->camera.get...

0
Q: Heap Sort implementation time complexity

Kanagavelu SugumarI have implemented Heap sort, but i think the time complexity is more than (nlogn). Could anyone explain me; what is wrong in my code which makes more time complexity. I will be glad if the answer is in terms of algorithm time complexity based. import java.util.Arrays; public class HeapSort { ...

-1
Q: Pre load js shopping cart

JS-CartHelpI have made a shopping cart to load from local storage. For this i have used JS and jQUERY. I have the cart finished with all functioning well. Although there is one small issue. When the page loads in a browser for the first time there is nothing in localstorage so when i addToCart nothing saves...

 
12:04 PM
0
Q: How this implemented multithreading can be improved?

sscHere is the link to git repo of my application I am currently implementing just to have better understanding of OOP as well as learning Concurrency (Atleast a try :D) simulation More specifically this function: public synchronized Person personEnters (final Person person) throws RoomFu...

0
Q: How to make doubly linked list design more efficient?

KostrahbI have played recently and implemented doubly linked list with merge sort algorithm. I was wondering if there is any way of improving the algorithm further to make it as fast as possible (I know about implementing list as array of void* pointers but I want to implement that as a separate structur...

 
Zak
12:17 PM
It's friday and the 2nd Monitor is deserted. What's happening with the world.
 
another yearling badge! this time in stackapps!
@Zak it's early
 
Zak
@Malachi It's already early afternoon in western europe
 
"I think that it is not good" — Why do you think that? Does it not behave as you expect? Or does it work and you just want a code review? — Quentin 38 secs ago
 
@Zak still early something
 
12:24 PM
The night is just starting here
 
@Zak Have you considered the possibility that people might be working?
:o
 
Zak
@skiwi Working? On a Friday? nah :p
 
Was worth the thought at least :P
 
should be a hack day, right?
 
0
Q: Rails recursive data structure makes too many SQL queries

Devon ParsonsIn our product, Company is a model that can have many Companies belonging to it; so some Companies are parents, some are children, and many are both. We have a helper method Company.root that has as its children all Companies that do not actually have a parent; in this way, accessing Company.roo...

 
Zak
12:37 PM
I just wanted to thank you again for writing that big response to my post. I refer to it all the time during my projects and it has improved my code readability 10 fold. — StormsEdge 7 mins ago
^^
 
Man, that must've been bad in the first place then :P
 
Zak
@skiwi The guy knew how to write code that does stuff, just not how to write code that is actually readable. (In VBA anyway)
> "You clearly know a fair amount of technical details about implementing code that does stuff, but very little about implementing code that is actually useful. Code is only useful if you (and whoever else ever has to read/maintain/extend it) can easily understand what it is doing and why."
 
yay modifying modules to use spaces instead of tabs \o/
 
12:54 PM
It's Friday.
 
1:11 PM
@Zak Oh well... it's VBA
 
You should then use [codereview](codereview.stackexchange.com) instead of SO — Francesco 59 secs ago
 
Zak
@skiwi I will defend the worthiness of VBA to my dying breath.
It was designed to do a specific type of thing and it does it very well.
 
1:27 PM
Are esolangs allowed here?
Btw, hi everyone, I come from PPCG.
 
Zak
@KennyLau Welcome @KennyLau
 
@KennyLau I think that, generally, yes, they can be allowed. However, we don't help with golfing code.
 
@KennyLau As long as you want it to be readable, maintainable code.
 
@Zak Thanks!
 
Zak
To answer your question, I present this CR question:
18
Q: You have no respect for logic

MastInspired by Hosch250, TopinFrassi, Legato and the recent milestone of having our 100th fizzbuzz question on Code Review I decided to add an ArnoldC FizzBuzz to the collection. I haven't found any best practices about the language, but I assume the code needs to be VERBOSE. For those unfamiliar w...

 
1:29 PM
We do, among other things, and , so, yea.
 
Pyth though
 
Oh, yes, and , I wrote that one :P
@KennyLau Post a snippet and we'll tell you :P
 
I don't have any question now lol
 
Zak
@KennyLau Find a random bit of code you wrote somewhere, stick it in a question with a brief overview of what it's trying to accomplish, boom, done.
 
FNrZTN
That's Pyth.
 
1:32 PM
0
Q: Self or this in a Class?

AdamI have written a class that stores users activity. To store user activity, ActivityModel::record('edit', get_class(), $database->lastInsertId()); is called from the function that makes the DB insertion. First argument for record is "what activity". It can be whatever you want it to be, edit, ed...

 
for N in urange(head(T)):
 Pprint("\n",N)
Meh, I think we can do that.
 
@Mast My intuition tells me to golf it to VTN.
 
@KennyLau If you do that, we'll close it.
 
What do you mean?
 
It's VhTN AFAIK.
 
Zak
1:34 PM
@KennyLau Code Review is not for golfing
 
We don't golf. We do readable.
 
Don't worry, I won't ask for you guys to golf.
 
If you want readable code in a golf language, we can do that.
If you want to golf in any language, we don't do that.
 
Zak
@KennyLau That's cool, just a standard thing, we find it's best to be clear with the PPCG people that their site exists for a reason, and it's because golfing code (questions or answers) is explicitly Off-Topic over here.
 
1:36 PM
1
A: Diamondize a Matrix

Kenny LauPyth, 41 17 bytes tm_<dx+dYk.T+LaYk Try it online! Inspired by @Doorknob's solution to another problem. How it works: tm_<dx+dYk.T+LaYk +L prepend to each subarray... aYk (Y += ''). Y is initialized to [], so this prepends [''] to the fir...

I'll post this.
 
54
Q: FizzBuzz in Brainfuck

Simon ForsbergInspired a bit by a previous Brainfuck question and the recent fizzbuzz invasion, I decided to make FizzBuzz in Brainfuck. The code is entirely my own, except for the inclusion of the Printing a number algorithm that I found on StackOverflow. My code is divided into several parts. Setup Const...

 
nice
 
@KennyLau Why?
What do you want to see in the answer?
 
@Mast So, would I ask "how to make this program more readable"?
 
Zak
@KennyLau Do you really want to take code deliberately made short and unreadable and ask "how do I make it readable?"
3
 
1:38 PM
@Zak "short" does not necessarily mean "unreadable".
 
Zak
If you knew how to golf it, you know how to write it un-golfed in the first place.
 
usually we just develop a more efficient algorithm
 
Zak
That's cool. I'm just saying, for you to get valuable feedback, it's best to write it as good as you can first, and then ask for feedback.
 
ok, then I'll post an attempt following the original code.
what tag should I use?
 
Zak
@KennyLau Whatever language it's written in, then anything else that feels important.
 
1:41 PM
For my question in particular?
I would like to make it more readable
 
Zak
@KennyLau "How do I make this code "Better/More Readable/Faster/etc." is already implied for every single question on the site ^^
48
Q: How to get the best value out of Code Review - Asking Questions

rolfl I have a project I am working on, and I would like some, or all of it reviewed, how can I ask for this review on Code Review in a way that produces the best possible value? This is not about a question being on-topic, or off topic. Rather, this is about making on-topic questions great qu...

 
you know, there isn't really a tag for Pyth.
 
Zak
@KennyLau You can always invent it ^^
 
2:00 PM
0
Q: Create a board for a JS ttt game

Xirux NeferI would like any of you to take a look at this code. I am making a vanilla JS Tic Tac Toe and started with the board. I am using Jasmine for the tests. I would like to receive feedback on: Is the naming improvable? Am I hurting performance? Is it idiomatic? Are the tests good? Are they clear? ...

 
should that be or ? would be misused for ?
BTW we also have a tag
 
@Zak Only if my reputation > 300
0
Q: Diamondize a matrix

Kenny Lau This question is in Pyth, not Python. The task is to output a representation of the matrix where the top left element is on top, the anti-diagonal is the central row and the bottom right element is at the bottom. For example, consider the following matrix: 1 2 3 4 5 6 The diamond version o...

 
Zak
So just to be clear, this is the code you want reviewed?
FNUlQ=Y+Y""=QXQN+Y@QN;=Q.TQ;FNUlQ=Hx@QN""InH_1=QXQN<@QNH;FNUlQ=QXQN_@QN;=Q>Q1;p‌​Q;
 
yes
 
0
Q: Diamondize a matrix

Kenny Lau This question is in Pyth, not Python. The task is to output a representation of the matrix where the top left element is on top, the anti-diagonal is the central row and the bottom right element is at the bottom. For example, consider the following matrix: 1 2 3 4 5 6 The diamond version o...

 
Zak
2:11 PM
@KennyLau And this is the same code, but golfed?
tm_<dx+dYk.T+LaYk
 
@Zak yes
 
Does anyone have thoughts on this?
 
@Zak Thanks
 
Zak
Cool. It's a good question. Just has a lot of extra fluff that's superfluous for CR which I'll edit in a second.
 
thanks
@Zak Are you familiar with Pyth?
I can help you if you are not
 
Zak
2:23 PM
@KennyLau I'm not about to go touching the code ^^ just cleaning up the presentation. With CR, we only want to see the version of the code that you actually want reviewed. Including previous versions just adds confusion (and fluff) unless it provides important context.
 
@Zak What do you mean you are not going to touch the code?
@Zak For example, =+H1 and =H+H1 are equivalent, with both meaning H=H+1.
 
possible answer invalidation by Malachi on question by Owen: codereview.stackexchange.com/posts/126354/revisions
 
Zak
@KennyLau I mean, for instance, presenting the (original) golfed code, and then your first attempt at writing it more readably, is superfluous. Just present the new code, with a description of its' purpose and what it does, and we'll review it on its merits.
 
@Zak Alright. So are you familiar with Pyth? I can help you if you are not
 
Zak
@KennyLau Not the faintest idea. I write VBA stuff in Excel ^^ I'll leave the reviewing to someone who actually has the first idea about your language.
 
2:33 PM
@Zak lol okay
 
hey pim you should remove the duplication from your tests
"but it looks fine like this"
yes but there's duplicate code, and you could merge these two testcases as well
okay, here you go then
PimsTestBuilder test = PimsTestBuilder.forCriteriumImport(false).pimsNAWRecord(createNAWRecord()).expectRecord();
        MockQueryResultRow dataSet = createRoosterRecord();
        String[] days = {"ma", "di", "wo", "do", "vr"};
        for(int i = 0; i < weekscheduled.length; i++)
        {
            int thisWeek = weekscheduled[i];
            if(thisWeek == 2)//null values
            {
                continue;
            }
            if(thisWeek != -1 && thisWeek != 0 && thisWeek != 1)
... I want to revert this commit and the ones before it
but hey, the duplication is gone?
 
Zak
@Mat'sMug I have no idea if we have any people but can we put up a pinned star asking for one?
 
for comparison, the original
        PimsTestBuilder test = PimsTestBuilder.forCriteriumImport(false).pimsNAWRecord(createNAWRecord()).expectRecord();
        MockQueryResultRow roosterRecord = createRoosterRecord();
        for(int i = 0; i < weekscheduled.length; i++)
        {
            int dayIndex = i+1;
            String columnPrefix = "r"+dayIndex+"_uren";
            if(weekscheduled[i] == 1)
            {
                roosterRecord.setColumnValue(columnPrefix+"weektotaal", 40)
                        .setColumnValue(columnPrefix+"matot", 10)
 
0
Q: What reasons are there to host private code online?

Mat's MugWe're looking for a good source control and project management solution at my workplace, and I've suggested creating a GitHub organization and private repositories. I love GitHub for many reasons, but this isn't about GitHub (in fact my colleagues are going to present points in favor of competing...

 
commit message: "revert madness"
 
2:39 PM
any takers?
 
I am working on a bug that only occurs in compatibility mode....
If you stuck a real server in a real cloud it would become saturated and fail very quickly. So...I dunno. Maybe the name works.
 
I poasted an answer
it is not a good answer
but then again, your question smells of list question
 
@Malachi source
@Pimgd aye, ...I tried not to make it be that, ...but it's hard. any ideas?
 
added a con
privacy
and laws
laws are always a good way to make a complicated situation even harder to grasp
 
yeah thanks, give my boss ammunition
lol
not applicable ;-)
 
2:48 PM
That's not possible
 
I mean, not a big deal then
...I feel that question will get shot down soon
 
well let's get some Rep out of it anyway....lol
Programmers is a tough site sometimes
 
There's a specific site for code review questions: [Code Review](codereview.stackexchange.com). — Ven 19 secs ago
 
your information is not encrypted on a cloud server?
 
welp I cleaned up my answer
You're trading confidentiality for availability
it's less secret and more available
 
2:54 PM
I scratched the "what other reasons would there be" part
 
> How do I convince my boss that having our source code hosted by a 3rd part is a good idea?
 
and, two close votes are in
 
Workplace.SE
 
really?
the fact that it's my boss is irrelevant IMO
it's just context
 
Well the answer is likely to be somewhere between "present case like this" and "if boss says no, he means no"
 
3:00 PM
thanks for your answer btw
 
welp my answer seems workplace on-topic now too
so even if it gets moved it'll be fiiiine
awww I got downvotes =D
@Mat'sMug your title is second guessing things
> How is hosting private code online a good idea?
> How do I convince my boss that having our source code hosted by a 3rd part is a good idea?
these have the exact opposite tone
...
"Is hosting private code online a good idea?" would have been perfect
anyway I'm back to work because I lost quite a bit of time over this removal of duplication and I wanted to get something done before the weekend (~45 mins left)
 
0
Q: An array function that returns an array containing all elements appearing a certain number of times

ANONArray.prototype.itemsWithQuantity = function(n) { var counts = {}; var result = []; var i = this.length; while(i--){ counts[this[i]] = counts[this[i]] == undefined ? 1 : counts[this[i]] + 1; } i = this.length; var alreadyPushed = {}; while(i--){ ...

0
Q: Count decimal places of pi number

mateusz372My program asks how many decimal places of pi number do want to see. I would like to ask for your review about my code. I have also two questions: Why I had to add 1 (getcontext().prec = places+1) in order to display a proper amount of decimal places. (getcontext().prec = places+1) Why do my p...

 
You can post to Code Review if you want a full analysis. But for now, if you want the Customer to get stuff from some database, I'd make the $dbh a property with has. That way you can simply pass it a different $dbh in your tests and don't need to care about mocking. If you have several classes that need a dbh, turn it into a Moo::Role. But pay attention that sqlite might not support all features of Postgres, so there are some pitfalls with the whole sqlite approach. It's probably safer to use DBIx::Class and let it worry about that stuff. — simbabque 58 secs ago
I'm voting to close this question as off-topic because this belongs on code review.stackexchange.comJarrod Roberson 33 secs ago
 
man, I hate bad equals implementations
 
possible answer invalidation by Panzercrisis on question by Panzercrisis: codereview.stackexchange.com/posts/126373/revisions
 
3:15 PM
they make your tests pass when they actually dont
like a range that equals if the first left side is the same matches
 
Zak
I'm back to reading about FizzBuzz, people who apply for programming jobs who can't program and that academic paper, which I'm finally getting around to reading. It is hilarious.
Choice quote:
> As computer scientists we normally excoriate this appalling design decision, but here we are able to benefit from their crass idiocy.
> There was an attempt to administer the test to another 30 or so students on a foundation (predegree)
programming course at Middlesex University. That administration failed, because the
students – rightly, in our opinion – were incensed at the conduct of their teaching and the arrangements
for their study, and simply refused to do anything that wasn’t directly beneficial to
themselves.
This thing reads like a really good blog post.
 
> and simply refused to do anything that wasn’t directly beneficial to
themselves.
Recipe for disaster.
@Pimgd I found an assert today which wasn't implemented correctly.
 
paper1.pdf
best title
remember kids, file names are important too
 
if(value < 8);
{
    assert();
}
Note the semicolon right behind the if.
 
ah come on that sort of crap ought to get blasted by an IDE
 
3:22 PM
VS didn't say a thing.
 
@Mast that's like if (foo) { } { assert(); }
R# would suggest to remove the extraneous scope around assert();, which should raise a flag
 
> In total, the test was successfully administered to 61 subjects.
So one of the little buggers @ complainy college actually took the test?
 
@Mat'sMug Does R# work for C?
 
@Mast good question. I know there's a version for C++
 
Zak
@Pimgd Maybe "about 30" + "about 30" = 61?
 
3:32 PM
or that
 
@Zak If it was that simple, why don't they say "31" instead of "about 30"? I smell inconsistent data.
 
3:49 PM
Move this to code review. — Ani Menon 26 secs ago
 
@Duga No. No. No.
 
@AniMenon Please take a moment to read a guide to Code Review for Stack Overflow users. — Mat's Mug 43 secs ago
@Mat'sMug If he puts up the code at code review, somebody might try to help him is what I meant. Either ways this is not the way to put up a question, I agree. — Ani Menon just now
@AniMenon no. Code Review requires code that works as intended. OP has a known bug and they're asking for a fix/solution - that is not what CR does. Please, read the link. — Mat's Mug 48 secs ago
 
aw, deleted
ooh another +325 on SO and I'll be at 10K
 
4:06 PM
wow they don't waste any time deleting stuff
I can't even vote to undelete
 
@NathanOliver - No I am not getting an error. I was told in a code review to include the base constructor as in MyDerivedClass2 and I asked why. No one could give me a good reason, short of "Documentation". So I'm asking why here. — TWhite 26 secs ago
 
anyway
 
0
Q: Optimize the code: simultaneous processing of jquery variables goes not so simple?

ne.mmojI have almost properly working code which makes use of jQuery and some additional libraries. But it's jQuery part is too overwhelming (and thus it does it's job slowly). So I tried to optimize it, and faced no luck. Now I seek for community help. The code: jQuery(document).ready(function($){ va...

 
Is a post still off-topic if the OP knows the code is broken but is not asking for help with the broken parts? (only small parts are broken; not the entire thing). Specific example.
 
4:24 PM
@Malachi it was my bad in the first place, for asking a list question. I never seem to get P.SE right :/
 
1
Q: Summative Pattern

Cᴏɴᴏʀ O'BʀɪᴇɴWhile playing around with J (link), I found that you can create a sequence of shape N0 N1 ... NK with i. taking a list as its parameters. Since i. creates a range 0 .. RHS and >: increments each value in a range, i. >: i. RHS creates a non-empty range. We can use , to flatten it and +/ to summat...

0
Q: is palindrome possible with the string

saneGuyfor a string of length n, count the number of occurences of each character. If atmost one character has odd count then the string can be a palindrome else its not. public class Palindrome { //count the chars in the input string //if not more than one character has odd coun...

 
4:36 PM
@Mat'sMug List questions are off-topic everywhere IIRC.
 
I know. I didn't mean to ask one either. it just ...came out that way.
 
8
A: Obfuscated FizzBuzz Golf

Simon ForsbergBrainfuck, 708 characters ++++++++++[>++++++++++<-]>>++++++++++>->>>>>>>>>>>>>>>>-->+++++++[->++ ++++++++<]>[->+>+>+>+<<<<]+++>>+++>>>++++++++[-<++++<++++<++++>>>]++++ +[-<++++<++++>>]>>-->++++++[->+++++++++++<]>[->+>+>+>+<<<<]+++++>>+>++ ++++>++++++>++++++++[-<++++<++++<++++>>>]++++++[-<+++<+++<...

 
ah yes, very good.
 
5:01 PM
0
Q: Postfix versus prefix increment explanation

AdHominemI am well aware of the varying evaluation and incrementation moments of both post- and prefix incrementation. Still, I fail to understand why this returns zeros only: Stream.iterate(0, e -> e++) .limit(10) .forEach(System.out::println); When checking this, I see e being...

 
Zak
If anybody wants a bounty, I would hate to see this go to waste. 9 hours left :(
6
Q: Modularised Document Construction

ZakThe goal: A set of configurable options, combined with a standardised data source, to produce a standardised Report. This question: One module of said document, with accompanying code. Input: (Dropdown selection): An Attitude To Risk (ATR) Value. 1 to 5. Business Logic: Select from pre-config...

 
Does your current code fail, or are you just looking for a code review? — ThisSuitIsBlackNot 32 secs ago
 
5:30 PM
Some people's minds are organized as sorted lists, some as hashtables.... — keshlam yesterday
 
5:46 PM
@Zak I don't see anything worth putting in an answer.
Just a bit of indentation (those cases), and perhaps use more early-return and less indentation in ifs.
 
0
Q: C# dictionary, take a result set and organize it into a dictionary

WaragiI'm trying to take a result set and organize it into a dictionary then assign the dictionary values to variables that are publicly accessible from my controller. My issue is I have to check if there is a key, if there is a key, assign it to a variable manually, if there isn't set the variable to ...

 
Zak
6:02 PM
@Hosch250 IMO, there's no such thing as a review that's too short.
There are short reviews that are horribly written, and it's hard to imagine writing a useful answer in, say, 1 sentence, but 1 short paragraph? Sure, why not.
IIRC, my one non-VBA answer is 2 sentences and 3 bullets laying out why code should always be under source control.
 
0
Q: how to get wrapped lines from multiline textbox?

alexIn my windows.forms c# application, I have a multi-line textbox with WordWrap = true. After I set Text property to a long string, I need to get all lines produced by wrapping. It is not the same as Lines[] property, because my text does not include new line characters. I have found solutions usin...

 
Zak
After all, what is a big review if not lots of little reviews put together?
@SirPython IMO, if there is code that is not up for review, then it should either be A) in a "this code provided for context only" section, or not in the question at all. Either way, not a problem if it's broken.
 
6:20 PM
you might consider migrating this question to codereview.stackexchange.comJeff Puckett II just now
 
@Mast It's going alright, I just have to get a few more things done and then get started on the actual site portion of it.
 
0
Q: Is this a good way to organize my ever growing login.sh for bash

John the Eagle . 0Also, I can not get the variable substitution to work: I tried about 3 different ways ... #!/bin/bash path="~/root/config/bash/" source ~/root/config/bash/_private.sh source ~/root/config/bash/config.sh source ~/root/config/bash/utility.sh source ~/root/config/bash/workflow.sh source ~/root/co...

0
Q: Is there any way I can make this set of branches in a method more clear?

Ben C. R. LeggieroThis works just fine, but it's very unclear that it does: /** * Queues the given item and returns the success of this operation. * * @param newItem The item to enqueue * @param rowUUID The UUID of an existing row if @c updateOldRow , else of a * new row. * @p...

0
Q: How is the structure of this configuration file?

John the Eagle . 0This is a new rev, I can't find the previous. # # # # Config.sh - configures tools # - configBash, configGit, configGrunt, configSublime2, configOSX # # configBash() { rm ~/.bash_profile ln -sf ~/root/config/bash/login.sh ~/.bash_profile source ~/.bash_profile echo ...

 
@CaptainObvious possibly broken, lacks description
 
6:38 PM
@EBrown :-)
@CaptainObvious Borderline off-topic, definitely grey.
@CaptainObvious two of those questions are from the same author. One is utter garbage and on-hold, the other is iffy.
 
0
Q: jQuery - $.post replace DOM elements. Is there a cleaner/shorter way of writing this?

Mike BarwickIs there a shorter way of writing this function? Seems like a complete mess. I thought about using $.each a couple times to cycle through, but since I need to compare values from the first two array keys in the multi-dimensional array, it makes things much more complicated. Any help or direction...

 
@Mast Both RBA.
 
0
Q: Non-code formula spreadsheet

Forward EdFrom what I can tell this site is mainly (not sure about solely) for the use of reviewing CODE. I am wondering if it will also review code-free spreadsheets for potentially better formulas, or layout of information, or process? For example could I post a working spreadsheet that looked somethin...

 
@CaptainObvious Should be Meta.
@Mat'sMug @SimonForsberg @janos @Jamal Can someone move that last question to Meta?
 
@EBrown you're late, bud ;-)
 
6:53 PM
Thanks.
 
7:03 PM
1
Q: Non-code formula spreadsheet

Forward EdFrom what I can tell this site is mainly (not sure about solely) for the use of reviewing CODE. I am wondering if it will also review code-free spreadsheets for potentially better formulas, or layout of information, or process? For example could I post a working spreadsheet that looked somethin...

 
7:14 PM
0
Q: Can this jQuery VLOOKUP() script be refined?

Alexander DixonDisclaimer: I am not an expert in the Excel VLOOKUP function. I do know how to use it and I do understand its purpose. Please consider my example in the code snippet when answering. Is there a way that I can refine my code to pass in an exact match? Also, I notice in my console.log, that it is...

 
@Vogel612 deleted. What was it about?
 
@Zak It isn't worthy of the bounty, so I won't post it.
 
7:36 PM
@Hosch250 That's what we all say. But if nobody posts an answer, the bounty will expire.
 
^
Keep in mind it could realistically be the case that it truly is really good code and there is not much to say about what could be improved
 
just leave the question open then
it will attract views over time because it has no answers
You're doing the overall quality a disservice by removing a zombie with such simple answers
 
0
Q: Python compare every element with all other elements in single dictionary

Kenneth OrtonI am attempting to write a statistical program using an LDA model I've trained/created using Gensim. I am very new to Python and am a student level programmer. This current program is working and getting the results I want. In get_similarities I am comparing each of the user's document vector to ...

 
7:52 PM
# load the tfidf model
'''tfidf = models.TfidfModel.load('data/wiki.tfidf_model')'''
Uh, is it just me or that code is inside a string?
(I don't Python very often)
 
@Mast So? Better it expire than get awarded to a mediocre answer.
 
00:00 - 20:0020:00 - 00:00

« first day (1084 days earlier)      last day (2934 days later) »