« first day (2026 days earlier)      last day (2286 days later) » 

00:00
RELOAD! There are 5838 unanswered questions (89.6758% answered)
00:11
@Vladimir its hard to know without seeing the full code, though for readability sometimes (most of the time) simple is better. Don't let anyone ever fault you for breaking things apart and making things more verbose. Its easier to read line by line then to understand a complex nested statements. Though, If you have code that works, may i suggest CodeReview on stackExchange — TheGeneral 1 min ago
Thank for advice. And where is CodeReview on stackExchange? do you mean stackexchange.com? — Vladimir 44 secs ago
00:26
0
Q: C# Employee Pay Data using JSON file

Christopher WoodI'm looking for some feedback on my code here. I want to eliminate duplicating the code through the different button_clicks. I'm thinking with a method but nothing I try works better than what I have. using System; using System.Collections.Generic; using System.Data; using System.IO; using Sys...

00:55
possible answer invalidation by connectyourcharger on question by connectyourcharger: codereview.stackexchange.com/posts/207916/revisions
@Duga rolled back
 
1 hour later…
02:12
0
Q: Linked list with hand-over-hand locking

nhtrnmFollow-up to this question: after reading the comments, I decided to redesign my linked list to have a cursor that only contains one node and implement the interface similar to the one of forward_list in STL. The interface is fairly clear in my opinion but I also added extra comments where I foun...

02:56
If your code works, maybe you should ask your question here. I think there you can get more accurate answer. — vasily.sib 23 secs ago
Since you have working code, this might be more on-topic at CodeReview. I'm not sure how the questions you've asked can be answered in a way that isn't simply opinion. Consider if you really just want a yes or no answer, or if you're looking for alternatives. This isn't really a yes or no answer sort of place. — Retired Ninja 38 secs ago
@RetiredNinja Do you know if there is a quick way to migrate the question over to CodeReview? Or should I just close this question and cut and paste it over there manually? — WBuck 20 secs ago
@vasily.sib Someone would be failing my code review with that code, and asked to recommit ;) — TheGeneral 54 secs ago
03:25
monking
03:42
0
Q: Looking for constructive criticism

IneffableI began trying to learn python3 as my first programming language two days ago for a hobby and interest to teach my kids later on. I've been working on a program guessing a random number. I started with just guessing the number and built on to add two players then added a computer opponent to it a...

0
Q: Find most significant bit without bitshifts

AliI am trying to find the msb of a binary without using any bitshifts. This is what I have come up with, which looks very naive but it's very simple: template<typename T> constexpr uint8_t find_msb(const T& a_variable) { static_assert(std::is_unsigned<T>::value, "Variable must be unsigned"); ...

Hello! Can anyone suggest me books on Java which is easier and simpler for beginners as Complete Reference by Herbert Schildt on C? Anyone...Please...
04:14
0
Q: repeated strings hacker rank

LaurentI'm doing a hacker rank challenge with this one called "Repeated String". I attempted this challenge in my weaker language java. The goal is to print out the occurrences of the letter a. First you're given a string "aba" then a number 10. The new string generated would be abaabaabaa and you need ...

05:00
-1
Q: Converting BinCounts from Mathematica to C?

Jomy BlueI am trying to convert my Mathematica code to C since it can sometimes takes the Mathematica code quite a while to execute since the arrival times lists are hundreds of thousands of counts long, and am looking to reduce computational time, but I am a little rusty on my C. I see that there is "CFo...

possible answer invalidation by 200_success on question by Foreel19: codereview.stackexchange.com/posts/205962/revisions
05:15
0
Q: Singly Linked List Implementation (With Nodes)

ChubakBidpaaThis code was recommended to me by my dear friend Jon after I wrote an implementation using arrays. With his help, I managed to create a Singly linked List similar to std::vector using Nodes. #include <iostream> template <class T> class LinkedList { private: size_t _size; public: clas...

0
Q: Check if mail contains a single page pdf and transfer to other folders

GauravsaThis is my first post here. Need some suggestions on how to improve code below: This code checks if a mail message contains a single page pdf attachment. If yes, it adds it to a processed list else rejected list. If mail can be processed, then it saves the attachment into a file. I feel this me...

Monking
 
1 hour later…
07:15
0
Q: find the shortest path between two points with obstacles

user5447339I need to find shortest path between two points in a grid given an obstacles. Given a 2 dimensional matrix where some of the elements are filled with 1 and rest of the elements are filled. Here X means you cannot traverse to that particular points. From a cell you can either traverse t...

0
Q: Is this random unpredictable?

Spreed. BloodI'm trying to make a pool of double's and then try pick a randomly selected winner but still take into consideration of the input. Is the SecureRandom really unpredictable? Here's my code: private static <E> E getWeightedRandom(Map<E, Integer> weights) { SecureRandom secureRandom = new Secu...

