« first day (2307 days earlier)      last day (1727 days later) » 

12:00 AM
RELOAD! There are 6210 unanswered questions (89.9268% answered)
 
12:15 AM
0
Q: Usage of global variable for dynamic value that must be declared compile time

Michael ChoiI've been trying to make a work-around for global usage; however, I can't seem to find an alternative. I'd like to create a C++ suffix function which converts pixels to millimeters. A custom gui library I've been developing separates OS calls and the actual widget system in two separate headers ...

 
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comSelcuk 13 secs ago
 
12:33 AM
@Vogel612 Thank you!
 
12:55 AM
0
Q: BiasedOptionChooser<T>: a class to do “weighted random choices”

TrauerI need to select "random" elements from a collection. Random is quoted because I must assign a weight to each element; elements with higher weights have a greater chance of being selected. To achieve this, I wrote the classes described below. I'd like to have my code reviewed in order to feel mo...

 
1:34 AM
0
Q: Safe and simple strtol()

Cacahuete FritoUntil today, in the few cases where I needed something like this, it had been in simple programs which only I used, and where I didn't care about security, so I used the simple atoi(). However, today I copy&pasted some of that code for some more serious program, and I researched about the many d...

 
2:13 AM
1
Q: Condition in print statement for `end` argument

jeremy radcliffIs there a better way to do this? Assuming very long lists, is this slow and wasteful? flavors = ['chocolate', 'vanilla', 'caramel', 'strawberry', 'coffee'] for flavor in flavors: print(flavor, end = ', ' if (flavors.index(flavor) != len(flavors) -1) else '.') Output: chocolate, vanilla,...

0
Q: Sass mixins vs Angular layout components

Volodymyr BilyachatFor long time I've been using Angular "Layout" components so their role is basicly to define layout, like padding, margin, fonts and so on. So for instance page header component <my-header>My super page</my-header> So now this component will have scss :host { width: 100%; display: ...

 
printing is really slow. If this works and you just want a performance review, that should be on the code review site. codereview.stackexchange.comKenny Ostrom 13 secs ago
 
3:12 AM
0
Q: Highlight String(s) that Matches a Search Term

Andrew GarrisonI'm writing a ctrl+f function so to speak in React that allows a user to search for a term in a list of words, and if the term matches any of the words in the list then it highlights it. To do this, I'm currently using document.querySelectorAll to retrieve all of the words in the list and manipul...

 
 
2 hours later…
5:40 AM
Once it works, please take your code to codereview.stackexchange.com. There are many bit and pieces that could and should be improved. — Ulrich Eckhardt 54 secs ago
 
5:51 AM
1
Q: Using Parent and Child in PyQt and Python

Chris BI've been searching the internet and cannot find a proper answer as when one should user "Parent" and "Child". I see these two used all over, I have not used them myself in my programs, and now I'm wondering if I have missed something in creating my software. I am wondering why and when should th...

1
Q: Activity Selection to maximize the number of activity executions

AnanthhokageI solved this problem from a challenge.The problem is as below:- Problem Statement: Given N activities with their start and finish times. Select the maximum number of activities that can be performed by a single person, assuming that a person can only work on a single activity at a time. Note ...

 
6:10 AM
0
Q: Validation of Credit card number

rikiI have written the code for credit card number validation and it works correctly but I feel that the code could be reduce to fewer lines. Can somebody help? #include <stdio.h> int main() { long long int no; do { printf("Card number: "); scanf("%lld", &no); ...

 
6:40 AM
@ysth, Shouldn't that have been a comment to the OP? Anyway, there's obviously missing parts to the code (e.g. the lack of exit in the child), but I decided to simply answer the question rather than speculating about the OP's actual code. Similarly, the OP's code obviously needs a code review (e.g. the use statement in the middle of run-time code), but I didn't want to veer off-topic. — ikegami 44 secs ago
 
6:55 AM
possible answer invalidation by Toby Speight on question by swaggg_pickle: codereview.stackexchange.com/posts/226958/revisions
@KennyOstrom I don't think the fact that it's on-topic at code review necessarily makes it off-topic here. — DavidW 47 secs ago
 
 
1 hour later…
8:08 AM
0
Q: C++ Linked List Template Implementation, Howto Default Compare Function, and Split?

