« first day (2189 days earlier)      last day (1814 days later) » 

12:00 AM
RELOAD! There are 6006 unanswered questions (89.8766% answered)
@SvenWritesCode It's a series of select fields with a next button and previous button - all in divs that are set to display: block or display:none; so that the user can go forward to change the next question or back to edit a previous select field... The code works exactly as intended - I'm just trying to learn how to do the same in shorter code .. But, I was unaware of the "code review" site that Barmar mentioned. So I may go there. Thank you. — turpentyne 12 secs ago
@Barmar I didn't know of the "code review" site .Thank you, I will check it out. — turpentyne 29 secs ago
 
12:41 AM
This area of questioning is more appropriate for Code Review. But you can't generally post pseudo-code there, you need to post a full working example that they can critique. — Barmar just now
 
0
Q: Show & hide multiple elements - vanilla js

turpentyneAsked this on StackOverflow, not knowing that this would be a better place for the question... I've managed to figure out a script in js to hide and show various elements. But, I imagine there must be a cleaner/simpler way to do this that what I've created? (without using jquery). Essentially...

 
1:02 AM
0
Q: React Filtering By Key Strings

Josh BI have the following code to filter some items by the keys. const keys = Object.keys(phone.plans) let filteredPlans = []; for (const key of keys) { if (key !== "6" && key !== "7") { filteredPlans.push (phone.plans[key]) } } I am trying to find a more React / efficient way of...

 
 
1 hour later…
2:25 AM
possible answer invalidation by Snoop2001 on question by Snoop2001: codereview.stackexchange.com/posts/219437/revisions
 
2:40 AM
0
Q: Random Letters Grid C++ Programming

Urfa JamilMy written code outputs a grid of random letters and asks the user to enter word found in the grid. But it does not output if the word exists in the grid or not. I need help coding that. I need help to modify my code to output the following lines, so that the programs checks if the word is in the...

 
3:20 AM
2
Q: Langton's ant in Clojurescript

