« first day (2147 days earlier)      last day (1872 days later) » 

12:00 AM
RELOAD! There are 5920 unanswered questions (89.8866% answered)
@Kingsley Are you saying that Param** would pass code review? Seems even worse to me. — john 20 secs ago
 
12:40 AM
0
Q: C++ writing object data to file

okkv1747vmI'm trying to write a program that stores usernames and passwords. So I have created a Record class. Each record has an id, title, username, and password field. I want to write each record to a text file. However, I am having some issues. When I compile I get the following errors. 'Record::get...

 
12:52 AM
Note: these types of questions are better suited for the Code Review stack exchange site. — Janac Meena 26 secs ago
 
1:48 AM
It does work, with no issues reported yet. Perhaps I should have posted this in codereview.stackexchange.com instead. Thanks for mentioning developers.google.com/web/tools/workbox I hadn't heard of it. — James Chevalier just now
 
0
Q: Beginner Tic Tac Toe Game for Python

EnriqueI am a beginner programmer and would like some feedback on this Tic Tac Toe game I made on Python. Any feedback would be appreciated, as I really want to get better at programming and pick up good habits. Here is my code. Something I would add is 'try' statements for invalid user input, but this ...

 
2:05 AM
@WhozCraig - I don't know of any "generally-accepted industry guideline". When I was a junior, I was told in a code review: "C++ references should be used only for operator overloading" (i.e.: returning an object reference to support assignment). I personally have no issue with using references for a "var parameter" (although pointers are my preference too), but not mixing references and pointers. Maybe I've turned into a coding curmudgeon over the years. Seems nowdays if you use ** in C/C++ you obviously hate the entire world, motherhood and kittens too. Seems so on SO at least. — Kingsley 56 secs ago
 
2:35 AM
0
Q: Command-Line Poker Showdown

alec935I created a command-line program that generates poker hands (5-52 cards) and compares their strength. On my Macbook Pro, it generates and compares 1m 5-card hands in ~2m. Here's my code: import copy import distutils.core from enum import Enum from time import time from random import shuffle fro...

 
2:54 AM
0
Q: Swift Prims algorithm

WishIHadThreeGunsLots of Prim's algorithm implementations seem long, and rely on a priority queue implementation. If I use an adjacency matrix I can then calculate the next item to take using functional programming in Swift. func prims (_ matrix : [[Int]]) { var selected = 0 var selectedSoFar = Set<Int>...

 
3:36 AM
I think stack exchange's Code Review is a better place to ask that codereview.stackexchange.comarieljuod 6 secs ago
 
3:47 AM
I'm glad it helped! If it works, you can consider running ShellCheck to get automated suggestions, and after fixing those, post it StackOverflow's Code Review sister site. — that other guy 33 secs ago
 
4:10 AM
Please ask if you have a specific question. I dont think people here will do code review and give suggestions. — MayurK 6 secs ago
When variables of different storage durations are mixed up as in this particular case, I do not think it will be safe. Even if it were, such code would probably not pass code review. :) — P.W 28 secs ago
 
5:10 AM
0
Q: How can I form in python this matrix to the corresponding graph?

AIZEN_NEWim working in graph theory and sagemath or python. for prove that R(3,3)=6 is necessary to find a counterexample of a graph where it has neither a triangle monochromatic red nor a K_3 blue, for this case, an adjacency matrix is designed with entries 1 and -1, where the entry in the matrix is 1 ...

 
Monking
 
5:34 AM
Monking
@CaptainObvious No. Also, cross-posted on Mathematics.
 
0
Q: fill out a spiral matrix in javascript