07:39
This is fine in principle (looks pretty much like BFS, right?). There are a few optimizations you could do: Try to avoid frequent allocation of new memory, store the visited flag in a fixed-size list rather than a hash set. For a more detailed review, go to Code Review. — Nico Schertler 38 secs ago
0
Q: list items equi-distant from edge to edge

DeveloperI've created an equi-distant list items that span from edge to edge of it's container boundaries, pasting code for review and better suggestions. .thumbnails { list-style: none; padding: 0; margin: 0 2% 2% 2%; /* container margins - same as li's */ font-size: 0; } .thumbnails li ...

08:16
0
Q: SHA-1 and MD5 BruteForce Python 3.7

ThewizyI've made a python program that can BruteForce Both MD5 and SHA1 hashes, and I would like know if i could make the Program faster or any way I could improve it! I'am still a beginner in python and in coding in general (This Program is only for Learning purpose) The Code: import time import stri...

08:46
0
Q: Where should we define Go interface in multiple Consumer scenario ? What about interface in producer to show generality?

denisthamrinCan someone give me a concrete example to this advise ? https://github.com/golang/go/wiki/CodeReviewComments#interfaces TLDR; So is this how i follow it ? package worker type interface DB { getAllTable() } type worker struct { db DB } func (w worker) doSomething() { w.db.getAllTable()...

09:31
0
Q: High CPU Usage on Website (65% on Dual E5-2697 v2) - Reviewed Code - Can't Locate Code

McFlySoHighI visited the website: Blackjack Random Shuffling / Card Shuffling Anomalies The moment the page loads, my CPU usage on a 24 Logical / 48 Core HT Machine jumps to 65% which is entirely used by Chrome Browser. I reviewed the code to the site, but can't seem to locate where / why the CPU usage ...

0
Q: Authorization - Create and unlock a User

Spedo De La RossaI just wrote this, but I am not realy happy with that. I think there is an easier way to do this. First I am checking if a user has an ID (from a portal we are using, it is in the header). After that I have to check if the user exists in my application, if not a user will be created, if the user ...

09:45
I'm voting to close this question as off-topic because it seems like it would be a better fit for codereview.stackexchange.comDaveyDaveDave 49 secs ago
0
Q: Correct use of HTTP VERBS in custom REST implementation

NestorI have a server-side service (using ASP.NET Core) that should provide a REST API to various clients. Behind the service, I use a SQL server for data storage. The controller has the following route attribute: [Route("api/[controller]")] [ApiController] public class CustomDataController : Contro...

This would better fit to Stack Exchange: Code ReviewPᴇʜ 7 secs ago
10:01
0
Q: Atomic update and backup ON DUPLICATE KEY golang sql statement

MaciliasWhat is the best way to combine two statements (INSERT or (BACKUP and UPDATE)) and perform them atomically in golang? I found this similar question: Query Select and Insert if not exists But the Solution does there does not fulfil 2 of the the following requirements: perform an backup of the ...

10:17
0
Q: Python 3.6 Dice Histogram: Using random.seed effectively

mcinnis_kI am not 100% sure that I am using the random.seed correctly for this assignment, or if there is a more efficient way to write the code. Any feedback is appreciated. import random random.seed(2) # declaring an array to count the occurrences a= [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # looping f...

0
Q: React shallow testing

