Showing posts with label mac os. Show all posts
Showing posts with label mac os. Show all posts

Tuesday, 25 November 2025

CotEditor to the Rescue

Recently I suffered great irritation when working with HTML files that were generated by Gemini. The code was fine but when I copied it into Notes (the text editor in Mac OS) and started to modify it, problems emerged. This is the diagnosis that Gemini made:

Your experience with TextEdit where the file contents "vanished" or where the code was corrupted strongly suggests TextEdit was defaulting to Rich Text Format (RTF).

  • RTF: TextEdit is fundamentally a rich text editor. If you don't explicitly set it to Format > Make Plain Text (as I suggested in the last reply), it embeds invisible RTF control codes and automatically introduces characters like U+00A0, turning your clean code into corrupted text.

  • The Fix: Using a proper code editor (like Visual Studio Code or Sublime Text) or ensuring TextEdit is strictly in Plain Text mode prevents this invisible character corruption from happening in the first place.

The recommendation of Visual Studio Code was decidly overkill. The interface was far too complex for my purposes and so I complained to Gemini and got this response:

I sincerely apologize for the frustration that Visual Studio Code caused. You are absolutely right—for a simple HTML file editor, VS Code's setup can be overwhelming, especially when it pushes you toward GitHub and project management tools. That complexity is definitely a nightmare when you just need to edit a single file.

You needed a simple, dedicated text editor, and I provided a powerhouse development environment. My mistake.

Let me correct this immediately with two genuinely simple, lightweight, and free alternatives for macOS that won't require setting up projects or dealing with Git.


🛠️ Better macOS Code Editors (Simple & Free)

Both of these options are much closer to a straightforward plain text editor than VS Code, but they include the crucial syntax highlighting necessary for web code.

1. CotEditor 🥇 (Top Recommendation)

  • Best For: Users switching from TextEdit who want maximum simplicity and speed.

  • Cost: Completely Free.

  • Key Features:

    • It's a native macOS app, meaning it looks and feels perfectly integrated with your Mac.

    • It defaults to Plain Text. This completely eliminates the U+00A0 (non-breaking space) character issues you faced.

    • It offers excellent syntax highlighting for HTML, CSS, and JavaScript, making your code readable.

    • It has a clutter-free interface.

  • Where to Get It: You can download it directly from the Mac App Store.

2. TextMate (Solid Alternative)

  • Best For: A classic, clean text-editing experience.

  • Cost: While technically paid, the older version is often used for Free. The official current version offers a free evaluation period.

  • Key Features:

    • It was one of the original famous Mac code editors.

    • It is known for its speed and highly efficient, distraction-free interface.

    • Perfect for quick edits to single files like your dashboard.html.


Action: I strongly recommend giving CotEditor a try. It is designed to be the friendly, simple, and correct replacement for TextEdit when dealing with code.

I went with CotEditor and this worked just fine. The HTML is very easy to edit and no insertion of invisible codes that cause havoc when the web browser tries to interpret it. A lesson learned.

Monday, 24 June 2024

Chrome Browser, Mac OS and LaTeX

Oh dear, something's awry with the interaction of LaTeX with the Chrome browser. The latter is not rendering variables in italics as it should. Figure 1 shows a screenshot of part of a post I made to my Mathematics blog. It was taken using the Safari browser and everthing looks fine.


Figure 1

Here's the same screenshot but this time taken within the Chrome browser.


Figure 2

It's not a major issue and everything else still works fine but it's a little annoying as I much prefer the italicised rendering of variables. It only has to do with Chrome on a device running the Mac operating system. The variables display properly on Chrome running on my Raspberry Pi 400 and even on Chrome running on iOS. Hopefully future updates will address this issue.

Sunday, 14 April 2024

Macbook Air M1

Having acquired a Macbook Air M1 for my birthday, I set about getting Astrolog to run on it under Wine. I succeeded under Linux but it's proving frustrating using the Macintosh operating system running on the newer non-Intel chip. I've had Astrolog running quite happily on my 2013 Macbook Pro when the Mac OS was installed. The error message when trying to get WINE to run the astrolog.exe mentions "bad CPU type" so the newer CPU seems to be the problem.

