« first day (2544 days earlier)      last day (1468 days later) » 

12:00 AM
RELOAD! There are 6525 unanswered questions (90.0804% answered)
 
12:44 AM
0
Q: Unit test jest https request using mocks gives error TypeError: Cannot read property 'end' of undefined

uppuHi I have following code function handler(...) { var req = https.request(options, function (res) { ... }); req.on('error', function (e) { context.done(null, 'FAILURE'); return callback(new Error(`Error: ${e.message}`)); }); if (writeContent) { req.write(writeContent); } r...

 
1:15 AM
Thanks again for this. I played around it some more today looking to speed up as much as possible. Posted on codereview.stackoverflow if you're interested in the results. — GollyJer 19 secs ago
 
1:27 AM
@Mast how ya doing
 
0
Q: Fastest conversion of ISO 8601 string into javascript Date object

GollyJerOn StackOverflow I got a great answer to a question I had about creating a Date object from an ISO 8601 string with the ability to reposition into local time. From there I wanted to see if I could make it any faster. We process a ton of dates in batches of 10,000 or more sometimes on slow phones...

 
2:06 AM
I’m voting to close this question because this seems to be an issue for Code Review, not Stack Overflow. — Prune 14 secs ago
 
 
2 hours later…
4:10 AM
Are you simply asking for a code review? May be a better question for codereview.stackexchange.comDrew Reese 23 secs ago
 
4:20 AM
I’m voting to close this question because it belongs on codereview.stackexchange.comDrew Reese 1 min ago
 
4:57 AM
Ben Popper on April 21, 2020
On this episode of the podcast, we chat with two of the Stack Overflow developers working on our public sites and community tools.
 
5:46 AM
@Malachi Good enough.
Wondering about the increased amount of crap SE-wide while trying to do my actual job :-)
 
6:33 AM
The code is quite clean. Consider posting on codereview.stackexchange.com instead. Review questions are off topic for SO — Mad Physicist 5 secs ago
 
7:08 AM
0
Q: Write a function to determine whether an array contains consecutive numbers for at least N numbers

JojiI am trying to write a function to determine whether an array contains consecutive numbers for at least N numbers. For example, the input is [1,5,3,4] and 3, it turns true because the array has 3 consecutive numbers, which is [3,4,5] Here this function requires sorting beforehand and it is not t...

 
 
1 hour later…
8:13 AM
If the code works (give expected results with no errors), you could post it on Code Review for an exhaustive review. — Serge Ballesta 47 secs ago
 
-1
Q: java.util.ConcurrentModificationException

