« first day (2894 days earlier)      last day (1124 days later) » 

12:01 AM
RELOAD! There are 7482 unanswered questions (89.4920% answered)
 
 
4 hours later…
3:43 AM
0
Q: Rock-Paper-Scissors-Lizard-Spock C++ Pogram

TheTempest7I'm writing the C++ program that involves a twist on Rock, Paper, Scissors. How the added Lizard and Spock affect the game is very simple and you could look it up if you want, but its not needed as I'm 99% sure my issue lies with the formatting of my if-else statements. In every iteration, no mat...

 
4:07 AM
Monking
 
 
1 hour later…
5:35 AM
@Vogel612, @MathieuGuindon both of you stepping down as mod thats not what I expected to see after just 3 weeks of vacation. Nevetheless thanks for your great effort to keep things running smoothly!
 
6:08 AM
0
Q: Implement simple Segment Tree in Rust

109149I wanted to learn about segment trees and implemented one for the codeforces - A. Segment Tree for the Sum. But it fails on test 27 (WA). I don't know what's wrong. Problem: Input The first line contains two integers n and m (1≤n,m≤100000), the size of the array and the number of operations. The ...

 
6:23 AM
As such, this might be more suitable for our sibling site Code Reviewtripleee 1 min ago
 
0
Q: C++ UTF-8 decoder

KlemenPlWhile writing simple text rendering I found a lack of utf-8 decoders. Most decoders I found required allocating enough space for decoded string. In worse case that would mean that the decoded string would be four times as large as the original string. I just needed to iterate over characters in a...

0
Q: Avoiding unnecessary if statement?

anupI need to have a better way of handling if else in the following code and reduce the lines of code :- let data = {}; // eslint-disable-next-line no-unused-expressions res.data.response.salary_info && res.data.response.salary_info.length > 0 ? (data = { basicProfile: {...

 
6:57 AM
0
Q: Retrieving first non-private ip for local system in elixir

hjpotter92I've recently started learning elixir, and the following is my attempt at fetching the local IP address of the system. It can definitely be improved further, but as this would be my first ever project in a functional language; I'd be open to any criticisms. defmodule Systemip do def private_ipv...

 
 
1 hour later…
8:33 AM
0
Q: A cloning method for ES-Objects

KooiIncI have written a (recursive) deep clone method for ES/JS-objects. It seems to work fine, but maybe I'm missing things. Please, feel free to comment! const isImmutable = val => val === null || val === undefined || [String, Boolean, Number].find(V => val.constructor === V); const isObject = obj =>...

0
Q: Sorting alphabetically ascending and descending using .sort()

BagseyeI have created this basic use case of .sort() for my own reference. I am asking for a review to see if there are bad practices present or areas that could be optimised. Is my use of modifying the array correct? Do I need to place the newly sorted list into a new array? Using .map() I found it wa...

 
This question is better suited for codereview as you're looking to improve code, not fix it. — evolutionxbox 51 secs ago
 
8:58 AM
0
Q: Writing value in Excel if is not 0

VityataInstead of making this check: if foo <> 0 then wks.cell(1,1) = foo end if I have decided to make a function that looks like this, in order to write foo just once: WriteIfNotZero wks.cells(1,1), foo Any ideas how to improve the function? Currently it is without error handling, as it is handle...

 
9:25 AM
The disclaimer is the indeed important here, because you are definitely doing some suspicious and code review fail things here — TheGeneral 41 secs ago
 
10:10 AM
0
Q: Storing the contents of text fields and inserting the stored values on button-click

Sir Teddy the FirstI've created a little GUI where the text entered in the text-fields is stored in a property of the currently selected button. If a different button is clicked, the contents stored for that button are inserted into the text-fields. For storing the information I'm currently using a class where each...

0
Q: C Macro based OOP

E R BarrattI come from an OOP background, and have recently delved into C and embedded systems. As an exercise I wanted to see if I could wrap some OOP concepts into a macro header. It works as I intended, is fairly simple to use and get a grip on if you know OOP terminology / concepts. Would love any feedb...

 
10:59 AM
1
Q: Check for circular dependencies

Unhandled ExceptionIntroduction Sometimes, especially in more complex class structures, I feel uncertain in some way whether undiscovered circular dependencies might exist. So I thought about how I can easily have their existence checked. The idea behind I came up with the idea of using a central place where I aut...

0
Q: Generate all possible unique combinations of positive numbers these have sum equal to N

