Saturday, November 07, 2020

New Free iOS App Now Available: Desktop Journey

 I've just released a new, free app for iPhone: Desktop Journey!

Desktop Journey is a single-page dashboard app for iPhone, with an attractive display of time, current and next calendar appointments, reminders, weather, and micro-break prompts. It gives your phone a purpose while it's in its charging cradle on your desk while you work.

With the exception of an optional weather add-in, Desktop Journey is completely free and ad-free.

Why did I make Desktop Journey?

For a while now, when I'm at work at my desk, I've had my iPhone sitting in a charging cradle on the desk.  I wanted to put the iPhone's screen to good use, so it wasn't just sitting there doing nothing.

 

This isn't adding value. We can do better!

I tried a few different alternatives to just a blank screen, such as a simple analog clock app, but I couldn't find any "dashboard" apps that took advantage of the phone's screen to display a variety of useful information. 

So, as with Vigil RPG, I decided to build it myself!

What does Desktop Journey do?

Here's an overview:

Annotated image of an iPhone 12 running the Desktop Journey app.

Read on for more details!

Current Time

 

The top portion of the screen is devoted to a simple analog clock. Before creating Desktop Journey, I was using a simple iOS analog clock app as a workaround, and I wanted to keep that core experience (while also adding more to it).

A little "desktop calendar page" icon, styled to look like the native iOS Calendar app icon, shows the current weekday, and day of the month.

"Now" and "Next"

These two panels, shown in the middle portion of the app, display calendar events, reminders, and -- with an optional subscription -- weather and temperature.

🗓 Calendar events are taken from the device's calendar (after permission has been granted to read the calendar). Thus, if you've already set up your iPhone's calendar to sync with another source, such as a Google or Microsoft Outlook account, events from that calendar will appear.

