« first day (1011 days earlier)      last day (3006 days later) » 
00:00 - 18:0018:00 - 00:00

12:00 AM
RELOAD! There are 1804 unanswered questions (94.2263% answered)
 
@Duga Them be rising again?
 
@Quill but they're cool zombies :)
 
12:20 AM
possible answer invalidation by Jamal on question by Hans: codereview.stackexchange.com/posts/119323/revisions
 
0
Q: Bash script to create directories and files

BarFooBarI wrote a pretty simple bash script. It takes a directory with subdirectories with incremental prefixes in their names (01test, 02test, 03test), creates a new directory with the next highest prefix and creates a couple of files and fills them with some default text. I'd like to do this in fewer ...

 
I'll move this conversation to Nth, you can talk politics all day long there
 
ty
 
np
 
Night night all, all have good dreams and all.
 
12:29 AM
OK, that's that.
Good night.
 
Night y'all
 
@Phrancis You are going to bed too?
 
catch the three two mast of you later
 
No, just saying bye to those who are
 
I think it is only Mast.
 
12:30 AM
OK
 
close enough
 
12:58 AM
I've got this issue floating around: github.com/Vannevelj/VSDiagnostics/issues/298
Baseline is this: Should we, when applying a rename action, automatically change the identifier to something convention-compliant?
For example changing a field to a property or removing an -Async suffix, should the name be automatically updated to follow that member's conventions?
When you go from field to property, you're changing its semantic meaning
When you go from suffix to no suffix you're not changing it
 
that's an interesting question
 
Also something to consider: naming conflicts. You could be doing something like going from field to property but then suddenly end up with a naming conflict
That makes me hesitant because it would be rather confusing
Keep in mind that the steps can be easily separated: first the user changes it to a property and afterwards they can still choose to adjust for naming conventions
But it does make you do two actions instead of one
Thoughts?
 
@JeroenVannevel Ask on Programmers.SE maybe?
 
That would be closed for being too opinionated
it is opinionated
I'm doing a poll, really
 
Maybe ask the residents of their chatroom
 
1:05 AM
Then I have to repeat everything though
Surely you guys have a view on it?
 
You could always display a dialog like "the following X may result in naming conflicts with Y:... Do you want to continue with refactor?"
(although that's the "PS" of your question)
 
I can't add that -- I have no control over UI
and it's actually very hard to discover whether there will be naming conflicts (so hard that I just don't do it)
 
@JeroenVannevel overaggressive tools are a pain...
 
What I can do is mark the member so that it will have the rename dialog after the refactoring. Meaning the identifier is highlighted and the user can either press enter or 'ok' to accept the existing name or immediately start typing to give it a new name
But then again -- chances of you wanting an entirely different name after refactoring from field to property are slim
but then again again -- if I don't mark it for renaming and there is a naming conflict, everything will be messed up now and you can't properly rename it now because the identifiers have already molten together
blimey
 
smells like meta
 
1:11 AM
meta what?
 
logic and rule discussions, not an se site
 
@JeroenVannevel Sounds really icky to me... The thought of it is nice, but a simple user error/overlook could result in many wasted hours
 
I don't know what you're talking about
 
dont worry
 
So unless you have a surefire way of letting the user know ahead of time what the potential consequences are going to be...
 
1:14 AM
Yeah, what @Phrancis said. Maybe you could present both options at once?
 
I'll just not rename it
in the end, public fields and properties both follow the same naming convention
so if it needs to be changed then that means it was wrong in the first place
I don't see any reason to assume that someone who writes their fields against the convention wants their properties to follow it
so if I keep it the same, I avoid conflict issues and the rename dialog
same goes for suffices
 
1:30 AM
Sounds like a pretty good plan
 
1:57 AM
0
Q: Generate String with Random Consonants and Vowels

Jae BradleyPurpose This problem comes from this dailyProgrammer subreddit challenge. The task is to take an input of C / cs and V / vs and to replace Cs with random consonants and Vs with random vowels (English alphabet) while keeping the case the same. Y is not considered a vowel in this case. Example: ...

 
2:07 AM
I'm voting to close this question as off-topic because it belongs on Code Reviewchris neilsen 15 secs ago
 
2:22 AM
0
Q: Find the letter 'z' within three characters after an 'a'

RaghavIt works, just feel that my solution is too complicated. # Write a method that takes a string in and returns true if the letter # "z" appears within three letters **after** an "a". You may assume # that the string contains only lowercase letters. # # Difficulty: medium. def nearby_az(string)...

 
2:49 AM
1
Q: Improving a robot's ability to navigate the plane with Karel J. Robot