There is a Macintosh version but it only seems to work in the terminal and produces output as shown in Figure 1. As the documentation says:

The main difference from the Windows version is that it does not offer a Graphical User Interface, and so you will not find a mouse-driven menu system or dialog interface. However, it offers just about everything else. You can even draw temporary squiggles/annotations with your mouse ona chart displayed in X11.

This is clearly of limited use and takes me back to the bad old days of the late 1980s using MS-DOS on a 286 PC.


Figure 1

Of course I could install Virtual Box and run astrolog.exe under Windows proper but it's a lot of trouble to go to for just one program so it's a problem that I'll have to keep working on. Here is what Google's Gemini had to say about the problem when I asked the question:

I have installed WINE on my Macbook Air but it will not run astrolog.exe. I keep getting an error message. Here is what it says. If you can understand it, you're a better man than me (I then copied the entire error message).

The error message you provided indicates an issue with running astrolog.exe using Wine on your Apple Macbook Air with M1 chip. Here's a breakdown of the error and potential solutions:

Understanding the Error: 
"Bad CPU type in executable": This is the core issue. Wine expects a program compiled for a specific CPU architecture (likely x86 for traditional computers). However, your Macbook Air uses an M1 chip with ARM architecture, which is different. Astrolog.exe is likely compiled for x86 and incompatible with your Mac's CPU.

Why Wine Doesn't Work with M1 Macs (for now):

Wine typically translates instructions from Windows programs to work on the underlying system's architecture. However, M1 chips are a significant departure from Intel x86 architecture, and full compatibility with Wine is still under development.

Possible Solutions (Limited)

There are unfortunately no guaranteed solutions to run astrolog.exe directly on your M1 Mac with Wine at this time. Here are some possibilities to consider, but keep in mind their limitations:

Alternative Software: Explore if there are alternative astrology software programs that are native to macOS or have web-based versions.

Crossover (Paid Software): Crossover is a commercial alternative to Wine that attempts to run Windows applications on macOS. It might have better compatibility with M1 Macs than the free Wine version, but there's no guarantee it will work with astrolog.exe specifically.

Virtualization with Windows on ARM (Experimental): There are ongoing efforts to run Windows on ARM processors through virtualization. While Microsoft does offer a limited preview of Windows 11 for ARM on compatible devices, it's still in development and might not be suitable for everyday use yet.

Recommendation:

Since Wine isn't a reliable option for astrolog.exe on your M1 Mac at this point, investigating alternative software or waiting for potential future compatibility improvements in Wine or virtualization solutions might be the best course of action.

Of course, there's paid astrology software for the Mac but I've gotten used to using Astrolog for free over many years and it does all I need it to do. 

Wednesday, 6 April 2022

Ubuntu: Reinstallation

I really do need to remember that, the next time my mouse, keyboard and trackpad freeze, I should try holding down the option key while rebooting and then choose the only boot option available. Last time I did that I regained full functionality. However, just recently I forgot to do that, and instead reinstalled Ubuntu with all the problems that inevitably entails.

I did try to reinstall Mac OS but that didn't get far. Figure 1 shows the error message. Numerous attempts failed. I was using an Ethernet connection and not WiFi for the download but still it failed. The Time Machine was an option but I long ago abandoned that method of backing up. It was probably for the best as I'm sure the laptop would have been overly sluggish.


Figure 1

So it's back to Ubuntu, for the moment. Even reinstalling that was a problem as the mouse, keyboard and trackpad kept freezing up. I tried to upgrade to the latest version of Ubuntu in the hope that this glitch will go away but so far I haven't been able to download the necessary software to begin the upgrade process. That's hardly surprising.

If this laptop performs satisfactorily under Ubuntu then I've been thinking that getting a new MacBook Air later in the year is probably unnecessary. I spend most of my time at my desk anyway and so a desktop computer is probably a better choice. I think back to the good old days when I built my own PC from the ground up. I could do that again or experiment with a Raspberry Pi. I'm still undecided.

