« first day (1683 days earlier)      last day (2376 days later) » 

12:00 AM
RELOAD! There are 4812 unanswered questions (90.2829% answered)
I recently posted on codereview rewritten version of "add 10 integers" code, which was written without loop too. It's 64b x86 code, and using stack for local variables, so it may confuse you a bit, but if you will try for a while to check the differences between OP and my version, maybe you will get the grasp of the principle, how to use certain memory more "array"-ish: codereview.stackexchange.com/q/181953/110284Ped7g 36 secs ago
12:19 AM
@200_success How's it going so far?
2 hours later…
1:52 AM
Q: Create a Powershell script to create 10 users and their respective password, this could be either interactively or built-in in the script

68DCISCreate a Powershell script to create ten users and their respective password; this could be either interactively or built-in in the script. I need help with this asap. Thank you for your support.

2 hours later…
3:26 AM
Q: Setting all possible combinations of values

Jonathan Woollett-lightI have a circumstance where I need to create every single possible version of an object upon a particular magnitude. After this, a process occurs which determines the best combination of values at this magnitude and then sets these for the next iteration of the magnitude reduction loop. double b...

1 hour later…
4:49 AM
Dear god, someone figured out how to write a regex that only matches itself http://codegolf.stackexchange.com/a/31863?stw=2
PPCG at it again, why in gods' names
Oh wow that's over a year ago, sorry
5:22 AM
Q: next number in an array sequence

aruncjH, i am a learner- please help with this array problem.I have to find the next number in this array sequence. Output i.e Sample Input and Output: 5--n total numbers to be entered. 2 3 5 4 1 Next customer id is 6 ** Program ** import java.util.Scanner; public class help1 { public static vo...

Q: Write a user input code

Jackson StewartBasically I am creating a puzzle game us html, css, and Java script. In one part of the game you have to enter a code like 4444 or apple and if the user enters the code wrong you lose but if they type 4444 or apple they move on. Now I have never used java script ever because i haven't needed to u...

Is there a problem with your code? Stack Overflow is about issues with your code. Not about improving working code. Code Review is the website to ask such questions. — icecub 53 secs ago
5:43 AM
@Phrancis 3 years ago.
Still, impressive.
The tweet was from a year ago.
They've done some very wacky things at PPCG.
6:00 AM
possible answer invalidation by Martin R on question by aruncj: codereview.stackexchange.com/posts/182567/revisions
6:21 AM
Oh damn
6:44 AM
@Duga Fine.
@Ludisposed Friendly reminder: our game expires if you don't move within 4 hours.
And 5 seconds after I say this, the pieces move. Magic.
While there's nothing wrong with your question per se, this is not the place for it. SO is a place for specific coding issues. If your code is working then it doesn't qualify. Try Code Review. — jmcilhinney 1 min ago
I'm voting to close this question as off-topic because it belongs on Code Review. — jmcilhinney 57 secs ago
7:10 AM
7:24 AM
@Mast Haha magic :)
Q: Resolving run time error -uva 466