NinjaGI got this question during my interview. Given an integer N, output an N x N spiral matrix with integers 1 through N. Examples: Input: 3 Output: [[1, 2, 3], [8, 9, 4], [7, 6, 5]] Input: 1 output: matrix filled out as a spiral [[1]] /*PSEUDO: rowMin =...

 
6:45 AM
0
Q: Python AES-CBC implementation using AES-ECB

InfuzionI am looking for ways to make this code more "pythonic" and any issues with my implementation. This was designed to solve Crytopal's Challenge 10. This challenge involves recreating the AES-CBC cipher using a library-provided AES-ECB function. from Cryptodome.Cipher import AES def decrypt_aes_e...

0
Q: Java Pi Calculation using an Averaged-Leibniz formula

Nikko77While trying to discover a way to calculate the digits of Pi faster with the Leibniz formula for Pi, I noticed that, if I took two consecuent numbers in the series, and calculate their average, I would get a number incredibly closer to Pi compared to these other two numbers, and furthermore, if I...

0
Q: ValueError: setting an array element with a sequence Tensorflow and numpy

FreddyGumpTrying to run this code, which is a function I wrote myself: def next_batch(batch_size): label = [0, 1, 0, 0, 0] X = [] Y = [] for i in range(0, batch_size): rand = random.choice(os.listdir(mnist)) rand = mnist + rand img = cv2.imread(str(rand), 0) img = np.array(img) img = i...

 
I would think that this question belongs on Code Review Stack Exchange instead. — Ole V.V. 1 min ago
I'm voting to close this question as off-topic because it belongs on Code Review Stack Exchange instead. — Ole V.V. 20 secs ago
 
7:24 AM
0
Q: Singleton design vs. automated testing and teardown

DinuI will post a generic code exemplifying two code patterns; this question is generic but I still think it's best fitted to code review even though it concerns abstract notions that would be pointless to express at large with code. We have a CMS framework. This is important in the sense that the f...

 
7:37 AM
Good monkening.
 
Monkin'
 
-1
Q: Getting Error to display result in real time with openCV and Python

iszzulikhwan91Hye Guys, I am new here. I would like to ask a questions. Regarding on Python and OpenCV. Hope someone can help regarding on this matter. I try to create real time face recognition using flask,python and face recognition library provided by python.I have 3 file app.py, face.py and camera.py. Yo...

0
Q: Replacing MIN and MAX macros with type-safe, recursive templates of variable arity

Jose Fernando Lopez FernandezI'm currently reading Mastering Perl for Bioinformatics; I'm using the book for learning bioinformatics while implementing the code in C++. I came across a situation where I needed to use the minimum of three numbers, which the author did using a function call min3 which, as expected, returns the...

 
@CaptainObvious not working, should be closed
 
7:58 AM
Your code review question link gives a notice that it was voluntarily removed by its author. Would you mind updating your answer here, either with a link to code, or with an explanation, or just remove your answer? — hlongmore 35 secs ago
 
@CaptainObvious @avazula RBA
 
@Mast RBA? what does that mean?
 
@avazula Removed by author
One of the hundred or so recurring acronyms in this room.
 
@Mast aaaaaah
now it makes sense haha
 
8:40 AM
0
Q: Mirrors number at borders of interval, untill it lays in the interval

user9400869I have the following simple function __device__ mirror(int index , int lB, int uB) { while(index < lB || index >= uB) { if(index < lB){index = lB + (lB-index);} if(index >= uB){index = uB-1 -(index-uB);} } return index; } It is used for every index to make give m...

 
8:54 AM
Plaintext password, even before completing the registration...
It still happens...
 
Monking
 
 
1 hour later…
10:04 AM
0
Q: Try to make group.toList() but looks questionably. How to fix the code?

SergeyMy problem is to load items with different types , then to sort it by types and return pair results: type to items (for the type) wrapping to object: data class MyProfilesWrap(val type: MeStore.ProfileType, val profiles: ArrayList<MeStore.ProfileImpl>) so after groupBy() i trying get it...

Not quite sure why that is closed...
> code working for me but looks questionably because i had to make blockingGet() in subscribe:
 
10:16 AM
0
Q: Java Verison of Bouncy Castle AES GCM

AkshayIs there a JAVA version of bouncy castle AES GCM for decryption alone. Method Name:- SimpleDecrypt Decryption code is in C# taken form this post Simplified secure encryption of a String. public static byte[] SimpleDecrypt(byte[] encryptedMessage, byte[] key, int nonSecretPayloadLength = 0) ...

0
Q: Stop flickering / refactor code for Excel ScreenUpdating false on Copy Paste to another worksheet

PoetoeI am beginner and still learn about programming on macro VBA excel. I need help from community to solve my problem on macro code on excel Sub export_data() With Application .ScreenUpdating = False .Calculation = xlManual 'sometimes excel calculates values before saving files End Wit...

0
Q: Fullscreen Slideshow with fading background

Dennis Finkfor the past months I have been learning plain javascript without jquery or libraries/frameworks. So now, when I develop a website, I want to write all of the JS code by myself to fully understand what is going on and to learn the language. So far so good. I tried to implement a slideshow with a...

 
@SimonForsberg "How to fix the code?" might have automatically raised flags. Anyway, since it's mod-closed, why not ask the relevant mod instead?
Graipher raised questions about it in the comments that weren't addressed either.
But, by the looks of it, it might simply need to be phrased better and suddenly it's on-topic again.
 
@CaptainObvious JAVA
What is JAVA
I only know Java
 
36
A: What's a Zombie? And what are the many other memes of Code Review?

Simon ForsbergMeme: Java vs. JAVA Originator: Jamal(?) (to be determined) Cultural Height: The 2nd Monitor (as usual), but also in various comments scattered across meta. Background: Question with the word JAVA (instead of Java) in the title or body, is often an indication that the poster is a beginner and/...

 
@Mast I know :)
I love browsing that meme page
 
@CaptainObvious Please nuke that.
 
10:58 AM
This should be on codereview.stackexchange.com instead — kemicofa 14 secs ago
 
11:24 AM
@kemicofa Oops, should i then close this and ask on CodeReview? — ZED.CWT 21 secs ago
No, just ask the same question on Code Review. — kemicofa 40 secs ago
 
11:53 AM
@DerKommissar Another uninformed HNQ question:
12
Q: Can I cause damage to electrical appliances by unplugging them when they are turned on?

OMGshI don't mean damage caused to the socket and prongs, but only to the appliance itself.

 
Oh dear god
The answers are not great either
 
12:09 PM
It's not question for stackoverflow, use codereview.stackexchange.comkriss 43 secs ago
 
@DerKommissar Nope
But honestly, that question should've been closed instead of answered.
 
The compiler can't possibly check each and every error you can make in your code. Write tests. Make code reviews. — JB Nizet 22 secs ago
 
12:30 PM
0
Q: Best method to count the number of times the + operator is called during the evaluation of the function

Riandef foo(n): total = 0 for i in range(n): for j in range(i): total = total+i^2 return total How best to modify this code to count the number of times the + operator is used during the evaluation of this function.

 
12:49 PM
0
Q: Why this JS code writting to a hole file so slow on Windows?

ZED.CWTvar fs = require('fs'), target = 'test', size = 2 * 1024 ** 3, content = Buffer.from('TEST'), fd = fs.openSync(target,'w'); console.time('Truncate') fs.ftruncateSync(fd,size) console.timeEnd('Truncate') fs.closeSync(fd) console.log(fs.statSync(target).size) fd = fs.openSync(target,'r+') conso...

 
@Mast Yes it should have.
Oh well, maybe their mods should use the new fancy "remove from HNQ" feature ;)
 
1:08 PM
0
Q: Find out how many laptops Molly can buy based on available money, array of quantities and array of costs

fpezziniProblem description: Molly wants to purchase laptops for her school. Find out how many laptops she can purchase by comparing the vendors available. Each vendor sells the laptops in batches, with a quantity identifying how many laptops on each batch, and a cost for the whole batch. Sample ...

 
1:22 PM
@DerKommissar They haven't so far and I doubt they'll do it.
 
1:46 PM
0
Q: Extracting image links from a markdown string

MichaelSuppose I need to extract the paths of images from a markdown string. The images look like this: ![Alt text](/path/to/img.jpg) ![Alt text](/path/to/img.jpg "Optional title") I am using a regex to extract the paths as follows: def imagePaths(s: String): List[String] = { val regex ="""...

 
If your code works and you're looking for design or performance improvement, a question on CodeReview might be more appropriate. — dymanoid 31 secs ago
Thank you, I had no idea of the separation between Stack Overflow and CodeReview — Micha 11 secs ago
 
2:05 PM
1
Q: Is it enough for PHP secure session class?

mepihindeveloperI need you help with my php session class. I can not understand, the class implements adequate work with sessions. By adequate work, I understand the security and correctness of the methods. <?php namespace Core; class Session { /** * @var string Название сесии */ private $n...

 
Mar 11 at 17:31, by Mast
Just keep practising and don't worry too much.
I recently realised there is something called deliberate practicing. jamesclear.com/beginners-guide-deliberate-practice
 
