DiskWarrior – The Battle of Data Recovery

DiskWarrior App IconI’ve been encountering a strange number of disk problems lately. It’s almost suspicious. Yet, I suppose that is to be expected with older computers. Over the years, damage can sneak in. Neglect can make matters worse. Macs “just work”, so it can be unsettling when they stop working. Perhaps I’ve been overestimating the durability of Mac hardware and software. With three dead drives this year, I decided to call in a clincher – DiskWarrior.

Continue reading “DiskWarrior – The Battle of Data Recovery”

Kites vs Drones

Parrot KiteThe northern hemisphere is entering Spring. That means warmer weather and more outdoor activities. As a technologist, it’s important to make an effort to go outside. Otherwise, I could spend the entire season at my desk. That’s not very healthy and it also leads to burnout. So, while wandering the aisles of Costco, I spotted something entertaining. There were boxes filled with colorful kites. A total impulse buy lead to two wonderful weekends. Instead of slaving away at the keyboard, I was at the beach. A refreshing breeze lifted my kite and my spirit.

Continue reading “Kites vs Drones”

Five Typical Programming Mistakes For Beginners

Single Equal Sign on Conditional

A big part of programming is storing values and then comparing them. If this, then do that. Here’s a very basic example in JavaScript…

1
2
3
4
5
6
7
var x = 3;
var y = 4;
if (x = y) {
console.log("They're equal.");
} else {
console.log("They're not equal.");
}

What message should be displayed? Obviously, 3 is not equal to 4. If “x” equals “3”, and “y” equals “4”, then x ≠ y. In this short program, is the “They’re not equal” message displayed to the console? No, if you try running it for yourself, the message “They’re equal” is displayed. Here’s the real mind-blowing part. It’s actually a true statement!

In the conditional part of the program, the characters “x = y” are used. If you read that, the voice in your mind makes it sound correct. “If ‘x’ equals ‘y’ then…” However, that’s not what the computer is doing. It’s setting the value of “x” to the value of “y”.

To fix this problem, simply use two equal signs. The correct code is “x == y”. It looks a little weird, but those are the rules. This is not just a problem for beginners. If you’re in a rush, or under the pressure, you could easily miss it. The way to avoid this problem is to have a solid understanding of Comparison Operators.

https://www.w3schools.com/jsref/jsref_operators.asp

Case Matters

Even just writing this article, I fell into a typical trap. Capitalization matters! A variable of “x” is not the same as “X”. To your mind, “x” and “X” are practically the same thing. To a computer, it doesn’t think. It just runs programs.

Arrays Start at Zero

Variables are one way to store values. But if you have a lot of values, an array makes it easier to organize. It’s like an Excel spreadsheet in your program. The problem is that Excel starts at row #1. An array, in programming land, typically starts at row #0. This is another one of those things that messes with the voice in your head. “I want the first row”. OK, that’s array[0]. This can be very confusing, especially for beginners.

A nice way to solve this problem is to include table headers in your array. By putting column labels at the top, the rest of the array is shifted one row down. The numbers align. It’s makes more sense.

If you’re using “Mr. Data Converter” to convert your data to web-friendly formats, such as JSON and XML, there’s a “First row is the header” option.

Conclusion

There are lots of ways to screw up in programming. The more you learn, the more involved your projects become. This leads to more complicated problems to solve. If you think you’re having trouble battling with problems as a beginner, it doesn’t get better – it gets worse. What gets better is you. One of the tricks of being a good programmer is identifying problems and then figuring out ways to solve them. If you’ve experienced any of the problems in this list, congratulations. You’re on your way to becoming a better programmer.

Damage Report: Mac Mini Crash

As I was trying to recover the data, I was getting angry with Apple. I started wondering if I should go back to Windows or move over to Linux. Do I really need to restore this computer? What would I really miss?

Considering that I was incredibly annoyed, I obviously would miss a lot. I like Macs. Yet, I wasn’t prepared to buy a new Mac. $1500 for a 13″ MacBook Pro seems too expensive. That’s without 16GB of RAM, which brings the price to $1700. I already missed out on the Black Friday sales too. No, I was determined to fix the Mac Mini.

I went way back in history to fix the Mac Mini. I pulled out my copy of Snow Leopard. This version of Mac OS is from 2009. And wow, it feels newer than El Capitan. Version 10.6 has a great look. Everything is so shiny, so embossed, so colorful. And even though this operating system is nearly a decade old, I didn’t feel like I was missing much. Safari loaded up Photics.com without trouble.

Back to the mission, I was working my way through history. I wasn’t using Snow Leopard for nostalgia. I was using it as a way to restore my computer and install El Capitan. Apple makes it surprisingly difficult to get previous operating systems. Sure, there are ways to do it, but it’s a lot harder when you have your main computer sprawled in pieces, laying across the desk. The putty knives were out again. I had to pry open the Mac Mini case one more time.

I replaced the troublesome SSD with the original Mac Mini hard disk. Reverting back to a spinning hard drive is noticeably slower. Applications load much faster with an SSD. Yet, I wasn’t about to spend money on a computer that’s obsolete. The latest version of macOS does not support the 2009 Mac Mini. That was a significant hurdle in this tech challenge. I ran into issues making a boot disk while running Snow Leopard. That’s because the OS was so old. I had trouble making an El Capitan boot disk on Sierra. That’s because the OS was too new.

I remembered the movie Groundhog’s Day. Like Bill Murray’s character, I was going on a strange journey through time. To get my Mac Mini running again, I ran a lot of old updates. It was a trip from the past to the modern day.

Once my Mac’s internal hard drive could run El Capitan, I proceeded to move the Time Machine files over. While the backup couldn’t do a full restore, I was able to access the files manually.

Here’s the odd part. While I consider my Mac to be at 95% of where it was, I have about double the available storage space. Previously, I had about 15-20 GB of storage available. Now, I have 49.64 GB of storage available. Both drives were about the same size. The SSD was 128 GB, while the original Mac Mini hard drive stores 120 GB. Where is that extra space coming from?

That’s years worth of damage. Files and preferences from applications long gone, they were stuck in the system. It really needed a good cleaning. I’ve been wondering if I was missing something, but everything working as expected. The backup files are still available. Time Machine didn’t work as expected, but it did work.

Here are the lessons learned from this experience

  • It’s probably a good idea to run the Disk Utility after a power outage / hard crash. The disk should be verified / repaired to minimize potential software issues.
  • SSDs are scary. While the speed is great, I’m not liking the reliability. I’m glad that my Time Machine backup is on a spinning disk.
  • I’m looking forward to new Mac hardware. Reinstalling software with an old CD-ROM or a USB 2 device is slow. I’ve seen way too many progress bars during the past few days.
  • Having a macOS boot disk can make a big difference in recovering a crashed Mac.
  • A clean install of the operating system can remove a lot of bloat. It’s tedious, but a good way to reclaim storage space.
  • Time Machine is good – but can also be susceptible to the same damage that crashed the main drive.

Free Template Tuesday #10 – Tumult Hype “Reveal”

Thumbnail - Split EmojiThis week’s Tumult Hype template is a quick guide on how to create a “reveal” effect. Sometimes, you might want to compare two objects. Perhaps picture #1 shows the outside of the human body and picture #2 shows what’s underneath. Perhaps the reveal picture shows undergarments, no clothing at all or an image of organs. Good web design can relate to many different professions. That’s why the “Reveal” template is handy. It shows how to create a common web effect with Hype – no custom JavaScript necessary.

Continue reading “Free Template Tuesday #10 – Tumult Hype “Reveal””