How to store Unix timestamps with MySQL

Some background:My website depends heavily on coordinating users across all kinds of different time zones.I am using Carbon to handle my time zone conversions and calculations on the server sid... | Continue reading


@stackoverflow.com | 2 days ago

Architecturing Airflow DAG that needs contextual throttling

I have a group of job units (workers) that I want to run as a DAGGroup1 has 10 workers and each worker does multiple table extracts from a DB. Note that each worker maps to a single DB instance an... | Continue reading


@stackoverflow.com | 3 days ago

Using a semaphore inside a nested Java 8 parallel stream action may DEADLOCK. Is

Consider the following situation: We are using a Java 8 parallel stream to perform a parallel forEach loop, e.g., IntStream.range(0,20).parallel().forEach(i -> { /* work done here */})The nu... | Continue reading


@stackoverflow.com | 7 days ago

What is logic behind “Broadcast” or “Room” based Websocket for chat room?

What are the techniques or strategies behind the "room" based WebSocket connection or "broadcast" option in WebSocket?Do we store "user's WebSocket connection ID" in a specific list for a room-ba... | Continue reading


@stackoverflow.com | 13 days ago

Android PopupWindow Question

I am working with PopupWindow and attaching the custom view to it but also I want to know the width and height of the content view before attaching it to the PopupWindow because I want to draw some | Continue reading


@stackoverflow.com | 14 days ago

Is C++ context-free or context-sensitive?

I often hear claims that C++ is a context-sensitive language. Take the following example:a b(c);Is this a variable definition or a function declaration? That depends on the meaning of the symbo... | Continue reading


@stackoverflow.com | 15 days ago

How does Facebook disable the browser's integrated Developer Tools?

So apparently because of the recent scams, the developer tools is exploited by people to post spam and even used to "hack" accounts. Facebook has blocked the developer tools, and I can't even use the | Continue reading


@stackoverflow.com | 18 days ago

Is there a smooth path to migrate from Xtext to Racket?

Racket and Xtext are both considered as language workbenches, but they are based on different concepts and workflows.As an experienced Xtext user, I find it difficult to adapt my thought process to | Continue reading


@stackoverflow.com | 19 days ago

How does Chrome decide what to highlight when you double-click Japanese text?

If you double-click English text in Chrome, the whitespace-delimited word you clicked on is highlighted. This is not very surprising. However, the other day I was clicking while reading some text in | Continue reading


@stackoverflow.com | 20 days ago

What is a “callback” in C and how are they implemented?