krankubaI am testing a very simple component in React and I would like to know if there is difference if I am extracting the ::name:: variable or not: const prop = {name: '::name::'} const wrapper = shallow(<Component prop={prop} />) expect(wrapper.equals( <div> <div>::name::</div> </div>...

10:47
-1
Q: Threading + queue

stamerWhich code is better? In the second example, the functionality is not added, but the main thing for me is to understand which style is better. https://pastebin.com/Mz4EnqFq or https://pastebin.com/1Vb059Rp

@Feeds code behind links
11:02
0
Q: Open Close using javascript

FLoraI would like to ad an open hours which would change everyday on my site and also having just the word "closed" when the opening hours is ended. I have used a code that I found on this website but I am not good enough in Javascript to change it to look like what I want : having just the "closed" ...

11:17
0
Q: When to use enums inside classes

avismaraI have a code that looks like this: class PermissionsManager { static let shared = PermissionsManager() public enum PermissionType { case contacts case calendar } } This got me thinking, while syntactically this is allowed, when are the times you would want to nes...

11:51
MOnking
12:03
it's not really on-topic for SO, but I would say you either get data from a service, or create a small factory that returns the on to go values, which could easily be refactored at a later stage. If you would show some of the code where you have problems with, it might be appropriate here, if you have a working solution and you want some input, you might rather check codereview :) — Icepickle 43 secs ago
12:33
1
Q: Passing bitmap from C# to C++ via a struct

WBuckFirst, I've read the a few questions regarding this issue, the most helpful being: https://stackoverflow.com/questions/27463876/passing-bitmap-from-c-sharp-to-c I was unable to get the provided solutions to work as I kept getting an AccessViolationException. What I'm attempting to do is pass b...

13:03
0
Q: Codility - Tape Equilibrium: understanding the complexity of my algorithm with for loop sums

ClockworkThis question is related to this one, since it's about the same Codility exercise (Tape Equilibrium instructions): Time complexity of tape equilibirum Basically, I have written the following code (let's focus on the algorithm; I purposely left unchanged the name of the parameter A and others): ...

13:16
for code reviews you should try codereview.stackexchange.com which is dedicated for. StackOverflow is for when your program do not work properly or when you are looking a way to achieve something. — RomainL. 48 secs ago
0
Q: Simple bash argument parser

BananachIn a bash script, I need to parse arguments that have the following form: 1) The main arguments can be thought of as being a single argument, but I do not want to force users to quote the entire thing, so when the argument contains spaces I must be able to handle multiple arguments. 2) One flag...

14:02
You actually asking what are the differences between those two object initializations...and the title is about passing object to method. This is misleading. Rephrasing your question would lead you to answer like hereReniuz 35 secs ago
unclear what you are asking. Assuming your code works as intended, you would have to explain what you consider as "best". Also note that for code reviews (of working code) there is codereview.stackexchange.comuser463035818 just now
14:22
Monking
14:49
0
Q: How can I speed up this 2d Array script?

Nick LantaI have a script that takes manager names in Sheets("Mgrs") and extracts the employees that fall under each manager in Sheets("Retail Sharepoint File-Merge"). Once it finds the managers employees, it prints the array to a new worksheet and formats it and saves it based on the values I lay out. O...

@skiwi @Mast ETH has dropped in price significantly with the Bitcoin drop.
I still haven't lost any $$$
15:14
posted on November 20, 2018 by CommitStrip

15:55
@202_accepted Just don't sell any of them. The price will recover eventually.
@Mast I'm not convinced. Some of the insiders in the network are talking about this being a huge "unrecoverable" dip.
0
Q: .NET/C# conditional AsyncLock implementation

the berserkerI have a case where I match data from DB by the various filters. Until the match is updated in the DB, I don't want to accept requests for matching with the same criteria, as this could produce duplicate matches. Therefore I "lock", but selectively using AsyncLock from AsyncEx library. I've chec...

0
Q: Python Toolbox for Open Street Map data

JuniorPythonNewbieBackground My project is python toolbox. This is my first bigger coding project. It took me quite time to code this toolbox. I learned a lot from the start point to this day. I changed this code hundred times, whenever I learned about new trick or method. This code works. I tested it with vario...

Hi, this is off-topic on stackoverflow. You are welcome to ask for specific programming and/or error related questions here. Your post would fit better on code reviewnilsK 17 secs ago
16:11
@202_accepted Of-course some of the people are. There are always some that claim some big dip is the pop of the bubble.
They could be right, but I'm not convinced this is an unrecoverable dip.
I'm neither optimistic, nor pessimistic about it. I'm just staying on the sidelines and observing.
Not strong enough a dip so far IMO.
I'm not convinced either way, in fact. I'm of the standpoint that we're in another market trend.
@RikSportel the world needs more of you! Do you have a Code Review profile? You'd do great over there! — Mathieu Guindon 9 secs ago
@Duga lol
16:24
@CommitStrip cue sad trombone
16:35
0
Q: Iterating over positional parameters in bash script

justinnoor.ioThis bash script called 'inpath' from "Wicked Cool Shell Scripts" 2nd version finds commands in PATH, i.e., $ inpath echo would output echo found in path. The script includes the function below, in_path(), which uses positional parameters in a way that is puzzling to the untrained eye. Notice th...

0
Q: Initiating Child ViewController from UIStoryBoard in iOS

D4ttatrayaI'm trying to use inheritance in UIViewController where base class has XIB in storyboard. I'm troubling with initiating different children classes with that XIB. I cannot use XIB file separately instead of storyboard because it has static UITableViewCells. So here is how I'm managing it currentl...

0
Q: Functional programming compress and expand functions in Haskell

cheshireHere is my code: import Data.Char newtype Xp_Zf' = Xp String deriving Show type Nat1 = Int type CharLength = Nat1 type Letter = Char newtype Kp_Zf' = Kp [(CharLength,Letter)] deriving Show komp':: Xp_Zf' -> Kp_Zf' komp' ( Xp xss@(x:xs)) = let check = checker(xss) in ...