YonexI am trying to solve a uva problem(uva 466). I have also solved it in my way. But whenever I submit it, it is showing Run Time Error. The problem link is here uva 466. Can anyone help me in this regard, please?? here is my code import java.util.Scanner; public class Main { public static bo...

7:50 AM
Q: Copy data from another sheet after matching the cases in column and inserting new rows as per the copied data

Anuj Variavaneed your urgent help. I have a range of data in on sheet and other data in 2nd sheet. the value in "C" column of sheet one is to be matched in sheet 2 "A" column and the total rows that matches will select & copy the adjourning cells of column "B" and "C". this will be inserted in the sheet 1 "G" &

8:39 AM
codereview.stackexchange.com/questions/182558/… This does not work like the author proclaims it, the checking for private or public addresses are just wrong... VTC as off-topic?
8:53 AM
Q: Simple python code takes command line argument for file location and tokenizes text

Jeremy H.I am trying to make this small snippet of code do things that it is not designed to do: import sys #Open file passed by terminal if len(sys.argv)==2: try: open(sys.argv[1]) with open(sys.argv[1]) as inputfile: #Iterate through lines for line in...

9:17 AM
@Ludisposed From a beginners POV it looks like it should work. If it doesn't that makes a good answer.
@Peilonrayz It doesn't all work, however it does print ip addresses. Just everything else is noise. There is no implementation of threading nor checking for private/public
Q: pancake sorting using python

noman pouigtpancake sorting is implemented below. Algorithm is below: Find the largest out of order pancake and flip it to the bottom (you may need to flip it to the top of the stack first).Repeat step one until the stack is ordered. from random import randint def pancake_sort(cakes): if not cakes or le...

Q: Refactor large case switch with design patter

R4nc1dI am trying to build a report based on certain condition. The problem is that I have a massive switch statement which is a code smell How can refactor the following so that it is more maintainable. I just copied/paste some of the values to show how the case will look. switch (countryId) ...

@Ludisposed They all sound like points you can raise. However saying something is broken because ipaddress.ip_address(ip).is_private doesn't work the way someone may think I don't think is valid
That is not the reason it is broken: 1. the is True on a integer is just wrong. 2. Checking for private is at the wrong indentation, so it actually doesn't do anything it will always return an ip. But I posted, will explain myself maybe more.
@Ludisposed 1. 0 is True works fine, unless they say 1 is True doesn't work properly then no it's not broken for that reason.
2. I'll check that, but is a good point to raise in the CR
9:33 AM
1 is True won't raise an error or anything, it will just be False.
@Ludisposed We're here to educate users, and the rules have been in favour of helping naive users. It's much more helpful to say random_ip(public_only=1) should be random_ip(public_only=True), you get rep, the asker gets help and no-one's pissed that the question's closed.
If you don't agree, then start a VTC
@Peilonrayz I agree... maybe should alter the tone in my post. Thanks, Guess I am just a bit snarky today ;)
@Ludisposed No problem, we all have bad days, ): I've been snarky lately too...
10:07 AM
maybe ask this in the codereview website? — Akintunde 7 secs ago
Q: Stack for asynchronous processing

Matthias BraunThe following TaskStack processes input elements asynchronously based on a function that it receives at construction: TaskStack<String, Integer> stack = new TaskStack<>(String::length); In a realistic scenario, this function would be long-running. We can add input elements to our stack to hav...

10:43 AM
Q: Stock Monte Carlo Tree Search implementation to a simple connect 5 game in Python

LukeRequired python version: 3.6+ fstrings included! External link: https://github.com/thejhonnyguy/Python-Stock-MCTS Code. (Questions below) Main program: mcts.py "stock mcts implementation" import sys import copy import random from board import Board from node import Node MCTS_ITERATIONS = 10...

10:58 AM
Q: Implement a doubly linked list program to concatenate two lists at a specified element?

