« first day (2149 days earlier)      last day (1851 days later) » 

12:00 AM
RELOAD! There are 5925 unanswered questions (89.8867% answered)
 
12:36 AM
0
Q: Generating random number from a binomial distribution

nalzokIn my application of Monte Carlo simulation, the crucial part is to generate a random number from a binomial distribution with parameters n = size and p = 0.5. Here is my current implementation #include <stdio.h> #include <stdint.h> #include <x86intrin.h> int64_t rbinom(int64_t size) { if (...

 
 
2 hours later…
3:06 AM
@ShmuelLevine Code Review Stack Exchange may be a better place for this question. — L. F. 21 secs ago
 
 
1 hour later…
4:28 AM
First try out what you think is lengthy then share here if we can help to improve. Else there's another site called codereview.stackexchange.com you can post your length code there too to get it improved. — Black Mamba 49 secs ago
Your title doesn't match your content at all :O Can you properly as your question in the content part? Please use codereview.stackexchange.com is you want people to evaluate your code. — jdc91 1 min ago
 
 
2 hours later…
6:20 AM
0
Q: The number having odd divisors between 2 numbers

AkshayNevrekarI am trying to solve a problem from Hackerearth. I'm able to solve sample testcases but somehow when I am submitting the solution it gives time limit exceeded error(15 sec+) or wrong output message. Problem Little Dipu is a small kid and like all the other kids, he likes to play, but he plays w...

 
6:47 AM
This might be a question for Code Review. — Chris Happy 9 secs ago
 
6:58 AM
I shared the simplest one I found out. May be a kind of code review, but expecting other simplest code. — rockey91 36 secs ago
 
7:17 AM
0
Q: Python Check if Port is in use, otherwise increase it

spicyramenI have a distributed application, which runs a container of a WebApp, I use a default port to start WebApp, but before I start I need to check if port is in use. A container may run in the same box, hence port may be in use. (Max I have 4 containers in WebApp). I created the following code whic...

 
 
1 hour later…
8:21 AM
 
8:52 AM
-1
Q: Enum and a fill Array

EvalynI am very frustrated at this printArray method. The description is as follows: The fill array method is passed a Scanner object to a file and the total number of lines in the file. Each line is a record. The method builds an array of Month enumerated types. I have just this last part and i am don...

 
9:30 AM
-1
Q: An unexpected [0, 0, 0] trailing was appended to output

AliceI am dedicating to solve a 3Sum challenge in leetcode 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. Ex...

 
9:49 AM
-1
Q: Tightly Coupled Data in Linked List

napoleonMy co-worker has this implementation of a Linked List. The data object is the representation of a boat but the data object in the structure seems tightly coupled from my pov because data object should be separate from the linked list. What would be a better implementation of this? class Boatnode...

 
10:08 AM
-1
Q: Java: Tic Tac Toe using Minimax Algorithm

MaxI wrote the game Tic Tac Toe using Minimax algorithm. But the AI does not work all the times. For example, if I go with 0, 4, 8, it will not try to stop me. There are many more cases but that is one of them. Did I do something wrong with the algorithm? This is the Board class: public class Boar...

0
Q: Count the occurrence of each unique word in the file

andreiy05I've been doing a task for an interview that I will have soon. The requirement is to code the following problem in C#. Write a program (and prove that it works) that: Given a text file, count the occurrence of each unique word in the file. For example; a file containing the string “Go do th...

 
10:46 AM
0
Q: How I can handle the switch case smartly in Serial Port's DataReceived Method?

