« first day (2879 days earlier)      last day (1124 days later) » 

12:00 AM
RELOAD! There are 7435 unanswered questions (89.5280% answered)
 
12:36 AM
Perhaps this is better suited for codereview.stackexchange.com — Russ J 11 secs ago
 
1:01 AM
0
Q: Just made a Rock Paper Scissors Game and Wanted Some Feedback

xJashunHere is the RPS game I made. I watched a 4 hour tutorial about c++ from freecodeacademy and produced this game right after it. If you have any feedback or suggestions please let me know. Or if there's anything I should be aware of or shouldn't be doing would be great. Thank you! #include <iostream>...

 
1:26 AM
0
Q: JavaScript algorithm: print out the path from directed graph under a given cost

JojiHere is a problem that can be modeled using a directed graph with different costs on each edge. Our input is an array of edges. const edges = [['A', 'B', 20], ['B', 'C', 10], ['A', 'C', 50], ['B', 'D', 5], ['D', 'C', 2]] ['A', 'B', 20], meaning that from A to B the cost is 20. I wanted to write ...

 
 
2 hours later…
3:07 AM
0
Q: LINQ OrderBy subclasses

GripsI ran into a situation where I have 2 subclasses inheriting from the same base class, I need to sort them together, but based on different criteria. I feel like there's a one-liner LINQ expression out there for this, but I couldn't figure out how to do it. The best I could come up with was 3 sepa...

 
 
1 hour later…
4:07 AM
I'm not familiar with Scala but its appears you're taking advantage of your classes inherently implementing the trait due to matching field names/types. You don't get that luxury in Rust, you have to define key() and value() each time. That said, lines-of-code is a notoriously terrible metric for determining anything. For one thing, the Scala succinctness has the unfortunate effect that HashMap.Put(1, None) is valid. Regardless, code review questions are best received on our sister site. — kmdreko 19 secs ago
Oh neat! Didn't know there was a code review site. Thanks for the link :) — captain-inquisitive 35 secs ago
 
 
1 hour later…
5:13 AM
0
Q: Leetcode: Remove Max Number of Edges to Keep Graph Fully Traversable Python 3 correct locally, wrong on platform

mLstudent33I am using Kruskal's algorithm to find the MST for Alice and Bob and using the Explore subroutine of DFS to check for cycles and to check connectivity. I pass 73 out of 84 test cases but 74 gives me incorrect output on the platform although my output is correct locally. I checked their "style" g...

0
Q: How do I avoid doing a search to compute a "normalized color"?

Archimedes TrajanoBefore I go on with how I tried to do this, some background. WCAG provides a method that computes luminance as part of the contrast ratio computation. What I am trying to do is given a color in RGB space convert it to HSL space and adjust the L value so that it will match the luminance of a anoth...

 
5:30 AM
I’m voting to close this question because it is more appropriate for codereview.stackexchange.comRuzihm 42 secs ago
You might be better off asking such questions on Code Review. — dan1st 35 secs ago
 
6:28 AM
0
Q: How can I maker my code more efficient for my jquery ajax menu?

blogobI'm building a "design system",I'm having trouble getting my menu to work properly. My site is in php and jquery, and I am using ajax to reload the content. Here is my html layout : <div id="containerWrapper"> <div class="flex-row"> <div id="menu" class="flex-col-xs-12 flex-col-md-2 g...

 
6:45 AM
I’m voting to close this question because this probably belongs on Code Review, another site in the Stack Exchange network. — AndrewL64 22 secs ago
@AndrewL64 "For licensing, moral, and procedural reasons, we cannot review code written by other programmers. We expect you, as the author, to understand why the code is written the way that it is." codereview.stackexchange.com/help/on-topicVLAZ 28 secs ago
 
 
2 hours later…
8:28 AM
for starters, don't use redundant variables like win = true; just pass true as parameter. But since this is a code review request, this should not be posted here — Stultuske 57 secs ago
I’m voting to close this question because it's a code review request: codereview.stackexchange.comStultuske 33 secs ago
 
0
Q: executable file

NostradamusI tried to write a program that checks if a file is executable, and if so, to check if it is binary or shell script. And my question is: is it the best implementation? Or I can write differently? #include <unistd.h> #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <string.h>...

 
If you have working code and you're looking for improvements, you should post your question on codereview.stackexchange.com instead. Just make sure to read the codereview guidelines. — Mike Scotty just now
 