Chau GiangThis is my function to generate all possible unique combinations of positive numbers these have sum equal to N. For example: If the input is 4 The output should be: [ '4', '1+3', '1+1+2', '1+1+1+1', '2+2' ] You can try it online here f=n=>{ // n is a positive number if(n==0) return ["0"] ...

 
11:23 AM
0
Q: Better way to find a non present id in a list of custom objects

papluscSo I am throwing an exception in the case that some id from a list of ids is not present en another list of custom objects. This is my approach: lineIds.stream().filter(lineId -> lines.stream().noneMatch((line -> Objects.equals(line.getId(), lineId)))) .findAny() ....

 
11:47 AM
0
Q: Create a cancelable Task background runner class

adospaceMy requirements are: Create a .net 5 class that encapsulates a task runner (i.e. a wrapper around a Task object) The class should be thread-save Consumer of the class should be able to know if the task is running Consumer should be able to start/stop and start again the runner I would love any ...

 
12:03 PM
@AkshayPrassanna - I just meant I hadn't done a thorough code review or anything like that. :-) — T.J. Crowder 29 secs ago
 
@CaptainObvious Interesting question. I haven't voted to close yet, but I think it is MRC.
 
1:03 PM
@Feeds The current suggestions make me think it's turning into a Kobayashi Maru.
 
This doesn't appear to have a single focused question. Since you are asking for general and opinion-based improvement to your working code, I encourage you to post this on Code Review instead. — Shepmaster 46 secs ago
 
1:24 PM
0
Q: Knex query method which conditionally run a whereIn() in the query with .modify() to have a result based on the selection in another table

JakubIn a Knex query (PSQL) method I used .modify() to be able to run a if(...) to conditionally run a whereIn() when the condition is true and present from a request. The method is used to determine a status of a conversation based on messages status. As mandatory we have conversation.idas that is al...

0
Q: Redirecting a user from a contact form webpage to a success webpage

timesharerOn a CentOS Apache-MySQL-PHP environment I have a website with a simple HTML-PHP-CSS contact form; the contact form is working. No JavaScript is used and most likely won't be used, in that form. This is how I redirect a user from the contact form webpage to a success message webpage (I tested the...

 
@Mast As in no-win for CR?
 
Typically Stack Overflow isn't a good place for asking for code reviews. Generally, you should formulate these posts as a question. For instance, if you ran this and had an error, include the error and ask for help. If no error, you can ask for alternative/better ways of doing what you're trying to do. — wxz 8 secs ago
 
1:48 PM
0
Q: Python machine learning ValueError: ' ' is not in list

christianncI'm writing a fairly simple AI chatbot that takes hardcoded inputs and outputs from a JSON file and determines which output to use for a given input. However, I'm getting a ValueError that reads ValueError: 'Greetings' is not in list Greetings is a tag, and is neither an input nor an output. The...

 
@Peilonrayz No win for whoever has to make the decision.
Potential to get ugly quite easily.
Regardless of whether a win is possible, definitely a character test.
Which is what the intention behind it was, I think.
 
2:05 PM
This is incredibly bad code. I would strongly recommend staying clear of it. If you want a code review of this little snippet I can give one - it won't be kind. But that doesn't answer your question, so... — Lundin 1 min ago
 
0
Q: spring batch multiple inputfiles in environment variables

manel ben amaraI need serious help please i'm stuck for 3 days now in same problem i have to code a spring batch program that read multiple csv files and copy their content into an output file. My batch configuration is syntactically correct and i run the app without errors but i don't see items displayed in co...

 
2:24 PM
0
Q: How to make this rust algorithm code cleaner?

prehistoricpenguinI am translating this next permutation algorithm in C++: template<class BidirIt> bool next_permutation(BidirIt first, BidirIt last) { if (first == last) return false; BidirIt i = last; if (first == --i) return false; while (true) { BidirIt i1, i2; i1 = i; ...

 
@Mast Ah thanks
@Feeds Don't think we can VTM to main :/
 
2:40 PM
@Peilonrayz But it really does not belong on Meta.
 
@pacmaninbw Correct. However, I'm going to leave the question a while before VTC / downvoting.
 
@Mast I've looked over the repository this question mentioned. I'm really beginning to dislike the question, and I don't think the poster has a clue about what maintenance programming is like.
 
3:09 PM
You might want to take this to Code Review as I don't see a specific coding problem here... — Tomerikoo 23 secs ago
 
We are not talking about perfection. We are talking about completely wrong information. We are talking about code that wouldn't pass any code review. — jabaa 47 secs ago
 
3:41 PM
Monking
 
4:10 PM
Greetings, Programs.
 
If this works, then it should be on codereview.stackexchange.comNomadMaker just now
 
@CaptainObvious Should the OP post more than just the redirect? e.g. the code that processes the form/POST data?
@SᴀᴍOnᴇᴌᴀ yes, there is more to the script and the script itself processes the POST data. Indeed, the URL within the call is a representor of the actual URL I work with. — timesharer 4 mins ago
 
@Mathieu27 Your post populates and writes a data field array which generally is a fast approach, here I don't see a possible improvement. - As Stack Overflow focusses mainly on a precise coding issue, you might get better help (e.g. regarding a method of html analyzis) at CodeReview by presenting working code to be optimized :-) — T.M. 10 secs ago
 
4:27 PM
@pacmaninbw It's not a great idea to roll-your-own here, that's clear.
 
4:55 PM
@Mast Up vote for the answer there.
 
0
Q: Optimise speed of VBA script execution

Mathieu27I have a VBA script that works well, it allows me to calculate the distance between two cities by specifying the country in question based on this site: http://www.distance2villes.com/recherche?source= I have sometimes more than 8000 distances to calculate, I would like to know if you have any a...

 
 
1 hour later…
6:12 PM
For code review please visit codereview.stackexchange.comMarkus Zeller 8 secs ago
If you are looking to get feedback on running code, try a site like Code Review instead. This really isn't a specific programming question. — MrFlick 42 secs ago
 
@Malachi I couldn't help but think of that user when I saw an advertisement recently for a new TV series Loki
 
6:46 PM
@SᴀᴍOnᴇᴌᴀ LOL, I think that User changed their username recently (ish)
I do to though....LOL
 
@Malachi you change your user name too?
 
think of that user when I hear the name Loki somewhere
 
it appears Loki's name changed sometime after Dec. 15 2017
@Loki Astari: thanks. Most of those tests vectors you point to are already in my test code on the repo. Those that are not are the long ones (millions of bytes). I will add them too, probably under conditional compilation. — nilo Dec 15 '17 at 7:54
 
I might have changed it from the very first time I logged in
 
for a while I made my handle on ICQ Qui-Gon Jinn back in the 90s
 
7:04 PM
LOL Nice!
 
7:52 PM
0
Q: Simple CMD turn-based game made in C

dareesomeIve been learning c for the past few weeks, I made a simple turn-based game to show off what I know. Is there anything I can do to improve the code or make the game run better? int main(){ srand(time(NULL)); bool play = true; while(play){ int choose = -2; int P_h = 2...

 
 
1 hour later…
9:05 PM
0
Q: Show contents in a book chapter and sections in a highly normalized repository

eguneysI want to present books that has chapters and sections, and contents in each book, chapter and section. This is my schema: type BookId = string type ChapterId = string type SectionId = string type ContentId = string type Book = { id: BookId, name: string, } type Chapter = { id: ChapterId,...

 
 
1 hour later…
10:28 PM
I remember hearing it long ago but is it actually true that like 50% of the people can easily learn programming and the others have a much harder time?
If so, does anyone have sources for it?
 
10:42 PM
0
Q: Throttled execution of an enumeration of Tasks

Paul TotzkeExample of use: var users = await usernames.SelectTaskResults(GetUserDetails, 4); where GetUserDetails(string username) is a method that calls HttpClient to access an API and returns a User object. The SelectTaskResults returns the awaited tasks. At most, there will be 4 concurrent threads calli...

0
Q: Best way to refresh a POST Request for third party API

anatp_123I'm using a third party API. I'm able to get data and display it in the frontend but I would like to to refresh the data every 5 minutes. I am not using this to put in live. Is the best way refresh the POST Request is use javascript?: window.location.reload(); c# var client = new RestClient("h...

 
11:30 PM
0
Q: Variable is not assigned a value within a function but assigned outside a function

VizintelI am writing web scraping code and it works well when each line is written in a separate cell but doesn't work when put inside of a function. NameError name 'soup' is not defined with this code: r=requests.get(url) soup=bs4.BeautifulSoup(r.text,"lxml") return soup```` Works fine when...

 

« first day (2894 days earlier)      last day (1124 days later) »