« first day (2934 days earlier)      last day (31 days later) » 

12:02 AM
RELOAD! There are 7577 unanswered questions (89.4365% answered)
1 hour later…
1:16 AM
Q: Does my passwords generator make sense?

WarlockI'm new to C# and I've just created a passwords generator. I'm not sure if my code is following best practices, etc. The schematic of the program is simple. How many passwords of x length can be created with y characters, that's it. An example, following [a-z0-9], 2 to the power of 36 = 687194767...

2:04 AM
Q: Create a full automation test suite using a mock file

TRUMPIAs part of the hiring process (QA position), I received as a homework assignment (which involves independent study) the following task: Create a full automation test suite (in Python3), so that when our developers finish writing the code, we will all be able to immediately test the code. Note: Th...

This type of question is better suited for Code Review Stack Exchange. — Jeremy Caney 12 secs ago
2:37 AM
possible answer invalidation by Neil on question by Neil: codereview.stackexchange.com/posts/260755/revisions
possible answer invalidation by Neil on question by Neil: codereview.stackexchange.com/posts/260755/revisions
2:53 AM
Q: Calculate max and average of paginated JSON API result

NeoVeI have this JSON: var myJSON = [ { "page": 1, "totalPages": 5, "data": [{ "title": "Movie 1", "rating": 4.7 }, { "title": "Movie 2", "rating": 7.8 }] }, { "page": 2, "totalPages": 5, "data": [{ "title": "Movie 3", "rating": 5.1 }, { "title": "Movie 4",

1 hour later…
4:05 AM
Q: Create a Custom Hooks for Search

Penny LiuI've implemented the logic of the Search Page which getting too long to handle and maintain. Here's what the code looks like: Github link. Thus, I want to turn it into a custom hook in our application. The idea is to create a new folder under components named Hooks then create a new file named Us...

Q: Optimal and Readable Merge Sort Implementation

mastmartelliMy first implementation of merge sort in C++. Looking for any sort of optimization and/or conventional practice tips. Such as, using the appropriate data types and naming my variables informatively. #include <iostream> void print_array(int[], size_t); void merge_sort(int[], size_t, size_t); ...

4:54 AM
Q: Is there a shorter way of declaring a Func (delegate) variable in C#?

user3163495So far I know of two different ways to declare a Func variable using a delegate. Technique 1 var AddTen = new Func<int, int>(delegate (int input) { return input + 10; }); Technique 2 Func<int, int> AddTen = delegate (int input) { return input + 10; }; Is there any shorter way to define ...

5:22 AM
This belongs to Code Review. — buran 58 secs ago
1 hour later…
6:31 AM
Q: Can my excel to excel data copy code with some with data manipulation be more efficient?

Tamal BanerjeeI'm trying to copy data from a worksheet to another worksheet with some modifications made on the fly. Here are the details of the stuff I'm trying to do: Open the file from where I'm going to copy data from (xlsPath) using OpenFileDialog Check the sheet's cell value V6. If it is empty then wri...

1 hour later…
7:43 AM
Hmmm, since you have something that works already, maybe the best place to pose such a question is codereview.stackexchange.comGeorge Menoutis 31 secs ago
8:11 AM
8:56 AM
Q: Complex reporting query suggestion needed for different approach as per latest Tsql format

Aditya SawantWe have recently migrated from SQL Server 2008 R2 to SQL Server 2017 web edition. I am not a SQL developer but enthuses to learn. Since many of our scrips are of old SQL format, I am searching for some alternative to leverage new T-SQL formats to help optimize the codes. Below is one example whic...

9:20 AM
Q: Very unorthodox placement of if-else clauses in C for handling special cases

DannyNiuI've encountered a situation with an if-else clause. Specifically, the positive case has only 1 expression, whereas the negative case is a sequence of statements wrapped in braces. Like this: if( i >= list->count ) *result = 0; else { *result = i * 32 + 31; while( mask >> (*result % 32) )...

10:00 AM
If you have working code then your question is a better fit for Code Review. Either way, your question needs to include the code you have a problem with. — trincot 22 secs ago
2 hours later…
11:46 AM
Q: String lib in C

ekatoI am new at C programming, so I would appreciate it if you could highlight the problems in my code. My biggest concern is wrong memory allocation. There are some code snippets, where I repeat my code. Is there another way to get rid of them? Github repo link. sstream.h #pragma once #include <std...

11:57 AM
1 hour later…
1:19 PM
Q: I wrote a text-based Role-Playing Game with java, how do I make the code elegant?

AlbertJThe Character class is the base class, which is the superclass of Enemy and Hero. Here is part of Character.java, the rest of it are just auto generated setters and getters. public class Character implements java.io.Serializable{ private int maxHp, hp, attack, defense, level; private int ...

1:48 PM
Q: Comma Operator, Arrow Functions and Single Line Auto Returns

RewindI am a self-taught hobby programmer and want to improve. I spent the morning reading as much hints and tips of the trade and have read about functional programming and array functions in javascript. I have never really used array functions before except things like indexOf. This looks fun, so I h...

@CaptainObvious Hypothetical.
Finally got my Peer Pressure badge on CR.
1 hour later…
3:01 PM
Q: Futures in Java

whiteRiceIm begginer in parallelism in Java. I wrote class Executor that set in the constructor Expression (math func that contains N variable , for exmaple : 2N+1 , N^2 +20*N ...) and long value . excute() function : this function iterate over N value and for each value calculate the result of the expres...

@pacmaninbw I thought that answer was uncharacteristically weak for you - should have realised you were going for your PP!
Has anybody else claimed it while holding over 10k rep?
@Peilonrayz I can only see current reputation on that list, not that at the time of the badge, which was what I was asking.
It's not important enough to make a SEDE query for; just idle speculation.
Oh. Yeah I'm guessing SEDE would be the only way to know then :(
3:49 PM
Q: Hackerrank: Fraudulent Activity Notifications

JackI'm having trouble on a question from Hackerrank, this solution works for smaller lists but seems to collapse when the list grows to 200,000 where I get the error "Wrong Solution". The Problem is here so you could reproduce it. Im not sure if there is an error in my code whereby it would fail. Is...

@TobySpeight I've avoided JavaScript for 6 years, I probably shouldn't have answered.
I hate doing web development.
4:23 PM
If this is working code that you think could be improved, see Code Review (but note that the code must be in the question). Otherwise please clarify the question. — jonrsharpe 45 secs ago
4:38 PM
Q: Memoizing component to prevent unnecessary rerender

Penny Liu I've implemented the functionality of the TabBar navigation. I want to apply memoization in our application to prevent re-rendering. To tackle this problem, we can use the useCallback hook to memoize our function or use useMemo hook to memoize any value. How can I refactor my current code snippe...

5:26 PM
Q: Plotting 2 types of data from DataFrame with different colors

Levon AvetisyanThis is the task: import pandas as pd import numpy as np import matplotlib.pyplot as plt plt.style.use('seaborn-whitegrid') # Plot style # Some 'magic' so that the notebook will reload external python modules; # see # http://stackoverflow.com/questions/1907993/autoreload-of-modules-in-ipython %l...

Q: Simple advertisement blocker I did for my school project

karlI want to share and get some feedback on a simple advertisement blocking program I wrote for my school project, named StopADS!. The main idea of this code is to remove advertisements from websites to make the web browsing experience smoother. Pretty close to finishing my 2nd year of programming i...

6:15 PM
Q: checking is ellipse is filled or not

davefollowing code below works fine but feels kind of a mess. any one has a better way to do this I am creating a basic "Enter Pin" to unclick screen on a app. So if user enter 1st digit, than ellipse1 should be filled. and if user enter 2nd digit, than ellipse1 and ellipse2 should be filled. and if ...

6:39 PM
Q: Optimizing nested sql query

JimI have a code, which dynamically creates an SQL query based on the selected tables and columns. One of the sample query, which is generated is as following: SELECT agr.Name, agr.Link, comp1.Name as 'Party 1', cnt1.Name as 'Party 1 Country', comp2.Name as 'Party 2', cnt2.Na...

Q: Converting a vector to BinTree

Bidika3473I'm having problems turning a vector to BinTree given that at any point, the root will be the first element of the vector, the first half(of the remaining vector once you erase the first element) goes to the left side and the second half of the remaining vector goes to the right side. I'm getting...

possible answer invalidation by ProgrammingHandyman on question by ProgrammingHandyman: codereview.stackexchange.com/posts/260758/revisions
2 hours later…
8:34 PM
@CaptainObvious Code not working.
@Duga While code was added it did not invalidate the answer.
9:28 PM
Q: Custom Error Handler Library in C++

Liam JamesIs this code clean and optimized? When taking memory snapshots, it seems a bit high. Anything I have done wrong or can do to optimize it? #pragma once #include <iostream> #include <windows.h> #include <sstream> #include <Psapi.h> // Author: https://github.com/TheRacc2 // Other Help: https://gith...

9:53 PM
Q: Improving readability and efficiency of this custom algorithm

KeithMadisonBackground The code below is an implementation of a 'window-search' algorithm. The algorithm is designed to simulate a real-world instrument, which records data simultaneously across n channels, at some sampling rate s. The data being recorded follows a normal distribution, with an RMS given by t...

I’m voting to close this question because it belongs on codereview.stackexchange.com. — Konrad Rudolph 13 secs ago
10:41 PM
Q: This program asks users to rank an item and validates the rank

Greg# get rank which takes the users rank as an argument and determines # if it is valid input def getRank(x): # make a list of the acceptable choices choices = ['l','m','h'] # convert the users rank to lowercase x = x.lower() # create a while True loop that only runs if x is not...

Q: join function C

Bleffychar* join(char** strings, size_t num_strings, char* seperator) { int cache = 0; int count = 0; for(int i = 0; i < num_strings; i++){ cache += strlen(strings[i]); } char * joined = malloc((cache + num_strings * strlen(seperator) + 1) * sizeof(char)); for(int j = 0; j

11:05 PM
Q: Is there any way to stop the lag in this Gif opener?

David LiuRecently, I made this gif opener using tkinter: import tkinter as tk from tkinter import filedialog as fd import time import threading def getfile(): file = fd.askopenfilename() window = tk.Toplevel() def run_gif(): i = 0 while True: try: ...

For questions asking for improvement and advice on already working code, better ask at SE Code Review please. — πάντα ῥεῖ 43 secs ago

« first day (2934 days earlier)      last day (31 days later) »