2:24 PM
-1
Q: Create a varialbe in an if-Statement and keep using it

QoheletPython is not my strongest skill, but I'm trying to get better and I enjoy its ability of line functions. Yet there's one issue I haven't come across yet: How do I define a variable within the if-condition which I'm able to use in the statement itself as well? Right now my code looks like this:...

0
Q: CPU Barycentric rendering in JavaFX/Kotlin

johnnic431I am writing a software renderer for the Kotlin port of Dear ImGui. In order to be feature complete, I needed to add barycentric coloring to some triangles for things such as color pickers. I have implemented barycentric erndering as below, but it takes 75-95 percent of the time spent on the cpu ...

 
I think this question might be a better fit on Code Review. — Lews Therin 43 secs ago
 
2:40 PM
possible answer invalidation by 200_success on question by alec935: codereview.stackexchange.com/posts/214221/revisions
possible answer invalidation by 200_success on question by alec935: codereview.stackexchange.com/posts/215896/revisions
 
0
Q: Is this the proper way to inform the main thread of an event from a Background thread?

MichaThe background-thread is an UDP listener. As soon as a certain type of message is received, the main thread has some work to do. My current solution works. But I'm in doubt of the implementation. My question: Is this a proper way to handle these "simple" situations? Is there another simple and...

 
3:02 PM
0
Q: C++ version of linspace()