EridanI am in my first year of formally learning computer programming in high school (we are using Java). One of the tools we used was Karel J. Robot, which can be downloaded here. Although we finished using Karel after a semester, I felt that there was a lot more I could do with it. I decided to use s...

 
3:10 AM
Monking
 
Minking.
We just got a really interesting bug report for Rubberduck.
More naming issues (I just read the last one).
Turns out Unicode characters crash the parser (surprise!).
5
 
3:28 AM
1
Q: A Compiler for a Minimal LISP Dialect to Run on the Java Virtual Machine

MinjaeKimAs the title states, this is a compiler written in C with a ruby build script that translates a minimal LISP dialect and spits out an executable jar file. I designed this LISP dialect and named it mjLisp. It has some missing features (that requires some extra parsing effort, thus more code) as yo...

0
Q: Open a window and render to it a texture

UsernameI'm new to C++ and SDL2. I made this program that makes a window. I want to make sure I'm implementing this in the most sensible way possible. I've been learning for free from online tutorials, so I wouldn't be surprised if I could improve it. Are there ways to shorten this code? Does this viola...

 
3:45 AM
I just got a bronze tag badge on meta o_O
 
That is more a code review issue, than fixing his problem -- unless you think using std::string actually fixing the problem he is asking about — Soren 1 min ago
 
 
1 hour later…
4:48 AM
in VBA Rubberducking, 24 secs ago, by Hosch250
@Mat'sMug We have a native Japanese person offering to finish the translation!
 
I'd be interested to read that once he's done
I haven't read any docs in Japanese before
 
> 4つのレジスタは、呼び出された関数側が保存する。
> The contents of the four registers are preserved by the called subroutine.
 
@Quill Where's that?
 
5:05 AM
0
Q: What is wrong with my quicksort algorithm?

Sagar B HathwarI tried writing quicksort algorithm recursively and using lomuto partitioning scheme. But there seems to be something gravely wrong with it. It works only for small inputs but takes forever for even small inputs like 1024, and eventually crashes. I implemented the code myself in C++ and didn't ...

 
@CaptainObvious Maybe a stack overflow or an index out of bounds?
 
0
Q: My implementation of a VList

DefinitySo here is a VList I have implemented import java.util.ArrayList; /** * Created by PAS43 on 02/02/2016. * * VList */ public class Main { public static void main(String[] args) { VList v = new VList(); v.add(10); v.add(20); v.add(30); v.add(40); ...

 
5:42 AM
You should try code review. — Ben 23 secs ago
 
Monking
 
6:10 AM
possible answer invalidation by 200_success on question by Arne: codereview.stackexchange.com/posts/15043/revisions
 
0
Q: Comparing many booleans

silverI have 4 booleans and all must be met to determine the value of a String: String message = (!isNameBlank && !isDestinationBlank && isDestinationValid && isAmountValid) ? "Have a safe trip!" : "Please try again!"; If I do this, it doesn't look elegant either: String message = ""; if(!i...

 
6:30 AM
I think you're looking for codereview.stackexchange.comUchiha 22 secs ago
 
7:20 AM
possible answer invalidation by 200_success on question by SeasonedNoob: codereview.stackexchange.com/posts/119299/revisions
 
@CaptainObvious Lacks context; possibly hypothetical?
Second opinions, please.
 
Missing context, I agree but for hypothetical IMO the variables names are too well named.
 
7:40 AM
Thanks. Left a comment:
This is a rather poor Code Review question. If you gave us more contextual information (e.g. How did these variables get set? Is the message going to be used in a System.out.println() or embedded in a JSON HTTP response?) we could actually provide more useful than just shuffling your tokens around. — 200_success ♦ 27 secs ago
 
7:52 AM
@CaptainObvious That's a rather impressive first question. A Bash one-liner build script that uses Ruby to do some string munging and invoke GCC to compile a LISP-to-Java compiler written in C.
 
8:25 AM
@Legato Congratulations on reaching 5k!
4
 
Monking
@200_success polygluttony :)
 
8:52 AM
I'm voting to close this question as off-topic because questions about reviewing or improving existing, working code and lacking a specific question statement are off-topic for Stack Overflow. You may be able to get help on Code Review. — Tim Schmelter 8 secs ago
 
-3
Q: can you write the code for the below one

MONICA GORRE7 - - - - - - - 14 15 - - - - - - 28 29 30 31 - - - - 56 57 58 59 60 61 62 63 I/p:(7,4)

 
Naruto answer; accepted non-selfie answer with 0 score: Making a grid of videos
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: AngularJS code to query DB and update $scope
 
9:08 AM
@CaptainObvious er, no
 
I think this question would be a better fit for codereview.stackexchange.comDefault 52 secs ago
 
Writing unit tests is very cathartic
 
Zak
Monking @all
 
hello @Zak :)
 
