Slashdot Mirror


User: meta+slash

meta+slash's activity in the archive.

Stories
0
Comments
6
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 6

  1. Use the tools Borge on Ask Slashdot: How To Start Reading Other's Code? · · Score: 0

    Reading other people's code is a punishment that one must master if you hope to grow as a programmer.  My favorite approach these days is to use callgrind and kcachegrind, walking up and down the call stack for each stimulus I can muster.  I often build a custom client to send malformed requests for these tests, it usually becomes part of my unit/regression tests.  Then I make note of the most prominent function names and data structures.  I construct an outline as if I were writing a book.  GDB is also a fantastic tool for understanding software.  You can learn a lot about code merely by setting a break point in malloc or read.  Don't be afraid to use 'set var' to explore an interesting test case.  strace, particularly with -c or -ff, can give you a quick idea of what a program does.  Eventually I start to change it.  First I use indent or some IDE to fix the whitespace, then I start to refactor. Eventually the code begins to look more like something I wrote than what I inherited.  That's how I know when it's time to hand it off to someone else ;)

  2. Re:grep and emacs integration on (Stupid) Useful Emacs Tricks? · · Score: 1

    Good point, that is not obvious.  grep behaves differently if you provide only one filename than if you provide more than one filename.  Adding /dev/null guarantees that I always get the multi-filename behavior.

  3. grep and emacs integration on (Stupid) Useful Emacs Tricks? · · Score: 5, Interesting

    Of all the Elisp I've written this grep is what I most miss when I use a coworker's environment.

    (defun my-grep ()
      "grep the whole directory for something defaults to term at cursor position"
      (interactive)
      (setq default (thing-at-point 'symbol))
      (setq needle (or (read-string (concat "grep for <" default "> ")) default))
      (setq needle (if (equal needle "") default needle))
      (grep (concat "egrep -s -i -n " needle " * /dev/null")))
    (global-set-key "\C-x." 'my-grep)
    (global-set-key [f8] 'next-error)

  4. Seen on Road Rage Linked To Automobile Bumper Stickers · · Score: 5, Insightful

    Don't drive as if you own the road ... Drive as if you own the car.

  5. Re:Measuring your power on Saving Power in your Home Office · · Score: 1

    The kill-a-watt (mentioned in other replies) is great, but if you have enough toys that they require more than one electrical outlet, as any self respecting geek does, you should get a whole-house monitor like mine. I have one and love it. It doesn't save you energy, but it's a better way to measure consumption than timing your meter revolutions. Now if only I could transfer that data to my computer.

  6. Re:I Own a Hybrid Civic on Hybrid Cars Don't Live Up to Mileage Claims · · Score: 1

    I bought my hybrid Civic 9 months back. I typically get 50mpg. I can reproduce 60+mpg most any morning (10am ;) on my way to work 15miles away. My commute is against traffic from one Washington DC suburb to another. The evening traffic usually limits me to 50+mpg (I can't vary my speed to fit the terrain as much... people get fussy when you're not going something over the speed limit). My wife (no lightfoot) got 51 the one time she took it for a long (120mi) trip up I95. So I'll back up all the people who point to driving habbits to explain poor milage. I will say though, that all the numbers quoted above are DC summer. I was getting 44-48mpg between ~December and ~Feb. I don't know if that's from oxygenated gas or just the cooler weather. I sold my Accord EX to get this civic and am very happy.