speedymcsI have been using this C++ function emulating MATLAB's linspace for quite a while now: cv::Mat CR::linspace(double p_start, double p_end, int p_interval) const { double spacing = p_interval-1; cv::Mat mat(1, spacing+1, CV_64F); for (int i = 0; i <= mat.cols; i++) { mat.at<double>(0, i)...

0
Q: A simple card game simulator

Prashin JeevaganthThis is a homework question, and I have written the code but wasn't sure if I had picked the right data structure for this job and minimised time complexity. Can anyone give me some feedback? Problem Description MagicTheGathering Aim: deal with a series of command (SUMMON, KILL, HEAL). ...

0
Q: Java Maze Solver (DFS)

Master ChiffI was asked to create a Java program that will navigate through a series of mazes. I would like to know if this is the optimal way of using a DFS or is there a better way and I am doing something wrong? Example of a Maze File: 10 10 1 1 8 8 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 1 ...

 
0
Q: Is this the correct use case for a tuple

PeteI have the following code in which I return two values in a tuple (I'm new to tuples so not sure how to use them properly) - the processed urls without pipe delimited strings and the media assets got from our digital asset handler private static (string[], IEnumerable<DigitalAssetSearchResult>) ...

 
4:19 PM
2
Q: Quad Tree Implementation in C++11

xorz57The following source code is working Quad Tree Implementation in C++11. How can I simplify the source code but also allow the user to bring his own Point Class Implementation? #pragma once #include <algorithm> #include <array> #include <cstddef> #include <functional> #include <vector> namespac...

 
ermagherd, dishwasher repairs are frigging expensive...
 
Really? That seems odd
 
@Vogel612 Half the price of a new one, if you're unlucky.
I used to repair them for a summer job. We did it for less and sold them second-hand.
A large shed full of parts was the trick in doing it for less.
Well, one of the tricks.
Dirty business, really.
 
@Mast yep. 350 bucks for the changing of the heater
Pretty sure my landlord will opt for buying a new one instead
and for 350 you get a full new one, not quite that high-end though.
 
4:38 PM
0
Q: Stack Interview Code methods made from class Node and Smart Pointers

gregMainly looking for feedback on my use of smart pointers to implement a standard stack. For interview level production code I have also include a namespace and asserts to test my class, let me know if that would be appropriate for an interview. I'd like feedback on my pointer management to avoid m...

 
5:06 PM
Monking
 
0
Q: PlayFair Cypher in Java

IgnisArrowSo I am a college student and I am trying to create a GUI that has a file chooser that opens the txt file in a dialog. Then the user chooses a secret code and the program decodes it using the following rules: a) If I1and I2 are found at the corners of a rectangle then O1 and O2 are the other two...

 
5:55 PM
0
Q: Optimization of VBA Code (loops)

