Perhaps I spoke too soon...

Aug 25, 2016 11:13

I am SO tired. Sooo tired. And achy. I feel like I've been hit by a truck or coming down with the flu (or some hellacious combination of the two!), yet there isn't a logical reason for it.

Oh, wait....I have fibromyalgia. Since last week I've been trying to maintain a full workday schedule of book-learning, occasional errand-running, food preparation, and general keeping on top of every little thing that needs done. Now my body's rebelling, saying it's had a enough of that. Well, tough. Mentally I'm feeling better than I have in a while. I feel more confident that I am the smart, capable person I remember being before child-rearing kicked me out of the rat race, and I'm not giving that up. Time to up the painkillers and the caffeine and continue onward.

(I know that's a simplification of the issue. I do need to find a way to better balance rest and activity in the longer term. But too often my fibro symptoms have held me back from reaching even small goals, so now I'm siding with my motivation to dig down deep and finally get things done. We'll see if later today that means I'll be crashed out on the couch before teatime.)

But is it damn annoying to have an "invisible" condition like this. I know I generally look fine. I walk with a cane when I'm out in public because sometimes my balance goes wonky at inconvenient times, and my left leg is still slightly weaker than my right from a lumbar disc issue I had in 2012. I have a blue badge disabled parking pass, and when I use it I often feel like I should make a display of using the cane in case anyone is tempted to think I don't deserve the blue badge. What they can't see is the fact that I can't walk very far before being in pain. I don't get winded from walking as much as I get quickly fatigued. I've been getting up most mornings for the past two years to work out in the pool, so don't think these things are just because I'm fat and out-of-shape, though I know it must certainly look that way. Fibromyalgia does not care what you weigh. I'm just about 80 pounds lighter than I was a year ago and today I feel as crappy and broken as I ever did at my highest weight. It's just nice to know that if I needed assistance from an attractive EMT, he's more likely to be able to lift me now. ;-)

But enough whinging.

Tip #24: Fix the problem, not the blame.
Tip #25: Don't Panic! [First rule of debugging.]
Tip #26: “Select” isn't broken.
Tip #27: Don't assume it - prove it.
Tip #28: Learn a text manipulation language.
Tip #29: Write code that writes code.



Debugging
Strategies
  • Visualise your data - Either with Plain text (Variable Name = Data Value) or use debugging software with visualization capablilities
  • Tracing - Invaluable in any system where time itself is a factor: concurrent processes, real-time systems, event-based applications.
  • Rubber Ducking - Explain problem to someone else. The simple act of explaining, step-by-step, what the code is supposed to do often causes the problem to leap out. Verbalizing assumptions can reveal new insight.
  • Process of Elimination - Rule out your code first before blaming other parts of the system.
  • Element of Surprise - Bugs can be caused by previously trusted code. Fix bug and project better ways to protect the code in the future.

Debugging Checklist
  1. Is the problem being reported a direct result of the underlying bug or merely a symptom?
  2. Is the bug really in the compiler? Is it in the OS? Or is it in your code?
  3. If you explained this problem in detail to a coworker, what would you say?
  4. If the suspect code passes its unit tests, are the tests complete enough? What happens if you run the unit test with THIS data?
  5. Do the conditions that caused this bug exist anywhere else in the system?


Text Manipulation
Examples: awk/sed, python, tcl, ruby, perl, etc.

Application examples:
- Database schema maintenance
- Java property access
- Test data generation
- Book writing
- C to Object Pascal interface
- Generating web documention

Code Generators
  • Passive: run once to produce a result
    • Creating new source files (java)
    • Performing one-off conversions
    • Producing look up tables & other resources too expensive to compute at runtime
  • Active: used each time their results are required (results are throwaway)
    • Get 2 disparate environments to work together (take a database schema and use it to generate the source code for the structures needed in another language)


Emacs 24.4.1
Ran through the first section of the built-in tutorial for Emacs. Shortcuts covered are listed below.
(See: Tip #22: Use a single editor well.)

Ctrl-v: forward one screen
Alt-v: backward one screen
Ctrl-l: redisplays screen with cursor line now center of screen
Ctrl-p: previous line
Ctrl-b: back one character
Ctrl-n: next line
Ctrl-f: forward one character
Alt-f: forward one word
Alt-b: backward one word
Ctrl-a: move to beginning of line
Ctrl-e: move to end of line
Alt-a: move to beginning of sentence
Alt-e: move to end of sentence
Ctrl-x 1: Get out of unwanted windows (1 = leave 1 window, the one the cursor is in)
Backspace: delete character left of cursor
Ctrl-d: delete character right of cursor
Alt-backspace: kills word to left of cursor
Alt-d: kills word to right of cursor
Ctrl-k: kills from cursor to end of line
Alt-k: kills from cursor to end of sentence
Alt-Lesser-than: moves to beginning of whole text
Alt-Greater-than: move to end of whole text
Ctrl-u #: Sets up a repeat count for next command (# = number of times)
[Ctrl-u 8 Ctrl-f: move cursor forward 8 characters]
Ctrl-g: Stops commands or quits a command in processes
Ctrl-space: starts Mark Set
Ctrl-w: deletes text highlighted from Mark Set
Ctrl-k: kills line
Ctrl-y: reinserts last killed text/line at current cursor position
Alt-y: scrolls through previous kills

pp_tips, fibromyalgia, emacs, debugging

Previous post Next post
Up