Posts Tagged Apple

 

How I fixed git-grep macOS UTF-8 support

As a speaker of Greek, I’ve been fixing issues in the handling of non-ASCII characters for over 40 years, using techniques ranging from simple lookup tables to dynamic patching of in-memory images. Here’s how I debugged and fixed the handling of UTF-8 characters in the git grep command, which was broken for almost a decade.

Continue reading "How I fixed git-grep macOS UTF-8 support"

Rather than alchemy, methodical troubleshooting

I recently encountered a pesky problem while trying to build a React Native project under Apple’s Xcode. The build would fail with an error reporting: EMFILE: too many open files, watch. Frustratingly, all available advice on the web pointed to different (often inexplicable) directions, none of which worked. After tormenting myself with these, I decided to troubleshoot the problem methodically, which allowed me to pinpoint it and solve it with an uncommon and noteworthy application of the git bisect command. Here’s the story.

Continue reading "Rather than alchemy, methodical troubleshooting"

Raspberry Pi vs USB vs Mac Audio

The audio hardware of Raspberry Pi is known to produce relatively poor sound quality. I bought a cheap USB sound card to try as an alternative. Here is what I found.

Continue reading "Raspberry Pi vs USB vs Mac Audio"

How to make a MacBook Kensington Lock Adapter

Apple, in its infinite wisdom, has not included a Kensington lock slot in the current model of the MacBook Pro computer. Given the computer's price, desirability, and the fact that three people I know have had theirs stolen, I decided to build an improvised adapter that would allow me attach a Kensington lock to the computer. I realize, that the security offered by such a contraption is what my colleague Vassilis Prevelakis calls an "advisory lock", for Kensington locks can be easily picked or pried away. However, I think it might deter a casual thief who would snatch the laptop you've left unattended for a couple of minutes.

Continue reading "How to make a MacBook Kensington Lock Adapter"

Applied Code Reading: Debugging FreeBSD Regex

When the code we're trying to read is inscrutable, inserting print statements and running various test cases can be two invaluable tools. Earlier today I fixed a tricky problem in the FreeBSD regular expression library. The code, originally written by Henry Spencer in the early 1990s, is by far the most complex I've ever encountered. It implements sophisticated algorithms with minimal commenting. Also, to avoid code repetition and increase efficiency, the 1200 line long main part of the regular expression execution engine is included in the compiled C code three times after modifying various macros to adjust the code's behavior: the first time the code targets small expressions and operates with bit masks on long integers, the second time the code handles larger expressions by storing its data in arrays, and the third time the code is also adjusted to handle multibyte characters. Here is how I used test data and print statements to locate and fix the problem.

Continue reading "Applied Code Reading: Debugging FreeBSD Regex"

Madplay on an Intel Mac

Numerous MP3 players around my house pull music from a central file server. The hardware I'm using is extremely diverse and many devices can nowadays be politely described as junk: they include 100MHz Pentiums with 16MB RAM, and an ARM-based prototype lacking support for floating point operations. For the sake of simplicity I've standardized the setups around a web server running on each machine to list static HTML pages containing the available music files, and simple shell-based CGI clients that invoke madplay to play the music. When I added an Intel-based Mac to the mix I found that madplay refused to work, producing only a white noise hiss.

Continue reading "Madplay on an Intel Mac"

Fixing the Orientation of JPEG Photographs

I used to fix the orientation of my photographs through an application that would transpose the compressed JPEG blocks. This had the advantage of avoiding the image degradation of a decompression and a subsequent compression.

Continue reading "Fixing the Orientation of JPEG Photographs"

Cross Compiling

Cross compiling software on a host platform to run on a different target used to be an exotic stunt to be performed by the brave and desperate. One had first to configure and build the compiler, assembler, archiver, and linker for the different architecture, then cross-build the other architecture's libraries, and finally the software. This week, while preparing a new release of the CScout refactoring browser I realized that what was once a feat is nowadays a routine operation.

Continue reading "Cross Compiling"

Everything Old is New Again

In 1984 the new kid on the block was Borland's Sidekick. A terminate and stay resident (TSR) program for MS-DOS, it would run in the background, and when it detected the two shift keys being pressed it would overlay the (then character) screen with a calculator, a notepad, a calendar, a dialer or an ASCII table.

Continue reading "Everything Old is New Again"

XML Abstraction at the Wrong Level

Over the last month I've encountered two applications that use XML at the wrong level of abstraction. Instead of tailoring the schema to their needs, they use a very abstract schema, and encode their elements at a meta level within the XML data. This approach hinders the verification and manipulation of the corresponding XML files.

Continue reading "XML Abstraction at the Wrong Level"

Apple's Presence in Greece Appears to be a Joke.

Earlier today I tried to buy an Airport Express base station by visiting what appeared to be an Apple store in Stournari street: the road in Athens with the largest physical concentration of computer shops.

Continue reading "Apple's Presence in Greece Appears to be a Joke."

Become a Unix command line wizard
edX MOOC on Unix Tools: Data, Software, and Production Engineering
Debug like a master
Book cover of Effective Debugging
Compute with style
Book cover of The Elements of Computing Style
Syndication
This blog is also available as an RSS feed:

Category Tags
AI (4)
AWS (4)
Android (2)
Apple (11)
C (21)
C++ (17)
Computers (58)
Databases (6)
Debugging (10)
Discussion (6)
Electronics (15)
Environment (1)
FreeBSD (26)
Funny (14)
GSIS (5)
Git (2)
Google (6)
Government (3)
Hacks (26)
Hardware (27)
History (13)
Information systems (1)
Internet (12)
Java (26)
JavaScript (1)
Linux (7)
Management (27)
Microsoft (11)
One Laptop Per Child (3)
Open source (58)
Opinion (30)
Parenting (11)
Perl (13)
Photos (13)
Politics (5)
Programming (110)
Python (3)
R (1)
Raspberry Pi (6)
Risks (7)
Scala (1)
Science (35)
Security (26)
Sights (19)
Smartphones (3)
Software (22)
Software engineering (93)
Standards (7)
System administration (46)
Teaching (9)
Technology (33)
Testing (3)
Tips (43)
Tools of the Trade (52)
Travel (9)
UML (6)
Unix (53)
Web (31)
Windows (17)
Writing (46)
XML (10)
vim (5)
Archive
Complete contents (382)
2024 (3)
2023 (5)
2022 (2)
2021 (3)
2020 (15)
2019 (4)
2018 (5)
2017 (20)
2016 (7)
2015 (6)
2014 (5)
2013 (13)
2012 (17)
2011 (14)
2010 (13)
2009 (40)
2008 (40)
2007 (41)
2006 (48)
2005 (44)
2004 (30)
2003 (7)

Last update: Wednesday, December 4, 2024 1:52 pm

Creative Commons Licence BY NC

Unless otherwise expressly stated, all original material on this page created by Diomidis Spinellis is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.