DanI've added a timer to my code and the bottleneck comes when I'm looping through 47 rows and inputting data from a dictionary that I previously loaded with values. Since i use these files for a lot of different things I've set up public variables in order to avoid setting them up for every new co...

-1
Q: Am I using async C# correctly or how can I make correct use of async?

Fredrik LingerI wonder which of these version is the correct way of using async tasks. I want part of the code in the function to run parallel at the same time, and some methods to wait for the tasks to finish. It would be a lot of help to me if you also could provide me what I should do to improve my code. A...

1
Q: Snake Game in Java feedback

kaneI started coding in August 2018, and I was wondering on how I can improve as a programmer. I'm more concerned about coding conventions. Particularly, how can I improve the structure of my code, organization, comments, variables, formatting, etc. Any other feedback is welcome and appreciated as we...

0
Q: SPOJ prime1 problem isn't passing successfully

Gaurav KumarI'm new to python and not very decent at programming. Please have a look at my code and provide your feedback. I have handled the boundary cases with a little difficulty. Problem - https://www.spoj.com/problems/PRIME1/ My solution - https://github.com/gutcodes/SPOJrepo/blob/master/test_Prime.py...

 
6:14 PM
0
Q: Code to show whether a word given as input is a palindrome or not

uddhav saikiaI don't know why this piece of code isn't working '''This is ta code to show whether the word given as input is a palindrome or not''' line=input("Enter your word") a=[] b=[] a.append(line) b.append(a.reverse) if a==b: print "This is a palindrome" else: print "this is not a palindrome...

 
6:40 PM
possible answer invalidation by greg on question by greg: codereview.stackexchange.com/posts/215944/revisions
 
7:10 PM
possible answer invalidation by greg on question by greg: codereview.stackexchange.com/posts/215944/revisions
 
8:08 PM
0
Q: given a search string fetch all movies results from the api

advdevWas told this code was 'weird' and didn't pass the coding test. I tried to split up to show the different levels of abstraction but maybe I went overboard? I told them this in the walk through of the code as things like console logging would be something more like save to database or something mo...

 
8:20 PM
possible answer invalidation by Infuzion on question by Infuzion: codereview.stackexchange.com/posts/215904/revisions
If this works, and you're looking to make it more efficient, you should perhaps instead post over at CodeReviewBruceWayne 13 secs ago
I echo the code review recommendation of @BruceWayne . As to your actual question " Is there a better way to do this??" the answer is a very emphatic yes. Your code is extremely inefficient, iterating through hundreds of sheets on a cell-by-cell basis. A well-written version of this code will be at least an order of magnitude quicker — John Coleman 32 secs ago
 
9:25 PM
0
Q: Sample size, P-values (its relationship), and data visualization with plots. ggplot and T test

LuisWe know that P-values (within t-test context as an example..) is highly sensitive to sample size. A larger sample will yield a smaller p-value remaining everything else constant. On the other hand, Cohen´s d effect size remains the same. I'm inspired in this code here, but I´ve changed some pa...

 
 
1 hour later…
11:00 PM
0
Q: Proper separation of behaviour and data structure when the data structure is complex?

Árpád MagosányiThe code in its full glory, complete with unit tests is here: https://github.com/edemo/PDEngine/pull/277/files (And also some discussion of the issue) I am struggling with how the principle of separating data structures and behaviour applies here. This would be the data structure, only with pub...

 
11:20 PM
0
Q: Finding the numerically listed string to the center algorthim

Travis WellsThe algorithm takes input for a string's length for L, and the number of strings altogether for X. The hamming distance is for input D. Input Z calculates the exact amount of all possible characters in the string besides the permutations for input D. We get a set of Z amount of characters. We di...

 
11:48 PM
But anyway, have now done it with the Bitmap implementation from CodeReview. Not yet handling transparency and stride, but otherwise fine - github.com/ststeiger/SimpleBitmap and github.com/ststeiger/cef-pdfStefan Steiger 46 secs ago
 

« first day (2147 days earlier)      last day (1872 days later) »