SQLite as a no-SQL database

SQLite offers through its JSON1 extension a lot of capability. Generating JSON outputs from SQL, even complex structured, multi-level JSON is very straightforward.

But what about the opposite use case ? When you have store data as JSON in an SQLite database, and you want to search or filter it ? This is a short exploration of what to expect.

(more…)

Boosting Intel laptop battery life

We all need more battery life, and for quad-core i7 & i5, a simple way to gain more battery is to simply turn off extra cores.

This little setting for Windows 10 made a whole world of difference in my experience, with battery life literally doubled on my core i7, and almost 50% gains on another i5 laptop.

Disclaimer: instructions that follow are for advanced users: if you do not understand the instructions, best give up than mess your machine. For all I know, if you misstep, you may end up blowing up a hole in reality and destroy the universe. You’ve been warned.

(more…)

Beware of TForm.SetBounds in a multi-monitor context

When in a multi-monitor context with monitors having varying DPI settings, TForm.SetBounds can be a little ambiguous when combined with form scaling.

The issue comes from Width / Height, in Delphi 10.3.1, they are understood as applying to the monitor the form is currently one, not the monitor SetBounds could be moving the form to. This is manifest when restoring a form position: if you store a form’s bounds, then try to restore it with SetBounds, it will result in an incorrectly sized form.

(more…)

Faster backups for large SQLite databases

sqlite370_bannerDespite having “lite” in its name, SQLite can handle very large databases quite efficiently. The single largest I am currently dealing with just passed 100 GB, and occasionally when backing it up with the SQLite standard Command Line utility it would take many hours.

After some asking on the sqlite-users list (thanks Clemens Madish & Simon Slavin), and some experimenting, I have gotten the backup time down to 4-5 minutes on a live 100 GB database, which is just fine in my book. Below are the findings and an utility, sql3bak, which wraps the results of the findings.

(more…)

Fuzz Testing in Delphi

Monkey-typingI am a big fan of TBCEditor by Lasse Rautiainen, in case you have not heard about it, it is fork of SynEditthat diverged very significantly and includes support for code folding, fully JSON-based syntax highlighters, minimap and many other features.

Of course a code editor is a very complex piece of software, with many opportunities for bugs to hide. I have been helping by providing some Fuzz Testing code and vectors.

(more…)