Prashant PimpaleI have below function which contains two switch case, which checking for Command Code and Response Code after that updating UI elements. The code is working fine. how I can reduce or make it better for those switch cases? private void port_DataReceived(object sender, SerialDataReceivedEventArgs...

 
 
1 hour later…
11:51 AM
the ideal platform for asking optimisation is Code reviewanky_91 51 secs ago
 
12:02 PM
0
Q: How I can present below graphical tree from Database and count their sub branches. For example: 2 has two (4 and 6) branches

Aliakbar+----------------+----------------+ | id | parent_id | +----------------+----------------+ | 1 | NULL| | 2 | 1 | | 3 | 1 | | 4 | 2 | | 5 | 3...

 
12:20 PM
0
Q: Using deftype to Create a Wrapper Class for Byte Arrays

Martin HarriganI want to create a wrapper class for byte arrays so that I can use them as keys in fastutil's Object2LongAVLTreeMap. I have created a wrapper like this: (deftype Bytes [^bytes ba] Comparable (compareTo [this other] (let [m (alength ^bytes (.ba this)) n (alength ^bytes (.ba ...

 
12:52 PM
Monking
 
 
1 hour later…
2:15 PM
0
Q: I finished personal project, I would like some help cleaning it up and making look nicer, and easier to work with

King_0_kingI just finished working on a personal project, it is a sort of email type program where you create an account and you can message people, the code works(as far as I’m aware) but it is not clean, different areas have different indents, i add more variable than I need, I print things that don’t nee...

0
Q: Toggle Function - Clean up code

HelloWorldHere is my current toggle function: $scope.toggleSelect = event => { $scope.selection = event.target.innerHTML; const emailListUpdate; if ($scope.selection === 'Select All') { emailListUpdate = $scope.users.filter(user => !user.report.emailed); } else { emailListUpdate = $scope.e...

0
Q: React tree view app utilising Hooks (i.e. useCallback)

CygiThe exercise was to build some sort of a tree view utilising newest React features (like Hooks). Main assumption: there can be only one 1st level item opened at time, rest of the levels may have multiple items opened at once. I'd like someone to review the code for performance (i.e. number of unn...

 
@CaptainObvious Remind me, what should we do with exact duplicates where the first question is closed but in the process of being reopened?
 
3:06 PM
This question is kind of subject to opinion. You might be better asking this on another Stack Exchange site, one dedicated to code reviews. — MickyD 50 secs ago
@MickyD This would not belong on CodeReview. — miradulo 27 secs ago
@miradulo did I mention “CodeReview”? No — MickyD 16 secs ago
@MickyD Lol oh, you meant the other Stack Exchange site dedicated to code reviews. Sure thing. — miradulo 29 secs ago
 
3:31 PM
0
Q: Java console application using OS's console

potatoI wrote a Java program that when it's executable .jar is opened manually, it re-opens itself inside the operating system's shell console. The purpose of this is to have a C#-style console application where the user can enter commands, without the user needing to manually open the shell console an...

 
3:45 PM
possible answer invalidation by esote on question by HelloWorld: codereview.stackexchange.com/posts/216054/revisions
 
-1
Q: A microservice routes to 3 microservices

HarisEach product has different application criteria and separate microservice. This project consist of the a single service ApplicationService that receives a single customer application for a specific service, then routes it to the respective product microservice. public class ApplicationServi...

0
Q: Efficient Prime Number Generator in c++

SpagI am trying to make an efficient prime number calculator. I've seen ones that can go up to close to 1 trillion in right around 4 hours, however I left mine on overnight and didn't get anywhere near that. I am asking this to see if anyone here knows a more efficient way for me to get up to a reall...

 
4:22 PM
To ask about improvement of already working code you should better ask at SE Code Review. — πάντα ῥεῖ 36 secs ago
 
Monking
 
5:01 PM
Have you run your code in a debugger and watched what it does? This is the best way to solve problems like this. Watch what your code does and look for where it makes a decision that doesn't fit with what you think it should do - This question should be posted on Code Review rather than here. This forum is meant for specific questions about programming, not "heres my code, tell me why it doesn't work". To get help here, can you ask a specific question about your code? — Steve 16 secs ago
@Steve this question has only recently been closed on CodeReview, because we don't review non-functioning code (lacking a formal spec, it's impossible to tell what would invalidate a solution; we don't have time to thoroughly test and review the code; if the code doesn't work, it might warrant a major refactoring which would invalidate any comments a reviewer might have made etc.) — VisualMelon 10 secs ago
@VisualMelon - good to know. I've just seen others suggest that questions like this go to CodeReview. I admit that I do see that as a bit of a cop out, since it's obvious that this question isn't sufficiently defined for any forum. — Steve 19 secs ago
@Steve aye, there are a lot of questions that get referred only to be closed again over on CodeReview. — VisualMelon 15 secs ago
 
@Mast I can't hammer as the other doesn't have an answer with an upvote :( Lets see if we can fix that!
 
5:44 PM
-1
Q: I am trying to print a string of values from an array with a , after each one. I pass accrueScore 15 10s and get 15 0s back

TypicalusernameI explained this in my program. Goal is to have all values int eh array print with a "," after. I've tried to create a new array to store the values but that didnt work. I tried to make a for loop to add the , but that didn't work. no matter what i do i get 0s back //** This is supposed t...

 
I'm voting to close this question as off-topic because it is asking to improve working code. ask on Code ReviewDaniel A. White 10 secs ago
 
6:03 PM
0
Q: Register-Login script

Maria LauraThis is a register-login script I have made in Python 3. It uses MySQL as a database and in the future I might implement it to my Blackjack game and add a row called money, but for now I would like to "hear" your opinion about this script hence I have little to none experience in SQL. import cym...

 
6:32 PM
@Peilonrayz The dupe is RBA, so, there's that.
 
@Mast RBA
?
Oh deleted
 
0
Q: Reverse int within the 32-bit signed integer range: [−2^31, 2^31 − 1]

gregProblem Reverse digits of a 32-bit signed integer. When the reversed integer overflows return 0. Feedback Looking for any ways I can optimize this with modern c++ features overall. I hope my use of const correctness, exception handling, and assertions is implemented well here, please let me kn...

 
@Peilonrayz Removed by author
 
7:00 PM
0
Q: Stack as a Persistent Data Structure Implementation

RomanAfter reading some articles about immutability, I found out that there are persistent data structures. In the following, I implemented a stack as a persistent data structure. What I like about the code in the current state is, that it contains no if-statements, no method is longer than one line ...

 
7:12 PM
@Peilonrayz Why do you import like this?
import random
from random import *
Either would suffice, no? You don't need both.
 
@Mast copied from the OPs code
@Mast Thanks for the edit :) I always ctrl-a tab ctrl-c when I copy code, very strange that I messed that up :(
Also they didn't AI, if you read the comment I requested they revert it. As I'd posted my answer after the change.
 
7:28 PM
@Peilonrayz Yes and no.
His edit did invalidate, even though it was posted after the answer.
 
My AI ruling must be out of date :(
 
That part of the ruling is a bit of a grey area.
But I'll defend it if need be.
 
I can definitely see the grey. I'm happy either way. I think going to meta or anything would mean the user has an even worse experience of CR. And so I'll delete my comment :)
 
If I remember correctly, the rule is you're shit out of luck if somebody was writing an answer while you were editing your question. Answers take priority over question edits.
But as usual, I can find such questions on meta all the time except when I need it.
 
0
Q: Writing GOlang object code that respects Go guidelines

PoutrathorLearning GO and I wrote this for a programming challenge. It is working (building and running) but I feel the code is not what GO code should be : am I using the struct element correctly ? especially struct methods ? in the playTurn() method, I reassign results (else not taken into account) be...

 
8:25 PM
0
Q: How do I properly write a question that involves third-party libraries?

User319I am preparing to submit a small OpenGL program for review. I've... canabalized a couple files from this GitHub repo to handle some image stuff I don't want to deal with. To be clear, I've used the files directly in my project without modification, and (AFAIK) without violating the licence. So ...

 
8:53 PM
0
Q: Replace tabs in input and variable vs symbolic parameter

promise TochiI am learning C and this is an exercise from The C Programmnig Languange by Brian and Ritchie. Write a program detab that replaces tabs in the input with the proper number of blanks to space to the next tab stop. Assume a fixed set of tab stops, say every n columns. Should n be a variable or a s...

 
9:10 PM
This question belongs on another site in the Stack Exchange network (code review) — Benyamin Jafari 55 secs ago
 
9:50 PM
0
Q: c++ sequence calculator x_{n+1} = f (x_n)

nessI am super out of practice with writing programs and even the stuff I kindof remember is wholly out-dated. I'm trying to write a simple program that asks what your x_1 is and reports x_1 to x_100 given some series function. like a sequence calculator where x_{n+1} = f (x_n). An example of my co...

0
Q: TDD test class for ViewModel class, architecture, what do you think?

bakunetCurrently I am writing my first TDD application. The project is in Xamarin.Forms and tested in xUnit. I am wondering, that maybe more experienced developers will have any comments or suggestions regarding the code or architecture, before I will continue with next View Models, to avoid correction...

 
10:28 PM
0
Q: Generic Singly-Linked List implementation

THExLONExCUBANI'm looking for some feedback regarding my implementation of a generic singly-linked list in C#. I'm also looking for some tips on how to implement other techniques such as using IEnumerable or other .NET interfaces I'm currently not aware of. Node.cs using System; namespace SinglyLinkedList...

 
10:40 PM
possible answer invalidation by Dan on question by Dan: codereview.stackexchange.com/posts/215946/revisions
 
11:06 PM
0
Q: C clone of hackertyper.net

Tornado547This is a simple c clone of the website hackertyper.net. The code can be found at github.com/Hurricane996/hackertyper. Here is a local copy Makefile PREFIX=/usr/local BINDIR=$(PREFIX)/bin DATAROOTDIR=$(PREFIX)/share DATADIR=$(DATAROOTDIR) MAN1DIR=$(DATAROOTDIR)/man/man1 CFLAGS=-Wall -pedantic ...

 

« first day (2149 days earlier)      last day (1851 days later) »