StackOverflow.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (13 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

Mems Youtube creativ

24 May 2026 @ 5:19 pm

export default function MemeHubLanding() { return ( <div className="min-h-screen bg-black text-white font-sans overflow-hidden"> {/* Background */} <div className="absolute inset-0 bg-gradient-to-br from-purple-900/20 via-black to-cyan-900/20" /> {/* Navbar */} <header className="relative z-10 flex items-center justify-between px-8 py-6 border-b border-white/10 backdrop-blur-sm"> \<h1 className="text-2xl font-bold tracking-widest"\> MEME\<span className="text-cyan-400"\>HUB\</span\> \</h1\> \<nav className="hidden md:flex gap-8 text-sm text-gray-300"\> \<a href="#" className="hover:text-cyan-400 transition"\>Home\</a\> \<a href="#" className="hover:text-cyan-400 transition"\>Trending\</a\> \<a href="#" className="hover:text-cyan-400 transition"\>

PHPMailer fails with very confusing message when the data message is rejected by the SMTP server

24 May 2026 @ 5:19 pm

I just spent a couple of days figuring out a problem with the PHPMailer. My application (a web server) is sending out email via an SMTP server. It worked at first and then started to produce this very mysterious error: Exception::__construct(): Argument #2 ($code) must be of type int, array given It turns out that this is some sort of bug in the mailer software, failing to respond to an error properly. The underlying problem was that my account at the mail service had become blocked. If I had logged into my mail account via its web interface I would have seen what the problem was, but I had just made some changes to the client software, so I assumed that I'd made a mistake and spent a couple of days trying to figure out what was wrong with the client software. PHPMailer has a debug facility. I turned it to its maximum setting, but got no useful information. I upgraded to the current version of PHPMailer which is 7.1.1. The problem persis

Why I write the same as curl but am not getting any response?

24 May 2026 @ 5:05 pm

I am learning how does network work. I am trying to retrieve time from the Bybit exchange. Curl works as expected, but my code in Rust works only with HTTP/1.0, HTTP/1.1 is getting complete silence and HTTP/2 is getting error from cloudfront. I am using native-tls crate for TLS. Curl: curl --trace dump.txt --http1.1 -H 'User-Agent:' -H 'Accept:' https://api.bybit.com/v5/market/time Rust: use native_tls::TlsConnector; use std::io::{Read, Write}; use std::net::TcpStream; const FROM_TRACE: [u8; 53] = [ // Offset 0x00000000 to 0x00000034 0x47, 0x45, 0x54, 0x20, 0x2F, 0x76, 0x35, 0x2F, 0x6D, 0x61, 0x72, 0x6B, 0x65, 0x74, 0x2F, 0x74, 0x69, 0x6D, 0x65, 0x20, 0x48, 0x54, 0x54, 0x50, 0x2F, 0x31, 0x2E, 0x31, 0x0D, 0x0A, 0x48, 0x6F, 0x73, 0x74, 0x3A, 0x20, 0x61, 0x70, 0x69, 0x2E, 0x62, 0x79, 0x62, 0x69, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0x0D, 0x0A, 0x0D, 0x0A ]; fn main()

this is my basic front end, you can use that

24 May 2026 @ 4:46 pm

1. Ordine.java — il model principale public class Ordine { private int id; private int tavoloNumero; private String stato; // "ATTESO", "IN_PREPARAZIONE", "PRONTO", "CONSEGNATO" private String dataOra; private double totale; private List<OrdinePiatto> piatti; // lista delle righe dell'ordine // Getters e setters public int getId() { return id; } public void setId(int id) { this.id = id; } public int getTavoloNumero() { return tavoloNumero; } public void setTavoloNumero(int tavoloNumero) { this.tavoloNumero = tavoloNumero; } public String getStato() { return stato; } public void setStato(String stato) { this.stato = stato; } public double getTotale() { return totale; } public void setTotale(double totale) { this.totale = totale; } public List<OrdinePiatto> getPiatti() { return piatti; } public void s

How to scrape with requests and selenium and how to handle cookies? [closed]

24 May 2026 @ 4:17 pm

I am currently trying to scrape a local website , I have wrote the code for it ,now I just need to make it work. I use the API for the most part but I need selenium for something. def suchen(base_json,headers,cartier): session = requests.Session() session.post("the site url",data=base_json,headers=headers) driver = webdriver.Chrome () driver.get("the site url") data_extractor = WebDriverWait(driver,10).until(EC.presence_of_element_located((By.CSS_SELECTOR,"button#onetrust-accept-btn-handler"))) data_extractor.click() searcher = driver.find_element(By.CLASS_NAME,"home-search-button") searcher.click() for cookie in session.cookies: driver.add_cookie({"name":cookie.name,"value":cookie.value,"path":"/"}) time.sleep(2) input_stuff = driver.find_element(By.CSS_SELECTOR,"input.selected-input") input_stuff.send_keys(cartier) click_it = driver.find_ele

Why not make a new TCP version?

24 May 2026 @ 3:48 pm

I heard TCP is like 50 years old, So why don't we create a new and modern TCP version? Why are we still using a very old protocol?

Function that break the flow of the caller function

24 May 2026 @ 3:10 pm

Is there a way to use a function that works like: #define macro(boolean) if(boolean) return void f(){ macro(2 > 1); } And make it something like: T check(bool boolean){ ... } void f(){ check(2 > 1); } So the f() function returns if the condition in check() is false. I can't find anything that points me in that direction. The check function can be anything, like a call to another function that returns a bool or something that, if it's not the expected result, has to break the flow. Edit: clarify (I hope). Update: the question is because I'm working with legacy code that uses a macro to check values. Not that I like macros.

Debugger are compilers or interpreters?

24 May 2026 @ 12:55 pm

I just started learning C++ from learncpp and came across one of the questions in Stack Overflow about the difference between compilers and interpreters. After reading it I started having a doubt about if the debuggers work as compilers or interpreters. Can anyone explain?

non-blocking I/O from keyboard to get key presses

10 May 2026 @ 4:15 pm

I have been learning about blocking and non-blocking I/O from file descriptors. Basically I want to detect key-presses for a game and want to know the best method for it. The platform is linux, and I have found the following ways: Using ioctl to make the system call non blocking, for example with read. Using select or poll on stdin or /dev/tty and keeping a timeout of say 16ms. I'm doing this as a bare bones project so I am not using any libraries at all, instead it's all on TTY mode and modifying the framebuffer etc. Now in libraries like SDL, pygame I know there is a poll event that you can do to check for keys, but in implementation do they also poll the OS for keys some milliseconds every frame, or is their some other way like detecting inputs on a separate thread.

Algorithm to Count Permutations Without Adjacent Repeating Characters and Find the Inverse

11 September 2024 @ 10:41 am

I would appreciate the help of this great community in finding an algorithm (in any programming language, though I have it in Visual Basic) to solve two related problems: Counting permutations with repetition, where identical characters are not permuted among themselves, but with the restriction that no two identical characters are adjacent. Finding the inverse permutation: given a permutation number, return the corresponding permutation, respecting the same restriction of no adjacent identical characters. For example, given the string: THE STRING WILL HAVE THE SAME QUANTITY OF EACH CHARACTER. "00000000000000000000000000001111111111111111111111111111122222222222222222222222222222222222233333333333333333333333333333333" Whith an algorithm, I would like to: Find the total number of permutations, where no identical characters are adjacent (e.g., no "00", &quo