9:27 AM
1
Q: Lock-free SPMC queue

GuinzooHere is my lock-free queue implementation for single producer with some preallocated memory. T is a simple type with no need for move operations. I don't use bool pop(T& result) in order to avoid double checking. Would love to see your feedback! template <typename T> class LockFreeQueue { public...

 
9:39 AM
0
Q: C++ array programs

user10726How do i create a program that take names, marks of 5 subject of 5 students and shows the percentage and total using array. The output should be in tabular form

 
Angular can be very unintuitive.
"Why isn't my promise resolving?"
"Oh, it's tied to the Angular digest cycle."
|:
 
9:55 AM
> We can provide you a store credit refund if you cancel this product. This credits can be used for future purchases or renewals and has no expiry date.
Time for digital ocean
 
Monking
 
I'm voting to close this question as off-topic because it is about optimization of working code, it is more suited for Code Review or Database AdministratorsGerald Schneider just now
 
@Quill you should see some of the code I'm refactoring now. I feel dirty. :(
 
dirty times call for dirty code
the main thing is understanding why it's wrong
 
  /**
   * Set the permissions of the active user to the given PermissionSet.
   */
  set permissions(value: PermissionSet) {
    this.$permissions = value;
    this.permissionsHaveBeenSet.resolve(value);
  }
