tag:blogger.com,1999:blog-87975265796511671222024-03-05T18:37:48.462+00:00Views of a CoderThomas Tempelmann about programming in general, and OS X, iOS and Xojo in particularThomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-8797526579651167122.post-72570134327122998632022-12-16T18:41:00.003+00:002022-12-16T18:41:51.260+00:00"Failed to Enable Personal Hotspot on iPhone" – finally, a solutionSome of my older Macs running High Sierra or Mojave were unable to join the Personal Hotspot of one or even two of my iPhones.I searched the Apple "Community" Support forums and found several related questions, with lots of "I have the same issue" tags, but with no helpful answer:https://discussions.apple.com/thread/8153026https://discussions.apple.com/thread/8337291https://discussions.apple.com/Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com1tag:blogger.com,1999:blog-8797526579651167122.post-20456551950186478252022-02-19T14:08:00.005+00:002022-02-19T15:38:03.796+00:00What I did in the past 2 years, programming related
I had stopped to blog here in 2019 because I wasn't too happy with the blogging platform I'm using (Blogger). I was looking for alternatives, but with the constraint that I'd be able to keep the existing blog posts, along with their sometimes valuable comments. I gave Wordpress a few attempts but am not too happy with its complexity and rather frequently discovered new vulnerabilities. I also Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com3tag:blogger.com,1999:blog-8797526579651167122.post-65703808882294915562019-06-30T11:42:00.002+01:002022-02-19T12:46:10.966+00:00
TT's generic programming guidelines
Declare your local variables close to where they're used
Do not declare all your variables at the top. Instead, declare them where you use them first. That makes it easier to see their type and also leads to better locality, avoiding accidental use of stale (old) values.
Bad style:
var i as integer
var item as FileReference
var files() as FileReferenceThomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com0tag:blogger.com,1999:blog-8797526579651167122.post-1351711615400485272019-05-11T17:13:00.005+01:002020-08-21T14:52:42.320+01:00Cloning APFS Volumes & Containers ("APFS inverter failed")(This is an older article that I hadn't published back then because it might not be fully accurate, i.e. the steps may not be applicable. Yet, it contains some valuable information so I decided to publish it now. Read with a grain of salt. If you have corrections, don't hesitate to comment or email me.)
TL;DR
If Disk Utility fails to clone an APFS container, giving "APFS inverter failed" as Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com20tag:blogger.com,1999:blog-8797526579651167122.post-10682891829744929552019-05-11T16:54:00.001+01:002019-05-11T17:09:45.430+01:00Understanding bugs in Xojo, or not getting them fixedA former employee of Xojo Inc. once met with an Apple Developer Support (DTS) engineer, looking over some code. The Apple engineer saw a note mentioning my name and told the Xojo employee: You know Thomas Tempelmann? I know him, too: "He's the best type of user, the one that debugs a problem so far so that he tells you exactly what you're doing wrong, and how to fix it."
I'm not infallible,Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com0tag:blogger.com,1999:blog-8797526579651167122.post-70709754157789247692019-04-22T03:01:00.002+01:002019-05-11T16:35:37.489+01:00Performance considerations when reading directories on macOS(Latest update: 11 May 2019, see end of text)
I'm developing (and selling) a fairly popular file search program for the Mac called Find Any File, or just FAF.
It works differently from Spotlight, the Mac's primary search tool, in that it always scans the live file system instead of using a database. This makes it somewhat slower in many cases, but has the advantage that it looks at every file Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com4tag:blogger.com,1999:blog-8797526579651167122.post-14611679070492670472018-08-10T17:52:00.004+01:002018-08-10T17:52:49.917+01:00Locating and updating symlinks and Finder Aliases with FAFToday I renamed one of my internal disks in my Mac Pro. I then realized that I had created a few symlinks to that volume, and those would now become invalid.
For example, if the disk used to be called "Data" and is now called "Backups", then symlinks I may have created would still point to "/Volumes/Data/..." but need now point to the new name instead.
Since I knew that there would only be a Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com0tag:blogger.com,1999:blog-8797526579651167122.post-50428671498317845062017-07-19T20:03:00.000+01:002017-10-03T14:56:06.236+01:00APFS and fast catalog searchThis is about FSCatalogSearch / searchfs support in macOS with the APFS file system.
Updated 3 Oct 2017: Find Any File 1.9 will support fast search on APFS on High Sierra (10.13) by using the searchfs function. Version 1.9 is currently in open beta, see the FAF web site.
Updated 25 July 2017: Clarified why FSCatalogSearch doesn't work on APFS, adds issue about hard links and 64 bit CNID Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com10tag:blogger.com,1999:blog-8797526579651167122.post-60803470687832247942017-07-05T16:59:00.003+01:002020-03-29T16:15:01.533+01:00Recover lost BootCamp Windows partitions on a MacI have installed several Windows 7 and 10 version on several of my Macs using Apple's Boot Camp feature.
Recently, I found that almost all of them have disappeared: I was not able to boot from them any more when I held down the option (alt, ⌥) key at startup - the Windows partitions would either not appear at all or not boot up.
The main reason in my case was that the MBR was reset to a plain Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com0tag:blogger.com,1999:blog-8797526579651167122.post-52860235287207005182017-04-08T16:44:00.002+01:002017-04-18T10:11:34.421+01:00Adding fast external disks to various Mac models, with benchmarks2nd Update on 9 Apr 17: See end of article
3rd Update on 18 Apr 17: Added more adapters
I wanted a fast external disk for my three Macs, which are now all 5 years or more old:
MacBook Pro Mid 2012 ("MacBookPro10,1"), 2.6 GHz Core i7
iMac 27" Mid 2011 ("iMac12,1"), 3.4 GHz Core i7
Mac Pro Late 2008 ("MacPro3,1"), 8 Core-Xeon 2.8 GHz
The Mac Pro has no Thunderbolt ports but I've Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com1tag:blogger.com,1999:blog-8797526579651167122.post-85491312987262607632017-03-28T16:33:00.001+01:002017-03-28T16:43:37.989+01:00Xojo: How to improve performance when using WeakRefsIf you're building tree structures with leaves (children) that shall keep a reference to their branch (ancestor, parent) they're attached to, the simplest (but not smart) solution is to store a direct references to the parent object in the child object.
Imagine this node class:
class Person
property name as String
property parent as Person
property children() as Person
end Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com1tag:blogger.com,1999:blog-8797526579651167122.post-56817903879182409272016-03-24T15:10:00.005+00:002016-03-24T15:13:32.461+00:00Using USB barcode scanners on Macs with XojoBarcode scanners translate 1D and 2D bar codes, such as Code128 and QR Code, into readable characters.
Usually, handheld bar code scanners with a USB interface simulate a keyboard by default. With that, they work out of the box: If you scan a code with such a reader, it'll send keyboard strokes to the computer.
This makes them easy to use, but it also causes some issues:
If you have a program Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com0tag:blogger.com,1999:blog-8797526579651167122.post-13998415181303010092015-10-31T17:29:00.001+00:002015-10-31T17:29:43.516+00:00Searching multiple Xojo projects
Finding that useful method or class in one of your numerous Xojo projects
If you've used Xojo (Real Studio) for a while, you'll probably have collected more than just one project.
And each of these projects contains unique code, and some of that may even be re-usable for other projects.
How do you keep track of all the code and methods you've written in the past? E.g, you do rememberThomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com1tag:blogger.com,1999:blog-8797526579651167122.post-38972091231135762992015-09-21T18:18:00.000+01:002015-10-31T15:53:27.081+00:00New: OS X Automator Action plugin for invoking ServicesWhen I started adding Services to my apps (Find Any File, iClip), I realized that this was not enough for users who want to write workflows with Automator or Applescript because there seems to be no way to invoke Services from Automator nor AppleScript.
So I wrote an Automator Action that allows you to run any Service that operates on Text or Files & Folders:
Find instructions and the Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com0tag:blogger.com,1999:blog-8797526579651167122.post-50575047888608025862015-09-17T20:24:00.001+01:002016-07-04T11:47:23.583+01:00Xojo SQLite databases: Enabling ICU for full Unicode support and adding custom functions
Unicode Support (ICU)
Xojo's default Database class REALSQLDatabase (or its replacement SQLiteDatabase), which is based on sqlite, does not support international (non-english) characters. For instance, if you try to use the SQL function upper on a french phrase such as Tête-à-Tête, you will get TêTE-à-TêTE, i.e. only the plain ASCII chars (a-z) will get uppercased but not Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com2tag:blogger.com,1999:blog-8797526579651167122.post-59730170148350706972015-05-17T15:12:00.005+01:002015-05-17T15:13:52.965+01:00Ricoh / Pentax Flucard reverse engineeringI have done some quick reverse engineering on the FluCard (a wireless memory card for Pentax DSLR cameras), revealing some additional commands it offers.
I'd like to do more work on this, such as actually decoding some of its busybox code, but have no time for that currently.
Details are here: http://www.tempel.org/Photo/FLUcard
Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com0tag:blogger.com,1999:blog-8797526579651167122.post-55731658247213826372015-01-08T00:48:00.000+00:002015-01-08T09:21:55.283+00:00OS X Kernel Hacking (fixing the psignal kernel bug)At the German Macoun conference in Oct 2014 I gave a talk about rootkits and hacking the OS X kernel.
This article is a summary and follow-up on this topic.
Introduction
Since Yosemite (OS X 10.10), kernel extensions (KEXTs) need to be code signed or they won't get loaded any more. The code signing certificate needs to be optained from Apple, and it's not easy to get it - and even if youThomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com0tag:blogger.com,1999:blog-8797526579651167122.post-20297301011015774582014-11-26T19:10:00.000+00:002014-11-26T19:10:12.848+00:00Making CUPS printer drivers work again on OS X Yosemite (OS X 10.10)I recently found out that some printer drives using the CUPS printing system stopped working on OSX 10.10 (Yosemite) that worked fine with the previous OSX Mavericks (10.9).
After some googling around I found various suggestions, but none seemed to help. In the end, it turned out that I had to follow THREE different suggestions to make it work. To save you the same odysee, here's my recipe for Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com4tag:blogger.com,1999:blog-8797526579651167122.post-36653686389699050722014-11-04T18:13:00.000+00:002014-11-04T18:15:49.475+00:00Find Empty Folders - a free OS X toolToday someone asked me if I knew a way to find and delete empty folders, even if they contain an invisible .DS_Store file.
I googled and found nothing.
So I quickly whipped something out with Real Studio.
The result can be found here:
http://www.tempel.org/FindEmptyFolders
Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com0tag:blogger.com,1999:blog-8797526579651167122.post-31277566873069986792014-07-18T13:47:00.000+01:002014-07-18T13:47:35.823+01:00Something adventurous for a change (Nelly Cootalot)Today I'm just helping promote someone else's work.
With this blog being directed mainly to other (programming) geeks, I think you might even be the right audience:
Did you enjoy playing Monkey Island, Leisure Suit Larry and other funny point-and-click adventures? (Though, the first Larrys I played were running still on DOS, without mouse support.)
And do you enjoy british humour?
And, Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com0tag:blogger.com,1999:blog-8797526579651167122.post-76381724779762218862014-07-07T22:48:00.001+01:002014-07-07T22:50:21.245+01:00OS X: Moving Files to Trash from your own application, with optional user interaction!When you're writing a interactive Mac OS X program, it's possible that you need to delete files.
And if they're files the user has access to, then it's often a good idea to move them to the trash instead of erasing them right away, in order to give the user the opportunity to restore them again (saving you the need to provide some kind of Undo command for the destructive operation).
Moving Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com1tag:blogger.com,1999:blog-8797526579651167122.post-10943143523644284292014-05-18T13:00:00.000+01:002014-05-18T13:00:25.225+01:00Using the Cocoa animation API with XojoI've just published a Xojo / Real Studio class for doing smooth fade/mode/resize animations with windows and controls.
Find out more about it here: http://www.tempel.org/RB/CocoaAnimation.Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com0tag:blogger.com,1999:blog-8797526579651167122.post-15644105907419832282014-03-26T22:10:00.000+00:002014-03-26T22:39:02.296+00:00Customizing Xojo's controls on OS X with Cocoa
This article is about some advanced techniques for Xojo users that write OS X Cocoa apps.
If you are using Xojo to build OS X Cocoa applications, you can customize the controls much further than Xojo offers directly.
Let's take the PopupMenu. It's fairly limited in appearance (one look only) and capabilities (no icons in the menu, for instance).
Changing the appearance of such a control is Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com4tag:blogger.com,1999:blog-8797526579651167122.post-88592534149937866972014-02-18T16:59:00.001+00:002014-02-18T17:00:54.662+00:00iClip 5.1.2 with Search and "Smart Sets" now in betaFor the past few years I've taken over the development of iClip 5, a Clipboard / Pasteboard tool for OS X after the original author abandoned it to instead get insanely rich with selling iOS apps and organizing Bundle deals.
iClip is now again in beta testing. The new version adds a search feature that also lets you create smart search sets in order to see ony specific clippings, e.g. only thoseThomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com0tag:blogger.com,1999:blog-8797526579651167122.post-85592986741063606492013-12-14T20:44:00.000+00:002013-12-23T09:50:22.895+00:00New: OS X Prefs Editor for editing app defaults
Mac OS X 10.8 introduced a caching system for app preferences ("cfprefsd"). While this probably increases performances for apps, it makes it harder for developers to manipulate preference values quickly for testing, because making changes directly to the plist files in the ~/Library/Preferences folder does not work any more with editors such as "Property List Editor.app" and the similar one in Thomas Tempelmannhttp://www.blogger.com/profile/17366020023638328512noreply@blogger.com2