nakiyaThe weekly coding challenge in Eric Normand's newsletter this week involves implementing Langton's ant. I wanted something on my screen so I put together a simple re-frame app. The core functions relating to the ant: world.cljs (ns ant.world) (defn init-world [width height] {:width width ...

 
3:40 AM
0
Q: Finding products of all other members of an array

FrankI had the following interview question: Given an array of integers, for each member of the array find the product of all the other members of the array. So for instance, if you have this array: {3, 1, 2, 0, 4} you should end up with this: {0 0 0 24 0} I wrote this code which uses two loops...

 
3:59 AM
0
Q: REST API Design Convention

svetha.cvlI have 2 models - Author and Publication, with one author being associated with multiple publications and one publication having multiple authors. To get/load an author by the author's id, I would design my API as host/authors/{authorId} To get/load a publication by the publication's id, I would ...

 
 
1 hour later…
5:05 AM
const eventData = []; does not create a global variable, it creates a block level variable in the imports level. I linked to my article to show you how to create proper Angular services for sharing data between components. Read the whole article and you will have an understanding of creating well defined Angular services. You don't do things in Angular with global variables. If you did want to hack something so nasty you would do it with window.eventData = []; but that would get you kicked off my team instantly if I saw that in a code review. — Adrian Brand 16 secs ago
 
5:59 AM
0
Q: A LaTeX environment that counts words

Weijun ZhouI am new to TeX and here is my attempt to (ab)use mfirstuc to define an environment that counts the words. I am looking for suggestions on how to improve the implementation. \documentclass{article} \usepackage{mfirstuc} \newcounter{wordcount} \newtoks\temppar %Make sure we do not accidentally ov...

 
6:19 AM
0
Q: Assigning test-data parameters by name

t3chb0tWhen creating data-driven tests with xUnit we can use the MemberDataAttribute to get the data from a member of this or other class. This is very nice but it has one disadvantage, you have to specify parameters in the same order as the test method so you need to be very careful. I prefer to use na...

 
I'm voting to close this question as off-topic because it is more relevant on codereview.stackexchange.comNigel Ren 52 secs ago
Your algorithm seems fine. There are lots of ways to improve the coding style. I suggest you post it on Code Review for comments. — Barmar 51 secs ago
 
6:40 AM
possible answer invalidation by Sarcoma on question by Sarcoma: codereview.stackexchange.com/posts/219418/revisions
If you have complete working code that you want feedback on, codereview.stackexchange.com is the right place to go. You will be amazed on the amount of feedback you can get there. Do note that when you post there, the code should work. It's not for finding bugs. — Broman just now
 
7:15 AM
0
Q: Add the word "readability" to the off topic close reason

BromanToday we have this close reason: Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the...

 
7:37 AM
0
Q: How can I make my PHP code readable and not repeating?

jaybee satulanI have a modelScan.php file, as you can see, I have codes that repeated within the function/method. How can I make this code more readable I appreciate your kindness. Thanks <?php /** * Class for Scanning files */ class modelScan { /** * Get the total size of file in the directory ...

 
7:58 AM
"I've tried to make it work with if statements and for-loops, and this works perfect. But this is everything but efficient." If it works, why don't you show the relevant code parts in your question so we can make recommendations for improvement? (By the way, if your code works fine but needs to be improved, codereview.stackexchange.com may be able to help). Right now it is unclear what you even did and how/why you think it is "inefficient" (whatever that means). — Max Langhof 55 secs ago
 
8:36 AM
0
Q: Refactor duplicated code in 2 functions for Python

spicyramenI'm trying to copy files to S3 after writing them locally: I have 2 functions which I need to do this. What is the best way to refactor the code that exists in both. s3 = False if data_fp.lower().startswith('s3://'): s3_data_fp = data_fp data_fp = os.path.join(_TMP, os.pa...

0
Q: Is $stmt->close() used correct

IngusI m confused if i can do like this: $param = "%{$id}%"; $stmt = $conn->prepare("SELECT name, comp, date FROM stats WHERE date = ? AND name LIKE ? ORDER BY date DESC LIMIT 20"); $stmt->bind_param("ss", $param, $_POST['date']); $stmt->execute(); $result = $stmt->get_result(); $count_rows = $result->...

 
8:55 AM
0
Q: Communication with interactive program in low-level wrapper to be used with VS Code Debugger API

EnbytedMy ultimate goal for this project is to create a debugger extension for VS Code that will support Microchip Debugger to program and debug PIC MCUs from VS Code. This question is about the lowest level of it - communicating with interactive console program and wrapping it with async API. The whol...

0
Q: ArmstrongNumber checker

Akshay soniThis is my code written to check whether a given number is armstrong or not . but the logic differs from the conventional logic of using integer and separating its digits and calculating , instead i optimize the logic of separating the digits using Sting and char array . Please review my code ? ...

 
9:15 AM
0
Q: Am I using the coroutines right in this api call?

Stavro XhardhaI have a repository which has a suspend method fetchNintyNineNamesAsync , which returns a Defered . Am I using it right like this ? class NamesViewModel( private val repository: NamesRepository, private val coroutineDispatcher: CoroutineDispatcher ) : ViewModel() { private val compl...

 
9:35 AM
0
Q: Find the cheapest shipping option based on item weight

StephenI've been taking the Computer Science course on Codecademy. The course includes this project where we have to create a python script to find the cheapest shipping method based on the weight of an item and I'm just wondering if what I wrote is the best solution or if there's a better one. def gro...

0
Q: Armstrong number generator

Akshay soniThis is my code to generate all possible armstrong numbers between the two given numbers . logic uses string instead of integer to separate the digits to optimize the code . Please review . import java.util.Scanner; public class ArmstrongNumberGenerator { public static void main(String[] ar...

 
9:48 AM
Good monking.
Is there an Access/VBA magician at the 2nd court available for a short question?
 
10:40 AM
possible answer invalidation by Mehrzad on question by Mehrzad: codereview.stackexchange.com/posts/219359/revisions
 
11:26 AM
@JonSkeet Yeah good point. I think I'll take a crack at implementing it and then post it to codereview.stackexchange.com — Mark Vincze 5 secs ago
 
11:51 AM
0
Q: Building QueryString from custom object

Felipe CoelhoI have a custom object that is based in the following models: public class Filter<T> where T : new() { public T Object { get; set; } public int Page { get; set; } public int ItemsPerPage { get; set; } } public class TransactionFilter<T> : Filter<T> where T : new() { public DateT...

0
Q: position elements using less absolute in CSS

Gourav ThakurI have coded an UI from dribble design as a challenge and completed it but I think The CSS I wrote is really bad. I am a beginner. How can I improve my CSS?. One of the main problems is that I am using position absolute for positioning everything. I want it to be responsive. This is the dribble ...

 
12:50 PM
0
Q: Deep Neural Net implementation in Python3

Display nameI created my first implementation of an arbitrary feed forward neural network with a simple back-propagation training implementation. class NeuralNet(object): learning_rate = .1 # Error function @staticmethod def J(guess, target): return 0.5 * np.linalg.norm(guess - targ...

 
1:11 PM
0
Q: Initializing BufferedReader and DataOutputStream in infinite loop

Faizan MubasherIs it a good practice to initialize the BufferedReader and DataOutputStream in infinite loop? ServerSocket welcomeSocket = new ServerSocket(8080); Socket connectionSocket = welcomeSocket.accept(); while (true) { BufferedReader inFromClient = new BufferedReade...

0
Q: PHP / Laravel - Using Python to image manipulation

oliverbjI have a simple job class in Laravel, that: Get all the images in a folder /original Perform some image manipulation on each image Save each image in a new folder /preprocessed All of these steps are added to a queue. However, I have taken an alternative approach and is using python to do t...

 
2:00 PM
Greetings, Programs.
 
2:16 PM
as your code is working, move this to code review stackexchange. you'll get better response. — SanV 17 secs ago
Maybe head over to codereview.stackexchange.com I'm guessing you'll get downvoted here for "too broad" or "opinion-based" — Gereon just now
 
@Donald.McLean Greetings, User
 
@Gereon: Code Review requires working code from a concrete project. — Martin R 37 secs ago
 
3:18 PM
Ahoy, mateys
 
0
Q: multiple AJAX requests and multiple SetTimeout animations

Phoenixmultiple AJAX requests and multiple SetTimeout animations I wrote a piece of code that included multiple AJAX requests and multiple SetTimeout animations. I want the code to perform better, especially the SetTimeout sections. which part of the code should be improved? thanks window.timer...

 
Once you get your code to work as intended (pretty or not), I'd recommend you put it up for peer review on Code Review - you'll get answers with infinitely more info/details than whatever can fit in a 400-character comment :) — Mathieu Guindon 24 secs ago
 
3:36 PM
@SᴀᴍOnᴇᴌᴀ Yes, and some of them used to be pretty active.
 
3:46 PM
The About me section for this nobody sounds more appropriate for Duga...
> I don't really exist, this is just an illusion.
 
Duga is not an illusion. You're being watched.
 
4:16 PM
Monking
 
4:49 PM
@Mast that always makes me think of the avatar for ceiling cat :)
(that was supposed to be an edit, not a separate message)
 
This question isn't appropriate for StackOverflow. Please post it to StackExchange Code ReviewPausePause 37 secs ago
 
5:10 PM
possible answer invalidation by 200_success on question by user3397791: codereview.stackexchange.com/posts/169130/revisions
 
@SᴀᴍOnᴇᴌᴀ I recently saw a news story about a cat on a catwalk... perhaps it isn't the first time this has happened but it seems somewhat amusing
 
@pacmaninbw Why did you use LCC on this question?
 
@Duga that's okay - the formatting of sample output was updated
 
1
Q: Parallel merge sort with thread- and bufferpooling

user199918I did wrote this paralel merge sort with no external dependencies. I tryed to make use of modern C++ as much as possible. Can you please tell me how it is? #include <vector> #include <list> #include <thread> #include <memory> #include <mutex> #include <condition_variable> #include <algorithm> #i...

 
5:44 PM
-1
Q: How to optimize multiple loops in VBA code within Excel

nikedudeI am not a very efficient vba coder, but I can brute force my way through something. I am trying to optimize this code to have it run more quickly. I would imagine it should be possible to combine the loops somehow, but I am not exactly sure where to start since the Sheets are within the formul...

 
5:57 PM
codereview.stackexchange.com might be a better fit for this question. If you provide your alternative implementations there (as code stripped of unnecessary detail), people may be able to provide valuable feedback. — Arda 48 secs ago
 
0
Q: Backup program in python3 for linux - suggestions for improvements

anfieldPython beginner here. Created this program as a project to help learn python. Just ran this in a centos7vm so far to test. What it does is - zip up files containing certain extensions defined within the program, logs the zip up process as it continues through, and when finished, send an email con...

0
Q: Refactoring Laravel Eloquent queries / model?

Ash KetchumDebugged my page load (was taking 4s...) and I was running 94 queries. 30 of them were the same. I've refactored a little by caching results, but how can I further refactor this class? The project is only half finished, and its already getting... messy. <?php class User extends Authenticatable...

 
6:23 PM
0
Q: Simplify SQL Query

Ramji RI'm writing a log table which contains the summary of the claims. The log table log's the data whenever there is an upload. I have wrote the following sql query. Though it serves the purpose I'm trying to learn whether there is any way to simplify the below updates. CREATE TABLE #1 ( i...

-1
Q: Sending a file in chunk using socket in C

TonyRomeroI'm trying to sending a file from a server by using a 256 char buffer plus a timestamp 4 bytes long right after. On the server side I'm sending first the file size, the file opening it as a binary file and then a timestamp. int conn_fd; // my socket char buf[MAXBUFL+1] // MAXBUFL = 255 int n=0; ...

 
7:00 PM
@ScottHannen To address your question, though — the datatype I'm working with, that corresponds to int in this example, are similar in meaning so that it makes sense to call some method on them. I can discuss the specifics in another post but I think it fits better in CodeReviewExchangeMTV 55 secs ago
 
0
Q: Simple calculation of sector coefficients using PHP

EmmaFunction This class extends the key class, called EQ, and does basic calculation based on minutely data and calculate coefficients for sectors of equity exchange markets based on market movers (e.g., AAPL, GOOG, AMZN, NVDA, FB). It works, I'm not so sure about its OOP. Would you be so kind a...

 
Does anybody else feel like this answer is just a code dump with no explanation? Sure the fact that it is simplified from the OPs code can lead one to conclude that it is better because it is more brief, but the output is not the same...
 
@MTV I agree with Scott as I briefly indicated in my answer and yes, you could try CodeReview once you have a working code. That being said, does the answer below answer the particular question you had here? — Ahmed Abdelhameed 17 secs ago
 
7:16 PM
@SᴀᴍOnᴇᴌᴀ I agree
 
7:33 PM
@SᴀᴍOnᴇᴌᴀ Related question: can accepted answers still be removed or mod-noticed?
 
@Mast Pretty sure they can't
 
On top of that, I'm not sure that code even does what OP want it to do, but since they're convinced it does, we can't close it for being borked...
Perhaps I'm broken.
3
Who knows.
@SᴀᴍOnᴇᴌᴀ That's definitely a code dump, yes. So feel free to flag it as such, although I honestly don't know what would come from that. Perhaps a custom flag would be appropriate here.
 
@Mast why shouldn't that be possible?
 
Unrelated, @Sᴀᴍ I rejected this since it would introduce a mistake. A ( was added for a ) which was part of a smiley. There was no intent of a () pairing. Edits adding mistakes shouldn't be let through, although in this case approve-and-edit may have been appropriate too.
@Vogel612 Might make them special, I thought. But I'm no mod, so please, enlighten us.
 
@Mast it does make them special in the respect that they can't be self-deleted
everything else should be working just fine to my knowledge
 
7:41 PM
 
oh wow that post refers to uservoice...
damn that's before my time on SE overall ...
 
First time I've heard of it tbf...
@Vogel612 By self-deleted is that limited to the answerer or does it also apply to the asker?
 
Can't self-delete questions with an upvoted answer IIRC, but I'm not awake enough to hunt for a source on that
I'm pretty sure one can't self-delete a question with an accepted answer, though... not that it's hard to remove the checkmark
 
@Vogel612 Fair, I think I need to note all these edge cases in a table. I keep forgetting
 
meh. it's not like it happens a lot
 
7:46 PM
Yeah they're very infrequent, like a couple a year max
 
@Peilonrayz If you'd make that a community-wiki somewhere or put it on a GitHub, it might even help others who are just as forgetful as you ^^
 
I just happen to have a weird kind of brain that likes to latch onto facts and not let go of them... But don't ask me what I had for dinner two days ago ...
 
Dinner two days ago is irrelevant. Today's dinner and tomorrow's dinner, that's what I want to remember.
So, be glad, you got a good brain.
 
@Mast I wouldn't want to put it on CR as people will moan that it's just a bunch of links in a table. And eveyone would forget the GH link XD IDK...
 
meta.se/questions/tagged/faq ftw
 
7:50 PM
@Vogel612 TBF there's normally a ton of duplicates on meta.se and meta.so that it'd be hard to miss them when searching
 
It's quite common to miss what you're looking for on the metals, yes.
Metas.
 
0
Q: Longest carbon chain

mobo poMy Code measures the longest path, not allowing cycles. For the example input below, the longest chain would be 4 Please can you review my code? import numpy as np inputgrid = np.array([['.','.','.','.','.'], ['C','-','C','-','C'], ['.','.','|','.','....

 
Thanks a lot! One question about Code Review: Is it encouraged to link to a .xlsx file that shows the data/data structure? I imagine looking at the code with just a description of the data is somewhat difficult. — NoNameNo123 24 secs ago
 
Does anyone know if it's common for ~15GB of RAM usage to be unaccounted for in Task Manager?
 
8:21 PM
0
Q: Finding min value of an array using SIMD

Jesse JI have the following code to find the maximum sbyte value in an array. It is using System.Runtime.Intrinsics to perform a SIMD min on chunks of the array, and then loops over the resulting vector to find the true minimum. public static sbyte Min( sbyte[] array ) { if( array.Length <= 0 ) r...

0
Q: User registration in Actix w/ DynamoDB

Ethan McCueI am trying to puzzle out api based user registration for a service I am building, but I have a strong feeling that my code is not optimal. It feels like passing "state" in the way I did prevents the server from being multithreaded, as I have no clue how actix could share data that isn't Send or...

 
@Peilonrayz Do you have an option to show processes from all users? perhaps that was already selected
 
@SᴀᴍOnᴇᴌᴀ Not that I can see, I loaded it up in admin mode too
 
@Peilonrayz What, reserved ánd not appearing to do much? Yes.
Don't worry, it's still available. Somewhat.
 
@Mast It makes my FF lag when I switch tab and Spotify buffer when I switch tab in FF.
 
Tried a reboot?
 
8:25 PM
Yeah, still there :/
 
Got a RAM graph with that?
 
As in Resource Monitor? Or something else
 
You're on win10, right? Like a CPU resource graph, has it for RAM too.
In task manager
 
Yeah I am, yeah I can see the nice purple graph
 
What's it filled with?
 
8:32 PM
I'm voting to close this question as off-topic because it belongs to codereview.SE — Thomas Weller 52 secs ago
 
Oh, and make sure your RAM is actually the problem. If your disk is doing more than it should, blame windows defender/update.
 
@ThomasWeller Feel free to recommend the OP post on CR but in the future, please don't use the existence of the Code Review site 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 usersSᴀᴍ Onᴇᴌᴀ 47 secs ago
 
@Mast I'm not sure how to answer this. Do you want to know usage (I cut it down somehow to 14/32GB closing every app on my PC and then re-opening FF) Or the composition, where 14GB is in use and 4GB is in standby. Other than that my user is 'using' 3GB where 2.5GB is FF.
@Mast My disk activity is normally empty, one of my drives was stalling with PyCharm so I've been keeping an eye on this. And it's normally at 0% whenever I check, unless PyCharm decides to destroy one of my drives or Steam downloads something.
 
@Peilonrayz That can happen if a program leaks Windows resources.
 
@SᴀᴍOnᴇᴌᴀ: I would answer all those questions with yes. That's why I voted for migration — Thomas Weller 59 secs ago
 
8:40 PM
@Zeta I fear it's something unwanted like this. Or I'm being paranoid and using too many tabs. I guess I need to learn the "fixing leaks for dummies" book
 
We had a program that would leak ~2.6MB/s. The program itself had a constant private memory size, but there was something wrong in the way the application redraw its interface. Funny enough, because the application itself didn't use much memory, Windows never killed it or blocked resource requests. It just chugged along, until there was no more free memory and everything froze.
Took some time till the vendor finally fixed that one.
 
@Zeta Wow, that sounds like a really nasty bug.
 
Oct 4 '18 at 18:16, by Mast
Everything can be broken.
@SᴀᴍOnᴇᴌᴀ: Yeah, well. These close vote reasons are f***ed up since years. Thanks for the hint. I'll do my best to remember that exception — Thomas Weller 32 secs ago
 
8:58 PM
hmm... appears to have been removed... I wonder if it was RBA, or sensored by a Mod
 
0
Q: Simulating pod racing over a 2D map : am I implementing OOP in a GO-like fashion?

PoutrathorI'm learning Go and I wrote this for a programming challenge. It is working (building and running) but I feel the code is not what Go code should be. I used an OOP design. Is it correctly implemented in GO ? In my main, I will call the method pod.playTurn(target, speed) package main import (...

 
@Peilonrayz That's somewhat normal.
@Zeta A reboot would temporarily 'fix' that.
 
9:17 PM
I feel like this question would be better on Code Review. Optimizations of working code are a little bit out of scope here. — Dharman 38 secs ago
 
0
Q: Go - avoid result reassignement in OOP

PoutrathorI'm learning Go and I wrote this for a programming challenge. It is working (building and running) but I feel the code is not what Go code should be: The code implements the steps a podracer takes to race over a 2D map. I input a target and a speed, and the code calculate where the pod will be a...

 
@CaptainObvious uh.... same code as post by same author ~10 minutes prior... claims to be split from a post from a few weeks ago... duplicate?
apparently the questions are different
 
If the code works, then this question may be more appropriate over on codereview.stackexchange.comcybernetic.nomad 50 secs ago
 
9:39 PM
0
Q: aiohttp async requests

Jorge VidinhaIm trying to accelerate multiple get requests to a web service using asyncio and aiohttp. For that im fetching my data from a postgresql database using psycopg2 module .fetchmany() inside a function and constructing a dictionary of 100 records to send as lists of dictionary urls to an async fun...

-2
Q: C# - For loop goes out of range when altering lists within

jvd14005I'm making a War card game in windows forms (each player has half the shuffled deck, each draws one card at the same time, whoever draws the higher card adds both cards back into their deck, and so forth) and I've got it working to the point where I can recognize which player has won the round. H...

 
@JosuéFreitas you cannot use master outside of the init method. If you need to then you have to define it as a class attribute by using the self. prefix.So in your login method use self.master instead of master. Also you are calling self.janela() after master.destroy and that wont work. You probably need to take this to code review and post your full code. There is a lot that needs to be changed. — Mike - SMT 7 secs ago
 
10:18 PM
1
Q: WordPress rest api basic auth with IP check

nztI'd like to use basic auth with the WordPress API and but restrict the capability to a single IP address. I've updated the existing code from here: https://github.com/WP-API/Basic-Auth accordingly. It seems to work fine but I would be interested in any comments about security or improvements th...

 
10:38 PM
1
Q: Simplistic Decision Tree in Haskell

Jeffrey BrownI've been doing all of my assignments for a class in Haskell. This constructs a binary decision tree. The command to run it is: stack exec decision-tree-exe <threshold> <training file> <testing file> where threshold is in the range (0,1]. I think I've gotten a lot better, but I'm still havin...

 
10:59 PM
This question looks better suited for codereview.stackexchange.comGeoffrey 23 secs ago
 
@Duga wat...
 

« first day (2189 days earlier)      last day (1814 days later) »