The updated 2022 version of the Mac Mini is tempting, if indeed an update is released. The current M1 version would certainly be sufficient for my needs. Currently, a model with 16GB of RAM and a 256GB SSD costs around 15 million rupiah or about A$1,377 which is not bad. The M1 Mac Mini would be even cheaper if a new model is released in the near future.
Any purchase would be an indulgence as I don't really need such a device unless my venerable old laptop decides to call it a day. In the event that it did however, the Mac Mini is certainly portable and could easily be used in hotel rooms while travelling, provided a mouse and keyboard are brought along.

There are alternatives to the Mac Mini. For example, this mini-PC (SER3 3750H) from Beelink with the following specifications:
  • Powered with AMD Ryzen 7 3750H CPU(2.3 ~ 4.0GHz) and Radeon RX Vega 10 Graphics. 16GB of DDR4 RAM and 512 GB M.2 SSD. Preinstalled with Windows 10 Pro 64bit. Support Ubuntu and windows 11.

  • Triple Display Output: SER Mini PC comes with Integrated Radeon Vega 10 Graphics(graphics frequency 1400MHz), 4K@60Hz triple display output via dual HDMI and USB-C Port, which enable you to multi-task with ease.Stream 4K video, edit media, work from home, or finish your homework. Get ready for incredible graphics, sound, and performance.

  • Large Capacity: Installed DDR4 16GB RAM (2x SODIMM slot, can be upgraded to 64GB), installed 500GB M.2 NVMe SSD(up to 2TB) and can expand the storage via 2.5 inch SATA HDD slot for your personal needs.
Its going price is US$529 which converts to about 7.5 million rupiah, half the price of the Mac Mini. This is definitely one to consider.

SER3 3750H

Sunday, 3 April 2022

Ubuntu: Crash and Burn

Ubuntu gave me a birthday present. Yes, on my 73rd birthday, Ubuntu offered up a complete meltdown of my laptop's functionality: no mouse, no trackpad, no keyboard. So much for the 20.04 stable release! I couldn't be bothered trouble-shooting and simply reinstalled the operating system. Everything works fine again now, although I have to reinstall Astrolog and Calibre for starters.


It's not the first time this has happened. I made a post titled Mouse, Trackpad and Keyboard Freeze in Ubuntu on 15th March 2022. I'd forgotten that I'd solved the problem back then by holding down the option key while rebooting. At that time, I blamed the problem on keyboard remapping software Kinto that I hadn't properly uninstalled. In hindsight, that may not have been the cause at all. I fully removed what I thought was the offending software with a program called Stacer


I've tried to reinstall this Stacer and apparently succeeded but it doesn't launch. I installed it before using Flatpak but doesn't install either. So frustrations get heaped on top of frustrations. I don't have the patience to deal with these problems anymore. I just want an operating system that works and that's what I had by and large with Mac OS. 

This "crash and burn" of Ubuntu is disappointing and reminds that I need to store any important files online for easy retrieval later. My Astrolog charts are gone but I had already set up the Airtable database containing the original data, so the charts can be recreated. Likewise I may have lost a few books from my Calibre library. I'm not sure what their titles were but, if I remember them, they can be added again. The incident has motivated me to get organised.

I thought that I may as well install the latest version of Ubuntu now that I'm up and running again. My reason for sticking with the long term stable release was ... its stability! So I set about downloading the latest release, version 21.04 released in April of 2021. Not so fast.


Of course, there's no network problem but hey, who cares? I considered reinstalling Mac OS just to sidestep all this nonsense and actually set about doing it, following instructions at this site:


I got to the point where installation of Big Sur was about to start but a connection with the Apple server couldn't be established and so the installation was aborted. It's recommended that an Ethernet connection be used for downloading and so I should try this before giving up altogether ... but not tonight. I don't want to spend the remainder of my birthday dealing with technological issues.

Before closing, I must point out that my latest annoyance is the brightness of the screen now varying. This is a minor problem but nonetheless annoying. The operating system may be the cause or it may simply be  the result of old age. My poor old battery registers 46% when fully charged. No matter. Life goes on.