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. |
||||||||||||||||||||||
Friday, May 30, 2025 | ||||||||||||||||||||||
Note to self: It's pretty easy to get a Stripe CheckoutSession in .NET. I talked about writing a Chrome extension and integrating payment through Stripe a few months ago. Unfortunately the "what appears to be an amazingly well-written howto" wasn't, quite. So here's a quick bit of play with the Stripe API using .NET. This looks up information according to a "Checkout Session" id, which is what you'll get sent if you set up a "After Payment" processor URL, which is what I'm doing -- for now in an Azure Function, just to be kewl. (No, you shouldn't use hard-coded paths in your code. No, you shouldn't pass around anonymous classed entities in C#. You're right, there's one instance of insanely not-DRY-ness in this code that almost bugs me. And I hate kludging Steps:
I'd been thinking about having a $3/year [sic] subscription for an extension. After a test, I learned what the comments, above, mention: That'll cost me ($3 x .029 + 30¢ somehow equals...) 41¢ [???] per transaction. Okay, apparently there's a "Usage fee" in addition to the charge?
From togai.com:
From bossrevolution.com:
Cool cool. 13 2/3% of $3. Just below Apple's small dev 15%. Good times. Least the API is simple. More to come. From stripe.com:
good heavens. Labels: .NET, c#, example, noteToSelf, stripe posted by Jalindrine at 5/30/2025 01:26:00 PM |
||||||||||||||||||||||
Monday, May 26, 2025 | ||||||||||||||||||||||
Sometimes, I surprise myself:
Labels: development, noteToSelf posted by Jalindrine at 5/26/2025 03:32:00 PM |
||||||||||||||||||||||
Monday, May 19, 2025 | ||||||||||||||||||||||
I'd missed the whole Forced Reset Trigger debate over the last year or so, but caught an article about it in The Post Sunday and figured I'd see what it's about. Here's what I learned, executive summary style.
My second isn't quite accurate, but check below and it'll make more sense. First, some YouTube videos and then quotes from an excellent article from the National Association for Gun Rights. The first shows the trigger in action with some slow-motion demonstrating that a trigger pull is required for each round. But it also is what reminded me of bump stocks. Again, it's not. The bump stock would essentially (afaict, ymmv) push the gun back into your trigger finger so you didn't have to manually pull. It looks like this does something similar but you do have to pull the hairiest trigger possible. This one shows me two things: The eyes of the first guy shows it fires lots faster than the novice shooter can normally. The second shooter shows me it does take a knack -- easily achieved, but a knack -- to get it to work. This one, however, is probably my favorite. This fellow shows that he can empty six rounds just as quickly using a traditional trigger. Dude is fast. Now for some quotes from that article from the National Association for Gun Rights. The last one is pretty telling. They're comparing the Force Reset Trigger to a binary trigger, the second of which also increases discharge rate, but in its case by releasing a round with a pull and a release, thus the whole "binary" moniker. But we learn a decent amount about how actual shooters consider the FRT.
That last point (and the "fun range accessory" comment) seem to wrap this up for me. In the wrong hands, a FRT could enable someone shooting at a crowd to cause a lot more carnage than without. For the serious shooter or someone truly interested in eliminating a specific threat, there is no practical usage. That is, unless your adversary was coming at you in waves like an 18-century bayonet charge, it's likely a bad idea to use a FRT for security. Honestly, I'm still surprised we have a sort of bifurcated Second Amendment. District of Columbia v. Heller is described at today's Wikipedia like this:
... but there's also otherwise an argument that anything goes. I mean you can even have a fully automatic rifle (as the NAGR references) if you jump through enough hoops. Okay, I realize that's a law, so not 2nd Amendment protection, but in general it feels like "if the Army can own it, so can I" argument comes up more frequently, like with sawed-off shotguns, iirc. That is, in 1939 SCOTUS said:
But I think I saw an argument that since the Army now assigns shotguns in specific urban missions it's fair game for everyone. But even the text, above, seems counter to Heller: The bar there is "Is this weapon useful to a militia?" not Heller's "Is this something a citizen would have at home and bring to a militia?" Anyhow... And, as I think I mentioned before, years ago I went to a local gun show to see how tough it'd be to get an AR-15 fully auto. There was a bin of the piece that you'd need to replace to make an AR-15 fully auto and a $10 or so book explaining how to do so easily available. For $1500 or so, you could walk out and be an hour or so away from an fully automatic M-16 equivalent. The question of whether a FRT should be illegal comes down to how you interpret Heller. I don't know that Heller is talking gun technology. That is, a flintlock musket or rifle (two different things) are nothing, not really, like even a lever-action rifle today. If you'd had a lever-action from 2020 or 1970 in 1770, you would have been a power like no other, not just for rate of fire, speed of round (so velocity and inertia -- damage), but also accuracy. I think Heller is saying more, "What sorts of weapons do you have around the house today?" rather than "Gun technology stops at 1791". Even then, NAGR would suggest the FRT isn't one of "the sorts of lawful weapons that they possessed at home" when it says "the FRT is often seen as a fun range accessory rather than a practical tool". When it comes to hunting, they add, "When tracking moving game, accurate follow-up shots are often more critical than speed. The binary trigger provides the time and control necessary to line up subsequent shots, whereas the FRT’s rapid reset can make it more difficult to stay on target." But this does argue for the binary trigger being legal, I believe. (Strangely, binary triggers appear to be illegal in Florida and Alabama, among other states.) The weird deal the ATF made with the makers of the FRT is a weird middle ground. I assume it's just a punt. From The Post:
Once the patent or whatever is out, are we back to where we started? Regardless, this seems to support where I think I always end up on this one: If you don't like our current state, you've got to amend the Amendment. Labels: guns, Other Stuff posted by ruffin at 5/19/2025 08:41:00 AM |
||||||||||||||||||||||
Saturday, May 17, 2025 | ||||||||||||||||||||||
From Hacker News' Malicious npm Packages Infect 3,200+ Cursor Users With Backdoor, Steal Credentials:
None of this is amazing or rocket science, which is exactly why it's important. It's not hard to social engineer humans. It does make me wonder about the almost unthinking preference devs can have for "[I don't care if it's] NIH". Not that it started with But if you want to reduce your proverbial footprint, there are ways. Knowing open-source libraries you use well enough to have contributed is one. Not writing an in-house version of something insanely trivial is another. And, as much as Apple's getting slammed for arguing for its own nanny state right now, using IDEs from fairly reputable sources and not believing deals that are proverbially too good to be true are all probably decent ideas too. I do wonder about, say, browser extensions. I have one from the EFF on one box that I haven't looked into for a while -- is it still be updated? What do adblock extensions really do? Luckily these are all in JavaScript so, even if obfuscated, you can still sniff through most of them fairly easily. Somebody should know, eventually, if the most popular get wacky. Right? Though heaven help me if the right vim plugins for IDEs get compromised. I'm toast. (Told ya it was easy.) Labels: development, npm, security posted by ruffin at 5/17/2025 02:08:00 PM |
||||||||||||||||||||||
Wednesday, May 07, 2025 | ||||||||||||||||||||||
Coverage reports in C# with Cobertura In the last contract I completed, we were building WebAPI microservices in C#, and part of our build process was to run all of our XUnit (and, depending on who originally wrote the microservice, maybe NUnit) tests and use SonarCloud to produce a pretty amazingly specific coverage report that highlighted every source file's test status, line-by-line. I've got a personal project in C#, have been spending time recently writing tests for it, and wondered if I could pull off the same level of coverage testing. Turns out I can! Exactly the same! Install by adding a ref to the coverlet collector to your testing proj:
Then run the test with this:
And sure enough, there's a new folder with every run in my Now the XML isn't very interesting.
You have to turn that into a more interesting report. This Stackoverflow answer explains how:
From the README: Install:
Run:
which, in my case, if I'm already in the same folder as the
... which, because we said so in the options, creates a folder named And then that report looks incredible: I have no idea why I redacted so much of that. Also note this is running against a very early stage piece of code. This coverage is obviously horrendous. But the coverage report isn't! posted by Jalindrine at 5/07/2025 05:47:00 PM |
||||||||||||||||||||||
Tuesday, May 06, 2025 | ||||||||||||||||||||||
From "Amazon now has a ‘Get book’ button in its iOS Kindle app" on theverge.com:
I just tried. It's there, and, though obviously easy in retrospect, the implementation surprised me: Kindle iOS kicked me to Safari, which I keep in private mode, and the "Buy with one click" button is activated. Okay, well shucks. Upon further review, apparently I don't usually pay much attention to that button, because it's always active, even if you're not logged in. Click it and it asks you to sign in. But I wouldn't expect that to last long. Right now it looks like Amazon is only adding Adding a one-use, unique "buy now token" would make it easier to buy using Kindle than Apple's own Books. I click buy in Kindle, I click a "buy now!" button in the browser that's opened (no Touch or Face ID required), and a universal link sends me right back to Kindle. And this would change our relationship with the web on our phones by merging apps and the web in ways I didn't really picture before. Now, Amazon knows where you were when you considered buying a book. They can do an okay job of fingerprinting you, not that they couldn't with you signed in within the app, but the extra data doesn't hurt. And, app review psychosis aside, there's no way for Apple to protect you beyond the way they protect any other surfer on Safari. (And with other default web browsers now on iOS, they can't always even do that.) This is a pretty significant wall breaking down in the garden. I'm still tempted to think it's a huge positive for devs and users, but watching the platform regain its equilibrium will be fascinating. That said, I feel like universal links are about to get overhauled. Apple might soon say...
Ugh. Tim Apple strikes again. (Though I haven't heard of them changing the rules there yet. You think Tim Apple's Apple (vs. Phil's Apple) would've had those universal link rule changes in the license already.) posted by Jalindrine at 5/06/2025 09:46:00 AM |
||||||||||||||||||||||
| ||||||||||||||||||||||
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! |
![]() |
|
|