Put the knife down and take a green herb, dude.
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
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white.
|Tuesday, October 25, 2016|
When I've talked about Apple having poor QA before, this is the sort of thing I'm talking about.
Let's give them the benefit of the doubt and say that there are thousands of images in the 10.12.1 update. There's still not so many you can't still divvy them up and have three sets of eyes look at each one. It took the Mac press all of 14 hours to come up with these images.
Could there be mitigating circumstances? Sure.
Maybe some of these are stored inline rather than as discrete files, unlike png/jpg files found within an app (or some other sort of) bundle. It could've been a nice inline image, perhaps.
Maybe MacRumors didn't find them in just 14 hours. Maybe they found the images in a beta and stayed quiet until the embargo was off.
Maybe folks were told the OS would be released concurrent with the new hardware, and that proved untrue (highly unlikely, but as long as we're maybe-ing... Didn't iOS 10 predate the iPhone 7, for instance?).
But even in one of these most favorable contexts for Apple, not to have every image pass in front of enough eyes to catch something the press does this quickly is insane.
Let's be clear: This isn't the Alcatraz level snuck into N64's San Francisco Rush or Warren Robinette's name in the Adventure for the Atari 2600. These images were meant to be consumed by users. Every user-facing image should have been QA'd. Unlike those games' Easter Eggs, this content wasn't hidden, and that QA should've been planned.
Actually, there is one "maybe" that could excuse Apple: Maybe this was a planned leak to stoke some excitement in diehard fans.
You know, I might've been tempted to believe that if...
Oh well. I'll admittedly be watching Thursday. As bad as it is, I still want to [finally] add a new horse to my Mac stable. My current Macs (ones that are powered on) are an old mini and a, I kid you not, 2009 MacBook upgraded to an SSD.
I waffled thinking they'd release something new this March, but finally decided not to get the updated 12" MacBook or wait for a MacBook Pro. Instead, I bagged a $700 14" Lenovo Y700. I thought that I'd regret that purchase quickly when new Macs came out in a month or so afterwards. That didn't happen, natch.
Looks like a portable workstation with a i7-6700HQ for $700 ($850 with SSD & 24 gigs of RAM) was a pretty good deal after all. Wonder what I'd get for it with those upgrades on eBay now, and what percentage of a 13" MacBook Pro it'd cover... ;^)
posted by ruffin at 10/25/2016 05:06:00 PM
|Monday, October 24, 2016|
I'm close to releasing my second application to the Windows App Store, and have gotten just good enough at dealing with icons -- not a rocket scientist-level task by any stretch -- and thought I'd share.
Buy an icon
First, you need a square png (or other common format) of your icon that's at least 620x620 pixels. You can get a nice rounded image, but for the Windows Store, at least, a full square is better.
In my experience, it's not too difficult to trade a couple weeks of waiting (in case you get a bad contractor) and $5-$15 to get a servicable icon from fiverr.com. I've used folks from Pakistan each time, strangely enough, and gotten very good results three times, most recently with foxsquare. You do need to be respectful to some degree, as their contract says, "We Do NOT Take Order related to Pork, Nudity, Alcohol & Gambling." So far, so good for me.
Here's my latest, a design for a podcast feed creator. I wish the angles on the orange circles were perfectly symmetrical, and that the little "i" icon didn't reach the bottom of the image, but all things considered, this is a heck of a lot better than I could've done in several hours' work. It's a steal at $15 with .psd.
To insert the icon into your UWP app, open up your package.appmanifest file from Solution Explorer, and hit the Visual Assets tab.
Now you have a pretty simple interface to upload icon imagery. I recommend clicking on each of the lines from "Square 71x71 Logo" on down.
Resizing your original
For each one, you'll want to upload resized versions of your original icon. "But how do I get those resized images quickly?" you ask? That's easy if you download IrfanView, the handiest image viewer I've ever used.
First name the original square.png. Then run a bat file that resizes everything.
Here's the bat file I'm running, though you may have to change to the path where you have IrfanView installed:
Now go into the appmanifest UI and click on every largest size available for each asset line, then add your image.
NOTE: Some of these already have placeholder X images in your project. OVERWRITE THEM. You can overwrite in addition to the ones you're uploading to ensure you have decently high quality images.
Rectangle splash and wide logos
This will leave you with just two assets unfilled, both rectangular. One is the "Wide 310x150" and the other the "Splash Screen" logo.
I kinda cop out here. I could probably get fiverr to make me some, but instead I open Ms. Paint.
The size we need is 1240x600. I tell Paint to create a new image, then I hit "resize" (Ctrl-W, strangely enough), and get it to 1240x600.
Make sure "Maintain aspect ratio" isn't checked.
Then I use the paint bucket to fill that all black. Finally, I paste in the 600x600 image IrfanView created and slowly move the middle pixel over until it's at 620 pixels into the image in Paint. Very high tech.
Save it and put into both of the assets you had left.
Voila! The end. Cheap and quick.
posted by ruffin at 10/24/2016 12:12:00 PM
|Saturday, October 22, 2016|
Hrm. I'm not sure that this is a great idea, as it gives some misplaced incentive to chase streams rather than sell albums.
I'd bet some trivial amount of money that streams on Amazon Prime count towards this number, as two albums from bands I like, Who You Selling For by The Pretty Reckless and Strange Little Birds by Garbage, hit Amazon Prime's streaming the day they were released. For a streaming service that costs me zero dollars a month (after the sunk cost of Prime), having release-day access from reasonably major bands was surprising.
Why is that bad? Well, I've gotten to try (and I mean fully try; I can put them on constant replay for hours if I want, and even download them to my phone so that I'm not using cell data) before I buy. And neither album is as great as my favorites by either band. Playing what I already own whenever I want, supplementing with Amazon Prime's streams of the new stuff, is plenty for now -- for me.
Usually, though, those are both bands where I'd strongly consider running by the record store or hitting iTunes/Amazon to buy a CD or AAC's of the album on release. (The local store has a store-wide 20% off sale today, and I was planning to grab Who You Selling until I listened a few times.)
I did test drive a little on Spotify before Amazon Prime added limited music streaming, but the ads made things annoying enough that I usually wouldn't listen but once or twice.
I get making the album as universally available as possible, but let's just say I haven't streamed songs from either album 1500 times. That means both bands...
I'm not sure if chasing stream counts like this is great for business. I like that I get this stuff on Prime, but if we're so cheap we're listening to Prime and not paying to stream, we're probably also cheap enough that we'll buy music we really like. Strangely, that's the cheapskate way to listen to commercial-free music these days.
posted by ruffin at 10/22/2016 04:40:00 PM
|Friday, October 21, 2016|
That's right. You can't read the RTF specification in an RTF editor. You need something that reads .doc or .docx first. (Admittedly, this is from March of 2008, so this is still Ballmer's Microsoft.)
That looks like fun. The pdf displayed below -- part 1 of edition 4 which does not supersede and refers back to edition 1, which is not included -- is over 5000 pages.
Raw XML can be human-readable, but there's no guarantee. UTF can be just as obfuscating as binary. And security through obfuscation is really all we ever had or have. It's all open source once you get to the zeroes and ones.
At least the OOXML format is given in a pdf. 🙄
I know, LibreOffice et all do a decent job with .doc. I can read the spec "for free". It's actually quite interesting, and quickly lets you know that some people still expected to read rtf docs' source when the format was created -- in this way, it's not wholly unlike Markdown.
posted by ruffin at 10/21/2016 10:16:00 AM
|Thursday, October 20, 2016|
[emphasis is mine]
That's got to be a joke, right? So I can't use a "nested class" (which would include anything with a java-style like
Look, that's crazy-insane. I'd also had trouble with "namespaced" UserControls I'd created in the past, and lucked into figuring out they'd only work for me when I took them "out" of the non-local namespace, but figured I was doing something wrong. Maybe not.
Wow. I've made a wrapper class in my local namespace as a shuttle.
UWP unfortunately remains a hacky place.
posted by ruffin at 10/20/2016 04:03:00 PM
|Friday, October 14, 2016|
Microsoft HTML Clipboard formats: All you ever wanted to know, but were afraid to ask. And then some.
Let's talk HTML Fragments in your clipboard when coding on Windows. I've created what's arguably the best Markdown editor on Win10 (if I do say so myself), and wanted it to be more intelligent when I was pasting content that comes from web browsers. That is, in the original version of MarkUpDown, if you copied the text I've got highlighted, below, from DaringFireball...
... and you pasted it into MarkUpDown as a quotation (Ctrl-Shift-V), you'd get unstyled text, like this...
I mean, that's okay-ish. Unfortunately, you'd have to go put in an additional line after each line so that it's not all scrunched into one paragraph. And you lose that Gruber was block-quoting Mossberg. And you lose that "they stop trying" was originally in italics. That stinks.
Isn't Markdown really supposed to be shorthand for html? Can't we handle pasting html better than that?
Yes, yes we can...
Go pull the HtmlFragmentHelper, a working, in-progress library for turning HTML Fragment strings into view models with these properties...
There are also several convenience methods to help you get, say, the top- and second-level domains for the HTML Fragment's source URL (
Here's an example:
And here's a quick article on how to get code back into the clipboard as html, which I'm not doing.
HTML Fragment Format
Want to paste clipboard HTML as HTML? Enter Microsoft's HTML clipboard format. Instead of using the standard code to read the clipboard's contents, like this...
... now you use this...
But when you look at the contents of
What comes back isn't a string with html source, but an "HTML Fragment" formatted string that looks like this:
HTML Fragment from Edge
Wow. No, really, wow. That surprised me. I was using Edge this time instead of Chrome, and whoa. Edge includes the entire page's header. That said, that's really not a horrible idea. We have really good context for this fragment, and if we wanted the original CSS, for example, we know where to get it.
HTML Fragment from Chrome
But let's take a look at where I initially started, with Chrome.
See the difference? Chrome's fragment initially looks much more focused, but also provides much less information about the code's original context. Worse, Chrome's puts all the CSS information inline, and repeating each CSS property inside of each pasted html element makes the source a long ways away from DRY. And that out-of-context, inline CSS is lossily translated, which will cause us some rendering problems that we'll see and discuss in a bit.
Now Edge's fragment isn't perfect. Here's the original html of that snippet straight from the server...
Look how clean the original is! Why can't we just get that? Chrome's CSS injections and line flattening makes for a much less human readable snippet.
Edge is close, but still weird. Take another look. For some reason, Edge's fragment makes every tag uppercase like it's 1998. It also trashes Gruber's original (and thoughtful) whitespace. Also yuck. I mean, Gruber's using Markdown to write Daring Fireball. In a perfect world, I'd take that clipboard's html and turn it back into Markdown when it's pasted into MarkUpDown.
How do we get this original source?
Start and End Fragment
The important thing to catch is that the HTML Fragment format almost always includes a full html doc with html and body tags after the
Though Chrome immediately dives into your selected text (the "true" html fragment) immediately after the
If you ignore context like this, though, it's an easy enough feat to take the string and parse out the "true fragment's" html by splitting the entire HTML Fragment string on
When we parse out that html and insert it into our Markdown from Chrome, however, we get some, um, interesting results.
I'm going to wrap these pastes in
Edge Parsed Code
Though you should remember that the original source has been smeared together, losing its newlines, and all the tags are strangely capitalized, the source looks pretty nice. It's plain, and adopts the local styling for the most part, but the most important markup is still there -- the blockquote, the italics, links if they'd been included, etc.
Chrome Parsed Code
Um, ew. Wha' happen'd?
Unfortunately, even though Daring Fireball's entire page has the same styles applied, this inline kludge Chrome performs puts it only in each, in this case,
Let's look at all the overhead we have for each
And here's what we have from Chrome's Dev Tools' "Computed" style tab:
But note that that's essentially all from one css file, as properties from user agent stylesheets are simply the browser's defaults:
If you'd like, we can compare the fragment's CSS vs. the stylesheet. Spoiler: It's a mess. Not a lot of matching. Click here to see. Ugly.
The bottom line is that
With HtmlFragmentHelper, I have a couple of choices. One is to strip all inline styles out, or at least some subset of styling. If I want to maintain as much of the original as possible, I might just blast anything that injects colors into the html, like
Or I could normalize the CSS and optionally (via a property on
I think I'm going to do the former, though it's not in there as of this writing. That Chrome paste looks horrible as is, though. If only there was an easier way...
HTML Fragment from Firefox
There are certainly other applications that create HTML Clipboard values. I ran into LibreOffice's when using Calc, their spreadsheet app, and its html clipboard doesn't include Start and EndFragment tags. Wonderful, folks, wonderful.
But isn't there one glaring omission I might want to add here? You know, I think there is at least one...
For fun, let's take a look at Firefox's fragment too. Firefox isn't as popular as it used to be, but it's probably worth taking a look. (Remember that this is all on Windows, and Safari is dead enough by now that I'm not going to bother with v5.)
Oh, so beautiful. Same whitespace as the original, with the added bonus (?) that the final paragraph is also text wrapped. No crazy inline CSS attempted. No header overhead or 1998-style HTML TAGS.
You could argue that Chrome is better because it has that inline CSS (yuck!) or Edge because it has the full page headers, but honestly, we're only one step farther away from what Edge gave us. We have the URL here. If we have network access to get CSS, we have network access to read the header and figure out where the CSS lives ourselves. Don't overcomplicate things. Beautiful. Good looking code continues to look good when pasted inline with Markdown.
Firefox Parsed Code
And Firefox's snippet is just as nice when pasted.
I miss Firefox.
posted by ruffin at 10/14/2016 11:46:00 AM
|Thursday, October 13, 2016|
Exactly right. I've had it do the same thing when I ask Siri to give me directions home, usually because I want to know if there's enough traffic to go an alternate route, and I get the same, "Who are you?!" complaint. But if I open Maps, "Home" is usually the first location listed.
QA sucks at Apple. I'm no longer politely questioning it.
Spend ten million (he said figuratively) and get the best QA staff in the business, and make sure there's no silo making QAing app interactions an issue. If Maps borks like this, the QA team "for Maps" has to be able to hold Siri and Contacts (or whatever else) accountable. No software ships until this blocking bug is fixed.
Good QA will think of and try these sorts of pretty obvious, yet creative, use (not edge, simply "use") cases before you ship.
Pitiful. Seriously pitiful.
posted by ruffin at 10/13/2016 02:38:00 PM
All posts can be accessed here:
Just the last year o' posts: