« first day (2739 days earlier)      last day (1264 days later) » 

12:00 AM
RELOAD! There are 7087 unanswered questions (89.7323% answered)
 
0
Q: Backtracking for finding a string with minimum cost

NorhtherI'm doing an exercise (not homework) and I decided to go with backtracking, The problem says as follows: You are given as input a target string Starting with an empty string, you add characters to it, until your new string is same as the target. You have two options to add characters to a stri...

 
 
2 hours later…
2:05 AM
0
Q: How to refactor the code below where I need multiple objects with business logic to handle collection of objects?

webgoesviral class Handler def handle(objects) unhandled_objects = Handler1.new(objects).handle unhandled_objects = Handler2.new(objects).handle unhandled_objects = Handler3.new(objects).handle unhandled_objects = Handler4.new(objects).handle unhandled_objects = Handler5.new(objects)...

 
 
3 hours later…
5:03 AM
Monking
 
Just posted over in codereview, thanks! — apreynolds1989 25 secs ago
 
5:21 AM
0
Q: Is this the most efficient use of modules, functions, etc in Python

Chimera.ZenI'm still fairly new to Python and I'm trying to see if I've efficiently used modules, functions, etc or if there's another/easier way to do something. This Python 3 Vigenere Cipher is a rebuild of a JavaScript-based cipher and based in Windows. It accepts any alphabet character, and has demo opt...

 
6:10 AM
0
Q: Substitution Cipher in C

apreynolds1989I was directed here from Stack Overflow. I completed my recent programming assignment for developing a substitution cipher in C. Below is what I came up with after reading many tutorials, googling many questions, watching many videos, etc. but I am happy with the result. I was just wondering if y...

 
If the code works and you just want to make it look nicer, post it on Code Reviewklutt 24 secs ago
I’m voting to close this question because it belongs on Code Reviewklutt 54 secs ago
 
6:30 AM
Yes, I was following the arithmetic and manipulations through, though I haven't digested it all. @klutt is correct though. With working code looking for improvements, you should create an account on CodeReview.StackExchange and move the question there. — David C. Rankin 13 secs ago
 
7:15 AM
If your code is working, this might be a better fit for codereview.stackexchange.com. This kind of questions are off-topic on SO. — Thierry Lathuille 5 secs ago
 
7:38 AM
I’m voting to close this question because it belongs on codereview.stackexchange.com — Peter O. 23 secs ago
In case your code is working and you are asking for a review, you should use codereview.stackexchange.com If you have a problem with the code, tell us what isn't working as you expect. — 4386427 10 secs ago
 
posted on November 02, 2020 by m8tey7

I'm pretty new to C programming and have been stuck on the following question for a while: If a=1, b=2, c=3,….z=26. Given a string, find all possible codes that string can generate. Give a count as well as print the strings. For example: Input: “1135″. You need to general all valid alphabet codes from this string. Output List aace kce ame Here's what I got so far: #include&

 
I’m voting to close this question because it belongs to codereview.stackexchange.comceving 13 secs ago
Code review questions are better over at codereview.stackexchange.com (but be sure to read their help first). — T.J. Crowder 26 secs ago
 
8:13 AM
0
Q: Leetcode longest substring without repeating characters

bullseyeI'm currently learning c++ coming from a python background, so I'll include a solution in python and in c++ for the following problem statement and based on very helpful answers obtained on my previous question I made some improvements in the c++ implementation: Given a string s, find the length...

 
9:02 AM
0
Q: A simple neural network in Fortran

Vladislav GladkikhAfter reading this blog about a simple neural network in Python, I wrote my version in Fortran. The network learns an XOR function. The inputs (X) and outputs (y) are as follows: X | y ------- 0 0 | 0 0 1 | 1 1 0 | 1 1 1 | 0 The network has 2 neurons in the input layer, 5 neurons in the hidden...

 
To the downvoter -- The question might be more appropriate on CodeReview, but it is well-asked, especially for a new contributor. I could see reason for a vote-to-close or migration, but I don't think a downvote is appropriate. — DevSolar 30 secs ago
 
9:19 AM
for code review. But since you're here, maybe you can explain what you wanna do first? — Burning Alcohol 10 secs ago
 
0
Q: Remove Featured image zoom on click - Wordpress