From the reading that I have done, Core Audio relies heavily on callbacks (and C++, but that's another story). I understand the concept (sort of) of setting up a function that is called by another | Continue reading


@stackoverflow.com | 20 days ago

Do developers use vim to write code (Java) on a Windows OS?

...or is vi/vim only used when developing on a non-Windows OS?If not, what feature(s) does vim provide that modern IDEs such as Eclipse do not? Why would one elect to use vim over Eclipse (or Int... | Continue reading


@stackoverflow.com | 21 days ago

Impossible to avoid the detection of “whether DevTools console is open”

Today I see this postFind out whether Chrome console is open .@zswang gave the way to detect if Chrome DevTools(console) is open. That's really suprise me, then I began to think is there any way... | Continue reading


@stackoverflow.com | 25 days ago

Is Java “pass-by-reference” or “pass-by-value”?

I always thought Java was pass-by-reference.However, I've seen a couple of blog posts (for example, this blog) that claim that it isn't.I don't think I understand the distinction they're making... | Continue reading


@stackoverflow.com | 26 days ago

Why does `True == False is False` evaluate to False in Python? (2013)

I get some rather unexpected behavior on an expression that works with == but not with is:>>> (True == False) is FalseTrue>>> True == (False is False)True>>> True == | Continue reading


@stackoverflow.com | 26 days ago

Need some help with angular and ng-bootstrap

I have started learning angular 9 recently.I have to display a modal with dynamic content. I'm trying to build a generic modal that can show content based on values it receives through a service.... | Continue reading


@stackoverflow.com | 26 days ago

To free or not to free memory (C)

This has been something that has bothered me for ages now.We are all taught in school (at least, I was) that you MUST free every pointer that is allocated. I'm a bit curious, though, about the r... | Continue reading


@stackoverflow.com | 1 month ago

Can we map inches on screen CSS accurately now?

All right. This is an old one, but fun. I know that we have 1in physical unit mapped to 96px on screen dpi. This mapping comes from way back in the 90s when monitors/screens used to be of a much ... | Continue reading


@stackoverflow.com | 1 month ago

Percentages in CSS vertical margin are calculated using the parent's width

If you look at the CSS box model spec, you'll observe the following: The [margin] percentage is calculated with respect to the width of the generated box's containing block. Note that this is tr... | Continue reading


@stackoverflow.com | 1 month ago

Why does rand() repeat numbers far more often on Linux than Mac?

I was implementing a hashmap in C as part of a project I'm working on and using random inserts to test it when I noticed that rand() on Linux seems to repeat numbers far more often than on Mac. RAN... | Continue reading


@stackoverflow.com | 1 month ago

How to make a great R reproducible example

When discussing performance with colleagues, teaching, sending a bug report or searching for guidance on mailing lists and here on Stack Overflow, a reproducible example is often asked and alw... | Continue reading


@stackoverflow.com | 1 month ago

Python Threads don't propagate exceptions

I'm very new to Python and multithreaded programming in general. Basically, I have a script that will copy files to another location. I would like this to be placed in another thread so I can out... | Continue reading


@stackoverflow.com | 1 month ago

Should all sites use SSL by default? The top answer is hell no

We are in the process of moving our web architecture to a new environment. Included are dozens of different sites ranging from almost completely static to dynamic sites requiring authentication and | Continue reading


@stackoverflow.com | 1 month ago

Why is “asdf”.replace(/.*/g, “x”) == “xx”?

I stumbled across a surprising (to me) fact.console.log("asdf".replace(/.*/g, "x"));Why two replacements? It seems any non-empty string without newlines will produce exactly two | Continue reading


@stackoverflow.com | 1 month ago

How to Store Credentials for Authenticating REST APIs

I know, similar questions have been asked many times here or elsewhere. However, I haven't yet found a satisfying answer to my use case/problem.Current SituationI have a web app with a JavaScript | Continue reading


@stackoverflow.com | 1 month ago

Map Inches on Screen CSS?

All right. This is an old one, but fun. I know that we have 1in physical unit mapped to 96px on screen dpi. This mapping comes from way back in the 90s when monitors/screens used to be of a much ... | Continue reading


@stackoverflow.com | 1 month ago

Map Inches on Screen CSS?

Stack Overflow | The World’s Largest Online Community for Developers | Continue reading


@stackoverflow.com | 1 month ago

Algorithm for Simplifying Decimals to Fractions

I tried writing an algorithm to simplify a decimal to a fraction and realized it wasn't too simple. Surprisingly I looked online and all the codes I found where either too long, or wouldn't work in... | Continue reading


@stackoverflow.com | 1 month ago

Your problem with Vim is that you don't grok vi [2011]

I've heard a lot about Vim, both pros and cons.It really seems you should be (as a developer) faster with Vim than with any other editor.I'm using Vim to do some basic stuff and I'm at best 10 ti... | Continue reading


@stackoverflow.com | 1 month ago

Why is this program erroneously rejected by three C++ compilers?

I am having some difficulty compiling a C++ program that I've written.This program is very simple and, to the best of my knowledge, conforms to all the rules set forth in the C++ Standard. I've ... | Continue reading


@stackoverflow.com | 1 month ago

AWS products and services naming nomenclature starting with 'Amazon' vs. 'AWS'

Just curious to understand if there are any logical reasoning behind in naming AWS products and services. For example, it has been named as AWS Lambda and not Amazon Lambda & it is Amazon S3 an... | Continue reading


@stackoverflow.com | 1 month ago

How to solve the “Mastermind” guessing game?

How would you create an algorithm to solve the following puzzle, "Mastermind"?Your opponent has chosen four different colours from a set of six (yellow, blue, green, red, orange, purple). You must | Continue reading


@stackoverflow.com | 1 month ago

How does C compute sin() and other math functions?

I've been poring through .NET disassemblies and the GCC source code, but can't seem to find anywhere the actual implementation of sin() and other math functions... they always seem to be referencing | Continue reading


@stackoverflow.com | 1 month ago

Can AWS S3 optimize images(.WEBP) to save bandwith?

noticing how Youtube and Netflix have announced they will be lowering quality on their streams in order to save bandwith. It got me thinking that a lot of the web also uses images. Then i wondere... | Continue reading


@stackoverflow.com | 1 month ago

Sorting 1M 8-digit numbers in 1 MB of RAM

I have a computer with 1 MB of RAM and no other local storage. I must use it to accept 1 million 8-digit decimal numbers over a TCP connection, sort them, and then send the sorted list out over ano... | Continue reading


@stackoverflow.com | 2 months ago

What Is The “–” Operator in C++

After reading Hidden Features and Dark Corners of C++/STL on comp.lang.c++.moderated, I was completely surprised that the following snippet compiled and worked in both Visual Studio 2008 and G++ 4.... | Continue reading


@stackoverflow.com | 2 months ago

How much data can be stored in a QR code?

I would like to use this script https://github.com/jeromeetienne/jquery-qrcode(or is there even a better solution?)What I like to do is "save" some small scripts or programs and even files like ... | Continue reading


@stackoverflow.com | 2 months ago

What is the smallest possible valid PDF?

Out of simple curiosity, having seen the smallest GIF, what is the smallest possible valid PDF file? | Continue reading


@stackoverflow.com | 2 months ago

6/15 most votes questions are related to Git

Stack Overflow | The World’s Largest Online Community for Developers | Continue reading


@stackoverflow.com | 2 months ago

In Lisp, all programs are data but not all data are programs

I will be forward in admiting that my knowledge of Lisp is extremely minimal. However I am extremely interested in the language and plan to begin seriously learning it in the near future. My | Continue reading


@stackoverflow.com | 2 months ago

This_is_sdparta: An easter egg in FF's WebRTC implementation

When generating offer and answer objects during webRTC signaling in Firefox, Mozilla added a pun about Session Description Protocols by returning answers and offers that say "THIS_IS_SDPARTA."Aside | Continue reading


@stackoverflow.com | 2 months ago

Can XHTML be parsed with Regexps?

I need to match all of these opening tags:<p><a href="foo">But not these:<br /><hr class="foo" />I came up with this and wanted to make sure I've got it right. I a... | Continue reading


@stackoverflow.com | 2 months ago

Is it normmal that I see other redis data on shared hosting

The Redis service is available on my hosting, and if i connect it for money, it is available only for me, since Redis rises in a separate docker container.But, if you turn it off, then Redis can ... | Continue reading


@stackoverflow.com | 2 months ago

Kludge World: Test whether a glob has any matches in bash

If I want to check for the existence of a single file, I can test for it using test -e filename or [ -e filename ].Supposing I have a glob and I want to know whether any files exist whose names m... | Continue reading


@stackoverflow.com | 3 months ago

The Stack Overflow Regular Expressions FAQ

What is this?This is a collection of common Q&A. This is also a Community Wiki, so everyone is invited to participate in maintaining it.Why is this?regex is suffering from give me ze code... | Continue reading


@stackoverflow.com | 3 months ago

NPM Is Down

I have a node.js project, i am trying to install the npm packages using the following command npm installHowever, im getting the following error. npm ERR! code E429 npm ERR! 429 Too Many Reque... | Continue reading


@stackoverflow.com | 3 months ago

How to check if a variable is a string in JavaScript

How can I determine whether a variable is a string or something else in JavaScript? | Continue reading


@stackoverflow.com | 3 months ago

Help with HTaccess file redirecting domains

I have this in my wordpress htaccess... trying to redirect tp https, and from our .ca to .net domain. Not working :(. I am repeating the bottom lines for all of my pages, yet it goes to 401 | Continue reading


@stackoverflow.com | 3 months ago

What Is a “Thread” (Really)?

I have been trying to find a good definition, and get an understanding, of what a thread really is.It seems that I must be missing something obvious, but every time I read about what a thread is,... | Continue reading


@stackoverflow.com | 3 months ago