MacBook, defective by design banner

title:
Put the knife down and take a green herb, dude.


descrip:

One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com

Using 89% of the same design the blog had in 2001.

FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white.

As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green.

x

MarkUpDown is the best Markdown editor for professionals on Windows 10.

It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support.

Features you won't find anywhere else include...

You've wasted more than $15 of your time looking for a great Markdown editor.

Stop looking. MarkUpDown is the app you're looking for.

Learn more or head over to the 'Store now!

Tuesday, December 03, 2024

Okay, let's write a Chrome extension. I've done this before, but couldn't really remember how, and since "manifest version 3" for Chrome extensions is some sort of big deal that changes all the rules, I might as well start over.

Google does have a "Hello World" tutorial here, but it's important to note that it's what at least this answer at SO calls a popup extension. (It also has some broken links to, eg, its sample extension icon, but you can get it all from the GitHub repo they link to.)

Getting the devtools window up for a popup extension, like the one you create in this "hello, world!" tutorial, is kind of a pain. You seem to have to first invoke your extension to show the popup, then right-click the popup, and finally select Inspect, which isn't super-easy to do. In fact, getting the correct dev tools window open is continually a source of pain for me. Popup needs inspect, an "action-only" background process extension needs it opened from the chrome://extensions page, and a "normal" extension that executes in a tab's context needs the "conventional" dev tools to that tab.

Let's take a closer look.

Create an action-only extension

If you want to simply perform an action (aka, "run a script") when the extension's taskbar button is clicked, you follow this example from Google's docs. Though it's "action only", the info for what to execute ยญdoesn't live in the action object but in the background prop. Again, I'm not really intending this to be thought of as a background task in the traditional sense; I just want something to happen on user-intervention (here, the extension's button on the top of Chrome's, um, chrome is clicked), but, you know, when in Mountain View...

An action-only extension reduces to this:

manifest.json

{
  "manifest_version": 3,
  "name": "Click action",
  "description": "Base Level Extension",
  "version": "1.0",
  "action": {
    "default_icon": "hello_extensions.png"
  },
  "background": {
    "service_worker": "background.js"
  },
}

Then simply add an event listener for the extension's "button" to your background.js file (or whatever file name you inserted for service_worker) like this:

function go(tab) {
    // do stuff. But not like `alert` b/c it's not in a page context.
}

chrome.action.onClicked.addListener(go);

To be clear, that's all you need to have for an extension, those two files, manifest.json and background.js (or, again, whatever name you use in the service_worker value) and maybe an icon, here hello_extensions.png stolen from Google's Hello World tutorial repo, all in a folder loaded via the extensions page with developer mode turned on.

In this case, without a popup, you open devtools by clicking the link within Inspect views service worker on the Extensions page (that is, what's displayed from the chrome://extensions/ pseudo-url), which a little closer to what's described for opening dev tools for "Background Scripts" in the SO question linked above. This is a lot easier (imo) than the popup version. Wish they had devtools available for popups from the extensions page as well.

That said, once you have it up, though there is a "refresh" button for extensions, you can make edits to the javascript file and have it refresh during your next action run (afaict), so you're up and running for a while once the tools are open.


Manipulating the tab

Okay, chances are pretty good that you want to interact with the content of the page. I don't, but let me point you in the right direction. You're going to want to get used to your new friend, chrome.scripting and the "scripting" and "activeTab" permissions.

That might be most easily done by reviewing Google's Page Redder extension sample over here on GitHub.

In brief, the code is this:

service-worker.js

function reddenPage() {
  document.body.style.backgroundColor = 'red';
}

chrome.action.onClicked.addListener((tab) => {
  if (!tab.url.includes('chrome://')) {
    chrome.scripting.executeScript({
      target: { tabId: tab.id },
      function: reddenPage
    });
  }
});

manifest.json

{
  "name": "Page Redder",
  "action": {},
  "manifest_version": 3,
  "version": "0.1",
  "description": "Turns the page red when you click the icon",
  "permissions": ["activeTab", "scripting"],
  "background": {
    "service_worker": "service-worker.js"
  }
}

Now, if you want to access in-scope dev tools, you need to open them as you normally would from that tab with F12.


Allowing the user to select options

The next thing I wanted was to add user-defined options. Interesting that it requires storage permissions. I hadn't initially wanted to add that, since the idea was that fewer permission types means a more easily trusted extension, but if I have to to have options, that frees up all sorts of other stuff, like persistent variables. I would feel badly about doing this, but if Google is going to make me...

(Not that I'd do anything super-nefarious, but maybe I'd store the last time I showed an advertisement page or might store than that've paid a subscription with some sort of key or something. My point is that the possibilities are many, and before I thought I wouldn't allow myself to consider them.)

Anyhow... I'm not showing a full page UI (though that's an option too), so I'd include a new UI file (options.html in this setup) and use this:

Anย embedded optionsย page allows users to adjust extension options without navigating away from the extensions management page inside an embedded box. To declare embedded options, register the HTML file under theย "options_ui"ย field in the extension manifest, with theย "open_in_tab"ย key set toย false.

manifest.json:

{
  "name": "My extension",
  ...
  "options_ui": {
    "page": "options.html",
    "open_in_tab": false
  },
  ...
}

Asking for money

I haven't really given this a good look yet, but I did learn that, unlike Safari on Mac, Google no longer lets you charge for the installation of an extension from their store. There's what appears to be an amazingly well-written howto for building a Stripe-integrated license checker for free at Cloudflare at this blog post, "How to create a paid Chrome browser extension" from earlier this year.

Labels: , ,


posted by Jalindrine at 12/03/2024 10:06:00 AM
Sunday, October 27, 2024

I purchase music outright because I'm old. I often buy from what at least used to be called the iTunes Music Store. The biggest advantage for me for doing so over, say, buying from Amazon or directly from the artist's site (which I often do, or buy from Bandcamp if available), is that Apple Music will stream those songs for me even if I didn't download them locally, so they're accessible any time I have an Apple device (or Windows!) and a network connection.

Well, almost. It doesn't work from my HomePod, you know, the device I spent a few hundred bucks on TO PLAY MUSIC.

All these phrases except maybe one used to work at some point. It used to be I could use the magic phrase "from my library" and get things to work, or say the name of a specific album. No longer!

And "shuffle my library" used to always work even when nothing else did. I'd sometimes get shuffle even when asking for something specific -- and Siri would tell me so before ignoring what I'd really requested ("Now playing your music library shuffled"). That shuffling the full library worked always drove me crazy because it'd tell me the music was there, Siri just wasn't going to play the way I wanted it.

Anyhow, the main course (Warning: this may say "Hey Siri" several times and light up as many Apple devices as you have within listening range):

Transcript:

Me: Hey Siri, play The Warning from my library.

Siri: The Warning Now Playing.

Also Siri: Sorry, there was a problem with Apple Music.

Me: Hey Siri, play Keep Me Fed.

Siri: Now playing Escapism by The Warning.

Me, silently: [Escapism? Isn't that the sixth song on the...]

Also Siri: Sorry, there was a problem with Apple Music.

Me: Hey Siri, play The Rolling Stones.

Siri: Here's The Rolling Stones.

Also Siri: Sorry, there was a problem with Apple Music.

Me: Hey Siri, shuffle songs from my... library.

Siri: Playing all songs, shuffled.

LONG PAUSE

Siri: Sorry, there was a problem with Apple Music.

I think that's a clear QA fail. Shouldn't these be well-established "user stories" by now? If they worked before, someone made it work. Did they do that on their own time or were they asked to? What happened to those tests? Why aren't those scenarios tested any more?

Like, I get it. I'm a dinosaur in a way that hasn't become cool again. I'm reminded of this Twitter ad I saw from the RIAA (boo! hiss!) last week (Oct 23rd):

I AM the 2%! There's are dozens of us...

Still, I think back to that picture of Jobs with the Tiffany lamp and hifi. Today's Apple seems to have completely lost the thread of Steve Jobs' "Thoughts on Music".


It continues. On Apple's HomePod feedback page, the most recent HomePod OS version you can select is 16.5. Mine, after searching the Home app for a while, is apparently on 17.6 and is downloading 18 now. How much money does this company have again?

Labels: , , , ,


posted by ruffin at 10/27/2024 11:55:00 AM
Wednesday, October 23, 2024

From stackoverflow.com:

Taken from MSDN's page on InvalidOperationException: "InvalidOperationException is used in cases when the failure to invoke a method is caused by reasons other than invalid arguments."ย 

โ€“ย STW
ย Commented Apr 21, 2009 at 19:44

I often forget what the "right" exception is to throw when it's not an argument issue -- and linters are getting better at reminding me not to be lazy and to stop using Exception with no subtype. "Code is evidence of the beliefs of its authors" after all.

I suppose InvalidOperationException is as good a fallback as any.

Labels: ,


posted by Jalindrine at 10/23/2024 10:31:00 AM
Tuesday, October 22, 2024

TL;DR -- If you Ikea stiffed you some 101350 fluted dowels, you can buy 5/16" dowels from Home Depot, 50 for under $4.

Depending on the precise usage, however, you may have to cut them down.


One of the funniest things about Ikea is that they're scamming all sorts of bougie yuppies to save Ikea the cost of actually assembling furniture. Don't get me wrong: They're maestros at making it so most anyone who's walked past someone with a handy gene can, with enough desire, get from flatpack to functional in an hour. Still, if you're Ikea, you've got all sorts of schmoes who clock $80+ an hour at their place of employment doing $15 an hour work for you, for free. That's an amazing ability to employ the most widely distributed micro-gig workforce, allowing you to have tons more in your warehouses, save crudloads on shipping, etc etc.

But, you know what, I really enjoy putting them together. There's something about assembling the furniture that's very Lego-like, which might not be too surprising, as the companies' headquarters are a long but doable drive away from each other. Must be in the water.

Setting out space, putting together a minimalist's toolset, and solving a beginner's level brainteaser seems a small price to pay for furniture that... isn't embarrassing. Probably won't get listed by name in your will, but functionally excellent. I've put together a wide swath of Ikea choices over the years, from a kitchen table for six, with a leaf that lets it expand to eight that was so easy to assemble that it should have the Ikea label taken off, to a chest of drawers (and its slimmer sidekick, apparently no longer available) whose drawers really do slide open and closed with a special grace on those Ikea rails, to a loft/desk/closet unit with ladder for a kid that, um, was more complex to assemble.

Anyhow, as one does, I recently got a Tarva queen-sized bedframe, which comes with slats in place of box springs for $149. I've got an extra mattress and space for a bed, so... why not?

Opening it up, I was already impressed. What seemed like a great deal also seemed like $40 of plywood sitting on my bedroom floor. I mean, there's some metal for support rails and the fancy slats, but Ikea has to maintain a decent profit margin. Like it's literally just a bunch of 1"x4"s and 1.5"x1.5"s with nicely predrilled holes.

Not patient enough to stain the pine, which is likely a mistake, I did the usual.

  1. Open box.
  2. Toss aside cardboard packing spacers.
  3. Organize pieces by material.
  4. Open plastic bags of small things.
  5. Separate small things into matching groups.
  6. Scan the page in the instructions depicting the small pieces with the faintest attention. (This will be important later.)
  7. Start following instructions.

Problem: I got to step 7. of the Tarva instructions and noticed I didn't have enough dowels. Like not nearly enough. I didn't notice until I had one side assembled and screwed down, but if I only used one dowel for every two indicated on the second side, I'd make it. So that's what I did, and tightened everything up.

Well, until I got to step 9, where I needed four more. So I gave up, feeling guilty I'd skimped on the headboard anyway, and took that last half of the headboard that only had half the dowels intended back apart.

Options:

  1. Call Ikea and hope they'd mail me some dowels before, well, before too long.
  2. Wait until I'm back near an Ikea, the closest being about 3 1/2 hours' drive away.
  3. Find another dowel source.

So after taking one of the dowels with me to Home Depot, it turns out the 5/16" dowels they carry are right close, and almost exactly the right diameter. Fifty count for under $3.50!! That's got to less trouble than the cost of my time bugging Ikea for freebees.

Took them home, opened them up, and started in. Now they're a little longer than the Ikea part number 101350 dowels, but I'd noticed putting it together that longer might've be better anyhow, because leaving the dowels more than half-way out had let me catch just the end of each, making pushing the side board down and together easier. Or so I thought.

I put them in each missing hole on the middle, inner board and pushed the headboard slats in. No problem! Worked fine! Makes some sense. If you need a couple different sizes of dowel, but one length would be within tolerance and make do for each of those usages, of course Ikea just gives you a ton of the universal fit dowel. Saves them money and makes it easier for you now that you don't have to keep them organized by size. The Home Depot dowels are just over a quarter-inch longer. They work fine on the inside of the slats. That means they likely should work as-is all over!

Oops. That is what we call in the Ikea trade "an insurmountable gap".

So here's the deal: The holes on the inside can take longer dowels, but the holes on the outside can't. The drilled holes aren't deep enough. Two options.

  • Remove all the short dowels from the inside of the slats and replace with longer ones, then use those short ones on the outside.

Downside: I'd still come up three dowels short. For this to really work, you'd need to take the first half of backboard slats back apart.

For some reason I really hate taking things apart that have been put together "right" already.

... orrrrrr ...

  • Cut down some of the longer dowels.

You can guess what I did. First I put aside four Ikea dowels for the step 9 (having discovered that some usages require the regulation-length Ikea dowels, I didn't want to risk it on unknown step 9), I pulled out all the short dowels on the inside of the headboard with my teeth, just like you should when the Home Depot dowels say "Warning: Carcinogen" (hopefully Ikea dowels aren't made of the same stuff?), and went outside to hacksaw three Home Depot dowels down to Ikea 101350 dowel height.

Long story only slightly shorter: It worked! I cut the dowels down to match the stock 101350 length and poof! Didn't even have to whittle down the edges to fit; they went right in. After a bit of lining things up, the pieces went together and tightened up without a fight.

So, again, a trip to Home Depot, $3.50, and only another hour of my time and look! I didn't even have to call Ikea and wait for them to send me the missing dowels! What a bargain. And, once I got done with Tarva step 7 fully doweled, I even went ahead and finished up steps 9, 10, and 12 [sic] before writing this and going to sleep!

Good thing I got those dowels at Home Depot and saved so much time. I'm obviously in a real hurry.

Labels: , ,


posted by ruffin at 10/22/2024 11:46:00 PM
Wednesday, October 09, 2024

From the Nikkor - The Thousand and One Nights Collection's 13th night (ostensibly about the <New> Reflex-Nikkor 500mm F8, which I may have recently purchased on eBay) at Nikon.com:

We used to call Mr. TSUNASHIMA with affinity and respect "Boss, TSUNASHIMA". Certainly, he was a big-brother type person and took thought for younger men. His dynamic manner did not limit to work-related things. Mr. TSUNASHIMA, who would play tennis for years, was a hard drinker equal to Mr. MORI, introduced in Tale Nine. Let me introduce you an episode of "Boss, TSUNASHIMA" at a drinking party.

It was about my freshman's time. At a drinking party on a company trip, several people (hard drinkers) of us were sitting in a circle and drinking sake (Japanese rice wine). Sake bottles were rapidly emptied one after another. The party really came alive and people's laughing voice and cheers echoed. Finally, all the sake bottles were emptied. So, Boss, TSUNASHIMA gave a cry to me, one of organizers, "Hey, SATO! Sake is empty." So I said, "Yes, sir," and brought several bottles of beer. Then, Boss, TSUNASHIMA exclaimed, "Hey, SATO! Is this really sake ?" I replied, "Well ?" Boss, TSUNASHIMA suggested, "Well, this is an alcoholic beverage called BEER, isn't it ?" So I knew that after all, a heavy drinker was different. The scales dropped from my eyes. I realized that I could not join in the party unless understanding their delicate manner and feelings.

That's, um, unexpected.


I've always thought reflex lenses were interesting, but always read about their poor image quality and small aperture, meaning you couldn't take very quick pictures in low light, so I never really gave them a serious thought.

But after buying a used, manual focus 300mm f/4.5 lens years ago and really enjoying using it on my D40, I've been a little less adverse about putting really old lenses on really new cameras.

I've got a few pictures on Wikipedia that I took during NFL games years ago, and kinda missed having my camera with me when I went to a game last week. But the rules have changed, and my old 80-200mm technically shouldn't be allowed in any more, since it's over the new rule of a max length of 5" on detachable lenses.

You can probably see where this is going. How can I get an ultratelephoto lens into an NFL game? Well, you get a 500mm reflex mirror lens that's 109mm long (so 4.3") to a bright arena without much in the way of shadows, and see what you've got.

We'll see how good of a specimen I bought when it arrives, and I'm a little worried about how narrow the depth of field is, but that does seem to go with the wide-open telephoto territory. I think the extra ISO digital allows will more than make up for the loss of one stop of maximum aperture.

Will be fun to give it a shot in any event. Don't know that I'll have much to report about sake or BEER, however, other than my absolute horror at how many $18 cans people around me seem to be downing. Seriously, dropping $50 to buy your best friends a round seems, um, a little steep.

And a little more context on why Mr. Tsunashima factored into what amounts to a blog on the history of Nikon's reflex lenses:

The optical system was designed by Mr. TSUNASHIMA, Teruyoshi of 1st Optical Section, Optical Designing Department (then). Mr. TSUNASHIMA ranked with Mr. MORI, Ikuo, introduced in Tale Nine, and Mr. SHIMIZU, Yoshiyuki, introduced in Tale Five, was one of the designers who built up the golden age of old Nikkor lenses.

He completed optical design of Reflex-Nikkor 500mm f/8 (New) in August 1982 and, later, obtained patent right both in U. S. and Japan.

Waiting until the time was ripe, the lens was on sale in spring of 1984, when trees put out leaves. The specifications of the lens, being light and compact and having amazingly short closest focusing distance of 1.5m, got publicity and accelerated the Reflex-lens boom of those days.

...

In other words, Mr. TSUNASHIMA designed the Reflex-lens in person, struggled to produce it in large quantities, and strictly controlled its quality by himself to put it on sale. Consequently, Mr. TSUNASHIMA participated in the own designed lens up to a stage just before shipment, which was the nearest stage to users.

Labels: , , ,


posted by ruffin at 10/09/2024 09:18:00 PM
Tuesday, October 01, 2024

Okay, I've had this open in drafts too long. I think it's got most of the info I wanted, so let's cut it loose for when I need it in the future.


I often take a different laptop with me when I'm travelling than whatever the "prime" development box is for a project, often to ensure I don't lose sensitive information if the laptop "disappears" while I'm out. When doing this, I usually copy the folder I'm working in, remotes (so personal access tokens, VPN setup, etc) be darned, and work from that.

The issue is often getting that work back onto the "prime" boxen. That usually means remembering how to make and apply git patches.

Look, here's the deal... ;)

If you want to copy over and preserve individual commits, you want to use "email" formatted patches. You can envision why. If you came before the time when everyone had shared remotes or if your workforce is distributed and most simply don't have remote access, it's easy to schlep around code via email. And so git has email support built-int! Though do note we're only using the format, as it carefully preserves each commit separately; we're not actually emailing anything. Unless you really want to.

On the travelling box:

Let's say I wanted the last 5 commits. I'd use this command to create an email-formatted patch file:

git format-patch -k --stdout HEAD~5 > patch.patch

Open up the text file and take a look! It's actually kinda interesting, begging for an SMTP server to send it on its way.

On the "prime" development box:

git am -3 patch.patch

Now look, if you used git apply here, it would apply EVERYTHING IN THE FILE AS A SINGLE ACTION and not commit anything. It's like rolling all the changes into a single worksession that needs to be committed. Using git apply for an email versioned patch reduces to the same operation as creating a diff with git diff and git applying it.

We DON'T want that. You have to use git am to get the email action going.

The -3 is for three-way merge if there's a conflict git can't resolve, and is the way I (and several other StackOverflow users, apparently) best prefer to manage conflicting patch applications. But you really shouldn't run into that much if you just worked on an existing branch.

Do make sure you're on the right branches on both boxes.


TODO: How do you get the patch to include staged files?

Labels: ,


posted by Jalindrine at 10/01/2024 11:21:00 AM
Friday, August 23, 2024

Okay, look, if there's one thing I'm tired of, it's half-baked example code that doesn't anticipate changes needed to push it into production.

Like the good ole WeatherForecastController from the .NET Core WebAPI template.

using Microsoft.AspNetCore.Mvc;

namespace MyApp .Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class WeatherForecastController : ControllerBase
    {
        private static readonly string[] Summaries = new[]
        {
            "Freezing", "Bracing", "Chilly", "Cool", "Mild", 
            "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
        };

        private readonly ILogger<WeatherForecastController> _logger;

        public WeatherForecastController(ILogger<WeatherForecastController> logger)
        {
            _logger = logger;
        }

        [HttpGet(Name = "GetWeatherForecast")]
        public IEnumerable<WeatherForecast> Get()
        {
            return Enumerable.Range(1, 5).Select(index => new WeatherForecast
            {
                Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
                TemperatureC = Random.Shared.Next(-20, 55),
                Summary = Summaries[Random.Shared.Next(Summaries.Length)]
            })
            .ToArray();
        }
    }
}

I mean, Visual Studio immediately complains:

Remove this unread private field '_logger' or refactor the code to use its value.

Well, duh. We have an endpoint with no logging. When would we need to log? Probably when we're doing something more complicated than creating random 8-ball style forecasts.

So let's pretend it's more difficult, throw in a try... catch, and actually log the exception.

[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> Get()
{
    try
    {
        return new ActionResult<IEnumerable<WeatherForecast>>(Enumerable.Range(1, 5).Select(index => new WeatherForecast
        {
            Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
            TemperatureC = Random.Shared.Next(-20, 55),
            Summary = Summaries[Random.Shared.Next(Summaries.Length)]
        }));
    }
    catch (Exception e)
    {
        _logger.LogError(e, "Something failed");
        return BadRequest("that didn't work");
    }
}

Guess what? Now we got TWO errors! YAY!!

  1. CS0029 Cannot implicitly convert type 'Microsoft.AspNetCore.Mvc.ActionResult<System.Collections.Generic.IEnumerable<MyApp.WeatherForecast>>' to 'System.Collections.Generic.IEnumerable<MyApp.WeatherForecast>'
  2. CS0266 Cannot implicitly convert type 'Microsoft.AspNetCore.Mvc.BadRequestObjectResult' to 'System.Collections.Generic.IEnumerable<MyApp.WeatherForecast>'. An explicit conversion exists (are you missing a cast?)

Dare you to tell me what to do next. Heck, I don't know. I do know WebAPIs have been around so long there are tons of wrong answers on the net.

Let's just show one example that does work and call it a day.

[HttpGet(Name = "GetWeatherForecast")]
public ActionResult<IEnumerable<WeatherForecast>> Get()
{
    try
    {
        return new ActionResult<IEnumerable<WeatherForecast>>(Enumerable.Range(1, 5).Select(index => new WeatherForecast
        {
            Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
            TemperatureC = Random.Shared.Next(-20, 55),
            Summary = Summaries[Random.Shared.Next(Summaries.Length)]
        }));
    }
    catch (Exception e)
    {
        _logger.LogError(e, "Something failed");
        return BadRequest("that didn't work");
    }
}

Why do I need to wrap the return type with ActionResult to be able to return BadRequest REST code? I don't know man. It should implicitly cast imo into any hard type return value. I mean it's not like we're literally returning IEnumerable<WeatherForecast> in the original code. We are doing some magic behind the scenes to make that a JSON return value for our consumers. Why not do the same for any REST code convenience type too?

Anyhow, I just want to remember this trick for the next time it happens so to the blog it goes.

:sigh:

Labels: , , ,


posted by Jalindrine at 8/23/2024 05:50:00 PM
Wednesday, August 21, 2024

Grubes on the economics of Android and Chrome:

Chrome makes no money at all on its own. Itโ€™s just a funnel for Google Search. Android maybe sort of kind of makes a little money for Google on its own, through the sale of Pixel devices, but itโ€™s negligible. Like Chrome, Android really only exists as a funnel to keep users using Google search and within the broader Google digital ecosystem.

The best counterargument I could come up with was that both serve as first-party digital private investigators, which is likely worth something, though even that ultimately reduces to "broader Google ecosystem" which, itself, also seems to reduce down to search. Does Google sell its behavioral analytics data?

There's an interesting example of the power of this surveillence in The Trust Engineers podcast. Facebook had somewhat naively demonstrated that they had users [nearly everyone?] involved in several A/B style psychological tests at once, and were modifying feeds in ways that seemed to change those users' outlooks on life in general. Horrible ethical optics, and it sounds like potentially horrible ethical outcomes. Can you convince people to shop more? Spend more in specific categories? Give to charities less? Support fringe causes? Change political positions? Break family bonds? Etc.

I guess that's the power that Android and Chrome bring, though there is a bit of an underpants gnomes feel in here somewhere. Either this stuff is so effective I completely miss it or my inclination is accurate: They really don't know how to sell me music, books, goods that I actually like yet, even with all the extra information I've given them, intentionally or not. One day they might make a hard right into exploitation, but so far it doesn't really feel like they're even trying. I might have a profile they sell to companies who buy advertisements, but the advertisements aren't that much more effective than they were 20 years ago, and they should be waaaaay more effective by now!

Still, the point is a very interesting one: What's the long game for these culturally-central open source projects Google backs? Because it's certainly not as simple a profit-seeking setup as, say, selling lemonade on a hot day.

Labels: , , ,


posted by ruffin at 8/21/2024 02:31:00 PM
Sunday, July 21, 2024

Okay, this is pretty seriously "other stuff", but as I'm watching the end of the Tour de France, I figured I'd note I finally pulled in a sprinting jersey in Zwift. Zwift is a virtual bike riding service where you hook your bike onto a "smart trainer" that translates the work you're doing to a computer (I use an iPad mini) connected via bluetooth. It's neat virtual world... the smart trainers make things more difficult when you go up a virtual hill and faster on the way down. It does feel like road biking, but from the safety of my garage.

There are usually sprint segments in each Zwift route in their many virtual worlds, from routes based in Paris to London to Richmond, VA. So if you're going for a 20 mile ride, you might have three sprint segments sprinkled in that route that range from a sixth to a quarter-mile or so.

And if you're the fastest person to have ridden a sprint in the last hour or so, your virtual in-game rider is awarded a "sprint jersey", kind of like sprint jerseys that are awarded in the Tour de France.

I have a love-hate relationship with the sprint segments in the middle of routes. If I try, I can usually get times that land me in the top 5-10% of riders (most of which probably aren't even going out of their way to sprint, to be fair), and I do lots better the shorter the sprint. But then I'm absolutely shot for miles and my overall route time craters. It's a weird risk-reward. It's fun to look like a dope in my garage peddling like a madman to get my name up on a leaderboard, but it's sad seeing my wattage (they measure the power you're producing and put it on your screen at [essentially] all times) crash.

Anyhow, there was a fancy virtual "kit" (biking outfit) that you could get this month on Zwift if you fully ran any two routes in France (Paris or the countryside) this month, give or take, and I was starting my second French-based route this month when a sprint segment rolled up. I knew it'd kill my fairly long ride to sprint hard, but as the starting line appeared, I noticed I was speeding up for a good sprint start. I didn't quite "leave it all out on the road" in the hopes I wouldn't completely ruin the rest of my ride, but it was danged close.

The result? I was one hundredth of a second away from winning the sprint. DAGGUMMIT! This is what you get when you don't quite sell out to something, I guess. Let this be a lesson to you.

But then, about four miles later down the road, it looks like the rider in front of me on the sprint leaderboard dropped offline, promoting you-know-who to sprint leader. AMAZE. Woohoo! I almost didn't notice, but suddenly my usual kit wasn't visible and it had been replaced by a dark green jersey.

Turns out I didn't get the normal bright green Zwift sprint jersey -- maybe because I'm "in France" during the Tour -- I got the official Tour jersey, Skoda green with a Tour logo on the right breast.


It didn't last long; I guess someone else faster beat me a few minutes later. Half of getting the jersey, I believe, is doing it when things are slow, which I think I did. I was riding a less popular route at a less popular time, so anyone with speed could easily beat me. But it was cool to be definitively "the fastest" for a few minutes last week, especially for someone who is not a fast rider overall.

At the very least, Zwift (free for 25 [virtual] km each month!) tricked me into working a little harder by making me think sprinting like a madman on a 25 year-old mountain bike in my garage is fun. ๐Ÿ˜‰

Labels: ,


posted by ruffin at 7/21/2024 11:01:00 AM
Friday, July 05, 2024

I've been using BBEdit as my compare tool on macOS for a few years now, but recently noticed that it keeps opening a window that's maybe 90% of my screen's width and height. That might be useful on a large monitor, but my 13" MacBook Air felt especially cramped.

Welp, to change the default size of a window in BBEdit, you apparently use the menu! Feels very OS 9-. /nostalgia

From "BBEdit > New Window Size & Location > Set Default" on ArsTechnica:

When I began my search for how to set the default location for new windows in BBEdite, I was certain that to set this required a "write defaults" from the command line.

Not so -- no need for BBEdit Expert Preferences for this ... it's in the menu:

Menubar > Window > Save Default <type of> Window

The Save Default Window command stores the position and size of the front window in BBEditโ€™s preferences, and BBEdit will create all new windows of the same type with the stored position and size.

In my case, the "type of" is "Difference".

So, to be overly clear, first open a difference window, size and position it to taste, and then run the "Menubar > Window > Save Default Window" jive.


I'm sure I've mentioned I've been using BBEdit since the year of its birth (not sure exactly, but certainly in 1992. I still fondly remember [a few years later] using it in tandem with Transmit). I'd wandered away from BBEdit for years, using Ultra-Edit on Windows for a while, then VIm, Visual Studio, and a number of language-specific editors (sort of like (and including) PhpStorm), Coda (super briefly), Sublime Text, and now largely (and largely happily) VS Code crossplatform.

It's kinda neat to have a daily use for the "old grey lady" of text editing again and to continue not to be disappointed in its feature-set. BBEdit doesn't suck.

Labels: ,


posted by ruffin at 7/05/2024 06:27:00 PM

<< Older | Newer >>


Support freedom
All posts can be accessed here:


Just the last year o' posts:

URLs I want to remember:
* Atari 2600 programming on your Mac
* joel on software (tip pt)
* Professional links: resume, github, paltry StackOverflow * Regular Expression Introduction (copy)
* The hex editor whose name I forget
* JSONLint to pretty-ify JSON
* Using CommonDialog in VB 6 * Free zip utils
* git repo mapped drive setup * Regex Tester
* Read the bits about the zone * Find column in sql server db by name
* Giant ASCII Textifier in Stick Figures (in Ivrit) * Quick intro to Javascript
* Don't [over-]sweat "micro-optimization" * Parsing str's in VB6
* .ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture); (src) * Break on a Lenovo T430: Fn+Alt+B
email if ya gotta, RSS if ya wanna RSS, (?_?), ยข, & ? if you're keypadless


Powered by Blogger etree.org Curmudgeon Gamer badge
The postings on this site are [usually] my own and do not necessarily reflect the views of any employer, past or present, or other entity.