« first day (2258 days earlier)      last day (323 days later) » 

12:00 AM
RELOAD! There are 6220 unanswered questions (89.7551% answered)
 
@Duga another day, another zombie
 
 
3 hours later…
3:18 AM
0
Q: Examining Income amongst races

brzigI am trying to compare income data amongst white and black samples. The data contains whether or not they are above or under 50K USD. I elected to use a difference of proportion test here as it seemed to make sense to me. I am looking to receive any feedback that I can especially if something I...

 
3:33 AM
I suggest you ask your question in here. One easy way to speed up, instead of sending sensor values as single messages, put them in an array like object, serialize it and send them at once. — M. R. 1 min ago
 
0
Q: Use SemaphoreSlim to control access to a resource

PabloInNZWe have an existing situation in an MVC ASP.NET app where it's possible for two threads to come back asynchronously, one from an external api(the payment gateway) and one from within the browser for each cart in an online shop. Only one should be able to run some further code, but they can come b...

 
4:23 AM
Monking
 
4:45 AM
possible answer invalidation by greybeard on question by thebenman: codereview.stackexchange.com/posts/223777/revisions
 
5:06 AM
Monking
 
5:20 AM
0
Q: Scraping a hiring website using python's requests and BeautifulSoup

M. IduoadI'm designing a scraping application using python, requests and BeautifulSoup4. I decided to divide the logic into two classes: Spider : gets the base url containing a list of job offers and logs them into a SQL table logs . Extractor: it pulls the urls of job offers' posts from the logs table...

 
5:40 AM
0
Q: Find a Sum of Particles in A Set of Boxes Given a Number of Rows and Columns

Cory HarperThis is a code challenge, from Codewars, the details of the specific challenge in depth can be found here: https://www.codewars.com/kata/magnet-particules-in-boxes/javascript. The summary of it though is a function which gives a sum of particles in a set of boxes given a number of rows and a nu...

 
 
1 hour later…
7:00 AM
0
Q: C++ simple inter-process notification system

José Tomás TocinoI needed to synchronise several processes, so I developed this ipn::Notifier class that uses a mutex+condition variable stored in shared memory to notify all processes. The ControlBlock structure is stored in shared memory and holds the sync elements as well as a counter of clients. #ifndef CO...

 
7:20 AM
0
Q: PHP: taking substring of substring of strrchr of preg_replace

GreyWould there be a more clear/efficient way to write public function getModelName() { return substr(strtolower(substr(strrchr(preg_replace('/(?<!\ )[A-Z]/', '_$0', __CLASS__), "\\"), 1)), 1); } for example: Class name: SettingOption Output: setting_option

 
8:00 AM
0
Q: Angular 2 - View is not updated when the code is modified

