Archive for the 'Tech' Category

Data collection in times of sickness both personal and global

March 23rd, 2020

Two weeks ago, I caught a sinus infection on the return flight from Disneyland (before the parks were closed down for health concerns; the trip feels like a lifetime ago). Since hospitals and doctors’ offices are getting slammed right now, I knew that making an appointment would not be prudent, so I called and requested an antibiotic prescription (they seemed grateful to have me not clutter their office and get others sick).

Throughout the entirety of my medication period, I took my temperature, sometimes several times a day. I wanted to keep tabs on how my illness progressed, and of course look out for possible COVID-19 symptoms in case my infection was weakening my immune system enough for another viral invader to take purchase (fortunately, this was not the case, and my typical old season-and-travel-influenced nasal drip ran its course as expected).

In the course of taking my temperature and adding the results to the Health app on my iPhone for tracking, I wrote up an iOS shortcut that I could trigger the temperature input via Siri. Maybe someone else will find some use in this, so here’s a link (requires permission to write health data, obvs).

Since I was recording my temperature like crazy, I now have fun visualized data!

Examples of my body temperature readings in the iOS Health app from a few weeks in March 2020.

Got a lot of high 96°F ratings which felt a bit low as a baseline, but then again, I never have this volume of body temperature data available to me, so perhaps I run cooler than I thought. Only got to 99° once and that was after a much-needed outdoor walk, so I’d chalk that up to a slightly elevated heart rate. Average of 97.44° is within expected ranges and also happens to align with the average temperature in recent studies.

So after all that, no fever (and no COVID-19; I’ve been sheltering in place since I got off that plane, especially as the global pandemic started to ramp up). Only some fun with data collection. Which, as self-quarantine activities go, isn’t the worst way to pass the time.

Tags: , ,

Manual Apple Store Gift Card Link Creation for Apple Wallet

January 4th, 2019

Just because this took me way too long to figure out:

If you have an Apple Store gift card you’re unable to scan into Apple Wallet via the iPhone camera (in my case, because I had a digital gift card from a third party that just provided card number and PIN, no QR code to be found), manually create a URL formatted as follows:

Replace ################ with the gift card number, and AAAAAAAAAAAAAAAA with the PIN, then click the link on your Mac or iOS device to generate the Apple Wallet confirmation prompt. C’est fait!

Tags: , , , , , ,

HTML5 Video Playlist: A Brief Kludge

June 1st, 2010

Twitter buddy @adecelle issued a challenge:

The listing in question describes how to replace an HTML5 video source in sequence; basically, it lets a single <video> tag change its movie in the course of playing the video, resulting in a YouTube-style playlist. Problem was, in the form presented on the site, there was no intuitive way to add x more videos, and the second video in the sequence would loop forever. It had been awhile since I had gotten to practice some coding, so I figured I’d give it a go.

As it turns out, this was a difficult nut to crack. My repeated Google searches on how to construct an HTML5 video playlist yielded a handful of code examples from various sources, but these examples were apparently written completely off the cuff and were more broken than the Apple code. Eventually I had to cobble snippets from multiple sources to make a functional output with the desired capabilities:

<script type="text/javascript">