permissionsHaveBeenSet is a deferred object
Side effects :(
But it's a remnant of the old system, so I'm just writing tests to verify it works like this for now
 
possible answer invalidation by Bassie on question by Bassie: codereview.stackexchange.com/posts/119278/revisions
 
    it('should return the permissions list after the first time it has been set', (done) => {
      const expectedPermissions = ['testPermission'];
      authSvc.permissions = expectedPermissions;

      authSvc.awaitPermissions().then((permissions) => {
        expect(permissions).toBe(expectedPermissions);
        done();
      });

      // $q is tied to Angular's scope.$digest cycle
      $rootScope.$digest();
    });
Angular *shakes fist*
@Duga Looks fine. Just OP changing a URL in his code
 
10:18 AM
0
Q: (C++14) Handling state in C-style function pointer callbacks

djrollinsI'm having some issues coming up with a sensible solution for using shared state in a C-style function pointer. I am using GLFW to handle my OpenGL context and have created a thin wrapper around all of the setup code. I want to provide a way of registering callbacks for key presses, however the g...

 
10:55 AM
Monking
 
Hello @skiwi
 
11:10 AM
0
Q: Natural merge sort in C

coderoddeI have this C implementation of the natural merge sort: #include "stable_sort.h" #include <stdbool.h> #include <stdlib.h> #include <stdio.h> #include <string.h> typedef struct run_length_queue { int* storage; size_t capacity; size_t head; size_t tail; size_t size; size...

 
This query suggested I should answer this question. Uhm, no.
 
@Mast magic
 
It has a weight of over 2800, but doesn't understand the language tag is the most important of them all.
 
12:03 PM
1
Q: Adding LINQ support to distributed cache: design

KefirI'm adding LINQ support to an existing distributed cache interface, which looks like this (simplified, full code is there: https://github.com/apache/ignite/blob/master/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs) public interface ICache<TK, TV> : IEnumerable<ICacheEntry<TK, TV>> ...

0
Q: how to find positive (negative) subngraph from given network dataset by using networkX(python)

sunainaactually i want to find a +edge and -edge and positive (negative) subgraph from a given network dataset my code is below from this code only i get a subgraph , i don't find the positive subgraph and positive edge import networkx as nx from networkx.algorithms.components.connected import connecte...

 
Greetings, Programs.
 
Greetings, @Donald.McLean.
(You do realize that we're not replaced by programs, yet, right?)
 
12:18 PM
Yes. I don't even believe in strong AI. It just seems like an appropriate greeting for this chat room.
 
Haha, was just kidding ;)
I do think that neural networks (or an evolution of that) will be able to mimic the human brain at some point
 
Zak
@skiwi I don't know if they'll ever mimic the *human* brain, but I reckon they'll become our intellectual equals in the near(ish) future, and become exponentially superior almost immediately thereafter.
 
Still it's interesting that they need training data, do we buy a pet robot and walk him through the house and through the neighborhood, teach it look videos on YouTube and then watch him learn and eventually kill you?
 
Zak
@skiwi Why interesting? Is there any organism that *doesn't* develop that way?
 
Probably not, but it's interesting as it's not an organism, but purely tech-based, though you may wonder that it'd be able to do things differently
 
12:29 PM
0
Q: using viewmodel create comper and edit

DannyI have this really long httppost action results that I add and update 3 db tables I think it's to long and can get shorter and smarter thank you for review public class AllVm { public AllVm() { this.wri = new Writer(); this.sub = new Su...

0
Q: JavaFX save method for two files

Dr.FykosI am working on a JavaFX application where the user through a series of textfields and dropdown menus has to create some sort of report. The data from the user are written in an xml file, I also convert the xml file to html and display it with the Webview class. The following code is the save m...

 
Zak
I thoroughly recommend the WaitButWhy "post" on the subject waitbutwhy.com/2015/01/…
 
I opened it up on a tab ^^
Any (non-)expert on code coverage here?
If I have a method like this:
@Override
public void add(int index, GameObject gameObject) {
    gameObjects.add(index, gameObject);
}
 
Zak
I say "post" because it's really 2 posts, across a word count of 23,000, which is not that far off a full-blown novel.
 
Where gameObjects is a java.util.ArrayList<> from the Java standard library
What do I really need to test then? ^^
@Zak That's quite a lot
 
Zak
@skiwi WaitButWhy posts are usually like that.
You can end up waiting a couple of months for one, but they cover topics in impressive depth.
Plus, it has funny stick-figure drawings ^^
 
12:34 PM
@Mast Thank you!
 
@skiwi You probably wouldn't want to test the individual add method.
But you might want to test that when you add something you can verify that it exists.
Honestly though testing data structures like that is a slippery slope, so I would just aim for that at an integration test rather than a unit test.
You shouldn't test any code you don't own (generally)
 
0
Q: how to save output screen data in text file in python and then how to use this data for ploting a graph on matlab

sunainafor example my code is this : import networkx as nx from networkx.algorithms.components.connected import connected_components import matplotlib.pyplot as plt G = nx.read_edgelist('/home/suman/Desktop/dataset/CA-GrQc.txt', create_using = None, nodetype=int,edgetype=int) H=nx.connected_component_s...

 
But what if the implementation changes? Then there would be missing tests, though if you track code coverage, then you should notice a drop
 
@skiwi If the implementation changes you should catch that if it causes an error in your integration test
Unit tests should be a black box, so you should test without knowing any of the internals, including the implementation.
2
You don't care about what happens in the implementation, only that the interface fulfills a contract
So if I had an add and a hasItem method, I would want to check that after using add the item was accessible from hasItem
but I wouldn't want to check after using add that the item was visible in some internal list
 
Post at codereview.stackexchange.com instead, and when you do, be sure to include the actual code. — Biffen 59 secs ago
 
12:41 PM
As an aside you want to limit mutability as much as possible
 
1. Minimal, Complete, and Verifiable example must be in the question, not a fiddle link (and definitely not a comment). 2. Did you mean Code Review. — jonrsharpe 49 secs ago
 
It may be worth instead of having an add method you simply take a List<T> in a constructor instead
Unless you do need to add things at runtime
 
@DanPantry Yes, but would you also test what happens if you add the item at the end of the list, at the front, and at some random index?
 
@skiwi Well, if my methods were literally add and hasItem, I don't care about position
Here's an easier question.
Are you implementing your own data structure?
No? Then don't test the data structure.
 
Yes No
2
Maybe it is my own data structure, but I don't intend it to be a general purpose data structure
 
12:44 PM
See, this is why you do TDD and you write the tests before your implementation
Because you already have a decision of "I want to make this data structure with an add method" instead of workign out what you actually need :P
You aren't making your own data structure; you're making a class which encapsulates a data structure
I wrote a class earlier that stored a list of permissions
and I added a hasPermission method on that class
 
Thanks, I will post it in Code Review as well — badigard 15 secs ago
 
that class, in its' implementation, uses an array
I don't care about where that element is in that array, i just care that it exists
So I don't test what happens when its added to what index. I just test that hasPermission works if the element is in the underlying array
You have java.util.ArrayList in your example
java.util.ArrayList is a random access data structure
So you can safely assume that positions will be correct and maintained etc
You don't need to test that
 
@DanPantry Right, but that's a detail of your interface, in this case I do care about the position
 
@skiwi Well, i alraedy answered that earlier
> You don't care about what happens in the implementation, only that the interface fulfills a contract
If your interface says "position is important" then, yes, you should be testing that position is maintained.
 
@DanPantry Correct, but you should test it as a black box, so you don't know the implementation and hence you cannot assume that random access is already implemented properly?
@DanPantry Right, that's more what I was asking, so because it's delegating I cannot just assume that I don't need to write a test for it as long as coverage doesn't drop? (Due to different implementation being used)
 
12:50 PM
@skiwi Yes. I think.
Also, don't use coverage as your metric for "I've written enough tests"
Write enough tests for you to feel comfortable with it
 
^^ Okay
 
Coverage is useful as an overall metric
But test coverage is not a measure of completion
Maybe @janos or @nhgrif can weigh in here (or anyone else who uses TDD)
 
Hmm, I just realize that in order to properly test this class I need to be able to take a List<> as constructor argument, as opposed to calling .add() for every element, is that one of the things TDD is supposed to catch?
In my code I won't be needing a List<> as constructor argument as far as I'm aware though
 
TDD is meant to make you think about your interface (rather than an implementation)
If you realise "I can't test this without a List<T> in the constructor" and you don't need a List<T> in your constructor in your normal code, that's TDD telling you that you do actually need a List<T> in your constructor in normal code.
 
Only I could test it, but it means manually calling .add() for every item
 
12:56 PM
0
Q: JavaScript Code Exercise

badigardI need advise on how to improve the following code for this exercise. I need to write a function which receives 2 arguments: Data records ///"id,first,last,email\n" + "555,John,Doe,jd@gmail.com\n" + "666,Jason,scott,js@gmail.com\n" + ............ Parameter // "email" I need to return a funct...

 
@CaptainObvious ouch, no intentation.
Why can't I tab-complete Cap's name?: (
 
@DanPantry On what exactly?
 
@nhgrif @skiwi was asking whether or not he should write tests for coverage on a data structure (java.util.ArrayList<T> specifically).
 
No. Java or whomever maintains Java should write tests around java.util.ArrayList<T>.
 
@DanPantry Because it's a ghost
Maybe the question more boils down to: Do I need to write tests that have no effect on coverage?
 
1:00 PM
Yes.
 
Ideally you'd write tests before you code, so you'd never have any code written that didn't have tests.
 
Consider an example of a priority queue.
 
That would give you 100% coverage but it still wouldn't catch edge cases (like incorrect input). In that event, adding tests wouldn't give you more coverage, but you would need to do it to verify your code is correct
 
With a priority queue, you can end up with 100% coverage well before you are satisfied that all the scenarios are tested.
If you end up with 100% coverage before all of the scenarios are tested, those other scenarios may or may not work. Maybe there wasn't enough code written to ensure those other scenarios work.
 
@DanPantry Yet doesn't incorrect input throw an exception, hence something you could test for with coverage?
 
1:03 PM
@skiwi Not necessarily. Not all "incorrect" input is statically analysable
 
@nhgrif Right, that makes sense
 
If you're writing an e-mail address parser (god help you) for example
 
So only way to proof that your code is correct using some metric is by writing formal validation using invariants, etc.?
 
But if you then write tests for those other scenarios and the tests are still passing, your code is probably in good shape. It's probably good if you hit 100% coverage well before you have actually tested all the scenarios. It probably has a good algorithm behind it.
 
^^
Basically everything I say will be echoed by @nhgrif so listen to him
He has far more experience in this than I do as well
 
1:05 PM
So 100% coverage is just one of the good indicators of a good codebase, while a decreasing coverage is definitely a bad sign?
 
I would say that incorrect use of third party libraries is a much more important issue with respect to adding tests after the code is 100% covered, since coverage of external libraries is not tracked.
 
One possible sign to test an external library would be to write TDD tests exploring how that library works.
 
But also what's important, tests exist largely to protect you from regression. You have 100% coverage today. What if you refactor tomorrow? Will you still be at 100% code coverage in the refactored version, and if not are you confident your code is still strong enough to withstand regressions?
 
But java.util.ArrayList<T> is almost certainly not an external library - it's part of the standard library. Bugs in it are quite rare
 
@DanPantry I was actually thinking of errors in how libraries are used that would show up in some cases but not in others.
 
1:07 PM
@skiwi Not necessarily. Sometimes, you have to write more code in order to squeeze out a bit more efficiency in one way or another. And sometimes an if statement that takes multiple lines is equivalent to a ternary, just more readable. Depending on how your coverage is counted, the ternary can give higher code coverage number.
For example...
 
return fooOrBar ? foo : bar;
That ternary only needs to be hit once to give 100% coverage for the line.
but...
if (fooOrBar) {
    return foo;
}
else {
    return bar;
}
The if needs to be hit once with true and once with false if you want 100% coverage.
 
True, but I more meant that if some number of commits later you find that test coverage has dropped, then you should be worried?
 
Yes. But not necessarily about the quality of the code.
 
Say someone in your team has been assigned a big refactoring for performance reasons, he hits improved performance, but test coverage regresses from 95% to 85%
 
1:09 PM
You should be worried that you've been adding code without adding tests.
6
 
Software is a loan shark, and it's awful to get in debt with it.
3
 
We're working on adding stuff to our lineup tool that will automatically red flag projects that have significant drops in coverage numbers like this.
 
@DanPantry takes more than your kneecaps... your soul
 
Zak
@DanPantry Because @CaptainObvious is not a user (Like @Duga) but a data feed.
 
Technically they're a negative user; but effectively yeah
 
1:12 PM
@skiwi In my example above, we'd drop from 100% coverage to 50% coverage. And if we were never calling with fooOrBar equal to false, our coverage would continue to drop as we added lines in the else statement. So all of a sudden your code base could have some incredibly nasty code that never makes it through a unit test.
Or, consider doing date formatting? The standard library in iOS has an NSDateFormatter. Once you set the format string, getting a string from date (or vice versa) is a one line call: let myString = myDateFormatter.stringFromDate(myDate)
I only have to hit that line once to get 100% coverage on that line.
And I assume that Apple has tested that method up and down all over. But that doesn't necessarily mean that I'm using it correctly.
 
I'm an idiot
7
My tests just caught a stupid error, pretty good timing in this conversation
 
I shouldn't be testing stringFromDate directly. But most likely, I've written a convenience wrapper around it.
 
If you want your code reviewed you should post to Code ReviewNathanOliver 25 secs ago
 
Zak
@DanPantry So you're an idiot for making the error, but a smart programmer for writing the tests to catch it?
 
@DanPantry you don't learn with that phrase, do you
@Zak so that makes him a neutral programmer now, then?
 
1:16 PM
@nhgrif Hmm okay, I get your point
 
If you need to go over many data files it can help to use make. I gave an example there. — bdecaf 32 secs ago
 
More often than not by tests catch an error in my tests rather than in my code under test
 
Well, first, you just need some practice.
 
That means that you're either writing your tests to the wrong specification or your code does not work as you expect
 
Or I'm just an idiot when writing tests
 
1:26 PM
But even then, tests assert the assumptions we're making about the code we're testing. Either the code is wrong or our assumption is wrong.
 
This is interesting, a test is failing half of the time, turns out that there are multiple valid solutions to this problem and the algorithm is non-deterministic because it uses a set and the used hash codes change at every run
 
Then your test needs to accept any of the valid solutions.
assert(validSolutions.contains(actualSolution)))
@DanPantry I might disagree with this...
 
Hmm right, hadn't thought about that way yet
It's a list where some subranges have multiple solutions, and in those subranges there are multiple solutions too
 
Unit testing is more like white-box testing. Black-box testing would be your functional/UI tests.
 
@nhgrif you mean the integration tests ;)
 
