Spatial Xcode

Checking my projects for building against iOS 11/iPhone X, and wanting to ship a new utility app (more on that later), I had to use Xcode again. And I screamed in rage, and cried, and this is why Mark drinks.

Filed a "suggestion" in Radar:

Open a project in Xcode. Double-click a file in the Project Navigator to open it in a window, resize & place it somewhere to work, then close. Repeat. Note that sometimes it'll keep the same size, but never the same position as previously, but after a few files it returns to a window sized like the main project window, randomly placed.

There's a concept called "spatial memory", which both the Finder and Xcode actively sabotage now, an old but still valid complaint: About the Finder…, by John Siracusa

Suggestion: Record the position & size of each file's window, and reuse that when opening a window. When switching to an alternate file, change the window size & position, do not destroy the current file's position. Maybe make this a preference setting, called "Project Builder Mode".

Cautiously Cat Stevens Saturday Music

After 46 years of mediocrity, conversion to a death cult, and hate for everyone who liked his work and didn't convert to his death cult, he's behaving like a person again? Maybe the disease is in remission. Given his previous behavior, I'm not super happy about giving him money even on streaming, but the old albums were amazing, and I miss that guy.

Programmer, Interrupted

So I sit down to code, and get maybe 30 minutes in, and BAM, interruption. Sit back down and growl and swear a lot, get back into the zone, and BAM, another interruption. Growl, gonna go play games where I murder people.

So here's today's music:

Aside: Posted this with the micro.blog client, which now does long posts. I went into the WP dashboard to add categories, but it'd be just fine for most blogging.

People Should Not Fear Advertisers, Advertisers Should Fear People

Good. You know what a "campaign" is? It's a prolonged military action against an enemy. Advertisers call it a campaign because you are the peasants being mass-surveilled by their soldiers for their profit.

Ad-block everything.

On iPhone and Mac I currently use Better, and on Mac ublock for eliminating single annoying elements.

"Oh no how will papers make money if they can't surveil us?!" Patronage or subscriptions. Maybe schwag, like "Democracy Dies in Darkness" tshirts, sold exclusively on Amazon.

Apple Special Event

  • Live video doesn't work in Safari beta. Had to watch on iPad.
  • Steve Jobs tribute. Makes me a little uncomfortable. I don't think Steve would've liked being deified like this. Not sentimental, he wanted the work to speak for itself.
  • Apple Park. Very pretty as a modern cathedral, but still that open plan is going to be Hell for developers.
  • Apple "Town Squares". This is a very 20th Century kind of thing, a real-world gathering place, where you're supposed to learn from others. But now everyone just lives by their computer and talks online, watches online video. There's a lot of "we're restoring historic buildings" in this; the Medicis funding arts while politicking to get their Popes elected.
  • The stream isn't doing the usual dual-camera picture-in-picture of presentation and zoomed-in view of presenter, so often I only see a tiny bit of a presentation screen, then it flips out for context. Very jarring.
  • Apple Watch, exercise ad, lot of heart health study. Almost every watch app is getting redesigned again, because they can't figure out what it's for, beyond being a watch. "Now you can take a phone call, while you're surfing!" Streaming audio is their solution to killing the iPod… But how much is that going to impact your data cap?
  • AppleTV. A presentation screen on streaming video can't show HD vs. 4k HDR video, so they desaturated the "HD" image to make the images look different.
    • Aside: I've never much liked Spider-Man, but the new movie looks stupid, the costume looks like a plastic CGI figure (which it is, I guess), and the fight scene was so over-choreographed it looked like ballet, not a kid in a brawl with thugs.
    • Aside 2: I love thatgamecompany's games, Flower and Journey are amazing. Sky looks just as good. But I'm dubious to the extreme about social gaming in it; that's the weakest part in Journey, which has almost no interaction.
  • "For the first time, you were actually touching the button!" And then iOS 7 destroyed that UI by removing buttons and making everything a bland white void. Thanks IVE-1138.
  • Ha ha everyone who had "iPhone X" on their bingo card, it's "iPhone 8". There's a regular fat model, and a super-fat + model.
  • The camera is much better. I dislike the term "portrait mode", which doesn't mean portrait-vs-landscape, but bokeh.
  • Using AR (Augmented Reality) Kit to put virtual objects on the real world is still silly, you're still staring at your phone. It replaces a convenient on-screen camera control with having to spin around like a doofus, you can't just sit in your chair and play comfortably.
  • There are sane uses of AR to overlay physical things, like landmarks, or provide auto-translation. If Glassholes and naked Robert Scoble hadn't ruined Google Glass, it might be have a useful interface. But holding up your phone to do it is still silly.
  • Wireless charging is a nice thing. In a car is a strange use for it, since it'd just bounce around without something holding it in place, like a cable.
  • One More Thing: A separate model of iPhone X, with all the crazy rumor stuff. No home button, edge-to-edge screen.
  • FaceID: From now on, you need to wear a mask at all times or anyone can use your "true face" to unlock your phone. The pigs can just hold your phone up in front of you to dig thru it. Good thing there's animoji, so you can send a completely virtual face (panda, poop, robot, or alien) to replace that pesky human interaction.
    • Aside: I am wearing a Star Trek Mirror, Mirror tshirt. I'm the one with the goatee.
  • iPhone X (pronounced "Ten"), and Qi chargers (pronounced "Chi") provide all new ways for Apple devotees to "well, actually" everyone else.
  • Skate to where the oh not this quote again.

Probably makes sense for me to wait a couple months for the iPhone X and get the bleeding-edge device rather than a better what-I-already-have.

OK, get back to work.

TPortableNetworkGraphic

Trying to load a PNG image and display it on the canvas has been… not fun. Delphi only knew about BMP stored in some horrible Microsoft resource format, and so everything FreePascal adds on top is a pile of hacks or undocumented features. The WWW was not especially helpful.

Mostly I'm posting this so someone else might find it in a search.

uses Classes, SysUtils, Controls, Graphics, LCLType, types, contnrs;

{
type
    TSprite = class
    public
        color: integer;
        filename: array of utf8string;
        subrect: array of TRect;
        constructor Create(c: integer; f: utf8string; r: TRect);
    end;
}

var
    imageCache: TFPObjectHashTable;

function getImage(filename: utf8string): TPortableNetworkGraphic;
var
    img: TPortableNetworkGraphic;
begin
    img := imageCache.Items[filename] as TPortableNetworkGraphic;
    if img = nil then begin
        try
            img := TPortableNetworkGraphic.Create();
            img.loadFromFile(filename);
            imageCache.Items[filename] := img;
        except on e: Exception do begin
            LogError(Format('Image %s: %s', [filename, e.message]));
            raise;
        end;
        end; // try
    end;
    Result := img;
end;

procedure drawSprite(canvas: TCanvas; spr: TSprite; srect: TRect; tick: integer);
var
    img: TPortableNetworkGraphic;
    frame, nframes: integer;
begin
    if spr.color <> dawnUndefined then begin
        canvas.Brush.color := spr.color;
        canvas.FillRect(srect);
    end;

    nframes := length(spr.filename);
    if nframes > 0 then begin
        frame := tick mod nframes;
        img := getImage(spr.filename[frame]);
        canvas.CopyRect(srect, img.canvas, spr.subrect[frame]);
    end;
end;