9:00 AM
0
Q: Is there some way to simplify this loop

eirikdaudeI have a cycle which goes from -55 to -1, then from 1 to 55 before going back to -55 again. I want to make a loop going from an arbitrary point in this loop to another arbitrary point, but never as far as a full cycle. Since the end value of the counter might be either a larger or smaller than th...

 
9:25 AM
0
Q: Alarm clock subclass of a clock

LostHatI have these two classes and they should remain separate classes, but I have a feeling that this could be implemented more efficiently and with less duplicate code. After googling around I still didn't figure a better way, so perhaps someone here could point me out. Ideally I want to get tick() m...

0
Q: How does one handle activity stuff in custom classes in Android?

Roland DeschainThis is a question, I'm just not quite sure about: Every Android development tutorial you find, will put all of the code simply into the MainActivity class (or some other class, that inherits from an Activity class). But what if you want to put code into your own classes? How do you best access c...

0
Q: How to combine two different functions into one?

JennyPlugin: Air Datepicker http://t1m0n.name/air-datepicker/docs/ How to make two render calls using a single render function? onRenderCell: function(d, type) { if (type == 'day') { var disabled = false, formatted = getFormattedDate(d); disabled = d...

 
10:03 AM
When your code works, you might want to post it on our Code Review site and get feedback & tips to improve it from more experienced coders. — Mawg says reinstate Monica 36 secs ago
 
10:15 AM
0
Q: Simplifiy the following flow for upload file status tracking

BobbyI am using angular and rxjs, and I am doing the following : I would like to upload an image to GCP, so I need to generate a signed url, upload the image,and while showing status of all the request. Component => ask a Service A to upload a file. this.uploadProgress$ = this.uploadHelperService.u...

0
Q: angular ng-hide/ng-show: basics - binding not working (not done correctly)

qqtfI'm clearly making an obvious binding mistake that somehow I don't see. If I replace the ng-hide/ng-show with an *ngIf it works, yet dontShow : boolean = true; <body ng-app> <div ng-hide="dontShow"><h2>ng-hide</h2></div> <div ng-show="dontShow"><h2>ng-show</h2></div> </body> don't ...

 
10:41 AM
0
Q: "tuple with named fields" implementation

Fabio A.I'd like to show you a type I made while experimenting with literal, non-type template parameters in C++20. The idea is to provide a type that wraps up tuple-like types (std::tuple, std::pair, even std::variant) and provides access to its fields using a string literal. Also, it has to respect the...

 
11:06 AM
0
Q: Statistical problem in python

nadina 77THE PROBLEM: The coin is tossed four times. What is the probability of getting 2 heads and 2 tails? Determine the solution analytically and then by simulating a given problem, determine an estimate of the required probability for a large number of simulations. My idea was to make cointoss funct...

 
This is more suitable for code review. Code ReviewAdrian 25 secs ago
 
11:24 AM
So what is the problem with this code ? there is no? then try on codereview — Selvin 12 secs ago
Check this other stackexchange site: Code reviewCleptus 42 secs ago
 
11:38 AM
I suppose even at codereview this question would be closed, as it isn very unspecific on what kind of improvement OP is after. — HimBromBeere 10 secs ago
 
12:22 PM
0
Q: Should I create separate package to host web api as windows service in .net core 3.1?

A.LearnSome background : I have common Web API library which adds Serilogger and Splunk integration/implementation for ILogger along with handling of common services/Middlewares such as Custom Authentication/Authorization, Exception Handling, Request/Response logging(For auditing) and many other feature...

0
Q: Format String to particular format ##.###/##.###

DeviI have a requirement to format all my string to the format ##.###/##.### Example: If input value is 3/4 then i need to format it to 03.000/04.000 If my input value is 1.4/2.0 then i need to format it to 01.400/02.000 I have tried the below, which is giving the expected output. Can someone suggest...

 
12:34 PM
0
Q: Adding alternative answer comment to low quality posts queue

Billal BegueradjWhen review low quality posts queue, sometimes I stumble on answers which provide alternative solutions instead of reviewing the OP's code. It would be nice to add this entry (alternative solution) to this list:

 
 
1 hour later…
2:03 PM
I’m voting to close this question because it belongs on Code Reviewphuzi 22 secs ago
When asking a question on StackOverflow the hints on how to ask a good question states: "The community is here to help you with specific coding, algorithm, or language problems." This implies you have a problem that needs fixing. Whereas the hint on CodeReview states "Improve code that you wrote or maintain, through peer review." This seems to fit better the question you're asking. — phuzi 29 secs ago
 