The "Now" panel shows the meeting or appointment that is happening currently, if there is one. The "Next" panel shows just the upcoming appointment (not all of the day's remaining appointments) -- plus the single next appointment after that, if there is one immediately following -- which makes for a nice at-a-glance answer to the question "What do I have coming up next?".

Tapping on an event opens up the view of the current day's events in the native iOS Calendar app.

🎗 Reminders likewise are sourced from the native iOS (again, only after you've granted permission).

The "Now" panel shows a reminder that was due earlier today that you haven't completed yet, if there is one. The "Next" panel shows today's next upcoming reminder that has a date and time set, if any.

Tapping a reminder opens it in the iOS Reminders app, so you can mark it as complete, or edit it.

Temperature and weather for the current locale, and today's upcoming high or low temperature, are optionally shown, with the purchase of a subscription. (These cost me money to subscribe to an API that provides worldwide weather information, and while I'm happy to provide Desktop Journey for free, and with no ads, I'd like to not lose money on it!)

Celsius and Fahrenheit are both supported. Which is displayed can be toggled on the Settings page.

The Hero's Journey


A hero character -- who may look familiar if you've played Vigil RPG! -- walks along at the bottom of the screen, on a long journey.

The biome changes each day, providing some visual variety. In other words, if you run the app again tomorrow, the hero will be somewhere else! There are several biomes, including taiga (pictured up above), desert (pictured here), grassland, caves, forest, dungeon, and more.

The sky also changes, based on the real time of day: Night (as shown here), sunrise, daytime, and dusk.

Encounters - Tasks and Exercises


Several times per day -- at semi-random intervals; typically a little bit less frequently than once per hour -- an enemy encounter will take place!

Each encounter prompts you with an action that you can perform yourself, "in real life," to defeat the enemy. Each of these are quick-to-perform actions that are good opportunities to take a very brief break from whatever task you're working on as the app is running. In this pictured example, you'd stand up from your chair and stretch; then, you'd tap the ✅ button.

There's no time pressure; encounters will last indefinitely (as long as the app is running), so you can delay if needed, and complete them at a convenient time. Alternatively, you can always just hit the Skip button to bypass the encounter instead.

There are two types of encounters: Tasks and exercises.

Tasks are like this one: A simple action that you can perform from your desk as a micro-break. Other tasks include "tidy your workspace" and "message a loved one".

Exercises can help you get moving a bit during your work day. An example is "Do 5 push-ups!". Exercise quantities can be adjusted with + and - buttons that appear during the encounter; so you could tell the app you did less or more than 5 push-ups, for example.

The encounters feature can be turned on or off in the Settings ⚙️ menu. Individual tasks and exercises can also be enabled or disabled, if (for example) your circumstances don't permit standing up, or if you don't feel like being prompted to do push-ups. 🙂

When you complete an encounter, you'll get a stats display of how many of that task or exercise you've completed -- both today, and all-time.

Settings

Settings can be accessed by tapping the Settings ⚙️ icon at the top of the app's page. In addition to customizing exercises, you can disable screen lock while the app is in the foreground; toggle temperature units between Fahrenheit and Celsius; and view the in-app "About" and "Credits" pages. 

Give it a try!

As mentioned above, Desktop Journey has no ads, and is a free download, so give it a try, and let me know if you like it! Download Desktop Journey on the App Store.

Friday, August 28, 2020

How to wire up a delegate method in Objective-C

This post covers how to wire up a delegate method in Objective-C. I'm always forgetting how to do this, so this post will serve as a reference for myself going forward, and hopefully may be useful to others as well!

A delegate method is useful when a given object needs to call a method on an object to which it does not have a reference. This typically comes up when the calling object is the child in a parent-child relationship in the application's object model. 

A practical example of when I've used this pattern is in Vigil RPG, after a combat has concluded, the combat screen ViewController notifies the parent ViewController (either the world map, or the dungeon level) that the combat has concluded, so that the parent can resume playing its background music.

In the parent class (the CALLEE): 

In the .h file:

Add the delegate as an interface in the class declaration:

@interface ParentClass: NSObject<myDelegate>


(There's no need to declare the callee method in the class's public interface.)

 

In the .m file:

1. Wire up the delegate

This can be done in the init method, or in any location where a reference to the child object is available which gets called only once:

self.myChild.myDelegate = self;

2. Define the callee method

- (void) myDelegateMethod
{

 // Implementation of the method that we want to call 

// from the child class goes here.
}


In the child class (the CALLER):

In the .h file:

1. Define the delegate protocol

(This can alternatively be done in a standalone .h file if the delegate is going to be used from more than a single callee class.)

 

This can go just before the @interface:


@protocol myDelegate<NSObject>
- (void) myDelegateMethod;
@end


2. Declare the delegate property

(This goes inside the @interface, along with any other @property items)

@property id<myDelegate> myDelegate;


In the .m file:

Add calls to the delegate methods 

 

These go in whatever are the appropriate place(s) in the class method implementations: 


if (self.myDelegate != nil)
{
// Calls myDelegateMethod on the parent class
    [self.myDelegate myDelegateMethod];
}



Wednesday, August 19, 2020

One Deck Dungeon Digital Scoresheet

One Deck Dungeon is a "Roguelike, dice-placement, single-player" board game. It's created and published by Asmadi games, and has a great digital adaptation for mobile devices and computers by Handelabra Games.  It's my current favorite "player vs environment" board game app on my iPhone.

The iPhone adaptation of One Deck Dungeon is particularly good! It plays in portrait mode, and does a great job of displaying the game, and allowing you to play it, that feels very natural on mobile. (This stands in contrast to many other mobile board game apps, which tend to have a single interface used for both the PC and mobile versions, with minimal adaptations to make the game more usable/playable on mobile devices.)


The mobile version of One Deck Dungeon unfortunately lacks one feature that its physical counterpart has: Tracking of which of the game's playable heroes have successfully completed which of the game's available dungeons. This feature of the physical game adds a lot of replayability, as you can work towards having a particular hero fully clear the game.

To address this, I've created a digital score sheet for One Deck Dungeon! Based on Google Sheets, it tracks which dungeons you've completed with which heroes, on which "challenge tier" (difficulty level), and displays your overall progress clearing the entire game with each hero.  Here's my current progress, as shown on the score sheet:

 
Now, before starting a new game of One Deck Dungeon on my phone, I'll open up this scoresheet on my phone's Google Sheets app, and choose a hero and dungeon that I haven't cleared yet (or want to improve my best completed difficulty tier on -- those are the values in the 1-4 range being filled in on the sheet). Then, I'll open up the actual One Deck Dungeon app, and start a new game with the selected hero and dungeon! If victorious, I'll come back to the sheet and fill in the appropriate cell.

Feel free to grab a blank copy of my One Deck Dungeon digital score sheet for yourself, and happy dungeoneering!
 
If you don't own a copy of One Deck Dungeon yet, I recommend it!


Thursday, August 13, 2020

Incrementally troubleshooting production server issues as sculpting marble

Near the beginning of Steve McConnell's classic book on software construction, Code Complete -- it's the one where Jeff Atwood's "Coding Horror" icon image originally came from -- several analogies for the process of creating software are considered, including penmanship, farming, and oyster pearl harvesting, before McConnell finally settles on "construction."

At my job, although I'm primarily a software developer, I do also occasionally put on the hats of DevOps specialist and DBA. In particular, this happens when a legacy server that I'm responsible for experiences production issues, and I'm one of the few with the knowledge and experience to figure out what's wrong, and get it up and running smoothly again.

This morning, while making another pass at troubleshooting a stubborn partial outage that had recently started cropping up on a near-nightly basis, where performance of the production website and/or database was being degraded in the early morning hours for a period of around an hour or two, another analogy for the type of production software maintenance occurred to me: that of sculpting!

Michelangelo's "David"
 
In troubleshooting this outage, my colleague and I have taken the approach over the past several days of of making a single change that might hopefully resolve the issue; then, waiting to see if the issue still recurred. If so, we'd make another change.
 
It occurred to me that this was not so dissimilar from the quote attributed to the sculptor Michelangelo saying, in reference to beginning a sculpture, that the desired figure is already in place; the excess marble that does not comprise the statue just needs to be chiseled away.
 
By way of example, here are some of the incremental changes we attempted, in working towards resolving our persistent nightly outage: 
  • Monitoring the performance of the database during the outage, we observed that a particular stored procedure was comprising much of the runtime.  We optimized that stored procedure by improving a couple of the existing table column indexes used in the sproc's query plan, to reduce the overall number of lookups the stored procedure needed to perform.
  • We altered one of our nightly scheduled jobs that was running concurrent with the outages to avoid calling the possibly-problematic stored procedure at all; instead, we fulfilled the job's data needs by adding some additional output fields to another query the job was already making.
  • Examining the raw server logs of incoming HTTP requests, we observed that a number of poorly-behaved bots (no user-agent strings; no reasonable rate limiting) were hitting our site very aggressively during the outage period -- and that the pages being hit were triggering calls to that same stored procedure. As at least an interim fix, we put rules in place to prevent the pages being hit from being rendered in response to those particular requests.

Each of these steps of trimming off poorly-performing code and problematic incoming requests has felt a bit like chiseling away some stone, hopefully in the end arriving at a nice statue -- or in our case, a stable production system!

Sunday, May 17, 2020

Review: Eufy Security Video Doorbell

This past November, I jumped on the trend of replacing my house's existing traditional doorbell with an Internet-enabled doorbell. The key reason for making the change was to solve the fact that I couldn't hear my home's doorbell chime at all while working in my basement home office, which was causing me to miss service appointments, deliveries, and visitors.

After some research, I decided to go with the Eufy Security Video Doorbell. I purchased it from Amazon on a Black Friday sale for US $108, discounted from the full sticker price of $160. (At the time of this post, Amazon is selling this doorbell for $136.)

The doorbell was easy to install. I'm only a very amateur electrician, but I was able to get it installed in place of my existing traditional doorbell with no problem. The doorbell comes with a high-quality set of instructions, in the form of both a short video served through the doorbell's companion smartphone app, and written instructions.

The doorbell's companion app works great for viewing recordings -- which are captured automatically when the doorbell detects a nearby person -- as well as for viewing a live video feed from the doorbell's camera.

The doorbell comes with a remote chime that plugs into a wall socket and plays a sound when someone rings the doorbell. A ring of the doorbell also generates a push notification from the smartphone app.

Both my wife and I were able to create individual Eufy accounts and then associate those accounts with our new doorbell, such that we were both able to receive doorbell ring notifications and view video from the doorbell from our respective smartphones, without having to share a single set of credentials, which was a nice feature.

A major benefit of the Eufy doorbell is that there's no ongoing monthly cost to get its full functionality -- unlike competing devices, such as Amazon's market-leading Ring doorbell. All of the video storage is onboard the device itself, not in the cloud. You still view video recordings and the live video feed from the Eufy app your phone, but there's no cost associated with that capability.

Another major perk of the Eufy device relative to the Ring is the relative lack of privacy / surveillance concerns. If that's something that potentially concerns you, a Google search on terms like "ring police surveillance" is a good starting point for doing your own research.

The one major caveat as of the time of this writing is that the doorbell unit stopped working a few weeks ago. It went from working one day to being dead/unresponsive the next -- no visible lights on the doorbell unit, and no response to button presses. I turned off my power and checked the wiring connections on the unit, but the issue still persisted after I verified that the wiring was fine.

When I contacted Eufy Support about this, they promptly sent me out a new unit, free of charge, which worked fine when I hooked it up to replace the existing (dead) unit. Given this A+ level of support, I don't consider this problem a significant con -- provided this replacement unit manages to last for multiple years!

As of this writing, I highly recommend the Eufy Security Video Doorbell if you're in the market for replacing your home's traditional doorbell with a video doorbell.