« first day (2892 days earlier)      last day (1134 days later) » 

12:01 AM
RELOAD! There are 7477 unanswered questions (89.4955% answered)
 
 
2 hours later…
1:40 AM
@PaulMcKenzie Hello. Could you please have a look at this question for me? I would greatly appreciate your input on it. — a_sid 41 secs ago
 
 
1 hour later…
3:10 AM
This is a "code review" question, and too broad for StackOverflow. (That is one reason that nobody has tried to answer it in the last 5 years ....) — Stephen C 6 secs ago
 
3:49 AM
0
Q: Regex with comments

samuelbrody1249The below is to parse a lisp expression (doing as much as possible in 'one go'). How does it look, and what can be improved? # goal: capture the next token then get the rest of the line # to be used in a while-loop/yield tokenizer = re.compile(r""" \s* # any amount of whitespac...

 
4:37 AM
0
Q: Robot movement simulation [How to convert Java code to Python]

Sourish RoyI am trying to solve this leetcode problem. Even though I solved it, I would like to see how I could translate my Java code to Python, since I am learning the language and its OOP components. How would the translated code look like? This is the solution: class Solution { public boolean judgeC...

 
5:25 AM
0
Q: Abbreviating a name

debdutdebThis is a question from a CS diploma question set : Make a program that will create an abbreviation of any given name using the initials. For example if the name if "John Doe", the program will output "J.D". My Code: #include <stdlib.h> #include <string.h> #include <stdio.h> char *abbr (const ...

 
6:13 AM
0
Q: Create a two dimensional int array and find the smallest and biggest member along with the indexes

debdutdebFrom a CS Diploma course question set: Create a two dimensional array of ints, fill it with any random integers. Now find the minimum and maximum number, also find the index of those numbers. I was not sure what they meant by "fill it with any random integers". Should I just use my imagination?...

 
6:37 AM
0
Q: Simple Makefile to build scala file and running them

Node.JSI wrote this simple Makefile but it ended up like a spagethi code. I used basename multiple times. I have a special case for first.spec.scala.run and follow.spec.scala.run and maybe more antipattern code that I am not aware of. I am not happy with my code and I appreciate any feedback or review. ...

0
Q: C++ Program which seperates the nodes in the linked list in such a way that all the even nodes appear at the begining of the Linked List

Ritish Can anyone exaplain me this code.this runs perfectly but i cant understand how :(. i've approached this by creating a structure for the nodes of teh linked list. And then two functions , one for insetion at the beginniing of teh linked list and one to display the linked list. Can one please expla...

 
 
2 hours later…
8:37 AM
0
Q: Pandas replace rare values in a pipeline

RUser4512A common preprocessing in machine learning consists in replacing rare values in the data by a label stating "rare". So that subsequent learning algorithms will not try to generalize a value with few occurences. Pipelines enable to describe a sequence of preprocessing and learning algorithms to en...

 
9:25 AM
1
Q: Duplicate to value in list Haskell

Yuki1112I wanted my code to do the following in a list: when the index is bigger than 0, duplicate to its value. So for example: ListOp :: [Int] -> [Int] ListOp [1, 3, 2] = [1, 3, 3, 3, 2, 2] ListOp [ 5, 0, 1] = [5, 5, 5, 5, 5, 1] ListOp [ 3, -2, 1] = [3, 3, 3 , 1] I was wondering how to improve my code...

 
 
1 hour later…
10:37 AM
0
Q: Simple Rock Paper Scissors

MORTALI made a Rock Paper Scissors game. It works fine but I would like to know how can I improve it further. #include <iostream> #include <algorithm> #include <string> #include <random> #include <array> #include <map> #include <limits> namespace { enum Winner { Tie, Player, Computer, WinnerCount ...

 
11:25 AM
0
Q: How to abstract DOM manipulation in a simple intuitive way

eguneysI am building a library to abstract DOM manipulation. Here's what the usage looks like: vsAddToSection() { let _inChapter: c.InChapter; let v$sections = vmap([], _ => vh('div.section.item', {}, { listeners: { click: (e, __) => { this.ctrl.inSection(...

 
 
2 hours later…
1:21 PM
This question seems more inline with Code Review. Code Review Stack Exchange is a question and answer site for peer programmer code reviews. Stackoverflow is more on-topic for questions about problems and algorithms. — lorem ipsum 53 secs ago
 
2:13 PM
1
Q: simple MobilePhone java

עמית שוקרוןI just learned about arraylists and I got a mission to build Mobile phone application with contact list when you can add \ remove \ modify \ search for contacts. I would like to get a review! if you think I should add something to the code feel free to tell me :) thank you! public class MobilePho...

0
Q: Contacts programming challenge

AnatoliiI successfully solved a problem on Hackerrank called Contacts, but I'm curious if my code in C++ looks good to C++ developers. If not, how it should be improved. Below is the short description of the problem and then the code itself. Problem Add name, where name is a string denoting a contact na...

 
I didn't down vote it, but most of your might be better suited for the code review site. You shouldn't be fetching the events at the same time that stripe is posting events to your endpoint. Just let stripe send each event that you're subscribed to and handle them as they get received. — user2682863 16 secs ago
 
2:30 PM
This question might be better suited at Code Review. But make sure to read their How to ask first. — Ivar 36 secs ago
 
0
Q: Faciliate algorithm that calculats a number of Bernoulli trials. Where the number is equal to a matrix cell value

Jonathan1234I work in Rcpp and wrote the following code: #include <RcppArmadilloExtensions/sample.h> // [[Rcpp::export]] int NonDiagSum(arma::mat n, int K){ int sum = 0; for(int i=0; i<(K+1); ++i){ sum += n(i,K-i); } return accu(n) - sum; } // [[Rcpp::export]] arma::mat Last_Chance(ar...

 
You might find it better to ask this on codereview.stackexchange.com? — evolutionxbox 39 secs ago
 
3:01 PM
0
Q: Writing a thread-safe ring queue in C++17

Cloud7001I tried implementing a thread-safe ring queue in C++. I'm totally new to move semantics and C++11/14/17 in general. #ifndef THREAD_SAFE_RING_QUEUE_HPP_ #define THREAD_SAFE_RING_QUEUE_HPP_ #include <mutex> #include <optional> #include <vector> namespace structure { class MaximumCapacityReachedEr...

 
 
1 hour later…
4:13 PM
0
Q: SimpleDateFormat not throwing exception for invalid dates/formats etc?

VictorI see that SimpleDateFormat is not catching up with issues in the passed string. Could some one review and answer on how I can correct the below code. package com.example.demo; import java.text.ParseException; import java.text.SimpleDateFormat; public class SimpleDateValidator { public sta...

 
Monking
 
Monking
Things are always changing..... which at least, is somewhat comforting.
 
hey @rolfl long time no see
 
Yup, been around on the main site, just not on chat. I still check in every day.
But, Yeah, it's good to be back in the 2nd monitor.
4
 
I mostly check in these days, but started coding again few days ago as a friend is looking into coding now (coming from more of a consultant/project management role)
 
4:27 PM
Heh, I have been getting "breadth" recently, currently programming in embedded C, Go, and Javascript.....
There's something bizarre about programming for the SAMD20 Cortex M0, windows PC, and "large scale" Cloud applications at the same time.
 
Sounds interesting :)
I somehow got into Node.js/express with TypeScript
 
Well, I have to implement the Modbus protocol on the SAMD20 in order to have communications with IOT-type applications, a Modbus Go library as well.
At least the Modbus Go library I can opensource.
Don't dismiss Node/Express. It's my primrary language for almost all our work-work.
Typescript is OK, but we mostly stick to native Javascript in Node - legacy reasons.
 
I hadn't thought about using them but my friend is using that stack and I was like well I literally got an idea last Friday so why not do it :D
It's a feasible idea for once too
Downside is that I basically don't have a clue about what I'm doing
 
You have to be cognizant of the Node event loop, but when you get the async nature of how to use Node, it's remarkably powerful.... like, crazy easy to do powerful things
 
I'll just first get things to work and later understand what I'm actually doing
3
 
4:45 PM
That seems to be a popular approach.
 
@rolfl Seen you in the queues lately.
 
@pacmaninbw I have been in the queues pretty much every day, I think I have missed 3 days or something in the past few years.
I only really check out the late answers/low quality posts, as well as the reopen review queue though..... ... well, more specifically, I tend to avoid the close-vote queue, it's more time-consuming, and available to low-rep users.
 
There are usually enough people in the close-vote and FP queue, so those need less attention.
 
I think we need to close this question before someone else tries to answer it.
 
Although I tend to step in when the queue gets too large.
@pacmaninbw Done.
 
5:01 PM
@Mast I VTCed that one 4 hours ago.
 
I know, the review says so :-)
I was hoping one of the other readers/lurkers had a spare vote.
 