morrettaWhen I click on the featured image, it pops up in full size. This is not good for user experience and want to disable this option. Is it possible to be done in CSS? the following is the image CSS code: .i-amphtml-blurry-placeholder, .i-amphtml-fill-content { display: block; height: 0; ...

 
10:15 AM
0
Q: LeetCode: Insert delete getrandom o1 C#

Giladhttps://leetcode.com/problems/insert-delete-getrandom-o1/ please comment on performance Implement the RandomizedSet class: bool insert(int val) Inserts an item val into the set if not present. Returns true if the item was not present, false otherwise. bool remove(int val) Removes an item val fro...

 
10:39 AM
I’m voting to close this question because it belongs to codereview.stackexchange.com — Yury Tarabanko 56 secs ago
 
11:05 AM
0
Q: Formatting the output with proper paranthesis - Prolog (without using ! and --> )

mkpiskgiven a signature (0,Z,{plus(2),minus(2),times(2)}, constants are integers and functions are plus, minus and times with arity 2 for each. I wanted to write a two predicates arth/2 and printarth/1 which takes terms in the above signature and do the necessary arithmetic calculations addition, subtr...

0
Q: Flask app to return close prices & average

jonnybinthemixI've been working on a little challenge in order to learn more.. I've written the following code, which works. I'm just concerned that there are several areas where my lack of in depth Python knowledge has forced me to 'go the long way around'. I'm really keep to learn more and learn in the corre...

 
possible answer invalidation by bullseye on question by bullseye: codereview.stackexchange.com/posts/251458/revisions
 
11:28 AM
@Duga thats ok
 
11:43 AM
I think this is better suited for codereview.stackexchange.comDani Mesejo 55 secs ago
 
11:54 AM
0
Q: Take postcodes and get the Lat long information from them

user6248190I had an interview task which was the final stage, however, the feedback I got back for my solution was that it lacked effort and structure. I would be grateful to know how my solution could be improved. I used postcode.io to get the latitude and longitude from the post codes. Below is the brief....

 
12:18 PM
0
Q: Stacked bar chart for dynamic row and column

Afzal HossainI am new in coding; using C# and linq for my visual studio project. I have a linq procedure to get a dynamic table with rows (more rows will be added as time passes ) and column (the number of columns will increase as well; to any number E, F, G ...). I am calling the procedure like var dt=obj.st...

 
12:39 PM
@Dani: no. Code Review is for working code, and it focuses on style and efficiency. — usr2564301 6 secs ago
 
1:08 PM
0
Q: File Removal PowerShell Script

Zoran JankovFile Removal PowerShell Script Introduction I have created a File Removal PowerShell Script that can be configured to remove files on various ways. I would like your opinions an suggestion on my scrip so I can improve the script, and to improve my PowerShell skills. I will non post the whole code...

0
Q: Extracting a massively composed widget as a method or as a local variable?

Money Oriented ProgrammerConsider the following trivial example for illustration purpose only. As a method import 'package:flutter/material.dart'; class MyPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('Hello World')), body: b...

 
1:43 PM
@airween it is good in any cases. This code would never pass any code review in any company. — P__J supports women in Poland 55 secs ago
Does your code work? If so, this question is off-topic for StackOverflow. If you are looking for a review of your code, try the code review website. Code looks fine to me though. — GrumpyCrouton 58 secs ago
 
1:57 PM
0
Q: Best practice for Python main function definition and program start/exit

jaaqFirst off, I am aware that best practice questions for hypoteticals are not generally done here, but this one comes up with every Python program I write, so please bear with me here: What is best practice to define a main function for a script/module that may be used started as main, but not alwa...

 
1
Q: Are you allowed to ask for reviews of the same program written in two languages?

Aryan ParekhIn the past few days, I saw 2 questions that were asking for a review of code written for a programming challenge. However, both of them had something strange, I hadn't seen in other questions. The OP was asking for a review of his solution, which was written in two languages. Specifically this ...

 
2:21 PM
0
Q: Any switch/if alternatives when calling some data with value?

vivietapp.js ... const datalist = require('./datalist.js') //retrieve array called category1 let data = datalist('category1'); ... datalist.js const category1 = [ {some data1}, {some data2}, {some data3}, ... ] const category2 = [ {some data1}, {some data2}, {some data3}, ... ] const c...

 
3:10 PM
Monking
 
Ben Popper on November 02, 2020
We explore the traits that have led to the rising popularity of the Go programming language.
 
3:35 PM
0
Q: How to vectorize similars instructions

krifurI sometimes need to execute a lot of similar queries, and I think it could be vectorize like for examples this kind of code : df_A <- df_A %>% group_by(id_ext,ident) %>% summarise_if(is.numeric, funs(sum(., na.rm = T))) %>% ungroup() df_B <- df_B %>% group_by(id_ext,ident) %>% summarise_if(is.num...

0
Q: Is there a way to make this code simplier?

JoshJohnsonProgram description: Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. My s...

 
3:52 PM
Greetings, Proggrams.
 
Greetings
 
1
Q: How do I implement a code analyzing directed graphs that a user inputs?

suggestions342I know how to implement directed graphs, I just don't know how to ask the user to input the desired graph. Any suggestions? Here is the implementation by the way: import java.util.HashMap; import java.util.HashSet; /*The nodes are also referred as vertex and arcs as Directed edges*/ public clas...

0
Q: Passing data from PHP-MySQL to JavaScript Chart with chart.js

Barangay Poblacion BI downloaded and used a JavaScript plugin called "charts.js" and I was able to output the chart in my webpage, here's how I did it in static way, I want to make it dynamic. First I call it, <div class="col-md-6"> <div class="tile"> <h3 class="tile-title">Age Category</h3> <d...

 
4:08 PM
This sounds like a Code Review question. Is there some specific problem you have with your current implementation? Some objective metric you would like to meet with an implementation where yours currently falls short? — TylerH 19 secs ago
 
4:24 PM
0
Q: Microsoft OA | Longest Substring Without 3 Contiguous Occurrences of Letter

hbjORbjFor the following question, does my JS Solution seem correct? Looking for some peer review. Thanks. Q: Given a string s containing only a and b, find longest substring of s such that s does not contain more than two contiguous occurrences of a and b. Ex) "aabbaaaaabb" => "aabbaa" "aabbaabbaabbaa"...

-2
Q: Button is not round with <!DOCTYPE html>, but without it is?

NREIMEROn my website, I have two „round“ buttons. I design these buttons with CSS. Now I added the DOCTYPE tag because I missed it. And the buttons are now not round. I made the round button with: <button class=„bla“> <svg>SVG CONTENT</svg> </button> Full Code with CSS You can enter on the first page s...

 
@CaptainObvious it feels like September again 😏
 
4:36 PM
Monking
 
4:48 PM
@CaptainObvious hiya 🤦
@BCdotWEB The code is working but not correctly! — NREIMER 3 mins ago
 
@SᴀᴍOnᴇᴌᴀ Already voted.
 
If you want a code review: codereview.stackexchange.compzaenger 28 secs ago
 
5:05 PM
@pacmaninbw it is already closed, I was just pointing out that comment...
 
1
Q: Simple multithreading programing in Python to download file from AWS S3

VBJI have written this multithreaded program to download files from AWS S3. Kindly review if it is a correct approach. Code works and downloads the files. But I see an issue occurring sometime (below is the error I see). According to me each file/object from S3 is download independently by one threa...

 
5:30 PM
possible answer invalidation by Marcell Monteiro Cruz on question by Marcell Monteiro Cruz: codereview.stackexchange.com/posts/250623/revisions
 
0
Q: Using multiple goroutines to write to a single tar file

Michael CanadyThis is a script I am working on the use goroutines to write to a single tar file through a channel, I keep getting fatal error: all goroutines are asleep - deadlock! I think it could be that all the goroutines are ending too early or aren't ending properly. package compression import ( "io"...

0
Q: C++17 static templated ini file reader

Romain LaneuvilleI've written a modern C++17 INI file reader to get access parameters values from an INI configuration file anywhere in a source file by simply included #include "Ini.hpp" in the headers. The file parsing is done once at first parameter request with a default file path. The parsing is done with RE...

 
6:27 PM
2
Q: Linked List Queue Implementation

theProgrammerI implemented a Queue using linked list data structure. This is also my first time using templates in C++. OVERVIEW Queue is a data-structure that supports only minimal functionalites such as push, pop, front, back, empty and size. PURPOSE I aim to have a deeper understanding of templates in C++...

1
Q: C# : Can I simplify the generics here

Christian BongiornoI have this class that's meant to represent a binary expression. The immediate improvement I'd like to make is to not have to declare the intermediate type of the operands; when declaring the expression, I'd like only to have to give it an input and an output. But output type of the 2 operands mu...

 
7:16 PM
0
Q: Haskell test performance for different container types

daydaynatationI want to test the performance for various types of containers in Haskell. So far I got Vector and List. My goal is to learn how to use typeclass, how to use containers etc. Could anyone point out suggestions of below code? module Lib where import Data.Array import Data.List...

 
Just had a Zoom job interview 2 coding questions, 1 was FizzBuzz.
 
@pacmaninbw I've reviewed two posts involving interview code this morning
 
7:36 PM
@SᴀᴍOnᴇᴌᴀ I think one of them became HNQ.
 
@pacmaninbw yes - 2 minutes ago
Ilmari's hotness userscript shows it at 57% Hotness
 
0
Q: Is there a better way to send multiple REST requests at the same time (node)

Scotty JamisonBelow is a (very) simplified version of a function I made that creates multiple REST requests to gather needed information. Things to note: One REST call is dependent upon the output of another. I want to send off multiple requests at the same time when possible If any rest request informs us th...

 
If the code works, this is better suited for codereview.stackexchange.comDani Mesejo 29 secs ago
 
@pacmaninbw When I interviewed for my current job it was one embarrassingly easy HackerRank question, then two zoom interviews, one with the manager, one with the manager + one other programmer.
The HackerRank question was "given a log file with this structure" (then went on to describe the IIS log file structure) "pull out the <some field>". Alright...it's the 3rd field, they're all space-separated, seems too easy...
 
8:24 PM
It looks like this is more suitable for Code Reviewburan 55 secs ago
 
@DerKommissar Yeah, I was kind of surprised at FizzBuzz, internally I was going really?
 
1
Q: A Sine Template Function For Boost.MultiArray in C++

JimmyHuThis is a follow-up question for An element_wise_add Function For Boost.MultiArray in C++. Besides the basic add operation applying onto each element, I am trying to implement a sine template function which can apply std::sin() on each element. A new concept with_std_sin is created as below. temp...

0
Q: Unity - Rail Shooter Player Ship Movement Handler

TurkinolithI'm currently learning C# so that I can do some projects with the language. To provide some fun learning I'm also learning the Unity engine at the same time. Currently I'm following a tutorial for making a rail shooter, however the tutorial is a bit dated so I'm taking it as a personal challenge ...

 
8:46 PM
 
@pacmaninbw Are "I want to know if there are any bugs in my code" questions on topic?
 
0
Q: How do you get a variable from one function into another?

Osman Polatit really helped me a lot posting a python question last time, so I would like to try again :-) I'm a total noob and just started to learn python a few weeks ago from a book :-) yesterday I read about "random" and it got me thinking about helping my kid in reading and writing by making a program ...

 
9:19 PM
0
Q: Cleaning datasets in VSCode with pandas() and numpy() [WORKING]

