Cantina Theme Played on a Pencil
Sounds like a pretty weird instrument, but Dani Ochoa managed to do it!
P.S. She followed it up with The Imperial March.
Sounds like a pretty weird instrument, but Dani Ochoa managed to do it!
P.S. She followed it up with The Imperial March.
Just a quick reference of all the patches that fix the Meltdown bug (CVE-2017-5754) on Apple’s operating systems.
Not impacted.
Patched.
Version: 11.2
Release Date: 4th December 2017
Release Notes
Patched.
Version: 11.2
Release Date: 2nd December 2017
Release Notes
Patched.
Version: High Sierra 10.13.2
Patches for older versions:
Release Date: 6th December 2017
Release Notes
More information on Meltdown/Spectre.
Apple’s Statement on Markdown/Spectre
Michael Descy has written a great piece about finding a writing font, and why it isn’t just a waste of time.
Choosing the perfect writing font is a classic way to procrastinate—but it is not a waste of time. Fonts are important. A good font is not only highly legible, it also conveys a subliminal emotional effect on the reader. Naturally, it follows that it will also have similar effects on the writer. A good font will make you feel better while you are writing—maybe because you can read it more easily, or because you find elements of it, its curves or serifs, aesthetically pleasing. Whatever the reason, picking a font that is pleasing can have a profound effect on your writing.
He goes into detail on what makes a good writing font, some considerations you will have to make, and also a bunch of great suggestions.
For myself personally, I’ve always used a monospace font to write with. I once saw someone write about it before, although I can’t remember the source, but they explained how they used monospace fonts while they were writing/editing, and a sans-serif for previews. This is similar to how I feel myself.
Because I write everything I do in Markdown, it still feels like I’m writing code, not a programming language, but still something that has to be deciphered before it’s fit to be seen by anyone else. And for some reason, monospace fonts use feel like they represent something that’s in progress.
So, the font I use for nearly everything is SF Mono. It’s the monospace version of Apple’s San Francisco font, and it’s been my favourite ever since they released it. However, it requires some fiddling to have it installed like a regular font. Before that I used the pretty similar, Andale Mono.
You’ve probably heard about the two major bugs that have been hitting the news recently. Their names are Meltdown and Spectre, and they affect nearly every modern computer processor.
As there’s so much information flying around the internet, it’s easy to not grasp the whole picture, or just have an easy place to direct other people to.
Luckily, Graz University of Technology have created MeltdownAttack.com, which explains both bugs, links to their relevant papers, and then some common questions and answers.
Meltdown and Spectre exploit critical vulnerabilities in modern processors. These hardware bugs allow programs to steal data which is currently processed on the computer. While programs are typically not permitted to read data from other programs, a malicious program can exploit Meltdown and Spectre to get hold of secrets stored in the memory of other running programs. This might include your passwords stored in a password manager or browser, your personal photos, emails, instant messages and even business-critical documents.
Meltdown and Spectre work on personal computers, mobile devices, and in the cloud. Depending on the cloud provider’s infrastructure, it might be possible to steal data from other customers.
This is just something small in Swift/iOS that I find pretty handy, so I thought I’d share it just in case it can help.
So, the problem is that creating data that has to be presented in a UITableView can be somewhat complex, especially if you have multiple columns. This solution is geared towards quickly creating dummy data, but I think it could be expanded into an overall DataSource solution.
Anyway, we’ll start with the current way of managing sections. Usually, you would have some kind of enum that would correspond to a section integer, and also however many arrays of data for the number of sections. You would then either use the section enum to find the correct array. Or maybe you’d use a 2d array, and then use it as the index.
It just doesn’t see very Swift to me. In Swift, everything is simple, easy to read, and is pretty easy to write. So I thought I’d come up with a slight abstraction.
My first idea was to just make two structs, one for a Section, and another for a Table:
struct Section {
var title: String
var items: [String]
}
struct Table {
var sections: [Section]
}
You could then go ahead, create individual sections, and add them to one table. Easy.
Example Data
Animals:
Example Code
let catSection = Section(title: "Cats", items: ["Tiger", "Lion", "Lynx"])
let bearSection = Section(title: "Bears", items: ["Grizzly", "Black", "Polar"])
let animalTable = Table(sections: [catSection, bearSection])
I just find that a bit more readable.
It also makes the number of sections and rows a bit simpler:
let numberOfSections = animalTable.sections.count
let numberOfRows = animalTable.sections[0].items.count
However, you can add this functionality to the Table struct Which makes it much, much better.
Here is the definition of the ComplexTable
struct:
struct ComplexTable {
var sections: [Section]
func numberOfRows(forSection section: Int) -> Int {
if sections.count > section {
return sections[section].items.count
} else {
return 0
}
}
func numberOfSections() -> Int {
return sections.count
}
}
Which would make it this easy to get the row and section counts:
let numberOfSections = complexAnimalTable.numberOfSections()
let numberOfRows = complexAnimalTable.numberOfRows(forSection: 0)
So there you go.
It’s nothing big, and it won’t win many programming awards. But it’s a small piece of code that will certainly help me when I’m just messing around with tables, or I want a really clean and simple way to store small amounts of organised data.
I’ve been getting annoyed recently with the amount of simulators I had installed in Xcode at work. But I’ve come across a really simple command that will fix this automatically.
I had 10.1, 10.2, 11.0. 11.1, and 11.2 installed, which I then reduced to just two of them. Then instead of painfully selecting and deleting each generated simulator, I just typed this:
fastlane snapshot reset_simulators
It uses Fastlane’s Snapshot tool, and what it does is delete all of your current simulators, and generate a set of new ones depening on the current SDKs you have installed.
The avatar images “work”!
I have them displaying properly, downloading properly, and also using placeholders when it hasn’t been downloaded yet.
Images also cache up to a predefined limit, and are stored with the URL as a key.
The only thing left, is to then update whatever is presenting the placeholder image, when the real one has finished downloading.
A few months ago, I started working on my own analytics service for my blog. I did this for many reasons, but ultimately for control and user privacy.
I only actually ever store four pieces of data:
So while there’s not much data there, I can track everything I need, so like visits per day, per post, and I can get an idea of where traffic is coming from.
There have been occasions where the service, which I named “Minilytics”, has gone down though, so I can’t say I’ve tracked all the visits. But I’ve got a few things to share.
Performance
I made nice SQL query that shows me the performance of the site for each day. I use the view count for that day, and run it through a few conditions that will then output a string that I’ve manually set up. It’s not as exact as viewing the view count, but much easier to visualise.
Monthly View Count
Again, this isn’t totally accurate as these numbers may be higher and it hasn’t tracked them. But this simple count of views from each month, is a good way to check the general increase/decrease in visits over time.
I’m going to try writing some more queries soon, and see what other insights I can pull from the data. But overall I think the site has been getting a lot more traffic recently! Especially since I moved the blog over to WordPress a few days ago. My guess is that the WordPress installation has better meta tags, descriptions, and stuff that search engines like.
So, Apple finally came clean with the battery stuff on older iPhones:
We’ve been hearing feedback from our customers about the way we handle performance for iPhones with older batteries and how we have communicated that process. We know that some of you feel Apple has let you down. We apologize. There’s been a lot of misunderstanding about this issue, so we would like to clarify and let you know about some changes we’re making.
First and foremost, we have never — and would never — do anything to intentionally shorten the life of any Apple product, or degrade the user experience to drive customer upgrades. Our goal has always been to create products that our customers love, and making iPhones last as long as possible is an important part of that.
The situation isn’t ideal, in that they’ve annoyed, and probably confused some of their customers by not making it transparent from the start.
However, the actual power management feature that people are complaining about, actually seems like a really good idea.
About a year ago in iOS 10.2.1, we delivered a software update that improves power management during peak workloads to avoid unexpected shutdowns on iPhone 6, iPhone 6 Plus, iPhone 6s, iPhone 6s Plus, and iPhone SE. With the update, iOS dynamically manages the maximum performance of some system components when needed to prevent a shutdown. While these changes may go unnoticed, in some cases users may experience longer launch times for apps and other reductions in performance.
I’ve seen a lot of news outlets saying that this is Apple trying to move people to newer iPhones, and even that it is causing iPhones to not last as long (Not the battery, but the actual device’s lifespan).
I can only see this update doing the exact opposite. It slowed down performance, but that is to extend the short term battery life, and also the long term life of the device.
The lack of communication is what messes everything up though. Even if you disregard the trust factor of Apple doing this without telling anybody, it leads users to believe that they are affected by it, when in some cases they might not be. So after seeing a small bit of news about Apple slowing down iPhones, someone with a completely unrelated device, or even an affected device with another issue, would more than likely blame this new power management update.
What Apple are doing about this, is actually quite impressive. They’re reducing the price of an out of warranty battery replacement by $50. But more importantly, they’re going to start making the battery heath more visible in iOS. It’s something you have on a Mac, and I will welcome it to iOS.
They could have avoided this whole situation though, as clearly they proved they can be transparent about this feature (although in this case it was forced). So why didn’t they write a small article about a “new power management feature” and how they’re extending the lifespans of older devices, and then just make the whole thing optional.
Jesse Watson has just published a time-lapse he shot of the recent SpaceX launch. You know, the one that looked really strange, and not like any rocket we’ve seen before. However the video is of course over a much longer period of time, and shows a wider angle of everything that went on.
He filmed it from Yuma Arizona, roughly 400 miles away from the launch site. And it took quite a bit of planning:
I scouted four locations that had foregrounds to add depth to the imagery and was uniquely inspiring to my hometown. Location choices were between a favorite local hiking mountain, the Imperial Sand Dunes, or a small hill that resides in the historic downtown area overlooking the city. I ended up choosing the location that overlooked the city, partially because it was the easiest to access with all of my time-lapse gear. I used The Photographer’s Ephemeris and Google Maps to help scouting and initial line up.
I have never shot a rocket launch before, so I did not know exactly what to expect as far as exposure or precise location of the rocket in the horizon. I wanted to be prepared to capture comprehensive coverage of the spectacle. Therefore I packed four cameras and five lenses, to cover wide to telephoto details of the scene. Three of the cameras were rolling time-lapse and 1 was setup for telephoto video.
It’s certainly an interesting story, and also a fantastic video.
Watch below in the embedded player, or if that fails, it’s on Vimeo along with his story.