Friday, October 7, 2016

warning: lisp geekiness

Nothing too special here, and I'm sure this will only be of interest to a few random geeky people, who knows where.  Maybe I should even put it on stackoverflow... but for now, I'm dumping it somewhere, so it doesn't get lost to time:

I was finding it a bit cumbersome to remove methods that I'd defined, which I wanted to remove because I wanted to change the argument count.  I wanted something simple (even better would be introspection and removing everything, but I couldn't find a portable way to do that -- if anyone knows of any, please let me know!), and was happy to do a bit of legwork to get something that would then be simple to use.  So, I came up with the following macro:

(defmacro easy-remove-method (name &rest args)
  `(let* ((modified-args (mapcar (lambda (x)
                                   (if (symbolp x)
                                       (find-class x)
                                       `(eql ,x)))
          (method (find-method ,name '() modified-args nil)))
     (if method
         (remove-method ,name method)
         (format t "Failed to find method (~a () ~a)" ,name modified-args))))

One could then call something like:

(easy-remove-method #'foo 1 'baz)

which would be equivalent to:

(remove-method #'foo (find-method #'foo '() '(eql 1) (find-class 'baz)))

Since I was working on methods which had integer-based eql specifiers, this made things much handier. In principal, I think you could just as easily place any other arbitrary object there and, as long as you didn't quote it and thus make it a symbol, you'd get an eql specifier for it. With the quote, you get find-class on that symbol. Which is just what I wanted, so yay.

Saturday, March 14, 2015

I've started SICP... again.

Not much to say here, because I say it over on a new blog I just started.  I'm going through SICP... that is, the Structure and Interpretation of Computer Programs.  Just thought I'd mention it here, in case anyone's following and might be interested in following that, too.  Don't worry, I don't expect it to be terribly interesting to everyone.  :)

Monday, January 26, 2015

What does Freedom mean to you?

There's a lot of lip-service given to Freedom in the United States. I was visiting with some friends in Berlin a few hours ago, and one of them (an American ex-pat) talked about there being much more freedom here. Like, that he could walk into somewhere, buy a bottle of beer, walk out, start drinking it on the sidewalk, and even then take it into the subway, and continue drinking. (I'll note that there are some signs about not drinking alcohol in the subways here, but I've never seen that rule enforced, and I've often seen people drinking a beer in the subway. And yet relatively rarely (though not never) have I seen the kind of drunkenness that seems to me so (comparatively) common in the United States.)

Now, is this an important freedom? As a non-drinker, myself, it's not one I happen to care all that much about, but I do think there may be something to it, somehow.

On the other hand, there's also the "freedom", I imagine some would see it as, for people to smoke in most bars here. A freedom that in many places in the states has been quenched, in favor of the freedom for others to be in a bar without experiencing second hand smoke. In this case, I'd quite definitely prefer the latter freedom, for myself. But maybe there's something to the former, as well, somehow? And even if not, who decides whose freedoms society will do more to protect, when freedoms come into conflict with each other? And how does the decision get made?

What freedoms are important to you?

No answers in this post. Only questions. It's just something my friend got me to pondering about. I'd enjoy hearing thoughts from anyone who may be reading this. Whenever that may be. Of course, you're free not to comment, too. :)

Tuesday, December 30, 2014

A confession to a future world...

I've scheduled this post to go live almost exactly 1 year after the incident that I'm about to describe.  It's quite likely that I'll have forgotten all about it by then, and especially that I made this post.  Or who knows, maybe I'll remember and delete it.  Maybe... well, all sorts of possibilities exist, including one that has a strange connection to what I'm about to say: Maybe, just maybe, I'll be dead.  I'll get to why I say that in a few paragraphs; for now, the backstory of today (or a year ago, or longer, if you don't see this post right away):

So, here's the thing.  I've been going to the gym of late ("of late" being late 2013, this post being written on the penultimate day thereof), three days a week (Mondays, Wednesdays, and Fridays), with my friend and now housemate, Vern.  Today, being a Monday, was one of the days we went. And today, I over-exerted myself.  Today was an upper-body-workout day, which meant that I start by walking on the treadmill a bit, then did a variety of weight-lifting exercises on the various machines there, and then finished it off with a recumbent stationary bike.  As per my normal, I pushed myself to increase either the weight or the reps (sometimes reducing the former, to get a greater increase in the latter) of each machine lift by a little bit... it varied, but somewhere on the order of a 20% increase in total weight-times-reps volume. Actually, I suppose it's a little more than that... my tracking app ("PumpNLog" - weird name, halfway decent app) says that I lifted 38,662 lbs in total (it's multiplying weight times reps, though with a caveat that I'm sort of making things up for the "weight" and "reps" of the walking and bike machines - also, I changed the way I logged the walking machine, so that says I did +75%, though really it was at most a modest increase in workout intensity, and maybe even a decline in it, from my last round.)  My "workout density", according to the app (which I believe is weight*reps/minutes) was up 17.4%.  Looking through, there are a couple of exercises that I really did do a lot more of - +46.7% on the "Row/Rear Deltoid", which I'd only done once before, and deliberately taken it easy on, plus I switched to 4 sets, 2 with each handle position, from my past version where I did 2 and 1...  Back extension, which I've been finding to be fairly easy, was also a significant increase, up 60%, all in reps. Most of the others were up between 3.6% and 24%.  Oh, and I skipped two exercises, which I'll get to in a moment.  Without running the numbers carefully, I'd say the 17.4% increase is probably about reasonable, overall.

Anyway, that's probably going way more into the numbers than I need to, even while it's less than I could.  I mentioned that I skipped two exercises, though...  One of the last machines I visit is the "assisted dip/chin" machine - a machine with a padded platform that you kneel on, which is tied to some weights to help you do "dips" (I guess that's what they're called - like dropping yourself between, and then pushing yourself back up, on parallel bars, kind of) and chin-ups (or something like them).  These are not something I'm great at.  I'm a big guy, weight somewhere in the near order of 400lbs, currently.  I've been setting the assist at the maximum possible: 175lbs.  I did the same today.  In the past, the most I've done is 4 dips, and 2 chin-ups, even with the assist.  And never more than a single set.  Today, though, I was feeling worn out from what I'd already done (perhaps perversely, I have these as my next-to-last machine, before abdominal crunches, which I still did)... and I tried doing a dip, and basically couldn't lift myself back up with my arms, as is the goal.  I just couldn't do it.  So I put a leg down and lifted myself back up that way, and just skipped even trying to do the chin-ups.

This was my first major sign of over-exertion, though I'd had some minor signs of more exhaustion than usual earlier on... but I was pushing myself, and I only got about 6 1/2 hours of sleep last night, which is not atypical, but is a bit less than I like to get.  So I hadn't been thinking too much of the earlier signs, and really, didn't even make too much of this new bigger sign.  These had always been hard, and I just didn't really care that much.

Anyway, so, I then went on to do my crunches (with weight added on a machine, though it's also on an incline, so maybe that balances out?), which went OK - I did increase reps, without increasing weight, and I did push myself kind of hard on that front, but it didn't seem a big deal.  And then, came the recumbent.  Normally this borders on a relaxation thing - I get my heart-rate up, sure, but it feels sort of free and easy, I just have to stick with it for a few minutes.

So, here's the thing with that.  The machine has sensors in some handles, at one's side.  You grab the handles, and it measures your heart rate.  So the way I've been doing things is by setting a time, and a target heart rate.  It then adjusts the resistance to try to get my to my target heart rate, apparently aiming for getting me there about 4 minutes in or so - or at least that's been about how long it's usually taken.

So, in the past, I've set my target heart rate to 130.  By the time the machine has a read, I'm usually already up to about 115, having been on the bike for maybe 30 seconds, and having just come from all those other exercises, which, per an iphone-app-based measurement earlier today, was getting me to a reading of 104 during lifting anyway.  (Well, and that app will enter in to some future revelation here... I'll get back to that.)  And in the past, I've typically found myself aiming for a pedaling rate of about 75RPM.  At this rate, I figure the machine is programmed to not give me much resistance, because I'm likely to hit my target without it.  Well, today, I think partly because I was a bit more tired than usual, and partly because I had this theory that it was kind of annoying how little resistance there was, and I thought it might be nice to have more, I semi-deliberately kept my pace down to between 60 and 65 RPM.  I also decided to try upping my target heart rate a little, and intended to set it to 135.  Apparently I goofed, though, because the machine didn't tell me I'd reached it at 135, waiting instead until I got to 137.  But before that, it was also giving me a lot more resistance than I've ever seen from this machine previously - presumably because my pedaling rate was down, and my target was higher, so it figured it better make me work.

Well, this was much harder than in past times.  How much of this was due to exhaustion and how much was due to added resistance, I can't quite say, but it got to where I was struggling a bit, maintaining the 60RPM pace.  And then it didn't think I'd hit the target until 137... which of course is lower than what the machine wants to stick me with, according to the ACSM guidelines mentioned on the label of the machine - but of course, those are for an 85% target, which is recommended for experienced folks.  I'm still quite new to this gym-going thing, and it was probably stupid of me to even go for 135 yet, let alone 137... or my actual peak of 140, which is fully 77% of my "maximum" heart rate for my age.  Anyway, that's how high it got, at the peak.  (It tries to adjust to keep you at your target, but it's not an immediate system, so peaks still exceed targets as a normal course of events, as far as I can tell.)

Anyway, I was at that for 7 minutes, plus a 2-minute cool-down, during which I think I got my heart rate back down to about 125?  Something like that.  And then I tried to measure it with the iphone app. The way the app works is it turns on the "flash" LED next to the camera, and you're supposed to put your finger on the surface of the camera, and it uses the minor variations in the light shining through your finger to then measure your heartbeat.  I've used the app several times previously, and it's always seemed to get a nice reading, latching on over the course of a few seconds, and then producing a nice sinus rhythm sort of graph (well, something that vaguely looks like one, anyway, to my untrained eye; though looking at the graph now on wikipedia, it's definitely simpler than that... hmm, it might even be closer to a sine wave, and it's not even that, really, but anyway, a wave, with a regular-looking frequency.)

Well, this time, it couldn't get a lock.  My muscles in my arms and hands were twitching a little, after the exertion, so I wasn't entirely surprised that it had some difficulty, but I did try to hold myself still for it, even holding my finger into place with my other hand - which I suppose could have messed things up, if I was pressing too hard?  Anyway, it couldn't get a good reading, and was trying for a lot longer than usual.  By the time it finally decided it was getting a reading, the reading it got was 86 BPM.  But here's the thing... the graph wasn't at all regular.  It was wavering about in a random-looking pattern... Perhaps I ought to upload a screen-shot, but I'm lazy, so, while I've captured a screenshot, I'm going to instead just point you at a graph that looks a little bit like it: sin(x)*sin(1.7)x.  Less regular, though, and... less periodic, even.

Which is getting me close to the main point here: I wonder if I was having some sort of heart attack.  Ventricular fibrillation, perhaps?  The graph looks a little bit like the one on that page, if you zoom in to just see a smaller amount of it.  Or maybe some other sort of arrhythmia?  I'm not a doctor, and my graph is not from an EKG, so I really don't know.  What I do know is that the app had a hard time getting a reading, that the graph it finally got was quite different from how they normally look even within the same app, and... what happened next.  I was on the edge of collapse.  I think I almost passed out.  I don't believe I lost any significant amount of time, but it's hard to say for certain, and I certainly noticed that I was feeling faint, that my head lolled forward and to my left a bit, my eyes closed, and it felt very similar to the feeling of nodding off to sleep.

And I wondered if I was having a heart attack.

Which brings me to the confession: I hoped that I was having a heart attack.  I've head other times, too, when I've felt like I might be having one - usually late at night, when I wake up from sleep... probably anxiety and/or indigestion related, really, but where things don't feel quite right.  Anyway, this situation felt a bit differently, and certainly had a ready-at-hand explanation, heart attack or no, for some exhaustion.  So it was different...  And yet, it was the same: In each case, I've found myself hoping that this was it, that I was about to die.

You see, I'm someone who has attempted suicide, several times.  And they weren't just cries for help or whatever, they were genuine attempts at dying.  In one case, after taking a month's supply (600mg) at once of Adderall, I definitely did pass out (on the crash end, though, so quite a few hours after the dose), and was down for... I don't remember how long, but many hours.  I'd hoped then, too, as I was barely able to move, lying face down in my bed (which I'd somehow managed to get myself to, while I still could), that this would be it... that I wouldn't wake up from the drooling stupor that was encroaching.  Alas, I did.  And I didn't go to the hospital or anything, I just went on living, as one does, after failing at suicide for the... 5th or 6th time, was it, by then?  Several of which had been in just the last few months.

Well, that was almost 13 years ago, by now.  So back to today.  Still, I had that hope.  The hope that this would be it.  Because you see, even while I haven't been especially suicidal lately (note, though, that this is a subjective and relative measure - my "normal" suicidal ideation rate is, I'm sure, "abnormally" high...  I'd guesstimate that I've thought about wanting to die roughly 90% of the days I've been alive?  Many many times, some days.)  And I wasn't particularly feeling depressed or anything today.  I certainly hadn't had any thoughts of deliberately over-excerting myself today for this purpose... though I have, previously in this gym-going regimen, pondered whether it might bring about a heart attack, given that I haven't consulted a doctor, or a trainer, or even the internet, on what sort of base to set for myself, to do this safely.  So there arguably is a bit of subtle self-destructive intention to this.  On the other hand, I also just like the feeling of post-workout soreness, and I like the idea of getting stronger and/or more fit.  So, part of my motivation is benign and "normal", too.

But here's the thing: I've had so much emotional pain in my life, over so many years, that when confronted with the prospect that I might be dying, and outside of something which threatens much in the way of pain (e.g. worrying about being in a car crash, say, like the other day when I was a passenger in a car where the driver was a bit...  erm, how shall we put this kindly... erratic?), the types of thoughts that come to my mind are thoughts of hope for relief.  That whatever bit of pain the experience I'm about to have might actually bring, relief from the long-standing (bordering on ever-present) emotional pain would be so huge as to have me barely caring.  And yet, the idea of suicide, especially after a half dozen or so failed attempts in my life, has a dread of the added pain (physical and/or psychological) of another botched attempt - especially if it made things even worse, which... I think some of my past attempts may have actually done, in subtle ways.  I think I may have less happy kidneys than I once did, and maybe my heart, too, and also my memory seems to be affected, though it's unclear to me whether that's from that overdose (or other asphyxial attempts), or whether it's a more direct effect of some of the anti-depressants I was on at the time of most of my attempts - anti-depressants which did horrible horrible things to me.  (Don't try akathisia, you're not gonna like it.  With apologies to Queen for the on-topic change of lyric.)

Anyway, I'm scared to try suicide again.  I'm scared not of dying, but of living, especially with new problems that might be created by a failed attempt.

But when I think I might be dying... well, that thought brings some comfort.  And makes me wish it, devoutly, to be so.  And yet, here I am, writing this up.  To be posted a year later... if I leave it around that way.

If I die of a heart attack during the night some night, or, more likely (or so it seems), during another of these gym workouts... and if these words end up somehow being some beyond-the-grave final words of mine... just know that it wasn't exactly suicide, but neither was it unwelcome.  For in the moments of me thinking I might die - thinking that that moment might truly be it - I wish for it.  And I fear not dying, but having someone call for help, and help coming, and being resuscitated.

I really ought to look into a living will, and maybe a DNR tattoo or something.  (Or "AND"?  That has the potential to look awfully benign... I wonder if medics would get it.  I fear not.)

Anyway, I've been wanting to put something out into the world about this for a while.  I've always been hesitant, though, for fear of it looking like a cry for help.  It is not.  Help might be nice, and there are times that I make such cries, but this is different.  This is just me sharing with the world some little something about my experience, in hopes that somehow, someone, somewhere, may either understand me better, or be able to point to my words, and have someone else understand them better.

Do I want to die?  Yes and no.  Am I done putting good into the world?  I often hope not.  And yet, if I were, it would be such a relief of pain, that I would take it.  I only hope that whatever good I've already put into the world (and I hope that's some, at least) will somehow amount to something, somehow, for someone.  But it'll also be nice to (not be able to) know (or rather, it's nice in advance to imagine) no longer being a contributor to what I see as massive human overpopulation, among other problems I have with being alive, especially in the high-energy-consumption, high-food-intake, United States... where, while I'm better about the former than some, I still am making a significant negative impact on this planet.

