« first day (2167 days earlier)      last day (1833 days later) » 

12:00 AM
RELOAD! There are 5964 unanswered questions (89.8620% answered)
 
used some simple SCSS & HAML loops to solve FizzBuzz in a big dumb animated blob for this week's @CodePen challenge https://codepen.io/cobra_winfrey/full/yrVOwm https://t.co/BRfAcPzptj
This is pretty neat for a
 
12:18 AM
0
Q: Python - Text Adventure

MattthecommieI need help simplifying this python code. I'm new, this adventure game is one of my first projects. I have tried simplifying my code already and this was the best result I could get. import time import random r = random.randrange(10) #r is the weapon being used for gun #pauses the story def pr...

 
 
1 hour later…
1:35 AM
0
Q: Request automation

JohsnSo I created a class to automate some requests for an api, can I improve this code in any way? The code itself is very simple and easy to understand Code: using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Net; using System.Text; using Sys...

0
Q: Does this mortgage calculator adhere to good coding style or is the Listener class too cluttered?

JeremiahDixonNew to Java, just finished the Helsinki MOOC course. I programmed a basic mortgage calculator as my first solo project and while it works, I have a few questions about coding style: 1) The listener and ui classes are cluttered with variables at the top. Is this acceptable or is there a cleaner w...

 
1:54 AM
0
Q: myUTF-8 small lib (validate UTF-8, guess language, count chars)

Accountant مI'm new to C language and never got my self into the details of UTF-8, and after reading some articles about it, I wanted to try and play with UTF-8 with C language for both fun and practicing purposes. This is a little C library that is supposed to validates UTF-8 strings, counts chars, guesses ...

 
2:13 AM
0
Q: `void` function to replace if-else with short circuit expression

thadeuszlayIt's about the "code in question" in the following code: const s = "waterrfetawx"; const del = 2; function palindromePossible(str, deleteAtMost) { const set = new Set(); for (let i = 0, len = str.length; i < len; i++) { const char = str[i]; void(set.delete(char) || set.add(char)); // <...

0
Q: Find duplicate in linear time and space

