« first day (2580 days earlier)      last day (43 days later) » 

12:00 AM
RELOAD! There are 6673 unanswered questions (89.9618% answered)
1 hour later…
1:04 AM
If the code is working and you are searching for recommendations to make this all more "elegant" then the question probably belongs to Code Review. Anyways, I've already a recommendation for you: Use an enum to specify the algorithm. Looks less messy. — akuzminykh 58 secs ago
Q: Fibonacci series, Good enough?

UnfreeHeX#include <stdio.h> #include <windows.h> #include <math.h> main(){ double x, y, xy; printf("Presenting to you the Fibonacci Numbers"); Sleep(2500); x = 0; y = 1; printf("\n%.0f", x); printf("\n%.0f", y); while (1){ xy = x + y; y = y + xy; x...

1:25 AM
Well, if you want to do more than 100K requests via UrlfetchApp in a day, you are better off with cloud functions and good old Node.js (or whatever lang you prefer to write your backend in that is supported). Maybe there is a way to optimize it? If so, you can post the question on code review for peers to check. — Oleg Valter 37 secs ago
2:00 AM
Q: Tinker to Get Next Two Tokens Rather Than One

JohnnyThis uses GPT-2 to find all completions of a sentence over a certain probability threshold. I am struggling, however, to figure out how I can make the output longer. It would be much appreciated if somebody could take a look at the code! def grow_branches(sentence_so_far, probs, input_probabilit...

2:24 AM
Q: Grade Calculation

ManuDevelop a smart application as Student Grade Calculator(SGC). Create a class Student with following private attribute : int id, String name, marks(integer array), float average and char grade. Include appropriate getters and setters methods and constructor. public void calculateAvg()- This met...

Q: Refactor RSpec test to remove duplicate code

MauricioRobayoI'm testing a custom each method that's called my_each, it is expected to behave exactly like the original each method. This is part of the tests that I have so far (simplified): require 'rspec' require_relative '../enumerables' describe 'enumerables' do let(:array) { [1, 2, 3, 4, 5] } let...

3:38 AM
Q: Rotating Matrix in Python with a For loop (90 degrees)

NoobCoderSo the image of a matrix can be transformed, for the rows and columns to this rule: The Values in the first row of the original matrix become the values of the last column of the image matrix. The Values in the second row of the original matrix become the values of the second last column of the ...

1 hour later…
5:00 AM
possible answer invalidation by greybeard on question by Neeraj Soni: codereview.stackexchange.com/posts/242930/revisions
1 hour later…
6:07 AM
Q: Is this program produces a topological sorting?

Serghey HmeliI am trying to implement topological sort. Idea is that I have vector of pairs in which first element is indegree and second linked list. I tried a bunch of tests, they seem to work, but I am not really sure about my implementation. Can you please review my code and give some advices? I've post...

I posted code here because I was not sure. It was claimed that it is off topic. I posted it on codereview and they claimed it as a duplicate and off topic. Maybe I just don't understand something about this community. — Serghey Hmeli 16 secs ago
6:32 AM
"Looking for a short answer because anyone can do it in 4 lines or more." – Okay, then you do it in 4 lines of more, and afterwards you can ask for improvements on Code Review. Stack Overflow is not a code-writing service, you need to demonstrate an effort. — Jörg W Mittag 53 secs ago
6:56 AM
Q: Why do I still NullPointerException after checking for null?

DmrengerI am thoroughly confused by the following: I want to manipulate some rows in Excel using apache poi. However, I seem to not understand how to check if a cell is empty. Here is my code: public static Magazine readMagazine(Row r) { Iterator<Cell> rowIterator = r.cellIterator(); while(rowIt...

7:20 AM
This question should be asked in codereview.stackexchange.comAmongalen 26 secs ago
7:36 AM
@CaptainObvious RBA
@pacmaninbw That happens more and more often.
@SᴀᴍOnᴇᴌᴀ Be prepared to be disappointed.
8:10 AM
Q: Is my concurrent tcp server correct?

NippleTwisterSo i've made a concurrent server that transferes files with socket programming by using fork(), and made a client to connect to a known localhost and ask for a txt. that is in a file. Then the server sends the file to the client that will be then saved locally. This is for a project at college an...

8:30 AM
9:05 AM
hi. I never really coded in C but I have learned how to. Lately, I had the need for speed ;-) and jumped back on the C train. I even used thread and the pcap library. It wasn't as hard I thought after all. My code runs fine. I am just looking for some code review. Not a thorough one. No need to dive in the deatils unless it's needed. I just would like somone take a quick glance of 5 to 15 minutes of my 1000 LLOC.
So I can't post on the site, right ? it's too long
it's there if anyone is wiling to do that: github.com/solsticedhiver/ssid-logger
Where can I ask that quick review ?
Well I don't know if quick review has any meaning
If your code works, this post belongs to codereview.stackexchange.comazro 17 secs ago
@solsTiCe @Duga is a bot, that is posting a comment found elsewhere. Press the "17 secs ago" to see what it's about.
😳 oh I was caught. That bot was misleading
@solsTiCe We have like a 60k character limit, however you code does look rather long. You can post parts of your program, for example if you think lruc.c and db.c are in a dire need for a code review then you can just post those. Your code has to be inline in the question as code blocks otherwise we can't review your code for legal reasons. Otherwise there should be no problems
9:19 AM
There's a separate Code Review Stack Exchange where this question might be better received. We tend to fix specific problems with code here, rather than do semi-ambiguous "I don't like my code" type of queries. — ADyson 23 secs ago
Seems off-topic on SO, might be better suited for codereview.stackexchange.comwOxxOm 52 secs ago
10:03 AM
@Mast Heh, that we agree on
10:15 AM
Q: javascript function to calculate second largest element in an array does not work

Dhruv Bansali am completing 10 days of javascript challenge on hackerrank and there i got this question to find the second largest element in an array and return it from the function written below. my code is giving the wrong output. When input array nums is 2 3 6 6 5 the output should be 5 but my output is ...

Q: Is there a way to speed up a nested for loop in Python?

Enrico MoscaI was just wondering if ther's a way to speed up the performances of this for loops in Python. I'm trying to process an image to get the color-moments without using libraries. It takes about 12sec to do the calculate_mean and calculate_standard_deviation functions for each part of the image. p...

10:25 AM
If you're learning, optimization is a good question to ask of course, ADyson's suggestion is a good one, you usually get pretty good advices on Code Review. I was just warning you against the fact that "looks" can be treacherous; lots of performance optimizations will make the code longer, not the contrary (for example creating a cache system to gain request time), so that one shouldn't always associate short code with better performance — Kaddath 38 secs ago
10:39 AM
Q: Faster way to check if number has factor of different primes than given list of primes

Gerile3im trying to get the factor prime number(s) for given number if its different than the primes that i have in a list. The number have to: dividable with any of the primes in the list should not have any other factor as primes other than in the list example: my_primes = [2, 3, 5] n = 14 shou...

Q: Writing a for loop to build a String using Streams

karvaiI have the following code which works. Been trying to write it in Java 8 streams to make it more readable but unable to get my head around it. Looking for any feedback to make it more readable. Thanks. // Expected output like: 1~CODE1|2~CODE2|3~CODE3|4~EX|5~CODE5 private String getFormattedValu...

11:02 AM
You're missing out on all the memory safety bugs, most segfaults, invalid casts, dangling pointer errors, leaks, ... a whole lot of undefined behavior is out of your reach :-) — Mat yesterday
11:16 AM
@CaptainObvious Terrible.
And hit HNQ unfortunately.
It's so awful an edit would be a major rewrite if done correctly.
@Mast It's not that bad, once you ignore all the "I did it without the googles!"
But it's not exactly great either
Q: Traversing through a generic binary tree

Spicy TigerAn abstract binary tree is to be created using a generic class. Each node has a string value as well as an initialCalculatedValue value. No changes should be made to the main class and a static inner class is to be included in the generic class. I'd like some advice on my code, as the main class ...

Q: TCP Client/Server is my use of Fork() correct?

NippleTwisterI made a concurrent tcp file transfer client/server in C socket programming using fork(). The programm is supposed to do this: The client should connect to the server and ask for a txt. that will be stored withn a file, the server will find and send the txt. file to the client that will be then s...

12:01 PM
@Peilonrayz Thanks for the clean-up.
12:14 PM
@CaptainObvious Why in the world would anyone put sleeps into the Fibonacci sequence?
Q: Architecture and error handling in simple java program

Pablo Aguirre de SouzaI'm trying to get my basic coding principles right but there's still a long way to go. This is an exercise for CodeGym. They logic itself isn't very hard and I passed the exercise easily but I'd like my code reviewed with the following in mind: In terms of the general architecture, I wasn't qui...

@Mast np ^^
12:55 PM
@pacmaninbw And use doubles.
1:12 PM
Ben Popper on May 27, 2020
We’re excited to share the results of our 10th annual developer survey! 65,000 developers shared their thoughts on the state of software today.
1:32 PM
Q: Wrote My own data structure. Mixture of a doubly linked list & unordered map C++

Ryan SwannI decided to make my own data structure. I did this because I wanted a data structure that is a queue but has o(1) time on lookup. template <class Object> class ObjectQueue; template <class Object> class ObjectQueueNode: private NonCopyable { friend class ObjectQueue<Object>; public: ...

1:53 PM
@Mast For integer values? That question is soooo wrong.
If you want a simpler solution, you can take your working code to Code Review. — Michael Litchard 36 secs ago
2:22 PM
Q: Localization of multi style text element in Vue

Nicke ManarinAfter following up this question, I'm thinking if there's a better/shorter way to write this text element that has part with different style, while permitting localizations: <p> <span class="has-text-grey">{{ $store.releaseList != null ? $store.releaseList.length : 0 }}</span> <span> ver...

2:32 PM
2:45 PM
3:02 PM
Interesting question, but sadly off-topic on this board. It would better fit to Code Review Stack ExchangenilsK 30 secs ago
3:43 PM
@Mast I'm getting more and more used to that...
4:31 PM
Can't change the character of others.
4:46 PM
Review&Feedback questions belong on Code Review, not Stack Overflow. — oguz ismail 30 secs ago
I’m voting to close this question because review/feedback questions belong on Code Review, not Stack Overflow. — oguz ismail 41 secs ago
5:14 PM
Q: Statistics function

catufI have created a database using Django. I have a small statistics page as shown below. Can I improve this code? def statistics(request): """Loads the statistics page.""" category_count = {} category_holotype_count = {} category_prefixes = [] total_holotype = 0 categories...

Q: Writing a c# class that has enum like constraint while behaving like string

LomithraniFollowing This post : https://stackoverflow.com/questions/630803/associating-enums-with-strings-in-c-sharp/56482413?noredirect=1#comment107635743_56482413 I wanted to go further as it didn't quite fully met my needs for a Enum like Class that would act as string I ended-up with a solution that ...

Q: Rust Iterator repeat_each

Solomon Uckorepeat_each transforms an iterator by repeating each value count times. It should be equivalent to .flat_map(|x| iter::repeat(x).take(count)). #![cfg_attr(feature = "override-try-fold", feature(try_trait))] #![cfg_attr(feature = "test-bench", feature(test))] use std::iter::{ExactSizeIterator, F...

Q: Max Contiguous Subarray: Divide and Conquer

BrayoniI am conversant with Kadane's Algorithm. This is just an exercise in understanding divide and conquer as a technique. Find the maximum sum over all subarrays of a given array of positive/negative integers. Here is what I have worked on but accumulating sum in solve_partition() looks pretty ...

Q: Feedback on my bash backup script

Ferre VekemansI have this little server at home, which is hosting some websites, school stuff and a minecraft server. I made this backup script and I would like some feedback since I'm not very good at scripting. Thanks very much #!/bin/bash # declare folders to backup dirs=( "/home/ferre/Minecraft" ...

5:50 PM
First manned SpaceX Crew Dragon is boarding. Launch 22:33 CET.
4:33 PM EDT
Europe not in summer yet?
CEST then.
@Peilonrayz We haven't had a winter yet.
Controls have changed a bit since the space shuttle.
6:11 PM
I'd love to see your improvements, additions, changes, comments, etc! that is more suited for Code ReviewScott Holtzman 22 secs ago
6:39 PM
Q: Making Select2 pillbox control more accessible compliant and want feedback (bring your screen reader)

nonoandyI am looking for feedback on screen reader improvements for the code/example below. The Select2 pillbox control needs to be more accessible. They have an open issues on this subject Select2 Issue Page and after I get more feedback will submit change suggestions to them (or submit a branch with ...

7:00 PM
This has some good answers should it really be closed? codereview.stackexchange.com/questions/242970/registration-code
good question
I see there are 2 VTC for AoC and 2 VTC for needs clarity...
Q: How to correctly remove an element in an array in react? and what can be improved in the code

Starbaxnow by clicking on a number it is deleted How to correctly remove an element in an array in react? and what can be improved in the code https://codesandbox.io/s/amazing-bas-cgbbv?file=/src/App.js import React, {useState} from 'react'; import './App.css'; function App() { let [arr,setArr] =...

Q: Using Cyclic Replacements to shift array

justanothertechdudeI was wondering if there is a better way to write this code that shifts an array to the right by k, in place with O(N) complexity and O(1) extra space. Note I dont want a different solution just to see if the method I am currently using can be written more efficiently, in particular I want to f...

@pacmaninbw The quality of the answers is not necessarily related to the quality of the question.
@pacmaninbw Wow, that's shockingly similar to this SO question
A poor question is harder to answer, but a question having good answers doesn't mean the question has any quality at all.
7:06 PM
and similar to this github code
but the OP didn't disclose where "the tutorial" is...
Or the goal of the code.
Wanting to know how 'secure' a piece of code is, tends to be a poor question by default.
They don't have a clue.
@Peilonrayz Opps, fat fingers. That does look amazingly similar.
Looks even closer to Sam's it's almost character for character
7:09 PM
I wouldn't be surprised if most of the code is 'borrowed'.
Coffin is nailed shut.
Did someone remove a comment?
@user13477176 Then I am sorry having to tell you that your question is off-topic here. SE Code Review requires that you are the author of that code. — πάντα ῥεῖ 38 mins ago
That's a reply to something that's not there.
Maybe they're taking the SO blog too seriously
It's also odd that question was asked at all after this question by the same user.
Glad to see stars again.
7:13 PM
Hey @Stargateur is there an straight foward way to transfer the question to codereview.stackexchange.com or I need to copy paste it? — Mateus Mercer 49 secs ago
7:30 PM
Q: Program which prints strings into files contained in structure

Dariusz MajcherczykProgram should read list of filenames, open these files and put their handles in the array of structure, then read strings and print consecutive lines of strings to smallest files by using handles contained in array of structures. My program does not put the actual string into the file but some g...

Q: Need someone to give me hints to make improvements (I am beginner)

IsmoussHey guys I am trying to improve my Python Programming skills, I tried to build a hangman code. I know it is not perfect but I works. I am looking for some hints or advice to improve this script. txt_file = open('dictionnary.txt','r') # Open the file with read option words = txt_file.rea...

@CaptainObvious Broked.
Sounds like you're asking for a code review. We have Code Review for that. — Fred Larson 15 secs ago
Please note you're going to need a better title on Code Review, one describing what your code actually does. — Mast 32 secs ago
7:55 PM
Q: How could I modularize this poker card game in rust?

Mateus MercerI'm learning rust by creating a simple card game program, with the usual stuff, ranks, suits etc. Currently I only implemented the card generation and a simple render function (not for future use). Looking at it, I can abstract some things, in terms of modules: I have a deck generator, it can ...

turns out that the cartesian product of "a lot" and "a lot" is "a lot".
8:17 PM
@DanPantry alot(sqrt(2))
Or alot*sqrt(2) if you prefer.
Q: AVL Tree implementation Based on VisualGo

MahdeenSkyI have tried implementing an AVL Tree on my own, based on visualising it. But i'm unsure how many testcases it work with, and how efficient it is. Are there any ways to make it efficient, and compact? class Node: def __init__(self, value, parent=None): """ Every Node has a va...

Q: VanityURL checker in Python

humidimport requests import json import time f = open('ok.txt', 'r') c = f.read() r = [] start = time.perf_counter() def steamCheck(name): return requests.get("https://api.steampowered.com/ISteamUser/ResolveVanityURL/v0001/?key=removed&vanityurl=%s" % (name)).json() for word in c.split(): ...

8:45 PM
possible answer invalidation by Stephen Rauch on question by humid: codereview.stackexchange.com/posts/243029/revisions
@Duga that's okay - OP added examples per request in comment, and SR applied proper formatting
Hi, would be good if you can provide example response of that api request to give us better idea of the code without having to get api key :-) — K.H. 24 mins ago
This would be a great question for the codereview community, if you can't narrow it down — Cireo 52 secs ago
@Victor I think once you finished your program, and you are allowed to share, you might have a lot to learn from having a Code Review. Do read their policy on questions and how to ask first, though :) — Icepickle 51 secs ago
9:38 PM
Q: Instantiating object in the facade constructor

fuatScrapping news articles from various web page is the main goal of this code. For the starting all spiders(web crawlers) at the same time, i try to implement the facade design pattern. It works but i feel the constructor of SpiderFacade class can be improved. Is there better way to do it or better...

Q: React/Redux/Node/Express crud application with a React class component

nadalhttps://try.gitea.io/nadal/repository Used this in a coding challenge after a job interview. I didn't get chosen, but I was wondering if it was because of the code quality in the project. import React, { Component } from 'react'; import * as ExpenseActions from '../actions/ExpenseActions'; impo...

Q: Union find using unordered map and templates in C++

rusiru thusharaI tried to implement union find (disjoint set data structure) algorithm in C++. There I used unordered_map data structure. Is there a better way of doing this using any other data structure. While finding the root I have used the following way. int root(int i){ if(i != parent[i]) parent...

Q: Made an Object pool in C++

Ryan SwannI'm making a Minecraft clone and have made an Object Pool. Looking for some advice on how I have implemented it. Uses m_availableObjects as a O(1) way of searching for the next available object. Thank you in advance. constexpr int INVALID_OBJECT_ID = -1; //Internal Use - Object Pool template

9:53 PM
Q: Efficient Algorithm for first N Pythagorean Triples

StackMatchI've been trying my hand at Project Euler problems and for problem number 9, I wrote a function in JavaScript which computes the first N Pythagorean triples while experimenting for the solution. I've posted my code below and wanted some feedback on whether this is an efficient implementation and ...

1 hour later…
11:21 PM
Q: Project setup script

NadpherIt's a pretty simple script really, i just want to know if there is a way to improve it. #!/bin/env sh set -o nounset set -o errexit if [[ "$#" -ne 3 ]] && [[ "$#" -ne 2 ]]; then echo "Usage: ./project.sh [NAME] [GENERATOR] [MAKEFILES]" exit 1 fi mkdir $HOME/Dev/$1 mkdir $HOME/Dev/$1...

11:46 PM
Q: VBA Code for Updating Various Work Bookmarks?

Nick-StackOverflowVBAI am relatively new to VBA and have watched a fair few tutorial videos/read a couple blogs to start getting my head around it. I've tried to write/edit my first code for work using example code from this page https://www.datawright.com.au/other/word_bookbark_vba_code_sample.htm and also a couple ...


« first day (2580 days earlier)      last day (43 days later) »