« first day (2899 days earlier)      last day (1119 days later) » 

12:01 AM
RELOAD! There are 7500 unanswered questions (89.4783% answered)
 
0
Q: extents_to_array and array_to_extents functions for Boost.MultiArray in C++

JimmyHuThis is a follow-up question for A get_extents helper function for Boost.MultiArray in C++. In order to retrieve, manipulate size information in each dimension from Boost.MultiArray in some better ways. Besides the get_extents helper function, I am attempting to implement extents_to_array and arr...

 
 
1 hour later…
1:23 AM
0
Q: Count characters, words, and lines in files (wc in rust)

Tony JI wrote a barebones version of wc in rust. wc is a program that counts the number of characters, words, and lines in a file and outputs those values to the command line. Here is an example of the output: 9 25 246 Cargo.toml 52 163 1284 src/main.rs 61 188 1530 total My version current...

 
 
2 hours later…
3:29 AM
0
Q: How to collect reference values from hashmap?

prehistoricpenguinI have written a code snippet to use HashMap<String, Vec<&String>> as the main data structure, and finally, I want to return a collected Vec<Vec<String>>, I can archive it by a for-loop, it there any pure iterator way to do this? (I have tried several times, but got tones of confused compiler err...

 
 
1 hour later…
4:45 AM
0
Q: My solution for Advent of Code 2020, Day 4, in C

KleberPFHere is my solution for Advent of Code 2020, Day 4, Part 1 in C. I tried using fscanf or fgets, but couldn't find a nice of doing it, so I ended up using getc. Is there a way of using fscanf or fgets that makes this code better? Also, how does the code look in general? #include <stdio.h> #include <

 
 
1 hour later…
5:59 AM
Monking
 
6:47 AM
There are answers available to this codereview.stackexchange.com/a/237472onkar ruikar 54 secs ago
 
7:10 AM
This question is probably better suited to Code Review. However be sure to take their tour and read their How to Ask page before posting. — Nick 1 min ago
 
7:43 AM
0
Q: huffman archiver in the moder c++ + good architecture

Dima00782I've written my Huffman archiver in modern c++ (at the moment of writing), could you review it, please? this is the main routine: #ifndef ENCODING_HUFFMAN_ENCODING_H_ #define ENCODING_HUFFMAN_ENCODING_H_ #include <cassert> #include <istream> #include <iterator> #include <memory> #include <ostream>...

 
8:34 AM
0
Q: how to map an array of objects with a children array

kappaI am a beginner who just started writing in typescript. I would like to ask how to map an array of objects with a children array efficiently. what I am trying to do is I am trying to map navigation menu item objects to two arrays for a json LD object. I have an array of navigation items as below....

 
 
2 hours later…
10:15 AM
0
Q: Event-driven C++ Web Framework and MVC patterns

jay kI'm writing an Event-driven C++ Web Framework and MVC patterns. Entire code is... here. 1. I would like to receive a review of the entire code. 2. Is this really easy to use? Controllers can be lambda, class method or custom inheritance (from xfwk_target). router /* registers http://127.0.0....

0
Q: Javascript nested objects - return key name for nested object with property == requestedValue

Hobbes CmyObject = { myNestedObject1: { prop1: "a", thingy1: { colour: "yellow" } }, myNestedObject2: { prop1: "c", thingy1: { colour: "red" } } } What I am trying to do: return first key where prop1 has value "a" (in the example above, it's "myNestedObject1"). If nothing found r...

 
10:27 AM
This is off topic for Stackoverflow. for code review please see codereview.stackexchange.comJeremy Thille 48 secs ago
 
10:40 AM
0
Q: How can that arrow code can be fixed into a clean code?

TiZ_Crocodilei'm learning about how to create a good and clean code, and i'm just need to review something like that, and i really not sure how can i fix this code into a clean code. bool isValidUserName(const std::string& username) { bool valid = false; if (username.length() >= MIN_NAME_LENGTH) ...

 
 
1 hour later…
11:41 AM
I’m voting to close this question because it is more well-suited for codereview.stackexchange.comJérôme Richard 54 secs ago
 
11:56 AM
0
Q: Optimizing a Fibonacci function in Python

Amirhosein RezaeeI am trying to calculate the nth number of Fibonacci sequence as efficiently possible in Python, so I tried this: import time import numba as nb from functools import lru_cache @lru_cache(maxsize=None) @nb.jit(parallel=True) def fib(n): a=0 b=1 if n == 0: return a for _ ...

 
Yeah, that's what I did but they rejected it in code review :) lol — TSR 57 secs ago
 
 
2 hours later…
1:38 PM
0
Q: Replace while(true); with std::condition_variable

flaviu2I am trying to replace in an adapted code from internet, a tread pooling class, named ThreadPool: void ThreadPool::Wait() { // we're done waiting once all threads are waiting while (m_threads_waiting != m_threads.size()) { ; } } where m_threads_waiting is defined as: std:...

 
2:02 PM
Reviewing and improving your code is really not the scope of this site. You might try Code Review but I doubt this question as-is is also on-topic there, so please read their guides first — Tomerikoo just now
 
 
2 hours later…
3:45 PM
0
Q: C++ event loop and thread signaling

Federico DevigiliUse case This is an event loop and signaling system I created for a piece of software which will have multiple asynchronous server/clients/event-emitters/ui, some of those components will have their own event loop running on a separate thread, some will just post events in the main thread event l...

0
Q: Stack Exchange Marathon Bot – Part 1: Bot framework &amp; easy commands

AnakhandThis code review is for my Stack Exchange Marathon Bot project, a Telegram bot for playing a dumb little game involving the Stack Exchange network. Since the codebase is not that small, in this post I want to focus on only one aspect, namely the Telegram bot -related code, which uses the python-t...

 
4:10 PM
0
Q: Initialize a gitlab project both locally and remotely with a single command

Najmaoui YassirThis shell script, with only a few configurations, has the goal of initializing a project on Gitlab.com without having to go through the go through the website's ui. This means: Let's say you just a project with a few source files, but you haven't done anything with git yet. The goal of this scri...

 
4:24 PM
Monking
 
4:35 PM
0
Q: BeautifulSoup web crawler

K CI am trying to build a broken link checker based on this How-to: https://dev.to/arvindmehairjan/build-a-web-crawler-to-check-for-broken-links-with-python-beautifulsoup-39mg However, I'm having trouble with the line of code, since when I run the program, I get this error message: File "/Users/Docu...

 
5:17 PM
Are you asking for a code review? that seems to be more appropriate for codereview.stackexchange.com instead. — dreamcrash 34 secs ago
 
5:51 PM
0
Q: Code style: Should prints be high or low level?

kasper.jhaWhere should i put print statements describing the flow of the program? Is there any convetion or code style for this? Should they be in higher level functions? def create_collage(): print('finding images ...') image_paths = get_image_paths() print('loading images ...') images = ...

 
 
1 hour later…
6:51 PM
Given that this is working code and you're looking for improvements (an admirable goal), you may have better luck on Code Review StackExchange, which is a site built for that exact purpose. — Silvio Mayolo 20 secs ago
 
7:31 PM
possible answer invalidation by Peilonrayz on question by TiZ_Crocodile: codereview.stackexchange.com/posts/259352/revisions
possible answer invalidation by Peilonrayz on question by TiZ_Crocodile: codereview.stackexchange.com/posts/259352/revisions
 
8:24 PM
0
Q: Dynamic generic array list implementation in C99

KlemenPlAs an exercise to get to know C a bit more, I decided to implement a dynamic array implementation in C99 with generic support. Everything is implemented with series of macros. The array_list struct definition itself is an anonymous struct, which allows client (user) to have very easy access to it...

0
Q: customer management system for registering customers (in C programming language). Kindly provide feedback as well as corrections to be made

A.R.AThe prompt is: that I should write a program for a customer management system for registering customers (in C programming language). The program should allow registration management members to: Add customer record (id, name, age, gender and city) to the file. Print customer details (ID, name, ag...

 
8:36 PM
possible answer invalidation by Seamus on question by Seamus: codereview.stackexchange.com/posts/259320/revisions
possible answer invalidation by Seamus on question by Seamus: codereview.stackexchange.com/posts/259320/revisions
 
 
1 hour later…
9:51 PM
@Duga Possibly corrected by @Peilonrayz.
 
@pacmaninbw No, not touched any AI stuffs. But I don't think any AI has happened
 
0
Q: Date Detection Regex in Python

jp207I worked on a problem from Automate the Boring Stuff Chapter 7: Write a regular expression that can detect dates in the DD/MM/YYYY format. Assume that the days range from 01 to 31, the months range from 01 to 12, and the years range from 1000 to 2999. Note that if the day or month is a single di...

 
10:42 PM
0
Q: 2021 Community Moderator Election - Nomination Requests

Vogel612In light of the about to be starting nomination phase of the 2021 Community Moderator Election, I want to add this question as a place for the community to nudge candidates on the edge into actually nominating themselves. We had this for the 2015 election and I kind of missed it in the 2018 elect...

 
10:56 PM
0
Q: Singleton handler for reading and writing to configuration.json

riskypenguinIn a current project of I have multiple modules that need to read from and write to a config.json file, where the settings are saved as nested dictionaries. I chose json here, because I want the config file to be human-readable. Simplified example config.json: { "server_data": { "email_address

 
11:21 PM
0
Q: C code to reset all usb devices (because ubuntu laptop disables usb mouse after sleep)

RasheedI don't program much in c, but cobbled together some code from different places in google. I'm sure this is backwards especially in how it works with strings and directory files. Please let me know what the best practices would have been. /* usbresetall -- reset all of the usb devices on bus 001 ...

 

« first day (2899 days earlier)      last day (1119 days later) »