« first day (2090 days earlier)      last day (1917 days later) » 

12:00 AM
RELOAD! There are 5850 unanswered questions (89.8305% answered)
 
12:53 AM
0
Q: Go API server - request handlers becoming excessively long

hazI'm developing a API server in Go. My route handlers are becoming excessively long, especially when the response needs a lot of information. For the following response type: // StateResponse is queried by the client to get the entire initial // database state. type StateResponse struct { St...

 
@pee2pee I was just about to write up an excellent Code Review, but my surprise, will I was typing, it was deleted by moderation! It looked like a good questiont ome and wasn't closed so I don't know what happened. Are you able to re-post your question so that my time isn't wasted? — mickmackusa 7 secs ago
 
1:12 AM
Hi Patrick, welcome to Stack Overflow. I think it would be best if you took the time to come up with a Minimal, Complete, and Verifiable example and posted that instead of all of your code. In your case, if you find that creating a MCVE is too difficult or not possible, your question might be better suited to a website dedicated to full code review. — taylorthurlow 26 secs ago
 
 
2 hours later…
3:45 AM
0
Q: An AI for a friend

GenesisThis is a programming challenge I set for myself a while back to create an AI that starts with no knowledge of anything whatsoever, and learns as you talk to it. (It can learn stuff like your name, how to say hello, goodbye, etc.) I tried to use the least amount of hard-coded responses as possib...

0
Q: Insertion Sort and Selection Sort Implementation