David C. RankinTo better learn templates, I have dabbled with a simple linked list implementing the class with a private member compare function (cmp) that is used when adding nodes in sort-order, or when sorting an unsorted list. Here I have simply bitten the bullet and put the entire class implementation in t...

 
8:29 AM
There is no precise question here, I think this should belong to codereview.stackexchange.com instead — Kaddath 49 secs ago
Stop! It's not for code review. Your script is not working? — u_mulder 27 secs ago
 
9:01 AM
This isn't a good fit for stackoverflow. Maybe ask on codereview instead? — freefaller 52 secs ago
Should the sum exclude the current value in x[:,0]? Your example isn't totally clear to me; I think it doesn't agree with the description given above. And a general note: maybe this question is better suited for CodeReview? — MrFuppes 23 secs ago
possible answer invalidation by Javier López Tomás on question by Javier López Tomás: codereview.stackexchange.com/posts/226832/revisions
 
@Duga Should be fine, it's just fixing a typo in the example data provided.
 
9:27 AM
0
Q: Alternative to arbitary amount of (nested) if statements

SomewhereDaveI'm looking for a better design solution to nested if statements. The problems to solve are poor readability, poor extensibility, and repetitive code. Some requirements: There can be an arbitrary/growing amount of cases to check for There can be an arbitrary/growing amount of criteria used f...

 
10:06 AM
0
Q: What is wrong in my Java Time parsing regarding time zones?

usr-local-ΕΨΗΕΛΩΝI am experimenting and trying to understand Java Time better. I have a timestamp string to parse with DateTimeFormatter String text = "2019-08-28T10:39:57+02:00"; DateTimeFormatter ISO_RFC_3339_PARSER = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Europe/Paris")); The above valu...

 
10:22 AM
This question is probably better suited for codereview.stackexchange.comMarkus Deibel 38 secs ago
 
10:45 AM
0
Q: Php mysql database code for live count of users using a local host

JencyHere, the Inserting data pare is not working. I tried all ways to solve. Anyone there to assist me in this case. <?php //input host, username and password $host = "localhost"; $username = "root"; $password = ""; $database = "users";//Name of database $timeoutseconds = 300; //get the Time $tim...

 
11:05 AM
0
Q: Is this implementation of single-threaded fully asynchronous server viable?

CKKI need a fully asynchronous single-threaded server written using .Net Core. Searched for options and, surprisingly, did't find any. So I decided to write a simple prototype. Borrowed idea from python's selectors module. Idea is simple. We have SocketSelector class to whom we register sockets for...

 
11:25 AM
0
Q: Too many for-loops and conditional operators