16:53
Monking
@202_accepted Did you make any though?
@skiwi Yeah, about 2%.
Not bad
That's since the start?
Yeah I ran it for about 5 days then stopped it.
@KonradRudolph For most cases yes of course use a namespace (preferably not the global one), but I expect functions and classes named after standard counterparts to do the same thing and perform the exact same way (if it ain't broke...). I would use a fully qualified name for a function, and honestly fail someone's code review if they used a mirrored name and didn't explain clearly why. Granted this has no bearing on the original question which is why this is a comment. — jfh 41 secs ago
17:26
Greetings, Programs.
@Donald.McLean depending on the implementation, they may respond with with a greeting
@SᴀᴍOnᴇᴌᴀ Just checking, but do you know the source that I am referencing there?
a quick web search gives me a good hint
0
Q: better way to convert video to gif

VitaliyLooking for the best way to speed up or maybe move from FFMpegConverter to another application for converting video to gif, because it takes much time, will be much appreciate for code review and suggestiions to improve converting performance public static byte[] ConvertToGif(string url, stri...

1
Q: I want to know what if a color repeats, and if so change a drawable

IRlyDunnoSo I made this code: // A List with only the days that have events List<Eventos> CalEvents = eventDao.Select(FromEventos.DistinctDate); // A List of a struct with Date + color of event List<eventAndColor> events = new List<eventAndColor>(); // If List isn't nul...

0
Q: Designing a configurable Discrete Event Simulation class

AlxeA bit of context: I've had a fair share of programming in Java but want to refine my C++ skills with a college task. I've wanted to focus on C++11 and C++14, as they are recent but not latest, and C++14 is the default revision of my compiler. I want to share a header (hpp) file and a test implem...

if there was a person here named Kevin would you expect that person to hug you?
17:36
@SᴀᴍOnᴇᴌᴀ In this case, I'm Flynn (which is, IIRC, how he was generally addressed).
ah... but maybe if there was somebody here named Alan or Lora you would hug them...
I'm not much of a hugger.
18:10
What an unusual conversation to walk in to
18:20
( ͡° ͜ʖ ͡°)
18:51
-1
Q: How to make Add and Update API for two different table using spring boot and MySql

kunalHow we can make API for add and update user information with image using spring boot and mysql? I want to insert this data into two different tables. some columns in one table and some column in different table. How we can do this.

19:21
@StephenRauch I was intrigued by this approved edit
does that look like reinventing the wheel?
19:35
@SᴀᴍOnᴇᴌᴀ Yes, every linked-list question is.
There's even a tag for it.
It's a functionality part of the standard library IIRC.
@Mast I know there is a tag for it...
I guess I didn't look at the node header... mostly the main code and the description
kapeesh
(not the god of monkeys)
lurking
8
lurking intensifies
6
19:51
(・о・)├┬┴┬┴
20:02
(*o├┬┴┬┴
  c├┴┬┴┬
Hi Ava - welcome to our lurking party!
0
Q: String Compression

Exploring Implement a method to perform basic string compression using the counts of repeated characters. For example, the string "aabcccccaaa" would become "a2b1c5a3". If the "compressed" string would not become smaller than the original string, your method should return the original str...

  * * *

|       |
|-------|
|       |
|       |
|       |
|-------|
|       |
|       |
|       |
|-------|
|       |
|       |
|       |
|-------|
|       |
|       |
|       |
|-------|
|       |
|       |
|       |
|-------|
|       |
Stairway to heaven star party
more like ladder to star party
The State of JavaScript 2018 https://t.co/B2yx1McNIY
 
1 hour later…
21:30
helpful output is helpful ...
@Vogel612 lolwat — what even is that?
maven
well, to be more correct a maven with a muzzle
 
1 hour later…
22:50
I'd say that doing Java development in notepad is extremely inconvenient, and one should not do that on daily job, they just lose on performance for no reason. I can imagine rare cases when an IDE is unavailable, but why should we optimize for those rare cases? Github is not a development environment either, and I feel like general language guidelines should not depend on one commercial code review tool that has little to do with Java/Android. If they want it, they can implement coloring on their side, but so far it seems like it's not really that important for their users. — Dzmitry Lazerka 47 secs ago
0
Q: Program that implements a finite difference scheme (Fromm's method) to solve a PDE (linear advection)

DaveI’ve written a working C++ program that implements Fromm’s Method - a finite difference scheme that solves the partial differential equation describing linear advection. I’m computing the numerical solution over a grid with 2^16 points. I started in Matlab, then moved to Python, both of which we...


« first day (2026 days earlier)      last day (2286 days later) »