codewriterI wanted to practice using templates since I have no experience with them, so I implemented these sorting algorithms. Selection Sort: template<typename Container> void selectionSort(Container& numbers) { for (auto iter = std::begin(numbers), iterEnd = std::end(numbers); iter != iterEnd; ++...

 
4:18 AM
0
Q: Finding all prime numbers within a range

The NightmanI am trying to find all primes less than 2,000,000 and sum them together. My code currently takes 1'36" to run. Is there a faster way to get my solution? The logic I am following in this code is make a list of all primes I have found. Then check that every odd number less than 2,000,000 is not d...

 
5:05 AM
0
Q: Join (custom) query in Spring Data JPA

user5846031I'm trying to make a REST service using Spring Boot and Spring Data. I have written a query using join and have achieved the required o/p but I'm curious to know if that is a right way of doing it or I can do it with a better approach. Here is the query using @Query annotation. @Query("select b....

0
Q: Linked List written in C

FarazI have been learning data structures and dynamic memory allocation in C. As a learning experience, I have written this linked list implementation. I really appreciate the feedback I've received on the previous code I've posted here and would love to hear any suggestions you all have on improvemen...

 
Monking
 
5:36 AM
0
Q: A Day at the Races. Racetrack Betting App

bruglescoI recently began learning C# and I picked up Head First C# as a starting point. One of the first projects they have you build, without the code provided, is a racetrack betting app. The project first gives you the requirements, as well as some suggested implementations. I did not follow the sugge...

 
5:51 AM
0
Q: Linear Regression on Pandas

BurgerBurglarI'm working on a simple statistics problem with Pandas and sklearn. I'm aware that my code is ugly, but how can I improve it? import numpy as np import pandas as pd import matplotlib.pyplot as plt from datetime import datetime from sklearn.metrics import mean_squared_error from sklearn.linear_mo...

 
6:09 AM
Monking
 
 
7:27 AM
0
Q: Is there any way to make the execution faster in the below Java code?

VirusMy Java code is as below. boolean almostIncreasingSequence(int[] sequence) { Integer[] arr = new Integer[sequence.length]; for(int ctr = 0; ctr < sequence.length; ctr++) { arr[ctr] = Integer.valueOf(sequence[ctr]); // returns Integer value } System.out.println("Integer ...

 
I'm voting to close this question as off-topic because it does not state a problem. For code reviews try codereview.stackexchange.comRichard 47 secs ago
 
7:54 AM
Its and interesting concept, however, i think this is better for codereview.stackexchange.comTheGeneral 38 secs ago
 
8:30 AM
0
Q: Upsert with .Net Core Web API

MarcosF8I am using .NET Core 2.2, EF Core and C#. I have created a web API project. I was requested to do an Upsert (insert or update). The entities structure is: - Movie - User - Rating: this is used to give a rating to a movie, so a new rating will have the MovieId (from Movie) the UserId (from User) ...

 
8:50 AM
I'm voting to close this question as off-topic because it should be posted on codereview.stackexchange.comScriptable 53 secs ago
 
9:14 AM
@Scriptable Please do not vote to close with a custom reason that "it belongs on Code Review". Nothing in the Stack Overflow rules justifies such a custom reason, and sloppy reasoning perpetuates inappropriate referrals. Not all questions about analyzing code are off-topic on Stack Overflow, and not all code review requests are on-topic on Code Review. Instead, vote to close as too broad or primarily opinion-based. Also, the question in its current form is off-topic on Code Review too. See codereview.meta.stackexchange.com/q/5777 for more information. — Zeta 57 secs ago
 
0
Q: I want the code explanation of this arraylist and linkedlist

JA MIt is a comparison program of arraylist and linkedlist, but I want a detailed explanation of this. What are you doing? I want an explanation of what each line is doing. import java.util.ArrayList; import java.util.LinkedList; public class ArraylistAndLinklist { public static void main(String ...

0
Q: Linq for ObservableCollection

Peter TaylorPurpose ObservableCollection<T> is not strictly a WPF class, but its intended purpose seems to be for use in WPF. It's the standard implementation of INotifyCollectionChanged, an interface which is special-cased by some WPF widgets to provide efficient UI updates and to maintain state effectivel...

 
9:32 AM
Hi Zeta, thanks for the feedback. It was a suggestion, the title suggests the person is looking for a code review, which would point me towards codereview stackexchange, I mean.... its in the name?. I would expect the user to check once there if their question is on topic or not or whether it can be reworded or edit to do so. I personally dont think this question is a good fit here and I would expect the user to improve the question and post on code review. if not, whats the point in code review site? surely SO isn't the dumping ground/triage part of the exchange — Scriptable 13 secs ago
 
0
Q: store csv data coming from an api in to file to later put in a database

Daniel JohansonWhat is the best way to store this data coming from the api into a csv file to later put into the db. Output: rank, level, xp, rank, level, xp, etc. This api produces about 60 rows of data per name ran and x that by about roughly 300 names that equals a lot of data. Pretty much with my current co...

 
9:45 AM
@Scriptable Don't get me wrong: it's off-topic on SO, sure. However, the existence of another site isn't a valid reason to close it. We get a lot of users on Code Review that migrate from SO, just to get their questions closed and downvotes because they only got pointed to CR but not to the rules. Yes, Code Review is for Code Review, but it isn't the dumping site for code either. For more information, see the link I already provided above. — Zeta 15 secs ago
I'm voting to close this question as off-topic because this should be on: codereview.stackexchange.comStultuske 49 secs ago
the code works but it feels like it is a bit too much. Code review requests are off-topic here. Look at CRhindmost 52 secs ago
 
 
1 hour later…
11:26 AM
0
Q: CMake modifying cmakelists to be cross platform

TheLinuxProhello i would like to make this CMakeLists.txt cross platform ideally i can just give this cmakelists.txt to a windows user and have it work out of the box without any modifications is this possible cmake_minimum_required(VERSION 3.0) project(sandbox) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) set(TH...

0
Q: Filtering code using LINQ

ArvindrajaIn this code I have declared myPushData, myPushDataFilterd and myPushDataFilterd2 variables which are using in code. I am thinking this code could be more easy & short var myPushData = new List<pushTokens>(); var myPushDataFilterd = new List<pushTokens>(); var myPushDataFilterd2 = new List<push...

 
12:06 PM
0
Q: Community Promotion Ads — 2019

JNat2019 is here! And with the new year, as usual, comes a new iteration of Community Promotion Ads! Let’s refresh these for the coming year :) What are Community Promotion Ads? Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The...

3
 
12:53 PM
codereview.stackexchange.com would be more appropriate. — mjwills 58 secs ago
 
0
Q: Numbered lines list

GemtasticI tried my hand at making a numbered line list. I would like some feedback on my use of CSS and if this approach (using a numbered list) is considered a good solution. body { background: black; } .terminal { background-color: black; padding: 0em; width: 70em; color: #99ffcc; } ...

 
1:17 PM
1
Q: Writing PDF files in C#

George BarwoodI have been making C# software to write PDF files. It's intended to be simple to use, compact, efficient and also reasonably simple to understand, maintain and extend as required. The basic functionality supports multi-column layout with word-wrapping and justification, and the standard fonts...

 
1:38 PM
This kind of questions belongs to code reviewc0der 8 secs ago
 
1:49 PM
0
Q: output of function doesn't store correctly

user191087I have a function solving a differential equation system. I want to plot one of the result variables (theta_i) after the system is solved. This variable comes from the equation: np.arctan2(g1,g2) so its values suppose to be between -pi and pi. If I print theta_i right after its calculation (in...

 
2:05 PM
0
Q: KMP algorithm in scala

vikrantI implemented KMP pattern matching algorithm in Scala. My code works but it looks more imperative and a scala translation of C/C++ implementation. I am not able to figure out how to manage multiple indexes and then update them conditionally. Following is the code with some explanation, kindly su...

 
2:53 PM
0
Q: Toggling Strict mode in JS

FreezePhoenixI made this code because, I figured that it might be an interesting concept, and that it would be nice to see it work. It enables the toggling of strict mode in any string of code. It even allows you to set a scope to run it through, although it does use eval. Example: toggleableStrict("var a...

 
possible answer invalidation by Arvindraja on question by Arvindraja: codereview.stackexchange.com/posts/212058/revisions
 
Does anybody else have any insights about this jQuery slideshow code?
 
3:12 PM
Khalid El Khatib on January 23, 2019

What languages do you want to work with next year? Are you more productive in an office or working from home? When did you write your first line of code? We want to hear from you in our annual developer survey! The survey, now in its ninth year, launches today and anyone who codes is encouraged to participate.

Take the 2019 survey!

This year’s survey questions are designed to gain insight into developer career paths, programming languages and tools, working preferences, and overall opinions and feedback. There are some fun questions, too (like previous years’ tabs vs. spaces and gif vs. “jiff”)! …

 
I voted to close because it is primarily opinion based question. It is more fitted in "code review" site. — Ziv Weissman 16 secs ago
 
0
Q: python code to copy the Files locally with rsync and subprocess

krock1516I have python code to copy the Files locally on the Server from one Directory to another using rsync and subprocess module, this is just in continuation of the post from this post where I tried to get various insight but opted to use below code finally. Please advise if this further can be impro...

 
3:52 PM
I think your question falls on the off-topic: Primarily based opinions and a better place to ask your question is: codereview.stackexchange.comeyllanesc 57 secs ago
 
0
Q: Is there a better way to write this code

studentCan someone please tell me if there is a better way to write the below code. This is a code for an android thread. This thread gets data from socket, maps it to an object and sends that object back to the main service. I would like comments from experienced java programmers regarding this code. I...

0
Q: C++ Factory pattern with `std::unique_ptr`

schorsch312I like to refactor my code base, especially the raw pointer implementation of a factory. I found a lot of implementations of the factory pattern. Some of them still use raw or the deprecated auto_ptr. The implementation here is imho too complicated. Are there any drawbacks in this implementat...

 
4:12 PM
0
Q: NHL Stats web app

Flynn84There is a web app. My first attempt to use NHL API have been reviewed here. I'm interested in any kind of refactoring of this code. But I have some questions that I want to point at specifically. First of all, is this a right approach to have all this dirty work for a 'views' in a 'services.py'...

0
Q: qt how much of the application logic should be in the widget

XapaJIaMnuI'm just starting with QT and I'm a bit confused as to what would consist of a good SE practise. I have a simple widget which is structured like this: int main(int argc, char *argv[]) { QApplication a(argc, argv); QCommandLineParser parser; parseCommandLine(parser); workerClass1 ...

 
@StephenRauch doesn't this suggested edit alter the code??
or is that just correcting improper exponents?
@SᴀᴍOnᴇᴌᴀ oh nm I see it mentioned in the explanation
 
4:43 PM
For reviewing code I suggest: codereview.stackexchange.comLukasz Szozda 26 secs ago
 
4:57 PM
@SᴀᴍOnᴇᴌᴀ So we good here?
 
yeah- thanks!
 
5:16 PM
0
Q: Using findInterval to assign vector elements to corresponding brackets

KonradThe following function receives a vector of positive integers and list of brackets. The function returns a data frame with a logical vector for each bracket indicating whether a given element of a vector falls within that bracket. Background Received arguments Vector x consisting of positive ...

 
Monking
 
5:39 PM
If your solution works, and you're just looking for general tips and suggestions for doing it better, then this question would be a better fit for codereview.stackexchange.comp.s.w.g 35 secs ago
 
0
Q: Portrait Painting Genetic Algorithm

jreeseInspired by this article. I've been trying to learn more C# and OOP. Here is my take on a genetic algorithm as described in the article. Here are some of the results: flower, jelly, and lighthouse It takes a picture, and generates 10 images composed of 32 random rectangles. It scores the 10 ima...

0
Q: Binary search performance

Radim BačaI'm putting together an example for students where I would like to show how we can optimize even such basic algorithm like a binary search with respect to hardware. I do not consider threads. I wrote it in C++ and the whole example can be found here. I'm trying to show some examples of the prefet...

 
6:03 PM
@CaptainObvious Too bad there isn't a community member with the name TheWindowsPro... if there was, maybe that issue would be resolved...
 
0
Q: Using IQueryable.GroupBy to count related database entities

SinjaiGiven a DbSet<Client> from an Entity Framework DbContext, I need to count the number of related Tickets of each type: Open, Responded, and Resolved. The below code works, and results in only one query (according to DbContext.Database.Log), as desired. However, the fact that the call to GroupBy...

0
Q: ncurses, how to flush input buffer and a window placment issue

moophttps://github.com/flyingfishfuse/captive-portal-cpp-terminal/blob/master/curses_interface.cpp So I've got this program I'm writing partially to teach myself and partially to teach others and get a job and I've wanted to do ncurses stuff so I figured this would be a good point to learn and also ...

 
6:36 PM
0
Q: Django: Render formset errors

Joey CoderI use the following code to render non_form_errors and non_field_errors. It feels that this is repetitive and I wonder if you have any best-practices to write it better? {% if social_ticketing_coin_allocation_formset.total_error_count %} {# General Non-Form Errors #} {% if s...

 
@200_success You have well over 10,000 rep points. Can you visit codereview.stackexchange.com/questions/208118/… and tell me who deleted the page and why? I was in the middle of writing up my answer and it was suddenly deleted without even being closed -- very frustrating. — mickmackusa 17 hours ago
@mickmackusa In the future, please use chat or Code Review Meta instead of posting a comment on an unrelated post. The question was automatically deleted because it was more than 30 days old, had a -1 score, had no answers, and was not locked.
I'm guessing that somebody downvoted it because it was a "simplified example".
 
6:51 PM
@Feeds should we just put Jamal's ladybug on there?
 
0
Q: clarity of logic to select second option in text table with shell script

simbo1905I am writing a bash script to mount openshift service accounts into kubernetes objects. To find the right secret to use I need to select is highlighted with <- THIS! in the text: $ oc describe sa sa-build-webhook-realworld Name: sa-build-webhook-realworld Namespace: you...

 
posts on Stackoverflow should be about a specific error, a bug in the code, etc. Your post is suited for "code review" - I suggest you post there. This is opinion based because, for example, I hate watchers, and I try never to use them while others will prefer them. I will prefer service than using the objects as a reference in directive but others will prefer directive :) — Ziv Weissman 11 secs ago
Probably a better question for either Code Review or Software Engineering SE sites. — UnhandledExcepSean 8 secs ago
 
 
1 hour later…
7:56 PM
0
Q: try catch block - code style

IrbisI have the following member function: std::vector<Log> SomeClass::GetLogs(const std::vector<std::string>& ids) { std::vector<Log> logs; for(const auto& id: ids) { Log log; try { //I have to use GetLog function in the following form //...

 
8:12 PM
0
Q: greedy and non-greedy regular expression in python

maplemapleI'm confused about the following results about greedy and non-greedy regular expression in python: The first case: import re x = 'From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008' y = re.findall('\S+@\S+', x) print(y) result is : ['stephen.marquard@uct.ac.za'] However in second cas...

 
8:32 PM
 
8:43 PM
0
Q: javascript - consolidate multiple null/undefined checks

dmikester1My brain is fried from looking from looking at this for so long. Is there a more efficient way to do this code block. We have the ability to use es6 code too if that helps. quantity = 1; if (!itemData.isDynamicRecommendation) { if (itemTemplateQty == null || itemTemplateQty.value == null...

 
Goes from "5MB to over 300MB"? You should post your code on CodeReview. — TinMan 27 secs ago
 
The fact that things like the npm left-pad incident are so rare is oddly reassuring.
4
 
9:05 PM
possible answer invalidation by Radim Bača on question by Radim Bača: codereview.stackexchange.com/posts/212088/revisions
 
9:15 PM
0
Q: Automatic RAII wrapper for concurrent access

gudvinrProbably many people had to work with multithreaded applications with C++ and can understand how messy can be fine-grained locking of objects. So once in a while I came to idea of implementing some proxy objects using a so-called "drill down" property of operator-> and RAII in mind. Yes. There ...

 
9:31 PM
0
Q: Loop through rows and columns in range and apply formula

AdmirEI am needing to apply a countifs formula on each cell in range that includes rows and columns. I am able to make it work if it is for a specific range or rows within one column but not sure about how to apply the same to multiple columns. My current code is below. Sub CountIfsFormula2() Dim l...

 
@Duga That's ok, this time. Left a warning.
 
possible answer invalidation by dmikester1 on question by dmikester1: codereview.stackexchange.com/posts/212099/revisions
 
10:07 PM
@Duga OP added clarification, at the request of commenters
163
A: Does YouTube delete video dislikes?

PoloHoleSetYes, they do. They will also delete likes, as well. However, the comments quoted and the general complaints on that video about dislikes going away are based on the claim that Gillette is either paying YouTube to delete dislikes, or that Gillette is doing it, itself. One reason why YouTube dele...

 
10:28 PM
Are you having an actual problem? If not, this might be better for codereview.stackexchange.comSean Bright 10 secs ago
 
 
1 hour later…
11:57 PM
@SᴀᴍOnᴇᴌᴀ The OP came back to award the bounty ヽ(´▽`)/ I was worried that wouldn't happen before the end of the grace period...
 

« first day (2090 days earlier)      last day (1917 days later) »