function myEndedListener(){
var myVideo = document.getElementsByTagName(‘video’)[0];

function myNewSrc() {
var myVideo = document.getElementsByTagName(‘video’)[0];

function myNewSrc2() {
var myVideo = document.getElementsByTagName(‘video’)[0];

function myNewSrc3() {
var myVideo = document.getElementsByTagName(‘video’)[0];


<video controls src=”videoplaylisttest1.m4v”>

Example site (H.264 videos in MP4 containers; YMMV)

I was particularly proud of finding the bug on the Apple developer page: the event listener keeping tabs on the ‘ended’ state of video playback (when the video reaches its end) was reloading the same video over and over again when playback concluded. It was on the Opera Developer Community page that I found the solution in removeEventListener() (their multiple video example, for the record, was fairly unusable as well, but I appreciate their help in coming up with a solution).

The end result is messy code, to be certain. I’m fairly confident that someone more technically savvy and JavaScript-fluent could come up with a cleaner solution, but as Paul told me, the important thing is that it fulfills the function (tested on Safari 4.0.5 for Mac OS X Snow Leopard and MobileSafari 3.1.3 for iPhone 3GS; the initial autoplay doesn’t work on the iPhone but the sequential JavaScript fu works like a charm on both).

“Why post all this JavaScript/HTML5 stuff on your sporadically-updated blog about video games and stuff?”, I hear you ask? Simply put, I wanted to add something to the search results pool in the hope that someone else can stumble upon this tiny corner of the Internet and benefit from all this legwork. Good luck, wayward e-vagrant!


The Friggin’ Future

May 11th, 2010

On a recent trip to Seattle, I once again realized just how amazing it is to live in The Friggin’ Future. With an iPhone 3GS (basically an extension of my arm at this point), I was able to:

•get walking directions from airport to hotel, around the city and back again, including light rail and bus routes with scheduled times (Maps, OneBusAway)
•consult user-submitted restaurant recommendations (Yelp)
•track spending (iBank)
•record the entirety of a concert (Camera) (don’t worry, it was w00tstock and was released under a Creative Commons license)
•keep hundreds of friends and well-wishers up to date up to the minute on happenings (Tweetie)

(I didn’t even get into really fancy stuff like geotracking the whole trip via Dopplr, mostly because I only just discovered Dopplr today. I TOTALLY would have though)

As much as this sort of thing has become commonplace, I can’t help but stop and marvel at times. It wasn’t terribly long ago that the notion of a pocket-sized device that could accomplish all these feats was in the realm of science fiction. But even the tricorders of Star Trek future history are primitive when compared to what has actually been created. The creators of that program could not have conceived of a worldwide network with virtually unlimited information at our fingertips (if you recall, most Treks had all their data stored locally on computers onboard their starships, basically servers with warp drive; I suppose if your ship can outrun data transfer speeds, a long-range Wi-Fi network might become a thing of novelty… but as is so often the case when Star Trek comes up, I digress).

Though I didn’t realize it when I bought my first iPhone in 2007, the device has become an absolute necessity in my life. It is my lifeline to the outside world on a level of profundity that a landline telephone could never hope to achieve. True, it has been a steady source of content consumption as my portable car stereo and TV (though the iPad has taken over the latter function with gusto), but it’s also the primary connection through which I socialize with a myriad of friends and well-wishers online. Some might express concern at eschewing real relationships for so-called “fake” ones with Internet folk, but I fail to see the distinction when the only difference is the means with which we communicate.

I’ve been obsessing a bit lately over one Amber Case, cyborg anthropologist, futurist and Singularity enthusiast (so perhaps you can understand my obsession). She argues that everyone in this modern age is a cyborg, as we all utilize technology to some degree to augment our physical bodies. It’s a compelling thought experiment (see more in her entertaining and informative lecture on prosthetic culture), and I hope it makes everyone realize the importance of devices like the iPhone (or your brand of choice) in their daily lives. Technology interconnects us on a deep level, and connects us all to something much bigger than ourselves.

And it’s exciting to live in a time where we can take it for granted. That’s when you know it’s The Friggin’ Future.

Oh yeah, add another bullet point for:

•update blog (WordPress)



June 4th, 2004

I thought I should drop in real quick and tell you all to download Simon Extreme. For all you “young’ns” who never experienced the joy of Simon, it’s a requirement that you download and play the game right now. Nay, a civic duty. For the rest of you that know and love the game already, well… it’s required of you too. You need to spread the word on this most classic of classic games. Download it already. 

(requires Mac OS X to work, but all cool people have Mac OS X anyway… you are cool, right?) 

Song recommendation: Ros Serey Sothea – I’m Sixteen

Like I need a subject title!

May 14th, 2004

I figure it’s about time I flesh out this here weblog. I never was into that whole ‘blog’ scene in the past (mostly because my other projects have blog-like properties of their own). But ever since I signed up with Spymac for its 1 GB of e-mail storage, I figured I might as well make use of the other nifty features and do-gadgets. So you’ll probably be seeing a lot more blog entries up in here. Get used to it! 

(I won’t, however, do those silly LiveJournal mood indicators. For crying out loud, is “cold” really a mood?!? I beseech thee) 

But why did I actually make this entry? I, who constantly neglect scheduled site updates in favor of selfish abstract activities such as “work” and “school” and “eating in order to survive”? Well, my fledgling blog is the proud winner of the CultSpy award! After several seconds of research, I found that CultSpy looks around for the most well-written blogs in the Spymac community. I must say, I’m quite honored to receive this. Now if only people would comment more often… >.< 

Oh yeah, since I’m all bloggin’ up in here, here is one of those common blog staples: currently playing songs! But I’ll provide a little something extra by providing a link to the song in the iTunes Music Store, so you can share in the love. Catch you all later, when I have more things to say! 

Song recommendation: AIR – Alone In Kyoto

99¢ a song? How can I lose?

April 16th, 2004

I thank God every day that I don’t own a credit card. That’s because I know that no matter how responsible I think I might be with a credit card, the instant I acquired one, I would open up the iTunes Music Store and overcharge that thing so quickly my head would spin. 

It’s like some sort of drug addiction. You browse through and say to yourself “Hey look: ‘It’s Oh So Quiet’ by Björk! And it’s only 99¢!” So you buy ‘It’s Oh So Quiet’ by Björk for 99¢ because, hey, it’s so damn cheap. Later on, you win a free song in your Pepsi bottle, so you figure “Hmm, I could go grab ‘Sign’ by Nobukazu Takemura with this.” So that’s what you do. 

And that’s how they grab you. 

Soon you find yourself driving to the Apple Store in Valley Fair Mall to buy a $10 gift certificate so you can grab up the Debut album by Björk. Next you’re standing in the supermarket looking through the Pepsi bottles to find winning pieces, so you can grab the iTunes exclusive BA BA TI KI DI DO album by Sigur Rós. Before you know it, you’re trading sexual favors for spare change and spare Pepsi bottle caps on the street corner. 

I should know, I’ve been through it all. Except for the sexual favors. I would never stoop that low… at least until the Pepsi giveaway ends on April 30th. My God, what have I become?