Sunday, January 10, 2016

Beach Ball!!!

I finally got my beach ball dice! Yes, I had to beat 25 different opponents in 24 hours, but it was totally worth it, right? Right? 



But here's the thing. There's a bug - at least on iOS - where the progress of your wins against different opponents isn't getting updated. So if you want to earn the beach ball dice, KEEP A LIST OF THE PLAYERS YOU BEAT (and when) and then paste that information into a help request so customer service can give you credit for your achievement, as they did do for me. Thanks, Yahtzee! 

Now here's my whole lineup of dice. I do expect this will be my final update, since the remaining locked dice involve tournaments and dice masters that are impossible to beat without spending moneys on bonus rolls. C'est la vie! 


Saturday, January 02, 2016

Yahtzee!!

My dice. Don't judge me. :-)

Friday, January 01, 2016

Swift selector argument - yes you can!

Selectors are an Objective C thing, but sometimes you have to use them in Swift.

For example, if you are calling performSelectorOnMainThread to work around the problem between GCD and UIWebView that causes hangs in stringByEvaluatingJavaScriptFromString (see <a href="http://stackoverflow.com/a/11805936/166661">here</a>) you don't have a choice.

But how to pass an argument? I defined my selector function to take AnyObject? just as I assumed I should since withObject:AnyObject?

So tl;dr - here's what I was doing wrong. The colon at the end of the selector DOES MATTER. Well duh, of course it does, because it indicates there's an argument. Here's an example of everything working correctly...

  private func caller() {
    let arg = 42
    performSelectorOnMainThread("myfunc:", withObject: arg, waitUntilDone: false)
  }

  func myfunc(arg: AnyObject?) {
    guard let n = arg as? Int else {
      print("how did we get in this cornfield?")
      return
    }
    print("and here we are with our arg n: \(n)")
  }

...and the proof of the pudding - my, how tasty!

and here we are with our arg n: 42

I hope this saves somebody else a few hours of struggle!

Thursday, December 10, 2015

What To Wear

Because I never ever remember...
°F Just Right Too Much Not Enough
56
  • warm wicking T
  • tech long sleeve T
  • shorts
  • didn't need the hat or gloves or extra LST n/a

    Wednesday, November 25, 2015

    Handy howmany commandy

    Here's a handy little bit of... well it isn't really SQL, is it? Shell scripting and SQL*Plus, more like.

    tcsh & csh


    alias howmany "echo 'select count(*) from table;' | sqlplus -s 'xxxxxx/xxxxxx@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxx)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=xxxxxx)))'"


    sh & bash


    alias howmany="echo 'select count(*) from table;' | sqlplus -s 'xxxxxx/xxxxxx@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxx)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=xxxxxx)))'"

    (for ksh use either) - and then...

    $ howmany

    Enjoy!

    p.s. I'd love to add a pipe to

    sed -e '/^$/ d; s/^\s-*//g'

    but the dollar sign screws things up, at least in tcsh. Oh well!

    Wednesday, November 18, 2015

    Sunday, November 15, 2015

    Hard-to-read Podcasts

    If you use the iOS Podcasts app, you've probably had occasion to swear at the producers of a podcast for their graphics and how they translate into dark text on a dark background. It's even worse in low light.


    Well swear no more! At least not about this. It turns out there's a setting for that! Unfortunately, because this is iOS, you have to open the Settings app. Go there and choose Podcasts. And there aren't that many settings, so find this one, Custom Colors, and turn it off


    And enjoy more podcasts!