@rolfl If I remember correctly you have a boat. Have you used it this year yet?
 
@pacmaninbw Have a boat, but it's not yet in the water this season. There was ice on the water just last week.
 
Ahh, spring is late this year.
 
It was early here.
 
5:07 PM
Just wondering what is the number of moderators needed for this site? I'd prefer to keep working in the queues if I can. I think I do more good there.
 
@pacmaninbw Apparently 4. We got 4, 2 are stepping down, 2 new ones are to be elected.
Unless the election is going to state something else, the official post isn't out yet.
 
5:49 PM
0
Q: Better way to implement single end point REST API?

ucupHi I want to ask question about a better way for implementing single endpoint rest. I want to build a rest API but I want it to only have single endpoint like: graphql, where you only have like: host/graphql. I already doing this example in laravel where you need to put a key and method to go to ...

 
6:17 PM
@Mast the election page is already available (if you know where to look)
 
6:30 PM
currently the election is planned to fill two slots
 
@Vogel612 Ah, I found it.
Nomination starts in 8 days.
 
April 12th :)
 
2 slots available.
@Vogel612 Yea, I wasn't sure whether you meant election day, start of nomination or what phase with that date.
Now I do :-)
 
Yea, I could've been a bit more clear with that...
 
At least we got a bit of a heads up, which is always nice.
They haven't started yet and already I can't wait to see the results.
No idea who's going to run this year, although there's a couple of people I wouldn't mind seeing going for it.
Is that proper grammar? Hmmm...
 
