« first day (2526 days earlier)      last day (1488 days later) » 

12:00 AM
RELOAD! There are 6468 unanswered questions (90.1116% answered)
 
12:56 AM
0
Q: How do I complete this code to include a delete function deleting both directory and files in it?

MPG So I have look through and directory exclude certain files, show files numbered with a delete button and need to write in a delete function to delete the directory and the files in it and not sure how that is written can someone provide an answer. <?php $dir = './'; $files = scandir($dir); s...

 
1:32 AM
This question presents itself as if it is an optimization problem with rust itself, which in and of itself is already off topic. The question goes on to explain an algorithm, and presents a very large amount of code, which we are to assume is correct, as though the assumption is that you have made sure that your algorithm is correct. The question is then answered by a completely separate thing: ops::Not can be applied to an integer. That was the error, not anything about rust's optimizations. I believe that this is better suited to either code review stackexchange or the rust forum. — Optimistic Peach 43 secs ago
 
2:20 AM
possible answer invalidation by Jamal on question by cburchie: codereview.stackexchange.com/posts/235988/revisions
 
2:30 AM
possible answer invalidation by Peilonrayz on question by cburchie: codereview.stackexchange.com/posts/235988/revisions
 
@Duga Handled. Just the ``` bug again.
 
2:44 AM
This might be better suited to codereview.stackexchange.comjmargolisvt 59 secs ago
possible answer invalidation by Jamal on question by George Austin Bradley: codereview.stackexchange.com/posts/238952/revisions
 
 
1 hour later…
3:47 AM
0
Q: Pixel Tinting: Can I reset the color variables so my colors come out correctly?

artyI am having trouble with this part of my assignment; here are the instructions: Part 4: Animate! Make an animation of your headshot that goes "psychedelic" 3 times, then goes "Dutch", and then slowly gets more and more blurred Below, is my code. The only issue I am having is making my photo "Du...

 
 
3 hours later…
6:31 AM
 
6:48 AM
I'm voting to close this question as off-topic because the code works; this belongs on the CodeReview StackExchange. — MSalters 50 secs ago
 
7:24 AM
Some things how to learn any programming language: 1. Tutorias are a fine start, but they only cover the bare basics. 2. Proper projects are the way to go. Get a broad selection - some image enhancing, some complex parsing (like parsing mathematical functions), some database communication, GUIs... 3. Participate here in SO. Read a lot other peoples code. Put your own code on CodeReview. 4. Read other sources, like blogs on programming, and also style guides (like the google style guide) — Aziuth 50 secs ago
 
7:54 AM
0
Q: Summing CSV files row by row using Node.js events

7hibaultI need to read multiple CSV files that have the same number of rows, and compute some results for each row. I would like to be able to do so using the fast-csv parser that triggers events on each row reading. Mostly to avoid having to load the entire file into variables and then compute what I ne...

 
8:13 AM
0
Q: Finding data relations of json paths in python

MaydayI am kind of new to python, so I am pretty sure there are way better elegant ways to do this. I have made a function that is able to compare two list of possible json object paths, and detect what elements do not belong to the other list. In the docstring you will find a better description with ...

 
8:36 AM
If you have an actual working code you would like to refactor, consider to post on code reviews community. — Mario Santini 48 secs ago
Hi, I think this question is more suited for the Code Review Stack Exchange siteTitulum 27 secs ago
 
0
Q: How would you resolve paths according to given uri formatting?

Cold CerberusCurrently, I do this with the following. if (path.contains("\\") && path.endsWith("\\")) { path = path+ fileName; } else if (path.contains("\\")) { path= path + "\\" + fileName; } if (path.contains("/") && path.endsWith("/")) { ...

0
Q: Performance: Use plain for loops to look lor (existence of) string in string array?

embertI timed a few ways to look for a string in a string array (with 82 elements in the example) in a case sensitive manner plus ignoring case. I am kind of suprised, that the plain for loops are faster than all other variants. Sure, there are no checks, but are there any other flaws here? Does ...

 
9:29 AM
0
Q: Create a matrix with all elements having the value of the shortest path to a given position

nultypeYou're given the number of rows and columns and the indices for the reference point. Reference point is = 0. i.e: 3 4 3 3 output: 4 3 2 3 3 2 1 2 2 1 0 1 I managed to solve the problem using the easiest solution there is. I calculated the elements from the same column, and then using 2 for loops...

 
9:48 AM
0
Q: Builder design pattern pass object

Ahmed MamdouhGood Morning This is a builder design pattern .. the builder problem is duplication so I want to know from an expert with explanation which is better on quality on this code: (1) public class Animal { private String animalName; private int animalAge; public static class Builder ...

 
 
1 hour later…
11:05 AM
You are welcome! ... and I found your code review :-) — Ted Lyngmo just now
 
11:22 AM
0
Q: Feedback on C++/SFML Boid/Flocking Simulation Code

jasbindra00I have created a flocking simulation based on Craig Reynolds Boids. Could you give me some feedback on my code? I am a newbie and would really appreciate some criticism. Files: Boid - this is the representation of a bird like object. Flock - this controls and manages the flock of boids. Flock...

 
11:54 AM
What you are asking for is a code review and you should be asking such questions on the Code Review Stack Exchange Please delete this and ask over there. What topics can I ask about here?Rob 38 secs ago
 
0
Q: A simple animation in pygame

Mitchell van ZuylenI'm following a tutorial into pygame. I realized the example code was written for the sake of being easy to understand. I wondered if I could 'improve' the code, with a focus on keeping the exact same functionality. I tried, but I'm not really sure if this is an improvement. This is the origina...

 
12:28 PM
@ArvindKumarAvinash: Please have a look at the help center there. Checking if the program is implemented correctly is not on-topic at Code Review, only reviewing code that works is. — Graipher 16 secs ago
 
12:59 PM
Monking
 
1:15 PM
Welcome to Stack Overflow! Unfortunately your question is off-topic as of now, as the code to be reviewed must be present in the question. Please add the code you want reviewed in your question. Thanks! — Rallen 18 secs ago
 
1:25 PM
@Rallen Why have you linked to Code Review's rules, when that is a different site with vastly different rules? — Peilonrayz 28 secs ago
 
1:50 PM
Write some tests. That’s how you’ll know whether it’s correct. You may also have better luck with Code Review than here. — Arya McCarthy 48 secs ago
@Graipher - :) What's the diff between Checking if the program is implemented correctly and Code Review? — Arvind Kumar Avinash 43 secs ago
 
RGS
2:14 PM
@Peilonrayz I got 13 upvotes out of nowhere for a CR question in a language barely anyone uses xD
And I wanted to ask you: after people reply to my CR question, does it make sense to incorporate the suggestions into the original post? How? I know I can't just overwrite the code I had posted because then Duga will warn you about a opssible answer invalidation :)
 
usually you'd not edit the question at all. Instead consider asking a new question with the changes incorporated as a follow-up
then again if you're happy with the updated code, you can just skip that.
 
RGS
Thanks @Vogel612 :)
 
@RGS Vogel612 has covered pretty much everything. However here is the meta around such things.
 
RGS
Thanks for the link
 
2:34 PM
0
Q: How do I factor this code that takes multiple parameters?

EvanTo begin, I have an XML file at /Users/gaze/lab/lab/gpib_lib/out.xml that contains lines like... <MemberCall method_name="setFastCoupleMode" callee_name="GPIB_7280" fname="/Users/gaze/lab/lab/gpib_lib/../apps/capbridge/capbridge.C" lineno="394" colno="9" /> <MemberCall method_name="setInputLine...

-1
Q: Refactor large controller of legacy PHP application

foodevCurrently I'm trying to refactor a big legacy application and I'm a bit stuck at where to start. The application does not use any framework or template engine. Though it tries to follow the MVC structure. Right now most of the controllers are doing all the logic and the "models" are basically ju...

0
Q: Iterator-Pattern for an iterator that returns one objects that changes

MorinatorI wrote an algorithm that returns all k-sized subgraphs of another given graph. Because I don't want to make the runtime of the next() call of the iterator depended on k, I don't want to return a new object every time. Instead I have one fixed instance-variable subG in the iterator that is change...

0
Q: Making a priority queue using a Heap. Without using queue or heapq

lastìadaI have to implement a priority queque using a heap without any library / package for priority queque or heap. I made a BinHeap class which is a min heap, and i made a priority queque class with enqueque, dequeque methods that uses it. The Priority queque class works fine but i'm not sure if the c...

 
I'd recommend codereview.stackexchange.com and also make sure you include some test input and output. — norok2 11 secs ago
 
2:53 PM
-1
Q: Ensure queue is in ascending order

Darnoc ElocThe program reads in a queue of integers and returns determines whether or not it is valid (ascending). For some reason I'm getting the message warning: control reaches end of non-void function for loop. How can this code be improved? #include <iostream> #include <queue> bool checkValidity(std:...

 
Ben Popper on April 03, 2020
Digging deep on dark mode with our design systems lead, Aaron Shekey.
 
I'm voting to close this question as off-topic because working code you'd like reviewed and/or made better belongs on codereview.stackexchange.comSimple Lime 1 min ago
 
3:23 PM
@SimpleLime The code looks like it in incomplete "shoud I use return here ?" additionally Code Review does not review stolen code - "a lot of copy/pastes". — Peilonrayz 59 secs ago
 
Monking - ^^ Great work @Peilonrayz ⭐
 
ty :)
 
0
Q: A heap queue in Dyalog APL

xpqzI am learning Dyalog APL. I implemented a binary heap, which seems to work. How could I make it look more like APL (and less like Python)? ⎕io←0 heappush←{(⍺,⍵)siftdown 0(≢⍺)} heappop←{ heap←⍵ last←⊃¯1↑heap ⋄ rest←¯1↓heap 0=≢rest:rest last r←heap[0] (((last@0)rest)siftup 0)r } siftdown←{ ...

 
@CaptainObvious 2nd question within ~1 hour...
 
3:50 PM
-1
Q: Inheritance with Singletons

laventncThe problem / background I have a project, BusinessProject, that currently stores some static data in memory using the Singleton pattern - we'll call this class GlobalData. This project is used in multiple applications, with different requirements on what data should be loaded into memory. One a...

 
4:05 PM
Please consider posting on Code Review. — Weather Vane 56 secs ago
 
@Duga I'm considering posting a link to this meta post but apparently the position held by the top-voted answers isn't a widely accepted view...
 
@SᴀᴍOnᴇᴌᴀ Hmm, yeah there's not many votes on the answers. afaik we don't allow it, I think there may be a "intro into complexity" post on CS as I believe they've had a problem with them
 
4:24 PM
if the question that the meta post linked to was closed then it would be a stronger argument but as it is, it doesn't seem very solid...
 
@WeatherVane On Code Review, this would be at best get a review but not an answer to the question. At worst it'd get closed before anyone can hope to answer it. I don't think either is what the OP wants. — Peilonrayz 50 secs ago
 
it appears there is a grammatical error in your answer to that meta post: "I drawn the line at whether the question is asking for a code review." - should that have been "I had drawn", "I draw" or something similar?
 
I think a rewrite would be best, "line at whether" is really confusing to me
Ah, turns out I misread it multiple times as "I draw ..." not "I drawn ...". Wow, I'm bad at reading
 
4:47 PM
0
Q: How to Unit Test a Thread which has an infinite loop?

DanielI wanted to be sure the thread being tested would complete its job by the Assert statement of the unit test, but I couldn't be sure bc of the way I designed the threads. I designed them to run forever in the background, performing a task - logging, assembling, or disassembling - at regular timed ...

0
Q: Parse org-mode clocktable CSVs into time sheets

Jonas SchwarzFor my student job, I have been logging work times with the org-mode in emacs for quite some time. Now since I can only work from remote, I figured it would be nice to automatically use the entries from the .org files into readily formated entries. I am doing this because the job requires me to w...

 
5:24 PM
@Peilonrayz there is too much text these days... I feel like I have to scan so many things and then occasionally miss important details
 
-1
Q: Hi, this is a matlab code where you imagine you're running a supermarket and have to calculate the net profit of your store. Please help me finish it

KancyHint( use a switch statement inside a while statement) Use for loop as well!]1 '[1]: Example on how to start![![enter image description here][1]][1]' '[2] clc clear all' '[3]a= input('How many different items did you have? ') name= input('Which items did you buy? ','s')'

 
@SᴀᴍOnᴇᴌᴀ Yeah, I agree. I wanted to codify it but it's a lot of work and just getting a list of rules takes days if not weeks. Doesn't help that many of the answers repeat the same core rules over and over.
But it looks like a problem of meta. You need to explain to a disgruntled OP why their code is off-topic and so you need to start from nothing.
 
@Peilonrayz a nearly Sisyphean task...
I would have thought it would have been sisyphucian but apparently not...
 
5:42 PM
Haha, yeah
 
@CaptainObvious no
 
5:55 PM
@CaptainObvious Closed.
 
"You'd have to be given this function pointer at construction time ... how you clone a type shouldn't be different for different instances of the pointer" I set that pointer in the constructor, but the function it points to is generated automatically by a template. The user can't set the pointer directly. Here's an early implementation of it. — HolyBlackCat 12 secs ago
 
6:22 PM
0
Q: Design of a turn based, dice game

Jorge LavínI'm trying to build a irc-bot that serves as a manager of a multiplayer, turn based, dice rolling game. The bot is listening to all messages on the channel. When the logins it build a Game instance with all the players, except himself, present in the channel. There are two kind of players in the...

 
7:00 PM
-1
Q: msgsnd erro: invalid argument for IPC program

The ViperThese are my client and server codes for message queue. The required function is supposed to be quite simple, client sends a number to the server, which the server receives and then sends back a sort of acknowledgement message like 'end' which is supposed to shut down the client as well. Here is ...

 
7:19 PM
0
Q: A demonstrational example of a Data mapper ORM v2

Your Common SenseI want to create an educational example of a Data mapper type ORM. Above all goals I want it small. In order to make it easily comprehensible by anyone. It is always a pain when you want to understand how the stuff works, but just unable to dig through such walls of code. If you take even a rela...

 
7:32 PM
I don't see any sort of question relating to a practical programming problem here. That is, all indications are that your code works as you want it to. There's nothing for anyone to solve. You can get advice on opinion-based things like best practices, coding conventions, techniques, etc. at codereview.stackexchange.com. If you choose to post a question there, please read their Tour carefully, and before you follow all guidelines, including providing a complete code example. — Peter Duniho 15 secs ago
 
-1
Q: Calculate the intersection area of two squares

sacchhI want to calculate the intersection of two squares where the coordinates of the input square are given by the bottom left corner and the top right corner. The other square is 6 units wide and has a variable positive integer height h (to make the task simpler). For that I defined some functio...

 
7:53 PM
You want to go to codereview.stackexchange.com — NomadMaker 43 secs ago
 
0
Q: Dynamic Web Scraper in Python

Viktor StefanovThe other week I faced the struggle of scraping dynamically generated content. So I used the selenium library with combionation of requests & bs4, the thing is I am unsure of the quality of the implementation as I just learned how to use those tools. I want to have a general feedback on the way I...

 
 
1 hour later…
8:58 PM
If you want feedback on Code, and the code is complete and works, it should be on Code Review, not here. This site is primarily for fixing broken code. Also note, like here, they require all code to be posted in the question directly. — Carcigenicate 1 min ago
 
9:31 PM
0
Q: Save on typing while using UTF8 encoding

Dmitry NoginTyping in something like Encoding.UTF8.GetString(...) and Encoding.UTF8.GetBytes(...) everywhere in your code could be eliminated by a helper UTF8 type: public class UTF8_Should { [Test] public void Convert() { var text = "Hello World"; byte[] array = (UTF8)text; ...

 
9:42 PM
I'm voting to close this question as off-topic because this question would be better placed on Code Review. — Adrian Mole 13 secs ago
 
10:22 PM
Can some one tell me if this has enough code for context? codereview.stackexchange.com/questions/239871/…
 
Seems fine to me, even if it's over my head
 
0
Q: Custom React debouncer hook

CabooseI'm new to React hooks and trying to learn to write custom hooks. Today I wrote a hook that I believe works as an effective debouncer of a setter function, to prevent excessive updates when data changes rapidly. I'm trying to keep this as simple as possible so as to be reusable throughout the app...

 
10:38 PM
Hi @user4035, this question seems like would receive better answers at codereview.stackexchange.com/tourFabián Heredia Montiel 42 secs ago
 
0
Q: Is there a way to make this traversal algorithm for a graph more efficient?

Lugvid_PaxI have an adjacency matrix "A" which I am using to represent a graph for a social network. Each node of the graph represents a person's name, and I am storing people's names in an 2-d array (the index of the person's name in the array is the same as the node's row index in the adjacency matrix). ...

 
11:06 PM
0
Q: Finding legal knight moves in a chessboard in APL (follow-up)

RGSThis question is a follow-up to this previous question of mine. Assuming I understood correctly what is outlined in this meta post. I wrote (and now, re-wrote) a function that takes as input a vector with two integers between 1 and 8 representing a position in a chessboard. This function should ...

 
11:17 PM
Welcome to StackOverflow! Requests for review and general critique of working code are considered off-topic on this site, and should be directed to CodeReview.SE instead. — Brian 46 secs ago
 

« first day (2526 days earlier)      last day (1488 days later) »