JonBNot please with this outcome, function works as is, but would love to simplify and prettify it. Use of one for-loop would be great and limit the use of the conditional operator. private void checkForOverage(List<GoogleUsageMapping> records) { Long sumOfAllocatedSize = 0L; Long sumOfLogic...

 
11:58 AM
thank you for the response. How then an adjacency list should look like? (I'm getting reverse information to your response in my review on StackExchange codereview.stackexchange.com/questions/226926/… ) — Undefitied 38 secs ago
 
0
Q: Computational verification of Collatz conjecture using gmplib

DaBlerPrerequisites The unsigned long type has a size of 64 bits. The following macros are defined. /* all 3^n for n < 41 fits into 64-bit unsigned long */ #define LUT_SIZE 41 /* any reasonably high number */ #define LUT_SIZEMPZ 512 The following array is defined and properly initialized with corr...

 
12:23 PM
Thanks for the code review. Can you show me how to fix the comments? — Peter Penzov 35 secs ago
 
0
Q: Reverse Dictionary: Group from child array elements and get its minimum key

ZephyrObjective I have following array and would like to group by each child and get its smallest Id:- var list = new[] { new { Id = 1, Childs = new [] { 'a', 'b' } }, new { Id = 2, Childs = new [] { 'a' } }, new { Id = 3, Childs = new [] { 'a', 'c' } }, new { Id = 4, Childs = new [] ...

 
This question is more suitable for codereview.stackexchange.comSimon 24 secs ago
 
12:54 PM
@Graipher Besides, the only answer is his own.
Which technically shouldn't be an answer, since there's no review in it.
But with self-answers on cross-posted questions, shrug, who gives. OP didn't want a review anyway, they wanted a faster alternative.
 
This may be something better suited for CodeReviewMark S. 47 secs ago
 
0
Q: WooCommerce Email Template: change email header based on payment type

MarieI'm trying to change the email_header text on one of the woocommerce templates based upon the payment type for the order. All the woocommerce methods I've tried result in errors. function ai_filter_woocommerce_email_heading( $order, $email_heading , $email ) { $orderPaymentMethod = $order->paym...

 
as is working code, this is more suited to codereviews SE - but I have a feeling it wouldn't be on-topic there either — treyBake 1 min ago
This seems like a question better suited for CodeReviewMark S. 33 secs ago
For example to hide it from my code reviewer when he checks the "Params" tab for testing purposes. — Jakub Bober 23 secs ago
 
1:23 PM
0
Q: decrease running time of a simple image processing program in python

cutenameRecently, I started reading image processing via opencv library in python. I create a minio object storage and upload some photos into it. after that, I wrote a program which reads every image in each bucket in minio and watermark it with a simple logo. I read each image with imread and finally(...

 
@Mast Didn't even see that, yeah
 
What's your question exactly ? Is your code working ? If yes and you're just looking for improvments, SO is not the right place, you want codereview instead. Else, please explain clearly the issue you're having (cf stackoverflow.com/help/how-to-ask) — bruno desthuilliers 20 secs ago
@deceze Whilst this could indeed make a good question on Code Review, your comment as it stands will attract the wrong attention to our site. In the future, please at least acknowledge that we have a help center that the user should look over before posting their question to our site. This is as half the above question "Can somebody write his version of this program?" is off topic, and the rest of the post is very low quality. Thank you. — Peilonrayz 45 secs ago
 
2:00 PM
The company started out exploiting a loophole in the law banning scooters. The city was mad at first, but then they noticed how much they were saving on street cleaning.
4
 
0
Q: Look for existing pivottables and change date/year colums based off the “Value” filter

Andreas RasmussenWe have a macro that updates all dates/years in all our pivottables (around 100 of them pulling out data from our OLAP cube) based off of a "Master Date" at the top of our sheet (which is being updated monthly). The problem is, that the way we're doing it, takes up a lot of space, and we've been...

 
possible answer invalidation by riki on question by riki: codereview.stackexchange.com/posts/226982/revisions
 
2:35 PM
@RMunroe llol
 
Ask this on code review. — Ravindra Ranwala 21 secs ago
 
2:54 PM
@Mast You feel it’s unclear, someone else feels it’s too broad, someone understands the question and answers it and some one thinks it should be migrated; this is why there is a voting system and not a dictatorship at SO. I feel it should be posted on a site that specializes in review, you feel it doesn’t, that’s fine. — Rasclatt 1 hour ago
@Rasclatt Except if this got migrated, I'd have made sure the migration got rejected. As a regular on CR, I got some experience with that. So you can request to migrate this all you want, in the end, it doesn't even matter. Except another user gets demotivated by not just 1 site, but 2. Let's save everyone the hassle. — Mast 49 secs ago
was this too harsh?
 
possible answer invalidation by VisualMelon on question by Zephyr: codereview.stackexchange.com/posts/227003/revisions
 
Yay
 
Thanks for the info. I didn't know about code review - stack exchange @RavindraRanwala — user10974034 1 min ago
@Rasclatt I recommend you don't argue with Mast over what's on-topic on Code Review. They're one of, if not the most, knowledgeable person when it comes to rules there. If they say it's off-topic it's almost the equivalent of the word of god. — Peilonrayz 1 min ago
@user10974034 If you ask this on Code Review, please read their help center and include the code you want reviewed in the post. Otherwise you'll get downvoted and your question closed in seconds. — Peilonrayz 41 secs ago
 
Kaz
3:10 PM
In other news, the first analyst candidate failed abysmally on the data project.
I'd like to think if they all fail, work will finally acquiesce and let me hire a Junior Analyst. Probably not though, they'll just dump more work on me.
 
After reading code review [help center], it seems my question did not suit their terms. My question is just a suggestion. Can you help this out?? @Peilonrayz — user10974034 58 secs ago
 
0
Q: React - How to refactor code written in the old way when using a new approach?

simhumilecoI was looking for steps on the internet to refactor previous applications for a new approach, but I did not find a satisfactory answer... I know the previous conventions for creating applications in React, but I can see that it is currently different because create-react-app is now generating a ...

0
Q: Implementation of a hash table using safe Rust

hc35I just finished reading the rust book and I am doing lots of little projects to practice and try to get better at writing idiomatic Rust. One of them involves implementing a hash table (I find it's quite a good and interesting exercise when learning a language) to later be used in a simple search...

 
3:30 PM
@Kaz As I like to jab my friend with: it be like that sometimes.
 
0
Q: What would be the better way to write this code in Angular Oninit lifecycle

LearnTodayThis code looks so nasty and childish to me. What better way can I rewrite this: this.blogSub = this.blog$.subscribe(blog => { if(blog === undefined) { this.blogSub1 = this.route.params .pipe(map(params => { const id = (params.title).substring((params.title).lastIn...

 
4:00 PM
0
Q: Allocating and freeing memory inside loop in C

Marcin GadomskiI have an question about how to make temporary string in C, what I mean is I would like to create a string on every iteration step and free the variable after it is not useful anymore. So right now I have something similar to this: for (int i = 0; i < array_size; i++) { //aray1 and array2 ar...

 
Monking
 
possible answer invalidation by DaBler on question by DaBler: codereview.stackexchange.com/posts/227002/revisions
possible answer invalidation by DaBler on question by DaBler: codereview.stackexchange.com/posts/226835/revisions
 
that's ... edits on a question and it's follow-up?
@Duga no invalidation
@Duga rolled back
 
4:20 PM
0
Q: USACO Arithmetic Progressions

MathWizI have the following code: from math import ceil with open('ariprog.in') as fin: ariLen = int(fin.readline().strip()) ariLim = int(fin.readline().strip()) def generate(bound): max_len=((bound**2)*2)+1 parity = [0]*max_len for i in range(bound+1): for j in range(bound+...

 
Is it just my browser, or have all the buttons gone dark?
(I don't like it)
 
possible answer invalidation by JonB on question by JonB: codereview.stackexchange.com/posts/227000/revisions
possible answer invalidation by AlexV on question by cutename: codereview.stackexchange.com/posts/227006/revisions
 
4:39 PM
0
Q: Challenge: MORSE_CODE.PY

Mikey AkamiheConverting words to morse code and vice versa using dictionaries and that's it. Gotta love StackExchange for forcing me to write more words than I need to. morse_code = {'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.', 'F': '..-.', 'G': '--.', 'H': '....', 'I': '..', 'J':...

 
5:10 PM
Greetings, Programs.
 
5:38 PM
-1
Q: Extract column from list of header

user207456I have huge file (more than 80 gb) and i need to extract columns from the list input_data.txt a b c d a1 2 9 6 1 b2 6 4 7 0 c2 3 7 2 0 d2 5 8 2 2 list file a c d ...

 
5:58 PM
-2
Q: Loop Through Tuple In Python3

William DaviesNot Sure If The Name Really Fits The Question, But Lets Say My Tuple Is 3 Elements Long And If I Want To Address Element 5, It Will Address Element 2 as It Has Looped Through The Entire Tuple And Gone Back To The Beginning. tupExample = ('foo','bar') print(tupExample[3]) Output: foo

 
6:18 PM
-1
Q: How do I call function to load USPS data set into python program?

Viktor GlombikIn our machine learning class (which is over now but I am going through the optional assignments again) we were given the following code and the file usps.matwith the following description The data set usps.mat contains handwritten digits from the U.S. Postal Service data set. The data set co...

 
6:35 PM
@Kaz That project you made to test them? They're supposed to fail on that or they aren't juniors.
It's how they failed it that's interesting.
@CaptainObvious If I Can't Understand Your Question How Am I Supposed To Review It? Where's The Code Anyway?
 
6:50 PM
@Duga I rolled it back and left a comment
@Duga its fine - one line removed after start of code fence and function names in description formatted as inline code spans
 
7:17 PM
0
Q: Stack Exchange graph data - helper modules

PeilonrayzBuilding on previous reviews Whilst not an iterative review I have tried to follow the advice provided to some of my older questions: KISS, in some of my previous questions I've over complicated the design. Even though I'm doing quite a lot I've tried to keep everything as simple as possible....

 
The code above works if that's the case, please check out Code Review as this would be best. — Çöđěxěŕ 34 secs ago
 
@dfhwze Did you find out in the end?
 
7:45 PM
@Duga It's calendar days, just as you assumed :)
 
7:56 PM
0
Q: More efficient way to loop over 30 items and make a HTTP request for each

ghanI am using the GitHub API to retrieve repos, but I also need to retrieve the latest commit date which means I have to first retrieve a list of all the repos and use the result to make an additional GET request to get the last commit date. Here is how I am currently doing it. Is there a more effic...

 
8:08 PM
@dfhwze Ah that's good to know :)
 
0
Q: Attempting to make an animated quiz game for The Shining fans

user3113415I'm working on a The Shining based quiz game for my work for Halloween. My current progress is below. https://jsfiddle.net/9h73nqxy/1/ I'm getting pretty stuck, and feel a bit out of my depth. I don't know whether to separate modules into data, UI and main controllers, or to just create a bunc...

 
@CaptainObvious looks a little off-topic...
 
8:29 PM
This is a pure code review question. Please visit codereview.stackexchange.com and ask your question here. — BionicCode 18 secs ago
 
0
Q: Code or maybe Eclipse is not functional

rrtt /**Name:Ruth Russell * DaTe: 8/26/19 * Class:CSMC 350 * Objective: Study of Java Class, GUI program_ String/Int, Tokenizer operation * */ package project1; import java.awt.*; import java.awt.color.*; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.Acti...

0
Q: refactoring nested if statements

bezI'm trying to refactor some code that looks similar to the code below. I feel that there should be a simpler way to do what it does. My main concern is the call to getDataB() in both if and else blocks of the (!dataA.isEmpty()) condition. DataA dataA = getDataA(); if (!dataA.isEmpty()) ...

 
8:55 PM
0
Q: Singular linked list check and assistance

aortaI've been working on writing data structures and methods from scratch (with minimal reference) and I'm looking for assistance on my coding style/if there's any way to optimize the mthods I've included. Below is my singular linked list code, all of its methods, and the output of my tests from mai...

 
9:34 PM
0
Q: Python task runner with asyncio

nz_21I'm trying to a write super simple task runner with asyncio. Basically, my goal is to run 100 requests to google as tasks, like so: from abc import ABC, abstractmethod import asyncio import socket import time import aiohttp import requests class MyScheduler: def __init__(self, wait=2): ...

 
9:54 PM
0
Q: Better way to apply class based on multiple conditions

derrickrozayI am using Angular 8.x. I have a table with two columns that can be sorted. You can only sort one column at a time. I have conditions that display an up and down sort icon if neither column is being sorted, or a up or down sort icon depending on the sort direction. Is there a better way to write ...

0
Q: Is there a recommended way to store data in PyQt?

Péter LeéhI am working on a PyQt project, and I am wondering: is there a better way to store data than how I'm doing now: Currently I store my data in the MainWindow's class variables like this: class mainProgram(QtWidgets.QMainWindow, Ui_Interferometry): var1 = np.array([]) var2 = np.array([]) ...

 
ugh so many close vote queue items :/
 
10:33 PM
0
Q: Python-style Generator in Java

AviI have implemented Python-style generators within Java. I might be reinventing the wheel here, but I feel that the ability to define a Generator with an anonymous class is the most flexible approach. Here's the relevant code: generator/Generator.java public abstract class Generator<T> imple...

 
 
1 hour later…
11:36 PM
Sample code done by a learner Hash table with dynamic sized array in C. — chux 32 secs ago
 

« first day (2307 days earlier)      last day (1727 days later) »