« first day (1587 days earlier)      last day (2415 days later) » 

12:00 AM
RELOAD! There are 4324 unanswered questions (90.8267% answered)
Code review requests generally belong on the code review stack exchange. — Dave Newton 59 secs ago
 
12:26 AM
0
Q: Java Pong implementation

MiroslavI was making a pong game when I realized (by looking at other people's examples) that my Pong code was very messy and not organized. I would like to ask for assistance. import java.awt.*; import java.awt.Component; import java.awt.event.*; import javax.swing.*; import javax.swing.Timer; public ...

0
Q: Ternary Operator Inquiry

FDinisCan someone help me decipher these ternary condition? Thanks in advance!! int x = getXcor(); int y = getYcord(); for(int i = 0; i < speed; i++) { getXCastleCoord() > getXcor() && getXcor() < dimX ? x++ : x; getYCastleCoord() < getXcor() && getXcor() > 0 ? x-- : x; getXCastleCoo...

 
1:08 AM
@D.Hunter I'm sorry, but this question is way too broad. Simplest solution would be to use a switch-statement and call the appropriate getter based on the String entered by the user. As an alternative, you could use maps to store the values, use Suppliers mapped to the appropriate names. A look at this console-menu should also help you quite a bit. — Paul 22 secs ago
 
1:27 AM
2
Q: JavaScript clicker game

vnbrsI'm studying JavaScript and jQuery and I did an implementation of a simple cat clicker game: class Cat { constructor(name, picture) { let self = this; self.name = name; self.picture = picture; self.count = 0; let mainDiv = $('#cats'); let catDiv = $('<div></div>')...

 
2:09 AM
0
Q: Modern OpenGL wrapper abstractions (shaders)

Dan GrownerI am experienced with other languages, but not so much with the latest C++ standards. I was wondering if anyone had any tips on how to improve my code or any critique on my implementation. This is not designed to be used as an external or public library and I hope my use of the initializer lists ...

 
2:41 AM
0
Q: AsyncObjectPool<T>

Jason LarkeI've recently needed a class to help me manage a pool of re-usable objects. It's my first time delving into the async/await side of C# and I wanted to create an async-friendly interface to allow me to elegantly handle situations where no pool item is currently available. I've come up with the bel...

 
3:01 AM
0
Q: Precision problem for square root

googDuplexI wrote a binary search square root function to find the square root of a number precise to 5 decimals. It seems to work for most cases but for the test input 99, I get 9.949869999999999 returned. This seems like a precision problem with double. Is there any other way I can get a precise number r...

 
3:50 AM
You might find this question more suited for CodeReviewRobbie Averill 29 secs ago
As noted, this would be better for code review, but I would start with making a function or class/method to contain the dup code. — Rasclatt just now
 
4:06 AM
0
Q: Number to text conversion (Check writing application)

JSextonnHow It Works: Inspired by r/dailyprogrammer, the application uses regular expressions to group 1-3 digits at a time from right to left, each captured group is then converted to text. Program Class using System; using System.Text.RegularExpressions; namespace CheckWriter { internal class P...

 
4:22 AM
Monking
 
4:59 AM
If the code works, Code Review is better. — Andy Turner 19 secs ago
 
5:30 AM
Today somebody called me at 6:00 AM and said Happy Birthday. I thought he's on drugs until I realised he's right. Happy quarter-century to me, I guess ¯\_(ツ)_/¯
 
5:49 AM
@MrGrj Happy Birthday !
 
6:30 AM
0
Q: Iterate the structure in ansible

Mintu ChoudharyLOAD_PLUGINS: - PLUGIN1: - name: balance_impl version: 1.0 - PLUGIN2: - name: billing_impl version: 1.0 - PLUGIN3: - name: sales_impl version: 1.0 - name: Read the plugins debug: msg={{item}} with_items: - "{{ LOAD_PLUGINS }}" I tried writing above task t...

 
7:20 AM
0
Q: All permutations of a sum

iCodeYouCodeWeAllCodeI'm attempting to implement an algorithm that finds all subsets that sum to a number n. Here is my attempt so far: function combos(n, combo, result){ combo = combo || []; result = result || []; if(sum(combo) === n) { result.push(combo); return; } if(sum(combo) > n) { ret...

0
Q: Slider with and without notification

MisiIn my project the value slider must be sometimes set. Then no notification may be generated because otherwise the new value will written in database again. I have this solved in follow way. Is there a better solution? package application; import javafx.application.Application; import javafx.bea...

 
7:41 AM
Make insert return the root node and have it accept a simple *BNode. BTW: There is a special codereview.stackexchange.com for this type of "Please review my code." — Volker 40 secs ago
 
8:07 AM
0
Q: Java inheritance and generics

regisikToday i had discussion with my colleague about casting. Our case: We have root class abstract class RootFoo<R extends RooFoo> { ... abstract R getThis(); } and we implement method getThis in subclasses. My solution looks like this: abstract class RootFoo<R extends RooFoo> { ... ...

 
8:17 AM
Monking.
 
I'm voting to close this question as off-topic because it is asking for code improvements of already working code. It would belong on codereview.stackexchange.com but also needs an MCVEoli_obk - ker 23 secs ago
I'm voting to close this question as off-topic because is asks to improve already working code. Such questions belong on codereview.stackexchange.comoli_obk - ker 37 secs ago
 
0
Q: Process bunches of records in seperate threads and wait for them all to finish

JocieI feel like there is a better way of doing this (i.e. without using two loops), but my colleagues and I are drawing a blank. private static void ProcessRecords(long[] recordIds) { var threads = new List<Thread>(); var recordsPerThread = recordIds.Length / Settings.Default.WorkerThreads +...

1
Q: Performance of Min and Max Sum of array in C#

Iti TyagiPrint two space-separated long integers denoting the respective minimum and maximum values that can be calculated by summing exactly four of the five integers. Stuck at understanding a hint given in question. Hint: Beware of integer overflow! Use 64-bit Integer. Code: arr = arr.OrderBy(i => ...

1
Q: code duplication in conditional Promise

LS97I am writing a function in Typescript that involves checking a condition, doing some extra processing if the condition is satisfied, and then doing the bulk of the job. Here's the catch: the extra processing stuff, that runs if the condition is satisfied, returns a promise. So instead of a clean...

 
8:35 AM
possible answer invalidation by D4ttatraya on question by D4ttatraya: codereview.stackexchange.com/posts/174930/revisions
"need code review" -> codereviewRight leg 13 secs ago
 
@Duga its ok
 
@Rightleg "Python: subprocess/try/functions not working;" = off-topic on Code Review. — Zeta 35 secs ago
 
9:09 AM
I would suggest pre-merge reviews, via Gerrit gerritcodereview.comLeonard Brünings just now
 
0
Q: single responsibility principle violated?

VansFannelI'm developing a C# library with .NET Framework 4.7 and Visual Studio 2017 Community. I'm trying to understand and use single responsibility principle correctly. I have this class to do a backup in a SQL Server 2012 Database: public static class DbManagement { private static string sqlBack...

 
9:34 AM
1
Q: Thread-safe rand for C

coderoddeI have this very short program for dealing with thread-safety of C's rand. Is it a correct implementation? #include <pthread.h> #include <stdio.h> #include <stdlib.h> typedef struct { pthread_mutex_t mutex; } thread_safe_rand; void thread_safe_rand_init(thread_safe_rand* tsr) { if (tsr...

 
@Gene yes...it's quite unpleasant especially during code review and I have to 'guess' what style the reviewer likes — ProtossShuttle 20 secs ago
 
9:47 AM
This question is far too broad for stackoverflow (i.e code reviews, code standards type hinting), perhaps a question for Software Engineering but read their guidelines before posting. — Sayse 22 secs ago
 
0
Q: how to pass edittext data to listview android

monzerI need help with my project.I want to pass data in tab 1 to listview in tab2 please insert the full code.

 
10:05 AM
possible answer invalidation by Iti Tyagi on question by Iti Tyagi: codereview.stackexchange.com/posts/175024/revisions
 
10:34 AM
1
Q: A C stack holding the minimum and maximum values

coderoddeI have this C stack implementation that knows its minimum and maximum values: minmax_stack.h #ifndef NET_CODERODDE_UTIL_MINMAX_STACK #define NET_CODERODDE_UTIL_MINMAX_STACK #include <stdlib.h> typedef struct minmax_stack_node { void* datum; struct minmax_stack_node* next_node; str...

2
Q: Caesar chiper in C

ema-peI've written a simple program that encrypt and decrypt a string using Caesar chiper. There are some examples to show how it works: $ cae encrypt "Hello World!" 5 Mjqqt Btwqi! $ cae decrypt "Mjqqt Btwqi!" 5 Hello World! $ cae encrypt "Hello world!" Ebiil Tloia! $ cae decrypt "Hello World!" Hello...

 
possible answer invalidation by Iti Tyagi on question by Iti Tyagi: codereview.stackexchange.com/posts/175024/revisions
 
Grrr
Tried to add metrics to my AWS lambda handler that sends slack messages
We use Grafana internally, so I added statsd, which utilises UDP
one day later after lots of trial and error of 'WHY IS THIS TIMING OUT?', I find out that Lambda ONLY supports TCP/IP packets
 
I think your question would better fit in [codereview.stackexchange.com/](Code Review Stack Exchange). — vijoc 9 secs ago
 
11:07 AM
0
Q: Javascript return several level

jardindedenI was wondering if there is a way similar as break for stopping different level. Here is an example : function Test() { Action(); [...] return; //Try to avoid this return and [...] } function Action() { alert('Hello world !'); return; //Here I would like something simi...

 
11:21 AM
0
Q: Filling a matrix with a scanline algorithm

Quentin L.I have a binary image approximatively 10,000*6,500 pixels (m,n) called "dem" and I want to "copy" it in a matrix of the same size by changing the matrix value from 0 to 1, using a scanline fill algorithm. The goal isn't really to copy a matrix but to check if the algorithm is working as it shoul...

 
11:55 AM
0
Q: Code for a game in python

AlexI am trying to write a code to form a frecell game. I need class called cards which has attributes suit and color I also need a class deck of cards with attaributes startvalue and endvalue and number of suits . I am stuck and is unable to find a solution .

 
12:30 PM
0
Q: Selection sort with reduced comparison count: Python iteration 2

greybeardFollow up to Selection sort with reduced comparison count - semi-final Iteration? My goal (and excuse not to tag reinventing…) is to have presentable code to argue the viability of reducing the number of comparisons used by selection sort (for readers not necessarily versed in the implementation ...

 
12:46 PM
1
Q: streamlining series of try-except + if-statements for faster loop processing in Python

Des GrieuxI'm processing strings using regexes in a bunch of files in a directory. To each line in a file, I apply a series of try-statements to match a pattern and if they do, then I transform the input. After I have analyzed each line, I write it to a new file. I have a lot of these try-else followed by ...

0
Q: Python sort a dictionary

Yunus SimsekI have to sort my dictionary. This is my implementiation. If you know another way to implement this, so feel free and tell me your sugestion My dictionary has this form: dict1 = { vector_ddc : { '0' : [1, 2, 3, 4], '00': [1, 2, 3, 4], ...}, len : 65464 } dict1 = {} dict1 = dictionary["...

 
1:01 PM
0
Q: Bash: change git remote from SSH to HTTPS within a given dir

Song JinThe code takes a user input dir path, then looks for git remote url that is still using SSH, and the repo is belong to an fixed Organisation. Then it will convert these repos' git remote url from SSH to HTTPS. My senior programmer said problems in the code are so many that he has to sit down wit...

 
1:24 PM
Monking
in some horrendous news, the German federal parliament elections are using a computer program for vote aggregation that is even worse on security than any reasonable person could possibly allow
 
Maybe the Piratenpartei can use that for their advantage.
 
0
Q: Nested Classes in C#

Max R.I wondered how nested classes in C# work as I often use them when I write native C# code (like Woods.Tree.Add(new Tree).Leaf.Color) so i tried it by my self with a Navigation example. There is a Position integer which declares a point on a line. To move left the position will be subtracted by 1, ...

 
@Zeta I wonder... their marketing and inner conflicts kinda knocked them out
I do hope they come back this year though...
I recently jested they might be the "Bündnis 90" for Generation Y
 
2:01 PM
@Vogel612 I'm not sure whether the pirate party or Die Partei gets more votes this year.
 
hmm ...
 
Greetings, Programs.
 
1
Q: Cloneable interface

Tomasz WaszczykIn the link https://stackoverflow.com/questions/4081858/about-java-cloneable is written that Cloneable is bad practise. How to rewrite the class below: public class DataSource implements Cloneable { /** * Variable name */ private String variableName; /** * Facility reference names */ priva...

 
I'm voting to close this question as off-topic because this is really much too broad for Stack Overflow, which deals with more focused coding problems than this. For advice on improving working code, consider Code Review instead - but do read A guide to Code Review for Stack Overflow users first, as some things are done differently over there!. — Toby Speight 23 secs ago
 
@Donald.McLean greetings, User
 
2:07 PM
@CaptainObvious Off-topic, broken code
 
possible answer invalidation by Peilonrayz on question by Yunus Simsek: codereview.stackexchange.com/posts/175046/revisions
 
@Duga I think that's ok - it doesn't really change the code, just makes it easier to follow.
 
2:23 PM
1
Q: How to use ExecutorService correctly?

EraNewGamesI'm using the Service and I want to start the downloading and uploading procedure to Realm. But the main thing is that it happens in one thread. As can be seen from my code, it's awful. If there is an opportunity to show how correctly this code should look. And I would like to know what is wro...

 
Requests for feedback on working code should be made at codereview.stackexchange.comFrançois Andrieux 27 secs ago
The root of the issue is that when a block throws an exception; that exception is attached to the blocks completion task or the completion task representing the completion of the pipeline. If if(!await t.SendAsync(item)) where t represents a block that is not faulted, i.e. the new BufferBlock<int>, then SendAsync will complete with success while the downstream ActionBlock is still faulted. Right now the example is not well behaved, can you post a new question with a more complete sample on Code Review we could get things cleaned up better. — JSteward 18 secs ago
 
0
Q: binary search tree impolementation in golang

kmad1729I have started dabbling with golang. I wrote up a binary search tree implementation. I was wondering if there is a cleaner way. Here is my implementation: type BNode struct { left *BNode right *BNode data int64 } func insert(n **BNode, data int64) { if *n == nil { (*n) =

 
3:50 PM
 
0
Q: TPL Dataflow and exception handling

Tomasz JaskuλaI have the following pseudo code: var queue = new BufferBlock<int>(new DataflowBlockOptions { BoundedCapacity = 5 }); var a = new ActionBlock<int>(async item => { await Task.Delay(500); Trace.TraceInformation( $"Target 1: | Type: {typeof(int).Name} | Thread: {Thre...

 
4:19 PM
I'm still new, but can someone tell me if this post would be a better fit on code review? — Tyler just now
Codereview SE is a better place for this question. — Gendarme 56 secs ago
I'm voting to close this question as off-topic because this is better suited for Code Review SE! — Am_I_Helpful 13 secs ago
I'm voting to close this question as off-topic because questions about improving the design of working code belong on CodeReview.stackexchange.com. — Barmar 42 secs ago
 
5:02 PM
posted on September 07, 2017 by CommitStrip

 
5:23 PM
Thanks for the input, the more I think about it the more I am inclined to solve some of these problems with process. The fear of having bug reports because one of the extensions was not created and attached properly is having me over engineer the solution and create stop gaps in the wrong places which code reviews and process can solve. Thanks again. — Helmut Granda 19 secs ago
 
1
Q: Array duplicate removal for duplicates exceeding `N`-number

Gavin HughesI recently encountered a front-end interview coding challenge question that required one to create a function which returned an array that excluded numbers that occurred more than n-number of times (i.e. duplicate-removal). In this example it was all numbers repeated >= three (3) times. I manag...

2
Q: Creating a scraper using multithreading

MithuI've written a script in python using "threading" module to scrape two sites simultaneously. This is my first time to work with multithreading, so the script might not look good enough to avoid criticism. However, It parses the two sites flawlessly. Any insight as to how i can do betterment of th...

 
Solid answer by a new user:
1
A: Designing a call center in object oriented way

chattonThanks for sharing your code, it's looking good but I think we can make some improvements. Currently, the getCallHandler(Call call) method doesn't actually make use of call! We can just remove that, so we end up with getCallHandler(). And then when we call it later, we don't need to pass in a Ca...

 
5:39 PM
I think this belongs on CodeReviewGrumpyCrouton 58 secs ago
 
Kaz
5:59 PM
I've managed to convince myself that over the next 2 years I can simultaneously:
Work full-time in a tough, demanding job;
Study full-time & complete my Maths Degree;
And study full time to become a Certified Financial Analyst (also the equivalent of a degree).

Am I mad?
 
Yes but that's unrelated.
2
 
1
Q: Given table of values, find rows that match a predicate

M. ProkhorovI'm working on the following problem: We have a Row Java type that roughly represents that of database table row (meaning it has a set of fields and is identified by complete set of values in those fields). Number and types of all fields are known up-front. Given a collection of these Row objec...

 
It sounds like you're looking for a code review. Those go on a different site. — user2357112 9 secs ago
 
6:19 PM
0
Q: List all checked boxes from webpage

Joey GrantThis is part of a Tampermonkey script that generates a box in the top right of a webpage and generates a list of checked boxes from the specified list selector (list chosen through buttons). The script works as expected; however, I am not a web guy and do not pretend to be one. My main source of ...

 
possible answer invalidation by Azerty123 on question by Azerty123: codereview.stackexchange.com/posts/174897/revisions
 
6:35 PM
0
Q: Compare two sheets and copy new and delete duplicates in excel

DigguDgI have two sheets named source and solution and I have to perform following activities. Copy new records from source to solution. Update records if rows present in source and have updated data. Delete rows from solutions if rows not present in source file. I have written following vba code....

0
Q: Alternative to env that accepts arguments

corvus_192It is commonly known that env doe not allow passing of arguments - at least not reliably. There are various workarounds described here, but they felt to hacky and unreadable to me. That's why I developed an alternative, ex. ex: #!/usr/bin/env bash # save the string given in the sheband line sh...

 
@RubberDuck Holy crap this guy just retweeted me
 
If your code works, and you're just looking to improve it, Code Review is probably a better SE site to ask this question. — Tieson T. 58 secs ago
 
6:59 PM
Seems like it's fit for CodeReview. There's no good single problem statement. I'd say this question should be closed as unclear what you're asking or too broad. — tambre 57 secs ago
What is your question? I see that you also posted this on Code Review. Cross-posting is discouraged. You might take a look at codereview.stackexchange.com/questions/138271/… to see if it solves your problem. In general, though, a binary heap is a poor data structure for this problem because removing arbitrary nodes from the heap is expensive. — Jim Mischel 57 secs ago
 
@EBrown he seems real down to earth. shrugs
I mean, I was chatting with a signer of the manifesto on Twitter this morning.
 
@RubberDuck He does, did you read his actual articles on F# for Fun and Profit regarding parser combinators and such?
 
Yeah. I've been reading that site off and on for years.
Finally starting to grasp it.
 
The parser stuff seems somewhat difficult, I think I get what's going on, he makes it look so simple. >.<
I think the trick is to wrap everything, by doing so you get far more data together than not.
 
7:14 PM
This may be better asked on code review stack exchangeJonathan727 50 secs ago
I'm voting to close this question as off-topic because there is nothing wrong with the code and there is no specific request. It's too broad. Please check out codereview.stackexchange.com and codereview.stackexchange.com/help/how-to-ask then consider asking it there. — Jonathan727 42 secs ago
 
7:42 PM
2
Q: Simple C++ program to add two integers

Fix3rI started learning c++ and the first exercise was to create a small program to add two numbers. No more requirements. I did this and put a small validate the user input. I am sure that it could be much better written, so I appreciate all the critics and suggestions. #include <iostream> using nam...

0
Q: Mongoose query using conditional formatting and regex

Isak La FleurI this the function createQuery is fully functionally, but I would like a review on it. I'm pretty sure this can be shorten and most important (improve performance). Any ideas? const express = require("express"); const router = express.Router(); const CompanyPart = require("../models/parts"); r...

0
Q: Removing key/value paris in list of dicts

MoxI have a list of dicts that all have the same keys. If a key's value is None in all dicts then I want to remove them (A solution that creates a new dict is fine as well). I'm concerned about my Big O complexity of 2n^2 (correct me if I'm wrong). Are there better solutions to what I have below? ...

 
8:30 PM
For code reviews there is codereview.stackexchange.com. — ventiseis 30 secs ago
 
8:46 PM
0
Q: OpenGL framework "SOGL"

nuke_birdHere is my repo, pull requests are always welcome ^^ I know that OpenGL frameworks already exists (OGLPlus, for example) but I developing another one following this set of reasons: To understand how OpenGL works To develop tool (framework) which is convenient to use (at least for me) To gain p...

 
@Heslacher Tnx!
 
9:19 PM
0
Q: Configuration for Embedded Broker ActiveMQ

HarishThis is my configuration for sending messages to an embedded broker. Also, the first bean method is used to just create and start the broker. It doesn't return any instance. Please a take a look at the 3 methods and tell me if there is an issue. Don't worry about inner details such as pub/sub d...

 
@EBrown That looks a lot like Parsec, but I'm not sure whether a parser combinator library in another language will help you to understand one in F#.
 
@Zeta He goes though everything in a great level of detail - and he based his examples on FParsec IIRC.
 
> For more information about parser combinators in general, search the internet for “Parsec”, the Haskell library that influenced FParsec (and this post).
Well, there it is. :D
 
10:04 PM
0
Q: C - Calculate the Lagrange polynomial

Ilmionome456I had to write a program to calculate the Lagrange polynomial of the maddening degree of function: \$log(x+1)+cos(x-1)\$ This is my solution: #include <stdlib.h> #include <stdio.h> #include <math.h> #define GRADE 6 /* Funzione per costruire la successione dei nodi (xi,yi) dei punti di valuta...

 
10:20 PM
0
Q: how do i make a multi http posts at the same time and collect responses?

Ahmid in code below i use for loop to do the task of http posting and filtering responses one by one i need help to understand how to improve the code to send 50 at time #! /usr/local/bin/python # -- coding: UTF-8 -- import sys reload(sys) sys.setdefaultencoding('utf-8') import requests import json ...

 
10:33 PM
monking
 
 
1 hour later…
11:52 PM
0
Q: For a project that follows the MVC pattern, is this an acceptable implementation of a control class for an entity?

the duck wizard For a Student object in the package entity, I have a control.studentpackage with classes that are relevant to the Student object. The Student is a class with only private properties and getters/setters for every property. The setters do no validation on their own. My project structure is as f...

 

« first day (1587 days earlier)      last day (2415 days later) »