OK, that's all I've got for now.  Maybe someone will read this someday.  Maybe I'll be alive to regret having posted it.  Or maybe I'll be glad I did.  Or maybe these are my final words to the world.  Just in case that last is the case... I send my love to those who surely know I still love(d) them, my regrets to those I've hurt in any way, and my wishes for a happier life for anyone left amongst the living.

Fare thee well.

Sunday, April 27, 2014

Contradiction... and resolution

Last weekend was the American Atheists's 2014 national convention.  And it happened to be in Salt Lake City... where I happen to be living these days, so... even though I didn't really feel like I could afford the tickets (I suppose I could have tried harder, but I failed to find a sufficiently low-priced option (see point #4) to actually attend), I went and hung out a bit: the "hallway track"take on things, plus a few things that were explicitly open to non-attendees (for which I'm thankful!): the exhibitors' displays, the book sale room (not that the books were free), and, importantly to this post, a screening (actually, several) of a new film from a guy named Jeremiah Camara, called Contradiction (also on facebook).  Here's a trailer for it:

So.  Let me just say that I'm really glad I had a chance to see this film, and that I would encourage any and all who have the chance to see it.  Let me talk a bit about why:

  1. Perhaps most generally, it's a film that's taking a critical look at the effects of religion on society.  I've come to an increasingly strong belief that organized religion in many (perhaps even all?  certainly, to me, all Abrahamic) forms is deeply harmful to... "us", whether we think of "us" as our society at large, or individual humans, or... all species of life on this planet, even.  That's a strong statement I'm making, and I don't think I have the energy to quite back it up here with my own words, so I hope you'll forgive me for a bit of hand-waving and just direct you to a two part blog post (not to mention the subsequent talk and book [Powell's; Amazon]) from Greta Christina (who I was lucky enough to chat with a bit; she's awesome, by the way), which gets into some of it, and then things like Daniel Quinn's Ishmael [Powell's; Amazon], which does a whole lot of deconstructing of things, that's been a significant influence on my thinking.  Which goes beyond that, but anyway, the point is that this film is taking a critical look at the effects of religion, and I think that's a wonderful thing.
  2. Further, it's particularly looking at the effects of religion on the (let's see, what's the PC word these days? well, I think the word our director used was) black community within the United States. My understanding is that this is a community which often goes under-represented within atheist circles (though there are signs of change - a good thing, 'cause it's apparently a pain to be a black atheist). It's also, of course, a community which has faced all sorts of other difficulties.  And the impression that I get from the film is that there's definitely some correlation between these points. And that... well...
  3. There's an exploration in the film of the idea that Christianity, in particular, is something that may well be common within the black community because slave-owners forced it on them, with a twisted message of getting freedom in the afterlife thanks to a relationship with some so-called god, by being submissive to your master in this life.  I think it's fucking atrocious that this happened, and just about as bad (though with less individual culpability) that the attitudes instilled in this way are lingering on, continuing the enslavement (of mind, if not body) of black Christians today.  But then:
  4. While this movie is nominally about the black community, and its religiosity, I think it has powerful things to say about the harm of religion in general.  And yet:
  5. It's been made in a way that's loving and respectful to believers, showing how easily they could be lured in to such beliefs - and yet also showing the dark side of those who may be profiting (or even profiteering) from their, err, propheting, shall we say?  Their ministry, anyway (in the sense of the action of ministering to someone).
So yeah.  I think this is an important film, and that people need to see it.  So if you have a chance to see it, do.  If you have connections in the film biz and can help it get distribution, please have conversations. Or maybe go check out Jeremiah's other project, The Slave Sermons, and watch, like, and subscribe.  And/or donate.  Something.  Just do what you can to help get this film seen.  Because really, it needs to be seen.  Help resolve the contradiction, by making people more aware of its existence.

Thanks for reading.

Tuesday, July 2, 2013

Magnetic Personality...

I put very little stock in the "fortunes" in so-called fortune cookies. They do, however, at times provide amusement... And at times provide interesting food go thought. So I like them, and I take them, when offered.

One was offered to me today, in an indirect sort of way (a bin of them left out at a business I frequent), so I took one. It tells me:

"You have a magnetic personality."

It has a little picture of a rose, with leaves (seemingly still on the living plant) next to it.

A magnetic personality, huh?

So what happens if two people with magnetic personalities meet? I guess it would depend on which poles were facing which directions, wouldn't it? Maybe they'd attract, super strongly. Maybe they'd repel each other.

Or maybe they'd start with the former, and then somehow a pole would flip, and they'd repel. Is that what it is? Is that how it works?

Or maybe the metaphor is just bunk, since I'm not really so very magnetic as all that.

Just random musings.

Palo Alto and Mountain View...

Random Observation: CalTrain #324, an express train southbound from San Francisco to San Jose, was quite full when I boarded, at the Hillsdale station this morning (2013-06-19). In Palo Alto, I think more than half the train cleared out. In Mountain View, almost everyone else left. There are now two people, besides me, in the visible seating (about 5/12ths) of the car I'm in, whose only other stop is San Jose.

From this, it seems to me, one of two things can be inferred - though it's possible it's a mix of these, and likely that I'm missing some possibilities:

(1) Living in San Francisco is desirable enough to commute down to high-paying silicon valley jobs, and/or:

(2) a bunch of people who work in Palo Alto can't afford to live in Palo Alto.

Just randomly thought that was an interesting thought. I wonder what the reality is, behind why people were on that train.