1:32 PM
They have several different names. And it depends on what you're testing exactly.
 
Hi there! Sorry, your question is too broad for Stack Overflow, where we like to focus on more specific programming problems. There is a sister site, Code Review, which specifically exists to provide constructive feedback for working code. Since your code appears to be working, I've migrated your question there. Just join that site (it is very easy to do so, no additional signup hassle) and the question will automatically be attached to your account. — Martijn Pieters ♦ 53 secs ago
 
If we're talking about some library code, the white box tests only hit the methods exposed in the public interface for the library. The black-box tests are going to be your plethora of unit tests that hit all of the individual methods.
If we're talking about an iOS app, your unit tests are the black-box tests. The automated UI tests that interact with the app through the UI (in only the methods an actual end user could interact with it) are your white-box tests.
 
0
Q: Formatting criticism and classes (python 3)

frankehhhTwo things here. First, I am pretty new to Python and I would like some tips and criticism on my formatting style/code and what can be better organized. Second, I am a bit shaky on how classes work, but I think that it can be used here to make it more simple. If someone could guide me on how to d...

 
@captain pretty bad title
 
Monking
 
1:46 PM
monking
 
monkin
 
1
Q: "throw-away" code review (pre-bootstrap)?

Basile StarynkevitchI'm coding the MELT monitor on github (GPLv3+ licensed free software, alpha stage). Ultimately most of the code I am coding manually now should be replaced by generated code. It is my first "Web" application (so I do feel like a newbie regarding Web technologies, but I am learning them) and it i...

 
2:12 PM
0
Q: Lisp-like DSL code review