bmjcodingI am working on a portfolio project that deals with creating a Netflix-style recommendation engine for movies. This code is currently ran locally but I will need to upload it into Jupyter Notebooks and implement it with Amazon SageMaker. The .tsv files are imported from IMDb Datasets. The code be...

1
Q: String/text manipulation utility class

Simon NobelI'd like to get some expert's view on this first piece of code especially in the area of performance - (e.g. avoidable copies) good practice (e.g. static members?) The final goal is the provide some abstractions for text manipulation like cleansing, stop-word removal and tokenization. The code ...

 
9:29 PM
@AnnZen Yes, that is a part of what we do here.
 
9:44 PM
0
Q: Generate Unique String Permutations Recursively - Optimization and Complexity

Adam Hurwitz🔎 Objective Write a recursive method for generating all permutations of an input string. Return them as a set. See: Recursive String Permutations - Interview Cake 🖐🏻 Questions 1: How does the problem change if the string can have duplicate characters? The solution below works with duplicate c...

 
9:55 PM
@pacmaninbw some companies seem to use them as a “basic level of competence” test.
 
@DerKommissar Very basic.
But this was a first interview.
 
10:20 PM
@pacmaninbw Thanks!
 
10:33 PM
0
Q: River crossing puzzle app using Pygame

user229550I am making a river crossing puzzle app using Pygame. Did I implement the conditions optimally? The Person class arguments for the conditions as to when or not a person will cross a river are these: hate=[]: If any of the names in the list are the names of any people in boat.aboard, don't cross....

 
10:48 PM
@CaptainObvious I think this was CNWAI, though OP added an "answer" that mentions how the error was corrected...
 
