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

I wonder how, if at all, you can improve precision with 4 stratum-1 clocks like he author has.

Ensembling clocks allows you to spot 'the odd one out' in case any one of them is having trouble so in that sense it would allow you to improve precision overall (or rather: availability of precision).

I miss the days of knowing who last touched every source file and precisely what version it was:

  $ what /usr/bin/file
  /usr/bin/file:
   PROGRAM:file  PROJECT:file-106
   $File: apprentice.c,v 1.309 2021/09/24 13:59:19 christos Exp $
   $File: apptype.c,v 1.14 2018/09/09 20:33:28 christos Exp $
   $File: ascmagic.c,v 1.109 2021/02/05 23:01:40 christos Exp $
   $File: buffer.c,v 1.8 2020/02/16 15:52:49 christos Exp $
   $File: cdf_time.c,v 1.19 2019/03/12 20:43:05 christos Exp $
   $File: cdf.c,v 1.120 2021/09/24 13:59:19 christos Exp $
   $File: compress.c,v 1.129 2020/12/08 21:26:00 christos Exp $
   $File: der.c,v 1.21 2020/06/15 00:58:10 christos Exp $
   $File: encoding.c,v 1.32 2021/04/27 19:37:14 christos Exp $
   $File: fsmagic.c,v 1.81 2019/07/16 13:30:32 christos Exp $
   $File: funcs.c,v 1.122 2021/06/30 10:08:48 christos Exp $
   $File: is_csv.c,v 1.6 2020/08/09 16:43:36 christos Exp $
   $File: is_json.c,v 1.15 2020/06/07 19:05:47 christos Exp $
   $File: is_tar.c,v 1.44 2019/02/20 02:35:27 christos Exp $
   $File: magic.c,v 1.115 2021/09/20 17:45:41 christos Exp $
   $File: print.c,v 1.89 2021/06/30 10:08:48 christos Exp $
   $File: readcdf.c,v 1.74 2019/09/11 15:46:30 christos Exp $
   $File: readelf.c,v 1.178 2021/06/30 10:08:48 christos Exp $
   $File: softmagic.c,v 1.315 2021/09/03 13:17:52 christos Exp $
   $File: file.c,v 1.190 2021/09/24 14:14:26 christos Exp $
  ...
 
  WHAT(1)                     General Commands Manual                    WHAT(1)
  
  NAME
       what - show what versions of object modules were used to construct a file
  
  SYNOPSIS
       what [-qs] [file ...]
  
  DESCRIPTION
       The what utility searches each specified file for sequences of the form
       "@(#)" as inserted by the SCCS source code control system.  It prints the
       remainder of the string following this marker, up to a NUL character,
       newline, double quote, `>' character, or backslash.
  
       The following options are available:
  
       -q      Only output the match text, rather than formatting it.
  
       -s      Stop searching each file after the first match.
  
  EXIT STATUS
       Exit status is 0 if any matches were found, otherwise 1.
  
  SEE ALSO
       ident(1), strings(1)
  
  STANDARDS
       The what utility conforms to IEEE Std 1003.1-2001 ("POSIX.1").  The -q
       option is a non-standard FreeBSD extension which may not be available on
       other operating systems.
  
  HISTORY
       The what command appeared in 4.0BSD.
  
  BUGS
       This is a rewrite of the SCCS command of the same name, and behavior may
       not be identical.
  
  macOS 26.4                     December 14, 2006                    macOS 26.4

archive of forth translation of Crenshaw’s howto

https://web.archive.org/web/20190712115536/http://home.iae.n...


Wow I hate* that. I use bracket comments. They're cool cause they are bracket comments, so I use it in scripts to document pipelines. They are annoying cause they are bracket comments, in an interactive shell I have to type more and in TWO places. It's fun to reason-out how it works ;)

  $ echo foo | tr fo FO | sed 's/FOO/BAR/'
  BAR
  $ echo foo | ${IFS# tr fo FO | } sed 's/FOO/BAR/'
  foo
It's nice to have a way to both /* ... */ and // ... in shell scripts though:

  foo \
  | bar ${IFS Do the bar. Do it. } \
  | baz
* in the best possible way, like it's awful - I hate I didn't think of that


for multiline pipes, it's WAY better to format like

    foo   |
      bar |
      baz 
You don't have to use backquotes, AND, it allows you to comment line by line, because there's no backslash messing with the parser.

I also use a last `|\ncat` so you can delete any line and you don't have to worry about the last line being a bit different than the rest

I created a list of similar tricks in https://github.com/kidd/scripting-field-guide in case anyone wants to take a look


You'll probably dislike this too:

  $ {
  >     echo foo \
  >     && echo bar \
  >     || echo baz ;
  > }
  foo
  bar
  <^P><^A>$<^F>IFS
  ${IFS#   echo foo   && echo bar   || echo baz ; }
  $ _
There's good and bad to both approaches. I like how I can use () and {} to bracket things and otherwise every line that end in \ is continued. I line-up on the left with the operator, you with indentation. When you use a # style comment, you have to look up and back and forward to see what the operator is you are continuing over to the next line:

  $ foo |
    bar | # ?Do? *the* $bar$ && [do] {it!}
    baz
Which only takes an extra neuron or so, but then history...

  <^P>
  $ foo |   bar | # ?Do? *the* $bar$ && [do] {it!}
  baz


aha! I see what you mean, it's indeed a nice option, yep.

Using brackets like this is something I never thought of, and it's probably why it's hard for me to process it, but I can see it provides nice annotation capabilities, and it's a more self-contained style.

Thx for sharing!



"Part 64: Self-compilation on an 8-bit CPU"

Unlike how a bunch of projects end right as they start to get good, this has a great ending. Thank you




Had an assignment to build a shell in a week, how hard could it be?

  controlling terminal
  session leader
  job control
The parser was easy in comparison.


Solving the mystery of the Tully Monster: https://www.anl.gov/article/solving-the-mystery-of-the-tully...


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

Search: