Hacker Newsnew | past | comments | ask | show | jobs | submit | bogolisk's commentslogin

how about being portable to non-Intel platform?

Really, nothing new to see...


Here's our (Bloomberg) version of this. The bsls::TimeUtil component is used to implement the bsls::Stopwatch. It supports high-res timestamps on OSX/Windows as well as Solaris, AIX, and HP-UX (SPARC, POWER, IA64). It's a good base to start from and we'll continually tweak it for more performance as platforms change (I think there a few patches in the pipeline).

https://github.com/bloomberg/bde/blob/master/groups/bsl/bsls...

Component docs: http://bloomberg.github.io/bde/group__bsls__timeutil.html


blah.c:

  void foo(item *x)
  {
      x->blah(1, 2, 3);
      x->blah (4, 5,
            6);
      blah (7, 5, 1);
      foo (4, 5, 6);
      x->blah (4,
            5, 6);
  }
  
  
  void foo2(item y, item *x)
  {
      y.blah(1, 2, 3);
      y.blah (4, 5,
            6);
      blah (7, 5, 1);
      foo (4, 5, 6);
      x->blah (4,
            5, 6);
  }
search in blah.c for a call to blah() with 5 as 2nd argument from any structure or pointer.

  cgrep --code --semantic '_1 . OR -> blah ( _2 , 5, _3 )' blah.c 

output:

  blah.c:6:    x->blah (4, 5,
  blah.c:7:          6);
  blah.c:10:    x->blah (4,
  blah.c:11:          5, 6);
  blah.c:18:    y.blah (4, 5,
  blah.c:19:          6);
  blah.c:22:    x->blah (4,
  blah.c:23:          5, 6);


If you think that fetchmail is the best program ever written and DK's knowledge and intellect is at the same level as ESR then you deserve this book.


OK, so you don't think much of ESR. Any alternative recommendations in the same topic area?


Kernighan and Pike, The UNIX Programming Environment.

(I consider ESR's book worthwhile too, and it's less outdated. But K&P is the purest expression I've seen of how to Unix.)


Who is DK?


Very likely, Donald Knuth. ESR's title is suggestive of Knuth's http://en.wikipedia.org/wiki/The_Art_of_Computer_Programming.


Should be DEK, not DK.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: