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! |
|
Saturday, August 08, 2020 | |
I'm not sure why I haven't been exposed to this earlier in my life, but it's definitely a clear example of brillance. (Reminder: My definition of brilliance is any solution to a problem that, once seen, can't be unseen. And it makes you wonder why you never thought of that yourself. Which isn't to say you would've, but that the solution fits that perfectly.) Let's cut to the chase: Studying analog computers today I ran into (via Wikipedia) an old Navy doc from 1944 describing an analog computer they used titled, Basic Fire Control Mechanisms, Ordnance Pamphlet (OP) 1140, which has been nicely scanned and presented in a pdf version. Lookit how these things work. Simplicity itself, but I'd never thought of making something like it. Easy, right? If you want to multiply by 36, you have a gear where X teeth of movement (say just enough to move a dial so that what's in the output window changes from 1 to 2) turns a second shaft 36 times X teeth. Then you check the number that shows in the output window (also listed on a dial) that's regulated by that shaft. In this case, the Navy wanted to set up a computer where sailors would enter the same number of specific variables for each calculation and have the machine compute the values needed to set and fire shells from their artillery. That's pretty cool. No, more to the point, that's brilliant. No energy needed. Easy to repair, all things considered. Doesn't require any insanely specialized knowledge to work on or with. Not real flexible -- you're give or take doing the same calculation each time -- but in this case, who cases? As the OP says...
Now I have my doubts about how "lightning" the mathematician would have to be, since we're just doing an easily, if tediously, delineated set of multiplication/division/logarithmic (?) operations each time (how many math questions can you answer in "six or eight hours"? Um, lots), but point taken. Pretty cool. But why [do you care]?Why did I run into this today? One pastime I've been pouring waaaay too much time into recently is the study of DIY headphone amps and cassette players. And one of the important parts of any (well, most any) headphone amp is its "op amp". The op amp is the piece that, when fed a little juice, makes the tiny electric current that's created by the magnets recorded into [sic] your tape as they pass your cassette player's read head loud enough to hear. If we read our canonical work, Op Amps for Everyone, we learn that the name "pop amp" is short for "operational amplifier", and they're, in a sense, a new twist on the shaft-based analog computers we just saw the Navy used for aiming shells in the Forties.
Does that make sense? You pass in a voltage and the operational amplifier -- which, it should be noted, requires a power source to perform its operation -- cuts it by two or multiplies by 7... or 36!... or whatever. It is, in effect, just a way of moving from one setting on one shaft through "electric gears" to another. In an amplifier, we take in a current (?) and multiply it to produce more volume (or is that gain?). Different op amps, like different gears, multiply by different amounts. That multiplication here is measured in decibels, a logarithmic scale Here's a list of op amps that work reasonably well in a CMoy DIY headphone amp (for more on the CMoy, sort of "the" famous DIY amplifier, read the original post here, learn to build here, buy a kit here, or learn about alternatives). Note that each has some measurements of the power you've got to put into the op amp to get a corresponding decibel gain for your sound; one this page, he's listed Anyhow, that's a long-winded way of saying that your old cassette player was very likely a computer. An analog computer capable of just one calculation, but that's all you needed! From the docs for the Elenco Electronic's AK-200 Cassette Player Kit (or the per-soldered AK-250), we see what the goal of your player's integrated circuit was...
Emphasis mine, as usual. Does that make sense? Because of limitations of the cassette tape medium, you need to boost some frequencies. That calculation is what all the innards of your player are for (aside from all the buttons and mechanics for engaging the capstan motor and all that): They're there to translate the feed from your tapes using the "NAB standard" formula for boosting the signal to a "flat frequency response". Neat! Some more cMoy stuff:
Btw, hummingbirds chirp, sometimes when feeding. TILx2. posted by ruffin at 8/08/2020 10:31:00 AM |
|
Wednesday, January 15, 2020 | |
Here's Today Adventure in Enjoyable AngularJS... I ran into some code from a project that looked give or take like this... namespace.directive('caNavigation', function () { "use strict"; return { restrict: 'E', scope: { inLinks: "@", collapseNav: "=" }, // ... controller: ["$scope", /* more jive */], function ($scope /* more jive */) { $scope.$watch('inLinks', function (value) { // omgwtfbbq? // ... Well, that's @ and = stuff is pretty cryptic, especially since I hadn't used a directive in AngularJS before (Angular 2+, sure, but still learning ye olde AngularJS -- going backwards, I know. Don't forget I had my first run-in with Perl in 2014 [sic]). Let's see what ye olde docs say:
Good heavens, AngularJS. Not the most discoverable. Seems like in AngularJS in general there's lots of magic stringing. Perhaps I shouldn't be surprised, but that doesn't mean I like it. (Here I mean largely inline array notation, which is too hipster by half. I mean, I get that you don't what to lose information when you minimize, but then how about pass real references, not refer to objects by their original names? Sheesh.* ) But let's go a little deeper so that we know what the @ symbol means too. If you've used Angular 2+ (what a failed naming scheme, btw. Why not "Angular.IO" after the website or just NGular or something so that googling this jive would be easier?), you can already see our steady progression to banana boxes. But for now, what a mess.
Guess that works. Let's ignore the =* shallow comparison jive for now. All we've really got is one prop called inLinks that will be passed... um... "in" that we'll update whenever it changes, probably after the page finishes loading and making some resource calls. And sure enough... <li ng-repeat="subLink in link.SubLinks|filter: {ShowInNav: true}" ... That means once we've loaded the correct navigational links for this context, we'll start pushing them into the DOM. And our code makes sense. Much rejoicing. * I actually kinda like AngularJS. It's one clean step away from the inefficient, overly-engineered land of enterprise development Bjarnason discusses and that at least the social convention surrounding Angular 2+ seems to require. But there are a few stupid* conventions like this one that really do AngularJS in conceptually. * Sorry, I've tried to come up with a good synonym, but "stupid" fits here. My earlier use of "hipster" was my kind attept at an alternative, but this stuff really feels a little too much like a first-pass solution to be in a nice, mature templating library. Labels: angularjs, noteToSelf, TIL posted by ruffin at 1/15/2020 05:32:00 AM |
|
Tuesday, December 01, 2015 | |
Clued in after reading this... I've got a place where I want to return entities mixed in with folders in a grid, in this case a Kendo Grid. I want to have the two "types" of data mixed in display, however, which means this isn't as clean as it could be. I've got pretty typical fields for the first query, and then I'm kinda kludging the folders into the same object model, like so...
I'm not absolutely sure how I feel about this as a production-worthy strategy... It's obviously taking a dog and making it quack like a duck, which is tres hipster. The problem is that Kendo Grid allows you to have hierarchies, but expects everything on the same hierarchical level to be of the same object type. (My vote is to write a custom table renderer that'd support the concept of folder levels mixed in with entities, but that's understandably not the route this contract is taking. Still, it's so often just as difficult to get a third-party library to work as you need it as it'd be to make your own widget that exactly covers your own use cases.) Regardless, what's neat to me is that the compiler's smart enough to know these are the same anonymous types and allows you to (apologies for the Yoda'd blog title. SEO BABY! /sarcasmTinge) Labels: c#, noteToSelf, telerik, TIL posted by ruffin at 12/01/2015 05:11:00 PM |
|
| |
|
All posts can be accessed here: Just the last year o' posts: |
|||||||||||||||||||||
|
![]() |
|
|