thadeuszlayThe task: You are given an array of length n + 1 whose elements belong to the set {1, 2, ..., n}. By the pigeonhole principle, there must be a duplicate. Find it in linear time and space. const lst = [1,2,3,4,5,6,7,8,7]; My functional solution: const findDuplicate = lst => { const ...

0
Q: Writing a custom, highly-specialized, special-purpose standard-compliant C++ allocator

Shmuel LevineBrief Preface I recognize that there are many nuances and requirements for a standard-compatible allocator. There are a number of questions here covering a range of topics associated with allocators. I realize that the requirements set out by the standard are critical to ensuring that the allo...

 
 
2 hours later…
3:44 AM
This sounds more like a question for codereview.stackexchange.comderHugo 51 secs ago
 
0
Q: What is the maximum margin that we can use on a website?

user8172330I was wondering if it is right to use a margin of more than 50 px or like below 24 rem to move an element in style sheet? .ls-action { left: auto; right: 0; margin-right: 24 rem; }

 
4:12 AM
0
Q: Parsing version from Cargo.toml

philipjkimI want to get version from Cargo.toml and use the value inside my app. Here is a function I wrote: use std::fs; pub fn get_version() -> &'static str { let text = fs::read_to_string("Cargo.toml").unwrap(); for line in text.split("\n") { if line.starts_with("version") { ...

 
Monking
 
4:41 AM
Yes. It is correct. One more thing. On stackoverflow, people prefer to answer only specific questions and avoid opinion based/code review type of questions. — MayurK 31 secs ago
 
 
1 hour later…
5:48 AM
2
Q: Best way to retrieve music metadata from audio files?

MeganI am using the music metadata-browser npm package to retrieve audio metadata from files. This library is being used in an Electron and React desktop app. To get the metadata of audio files, (and add it to the redux state), I use the following function to get metadata and add the file to redux s...

1
Q: Simple One-Time Pad in Rust

carloabelliI am new to rust and to start learning the language I decided to implement a simple one-time pad encryption program. The part I am least sure about is the reading and writing from the files. Ideally this would run efficiently on large files. use clap::{Arg, App}; use std::{ error::Error, ...

 
6:07 AM
-1
Q: getting elements as input from user and adding the two matrices

sudip narayan Choudhury#getting elements as input from user and adding the two matrices. #B3 and B4 are the rows and columns of the each matrix B3=int(input("Enter the number of rows ")) B4=int(input("Enter the number of columns ")) Row1=[] for i in range(B3): m1=[] ...

 
6:34 AM
@DerKommissar Yea, basically you only simulate modules. Simulating the entire board is not feasible with most boards, although in RF designs it's more common to do at least a specific type of simulation before making a prototype. You really don't want to fry your first prototype of a complex filter, or worse, PSU, by shorting it with the RF coming from the antennae next to it, for example.
So in specific situations there are specific scenario's you should test against.
Afar from that, just simulate the module, prototype the module, put module on board, see what happens.
@all Thanks for the response. I got a plan now, so half the battle has been fought already.
mumbles something about plans and contact with the enemy
 
7:12 AM
Monking.
 
 
1 hour later…
8:21 AM
Monking
 
9:01 AM
0
Q: Return a new array where each element is the number of smaller elements to the right of that element in the original input

thadeuszlayThe task: Given an array of integers, return a new array where each element in the new array is the number of smaller elements to the right of that element in the original input array. For example, given the array [3, 4, 9, 6, 1], return [1, 1, 2, 1, 0], since: There is 1 s...

 
Is that another way of saying its not possible with just excel alone? Im optimistic that it is possible, especially when the gif from my previous comment has demonstrated it. That gif was taken from codereview.stackexchange.com/questions/185212/…Soaring Rioren 43 secs ago
 
9:30 AM
Monking
 
10:10 AM
About question 1, then you should post it on codereview.stackexchange.comCarsten Løvbo Andersen 24 secs ago
 
10:44 AM
Fix whatever level generation algorithm you've written so that it doesn't do that? There's not really anything else we can say, given that you haven't given us any information. If you posted your code on the codereview stackexchange site, maybe they could try and find your problem. — canton7 1 min ago
Is this an answer? If you want to get hints on how to improve your code it would be better to post it on codereview.stackexchange.combarbsan 6 secs ago
 
0
Q: How to make two nested for loops more efficient in pandas

mp252I have two different series in pandas that I have created a nested for loop which checks if the values of the first series is in the other series. But this is time consuming in pandas and I cannot work out how to change it to a pandas method. I thought to use the apply function but it did not wor...

 
11:16 AM
0
Q: PHP - Transforming text content according to rules then persisting to database

oliverbjI have a web application where my users can upload text documents and emails into what I call Streams. A stream is like a "stack", that holds all emails / documents. My users can then add fields to the stream, and field_rules. This means, that every time a new document or email is added, the tex...

 
11:54 AM
0
Q: To find if a character is a delimiter

machine_1I have a function to check if a character is a delimiter and I wonder if it is consistent or can be improved: int chDelimit(int ch) { return (ch == '\n' || ch == '\t') || (ch >= ' ' && ch <= '/') || (ch >= ':' && ch <= '@') || (ch >= '[' && ch <= '`') || ...

 
12:12 PM
I'm voting to close this question as off-topic because if the code is working, it's more fit to code review — Magnetron 9 secs ago
 
12:50 PM
Since the code is working and there are supposedly no problems with it, this is likely the question for codereview.stackexchange.comestus 44 secs ago
Because the WebBrowser IS a solution, back then, I was looking for a way to do it, now I'm asking for a code review — Thryn 35 secs ago
now I'm asking for a code review, But I still get the same result, does not sound like a review, more of an issue you want help with. Also code review is for another place, like code review. — Çöđěxěŕ 58 secs ago
What do you need, help with code that is not working and or a code review? — Çöđěxěŕ 57 secs ago
 
1:40 PM
This would be better off in code review if the code works as is. — TheChubbyPanda 18 secs ago
 
1:50 PM
0
Q: Retry a Promise resolution N times, with a delay between the attempts

ttousI want some JavaScript code to take 3 things as parameters: A function returning a Promise. The maximum number of attempts. The delay between each attempt. What I ended up doing is using a for loop. I did not want to use a recursive function : this way, even if there are 50 attempts the call ...

0
Q: display rent and return bike in Bike Program

NewbieJavaProgrammerYou are contracted to develop a software application to maintain business activities for a bike hire shop “Bike now“. Your application must support such functions as 1. Display all rents 2. Return bike public void displayAllRent() { for(Customer c: customers){ System.out.print(...

 
2:10 PM
0
Q: Regex match comments and quotes

maxpelicI'm working on making syntax highlighting on my blog, and I created a regex to match strings and comments (I'm going to make a callback function to format each differently) Here's my regex: (?>(")(?>[^"]|(?>(?<=\\)"))*")|(?>(')(?>[^']|(?<=\\)')*')|(?>((?>\/\/|#))[^\n\r]*)|(?>(\/\*)(?>.(?!\*\\))...

1
Q: Feedback on Object-Oriented ETL Class Structure for Computing Profit Summary Data

Scott SkilesHow can the structure of the class below be improved? I am using Python3 and pandas 0.24.2 to do some data processing and ETL flows. I have followed this pattern a couple of times and it is really bothering me but I am not sure which direction to go to majorly improve it. Any advice for what to...

 
2:48 PM
0
Q: Avoid a while(continueListening) {} in main thread

ManuelarteI have the following piece of code: public static void main(String[] args) { ... while(condition.continueListening()) { } log.info("Finished"); } The condition object creates its own thread that after one condition is met, make the method continueListening, to return false. Th...

 
3:29 PM
Also didn't know about codereview.stackexchange.com - will post this type of question there next time. Thanks! — JavaScript Joe 8 secs ago
 
Ahoy, mateys!
 
Monkin
 
4:00 PM
posted on April 10, 2019 by CommitStrip

 
This answer has been modified from its original code dump form - what do others think of it now?
Whenever I see that word/name Incomputable the song "Unforgettable" comes to mind :)
 
@CommitStrip So true
 
 
1 hour later…
5:26 PM
Here's a example of how someone else approached your problem codereview.stackexchange.com/questions/191765/…Poket 40 secs ago
This would be best over at code review... — Çöđěxěŕ 36 secs ago
 
6:01 PM
0
Q: Django Restframework: Writable nested serializer with custom behavior

dudenr33Context I am trying to get some practice with Django and Django REST framework. As a toy example I want to set up a server to which I can POST results of automated test runs. In the simplest version, a test result contains the following information: a testcase id, which is unique and will neve...

 
My first comment was just a code review tip. The solution was in my second comment, which is already answered in my third comment. — Emile Bergeron just now
 
6:40 PM
0
Q: place operators in yaml to pass to python

Steven MarksIm currently learning python and have been working on a script that takes config from a yaml file and runs it through various queries and filters. I pull data from an API and then use if statements to filter further what i require for each particular function. What i want to do is have a gene...

 
6:52 PM
 
@CaptainObvious No code.
 
7:19 PM
-1
Q: Receiving multiple inputs through a single scanf that are separated by spaces

NucleusI was assigned a project in which the input consists of 12 numbers that are separated by a space each. I thought that the following line of code would work int a,h; float b,c,d,e,f,g,i,j,k,l; scanf("%d%f%f%f%f%f%f%d%f%f%f%f",&a,&b,&c,&d,&e,&f,&g,&h,&i,&j,&k,&l); However, when apply...

 
8:04 PM
@CaptainObvious broken code!
 
Aye... 'tis borked
 
8:55 PM
0
Q: Pokemon Turn Based battle (Python)

yummylipbalmThis is based off the popular Pokemon Turn Based project (here). I am new to Python and I am trying to use OOP. Did I use my classes properly and is there a way to reduce the number of if statements in my code? Since this is my first code review, how is the formatting, number of comments, etc? ...

 
9:10 PM
As your code works, you’re at the wrong platform. what you need is code review. — Nikolaus 42 secs ago
 
0
Q: FluentValidation/Mediatr: Where do I check if related entity exists?

lcssanchesFirst, sorry if I am doing anything wrong, this is my first post on Code Review. In my current project I am using FluentValidation and mediator pattern using Mediatr. My doubt is where do I put validations that will check for existence (or not) of an entity? For example, I need to create a ne...

0
Q: RXJS and Ionic- Sequencial Subscriptions Waiting on User Action

gv0000In an Ionic App a user can open a new browser via "inAppBrowser". I'm trying to get the stats of the user before they go into to the inAppBrowser, get the stats again when browser closes, and then run a function to compare the before and after. What I have right now is working but I feel like I...

 
you should post code review questions on codereview.stackexchange.comBoris 18 secs ago
 
10:19 PM
I considered it but don't think a custom binder would pass code review. If I could use AutoMapper I would :-) For whatever reason we only have TinyMapper in this project. — nurdyguy 29 secs ago
 
10:33 PM
This might be a good post for codereview.stackexchange.comG. Anderson 49 secs ago
 
11:11 PM
1
Q: Speed up fast poisson disk sampling generator in Python

HadwigI wrote a generator class which implements Fast Poisson Disk Sampling algorithm in Python. I did some optimizations like, x ** 2 -> x * x, using unpacking instead of indexing, move unpacking outside of loops and precalculating of constants (like 2 * pi), but still not very pleased with results. I...

 
11:30 PM
0
Q: How to validate common variables/fields from multiple objects in more generic way?

Krishna KCan someone help me to create a generic method that validates common fields/variables comes from multiple objects, if that is possible? The below code validates some bunch of variables/fields from a schema object, so here the requirement is I have two different schema objects which has common Fi...

 
11:40 PM
possible answer invalidation by Hadwig on question by Hadwig: codereview.stackexchange.com/posts/217231/revisions
 
0
Q: First python program. Tic-Tac-Toe

andrewtwThis is my first program written outside of using books and tutorials. Any help on style and functionality would be helpful. import sys from textwrap import dedent import os import random os.system('CLS') # board number setup board = [0,1,2, 3,4,5, 6,7,8] # Defines the b...

 
@Duga looks like requested profiling code added, per request of renderlein (same user that has the one answer) in comment
 

« first day (2167 days earlier)      last day (1833 days later) »