2:28 PM
0
Q: Another attempt at dynamic array implementation in C

CheeseMan69I saw quite a few posts about making a dynamic array so I tried to make my own for learning purposes. Here it is: #ifndef VECTOR_H #define VECTOR_H #include <stdlib.h> #include <stdbool.h> #include <string.h> #ifndef VECTOR_RESERVE_SIZE #define VECTOR_RESERVE_SIZE 4 #endif //Declaration type...

 
2:39 PM
@phuzi: I usually treat CodeReview as working more with details of implementations. Questions like "this works, but seems wrong-headed; are there better options?" seem well-suited for SO, especially when the question show some actual effort as this one does. It does lose some points in my mind for not showing the requested output or having a runnable snippet, but on balance, I find this a decent question, and well fit for SO. — Scott Sauyet 43 secs ago
 
2:56 PM
You probably want to post that here. — JHBonarius 8 secs ago
If you want help improving working code, you should post this on CodeReview.SE. If you do decide to do so, please delete the question here. — NathanOliver 29 secs ago
 
3:18 PM
0
Q: Is it possible to make the following C++ code faster?

Jonathan1234I'm working on Rcpp and I wrote the following code #include <RcppArmadilloExtensions/sample.h> using namespace Rcpp; // [[Rcpp::export]] arma::mat SIZA(int K){ arma::mat P; P.ones(K,K); P = trimatu(P); for(int idx=1; idx<K; ++idx){ arma::mat W; arma::mat Hlp; W.ones(K-idx...

 
3:30 PM
0
Q: MathJax is really eager to be applied to posts

PeilonrayzWhen writing a MathJax heavy post I noticed a couple of bugs. For reference, here is an example of how the MathJax should look: $$ a_{i+1} = \begin{cases} \frac{a_i}{2} & \text{if $a_i \% 2 = 0$ (even)} \\ 3a_i + 1 & \text{if $a_i \% 2 = 1$ (odd)} \end{cases} $$ Begin and end work outs...

 
3:43 PM
It might be in scope for codereview.stackexchange.com but you'll have to check that yourself — James Z 22 secs ago
 
4:09 PM
@CaptainObvious Should the code from the answer be used to update the code in the OP? If so, does the OP need to do that?
 
4:34 PM
0
Q: What is happening in this Javascript Code