@SᴀᴍOnᴇᴌᴀ Perhaps the OP thinks CR is SO.
 
@pacmaninbw perhaps that is the case for many OPs 😏
 
LOL
@SᴀᴍOnᴇᴌᴀ You're not that far from your gold anymore.
 
I know!
I had considered waiting until winter bash because there is often a special hat for getting a gold badge but I don't have to wait that long
 
I doubt I'll make it by winter bash.
Maybe winter bash 2021.
 
11:22 PM
0
Q: Find junk values in all tables and columns

User1973Find junk values in all tables and columns: Loop through all tables in a schema (Oracle 18c) Loop through each number and text column If columns have values that are junk, then add a statistic/record to a log table: 0 (number) (text; single space) (text; double space) 0 (text) - (text) NUL...

 
11:46 PM
ABMs often run on a grid, say 100x100 - that is you need to update 10,000 cells 100 times, 1000 times... this takes time! If your program is working, I suggest you post a request for help on codereview.stackexchange, this is probably a better place for this sort of questions. — Reblochon Masque 30 secs ago
@ReblochonMasque when suggesting users post on CR it would be great if there was also a suggestion like "Please read the relevant help center pages like 'What topics can I ask about here?' and 'How do I ask a good question?". In the current form the code above would likely be closed as off-topic because it is missing context, which happens all to often. — Sᴀᴍ Onᴇᴌᴀ 58 secs ago
 

« first day (2739 days earlier)      last day (1264 days later) »