Blog: 2010-10

Latest  2014  2013  2012  2011  2010  2009  2008  2007  2006  2005  2004  2003  2002  2001
-12  -11  -10  -09  -08  -07  -06  -05  -04  -03  -02  -01

Movement Over Sweet Trickery

I just went to blog this, then realized that Halloween night is an odd time to be doing so...

Usually, if I'm feeling tired or sluggish, I'll have an urge to drink or eat something sugary or caffeinated. The caffeine urge is very mild, since I kicked the habit and almost never touch the stuff anymore. Now I want to cut out most of the counterproductive junk food intake.

Some guidelines I'm starting with this winter:

  • When feeling tired or sluggish, do exercise instead of trying to ingest calories that are not needed. This can be impromptu cardio, weights, or stretching.

  • Avoid liquid calories. Drink mostly only water and herbal tea. Save rice milk for cereal.

  • Don't keep junk food in the house.

  • Don't go to the convenience store, because junk food is too convenient there.

  • Avoid using laptop from the kitchen table, since body will keep thinking that it should eat when food is so available. (This is inconvenient at the moment, since I'd originally decorated the kitchen to be cheery and inviting, and the only other desk-like furniture is in the office room, which is sedate and for business only.)

Most of these guidelines I've had in the past, but they need to be reasserted.

I have a few more guidelines after I get back in the groove of the above.

Also, I don't play video games much, but I have noticed since playing recent first-person video games that just a "break" of running and jumping around in the game seems to be immersive enough to satisfy some urge to do that in real life. This might be good, were I not able to move around in real life, but it's bad if I let able-bodied me be tricked into thinking I'm being active when I'm not.

PS3 and PC Speakers

 [photo of wood stand with PS3, monitor, and speakers] Recently, my living room 'home theatre' has consisted of a Sony PlayStation 3, plugged into the analog video and audio inputs of 23-inch LCD monitor. The monitor doubles as my spare monitor for working on servers or repairing computers. The problem til now is that the speakers in monitor were so bad that people would rather watch movies on a laptop. After some research and shopping around, I found PC speakers that work acceptably for living room use.

By "acceptably", I mean a big step up from watching a movie on your laptop, but decidedly not audiophile quality.

The particular speakers I ended up with are Creative Inspire T3130, a 2.1 PC speaker set, with a bass volume control on the subwoofer, and cabled remote main volume control. A couple simple connectors converted the 1/8-inch stereo plug to a pair of RCA jacks needed by the Sony AV cable. The speakers' remote control I mounted to one of my Birch IKEA CORRAS racks (see 2009-07-14) with Velcro. The Velcro mount in the corner is firm (and probably sturdier than the construction of the remote itself).

 [photo closeup of speaker volume control mounted on wood stand]

This was my fourth attempt at PS3 speakers. My first attempt was the monitor's integrated speakers, which were not minimally satisfactory. Second attempt was an Altec Lansing FX3022 pair, which were a nice package that avoided a subwoofer box, but which had way too much bass and no separate bass control. Third attempt was a component receiver/amp and a pair of bookshelf speakers that I rescued from the trash separately, but the receiver has flaky potentiometers, and I didn't like having the extra component on my minimal rack.

The PS3 is probably temporary, til I find I never want a GTA IV break. Then it will be replaced with a low-power Atom-based PC that I build and write some custom software for. I kinda fancy the idea of making things like a free Hulu viewer, with my phone doubling as a remote control. When I get spare time from paying work and from researchy projects.

cas-cad-e in syntax-rules

Shriram presented "a little macro exercise" for Racket or Scheme on this Friday night. I was feeling drowsy enough that hacking up an implementation in old-school syntax-rules seemed like a good idea.

;; V  = value
;; IC = input clause
;; SC = saved input clause
;; LC = output nested-let clause
;; CC = output case clause
;; TN = thunk name

(define-syntax %cas-cad-e:3
  ;; (V LCs CCs)
  (syntax-rules ()
    ;; No more LCs, so finish.
    ((_ V () (CC0 CC1 ...))
     (case V CC0 CC1 ...))
    ;; At least one more LC, so make the "let" form and recurse.
    ((_ V (LC0 LC1 ...) CCs)
     (let (LC0)
       (%cas-cad-e:3 V (LC1 ...) CCs)))))

(define-syntax %cas-cad-e:2
  ;; (V ICs LCs CCs TNs)
  (syntax-rules (break)
    ;; Processed all input clauses, so assemble.
    ((_ V () LCs CCs TNs)
     (%cas-cad-e:3 V LCs CCs))
    ;; Input clause that ends with a "break".
    ((_ V
        (((K ...) B ... (break F)) IC1 ...)
        (LC0 ...)
        (CC0 ...)
        (TN0 TN1 ...))
     (%cas-cad-e:2 V
                   (IC1 ...)
                   ((TN0 (lambda () B ... F)) LC0 ...)
                   (CC0 ... ((K ...) (TN0)))
                   (TN1 ...)))
    ;; Input clause that does not end with a "break",
    ;; and IS the last clause.
    ((_ V
        (((K ...) B ...) IC1 ...)
        (LC0 ...)
        (CC0 ...)
     (%cas-cad-e:2 V
                   (IC1 ...)
                   ((TN0 (lambda () B ...)) LC0 ...)
                   (CC0 ... ((K ...) (TN0)))
    ;; Input clause that does not end with a "break",
    ;; and is NOT the last clause.
    ((_ V
        (((K ...) B ...) IC1 ...)
        (LC0 ...)
        (CC0 ...)
        (TN0 TN1 TN2 ...))
     (%cas-cad-e:2 V
                   (IC1 ...)
                   ((TN0 (lambda () B ... (TN1))) LC0 ...)
                   (CC0 ... ((K ...) (TN0)))
                   (TN1 TN2 ...)))))
(define-syntax %cas-cad-e:1
  ;; (V SCs ICs TNs)
  (syntax-rules ()
    ;; Processed all ICs, so go to next phase.
    ((_ V SCs () TNs)    
     (%cas-cad-e:2 V SCs () () TNs))
    ;; At least one more IC, so make a TN for it.
    ((_ V SCs (IC0 IC1 ...) (TN0 ...))
     (%cas-cad-e:1 V SCs (IC1 ...) (TN0 ... <cas-cad-e:case-thunk>)))))
(define-syntax cas-cad-e
  (syntax-rules ()
    ;; Put in a form easier to process.
    ((_ V IC0 IC1 ...)
     (%cas-cad-e:1 V (IC0 IC1 ...) (IC0 IC1 ...) ()))))

VerifiedByVisa Problem

 [screenshot of Web browser complaining about invalid security certificate] I just tried to buy something from Newegg, but my browser could not authenticate's SSL cert.

I have two guesses as to why, but SSL is too unpleasant to do for fun, and Visa can afford to pay people to make their stuff robust.

Also, the bundle of trusted CAs in browsers is only moderately useful anyway.

Bad Luck, Good Luck

A guy who works in Kendall Square here had several bits of mixed luck:

  • Being a 300-pound guy trapped in an SUV that began to self-combust as he got on the interstate.

  • The doors and windows wouldn't open.

  • A police cruiser with five (!) officers packed into it happened to be driving by.

  • They managed to get him out before it exploded.

  • They managed to get his golf clubs and briefcase out before it exploded.

  • His SUV exploded.

Kathie Ragsdale, "Cops pull man from SUV before it explodes in Somerville," Wicked Local Somerville

Earlier to... 2010-09

© Copyright Neil Van Dyke      Contact