KeVP83I am working on a school project and have following issue: I have a Set with Orders. (Order has a date, waiterID, orderNr and a List of OrderItems) I want to filter those orders by Waiter and create a List of all the OrderItems from that Waiter. I tried to use a stream (as requested by the teache...

0
Q: Pig Latin Converter

Roshan ShresthaI have written a program on Pig Latin converter which I've attached herewith Pastebin. I am still a beginner, and I know that the code works perfectly, but can we make some improvements in this code cause I don't like using break statements too much. Also, is there any way to make this code small...

 
8:37 AM
@Ryan In my opinion there is too much commenting. I would love to give an explanation, but doing so in a this comment on this answer wouldn't work, and posting a new answer would be off-topic for your original question. You might post a new question here on SO, but it might be closed as too "opinion based". --- So - could I suggest posting your code and asking about its commenting on codereview.stackexchange.comGavin Lock 5 secs ago
 
8:52 AM
I’m voting to close this question because this is more of a code review question. You might want to try posting it on codereview.stackexchange.comElias Van Ootegem 44 secs ago
 
9:23 AM
0
Q: GEEKTRUST: TAME OF THRONES OO Modeling

Adit A. PillaiI am trying to solve a problem on GeekTrust, called Tame of Thrones (here) And would like to get my code reviewed. I am trying to achieve the badges for Functional/OO Modelling and Extensibility. I'm not sure how to paste all of that code in here, is it ok to share a Github link? Following are...

0
Q: Namespace in project

darkSo lets imagine what i have one class like Fob with the Move() method and another class Fob with the same method Move() they are in same namespace, so i want now to call Move() method from the first class Fob in the second class. I'm thinking what i need to extern aliases but in my project then i...

 
possible answer invalidation by Miha on question by Miha: codereview.stackexchange.com/posts/240858/revisions
 
9:45 AM
-1
Q: what is the time complexity of the following code

Nikhil Chauhan problem statment: code: a=[[1,0,0], [0,0,1], [0,0,0]] count=0 check=1 for i in range(len(a)): index=set((index1,index2) for index1,value1 in enumerate(a) for index2,value2 in enumerate(value1) if value2==check) if len(index)!=len(a)**2: for x,y in index: l,r,u,d=y...

 
10:08 AM
0
Q: Class for user actions

DestroyerI implemented a class for relationships with the user (deletion, name change, check for existence), I created this class to remove extra logic from the activity class. Could you talk about how my code can be improved? class UserActionManager @Inject constructor(private val repository : BaseAppRe...

 
 
2 hours later…
11:39 AM
This question appears to be off-topic because it is a code review request. This might be better suited to the Code Review Stack Exchange site. Before posting there be sure to read their FAQ to ensure that your question meets their guidelines. — John Conde 6 secs ago
 
12:00 PM
-1
Q: How do I make this code shorter and more efficient?

MelPradeepThis is my solution for the Credit problem on CS50's Pset1. It involves using Luhn's Algorithm to test the validity of the Credit Card Number entered and based on a few conditions attempts to identify the Credit Card Company. Check_Length attempts to find the length of the number entered. Check_...

 
12:23 PM
0
Q: Roman Number Conversion in Java

Neslihan BozerI have implemented a roman number conversion class below. I have designed by using the stack data structure(as similar to balanced parentheses problem.) checking if the previous element whether it causing decreasing the number or not? Please put your valuable comments on how could I improve it?...

 
This post may be better suited to Code Review Stack ExchangeMartin just now
 
12:43 PM
@Mast I would be surprised if they didn't sell anything in the EU.
Ryobi is a good brand here in the states. I stick with them, Rigid, or Milwaukee.
 
1:08 PM
-1
Q: Find max and min simultaneously in a Python list?

PenguinSnowOne of the simplest way to find the maximum and minimum of a list: a_list = [...] max_item = max(a_list) min_item = min(a_list) However, I feel iterating through the list twice is wasteful. Is there a more efficient way to do both in only one go?

 
@DerKommissar I've never seen any of their equipment in anyone's shack. I've seen a lot of shacks.
And sheds, workshops, etc.
 
Lawn equipment or power tools?
 
1:23 PM
@DerKommissar Neither. It's all Bosch, Makita, Karcher, Stanley, Ferm, Metabo, Black & Decker, Hitachi, AEG, Gardena, Wolf, Robomow, McCulloch, Einhell and some smaller almost nameless brands (Wesco, Workx, OK, Lux).
Never seen any Ryobi.
 
Oh yeah I love Makita too.
I meant Makita when I said Milwaukee above, by the way.
I'm not a huge Bosch fan on the powered side, but I love their bits, hand tools, etc.
Same with B&D, I am not a big fan of their powered stuff but all their hand tools and bit sets are great.
 
Ah, yea, I've used a Milwaukee cutter professionally for a while.
 
Metabo's are amazing too.
I just don't buy them because I like Makita better.
 
Metabo powerdrills, the non-battery ones, are indestructible.
 
Yeah that's the ONLY power tool I would get of theirs. I use battery Rigid, and those are a lifetime "we don't ask questions" warranty.
 
1:27 PM
Professionally that works great. You basically rent the battery and whenever it isn't doing so well anymore you get a replacement. Often with pick-up service or drop them at the nearest toolshop.
 
0
Q: Cleaning up Javascript event listener that manages game-loop

CrupengAs I added more features to my chess game, such as an endgame screen. I eventually ended up having a lot of duplicate code, and complex logic with lots of nested if statements in loops. The usual advice is to add more functions, but I cannot think of ways to reorganise this code such that each pa...

0
Q: Receive data from SQL and CSV and send it to MySQL database using Python

LV98Details: I have a code, which does the following: Get data from CSV and insert it into MySQL table Get data from SQL Server and insert it into MySQL table Run this code every 240 seconds - to refresh the data, in order to have up to date infromation. I'd like to know whether the code below, ...

 
All those take the same battery except the router, which is corded.
 
@Mast I'm just happy I still have a job.
@DerKommissar I use Ryobi tools
saw your tweet about your lawnmower
 
My lawn tools are Ryobi lol
 
1:32 PM
how do you like it?
 
Love it
Used it yesterday to cut a (huge) pile of leaves and then my whole backyard.
Did the whole job on two 4AH batteries and in ~20 minutes.
 
NICE!
 
I didn't even have to touch the 6AH's.
 
I want to get the one that runs on the 18V
 
The 40V toolsets are amazing.
I got the trimmer (and a hedge clipper attachment) and the leaf blower last year.
 
1:33 PM
@Malachi Same here. Luckily we got a full workload right before sh*t hit the fan, so no lay-offs either. We'll be good for at least a year.
3
 
@DerKommissar how do you like the leaf blower? does it actually work for blowing leaves?
 
@Malachi OH YEAH
And it has a "turbo" button.
 
@Mast That's Awesome.
 
110MPH / 500CFM
 
@DerKommissar Right, I forgot your shed is as big as my house.
 
1:34 PM
I think you should ask this on codereviewcigien 32 secs ago
 
we didn't get any new work, but we know work will be returning.
 
we do assessments for several School Systems.
 
@Mast Garage, holds 2 cars, I only have 1 lol
2
 
and they shut down spring Testing on us
anyway I have to start work
 
1:35 PM
@DerKommissar If my wife gets a car, one of us will have to park it 150m out. Garages are at a premium nowadays.
 
Ouch, that's a bummer.
I was parking mine in the driveway for a bit last year while my ex lived here.
I had a bunch of stuff in my side of the garage.
Now that she's gone the garage is empty too lmao
 
I sometimes have to park it in an iffy place (technically too close to a corner) if I come home late already.
 
Ah bummer.
You live in the city though, don't you?
 
City council thinks if they push enough problems on car owners, the amount of cars will drop eventually.
 
Yeah, they're trying that some places here.
They raised the registration rates for Hybrid and Electric vehicles in my state.
 
1:37 PM
Meh, city, city, it's a big village. But villages here are more compact than at your side of the ocean.
 
Yeah I bet. We're spread pretty well.
 
@DerKommissar what do you think about the Cybertruck?
 
Gross
 
lol
 
I think all Tesla's look bad to begin with, but that one is a special kind of awful.
 
1:38 PM
lol
 
The 3 and S don't look too bad.
 
I kind of like the truck
I don't like the cars.
 
I think they all look like garbage, but I'm still a square-body guy.
 
The Semi is going in production somewhere end of this year, right? That's going to be something.
 
I have a 2018 Honda Accord Hybrid, and I think they made those look pretty dang good.
Nice sharp corners, clean exterior, aggressive headlights and taillights.
My neighbor has a Model S and some stupid looking Buick lol
 
1:39 PM
I figure that it's the year 2020, I ain't got no flying cars, I at least want something that looks like it is from another century! lol
 
@Malachi A 3 will get you that. Looks like what concept supercars looked like 2 decades ago.
 
I almost bought a Genesis G70, those look pretty slick too.
 
Had you put a Porsche logo on it years back, lots of people would believe it.
@DerKommissar With a grill big enough to barbecue on?
 
Yep lol
 
1:43 PM
Have there been electric F150's sighted yet?
 
Was going to get the 2.0T with the 6-speed manual.
 
The F150 EV is not going to sell well here, but I imagine over there it just might.
 
It won't sell here.
People who buy trucks here buy them for the "sound" and "looks", not for the utility or anything.
(Except me, apparently.)
I still have an old F350 (1985, older than me).
 
If you don't need them for utility, put a subwoofer in the back. Plenty of room for it.
 
I buy my cars for utility. Looking good is a nice side-effect, but if I don't need a truck I'm not getting a truck.
 
1:45 PM
I buy mine for mileage. 45km+ yearly.
 
I used to put 20k miles / year on mine, now I'm around 12k.
 
Difference between driving 1:16 and 1:18 is 500 bucks in gas.
A year.
@DerKommissar Mileage is much less of an issue then.
 
0
Q: Luhm's Algorithm

Nicholas FokI've was attempting a problem set from edX's CS50 course on the introduction to computer science. The code is supposed to take a credit card number and identify the type of card. When I compile the code, it continuously prints 0 and I have no idea where to begin to identify the problem areas. ...

 
I used to fill my tank every other week, now I fill it less than once a month lol
 
@DerKommissar I like the sound, but I have a Harley Davidson too...lol but I want a truck so I can get lumber and haul dirt and stuff like that. and help people do these things that don't have a truck.
I looked at the 2.0 F150 but didn't have the money
 
1:59 PM
I'll sell you my F350 lol
It's an F350 1 ton Dually 4x4 4-speed manual.
 
I think it was just one of those vehicles that changes the amount of cylinders being used based on the power demand
@DerKommissar got pictures? is it diesel?
 
Quick "stackable or no?" question: As my bachelor's thesis I have written a library in C, about 800 LOC, and am looking for some feedback. Specifically its an immutable hash trie, similar to Clojure/Scala's persistent hash maps. Is that within scope here?
 
It's gas, and I've got pics somewhere.
@ammut As long as it works and you intend to consider the feedback, sounds reasonable.
 
@DerKommissar message me on .... Twitter?
 
@Malachi Do you still have my cell? I can do that too though lol
 
2:01 PM
@DerKommissar let me check
you still working?
 
Yep
That's my cell lol
 
@DerKommissar it does and I intend to. Thanks.
 
@DerKommissar I fill it every 3 days.
 
@ammut Cool, sounds like it fits then. :)
 
@ammut Sounds ok. May I suggest the FAQ on asking questions to improve your chances?
 
2:15 PM
0
Q: UPDATE ... SET ... WHERE equivalent in R

akrafI need to modify a table based on a shorter table which contains the new values. The new table has a subset of the columns of the old table. Some columns of the new table serve as identifiers which rows of the old tables should be changed and some columns contain the new values. The columns that ...

 
2:38 PM
1
Q: An over-the-top approach to data entry

Hayden MossMy goal: to make the already easy task of filling out an excel sheet 1% easier by putting in hours and hours of effort. On a more serious note, I'm currently developing a system to manage inventory at my work. The following is my attempt to smooth out the process of receiving inventory when it ar...

 
I’m voting to close this question because it is asking about improving working code. Ask on Code Review. — Daniel A. White 10 secs ago
 
@DerKommissar How much room in the garage is used by your tool shop?
 
I’m voting to close this question because the question belongs to codereview.stackexchange.com — Your Common Sense 59 secs ago
 
3:00 PM
-1
Q: Regex to remove spoken email names

RandomTaskThe regex below removes email names from a spoken transcript. Examples below are completely made up. You'll note above that "dot" and "at" are the only common terms. Format: token1 tokenN at word dot word before "at" remove 1-2 tokens delimited by spaces remove "at" remove the word after ...

 
@pacmaninbw Not as much as you think. Actually just finished cleaning it up.
The car can honestly move a good 2 feet camera left, but no one else parks in the garage so I take what space I need.
 
4:08 PM
0
Q: Sum of Look and Say Sequence

Jonathan TapnioI'm still learning c#, and I need my code to only run less than 2 seconds to be accepted. I have a look and say sequence and after the last number is found, the code sums it all up, and it takes so long if the element in the sequence is big. Example: Input: 2 Output: takes less than a second ...

0
Q: Easy to use Thread Pool Implementation

Paulawhile ago I asked about a thread pool implementation I had made. I took the advice down and modified it a lot over time to fit my needs. It has been serving me extremely well in all of my projects but I was wondering if there was anything else I could improve on? Here is the class: class Threa...

-1
Q: A better OOP way for solution

Gaurang ShahI am implementing a functionality in Scala to Copy files from one FileSystem to another FileSystem. And this is what I have implemented. CopyFile.scala Methods are empty. However, they will just call external library and will do error handling. object CopyFiles { def localToHDFS(src: Str...

 
4:23 PM
If you want a review codereview.stackexchange.com might be a better place for this question :) On SO you should ask a more specific question. — churill 51 secs ago
@churill I've given it some thought but I felt that since this is pseudo code, and not actual syntax of any programming language, it would be more appropriate for here, or even Computer Science, then code review. Maybe it's a mistake on my part. Let's hope someone will comment anyway :) — Rorschach 8 secs ago
 
0
Q: FileSystem Utilities wrapper

Martin YorkRelated to my code I just put out for review. I wrote some small helper functions for dealing with interactions with the file system. This is not meant to by any type of "File System" wrapper. I just wanted to put my code into named functions to make the code Column formatting code easy to read ...

 
@churill Pseudo code is off-topic on Code Review. — Peilonrayz 35 secs ago
 
4:43 PM
@Malachi There's this:
 
4:54 PM
Hi there
 
5:15 PM
-1
Q: My query works, but it takes too long to run - can it be optimized?

KOBI have written the following SQL (Presto) query that runs, but takes far too long and so exceeds the runtime allowed on the Presto cluster. Can the joins and aggregations be optimized? WITH all_topups AS ( SELECT customer_id, credit_id AS transaction_id, day AS trans...

 
@Mast I don't think this is real good for hauling lumber.
Glad to see we got the stars going again.
 
5:38 PM
0
Q: PostgreSQL Function for User Creation

TorkoalI've been challenging myself to write a small CRUD app just using Postgres functions. Below, I have the function I have been using to create users: create or replace function create_user( email text, pass text, out response json) as $BODY$ begin insert into users (email, pass_has...

0
Q: Python: Scalable design of a system with multiple state machines, where valid state transitions depend on the state of other machines

Blue7This is a pretty huge question, however, I would appreciate it if you could just review the design and not my implementations of it. The Implementation and test sections could be ignored, they are only there to aid the description of the design, in case I didn't describe it very well. This makes...

 
 
1 hour later…
6:45 PM
0
Q: How to make a function better so that it finds many different regex and counts them?

AnnaI need help in improving a function. Right now the aim of my code is to take an XML file, take the child elements (text tag) of the new_line tag and store their index as keys in a dictionary, and the elements as values in the same dictionary. Having done that, I delete some keys whose values cont...

0
Q: Is this code good ? Does it have any problems?

Roxana GomeajaI have a code and i want to ask you if my code contain any problem. I know it is open to SQL Injection ( i will use prepared statements for that ) So without this problem there exists any other problem ? <?php include 'dbConfig.php'; $statusMsg = ''; if (isset($_POST['submit'])) { $name = mysq...

0
Q: ImGui manager singleton

Rick NijhuisFor my game engine I am implementing ImGui for debugging purposes. In order to manage ImGui I have made a singleton to make sure only one ImGui context gets created. I am not entirely sure if this is a good implementation of a Singleton so I am looking for some feedback, also is using a Singleton...

0
Q: Scala: String Tokenisation Cumulatively

Wiki_91I'm trying to split an incoming stream of strings into cumulative tokens using a function below, def cumulativeTokenise(string: String): Array[String] = { val array = string.split(" +") var result: Array[String] = Array() array.map { i => ( result = result :+ ( ...

 
7:13 PM
If this is working code that you want reviewed then this would likely be a better fit here: codereview.stackexchange.comDavid just now
 
@pacmaninbw Probably, but if that ass isn't futuristic, I don't know what is.
Hey, someone on my watchlist got suspended. How did I miss this...
 
7:53 PM
This may be better suited for Code Review. — nanofarad 34 secs ago
 
-1
Q: Tic Tac Toe Python Creator

user222706I'm not sure how to solve this. Any help? I've tried for a while and couldn't get anything to work. The text tells you what to do but I don't know how to make it work. Every answer is appreciated! """ This program simulates the game of tic tac toe. """ # get_valid_index # ----- # Get row or col...

0
Q: Listing my StackEchange communities user id

artu-hnrqExtending this answer solution, I've wrote the following bash script to get my StackExchange accounts page html and parse it to a YAML file. The objective was list for each community I participate its url and the given user id. #!/bash/bin NETWORK_PROFILE_URL=$1 read -r ID USER <<< \ $( cut...

 
8:05 PM
@Mast I wondered why I hadn't seen them around for a bit
 
"its real value." --> some small double take 100's digits to express exactly. Usually 17 significant digits is enough. — chux - Reinstate Monica 34 secs ago
 
@Mast Futuristic and sexy.
 
@Mast I noticed a user suspended today - likely the same user you are referring to
 
8:38 PM
This isn't a question but more a code review or a post in the software engineering forum i dont feel like this belongs on stackoverflow. Also i find that with these questions the unity q/a or forums tend to get more response — sommmen 56 secs ago
 
-1
Q: Design a simple card game in JavaScript

JojiI wrote a simple card game in JavaScript and I wonder if anyone could give me some advice and make some improvements on my code. So it is a 2 person card game. Every card has a number and also has a pattern. The game goes like this: we have a set of pre-defined rules, and these rules have a ra...

 
9:00 PM
-1
Q: Small Javascript Lib to draw SVG file

Rami BelgacemI'm new to javascript and i decided to make a script that allows other developers to show SVG elements in the web browser. (it is just for learning purpose), and it is still under development. I made it in ES5 first and then i'm willing to upgrade it to ES6+ so i can learn and understand the dif...

 
@CaptainObvious ಠ_ಠ I'd think a user with 6 posts on CR and 6 network profiles would know how to edit his/her post...
@SᴀᴍOnᴇᴌᴀ Ok will delete this post and reopen a new one that has code in it — Joji 2 mins ago
~reaches for the WGFP
 
@SᴀᴍOnᴇᴌᴀ That's some 'top quality' SO mentality right there. I browse some questions and the amount of reposts I see in answers is weird.
 
9:23 PM
0
Q: PHP Vending Machine Input Issue

QuincyI am a beginner in PHP, I'm working on a simple Vending Machine program and I am currently stuck. The program is supposed to check if the inputs are numeric & is less than or equal to 0 and isset() to check if the submit button has been set. I believe I have that so far but I don't think it's run...

 
@CaptainObvious sounds off-topic but OP doesn't actually want help with implementation...
 
@SᴀᴍOnᴇᴌᴀ Not a fan of the edit, as it's moved all the flags into the beginning of the question. Hopefully the OP gives some info to resolve them.
 
9:38 PM
@Peilonrayz I was trying to avoid it being closed in case it is salvageable but feel free to rollback my changes if you want
 
@SᴀᴍOnᴇᴌᴀ I'm not going to roll it back - just thought you should know
 
10:08 PM
0
Q: array of struct read from file in C

GarfieldCatI want to read csv file in to array of structs with NULL ending. test.txt 11,345,1,k 12,34.23,3,v 13,13.4,5,x 14,15.7,6,c #include <stdio.h> #include <stdlib.h> struct csv_line { int value1; float value3; int value2; char char1; }; struct csv_line *line_pointer = NULL; int main(...

0
Q: Optimize code usage and repeated code

RubenI have a method that I use nested foreach and the same variable call multiple times. I read a lot of optimizing code but I'm pretty sure I can do this with less code and best practices: public async Task<IEnumerable<IssueViewModel>> Get(IssueSelectModel model) { async Task<...

 
If you have working code, check out Code Review for feedback about improving it. — Code-Apprentice 19 secs ago
 
10:31 PM
0
Q: How can i make my function which detects anagrams faster

Bruno PintoI was asked to solve the following exercise: Given an input vector, i have to find the anagrams and return only a vector only with the original strings. Example: Input vector - "code","doce","framy","frame","sad","cat","frema" Output - "code","framy","sad","cat" My solution is to sum the ASC...

0
Q: Design a simple card game in JavaScript

JojiI wrote a simple card game in JavaScript and I wonder if anyone could give me some advice and make some improvements on my code. Here is the demo that I build: https://codesandbox.io/s/cardgame-his95?file=/src/index.js So it is a 2 person card game. Every card has a number and also has a patt...

0
Q: Optimising multiple string splits and concatenations

ræymentI'm writing a program in Unity and am using a TextMeshProUGUI object (named history) to hold a list of messages to act as a terminal/console. The problem I am having is that I am printing up to hundreds of lines a second, which can be detrimental to performance when I'm doing many string splits ...

 
10:53 PM
0
Q: Simple State Transition Table

J. DoeIm implementing a feature and have created an operation for each step. operations are asynchronous. How can I implement a coordinator to logically transition from one operation to the next upon completion? Right now I simply store and send notification of last successful operation. Which notifie...

0
Q: Tic Tac Toe using Cartesian coordinate system

Joel VI am trying to learn the Cartesian Coordinate System, starting with a basic tic tac toe grid for simplicity, then perhaps moving to chess. I was able to make the following code to start out: board = [] def new_board(): for row in range(4): board.append([]) for column in rang...

 

« first day (2544 days earlier)      last day (1468 days later) »