LahariI am beginner in data structures I was unable to recognise the problem here. My code is going to infinite loop while displaying. Is this a right way to implement. Can any one help me to get over to this problem? Here is my code, public void concatLists (Concatenate list2, E ele) { Node<E> temp ...

@CaptainObvious Broken.
11:21 AM
Theres' a code review site: codereview.stackexchange.comAdelin 55 secs ago
Although I'm not sure if it's the right place. Check that help center as well. I might have seen something in the lines of [...]examples of titles that are unacceptable[...]: Simplify this chain of if statements (Applies to too many questions.)Adelin 25 secs ago
Q: Optimizing grid based inventory

FiffeI am trying to create a grid based inventory and so far everything is going well except for one thing. The inventory consists of Grids that are built of Cells, Grids can have custom size (like 5x3, 3x3). Every Cell is always 1x1 and can hold Items which can be of different sizes (like Grids). I...

11:55 AM
wow ... 10 minutes of packaging time ..
because each and every packaging phase needs to run the damn tests...
Q: How to handle different responses from external API correctly?

Zhi VI have PHP cronjob script. I need to send requests and get responses from some API. So, there is a code of the API class. In this class, I connect to API and I call public methods of this class from another class. class Api { private $authApi; private $logger; function __construct() { glo...

actually the full compilation suite ... wtf...
I think if you posted the slow piece of code you might get a better response; but if it gets the right answer then I'd suggest posting it to code review might be the way forward — UKMonkey 17 secs ago
12:29 PM
Most of that, except for the Code Review bits. — jessehouwing 55 secs ago
1:03 PM
Q: I found this javascript on a webpage, what is its purpose?

leonixyzI found a very strange javascript on a page. It was encoded in a large base64 string, then enclosed in atoi() and eval()d. Like this: eval(atob("0aW9u...UuYWRkR")) I decoded it and beautified the code. I admit it is quite a big script, but the code was not minified so it is readable, is some...

1:21 PM
Q: Is this a correct Stairway implementation?

Camilo TerevintoI've been reading on SOLID and dependency injection, and I was wondering how to prevent the client (ASP.NET Core) which contains the DI container from having to reference my domain implementation layer, so I came up with this: The Web project (references DomainAbstractions, DomainInjector, Core...

@CaptainObvious Off-topic, but seems to be a cryptominer. Can I flag for migration to security.SE in some way?
1:38 PM
use codereview.stackexchange.com for this kind of purpose, it's too generic and opinion-based for here — WNG 44 secs ago
1:50 PM
Greetings, Programs.
Q: function addHandlers

code4everI'm experimenting with text editing with fabricjs objects and have the following code that works but that I'd like reviewed. It feels really clunky to me for some reason and as I'm new to handlers I'm sure what to change if anything? function addHandler(id, fn, eventName) { document.getElement...

@Donald.McLean Greetings, programmer.
2:17 PM
WB starts in less than half a day.
2:34 PM
@Hosch250 What is WB?
I get asked that question every year.
2:45 PM
Q: C++ - algebraic expressions calculator by addition

VenoI'm ultra new to programming. I basically know only IFs, loops, variables. This is first time I used functions in my code and I'm not sure if I understand them correctly. Basically it is a calculator that requests two natural positive numbers on input, and outputs it's addition, subtraction, mul...

Q: calculate knight moves (my first python)

TweakimpThis is my first little python project. I want to get to a point where i can solve chess puzzles like this one from puzzling.stackexchange. I want to be able to change the board size to something like 15*15 or 3*7 and still all rules to apply. So far, you can just run the file and it gives all p...

Vista died this year :)
Back in April.
7 dies in January 2020.
8.1 is off mainstream support this coming January.
possible answer invalidation by mdk on question by mdk: codereview.stackexchange.com/posts/182156/revisions
@Hosch250 I was in other another room and just saw that line, I was like: How can he knows how many died in something before it happens.
Now with context it makes a lot more sense
@Duga rolled back
2:54 PM
@Hosch250 It's about time.
@Ludisposed Are you sure they'd take it?
Q: Releasing a T-Rex into a modern ecosystem wouldn't be that bad, right?

GreenT-Rex Forever LLC has a mating pair of Tyrannosaurus rex. They're a bit shady on how they got them, time travel, cloning...they won't say. Third-party biologists and paleontologists have examined the pair and their first clutch of offspring. They are definitely real. Somehow, T-Rex Forever go...

I'm thinking of linking to that question every time somebody tries to find an excuse to use eval.
Q: Test all C# properties with single test function

StephenHIn writing unit tests for c# functions, there is a good case made for testing properties. In testing those properties, I felt there should be a few goals. Provide a wide range of inputs Test additional features like PropertyChanged Don't write a ton of very repetitive test code So I came up w...

3:15 PM
@Mast I think with more information, this could be a valid question. But he would need to give alot more information, and ask an actual question. But yeah, normally (explain this malware) questions are frowned upon.
Q: Optimizing Needleman-Wunsch algorithm in Java

Najm SheikhFor a class assignment, I was required to implement the Needleman-Wunsch algorithm in Java. I have already completed the assignment but I was wondering if there were any algorithmic (or even syntactic) improvements that could be made over my existing code to make it more efficient. You can find ...

3:43 PM
Three more VTC:
Q: Resolving run time error -uva 466

YonexI am trying to solve a uva problem(uva 466). I have also solved it in my way. But whenever I submit it, it is showing Run Time Error. The problem link is here uva 466. Can anyone help me in this regard, please?? here is my code import java.util.Scanner; public class MirrorMirror { publi...

@Mast The entire problem with those errors is they mean the program is not running fine... I lol'd, I already did VTC though
@Mast It's running fine in the compiler :P
In other words, it's a runtime error.
4:14 PM
Q: Color Rows In DataGridView

Smith StanleyI am using the below syntax to color code sales persons data. The issue that I have is that the datagridview returns roughly 12,000 rows so the coloring syntax takes some extensive time to execute. Is there a way to optimize this code? private void datagridview1_CellFormatting(object sender, ...

Q: Opencv forEach with lambda expression for parallel processing

Ja_cppI'm using forEach function to access pixels in parallel like so: // build look up table unsigned char lut[256]; for (int i = 0; i < 256; i++) lut[i] = cv::saturate_cast<uchar>(pow((float)(i / 255.0), fGamma) * 255.0f); dst.forEach<cv::Vec3b> ( ...

4:50 PM
Q: Perform logic if authenticated using certain type of authentication

zero01alphaI am converting passwords stored with MD5 into BCrypt when a user logs in. Ideally they are using BCrypt so I check for that first, then I attempt to authenticate with MD5 if BCrypt authentication failed. If the MD5 authentication works then I convert their password to BCrypt. Finally, if they ar...

5:01 PM
Q: Computing the number of primitive sorting networks on n elements

Matt SamuelMy goal here is to compute the 16th term of the seqeunce https://oeis.org/A006245 . Approximately 7 years ago I computed the 12th term and it took 250 GB of RAM and 24 hours. Now I've reduced computing the 12th term to 1 GB of RAM and 45 minutes with an iterative algorithm instead of recursive. T...

@Hosch250 Did you get a VM for testing IE 8 running?
It should be asked on Code Review at stack exchange, but if you do not modify self.books directly it would be fine to go for first approach — gonczor 21 secs ago
5:36 PM
Not yet.
Higher priorities.
@Hosch250 👌
1 hour later…
6:37 PM
posted on December 12, 2017 by CommitStrip

Q: Checking if the whole number is prime, and if all its digits are too

MateusThat was an easy one to solve but the problem lies in the efficiency since it checks every single digit of the number while converting to integers. I'm receiving TLE on the site so I have to raise its performance. So its hard to explain but the exercise ask to return "Super" when the number is p...

7:06 PM
Q: Optimize mySQL query

ndeluccaI have the following query: SELECT tab.idtab AS id, tab.type AS type, COUNT( tablog.eDate ) AS times FROM tab LEFT JOIN tablog ON tablog.idtab = tab.idtab AND tablog.event= 'ENERGY' AND tablog.detEvent = 'KEEPALIVE' AND tablog.eDate BETWEEN '2017-12-01 00:00:00' AND '2017-12-08 23:59:59' WHE...

7:20 PM
Q: Improving efficiency and performance of self created function in r

WaqasI am implementing my algorithm. Firstly, I would like to know if it is possible make it more efficient? #Packages library(MASS) ############################# #Data ############################# data(Boston) attach(Boston) x_train<- as.matrix(scale(train[,1:13])) attr(x_train,"scaled:center")<-NU...

Q: Iterator variable behaving strangely in C++

DuttaASo I am somewhat new to the intricacies of C++ and its memory handling. I wrote a piece of code in which the iterator in main function is not behaving as i would expect. It is supposed to take n inputs instead it is just exiting midway depending on the values inputted. The mergeSort and merge fu...

7:35 PM
possible answer invalidation by Jonathan Woollett-light on question by Jonathan Woollett-light: codereview.stackexchange.com/posts/182565/revisions
8:11 PM
It seems that your code currently works, and you are looking to improve it. Generally these questions are too opinionated for this site, but you might find better luck at CodeReview.SE. Remember to read their requirements as they are a bit more strict than this site. — 4castle 22 secs ago
8:30 PM
Q: Filtering of list based on different parameters

saurabh agarwalI have one interface public interface ItemFilter{ public List<Item> filter (List<Item> items, List<Obj1> obj1List, List<Obj2> obj2List) } There are three implementation for this. public Class Filter1 implements ItemFilter { public List<Item> filter (List<Item> items, List<Obj1> obj1L...

3.5 hr to WB.
@Hosch250 ( ͡ᵔ ͜ʖ ͡ᵔ )
8:53 PM
Q: Cancel running Task on Dispose and race condition

cogumel0I'm building a wrapper around NamedPipeServerStream and NamedPipeClientStream. Currently my Connect() method on the Client looks like this: public async Task Connect(CancellationToken cancellationToken = default(CancellationToken)) { var cts = CancellationTokenSource.CreateLinked...

Q: Min&Max Heap implementation in .NET

kuskmenOverview I was doing some performance optimization patterns when I stumbled upon PriorityQueue and I implemented for that reason Heap data structure, but I wanted you guys to tell me if I did something wrong. I am trying to achieve max performance and slight abstraction over the structure (what ...

Without seeing the code, there's little we can do. If the code works but is just slow, consider posting it on Code Review. Also consider the possibility that the Oracle procedure is inefficient, too. — Mat's Mug 41 secs ago
@Duga I'd have to say there's a fairly good probability that it's slow :)
Also, compile your query and make one call to the DB--or one per N records. It'll almost certainly be faster.
Or maybe you could fire your call to the DB and just continue, if you don't care if something errors.
9:08 PM
Q: LockedValue implementation

DNKI am working on class for simple sharing values between threads without race-conditions, which can't be a std::atomic (this means, no POD and no trivially-copyable types). The initial intention was to lock a std::function against writing while reading from an other thread. The class itself is si...

Q: What is the fastest solution for finding the maximum sum of a subarray?

enigmaQuestion Given an array, find the longest continuous subarray which has maximum sum. My Approach First, I solved this problem using dynamic programming which effectively solved the problem in O(n) time as opposed to the brute force approach. For each iteration, I checked if the sum is less than ...

9:43 PM
Q: c++ template class to partially implement python numpy for a neural network

Paul BaxterI just read a book on creating a neural network. The book uses python. I wanted to port this to c++. In order to do that I had to create template classes to implement some of the numpy matrix functions. The template classes that I created attempts to be portable (work on any c++), size independe...

9:58 PM
Q: Cluster tweet texts

JayI am using using the following code to cluster tweet texts. The input is a dictionary containing tweet-id and tweet text as key value pairs. Example: {'43543':'hello','984598':'how are you'} and the expected output is {0:[list of ids that have similar texts],1:[list of ids that have simil...

@CaptainObvious so tempting to take the code out of the JS snippet but must resist
2 hr.
10:15 PM
if it works and you just want feedback you should post to code review — nogad 18 secs ago
@nogad yes it works where exactly to post in code review? — John Jack 14 secs ago
sorry i forgot the link: codereview.stackexchange.comnogad 55 secs ago
10:30 PM
Seems like I've found myself in a little bit of an argument/discussion...
Is this code using a Greedy Algorithm, or Dynamic Programming? (or both/neither?)
Q: What is the fastest solution for finding the maximum sum of a subarray?

enigmaQuestion Given an array, find the longest continuous sub-array which has maximum sum. My Approach First, I solved this problem using dynamic programming which effectively solved the problem in \$O(n)\$ time as opposed to the brute force approach. For each iteration, I checked if the sum is less ...

possible answer invalidation by DNK on question by DNK: codereview.stackexchange.com/posts/182625/revisions
@SimonForsberg seems like both
at least the usual solution for that challenge is a greedy dynamic programming solution..
10:59 PM
1 hr.
If this code works fine, then this question is off topic on Stack Overflow, but may be good for our sister site Code Review. — Joe C 11 secs ago
@CharlesDuffy in the future, please don't use Code Review as a reason to close a question. Evaluate the request and use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSam Onela 17 secs ago
11:19 PM
Q: React Redux default playground

IcepickleLately I am answering more and more questions regarding ReactJS & Redux on SO and I created a basic playground that should help me answer questions faster. The goal of the playground is to have some of the basic boilerplate code prepared so that I might have an easier time creating a stack snipp...

@Peter when the code is in a working state then it can be posted there. But until then, the OP typed "I'm having trouble with it." and thus it would be off-topic. — Sam Onela 7 secs ago
11:45 PM
@Hosch250 15 minutes! 🕒

« first day (1683 days earlier)      last day (2376 days later) »