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

00:00
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
00:19
@200_success How's it going so far?
 
2 hours later…
01:52
-1
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…
03:26
0
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…
04:49
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
05:22
0
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...

0
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
05:43
@Phrancis 3 years ago.
Still, impressive.
The tweet was from a year ago.
They've done some very wacky things at PPCG.
06:00
possible answer invalidation by Martin R on question by aruncj: codereview.stackexchange.com/posts/182567/revisions
06:21
Oh damn
Monking.
06:44
Monking
@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
07:10
Monking
07:24
@Mast Haha magic :)
Monking
0
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...

07:50
0
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" &

08:39
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?
08:53
0
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...

09:17
@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
0
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...

0
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
09:33
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
maybe ask this in the codereview website? — Akintunde 7 secs ago
Monking
0
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
0
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
-1
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
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
0
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
wow ... 10 minutes of packaging time ..
because each and every packaging phase needs to run the damn tests...
0
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
Most of that, except for the Code Review bits. — jessehouwing 55 secs ago
13:03
0
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...

13:21
0
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?
13:38
use codereview.stackexchange.com for this kind of purpose, it's too generic and opinion-based for here — WNG 44 secs ago
13:50
Greetings, Programs.
0
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.
14:17
WB starts in less than half a day.
14:34
@Hosch250 What is WB?
I get asked that question every year.
2
WinterBash.
14:45
0
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...

0
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 :)
6
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
Monking
Monking
@Duga rolled back
14:54
@Hosch250 It's about time.
@Ludisposed Are you sure they'd take it?
57
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.
0
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...

15:15
@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.
0
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 ...

15:43
Three more VTC:
-1
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.
16:14
0
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, ...

0
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> ( ...

16:50
0
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...

17:01
Monking
0
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
17:36
Not yet.
Higher priorities.
@Hosch250 👌
 
1 hour later…
18:37
posted on December 12, 2017 by CommitStrip

1
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...

19:06
0
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...

19:20
0
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...

0
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...

19:35
possible answer invalidation by Jonathan Woollett-light on question by Jonathan Woollett-light: codereview.stackexchange.com/posts/182565/revisions
20:11
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
20:30
0
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 ( ͡ᵔ ͜ʖ ͡ᵔ )
20:53
0
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...

0
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.
21:08
1
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...

0
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 ...

21:43
0
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...

21:58
0
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.
22:15
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
22:30
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?)
0
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..
22:59
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
23:19
0
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
23:45
@Hosch250 15 minutes! 🕒

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