Tuesday, November 26, 2013

How I lost 67 Pounds

Between April 2012 and October 2013, I lost 67 pounds. People keep asking me how.
The short answer: diet and exercise.
The long answer: I had a plan. It started simple and grew more complicated. That plan is below.
DISCLAIMER: I am not a professional nutritionist or a professional physical therapist. This is not intended as advice, but to document what I did to answer others' questions. What worked for me might not work for you.
Disclaimers aside, let's make way for:

Morty's Weight Loss Plan

General weight loss

  1. The big rule: don't try to do everything at once. Start small and build.
  2. Don't lose weight too fast. For the first week or two, it's OK to lose a lot of weight, but after that, it should be 1-2 pounds per week. If you're losing weight faster than that, back off. Do less exercise and maybe relax the diet a bit.
  3. You're not just doing this until you lose weight. If you go back to your old bad habits, you're just going to put the weight back on. The goal here is to make lifestyle changes that will let you lose the weight and then keep it off. And you need to exercise even if your weight isn't a problem. So your mindset should be "what can I live with for the rest of my life", not "what can I live with until I drop the weight."
  4. NB: you do get to back off a little bit when you reach your goal weight. It's easier to maintain weight than to lose weight. Homeostatic equilibrium, baby.

Eating

  1. Eat at least three meals per day
  2. Eat at least 5 items of fruit per day. Usually a banana, two apples (fuji and something else), a pear (bartlett, d'anjou, forelle, or other green pear or red pear, but not packham) and a citrus (minneola tangelo, valencia orange, or other)
  3. Eat at least one serving of vegetable per day. [Mom would be so proud.]
  4. Eat at least one serving of fish per day. Canned fish works well. Examples: tuna salad (suitable for work), sardines in lemon sauce, sardines in mustard, smoked trout.
  5. Watch out: don't bring "stinky" fish to work. Some people didn't grow up eating this stuff. Poor them.
  6. Avoid starch. That includes bread, potato, pasta, or rice. A little won't hurt, but don't overdo it.  (I eventually added a daily whole wheat bagel.)
  7. Eat at most one "meat" meal per day. The other meals should be just fruit and/or vegetables and/or fish
  8. Meal idea: stir fry. Use 2 pounds of veggies for every pound of meat.
  9. Meal idea: grilled steak and grilled veggies
  10. Meal idea: Maiwand Kebab (21044, by the Safeway, not one of the other ones). Lamb kebab, substitute eggplant and chickpeas.
  11. Eat fruit and veggies *before* "fun" food
  12. If you're hungry, eat. If you're thirsty, drink. If you're tired, sleep.
  13. While eating, pay attention to your hunger. If you're not hungry any more, stop eating. Eat slowly, so your body has time to adjust.
  14. It's OK not to finish everything on your plate.
  15. You can eat food that's healthy. You can eat (some) food that's tasty, even if it's not healthy. If the food isn't healthy and isn't tasty, don't eat it! This is especially a problem at restaurants, which tend to bundle "bad" foods with "good" foods. I don't much like french fries, and they are not healthy, so why do I eat them when they are served in restaurants as a side?
  16. Tricks for dealing with restaurants: "hold" and substitutions. I tend to eat whatever is served to me, even if I don't like it -- I don't want to waste food. So, get them to "hold" it, so it won't be wasted. Or substitute for something healthier. Most restaurants are happy to substitute salad for french fries.
  17. When eating out, partition your food. Don't eat more than you think you should. Remember, it's OK not to eat everything. The starving kids of the world won't be any more fed if you overeat.
  18. When you want to drink juice or other sugar waters, drink just a small amount. The best part is the first swallow. Then slake your thirst with water.
  19. The above works with most tasty+unhealthy food. Ice cream? Have a spoonful, and then eat something else.
  20. You are allowed to make occasional exceptions. The bread at Maiwand 21044, for example. Just don't do it too often.

Exercise

  1. "No pain, no pain." If it hurts, stop the exercise or decrease the weight.
  2. Watch TV on an exercise machine (treadmill, exercise bike.) No TV watching from the sofa unless you are also keeping up with your exercise.
  3. Never run two days in a row -- intersperse with bike work.
  4. When you have time, spend extra time walking/biking at low intensity. This helps you lose weight. Keep it slow.
  5. Split the weights into muscle groups. Do different groups on different days.
  6. Gradually increase the load over time. I increase one setting per visit, gradually rotating through all settings. Since I use 12 different weight machines, that means I stay at a given setting for about 2 weeks before I increase it.
  7. Don't increase by more than 5 pounds at a time. For machines that only go up by 10 pound increments, use 5-pound add-on weights.
  8. If you are scheduled to increase the load but are having a lot of trouble with it, DO NOT increase the load. See "no pain, no pain" above.
  9. Even if you are scheduled to stay at the same weight you have done before, if you are having trouble with it, decrease the weight. See "no pain, no pain" above.
  10. Exercise every day if possible while trying to lose weight.
  11. Missing one day occasionally is OK. Do not miss two days in a row. [When you're done losing weight, you might be able to back off to exercising every two days as a matter of course.]
  12. High-speed exercise is good for the heart. Low speed exercise is good for weight loss. The border is at a pulse rate of about 180 - $your_age. Above that threshold, you don't burn fat. Do both kinds of exercise.
  13. Per the above, you need a heart rate monitor. Be sure to get one with a replacable battery.
  14. Normal exercise sequence: half an hour of swimming followed by half an hour of running/walking or biking followed by weight work.
  15. Exerise every day. If you can't do every day, do every 1.5 days.
  16. I try to exercise 7 times in a week. Sample schedule: Monday morning: run, group 1 (abs and arms). Tuesday morning: bike, group 2 (chest, thighs, legs, shoulders). Wednesday: repeat Monday.
  17. Note that the above was not an all-at-once deal. When I started out, I was just going the running. After more than 5 months, I started the group 1 and group 2 exercised. A few months after that, I started the exercise bike. I phased in swimming about 15 months after I started, then dropped it a few months later.



Thursday, June 6, 2013

Commands: noun, then verb

One of the little things that irk me: commands that start with a verb followed by a noun.

I fully understand why English-speaking people tend to put the verb first. In English, an imperative order is given verb first. "Insert this module! Delete this directory! Add this apt repository!" So English speaking programmers tend to use the same convention for program names.

Unfortunately, verb-first order breaks command searching via command completion. Suppose I want a module related command, but I can't remember the name. The part I'm most likely to remember is "mod". If it were "modins", "moddep", "modrm", etc., I could start typing "mod" and press <tab> and the various module-related commands would be listed. But if it's "insmod", "depmod", "rmmod", etc., I had better remember the particular verb used as well as the noun.

A related problem is that verbs tend to not be consistent. Why do we "ins" and "rm" modules but "add" and "del" users? The noun part is much more likely to be consistent. Once more, command completion comes to our rescue.

When I did Solaris admin, I was impressed that all their module commands started with "mod". I'm happy to note that people in the Linux world now mostly seem to get this as well. The early Linux module commands were "verb-noun" ordering, but the newer module commands are "noun-verb" -- "modprobe", "modinfo". Similarly, the early "user" commands were "adduser" and "deluser", but the modern equivalents are "useradd" and "userdel". Yay for progress!

[And now I have a reference for when I need to argue with someone on why they should rename their program! Yay me.]

Monday, May 6, 2013

Android configuration

I document all my normal Android settings, for when I have to configure a new device. Let's share.
  1. settings
    1. security
      1. unknown sources: allow
      2. screen lock: pin
      3. automatically lock: 5 minutes after sleep
      4. power button instantly locks: off
      5. owner info: enter name and email
      6. verify apps: enable
    2. backup and restore
      1. automatic backup: enable
      2. automatic restore: enable
  2. accounts:
    1. google
    2. dropbox
    3. facebook
    4. Mantano (now expired)
    5. netflix
    6. outlook web email
    7. skype
    8. tivo
    9. twitter
  3. ADW (ADVANCED)
    1. actionbar: don't show
    2. dock: rotate with device orientation
    3. desktop position: ICS slider
    4. app drawer: ICS paginated
    5. transitions: normal scroll
    6. ADW Settings
      1. screen
        1. desktop columns: 5
        2. desktop rows: 7
      2. system
        1. advanced settings
          1. home orientation: portrait
    7. desktop setup
      1. icon row:
        1. phone
        2. beyond podcast
        3. chrome
        4. reader
      2. row: 1 (from bottom)
        1. power toggles icon (see below for details)
        2. widget beyond podcast 1x1 icon
      3. row: 2 (from bottom)
        1. widget connectbot frakir.org
        2. maps
        3. winamp
        4. folder
          1. facebook
          2. twitter
          3. flipboard
          4. google+
        5. play store
      4. row: 3 (from bottom)
        1. folder
          1. mantano reader lite
          2. AEPreader
          3. aldiko premium
          4. eReader Prestigio
          5. ZXReader
          6. HaTaNa"Ch
        2. OurGroceries
        3. folder
          1. Angry Birds
          2. Angry Birds seasons
          3. Bard's Tale
          4. Defender II
          5. Minecraft PE demo
          6. Sudoku
        4. folder
          1. MX player
          2. Music
          3. Mythfrontend
          4. netflix
          5. pandora
          6. tivo
        5. folder
          1. Gmail
          2. Messaging
          3. Outlook Web Mobile
          4. People
          5. Skype
          6. Talk
          7. YAIIC
      5. row: 4 (from bottom)
        1. folder
          1. Clock
          2. StopWatch and Timer
        2. Navigation
        3. folder
          1. Camera
          2. Camera MX
          3. DOF Calculator
          4. OneShot Cam
          5. Smart Voice Recorder
        4. folder
          1. settings
          2. ADW Config
          3. Authenticator
          4. battery indicator
          5. BlueAnt
          6. Downloads
          7. Dropbox
          8. ES File Explorer
          9. Gallery
          10. Power Toggles
          11. ROM Manager
          12. SGS3 Easy UMS
          13. StickMount
          14. SuperSU
          15. Task Manager
          16. Torch
          17. Traceroute
          18. UltraTools Mobile
          19. Wi-fi Web Login
        5. folder
          1. Tricorder
          2. AK47
          3. Android Lightsaber
          4. Android Lightsaber (#2)
          5. BlueScreen
          6. Earth
          7. Google Sky Map
          8. Periodic Table
          9. screen Crack
          10. Sonic Screwdriver
          11. Sonic Screwdriver (#2)
      6. row: 5 (from bottom)
        1. blank
        2. blank
        3. folder
          1. Barcode scanner
          2. BMI Calculator
          3. Chicon7
          4. DC Metro Map
          5. DC Metro Transit
          6. Goggles
          7. How to Tie a Tie
          8. Karl's Mortgage
          9. Local
          10. MyBMI
          11. NASA
          12. News and Weather
          13. RunKeeper
          14. Running
          15. Speed Dial
          16. The Weather Channel
          17. Translate
        4. RealCalc
        5. folder
          1. Titanium Backup
          2. APN Backup & Restore
          3. Call Log Backup & Restore
          4. SMS Backup & Restore
      7. row: 6 (from bottom)
        1. blank x5
      8. row: 7 (from bottom)
        1. blank
        2. Calendar
        3. Hebrew Calendar Widget (see below)
  4. aldiko premium
    1. settings | display | page turn animation = off
  5. automateit
    1. settings
      1. show popup messages: off
      2. show service notifications: off
    2. add rules
      1. application trigger
        1. application: map
        2. actions: composite
          1. GPS: on (phone only)
          2. mobile data: on (phone only)
      2. power connected
        1. actions: composite
          1. GPS: on (phone only)
          2. bluetooth: on
          3. wifi: on
      3. power disconnected trigger
        1. actions: composite
          1. GPS: off (phone only)
          2. bluetooth: off
          3. wifi: off
      4. application activated trigger
        1. application: MX Player Pro
        2. action: set screen brightness 100%
      5. application deactivated trigger
        1. application: MX Player Pro
        2. action: set screen brightness automatic
  6. AVG
    1. activate
  7. battery indicator
    1. just start it
  8. call logs backup and restore
    1. preferences
      1. backup folder: external card
      2. schedule backups
        1. enable
        2. 4am
        3. repeat 1 day
  9. connectbot
    1. set up hacker's keyboard first
    2. connect ssh to morty@frakir.org
    3. connect ssh to work
    4. connect local
    5. create shortcut widgets for morty@frakir.org
  10. dropbox
    1. configure account
    2. upload phones
      1. upload existing photos: no
      2. skip
  11. email
    1. settings
      1. application
        1. auto-advance: message list
  12. ES File Viewer
    1. settings
      1. file settings
        1. show hidden files: yes
      2. view settings
        1. view: details
  13. facebook
    1. log in
    2. sync (contacts): Sync all (note: won't be present on tablet)
    3. settings
      1. sync photos: off
      2. messenger location: off
      3. sync contacts: sync all (note: won't be present on tablet)
  14. hacker's keyboard
    1. configure input methods (also under settings | keyboard)
      1. hacker's keyboard
        1. enable
        2. settings
          1. keyboard mode, portrait: full 5-row layout
    2. set current input method (also under settings | keyboard)
      1. hacker's keyboard
  15. Hebrew Calendar 3x1 widget
    1. hebrew date changes at: midnight
    2. location for candle lighting: enter location manually: 21044
    3. Language: Hebrew
    4. minutes before sunset to light candles: 18
  16. mantano
    1. settings
      1. bookshelf
        1. import folders
          1. add: /mnt/inbooks
          2. del: /mnt or other defaults
  17. ourgroceries
    1. send auth request to main acount
  18. MX player
    1. settings
      1. decoder
        1. S/W decoder (local): yes
  19. netflix
    1. log in
  20. power toggles
    1. create a widget
      1. toggles:
        1. hotspot (wifi)
        2. wifi
        3. bluetooth
        4. gps
        5. mobile data
        6. screen lock
        7. volume toggle
        8. brightness quad
      2. transparency: about 50%
    2. under the app:
      1. notification widget
        1. enable
        2. conigure
          1. two rows
          2. row1: as per widget above
          3. row2:
            1. flash light
            2. screen light
            3. data sync
            4. sync now
            5. airplane mode
            6. play/pause music
            7. rotation lock
  21. realcalc
    1. settings
      1. RPN mode: yes
      2. Enable Radix modes: yes
      3. swap percent and 1/x: yes
  22. tricorder
    1. obtain from your dropbox account
    2. settings
      1. sound level: quiet sound
  23. SuperSU
    1. settings
      1. show notifications: no
      2. clear logs after: never
  24. wifi web login
    1. log in at work
    2. log in at gym
  25. root phone (ADVANCED)
    1. download heimdall, recovery.img, and CWM file CWM-SuperSU-v0.87.zip to linux system
    2. build heimdall
    3. copy CWM file to phone external card
    4. reboot (#1) phone, while holding down buttons: volume-down, power, and home
    5. at prompt, press volume-up
    6. you should now be in "ODIN mode" (small print) and "Downloading..."
    7. on your PC, sudo ./heimdall flash --recovery recovery.img
    8. watch phone closely! If you miss your window, you will need to reflash until it works
    9. When it reboots (#2), hold down buttons: volume-up, power, and home
    10. If you boot into the normal phone OS, you missed recovery mode. Go back to the reboot #1 and reflash.
    11. You should boot into CWM based Recovery. If you boot into Android recover, go back to reboot #1.
    12. If you got into recovery mode, congrats!
    13. In the recovery menu, use volume-up, volume-down, and power to select
    14. select "install zip from sdcard"
    15. select "choose zip from sdcard"
    16. select "firmware"
    17. select CWM file
    18. select "yes"
    19. select "go back"
    20. select "reboot"
  26. Upgrading to a different firmware (ADVANCED)
    1. backup phone apps using Titanium backup
    2. backup call logs to external SDcard
    3. backup SMSs to external SDcard
    4. backup APNs; copy from local SDcard to external SDcard
    5. backup ADW launcher settings; copy from local SDcard to external SDcard
    6. download and transfer to phone sdcard:
      1. desired image
      2. google apps ("gapps") for desired image
    7. do usual root steps, up to second boot
    8. using clockwork recovery:
      1. make a backup of the system firmware
      2. wipe previous data
      3. install image
      4. install google apps ("gapps")
      5. reboot
    9. once booted
      1. configure wireless
      2. configure google account
      3. go to google play
        1. stop downloads (if they are happening)
        2. install titanium backup
      4. go to titanium backup
        1. menu | batch actions
          1. restore missing apps with data
          2. DO NOT: restore missing apps and all system data
          3. DO NOT: restore all apps with data
      5. reboot