« first day (3508 days earlier)      last day (510 days later) » 

12:07 AM
REFRESH! There are 7575 unanswered questions (90.0809 answered)
 
12:44 AM
I’m voting to close this question because working code that needs improvement should be on codereview.stackexchange.comJoseph Wood 37 secs ago
 
 
1 hour later…
2:00 AM
0
Q: Splitting a list in Kotlin

Felix DombekI want to split a list (as if splitting a string by a delimiter), ideally in a functional style, and was surprised how hard it seems to be. Or maybe my code is just unnecessarily complicated? fun <ElemType : Comparable<ElemType>> Iterable<ElemType>.split(delim: ElemType): List<List<ElemType>> { ...

 
 
7 hours later…
8:38 AM
0
Q: A stripped-down version of UNIX sort utility

HarisUsage: ./usort <options> <filename> Name: ./usort - sort lines of text. Description: Write sorted concatenation of FILE to standard output. In ...

 
I’m voting to close this question because working code seeking improvement should be posted on the Code Review stack. — Solar Mike 36 secs ago
 
 
2 hours later…
10:18 AM
0
Q: Waking up the threads in order of arrival in c (condition variable)

SBATI am wondering how can i let threads to be woken up in order (like a FIFO ),to let my question to be more clear i made this example (i know it's useless and not like this we should use conditional variables) my code: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <pthread.h> ...

 
 
1 hour later…
11:32 AM
0
Q: Is this elements argument unnecessary?

janoChenI have an elements array that I use in many functions: let elements = [] document.addEventListener('keydown', (event: KeyboardEvent) => { // more code elements = highlight(elements, regExp) elements = removeHighlight(elements) // more code }) function highlight(elements, regExp)...

 
 
1 hour later…
12:45 PM
possible answer invalidation by n0k on question by n0k: codereview.stackexchange.com/posts/281798/revisions
possible answer invalidation by n0k on question by n0k: codereview.stackexchange.com/posts/281798/revisions
possible answer invalidation by n0k on question by n0k: codereview.stackexchange.com/posts/281798/revisions
 
1:29 PM
Don't you just hate it when author deletes a question you just spent three hours writing an answer to? Grr.
 
@Duga Rolled back and edited.
@TobySpeight Which one, that is frustrating.
What IDE do you use for C++ on Linux?
 
I've voted to reopen.
I don't use an IDE - but I do use Emacs to drive just about everything.
 
ahh.
I was always a vi man. IDEs are a little easier.
@TobySpeight describe the environment you used for the wc development. I am running ubuntu 22.04 in VMWare on Windows 10. have some issues
 
Emacs can drive Git and GDB more comfortably for me than either tool individually. And I do like that it parses compiler output so I can jump straight to error locations (and Valgrind warning locations etc) just as I can from grep output. :)
I was on Debian bookworm with GCC 12, I think.
 
I have GCC 11.
How do I get GCC 12?
 
1:36 PM
apt-get install gcc-12
 
Got a problem with the ranges and views.
 
Assuming it's in your distro's repo.
 
It is an LTS version it may not be.
 
Don't forget to set CXX=g++-12 to actually use it, of course.
 
1:38 PM
I'd be surprised if it isn't. Remember Ubuntu LTS releases are no different to point releases, just supported for longer.
 
1:50 PM
@TobySpeight I would. On CR?
If this is about this question, I'd store the answer for now and see if a modified version shows up.
 
2:08 PM
You may have better luck asking your question at codereview.stackexchange.com or softwareengineering.stackexchange.com For this site that's too broad to answer concisely. @bebraed — πάντα ῥεῖ 48 secs ago
 
2:19 PM
@Mast Yes, that one. I now see there's comments about one of the bugs I am pointing out.
 
@TobySpeight OK my compiler problems were due to the different versions of gcc, works with gcc 12 doesn't work with gcc 11.
 
@πάνταῥεῖ, it's not at all suited to Code Review, as it's not yet implemented. Code Review is for finished, working code, which this clearly isn't. — Toby Speight 58 secs ago
 
@pacmaninbw Not surprising, as Ranges is a C++20 feature, and GCC 11 doesn't completely provide C++20 (but GCC 12 does).
 
Thanks!
 
0
Q: Extend iterators with until() function

Richard NeumannI want to extend generic iterators with a convenience function until() that works like an inversion of take_while(). Here is the code: Cargo.toml: [package] name = "until" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manife...

-1
Q: Why filter view is only working properly in debug mode

MasterMindI am trying to design a simple flightbookings management system. While trying to this I walked into an interesting error that I was unable to solve. I tried to reproduce the same error in a much more simplified program and succeeded. In the code below I have a class Num which just represents an ...

0
Q: Hand gestures based virtual trackpad

TheCommentWriterThis program uses webcam to track hand movements / gestures and sends corresponding mouse / keyboard events to the computer. I use it to switch spaces, move active window between desktops, scroll vertically and horizontally and control the cursor. My previous post here had some obvious improvemen...

 
 
2 hours later…
4:05 PM
0
Q: Short Text Pre-processing

Andrea CiufoFor educational purpose I am preprocessing multiple short texts containing the description of the symptoms of cars fault. The text is written by humans and is rich in misspelling, capital letters and other stuff. I wanted to write a short pre-processing function and I have three questions: Why I...

 
4:27 PM
@Mast It's been delete for three hours without any sign of activity. Anyone else willing to cast an undelete vote so I can post my answer? If the author insists on deleting it again, I'll let it go, of course.
I understand that mods can't vote like ordinary users, so not expecting a hammer!
 
0
Q: How to correctly implement a class containing collections of objects?

bebraed#ifndef REGISTRY_REGISTRY_H #define REGISTRY_REGISTRY_H #include <vector> #include "patient.h" #include "doctor.h" #include "appointment.h" class Registry { public: Registry(); ~Registry(); std::vector<std::pair<std::string, Patient>> GetPatients() const; std::vector<std::pair

 
 
1 hour later…
5:38 PM
Monking
 
More suitable for codereview.stackexchange.com as well with zero comments or a description of the algorithm and what it is trying to do there isn't really anything to review. — Brian 13 secs ago
 
0
Q: Smallest distance in a list to the number 0 supplies amount of that number with map

txm03want to create a function absmin which gets a list of floating point numbers and returns the amount of that number which has the smallest distance to 0. We should do it with the function map. My first idea was that the function abs mentioned the problem with amount, but know my question is, how i...

 
6:09 PM
0
Q: function to print any type in Lua?

Thiago LuizI'm learning Lua for about a week now and I've built (I hope) a function to print any type in Lua. As I'm new to Lua I don't quite understand: if there is a more succinct way to achieve this if there is a standard way to print nested tables if there are any cases the function doesn't cover fun...

 
6:23 PM
It seems that your code currently works, and you are looking to improve it. Generally these questions are too opinionated for this site, but you might find better luck at CodeReview.SE. Remember to read their requirements as they are a bit more strict than this site. — gunr2171 53 secs ago
 
7:18 PM
This question seems better suited on Code Review and is off-topic here. — wovano 6 secs ago
 
7:48 PM
0
Q: Is this simple python script to implement a function correct?

mosbahI'm learning python and I have the following prompt. I am trying to implement a function that: 1- is named even 2- takes 2 integer arguments, start and n 3- returns a list of n smallest even integers greater than or equal to start in ascending order Implementation of the function will be tested b...

 
@YSC I suppose the type of feedback I'm looking for would be better directed towards code review. I'm inquiring about alternate approaches. — FamousAv8er 44 secs ago
Should probably post this on codereview.stackexchange.com instead. — HolyBlackCat 43 secs ago
 
8:13 PM
0
Q: Converting String to Binary Hash Tree

FamousAv8erI've written a pretty basic algorithm to convert a string to a binary hash tree of its characters, where each character represents a leaf node. The hash tree itself is being stored in a vector. If the number of leaf nodes is not a power of 2, I'm padding the number leaf nodes with empty substring...

 
@TobySpeight Remind me Monday after 6PM GMT and I'll hammer it if it hasn't been undeleted by OP by then.
 
8:38 PM
0
Q: How to vectorize and speed-up double for-loop for pandas dataframe when doing text similarity scoring

illuminatoI have the following dataframe: d_test = { 'name' : ['South Beach', 'Dog', 'Bird', 'Ant', 'Big Dog', 'Beach', 'Dear', 'Cat'], 'cluster_number' : [1, 2, 3, 3, 2, 1, 4, 2] } df_test = pd.DataFrame(d_test) I want to identify similar names in name column if those names belong to one cluster ...

 
9:02 PM
0
Q: Deserializing JSON data with flexible key and type into structures

pkceI need to parse JSON data that's got a... unique structure. It either looks like this: {"ok": true, "<key>": .... } or this {"ok": false, "error": "reason" } Where <key> and the shape of the data depends on the API call. The following code accomplishes this task, assuming that T derives Deseria...

 
 
2 hours later…
10:40 PM
You are not asking about the solution to a specific programming problem, but are asking for a review of your current solution to a larger problem. That's not on topic for StackOverflow, but it would be for Code Review. — Grismar 12 secs ago
 
11:31 PM
1
Q: SImple Inverted Index

iluvfuguThis is a simple inverted index I made. The goal is to: Read set of text files from a directory, docs Tokenize them Normalize the tokens by removing punctuation and lowercasing them create an index of words to doc name, count of docs that that word appears in Everything works as expected. I'm ...

 

« first day (3508 days earlier)      last day (510 days later) »