6:45 PM
I'm pretty sure it is
 
7:43 PM
@loremipsum Thanks - I am a regular here, but I have never heard of Code Review SE :). — Tomáš Kafka 17 secs ago
 
0
Q: A thread-safe WebDriver pool to submit browsing jobs to

CarcigenicateFor a project, I need to make use of Selenium WebDrivers, and since they're so expensive to start, I decided to write a pool to manage them. with driver_pool.FirefoxWebDriverPool(5) as d_pool: # Sequentially visit a page 1000 times for _ in range(1000): # Don't actually run this. ...

0
Q: Best practices for viewmodels for SwiftUI preview?

Tomáš KafkaAre there best practices about how to prepare lightweight viewmodels with dummy data, that could be used in SwiftUI previews? Right now, I have a viewmodel for an in-app purchase screen, that needs to fetch products from the app store, but for mocking it in preview (without needing a whole fetchi...

 
8:46 PM
Questions about code elegance and idiom, especially when it's a generic call for improvements, are a better fit for codereview.stackexchange.com. They don't support question migration from here; be sure to read their FAQ etc. before posting. — Karl Knechtel 11 secs ago
 
9:02 PM
-1
Q: What do I need to fix to solve the Eight Queens Puzzle in Python?

StiffThe function should return True if placing a queen at position chessboard[row][column] results in a legal board. Otherwise, it returns False. We can represent a board as a list of lists. Each entry will be set to True or False depending on whether the corresponding square contains a queen or no...

 
9:50 PM
0
Q: C++, SDL, and RAII

KallDrexxLearning Modern C++ patterns and this ended up being the direction I went to to create an encapsulation of SDL's window management, while trying to stay with RAII practices. This is meant to be a base for a software renderer (and possibly expanding to OpenGL after that). window/input.h #pragma...

 
You can avoid most of your loops by vectorizing your calculations. Instead of creating a range and iterating over it: dis=[20,40].... while b<=len(dis)-1:, just create an array: np.arange(20,40) and use array or matrix operations. b) Don't overwrite the builtin reversed c) Your code could use a review, post it on CodeReview.SE d) Please edit the question to add the definition of dis, otherwise this is irreproducible — smci 35 secs ago
 
10:42 PM
I’m voting to close this question because it is a code review question and will get a better response at Code Review . — JohnG 35 secs ago
 
11:02 PM
1
Q: How can I speed up my combination search algorithm?

TrustworthyI'm designing an algorithm that creates optimum teams based on everyone's availabilities (maximizes the amount of shared availability). To this end, I've made a function that takes in a dictionary of availabilities mapping person to an array of their availabilities throughout the week at every 15...

 
11:26 PM
0
Q: Please check out my code incrementer

Ethan BelcherI recently developed code that can run as a function parameter but I'm not quite sure how vulnerable it is to hacks and/or cheats. Also, is there anything I could improve? Thanks const h1 = document.getElementById('hi') world = "world"; function testCode(codeEntered) { var code = codeEn...

 

« first day (2892 days earlier)      last day (1134 days later) »