Basile StarynkevitchI am the main designer and implementor of GCC MELT, a Lisp-like domain specific language -which I call MELT- to customize the GCC compiler, implemented by a bootstrapped meta-plugin for GCC. GCC and GCC MELT are both GPLv3+ free software. GCC MELT is quite big (80KLOC of MELT code) and is bootst...

 
2:22 PM
0
Q: Tidy up multiple jQuery onClick events

DevJunior The 50421stSo I have a ton of jQuery onClick events. onClick I hide/show different UI elements. I was wondering, how can I tidy the code up and make multiple onClick events more readable? This is a chunk of code from my project : $('.info_2').on('click', function() { $('#nav-wrapper').toggleClass('hidde...

 
If you are looking for code review, you may be better off asking on Code Review or perhaps on Reddit. — Shepmaster 56 secs ago
"Is this right?" Does it work? If you have working code that you want others to review you should probably ask at codereview.stackexchange.com instead. If your code doesn't work you need to provide more information about the issue(s) you're experiencing. — Michael 23 secs ago
 
2:45 PM
I was wondering why my code formatting suddenly was so weird, turns out I changed continuation indent from 8 to 84 instead of 4
8
 
0
Q: How can I stop unaccomplished generator?

theothecookieIn ES6 added cool thing - generators. It's realy awsome, because it let to write plain async code. I'm using co to fire generators: class MyAppClass extends events.EventEmitter { constructor() { //some init actions this.on('ImportantEvent', this.createSession); } createSessio...

 
@skiwi 84!
 
3:07 PM
0
Q: Performance of the String searching algorithm

Alpa8I am trying to solve a string matching question mentioned here.I recently learned the Knuth–Morris–Pratt algorithm and tried to implement it to solve this question.But I am getting a TLE for this code: import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokeni...

 
@CaptainObvious nope
var object = {
    toString: function(){
        var obj = this;
        var total = '{';
        Object.keys(obj).map(function(key, index){
            if (obj.hasOwnProperty(key)) total += `'${key}':'${obj[key]}'` + (index < obj.length ? ',' : '')
        });
        return total + '}';
    }
};
var newObject = Object.create(object);
newObject['a'] = 1; newObject['b'] = 2;
newObject.toString(); // {'a': '1', 'b': '2'}
that's how you fix that [object Object] thing
We might need a user merge
 
3:28 PM
@Quill OP edited
> I wrote a working code, but how can I stop whole coroutine in right manner?
or should it have been closed as "hypothetical"?
 
It's hypothetical, yeah
 
Hi @Barmar, I guess this question should go to code review site, I was looking for a answer whether my solution is good or I need to use JS reduce function, or is there a better standard logic to do it. — Dilip Rajkumar 40 secs ago
in SO is it possible to move the question or do I need to delete and ask again in code review? — Dilip Rajkumar 21 secs ago
 
0
Q: PHP-Sanitizing/Validation Myqli prepared statements 2016

user3016065I'm currently working on sanitizing/validating user input that will be stored on mysql database with the help of password_hash(). I have 4 variables( $firstname, $lastname, $email, and $password), all contain same steps. I would like to know if the following code is the "proper way" to maintain ...

 
@CaptainObvious is the 2016 for oh god, it's 2016 and I'm still using this shit?
5
 
@DilipRajkumar you need to delete and re-ask on Code ReviewZak 42 secs ago
 
3:37 PM
@Quill just a coincidence. it's the 2016th question about
3
 
eww
 
These type of questions is better suited on : codereview.stackexchange.comJonas W 58 secs ago
do you have a question? or do you want a code review? — user1666620 33 secs ago
 
4:19 PM
0
Q: Creating and manipulating FITS files--astropy.io

Joseph FarahI wrote a program that manipulated data from VLA observations and created FITS files to be used in creating spectral energy distributions of high redshift radio galaxies. I really tried to be as efficient as possible--I made lists of the variables and lists I had to use, I looped everything where...

0
Q: Is it bad practice to have an inherit from a view model in MVC?

davyI have a situation where I have a bunch of common properties in a view model but have certain cases where I need to extend it. I created a couple of derrived view models, which I pas into views that expect the derived view Model. (I realize I could use a Polymorphic Binder but I'm happy with jus...

 
@CaptainObvious hypothetical
 
You should check out Code Review, I think the question currently is off-topic here. However, note that Code Review also has strict guidelines (one that it shares with SO that you should provide a minimal and working repro of your situation if at all possible). Be sure to check out their FAQ if you decide to post there. — Jeroen 38 secs ago
Thanks for the pointers. This is not a request for a code review. I am trying to understand a new language based on a language I already know, and am asking some simple questions to clarify that understanding. — chkn 27 secs ago
Questions about improving functioning code are more appropriate on Code Reviewjmoerdyk 31 secs ago
 
4:36 PM
> If the next header number is generated by the view, Use RecordCreate to generate the next available header number. If the header number is specified by the caller, use RecordClear to initialize the fields of the header, then Set the header number in the header view.
I hate this API
4
 
@jeroen I don't know if your understanding or just your explanation of Code Review's requirements are wrong, but we have very different requirements from SO. (working? yes. Minimal? No. Also, example, hypothetical or stub code is automatically Off-Topic anyway.) you (and the O.P.) should check out A Guide to Code Review for Stack Overflow usersZak 24 secs ago
 
0
Q: Correlation and Dependence

Fred VioleIt is well known that 0 dependence implies 0 correlation, while 0 correlation does not imply 0 dependence. I have a paper here illustrating nonlinear correlation coefficients from relationship subsets of the joint distribution. I have another paper here demonstrating that dependence is the averag...

 
Zak
@Duga I *think* I got my point across without being too confrontational.
 
Steve Feldman on February 9, 2016
What's the deal with ad blockers?
 
@StackExchange Because those using AdBlockers are still generating traffic by posting questions and/or answering them, obviously.
Like moi.
 
4:50 PM
The only time I get ads is when I'm not logged in. Like, never. Who keeds an ad blocker when they got rep?
 
The only ads I see are community ads. No clue what the rest looks like.
@Mat'sMug Too lazy to add a blanket exception for all SE sites.
 
Oooh I know! I'll make a ViewKeyAttribute and have the "entity" mapping specify how the key is generated
@Mast if you have like >200 rep you don't see ads anyway
They appear between questions and answers when you have <200 rep
 
I don't have 200 rep on many of the SE sites I visit.
I don't have 200 rep on many of the SE sites I visit.
I don't have 200 rep on many of the SE sites I visit.
 
Did you ask the code reviewer? This seems pretty opinion based, and there may be some business reasons specific to your situation what may dictate the reason why the VM should be duplicated. — sous2817 39 secs ago
 
@Mast uh, am I the only one to see this message 3 times?
 
4:57 PM
I see it three times too.
 
@Duga business reasons for duplicated code? No way dude, no way.
 
0
Q: More performant javascript game tick?

quantumpotato installLoops() { window.requestAnimationFrame(this.loop.bind(this)); } loop() { this.now = Date.now(); var delta = this.now - this.last; this.last = this.now; this.dt = this.dt + delta; if (this.dt < this.rate) { window.requestAnimationFrame(this.loop...

 
I've had SE try to post messages multiple times when I post it once.
 
I think the chat api normally eats duplicate consecutive posts
 
I see it three times three times three times too.
 
4:58 PM
I need more coffee coffee coffeeeeeee
 
@Mat'sMug Normally, yes, but there are bugs.
 
impossible!
 
Impossibru
 
Very possible. Apparently there are 1-5 bugs in every 1000 lines of code in production.
I just read that interesting statement the other day, but I lost my source.
 
-1
Q: C sharp using threads no async await

Kunal PrajapatiWrite a program which will keep accepting a number from the user endlessly and it needs to be added to the previous number and stored to a file. Accepting input and storing output should be independent of each other and should run in parallel. Note: * Don't use static variables anywhere Sample ...

 
5:06 PM
@CaptainObvious what makes people think this type of question is on-topic here, beats me
 
@Mat'sMug Where did your verb go?
 
makes
 
The one after "people".
 
 
@Hosch250 You lost your source... code?
 
5:10 PM
@skiwi No, my source to cite.
 
This probably belongs on code review, not here — Bob Dylan just now
 
I'm working on disambiguating sentences for college:
1) I’m going to wax the car in the garage.
   a. I’m going to wax the car that is in the garage.
   b. I’m going to wax the car while working in the garage.
There, that looks a little better.
 
I'm voting to close this question as off-topic because it probably belongs on Code ReviewPeter Wood 40 secs ago
 
5:25 PM
I thought that was kind of interesting ^^
 
This would likely get downvoted on Code Review for not having a sufficient description of what the code is supposed to do. It would be on topic, but not a spectacular question. — RubberDuck 42 secs ago
 
@EthanBierlein Me too.
 
0
Q: Extract DTS:Variable from deployed SSIS package

need_the_buzzI am working on a task to extract a specific variable from all the SSIS packages deployed in production. We are using SQL Server 2012. I found a way to parse it out from the XML code using vb.net code. This will only work if the package is in the file system. How do i extract the XML code from th...

 
I am very anti-ads. I wouldn't mind it so much if the ads weren't so in-your-face, and weren't so sleazy, and weren't common tools to deliver malware, and if the ad-tracking companies didn't stalk you around the web (I'm surprised no one has made it into a stalking case yet - they've only made cases about privacy as far as I know).
They would probably lose if they tried to make it a stalking case though because it wasn't directly targeting them, unless, perhaps, it was a class-action case.
 
http://www.commitstrip.com/en/2016/02/09/the-childhood-of-a-coder-cant-stop-watching/
CommitStrip
The childhood of a coder: Can’t. Stop. Watching.
CommitStrip
1455038447
4
 
5:36 PM
@CommitStrip Oh yes!!
2
 
5:56 PM
So that's why we are all coders...
 
Zak
@CommitStrip Is that defrag?
 
@Zak damn skippy!
 
00:00 - 18:0018:00 - 00:00

« first day (1011 days earlier)      last day (3006 days later) »