Posts

"Morning Reader" Chrome extension published

Usually I like to open a set of websites for reading while drinking my morning coffee. To save time, I used an extension that would save presets for each day, and it would open each day's links with one button. However, I recently found that the presets were local to the machine when I switched to my laptop on vacation, which was irritating. So, I put together a basic extension that does the same things, but uses Bootstrap for a nicer looking UI, and uses the Chrome storage API to sync presets across all logged-in Chrome instances. It also allows saving presets to a file and loading again, for a backup and or transfer method. Link:  Morning Reader

Performance: Indexing JSON in SQL Server

Continuing the JSON in SQL Server posts found  here  and  here , a co-worker asked the interesting question "can you index the key values in a small SQL Server text column using JSON?" I didn't know the answer to that, so here we go. Setup The test box remains the same: Core i7 CPU, 16 GB RAM, 1 TB 7200 RPM data disk. SQL Server 2019. The DicomFile table had a new column added, populated from the indexed SQL columns, and a new nonclustered index added. alter table DicomFile add IndexedJson varchar(1000); go update DicomFile  set IndexedJson = concat('{'         , '"SopClassUid": "', SopClassUid, '",'         , '"SopInstanceUid": "', SopInstanceUid, '",'         , '"PatientId": "', PatientId, '",'         , '"StudyInstanceUid": "', StudyInstanceUid, '",'         , '"SeriesInstanceUid": "', SeriesInsta...

Performance: SQL Server vs MongoDB (Reporting)

As a continuation of this performance comparison , I wanted to also compare performance in SQL Server's supposed strong point: reporting on very large relational data sets. Does it truly perform better than MongoDB? Again, this will attempt to be a mostly vanilla comparison, without the different optimizations that can be done in both platforms, for a couple of typical reporting queries. Setup The test box remains the same: Core i7 CPU, 16 GB RAM, 1 TB 7200 RPM data disk. SQL Server 2019, MongoDB 6.0.1. Data was randomly generated using a console app and inserted into both platforms. For SQL Server, I created both a relational table structure, and a columnstore indexed table that is more typically seen in reporting databases. The columnstore table was created as a flat copy of the relational tables, and a SELECT FROM INSERT statement populated the data. MongoDB received the same data, with the Customer and Product data embedded in each document to avoid doing any lookups or joins....

Performance: SQL Server vs MongoDB (JSON data)

Anyone reading the title of this post may immediately start to question my sanity and/or competency. After all, SQL is a relational datastore and MongoDB is a document datastore, and wouldn't it just be obvious that a document datastore would be more effective at storing unstructured JSON documents? I have been learning more about NoSQL databases and that's the common wisdom, but I've been around long enough to doubt any hype over any technology. I want to know: how much better? Do the new JSON features in SQL Server 2019 compare well? I wanted to see how both systems perform when the rubber meets the road. Setup To do the comparisons, I'm using DICOM files as the data. The protocol details are too deep to get into here, but they're used in health care to transfer information and images between systems. They are distinct documents, with information stored in tags and sequences, and readily translate to a JSON format . Here's a full example . Updates are not rea...

Adding Font Awesome to .NET MAUI App

First, download the desktop version of the Font Awesome fonts. https://fontawesome.com/download Extract the .OTF files to the project's Resources/Fonts folder. You can rename the files to something easier to type/read, if desired.  After copying, check the properties on the files and make sure the Build Action = "MauiFont". Open the MauiProgram.cs file and add the new fonts to the app builder. public static class MauiProgram {   public static MauiApp CreateMauiApp() {     var builder = MauiApp.CreateBuilder();     builder       .UseMauiApp<App>()       .ConfigureFonts(fonts => {         fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");         fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");         fonts.AddFont("FontAwesome6Brands.otf", "FontAwesomeBrands");         fonts.AddFont("FontAwesome6Regular.otf", "FontAwesomeR...

Top Fives (Movie Edition)

Apropos of nothing, here's some of my top 5 lists of favorite movies. Some of the lists have more than five because I couldn't narrow them down any farther. Some count more than one movie together because I think they work better as a singular work of art versus a single movie. Purely subjective, and in no particular order. Action 13th Warrior The Bourne Identity Rambo First Blood John Wick Mad Max Fury Road Comedy Game Night Scott Pilgrim vs. the World Bill & Ted's Bogus Journey Monty Python & the Holy Grail Army of Darkness Back to the Future Groundhog Day O Brother, Where Art Thou? Oscar Beerfest Spaceballs Drama Braveheart Twister EDTV Empire Records The Truman Show Family Kung Fu Panda (trilogy) The Muppets Christmas Carol The Goonies Hook Toy Story 1 & 2 Fantasy Lord of the Rings (trilogy) Willow How to Train Your Dragon The Princess Bride The Dark Crystal Horror The Thing Jacob's Ladder The Cabin in the Woods Event Horizon Predator 1 & 2 Mystery T...

Improving a cheap barbell

Image
 My home gym equipment is cheap and second-hand, but it works for me, except for a minor issue with the barbell. It is a cheap hex bolt barbell that I picked up at a garage sale, and although it's straight it wasn't stored properly and there was some rust in between the shaft and the sleeve at the very end. The red area in the diagram below shows where it would stick and keep from rotating properly. I tried disassembling it and cleaning it, which helped a bit but didn't fix the issue. So, with a flash of inspiration I searched and purchased a cheap pair of roller thrust bearings. They were 4 mm thick, with the right inner and outer diameter to fit around the problem area and separate the shaft and sleeve.  They work perfectly, and now the sleeves and weights rotate smoothly.