https://cedardb.com/docs/technology talks about the technical details on how they maximize their usage of available cores and RAM, and their query optimizer.
In an SSD, a write operation can only be done when the page is already erased. However, the unit of read/write operations are a page, while the unit of erase operation is a block. That means for a disk write, a naive implementation needs to read the whole block, erase the block, then write updated data back to the block, which is unacceptable. Furthermore, blocks should wear out uniformly, otherwise, the SSD would lose capacity.
To tackle these problems, SSD introduces Flash Translation Layer (FTL) which helps to build an illusion of random access device. To achieve this, FTL employs an approach very similar to LSM trees. Writes are always written to new, already erased pages, while in the background, garbage collects (GC) outdated data. FTL needs to keep a map from the user’s logical address to physical address on SSD, both in-memory and persistently.
So to answer your question, why are sequential writes are faster than random writes on SSDs? Because the address map table is smaller since new data is consecutive in larger chunks. Garbage Collection is simpler and only metadata needs to be updated. Erasing a block is required anyway.
Hmmmph. I love UNIX but to me symbols are supposed to feel invisible, not be obsessed over. These are like parentheses in LISP. LISP users start seeing trees rather than parenthesis.
What are some use cases where having AHK scripts would help? On the same note, can anyone share some existing list of scripts and their functions which helped make their lives easier?
You can complain about ethics on this one but, for awhile, I was using an AHK script to autoclick through an aggressive "Your trial is over, Buy now please!" style dialog that randomized the position of the exit button for the box. The software would let you continue using it if you clicked through though.
Every ~200ms the script scanned a small portion of the screen where the exit button might appear in and if the script found the button then it would close the dialogue box for me.
This was originally a program I wrote in C for my own use on my ThinkPads some 20 years ago. It turns various keys into mouse movements whenever a mouse button or the Caps Lock key is held down, so you can use the TrackPoint for coarse movement and then seamlessly move the mouse pointer pixel by pixel with the keyboard.
It's a bit like the MouseKeys that is built into Windows for keyboards with numeric pads, but designed for laptop keyboards that don't have that.
When I discovered AutoHotkey, I rewrote JKLmouse using it, and it made it so much better. The code was simpler, and I could make a change and reload the AHK script without having to reboot. I think it is a pretty nice example of some readable and maintainable AHK code.
There is an installer, but I haven't kept it up to date. Instead I recommend installing AutoHotkey directly and getting jklmouse.ahk from GitHub and using it as an AHK script.
Now I have to see about updating the script to work with AutoHotkey V2!
I bind ctrl+space to make the current window stay on top of others. Sometimes it is a commandline or file explorer or notepad that I want to keep visible while I click something else behind it, without rearranging the windows side-by-side.
I like to prefix files with a YYMMDD date, so I made a script to do that when I press a hot key, and also send a text to my wife to bring me a cup of coffee.
Back when I played Minecraft, I wrote one I was pretty pleased with:
If you have a stack of items, you can pick up half of them by right-clicking on it, which is very convenient when you're dividing out a stack on the crafting grid to make many copies of a recipe that needs that item in 2 or 4 slots; but for some recipes, you need to put the same item in 3 or 6 slots, and there's no built-in way to divide a stack into thirds.
So I made an AHK script that, when I held down a key, would
- pick up half of the items in the stack I'm pointing at (right-click)
- move the mouse one inventory space to the right
- put them down (left-click)
- pick up half of them again
- move back one inventory space left
- put them down, adding them back to the original stack
- and repeat
and it would only stop after one of the "pick up" steps; so, after a few iterations, you'd be left with the stack divided into equal thirds, two in your inventory & one on the mouse.
Eg, starting with a stack of 60, it goes 30/30, 45/15, 22/38, 41/19, 20/40, 40/20, 20/40, 40/20... then release the key, and you've got three stacks of 20.
If I remember right: Last time I played Minecraft you took the whole stack of materials and painted (left drag) over the grid where you want the items. It would share up the stack evenly over all the grid items no matter how many you painted. Very easy to make stairs for example. I think there is an even easier way now but haven't played for a couple of versions.
Battlefield 2042 recently had an XP glitch where you could go into a server with BF3 settings, throw ammo to a teammate and get XP for the resupply. Naturally there were several servers dedicated to this with 128/128 players and everyone on one team all standing at one objective.
Rather than actually play the game to level up and get the weapons/gadgets I wanted or even play this accelerated XP mini game, I wrote an ahk script to automate the equipping and dropping of the ammo crate so that I could do other things.
I only had to let it run for a few hours before I was max level, and the 10 minutes of scripting gave me the benefit for something I wouldn’t otherwise subject myself to.
I had to type an incrementing number over an over. I wrote a scrip so that one key would type a variable and then increment it and another key to decrement if I messed up. Saved me a lot of time.
I have a laptop whose keyboard is physically a QWERTY, but I configured to use (the Belgian variant of) AZERTY. There is one physical key missing on QWERTY compared to AZERTY, so there are 3 characters I cannot type normally, and not rare ones: < > \
I created an AHK script that binds other, convenient key combinations to those characters. Now I can type them.
I've used it with video games to convert actions which require you to hold a button (e.g., running, chopping wood) into actions you toggle on or off with a single button press.
I've also used it to quickly enter lots of data into a native application that only supported adding one item at a time.
I've done some scripting for a very annoying enterprisy software in a medical environment. Think "repeat the action for those 100 patients" without spending hours clicking around. It started in AutoIT and migrated to FlaUI, but probably could've started in AHK as well.
Who you using for DNS? Archive don’t like cloudflare and their name servers will often return an invalid reply or an address on the other side of the world.