Mahmoud ArafaI have an angular 2 project and I run it after a code change it doesn't updated the view (may be it doesn't compile the files) Below is app.component.ts: import { Component } from "@angular/core" @Component({ selector: 'my-app', template: '<button class="colorClass">My Button</button>'...

 
8:20 AM
0
Q: Performance issues with double for loops

armaraThe alpha that I create is not created in a crazily efficient way I know, but the main bottleneck in this code is in what I call the "Maximization step" (see comments in code). There are double for-loops twice, and the reason for this is that I need to use the computed vector from the first doubl...

0
Q: JOIN and NOT EXISTS query in mongoose

Vicky GonsalvesI have a sql query which I need to convert in mongoose aggregate SQL: Select a.participant_id, a.name from participant a , settlementAccount b Where a.settlementAccount = b.id and b.account_type = "FundingAgent" and Not Exists (select 1 from settlementAccount c where b.account_type = "Tra...

 
8:40 AM
0
Q: This cde generates an ID number for each new row of text that is pasted into the worksheet, how can I make it better and more consistent?

SanderJensenThis code checks if "B2" and so on is filled in and if it is then it will generate a new ID number for the row of data that was transferred to the worksheet on the next empty row, I know this code creates opportunities for bugs so I want to make it better but I don't really know how I could do it...

 
 
2 hours later…
10:20 AM
0
Q: pausable and chunked file upload

Parsa YazdaniI am trying to create a file hosting website where the file upload is chunked (to help large files) and allow users to pause the file upload. Maybe each chunk would save separately to allow users to continue later. Here is my code: //Setting Variables include 'config.php'; $target_filename = ti...

0
Q: JS/JQuery code refactor to be in line with DRY

mr_muscleI use JS/JQuery validation for radioboxes, input field etc. Because of AJAX I use one global validation (in a separate file) and 4-5 other files to coverage actions in a relevant registration form pages. These actions are repeated in a few places so I need to refactor it to be in line with DRY. ...

 
10:41 AM
If your code runs correctly, your question may be more adapted to the code review stack exchange. — m.raynal 24 secs ago
You can't do much on the server aside from only include trusted third party libraries that don't try to do weird stuff with your code. Also, code review any submissions to the code base to make sure code is doing only what it needs to. However, that's really standard for any programming language, not only JS. — VLAZ 5 secs ago
 
11:11 AM
I don't quite see why this has been downvoted.
-1
Q: Examining Income amongst races

brzigI am trying to compare income data amongst white and black samples. The data contains whether or not they are above or under 50K USD. I elected to use a difference of proportion test here as it seemed to make sense to me. I am looking to receive any feedback that I can especially if something I...

It has two close-votes for "lacks context", but I don't quite see that reason either.
 
@SimonForsberg They're being abused again, I suspect. Should've been UWYA.
At least, I could make a case for UWYA here.
Not that I've voted.
 
11:27 AM
@Mast Yeah, not the first time that happens.
 
11:40 AM
0
Q: the fox is black - a simple image scraper

badukerI wrote a simple image scraper for the Desktop Wallpaper project by The Fox is Black. The site is a fantastic (yet, apparently dead) blog full of fabulous images. However, there's no way to download an entire bundle of images, hence this simple scraper. I'm putting the code up for scrutiny. Any ...

 
Questions about working code can be interesting, but they are a better fit at Code Review rather than Stack Overflow — Nino Filiu 1 min ago
 
@SimonForsberg I down-voted because we don't know anything about the format of the csv input, nor are there any tests to verify his spec. Both LCC and UWYA for me.
What about this question: a substantial edit has been made? codereview.stackexchange.com/questions/223776/…
 
@dfhwze Ah, I see. Thanks for the comment.
 
we don't really do code reviews here (there's a separate site for that called "Code Review StackExchange"), but as a general principle, most people tend to avoid the use of Gotos these days. They're a bit of an old-fashioned concept, and shouldn't be necessary. If you want to jump out of your loop there are better ways. — ADyson 44 secs ago
 
12:00 PM
0
Q: Accessing span.name.actor-name using xpath

Random userI am trying to extract the text between the span tag : <span class=name actor-name>Name1</span>. The code has multiple such tags. Here the intended motive is to extract Name1,.. etc. This is my code so far: import requests from lxml import html payload = { "session_key": "random@gmailcom...

 
@Mast It's not abuse, it's now the way.
 
@Peilonrayz Says who?
 
Look on meta?
 
@Peilonrayz Link?
 
sec
9
Q: "unclear what you're asking" vs "Lacks concrete context"

t3chb0tAren't these two close reasons too similar? Since the Lacks concrete context exists I cannot remember using the unclear what you're asking anymore. unclear what you're asking Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currentl...

11
Q: What is "lacks concrete context" exactly?

PeilonrayzContext Recently I've seen an increase in people voting for LCC when I don't agree this is the correct reason. These all seem to be getting LCC VTC because they're lacking description. https://codereview.stackexchange.com/q/222407 Looping through this list takes time Displaying a paginated lis...

There's probably a couple of "why is my question closed as LCC"
It's been the way ever since the close reasons changed, people just half ignore it.
 
12:19 PM
Why the "Update"? It feels like that doesn't match the rest of your answer. — Simon Forsberg ♦ 26 secs ago
 
0
Q: Is self instantiation inside static javascript class method a bad practice?

ReynIs this a bad code using OOP JS(this is TS)? class KYC { public reference; public data = null; constructor(id: string) { this.reference = id? firestoreAdmin.collection('kyc').doc(id) : firestoreAdmin.collection('kyc').doc() : } async get() { const result = await this.refer...

 
@Peilonrayz Most of the votes on your answer there was before the "Update"
@Peilonrayz Only has one answer, with a -1 in score.
 
@SimonForsberg Yeah? And if you look at how the close reason is being used it didn't do anything to change it
 
@Peilonrayz Just because people half ignore it doesn't make it right though, does it?
 
We can say whatever we want on meta, but at the end of the day if no-one follows it it means moot
 
12:21 PM
@Peilonrayz Then what's the point of meta?
 
What is the point of meta in this case?
it's done nothing
 
My experience is that it's just a handful of users who, in my opinion, uses the close reasons incorrectly. Unfortunately, a handful is also exactly what it requires to close a question.
 
@SimonForsberg Right, and me complaining on meta fixes that how?
I've tried telling users in chat, linking to my answer pre update, and get ignored
It's now just the way it is, it seems
 
@Peilonrayz Honestly, unsure. It did bring it to attention though. The fact that everyone doesn't follow doesn't mean that the "right way" shouldn't be encouraged.
 
if everyone drives too fast, the speed limit might be too low ... it's not a straightforward right or wrong I'm afraid
 
12:26 PM
@dfhwze I don't think that analogy applies here.
@SimonForsberg When did I say anything about not encouraging the right way?
 
@dfhwze Try to convince the police of that.
5
 
It applies imo because ppl try make logical and intiutive decisions
 
@Peilonrayz The update to your meta-answer, the one I just un-upvoted.
 
@SimonForsberg It equally encourages both? What do you mean I discourage 'the right way'?
 
@Peilonrayz I didn't say that you discouraged the right way, I just meant that in that answer both ways are encouraged. Not only the "right way".
 
12:30 PM
Whatever then.
 
12:43 PM
@SimonForsberg Fun fact: a significant number of speed limit zones in the U.S. use the "85%" rule -- set the limit somewhere 85% of drivers follow it. If more than 15% are speeding, increase it.
It's completely ridiculous but it's also, unfortunately, how things here work.
 
12:59 PM
Greetings, Programs.
 
0
Q: Number of all specific substrings in a string; time complexity

Csongi NagyI would like to ask a code review regarding a type of exercise. Let's suppose I have to get the number of all specific substrings in a string. We call something specific if certain conditions are fulfilled (let's suppose it's an O(n) problem, so it won't matter much when counting the overall com...

 
Speed limits should be based on what's safe for that area.
 
1:17 PM
This is a way too broad question for Stack Overflow; see this page of the help center for what you can ask about here. This looks more like a question fit for Code Review. — Adriaan 39 secs ago
 
0
Q: Find the maximum number in an array of numbers

Arjun AshokThe task is to find the maximum number in an array of numbers. I have taken every number in the array to be byte-sized. I have written the code such that the result is stored in ch at the end. Code optimization and improvement required. org 100h lea bx,array mov si,0h mov dl,0h mov dh,n cmp ...

 
This question belongs on CodeReviewThumbnail just now
 
1:40 PM
might be better if you could actually write some real code to do this and submit it to codereview.stackexchange.com. that said, why are you using so many processes/threads? why not just use two and alternate between them before the time runs out. also what is a "channel", why do you need to switch? — Sam Mason 55 secs ago
 
1
Q: Parsing and plotting with numpy (or pandas)

Shawn Marion fanI am trying to improve the following code to make it more broadly applicable and quick to use. # IMPORTS import numpy as np import pylab as py import matplotlib.pyplot as plt from scipy import optimize from scipy.optimize import curve_fit # THE INEFFICIENT PARSING: SELECTING VALUES FROM SEVERAL...

 
2:00 PM
0
Q: Matlab grammar to enhance

JérômeI wrote a grammar for Matlab using the SSLR toolkit and inspiring myself from Python's grammar. You can find the code below. Do you have suggestions of modifications and improvements ? Thanks for your participation ! public enum MatlabGrammar implements GrammarRuleKey { NAME, ARGUMENT, ARGLIST,...

 
2:31 PM
If the code works as intended but performance is an issue, then, I think, it would be better to post it on codereview.stackexchange.com instead. If you do so, write something about the purpose of the code, provide input data, and I also strongly suggest delete this copy of the question. — Georgy 30 secs ago
 
@Peilonrayz Well, yes, but since some consider it abuse I thought it would be useful as a clarifying sort-of-definition.
@Donald.McLean You'll get different opinions on what's safe depending on who you're asking.
Safest thing is not to drive at all, so if it's about absolute safety...
@DerKommissar If they'd try that on some of the roads I frequent, there would be a lot more accidents.
 
0
Q: C program to parse source code of another language

RobotManI am new to C, and I have very little formal education on programming (Although I am currently in college). I work as a Robot Automation technician, and me and my team are required to document a lot of things. I wrote a program that we run on our robot computers to do this, but the language (RAPI...

0
Q: Method Refactoring Due to HashMap read Issue

SelvinBelow is the Original code. In 9th line, it was not able to get the string value even though it was there in master list(reasonMap). Tried Trimming the string as well, did not work. I had to modify the code as below, which worked perfectly. I would like the updated code to be reviewed, please s...

0
Q: Cracking the Coding Interview - 1.5 One Away

dariogithubI would like to know any suggestions about to improve my code solution and your rating of my approach to the problem, I based my code on the fact that if the strings have different length removing one character from the longer string is equal to add one character to the shorter one. Description ...

0
Q: Using external unique identifier field 'id' in Mongodb along with Golang

Prakash PandeyI am using Golang with MongoDB for my application. I want to design my application in such a way that in future if for some reason I have to change my database from MongoDB to some other database I can easily do it. For this reason, I have introduced a field called id in each and every docume...

 
Often it's not even the speed that's dangerous, but the lack of distance between cars at that speed.
5
100 mp/h is fine if you're going in a straight line and the nearest car is 5 miles behind you.
Assuming car is in a condition to warrant that and all such caveats, but speed alone doesn't kill.
It's not the acceleration that kills you, it's the sudden deceleration :-)
3
 
2:47 PM
Monking
 
3:01 PM
@Tomerikoo it's too much time tweaking things and not answering the question at hand. Code is nearly always improvable, but that's for codereview, OP just needed to know how to write to a new file on this occasion. — Nordle 49 secs ago
 
@Mast A very long time ago when I was in Drivers Education we learned that at 60 miles an hour it takes about 360 feet to stop. The suggested distance between cars for that was 6 car lengths. Also don't watch the car in front of you but the car in front of that.
@Donald.McLean In California there is a safe speed law, but it generally decreases the posted speed based on the conditions.
 
possible answer invalidation by Dessus on question by Dessus: codereview.stackexchange.com/posts/223812/revisions
 
3:17 PM
@Duga rolled back, since OP added updated version of code; interesting to note that it is a HNQ
 
3:51 PM
Monking
 
@Mast That's what engineering is for
 
1
Q: Safe Dispose of Timer

AFruehI am currently refactoring a larger solution where the compiler gave multiple warnings about disposing the used System.Timers.Timer instances. The timers are running in short intervals so I would have to check before I dispose the timer if the elapsed callback is currently active. Following the...

-1
Q: Cleanest way to call C code from C++?

AdityaSo I am dealing with really old C code, which was written in the 90s or maybe even the 80s. The C code is frozen essentially. I am not allowed to change it. My current task is to write a service in C++ that wraps the C code. Most of the function signatures of the C code looks like this: read_da...

0
Q: Create a pump object from either one of pump model number or pump product id

DennisConsider this code: class AssemblyFactory { public function makeAssembly(array $params) { if (array_key_exists('modelNumber', $params)) $pump = $pumpFactory->fromModelNumber($params['modelNumber']); else if (array_key_exists('productId', $params)) ...

-1
Q: Data Model Design for Phone Call Model

wdavies973I'm working on a data model to store information about telephone calls: public class Call { private String from; private String to; public enum Status { Dialing, InProgress, Completed_HungUp, Completed_NoAnswer, Completed_Busy, Unregi...

 
4:15 PM
This isn't how Stack Overflow works. The answer box is for answers, not follow-on questions. SO is not a discussion forum. If you want to ask how the code can be improved, post a new question asking that (but probably not here, check out code review's help and then possibly post there if it fits those guidelines). — T.J. Crowder 19 secs ago
 
0
Q: localStorage should expire after 24 hours

user1941537The following code is checking if the user's browser is IE and if this is the case and there's no localStorage yet, it sets a localStorage, which should be valid for only 24 hours. (function ieAlert () { var isIE = document.documentMode var lastClear = window.localStorage.getItem('myLocalSto...

 
if this code works and you just want to optimize you might post on codereview — depperm just now
possible answer invalidation by dfhwze on question by KyloRen: codereview.stackexchange.com/posts/223776/revisions
 
4:47 PM
Absolutely not. Code review is for working code. The above is a broken pile. — Blorgbeard 8 secs ago
 
4:57 PM
In my flagging history I notice my most recent flag dates from 5 days ago, even though I flag on a daily basis. Is this normal?
 
-1
Q: Java rotate square matrix by 90 degrees

Pierre-AlexandreI am a computer science freshman and I tried to implement the algorithm to rotate a matrix by 90 degrees. My code only works for a 3x3 matrix because I have not been able to apply the pattern to every NxN matrix. Would it be nice if I can get some feedback on my code and also if you have any ti...

 
5:14 PM
If your code is working and you just want efficiency, it's better suit for Code Review. — dwirony 37 secs ago
 
0
Q: "When to take medicine" Challenge on CodeChef

msmilkshakeI just submitted this code to solve the "When to take medicine" challenge of CodeChef (link to problem): #include <iostream> #include <string> #include <sstream> int countDays(int dd, int subtract) { return ((subtract - dd) / 2) + 1; } int main() { int t {0}; std::cin >> t; std...

 
5:40 PM
@dfhwze I see a few flags that I raised today in my flag history...
 
5:57 PM
@SᴀᴍOnᴇᴌᴀ I take it that Close and Flag act the same way, I always press Close.
 
0
Q: test oriented design; Python test script to test a company's API, print test results, log exceptions

DanI'd like some constructive feedback on the code that I have written to test the API for smartsh33t.com I wrote it in Python. I wrote the program to take .json files and read them into the testrunner. then invoke the companies API for the create sheet functions, then record the results. I am i...

 
I think once you earn the Cast close and reopen votes privilege then it no longer counts as a flag
 
You're posting on the wrong site. Take this to code review — Akintunde-Rotimi 16 secs ago
 
> Note that once you gain the reputation to vote to close, you should no longer flag for moderator attention to have questions closed or migrated. It is your responsibility to vote now.
 
6:14 PM
@SᴀᴍOnᴇᴌᴀ Thanks for the useful link. The only situations I still use to flag for mod intervention is rude behavior. Reading the link, I should just flag/vote to close.
 
@dfhwze yep NP
 
This is a Q&A site, and @Akintunde-Rotimi is correct, this should belong on CodeReview (check their guidelines though). — Script47 26 secs ago
your belief is wrong. you'd be more on-topic at code review. (for example: "how to do it better" is both opinion-based and too broad, therefore explicitely off-topic twice). that being said: parameterised statements and password_verify - you're off to a good start. — Franz Gleichmann 22 secs ago
 
@dfhwze I've flagged 6 posts as spam, but no questions - just answers
most of my flags now are outdated comments
 
I'm voting to close this question as off-topic because it is asking for a code review and would be better posted to the Code Review Stack Exchange site. — Dave 46 secs ago
Anyone able to migrate this post? I don't know if that is possible without moderator intervention, particularly with CodeReview (unsure if it is fully-implemented yet). — Cyril 31 secs ago
 
7:08 PM
If the code is your own, it works, and you're looking for a complete review of the code, Code Review might be a better match for this question. I strongly encourage you to read their help center before asking though. — Heretic Monkey 33 secs ago
 
7:19 PM
 
0
Q: Command Design Pattern Implementation: Moving Robot with Undo-movement (Python)

Minh TranI'm learning about the command design pattern and would like you to critique it for division of responsibility, especially with regards to how the robot "undoes" commands it previously executed and where those commands are stored (inside RobotController) Everything seems to work correctly. I do...

0
Q: Python Script to download images and videos from a user's profile on Instagram

rawdpiperThe script downloads images and videos from a user's profile page on instagram. It works fiine, but I'll like to know if there are ways to improve the script. All ideas and suggestions are welcome. import sys import os import requests import urllib.request import time import json from colorama i...

 
@RMunroe or maybe it wasn't the Challenger that did it, but instead the LZ 129 Hindenburg...
 
Take a look at codereview.stackexchange.com for reviews of working code — Blorgbeard 55 secs ago
 
7:38 PM
I just reviewed a question of which after the answer I found out a follow-up is available :s
Which makes me think, is it 'good practice' to edit a question and indicate a follow-up exists?
 
@dfhwze If done by OP, absolutely. If done by others, I'm not sure.
 
8:01 PM
0
Q: Store subranges from contiguous range into array based on criteria

lifeuhfindsawayMy code parses through a contiguous range of data in a spreadsheet (orng) and creates subranges from orng that contain the same string value (lot number) in the 6th column of orng. orng has 42 rows and 38 columns and each subrange has 1-15 rows and 38 columns. As far as I know, I can't create a n...

 
@Mast I'll check the meta tomorrow whether others have been in this situation before. Bed time now.
 
8:16 PM
Thank you so much for the feedback and answers. I will keep in mind the Code Review, which I was not aware of. @IronFlare, The reason why the inputs are formatted that way is simply the way I am getting the data from an API I do not have control over... — user906573 27 secs ago
 
8:40 PM
Try codereview.stackexchange.com. That is the place to ask such a question. — VDWWD 7 secs ago
possible answer invalidation by HappyHands31 on question by HappyHands31: codereview.stackexchange.com/posts/223821/revisions
 
0
Q: STL-like vector implemention in C++

ademI attempt to write a STL-like vector, mostly because figure out how is it works. I wonder which parts are looks weird or what I made stupid. Any kind of comment is appreciated: #pragma once #include "alloc.hpp" #include <algorithm> #include <initializer_list> #include <limits> namespace p1v0t ...

 
9:21 PM
-1
Q: Good habits for HTML structure in connection with Bootstrap 4

bambolinaI'd like to discuss an html structure. There is many ways to structure it, but i'm thiking of the one that includes best habits, looking from many perspectives. Not too many divs? As much named tags as possible? Like <header>, <footer>, <article>... tags. It is good to use a <main> tag? And so ...

 
9:41 PM
0
Q: Nested Python Dictionary with containing arrays of lists into Pandas dataframe

Shadman QaisarI have a Python Dictionary in the following format: { 'data' : { 'Future_Col_Name_1' : [['time_stamp_1', val_11], ['time_stamp_2', val_12],...], 'Future_Col_Name_2' : [['time_stamp_1', val_21], ['time_stamp_2', val_22],...]]}} And I need to convert this into a dataframe in the following f...

 
@David Please don't recommend sites when you don't know what is on or off-topic there. The user has now posted an off-topic question on Code Review. Thanks. — Peilonrayz 26 secs ago
 
10:01 PM
@Peilonrayz Gabriel ?== Shadman Qaisar
 
Questions like this where you are looking to optimize working code are better asked on codereview.stackexchange.com This site is focused on code that doesn't work — charlietfl 22 secs ago
 
@SᴀᴍOnᴇᴌᴀ Where've you got Gabriel from?
Oh, yeah looks that way
 
@Peilonrayz The OP of the SO post you commented on
this may be a case of mistaken identity...
 
10:21 PM
0
Q: Isn't this code an itertools.tee misuse?

Dmitry KuzminovThere is a code sample in the book "Clean Code in Python" which I find controversial. def process_purchases(purchases): min_, max_, avg = itertools.tee(purchases, 3) return min(min_), max(max_), median(avg) The purchases is a generator of float values: def load_purchases(filename): ...

 
@CaptainObvious appears to be just code from a book - I left a comment for the OP to confirm
 
Generally you ask these sort of questions on other Stack Exchange sites. There may be sites dedicated to code review but be sure you read the appropriate FAQ and reformat your question as necessary before posting — MickyD 9 secs ago
1. See How to Ask and minimal reproducible example. Your code is long, your explanation is long and your spreadsheet takes a lot of time to load= No one wants to even comment here. For future reference, Provide a sample spreadsheet(not the whole thing), if you are unable to summarize the problem adequately in the question. 2. Having skimmed your question,You seem to be mixing formulas and code,depending on query/unique and other formulas.Don't depend on formulas; Recreate the entire logic in your script itself.Try w3schools.com/js 3. Try codereview.stackexchange.com This is not the place for reviewQs — TheMaster 33 secs ago
 

« first day (2258 days earlier)      last day (323 days later) »