spraveenitproI have this below Javascript code that animates [expands/collapses] a group of DOM elements: function animateHeight(children, animationDuration, changeTop) { const height = children.clientHeight; const frameDuration = (1 / 60) * 1000; // 60 fps return new Promise((resolve, reject) => { ...

 
@CaptainObvious AoC
 
@phuzi It does appear to be on-topic on CR but please use a normal close reason - e.g. "Needs more focus" (like I did) instead of the fact that it is on-topic there as a reason. Please see Does being on-topic at another Stack Exchange site automatically make a question off-topic for Stack Overflow?, Migration of code questions from Stack Overflow to Code Review and this answer to A guide to Code Review for Stack Overflow usersSᴀᴍ Onᴇᴌᴀ 38 secs ago
 
4:59 PM
0
Q: First c program - convert .sav SPSS files into long or flat format csv's

E R BarrattI'm a long standing PHP, JS, C#(Unity) dev looking to get outside objects and lower down. I've written a quick program to read binary data from a .sav file, and output the data section into CSV's in either long or flat format, with optional leading row indexes. Wanted to learn more about C so I c...

 
Welcome to Stack Overflow. Since it seems you have working code and are looking for general improvements, this appears to more appropriate for CodeReview – be sure to check their question guide first, though. — MisterMiyagi 1 min ago
 
5:25 PM
0
Q: State machine in C for SDL game

matthewsI want to create a state machine for menu in my SDL game. So this is my code without the SDL I just want to ask if this is a good way to create it. I am trying to implement a screen and then mouse events but i have a problem there so this is a reason why i ask if this is okay. here is a code:` #i...

 
@CaptainObvious If you don't know, we're not going to review it.
 
5:43 PM
posted on March 22, 2021 by CommitStrip

 
0
Q: Pluralize a string

NullI find that a common pattern when outputting a message is the need to pluralize a word. For example, if I need to output a count of files found I would need to write something like std::cout << "Found " << count << " " << (count == 1 ? "file" : "files"); in order to use the correct singular or p...

 
5:59 PM
@SᴀᴍOnᴇᴌᴀ @Malachi I discovered yesterday that the mobile version of Brave does offer a quick way to enter TLDs - by holding down on the dot button it offers multiple common TLDs like .com, .edu, .net, etc.
at least that is how it is in iOS... I'm not sure about the Android apps
 
6:15 PM
0
Q: Read strings from a standard input, and find the most duplicated word

Natalo77 Write a program to read strings from standard input looking for duplicated words. The program should find places in the input where one word is followed immediately by itself. Keep track of the largest number of times a single repetition occurs and which word is repeated. Print the maximum numbe...

 
6:40 PM
0
Q: Leetcode 3 sum code optimisation

D_S_XI was working on 3sum problem on leetcode Question Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain duplicate triplets. Example: Given array num...

 
7:31 PM
0
Q: Linked list that support modifications during iteration

Ilya GazmanAs part of my Signals library, I needed to create a custom Linked List with the below properties It should allow "addition" and "removal" of items during iteration, aka when iterator() is called, like in the for loop. It should ignore-Addition of duplicated items. It should ignore-Removal of non...

 
7:47 PM
you should ask this question on codereview.stackexchange.com perhaps, beecause your question lack focus — Antonin GAVREL 34 secs ago
OP clearly states that the program is not working as intended; this disqualifies it from codereview. — sweenish 55 secs ago
Ok I didn't know that a program had to be fully functional to be posted on code review... — Antonin GAVREL 30 secs ago
 
8:16 PM
Chris G might have missed some ES6 structures here, clearly the code doesn't run in pure ES5 environment (const and arrow functions). Apart from that, the question itself might have a better home at codereview.stackexchange.com Make sure you've read their Help section carefully before asking. — Teemu 47 secs ago
 
0
Q: Three Sum Algorithm

Akash PatelI made a randomized algorithm to solve the three sum problem. There are two key parameters: number of solutions, and total. Notably, the algorithm might generate a duplicate solution. This is not checked since there is no guarantee that there is N unique solutions. The code is below. import ran...

 
8:46 PM
0
Q: Ncurses Snake Game using a Linked List in C

Andy Sukowski-BangThis is a lightweight text based version of the popular game Snake written entirely in C. In order to build it, ncurses needs to be installed on the system. Navigation is done using the vim-keys and you can quit with 'q'. The bones of the snake are stored in a linked list. This is one of my perso...

 
Because your program behaves as expected and doesn't return any errors, I would instead post it on the Code Review Stack Exchange. — Andy Sukowski-Bang 8 secs ago
 
9:37 PM
1
Q: Rsync helper in C (Improved)

yan_khit's the second time I'm posting this project here for review. So after I got a review from a nice guy I improved the program and worked on it for a few days and I would love to get reviews, feedback and tips so I could learn more and more from you guys. So here is the program: config_man.h #ifnd...

 
9:50 PM
@CaptainObvious 2 more VTC needed
 
10:18 PM
I didn't found any question mark. Are you looking for a code review? — Jeroen van Langen 38 secs ago
 
0
Q: multiply a square matrix with the diagonal and antidiagonal elements different from zero in vector

user14711505So i have a square matrix with the diagonal and antidiagonal elements different from zero in a vector vector<int> matrix = {1,2,3,4,5,6,7,8}; The matrix: 1 0 0 5 0 2 6 0 0 7 3 0 8 0 0 4 I try to multiply this with an other matrix xmatrix is the class for matrices I tried like this: void xmatrix...

 
 
1 hour later…
11:44 PM
0
Q: Using classes to create dynamic Tkinter widgets

ajgringo619I'm in the process of streamlining my code, which works but it completely unmanageable. My main window has a structure like this: window notebook1 frame1 label1 text1 label2 There are (3) notebooks, each with 3-5 frames. Because my current code has...

0
Q: Typescript - Organizing a lot of consts that need to be accessed throughout the codebase

rococoI need to have a bunch of hardcoded const objects, something like export const APPLE: Food = {name: "apple"}; export const BANANA: Food = {name: "banana"}; export const BROCCOLI: Food = {name: "broccoli"}; export const STEAK: Food = {name: "steak"}; I need to be able to access these consts fr...

 

« first day (2879 days earlier)      last day (1124 days later) »