Compute fast log base 2 ceiling

What is a fast way to compute the (long int) ceiling(log_2(i)), where the input and output are 64-bit integers? Solutions for signed or unsigned integers are acceptable. I suspect the best way...

Can sorting Japanese kanji words be done programmatically?

I've recently discovered, to my astonishment (having never really thought about it before), machine-sorting Japanese proper nouns is apparently not possible. I work on an application that must...

How to efficiently de-interleave bits (inverse Morton)

This question: https://stackoverflow.com/questions/3137266/how-to-de-interleave-bits-unmortonizing has a good answer for extracting one of the two halves of a Morton number (just the odd bits),...

Git for Windows: .bashrc or equivalent configuration files for Git Bash shell

I've just installed Git for Windows and am delighted to see that it installs Bash. I want to customise the shell in the same way I can under Linux (e.g. set up aliases like ll for ls -l), but I...

How to localize/rename the "Default" (no group) header in a Winforms ListView?

wondering if anyone can help with a Windows Forms/.net ListView issue (using C# in this case...) We're adding ListViewItems to a ListView. Some of them, by design, don't belong to any group. At...

Python Requests - Post a zip file with multipart/form-data

I'm playing around with the Python Requests module that has so far been a delight. However, I've run into an issue whilst attempting to post a zip file using multipart/form-data. I'm using Digest...

PhpStorm very slow and sluggish on netbook, optimize IDE for responsiveness?

I recently upgraded from PhpStorm 6 to PhpStorm 7. Delighted to see all the improvements, but it runs awfully slow on my low-powered netbook. The delay between typing and seeing text appear is...

Simple and clean way to convert JSON string to Object in Swift

I have been searching for days to convert a fairly simple JSON string to an object type in Swift but with no avail. Here is the code for web service call: func GetAllBusiness() { ...

C# Serving a stream to a browser - can it be done?

I am trying to output a file to the browser from a REST API - but I don't have a physical file, instead I have a MemoryStream (and I would prefer not to write a physical file). This...

Bluetooth Issues Sending AVRCP Volume Changes Using D-Bus (qdbus) Send With org.bluez.MediaTransport1

I am working on emulating a Bluetooth headphone for automated testing using a raspberry pi as my headphone. Part of the challenge I was facing initially was to send AVRCP commands from the PI to...

Proposing an algorithm for arbitrary shape Bit Matrix Transposition with BDD-like structure

We consider a bit matrix (n x m) to be a regular array containing n lines of integers of size m. I have looked in Hacker's Delight and in other sources and the algorithms I found for this were...

Copying Excel ranges to Outlook mail: The method or property is not available because the document is locked for editing

I get an error while copying Excel ranges from the worksheet through the userform and pasting to Outlook. Error 4605 appears stating that the document is locked for editing. I get this error the...

svelte + express (without sapper) - how to send props/communicate with the server?

I am coding a little website to be my homepage. So far I managed to do what I wanted with express and handlebars templates but I am doing this website to test my boundaries, and I lack using a...

MotionLayout - annoying debug error in the log: "no widget for <view id> (<view type>)"

I've been using MotionLayout for a while now, and it's been an absolute delight. But I've been facing a pollution problem I'd like to know how can I get rid of. Basically I'm getting bombarded the...

How to use processing.py in google colaboratory

Recently I've been studying a lot on the processing library (mainly using p5.js) and was delighted to find out that in the processing IDE, there is a python mode, processing.py. I want to try...

TDD + DDD: Model abstractions

I've recently had an interesting experience but didn't find a satisfying answer so far: I'm a big fan of DDD and try to define rich domain objects with behavior and good information hiding, even...

ESP32-CAM how to publish large binary payload to AWS IOT ssl mqtt topic, tested many libs without success :-(

I'm currently working on an ESP32CAM project to publish on AWS IOT topic some captures from the camera in high resolution (UXGA). I've managed to publish some short json payloads with attributes...

google drive URL parameters

I've got some video files on google drive, and I was delighted to find that I can share the video with a URL parameter that looks like (for example...)...

Displaying an image of a ruler with accurate dimensions across multiple iOS devices using SwiftUI

I am searching for a way to define the size of an image in terms of inches or millimeters instead of points or pixels. I want to display an image of a ruler on a white background. Regardless of...

My Google Analytics setup for hugo is not working

I've added my tracking id to my config.toml and everything looks like its matching up. Yet I haven’t seen any realtime data come in when I launch https://analytics.google.com/ theme =...

How do I do AVX vector blending with clang native vector syntax (no intrinsics)?

To my delight, I found that clang will let you write explicit vector code, without resorting to intrinsics, using extended vectors. For instance, this code: typedef float floatx16...

Python/Numpy versus Fortran running times

I have a question concerning Numpy /Python and Fortran running speed. First, to start with, I reprogrammed a running Python program in Fortran. It works fine. But I realized that the Fortran...

Unable to get exact height of WKWebView

I am trying to show a HTML data in WKWeView, But it's showing half content only. I tried to give more space to webView but its still cutting last paragraph. I am unable to scroll below this- My...

Visual Studio 2019 git problem: "Cannot spawn ... ssh.exe: No such file or directory" on fetch/push

Can't get VS2019 to fetch/push to the remote (happens to be on GitLab). What is the correct configuration? I'm using the built-in Windows 10 OpenSSH (C:\Windows\System32\OpenSSH) I've set env...

Why does interning global string values result in less memory used per multiprocessing process?

I have a Python 3.6 data processing task that involves pre-loading a large dict for looking up dates by ID for use in a subsequent step by a pool of sub-processes managed by the multiprocessing...

Android Studio 4.2.1 NullPointer Exception on startup

I wanted to continue working on my app with Android Studio today, but when I want to start Android Studio, I currently get the error that can be seen below every time. I haven't changed anything...

Efficient modulo-255 computation

I am trying to find the most efficient way to compute modulo 255 of an 32-bit unsigned integer. My primary focus is to find an algorithm that works well across x86 and ARM platforms with an eye...

React Context and Storybook: Changing value of a React Context inside a component story

I'm wondering how I would go about changing the value of a React Context (https://reactjs.org/docs/context.html) inside a component story in Storybook. I imagine there is a way to control this via...

Can I use Applescript to import songs from .csv list of song info into iTunes?

Is there a way I can use AppleScript to import songs from my Mac hard drive into iTunes using only a .tsv list containing tag information? (I have too many files in my iTunes collection so not all...

Iterate State Monad and Collect Results in Sequence with Good Performance

I implemented the following function: iterateState :: Int -> (a -> State s a) -> (a -> State s [a]) iterateState 0 f a = return [] iterateState n f a = do b <- f a xs <- iterateState (n -...