Tuesday, February 25, 2020

Workaround: Trello card shows "Loading..." instead of GitHub PR link

Here's a quick workaround for when you pull up a Trello card with the intention of clicking through to the linked GitHub pull request, but the "GitHub Pull Requests" section of the card stubbornly just displays "Loading...", without ever resolving to the link you're after. (This situation is likely related to a number of HTTP 500 error responses from requests to api.github.com visible in the Network tab of the browser's developer tools.)


Scroll down to the Activity section of the card, and look for the events with the "attached" verb. One of them should include the GitHub PR link.

If you know your GitHub repository's name, you can do a Ctrl+F/⌘+F search for that. The word "GitHub" doesn't actually appear in the text of the activity log item, but the repo name does.

Sunday, February 09, 2020

Vigil RPG 5th Anniversary Edition Now Available!

Now available on the App Store for iOS devices: Vigil RPG, Special 5th Anniversary Edition!

Vigil RPG is a game that I solo-developed and released for iPhone back at the end of 2014.  Vigil RPG is the kind of designed-for-mobile RPG that I couldn't find on the App Store, so I wrote it myself! It features interesting combats (even in non-boss battles), while also allowing you to play each combat round in a single tap.



I'm happy to announce that Vigil RPG, Special 5th Anniversary Edition, is now available! It's a free update to the original Vigil RPG app. It features:

Universal (iPad) support


Vigil RPG had always been playable on iPad, but only as an automatically-scaled-up version of the original iPhone 4. Now, Vigil RPG is a full Universal iOS app, with every screen in the game having been updated to take advantage of iPad portrait-mode screen resolutions.

iPhone X and iPhone 11 support


Vigil RPG now also takes advantage of the full resolution available on newer iPhones, all the way up to the iPhone 11 Pro Max. (Future large phone models will now be automatically supported as well.) Enjoy Vigil RPG's beautiful pixel graphics in glorious high resolution on your new device!

New and reworked enemies


A new, unique early-game boss enemy has been added. Players familiar with Vigil RPG will no longer find it quite so easy to retrieve a quest item from one of the local farms early on in the game!

A number of existing enemies in the game have been reworked to make them more interesting to fight. A few examples:
  • The Tank Goblin, instead of just having thick armor, now has a defense that is really tough to crack.  Players familiar with how to beat King Hippo in Nintendo's Punch-Out! series, though, should have an advantage in figuring out how to hurt him effectively...
  • The Skeleton Fire Mage now chants some strange words at the beginning of combat. Could those words be somehow related to the combat round numbers in which it casts its FIRE spells?
  • The Fire Elemental now grows into a larger and larger flame as combat progresses! The ICE spell can help cut it back down to size, though!
  • It's now extra effective to use the never-miss FIRE spell on flying enemies, such as the Giant Hornet that is encountered early in the game.

New Music


Delight your ears with new 8-bit-style music tracks for many of Vigil RPG's unique boss enemies!

As a bonus, here's my favorite, as a free download: The new Arcane Tower boss battle theme!  (Composer credit: nene at opengameart.org!)

New In-Game Commentary


Everyone's favorite root-beer-serving bartender, Bo, has lots and lots of new commentary, gameplay tips, and humor for you at the Tavern. You can also now just tap him to get more tips, instead of having to leave the tavern and come back again.


Local High Scores


Vigil RPG has always featured an "elapsed turns" system, which tracks how efficiently and effectively you've been proceeding through the game. Completing quests in fewer turns gets you better quest completion rewards.

Now, a local high scores table for each quest is available at the Tavern! When you complete a quest at the Tavern, your performance compared to other save files and prior playthroughs on your device is now displayed.

Many more enhancements!


To name just a few:
  • Stats are now displayed at the end of combat for how well you did mitigating enemy special attacks (i.e. blocking them, or otherwise taking advantage of an enemy's weakness to stop them from being effective), and interrupting enemy spells.  These stats for the entirety of your playthrough are also now displayed on the Hero Status screen!
  • The Shaman (a late-game NPC located in a remote section of the world map) now invites the hero to rest at his hut (to restore HP) after he is done assigning the hero a quest!
  • The Town of Arboria now has a new and improved appearance!
  • Some quest rewards, hero level-up bonuses, item prices, and monster stats have been tweaked to make Vigil RPG even more finely balanced!
  • Picking up Fire Rubies in the Volcano now slightly restore the hero's HP!
  • 400+ new git commits of new sound effects, UI improvements, and other goodness!

Support your local Jon Schneider's Tech Blog indie game development scene!


To learn more about Vigil RPG, check out the Vigil RPG website.  Or help me buy my wife a delicious coffee by checking out the game that TouchArcade.com named one of the top 10 JRPG-style games available on iOS -- alongside such notable series as Final Fantasy, Dragon Quest, and Chrono Trigger! -- by buying your very own copy of Vigil RPG on the App Store!

Friday, February 07, 2020

Fix: "OS Error 4294956486" launching Children of Morta on Mac/Steam

Early this morning, I tried to launch the game Children of Morta on Steam running on my Mac. The game failed to open, and Steam displayed the error "OS Error 4294956486".

Solution

Deleting the game via the Steam (via Library → Right-click on Children of Morta in the list → Manage → Uninstall), and then redownloading and reinstalling Children of Morta, fixed the problem for me, and I was able to get a little gaming in before my work day.

Other solutions attempted that didn't work for me

  • Restarting Steam.
  • Restarting my Mac.
  • Launching the game manually via the command line.
  • Doing a "Verify Integrity of Game Files" (via Library > Right-click on Children of Morta → Properties → Local Files tab → "Verify Integrity of Game Files" button).

Tuesday, August 13, 2019

TimeSnapper for Mac is now available!

Since all the way back in 2008, during most of which Windows was my daily-use operating system for work and hobbies, I used, and was a big fan of, a utility called TimeSnapper.  Billing itself as "The Automatic Screenshot Journal", TimeSnapper quietly would run in the system tray of my Windows computer, taking a screenshot of whatever application I was actively using every few seconds.  TimeSnapper additionally came with a "Play Your Day Like a Movie" feature, where I could watch my entire day of work, or jump directly to the screenshot of any point in time of the day.

TimeSnapper saved me on multiple occasions where I would have otherwise lost work. A couple of examples of this:
  • I'd been typing some long-form text into a form on a web page, only to have the browser crash and lose all of my work. Without TimeSnapper's most recent screenshot of my work-in-progress post, I'd have had to recreate the text from scratch, instead of simply having to retype it. (See my 2014 tweet about the incident!)
  • I'd run into a problem with a program, where it displayed a particular error message in a dialog. A few minutes later, I wanted to Google the error to try to find a solution. I couldn't remember the exact text of the error in order to type it into Google... but TimeSnapper had captured an image of the error dialog, so there was no problem!
In early 2017, taking on an assignment with a new product at work, I switched to working on a Mac, making my primary daily-use operating system macOS instead of Windows.  One of the first things I did, naturally, was to look for macOS equivalents of the essential utilities that I had come to rely on for software development and other work on Windows.

Although I was able to find many useful equivalents for utilities such as clipboard history saving, I wasn't able to find anything like TimeSnapper. Seemingly at least once every week after switching to Mac, I'd run into some situation like the ones described above where I wished I could look back in time to retrieve some important piece of information that I know I had on screen a short time earlier, but was now lost.

Fast-forward to the present day, and I'm super excited to announce: The official release of TimeSnapper for Mac is now available!

Why am I able to announce this? Because, in partnership with the original developers of TimeSnapper for Windows, Leon Bambrick and Atli Björgvin Oddsson, I am the developer of TimeSnapper for Mac!

By late 2017, I was frustrated enough with not having TimeSnapper or a similar utility in my day-to-day work that I reached out to Leon, asking if there was any news around a Mac release of TimeSnapper. Leon replied that there was not; but after some conversation, he offered me the opportunity to develop it!

After a long journey, starting with me not even knowing whether making a macOS version of TimeSnapper would be at all possible -- for example, whether macOS even had operating system hooks allowing an application to perform screen captures -- TimeSnapper for Mac is now complete, and is available on Apple's Mac Store as of today!

https://apps.apple.com/us/app/timesnapper/id1456327684?mt=12

Some of the major milestones in TimeSnapper for Mac's development, using Objective-C and Xcode, included:
  • Getting a simple, UI-less program working which successfully managed to take and save to disk a screen capture of the Mac desktop.
  • Making the program "wake up" at regular intervals to take screen shots -- and continue to do so even if the computer is put to sleep.
  • The ability to pause, and later resume, the capture of screen shots on command.
  • Adding an option to reduce screen shots in size and/or quality before saving them to disk -- and adding a Preferences window for the user to control these options, as well as the delay between screenshots and the image format (.jpg or .png).

  • An option to capture just the foreground application window, the entire monitor where the application is running, or all monitors (on a multi-monitor system). Due to the way the relevant macOS hooks work, just successfully identifying the foreground-most window was surprisingly challenging, but after lots of effort and testing, TimeSnapper is able to get it right for almost all applications.
  • Adding a "preview image" of a screen shot to the Preferences window with the selected size and quality options applied, as well as an estimate for how large the screen shot would be on disk with the selected options.
  • Adding "auto cleanup" of old screen shots to save disk space, along with Preferences window options for the user to specify a maximum age of saved screen shots, and/or maximum disk utilization for all screen shots.
  • An option to open a new Finder window, navigated to the folder where TimeSnapper saves its images.
  • Getting TimeSnapper to optionally start automatically after reboots. (This functionality on Mac was almost shockingly difficult to implement relative to what I expected, requiring quite a bit of code along with a whole "sub-application".) 
  • Getting TimeSnapper to appear as an icon and menu in the Mac's top Menu Bar, and to display its larger Dock icon only when one of its windows is open.
  • An initial "Play Your Day Like a Movie" window, displaying one of the saved screen shots.
  • Adding a timeline to the Play Your Day window, displaying a range of hours corresponding to the earliest and latest screenshot captured for a selected day, and a tick mark on the timeline for the time of every individual screenshot taken.
  • Getting a mouse click -- and later, drag -- on the timeline to change the image display to the image taken nearest to the clicked time.
  • Adding the eponymous ability for the window to play the selected day's screenshots like a movie, with playback controls for starting/pausing the playback and increasing or decreasing the playback speed.
  • Handling local time changes properly, so that "going back in time" by carrying the Mac across a time zone boundary from east to west, or at the end of Daylight Saving Time, doesn't cause screen shots to appear out-of-order in the Play Your Day window, or to potentially overwrite one another.
  • Lots more polish and bug squashing!
It's been a genuine pleasure over the past few months, in the later phases of development, to once again have had TimeSnapper running on my daily-use computer -- now, a Mac -- affording me the ability to easily peer back in time and see exactly what text or activity I previously had on my screen!

Check out TimeSnapper on the Mac App Store! If you like it, I'd love it if you'd leave a nice review, or just drop me a line (here in the comments, or find me on Twitter) and let me know what you think!


Friday, June 28, 2019

Workaround: HTTP 502 "Incomplete response received from application" in Rails app on Phusion Passenger server

I've recently been fighting an intermittent issue in a specific Ruby on Rails app running on a Phusion Passenger web server on my local macOS development machine: HTTP requests to the app would intermittently return the error "Incomplete response received from application" wrapped in a simple h2 element, instead of the desired resource.

When this occurred, I'd also see a message like the following appear in the Phusion Passenger web server log:

App 6510 output: [ 2019-06-27 12:07:49.0318 6510/0x00007f83639eb6f8(HTTP helper worker) utils.rb ]: *** Exception Errno::EBADF (Bad file descriptor) (process 6510, thread 0x00007f83639eb6f8(HTTP helper worker))

Oddly, no one else working on this application saw these errors while running the app on their machines, even though as far as we could tell, we were all running pretty much the exact same environment.

The workaround

 I found that I could get this issue to stop manifesting on my machine by appending the following parameter to my passenger server start-up command:

--spawn-method direct

This resulted in the complete Passenger start command for the application looking like:

bundle exec passenger start --port 3000 --max-pool-size 4 --min-instances 4 --spawn-method direct

Explanation

The key to coming up with this workaround was an article on the Phusion Passenger website: Spawn methods explained (for Ruby developers).

That article talks about how, in order to save memory and improve start-up time, Passenger uses a "spawn method" setting of "smart" for Ruby applications by default. That setting accomplishes that by having multiple server processes share certain objects in memory.

A caveat of the "smart" spawn mode noted by the article is unintentional file descriptor sharing. This caught my attention: Research I'd done on the "EBADF (Bad file descriptor)" error noted that it could be caused when a file descriptor -- that is, a handle pointing to a resource like a local file or a network socket -- is closed, but then accessed again after being closed. If such a handle was being unintentionally shared between web server processes, it does seem entirely plausible that one process could close a handle, then the other process could try to use it for something.

It seemed logical that configuring Passenger to not share objects between processes, via using the "direct" spawn mode setting instead of the "smart" setting, would avoid this. Sure enough, using the "direct" setting did immediately stop the "Incomplete response from application" errors I was seeing in my local environment.  Additionally, running the app on my local machine (with myself as the only user), I didn't observe any meaningful degradation in app performance.

What I'm still unsure about at this point is exactly what specific handle was being incorrectly shared between processes, and why no one else working on this application was having the same error that I was manifest in their environments. Thus, I'm considering this a "workaround" rather than a "solution" for the time being.  (And I'm not committing a change to have the app use the "direct" spawn mode in any environment other than my own.)


Other solutions attempted

Prior to finding the workaround, as all signs pointed to this being some kind of environmental issue with my local machine, I tried to "fix" my environment in quite a few different ways:
  • Use a different client browser
  • Restart the Passenger web server
  • Reboot 
  • Reinstall Ruby 2.6.3
  • Revert to an older Ruby version (2.5.3) using rvm (and uninstall 2.6.3)
  • Reinstall gems via bundle install --force
  • Clone a fresh copy of the Rails application code itself from the remote repository
  • Run the application on a different port (other than 3000)
  • Update the database (mySQL) to the latest patch version
  • Increase the limit of open files per process via ulimit -n 8192
  • Increase the database pool size in database.yml
None of those attempted fixes made a difference; the "Incomplete response received from application" response to HTTP requests, and the "Errno::EBADF (Bad file descriptor)" in the server log continued to manifest.

I had initially suspected the Ruby 2.6.3 upgrade to have something to do with the problem, as I had first started noticing the issue around the time I made that upgrade locally. However, as downgrading to 2.5.3 didn't fix the issue -- and others working on this app were running 2.6.3 with no issues -- I ended up concluding that the 2.6.3 upgrade did not seem to be the direct cause of the issue.

I'd very much like to understand what is actually causing this error in my environment. In the meantime, though, I'm very happy to finally have a viable workaround, so I can get work done again!