9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] rc mystery
@ 2004-08-04 16:35 Skip Tavakkolian
  2004-08-04 16:46 ` Charles Forsyth
                   ` (2 more replies)
  0 siblings, 3 replies; 47+ messages in thread
From: Skip Tavakkolian @ 2004-08-04 16:35 UTC (permalink / raw)
  To: 9fans

term% echo `{date -n && sleep 2} `{sleep 2 && date -n}
1091636548 1091636548

can't figure out why?

I would have expected something more like this:

term% cat <{date -n && sleep 2} <{sleep 2 && date -n}
1091637155
1091637158



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-04 16:35 [9fans] rc mystery Skip Tavakkolian
@ 2004-08-04 16:46 ` Charles Forsyth
  2004-08-04 17:17   ` Charles Forsyth
  2004-08-04 17:18 ` boyd, rounin
  2004-08-05  8:22 ` C H Forsyth
  2 siblings, 1 reply; 47+ messages in thread
From: Charles Forsyth @ 2004-08-04 16:46 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 149 bytes --]

i imagine it must run the second `date -n first and the first `date -n second
since the first and second `date -n are both run in the same second.

[-- Attachment #2: Type: message/rfc822, Size: 2270 bytes --]

From: Skip Tavakkolian <9nut@9netics.com>
To: 9fans@cse.psu.edu
Subject: [9fans] rc mystery
Date: Wed, 4 Aug 2004 09:35:20 -0700
Message-ID: <7446ba65534f2ff0fd37373855b2b932@9netics.com>

term% echo `{date -n && sleep 2} `{sleep 2 && date -n}
1091636548 1091636548

can't figure out why?

I would have expected something more like this:

term% cat <{date -n && sleep 2} <{sleep 2 && date -n}
1091637155
1091637158

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-04 16:46 ` Charles Forsyth
@ 2004-08-04 17:17   ` Charles Forsyth
  0 siblings, 0 replies; 47+ messages in thread
From: Charles Forsyth @ 2004-08-04 17:17 UTC (permalink / raw)
  To: 9fans

	term% echo `{date -n && sleep 2} `{sleep 2 && date -n}
	1091636548 1091636548

to spell it out without a second tongue-twister, the sequence will be
	{sleep 2 && date -n}; {date -n && sleep 2}
capturing the output from each in turn,
which allows the two dates to run in the same second.
they don't run concurrently, unlike
	term% cat <{date -n && sleep 2} <{sleep 2 && date -n}
where they must be run concurrently for the <{} to work correctly.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-04 16:35 [9fans] rc mystery Skip Tavakkolian
  2004-08-04 16:46 ` Charles Forsyth
@ 2004-08-04 17:18 ` boyd, rounin
  2004-08-04 17:42   ` boyd, rounin
  2004-08-05  8:22 ` C H Forsyth
  2 siblings, 1 reply; 47+ messages in thread
From: boyd, rounin @ 2004-08-04 17:18 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

order of execution.

> term% echo `{date -n && sleep 2} `{sleep 2 && date -n}
> 1091636548 1091636548

those two are run in parallel and their outputs are handed to echo
as arguments (fork being fast, as it was always meant to be :)

> term% cat <{date -n && sleep 2} <{sleep 2 && date -n}
> 1091637155
> 1091637158

no, that gives you:

    cat /fd/m /fd/n

and the cat can't read /fd/n until /fd/m is closed.  both fd's
are pipes to the subshells, so the executional is serialised.

eg:

    brahma% echo <{date -n && sleep 2} <{sleep 2 && date -n}
    /fd/6 /fd/5
    brahma% cat <{date -n && sleep 2} <{sleep 2 && date -n}
    1091639796
    1091639798




^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-04 17:18 ` boyd, rounin
@ 2004-08-04 17:42   ` boyd, rounin
  0 siblings, 0 replies; 47+ messages in thread
From: boyd, rounin @ 2004-08-04 17:42 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> are pipes to the subshells, so the executional is serialised.

err, 'execution'.  everyone knows my typing is lousy.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-04 16:35 [9fans] rc mystery Skip Tavakkolian
  2004-08-04 16:46 ` Charles Forsyth
  2004-08-04 17:18 ` boyd, rounin
@ 2004-08-05  8:22 ` C H Forsyth
  2004-08-05 22:31   ` Skip Tavakkolian
  2 siblings, 1 reply; 47+ messages in thread
From: C H Forsyth @ 2004-08-05  8:22 UTC (permalink / raw)
  To: 9fans

here's a change that shows that rc evaluates as i suggested:
	echo `{echo a>[1=2] && date -n && sleep 2} `{echo b>[1=2] && sleep 2 && date -n}
if you try the same with <{} you'll see that also evaluates b (starts process b) first,
which i couldn't tell yesterday,
but since the <{} are run concurrently, because of the initial sleep in b, you see the output of
a's date first.  it makes sense that it evaluates/starts both in the same order in
an argument list.  perhaps it uses a list of args in reverse order or a stack at some point.
there's probably an obscurely useful application of the effect.

byron's rc does left-to-right evaluation.

so there's one application: ./configure.rc can tell whether it's rc or byronrc.
of course, in good ./configure style, it should only do that to confirm what you've
already told it from a set of hardwired choices.


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-05  8:22 ` C H Forsyth
@ 2004-08-05 22:31   ` Skip Tavakkolian
  2004-08-05 23:26     ` Charles Forsyth
  0 siblings, 1 reply; 47+ messages in thread
From: Skip Tavakkolian @ 2004-08-05 22:31 UTC (permalink / raw)
  To: 9fans

> perhaps it uses a list of args in reverse order or a stack at some point.
> there's probably an obscurely useful application of the effect.

I checked the code briefly and for both (backtick-brace & redir-brace ) we have:

word : ` brace
	| REDIR brace

words: word
	| words word

for WORDS, the code is emitted as tree2, tree1 (i.e. second arg is evaluated first).

code.c:250: 	case WORDS:

which agrees with what you say.  Is it really as simple as emitting the tree's
in reverse (of current order?)

P.S. I'm not loosing any sleep over it, but I would have expected in order
eval of args (FORTRAN at work, still)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-05 22:31   ` Skip Tavakkolian
@ 2004-08-05 23:26     ` Charles Forsyth
  2004-08-06  2:47       ` Skip Tavakkolian
  0 siblings, 1 reply; 47+ messages in thread
From: Charles Forsyth @ 2004-08-05 23:26 UTC (permalink / raw)
  To: 9fans

>>P.S. I'm not loosing any sleep over it, but I would have expected in order
>>eval of args (FORTRAN at work, still)

if so, keep a watchful eye on your C compiler!

there have been languages that defined order of evaluation precisely
(eg, strictly lexical order) and although they really didn't suffer for it
in performance, they were definitely few and far between.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-05 23:26     ` Charles Forsyth
@ 2004-08-06  2:47       ` Skip Tavakkolian
  2004-08-06  3:51         ` George Michaelson
  0 siblings, 1 reply; 47+ messages in thread
From: Skip Tavakkolian @ 2004-08-06  2:47 UTC (permalink / raw)
  To: 9fans

> if so, keep a watchful eye on your C compiler!

yup. one of my favorite C interview questions (in the form of an example)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06  2:47       ` Skip Tavakkolian
@ 2004-08-06  3:51         ` George Michaelson
  2004-08-06  3:52           ` boyd, rounin
  2004-08-06  7:12           ` Skip Tavakkolian
  0 siblings, 2 replies; 47+ messages in thread
From: George Michaelson @ 2004-08-06  3:51 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Thu, 5 Aug 2004 19:47:18 -0700 Skip Tavakkolian <9nut@9netics.com> wrote:

>> if so, keep a watchful eye on your C compiler!
>
>yup. one of my favorite C interview questions (in the form of an example)

Certainly, after I proved myself unable to code in FORTRAN having
mistakenly claimed so, back in  '81, in front of an interview panel of 10
people at the UK antartic survey offices, I learned very quickly that
truth hurts less than some lies. this may justify your point of course. I
remain deeply ashamed at my dishonesty and stupidity, in many dimensions
in this case.

But, don't you think there is something equally deceitful in setting trick cyclist
tests on people?

I'm finding when I do interview current graduates, their competencies are so
abject, its hard to frame questions which don't insult somebodys intelligence
in being asked. Its very compelling to think of blaming the teachers.

These people (like me) should not have been allowed to graduate. So it goes.

-George



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06  3:51         ` George Michaelson
@ 2004-08-06  3:52           ` boyd, rounin
  2004-08-06  5:07             ` geoff
  2004-08-06  7:12           ` Skip Tavakkolian
  1 sibling, 1 reply; 47+ messages in thread
From: boyd, rounin @ 2004-08-06  3:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> But, don't you think there is something equally deceitful in setting trick cyclist
> tests on people?

nope, i'm all for the Bob Taylor 'trial by fire'.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06  3:52           ` boyd, rounin
@ 2004-08-06  5:07             ` geoff
  2004-08-06  5:17               ` Charles Forsyth
  2004-08-08  0:05               ` Brantley Coile
  0 siblings, 2 replies; 47+ messages in thread
From: geoff @ 2004-08-06  5:07 UTC (permalink / raw)
  To: 9fans

Technical interviews seem to be a recent invention, made worse when
they are phone interviews.  When I was starting out, I did audition
for Henry Spencer by writing, including testing and debugging, a
simple filter (on his V7 Unix system, not on paper), which seems much
fairer.

These days I take the attitude that experienced programmers are like
studio musicians: if you want to check us out, our code is out there
on the net or we can supply samples, but don't insult us with
``technical'' interviews.  We're adaptable; learning new languages is
not a big deal.  Of course one has to get past the HR checklist first:
must have 20 years experience in Java, Oracle, CORBA, Windows XP,
Apache, Perl and any other fad of the moment.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06  5:07             ` geoff
@ 2004-08-06  5:17               ` Charles Forsyth
  2004-08-06  7:27                 ` Skip Tavakkolian
  2004-08-07  6:04                 ` dvd
  2004-08-08  0:05               ` Brantley Coile
  1 sibling, 2 replies; 47+ messages in thread
From: Charles Forsyth @ 2004-08-06  5:17 UTC (permalink / raw)
  To: 9fans

>>must have 20 years experience in Java, Oracle, CORBA, Windows XP,
>>Apache, Perl and any other fad of the moment.

years ago a friend of mine was amused to see adverts suddenly appear one
week in Computer Weekly requesting people with `3 years experience in XYZ', where
XYZ had only been announced, let alone released, by IBM the previous week.

mind you, if you've seen the size of J2XX for any XX recently, you might wonder
if you might need the 20 years just to comprehend the documentation properly.
i get lost in the com.maze.twisty.little.passages.all.different



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06  3:51         ` George Michaelson
  2004-08-06  3:52           ` boyd, rounin
@ 2004-08-06  7:12           ` Skip Tavakkolian
  2004-08-06 15:56             ` George Michaelson
  2004-08-06 18:17             ` Chunky Kibbles
  1 sibling, 2 replies; 47+ messages in thread
From: Skip Tavakkolian @ 2004-08-06  7:12 UTC (permalink / raw)
  To: 9fans

>>> if so, keep a watchful eye on your C compiler!
>>
>>yup. one of my favorite C interview questions (in the form of an example)
>
> Certainly, after I proved myself unable to code in FORTRAN having
> mistakenly claimed so, back in  '81, in front of an interview panel of 10
> people at the UK antartic survey offices, I learned very quickly that
> truth hurts less than some lies. this may justify your point of course. I
> remain deeply ashamed at my dishonesty and stupidity, in many dimensions
> in this case.

I don't know if it comes from dishonesty or just not knowing because
one isn't regularly challenged about how well one really knows subject X.

>
> But, don't you think there is something equally deceitful in setting trick cyclist
> tests on people?
>

What's deceitful about asking somebody what does printf("%c\n",0["unix"]);
print and why?  The "trick" is only a conversation piece.

Having been on the receiving end of it too, I sympathize; but I think
it is a fair way to weed out some of the posers (with a degree or not).  I
agree with what geoff said.  Code samples of previous work are probably
more representative of one's true abilities.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06  5:17               ` Charles Forsyth
@ 2004-08-06  7:27                 ` Skip Tavakkolian
  2004-08-07  6:04                 ` dvd
  1 sibling, 0 replies; 47+ messages in thread
From: Skip Tavakkolian @ 2004-08-06  7:27 UTC (permalink / raw)
  To: 9fans

> mind you, if you've seen the size of J2XX for any XX recently, you might wonder
> if you might need the 20 years just to comprehend the documentation properly.

About a year ago I discovered the second best way to deal with Java development
(avoiding Java would be the first); it is to use Eclipse.

> i get lost in the com.maze.twisty.little.passages.all.different

I see the start of a poem.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06  7:12           ` Skip Tavakkolian
@ 2004-08-06 15:56             ` George Michaelson
  2004-08-06 17:06               ` ron minnich
                                 ` (2 more replies)
  2004-08-06 18:17             ` Chunky Kibbles
  1 sibling, 3 replies; 47+ messages in thread
From: George Michaelson @ 2004-08-06 15:56 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

>>
>> But, don't you think there is something equally deceitful in setting trick cyclist
>> tests on people?
>>
>
>What's deceitful about asking somebody what does printf("%c\n",0["unix"]);
>print and why?  The "trick" is only a conversation piece.

Conversation pieces are best left for the dinner table, where wit, and verbal
fencing are appropriate. Personally, I find interviews a very degrading process
from both sides of the bench.

Its a very odd way to get one char out. You've made the compiler reduce a
string literal down to one char, to stuff into a stack, only to throw away
the rest of the string. I'm struggling to see why this is better than an
embedded /* we need to emit 'u' at this point */ comment which is probably less
work for the compiler, although I suppose it has to find the end of comment marker
rather than walk the embedded string, find its first element, and literal it.

Is it really efficient to array de-ref rather than embed the ASCII value directly?

I'm not convinced we wouldn't do better with a lottery. I am not a
psychologist and I cannot predict how people will respond to questions
where the 'desired' answer is not clear. It only gets worse if English is
not the first language. Maybe you don't hire non-nationals. Or do you 'test' them
in their own language? (perhaps C is, in these cases, the best choice..)

>
>Having been on the receiving end of it too, I sympathize; but I think
>it is a fair way to weed out some of the posers (with a degree or not).  I
>agree with what geoff said.  Code samples of previous work are probably
>more representative of one's true abilities.

Yes, I agree with that.

Faced with 40 or more shortlisted candidates for a post, its tempting to
find short paths to triage. But its also demeaning. I do it too.

-George

(to be less OT, gcc did at least make the same assembler for printf "%c\n", 117)


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 15:56             ` George Michaelson
@ 2004-08-06 17:06               ` ron minnich
  2004-08-06 17:54                 ` Skip Tavakkolian
  2004-08-06 17:16               ` boyd, rounin
  2004-08-06 18:21               ` Skip Tavakkolian
  2 siblings, 1 reply; 47+ messages in thread
From: ron minnich @ 2004-08-06 17:06 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs


> >What's deceitful about asking somebody what does printf("%c\n",0["unix"]);
> >print and why?  The "trick" is only a conversation piece.

well in interviews when I get questions like that I say the answer is
"shoot the guy who wrote that in the head, it's a mercy killing"

ron
p.s. OT, but I need a joke now and then nowadays ...

p.p.s. see bullshit classification below.
--
LANL CCS-1 email flavor:
***** Correspondence   [X]
***** DUSA LACSI-HW    [ ]
***** DUSA LACSI-OS    [ ]
***** DUSA LACSI-CS    [ ]




^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 15:56             ` George Michaelson
  2004-08-06 17:06               ` ron minnich
@ 2004-08-06 17:16               ` boyd, rounin
  2004-08-06 18:21               ` Skip Tavakkolian
  2 siblings, 0 replies; 47+ messages in thread
From: boyd, rounin @ 2004-08-06 17:16 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Faced with 40 or more shortlisted candidates for a post, its tempting to
> find short paths to triage. But its also demeaning. I do it too.

easy.  3 piles:

    - no chance
    - maybe
    - interview ['trial by fire']

tried and tested and worked [~150 candidates].



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 17:06               ` ron minnich
@ 2004-08-06 17:54                 ` Skip Tavakkolian
  2004-08-06 17:55                   ` boyd, rounin
  2004-08-06 18:03                   ` andrey mirtchovski
  0 siblings, 2 replies; 47+ messages in thread
From: Skip Tavakkolian @ 2004-08-06 17:54 UTC (permalink / raw)
  To: 9fans

> "shoot the guy who wrote that in the head, it's a mercy killing"

I agree, maybe not in the head though. the example came from a
USENIX obfuscated C code contest.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 17:54                 ` Skip Tavakkolian
@ 2004-08-06 17:55                   ` boyd, rounin
  2004-08-06 18:03                   ` andrey mirtchovski
  1 sibling, 0 replies; 47+ messages in thread
From: boyd, rounin @ 2004-08-06 17:55 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> I agree, maybe not in the head though.

right, double-tap to the chest and one in the head.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 17:54                 ` Skip Tavakkolian
  2004-08-06 17:55                   ` boyd, rounin
@ 2004-08-06 18:03                   ` andrey mirtchovski
  2004-08-06 18:16                     ` Roman Shaposhnick
                                       ` (2 more replies)
  1 sibling, 3 replies; 47+ messages in thread
From: andrey mirtchovski @ 2004-08-06 18:03 UTC (permalink / raw)
  To: 9fans

>> "shoot the guy who wrote that in the head, it's a mercy killing"
>
> I agree, maybe not in the head though. the example came from a
> USENIX obfuscated C code contest.

Microsoft likes to ask questions of that type (and trick questions) in
their phone interviews (no, I don't know that from personal experience).

andrey



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:03                   ` andrey mirtchovski
@ 2004-08-06 18:16                     ` Roman Shaposhnick
  2004-08-06 18:17                     ` George Michaelson
  2004-08-06 18:23                     ` Skip Tavakkolian
  2 siblings, 0 replies; 47+ messages in thread
From: Roman Shaposhnick @ 2004-08-06 18:16 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Aug 06, 2004 at 12:03:25PM -0600, andrey mirtchovski wrote:
> >> "shoot the guy who wrote that in the head, it's a mercy killing"
> >
> > I agree, maybe not in the head though. the example came from a
> > USENIX obfuscated C code contest.
>
> Microsoft likes to ask questions of that type (and trick questions) in
> their phone interviews (no, I don't know that from personal experience).

  Nowdays the Google (labs?) sure gets the prize for asking this sort
  of riddleish questions. I'm no sure whether I'd personally hire
  somebody who can answer them, but they sure do bring me back to
  the childhood and math club.

Thanks,
Roman.

P.S. But then, again, they have this giant billboard reading:

    {first 10digit prime number in consecutive digits of e}.com


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:03                   ` andrey mirtchovski
  2004-08-06 18:16                     ` Roman Shaposhnick
@ 2004-08-06 18:17                     ` George Michaelson
  2004-08-06 18:45                       ` Skip Tavakkolian
  2004-08-06 18:23                     ` Skip Tavakkolian
  2 siblings, 1 reply; 47+ messages in thread
From: George Michaelson @ 2004-08-06 18:17 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs; +Cc: mirtchov

On Fri, 6 Aug 2004 12:03:25 -0600 andrey mirtchovski <mirtchov@cpsc.ucalgary.ca> wrote:

>>> "shoot the guy who wrote that in the head, it's a mercy killing"
>>
>> I agree, maybe not in the head though. the example came from a
>> USENIX obfuscated C code contest.
>
>Microsoft likes to ask questions of that type (and trick questions) in
>their phone interviews (no, I don't know that from personal experience).
>
>andrey

I doubt that applies to Microsoft Research.  Is there any point in working
for any other division of MS? I can't imagine Someone like Rick Rashid
bothering to answer 20 questions, let alone ask them.

-George


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06  7:12           ` Skip Tavakkolian
  2004-08-06 15:56             ` George Michaelson
@ 2004-08-06 18:17             ` Chunky Kibbles
  2004-08-06 18:47               ` Skip Tavakkolian
  1 sibling, 1 reply; 47+ messages in thread
From: Chunky Kibbles @ 2004-08-06 18:17 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Aug 06, 2004 at 12:12:33AM -0700, Skip Tavakkolian wrote:
>
> What's deceitful about asking somebody what does printf("%c\n",0["unix"]);
> print and why?  The "trick" is only a conversation piece.

OK. So I guessed the right answer on the grounds that it's the only
sensible answer [assuming the code is genuinely correct], but would
someone please explain it to me anyways?

gcc didn't complain even with -Wall -pendantic -ansi, so there has to
be a pretty decent reason that it works...

Gary (-;


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 15:56             ` George Michaelson
  2004-08-06 17:06               ` ron minnich
  2004-08-06 17:16               ` boyd, rounin
@ 2004-08-06 18:21               ` Skip Tavakkolian
  2 siblings, 0 replies; 47+ messages in thread
From: Skip Tavakkolian @ 2004-08-06 18:21 UTC (permalink / raw)
  To: 9fans

>>What's deceitful about asking somebody what does printf("%c\n",0["unix"]);
>>print and why?  The "trick" is only a conversation piece.
>
> Conversation pieces are best left for the dinner table, where wit, and verbal
> fencing are appropriate. Personally, I find interviews a very degrading process
> from both sides of the bench.

Maybe that's why interviews are harder than need to be.  Perhaps you
view it as judging a person's life's accomplishment; I don't.  I have passed
up a number of candidates that I would have enjoyed having as friends.

> Its a very odd way to get one char out. You've made the compiler reduce a
> string literal down to one char, to stuff into a stack, only to throw away
> the rest of the string. I'm struggling to see why this is better than an
> embedded /* we need to emit 'u' at this point */ comment which is probably less
> work for the compiler, although I suppose it has to find the end of comment marker
> rather than walk the embedded string, find its first element, and literal it.
>
> Is it really efficient to array de-ref rather than embed the ASCII value directly?

The point is how arrays work in C (and C++). That's all.

>
> I'm not convinced we wouldn't do better with a lottery. I am not a
> psychologist and I cannot predict how people will respond to questions
> where the 'desired' answer is not clear. It only gets worse if English is
> not the first language. Maybe you don't hire non-nationals. Or do you 'test' them
> in their own language? (perhaps C is, in these cases, the best choice..)

As I pointed out before, the interview shouldn't be the judgement on a
person's life; just the relevance of their experience and aptitude to
the work at hand.  Communications skills and person's sense of
aesthetics are also big considerations.

(P.S. It has been my experience that candidates that had previously worked
at Apple, are more stylish than those that worked at M$; man or woman)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:03                   ` andrey mirtchovski
  2004-08-06 18:16                     ` Roman Shaposhnick
  2004-08-06 18:17                     ` George Michaelson
@ 2004-08-06 18:23                     ` Skip Tavakkolian
  2004-08-06 18:37                       ` boyd, rounin
  2 siblings, 1 reply; 47+ messages in thread
From: Skip Tavakkolian @ 2004-08-06 18:23 UTC (permalink / raw)
  To: 9fans

>> I agree, maybe not in the head though. the example came from a
>> USENIX obfuscated C code contest.
>
> Microsoft likes to ask questions of that type (and trick questions) in
> their phone interviews (no, I don't know that from personal experience).

Some of the toughest interview questions I was ever asked were at an
interview by DEC WRL dudes up in Bellevue ('90-'91).  The work was for
some C++ compiler development, so it made sense.  I didn't get the
job.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:23                     ` Skip Tavakkolian
@ 2004-08-06 18:37                       ` boyd, rounin
  2004-08-06 18:49                         ` Skip Tavakkolian
  0 siblings, 1 reply; 47+ messages in thread
From: boyd, rounin @ 2004-08-06 18:37 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Some of the toughest interview questions I was ever asked were at an
> interview by DEC WRL dudes up in Bellevue ('90-'91).

WRL was in palo alto, unless it was some piece of quasi-related advanced development.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:17                     ` George Michaelson
@ 2004-08-06 18:45                       ` Skip Tavakkolian
  2004-08-06 18:49                         ` George Michaelson
  0 siblings, 1 reply; 47+ messages in thread
From: Skip Tavakkolian @ 2004-08-06 18:45 UTC (permalink / raw)
  To: 9fans

> I doubt that applies to Microsoft Research.  Is there any point in working
> for any other division of MS? I can't imagine Someone like Rick Rashid
> bothering to answer 20 questions, let alone ask them.

Were you there?

MS Research is a horse of a different color. You've got to be published
to go there.  Lowly developers need not apply.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:17             ` Chunky Kibbles
@ 2004-08-06 18:47               ` Skip Tavakkolian
  2004-08-06 18:54                 ` boyd, rounin
  2004-08-06 19:06                 ` Chunky Kibbles
  0 siblings, 2 replies; 47+ messages in thread
From: Skip Tavakkolian @ 2004-08-06 18:47 UTC (permalink / raw)
  To: 9fans

> OK. So I guessed the right answer on the grounds that it's the only
> sensible answer [assuming the code is genuinely correct], but would
> someone please explain it to me anyways?

Why, indeed.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:45                       ` Skip Tavakkolian
@ 2004-08-06 18:49                         ` George Michaelson
  2004-08-06 19:01                           ` boyd, rounin
  2004-08-06 19:52                           ` Skip Tavakkolian
  0 siblings, 2 replies; 47+ messages in thread
From: George Michaelson @ 2004-08-06 18:49 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs; +Cc: 9nut

On Fri, 6 Aug 2004 11:45:42 -0700 Skip Tavakkolian <9nut@9netics.com> wrote:

>> I doubt that applies to Microsoft Research.  Is there any point in working
>> for any other division of MS? I can't imagine Someone like Rick Rashid
>> bothering to answer 20 questions, let alone ask them.
>
>Were you there?

god no, I'm not even able to wash their floors properly.

>
>MS Research is a horse of a different color. You've got to be published
>to go there.  Lowly developers need not apply.

ok. so we're talking about exclusively crap jobs, for money, basic code whoring?

fine. But you know, it really shits me that even to get a crap job, you have to
act like a performing monkey.

What happened to the dignity of labour?

-George



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:37                       ` boyd, rounin
@ 2004-08-06 18:49                         ` Skip Tavakkolian
  2004-08-06 18:55                           ` boyd, rounin
  0 siblings, 1 reply; 47+ messages in thread
From: Skip Tavakkolian @ 2004-08-06 18:49 UTC (permalink / raw)
  To: 9fans

> unless it was some piece of quasi-related advanced development.

It was.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:47               ` Skip Tavakkolian
@ 2004-08-06 18:54                 ` boyd, rounin
  2004-08-06 19:06                 ` Chunky Kibbles
  1 sibling, 0 replies; 47+ messages in thread
From: boyd, rounin @ 2004-08-06 18:54 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Why, indeed.

it's probably that old array is the address of the array thing, dating from [67]th Ed C.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:49                         ` Skip Tavakkolian
@ 2004-08-06 18:55                           ` boyd, rounin
  2004-08-06 20:01                             ` Skip Tavakkolian
  0 siblings, 1 reply; 47+ messages in thread
From: boyd, rounin @ 2004-08-06 18:55 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> > unless it was some piece of quasi-related advanced development.
>
> It was.

you had it easy, then :)



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:49                         ` George Michaelson
@ 2004-08-06 19:01                           ` boyd, rounin
  2004-08-06 19:52                           ` Skip Tavakkolian
  1 sibling, 0 replies; 47+ messages in thread
From: boyd, rounin @ 2004-08-06 19:01 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> >MS Research is a horse of a different color. You've got to be published
> >to go there.  Lowly developers need not apply.
>
> ok. so we're talking about exclusively crap jobs, for money, basic code whoring?

hard to say.  when SRC exploded [chuck] thacker went to a u$loth lab in the UK.

> What happened to the dignity of labour?

check out the lyrics to Richard Clapton's High Society.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:47               ` Skip Tavakkolian
  2004-08-06 18:54                 ` boyd, rounin
@ 2004-08-06 19:06                 ` Chunky Kibbles
  1 sibling, 0 replies; 47+ messages in thread
From: Chunky Kibbles @ 2004-08-06 19:06 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Aug 06, 2004 at 11:47:09AM -0700, Skip Tavakkolian wrote:
> > OK. So I guessed the right answer on the grounds that it's the only
> > sensible answer [assuming the code is genuinely correct], but would
> > someone please explain it to me anyways?
>
> Why, indeed.

I've been replied to in person a couple times, now, which I greatly
appreciate.

Basically, x[y] is shorthand for *(x+y). Recall that in pointer
arithmetic, "+" is commutative.

ie, the compiler reduces it to ("unix" + 0), which is a
pointer to the u.

Gary (-;

PS It should also be accompanied with a

#warning Code written by perl "programmer"


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:49                         ` George Michaelson
  2004-08-06 19:01                           ` boyd, rounin
@ 2004-08-06 19:52                           ` Skip Tavakkolian
  2004-08-06 20:08                             ` andrey mirtchovski
  1 sibling, 1 reply; 47+ messages in thread
From: Skip Tavakkolian @ 2004-08-06 19:52 UTC (permalink / raw)
  To: 9fans

> fine. But you know, it really shits me that even to get a crap job, you have to
> act like a performing monkey.

I view it as respecting my craft enough to fully understand
the tools I have and how they work.

> What happened to the dignity of labour?

I can only refer to your own earliest experience in an interview,
which you recounted previously.

Here is an extreme (but true) example.

For one senior C/C++ developer position at a company I worked for, we
brought in several candidates, some from out of the area.  One fellow
looked very impressive on his resume.  The company paid for his
airfare and hotel to come up from California for this interview.  I
was the second person to talk with him (the first was the HR manager).
After our initial getting acquainted chat -- during which he asked if
it was true that the CEO personally interviewed the candidates as
well, which was true at that time -- we moved on to the technical
questions.  He failed the C questions, but from what I could judge,
was very smart and a good problem solver.  A total of six people
talked with him over the course of the day, all pretty much the same
impression.  He was very agitated when we told him we couldn't
consider him because his C and C++ skills were lacking.  He demanded
to see the CEO anyway.  His purpose for wanting the interview?  He
wanted to pitch a business proposal to the CEO, (copies of his
Business Plan in hand).  If he had received an offer he would have
turned it down, I have no doubt.  He was there (at that company's
expense) to make a sales pitch.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 18:55                           ` boyd, rounin
@ 2004-08-06 20:01                             ` Skip Tavakkolian
  2004-08-08  0:29                               ` Brantley Coile
  0 siblings, 1 reply; 47+ messages in thread
From: Skip Tavakkolian @ 2004-08-06 20:01 UTC (permalink / raw)
  To: 9fans

>> > unless it was some piece of quasi-related advanced development.
>> 
>> It was.
> 
> you had it easy, then :)

Didn't help me any ☺

Unless it is a big state secret, I'd be curious to know what it was like
to be interviewed at the Labs.

I often wonder:

What kind of interview Rob or other superstars like him conduct?



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 19:52                           ` Skip Tavakkolian
@ 2004-08-06 20:08                             ` andrey mirtchovski
  2004-08-06 20:15                               ` boyd, rounin
  0 siblings, 1 reply; 47+ messages in thread
From: andrey mirtchovski @ 2004-08-06 20:08 UTC (permalink / raw)
  To: 9fans


> For one senior C/C++ developer position at a company I worked for, we

[snip]

"wallstreet" (the movie)!  gotta give it to those people -- at least
half of them succeeded just because they tried.

true story: all the canadian universities i applied to in 1997 refused
to waive the application fee to international students (at least on
paper).  most of them did it after i submitted a fee waiver request.

same goes for scholarships.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 20:08                             ` andrey mirtchovski
@ 2004-08-06 20:15                               ` boyd, rounin
  0 siblings, 0 replies; 47+ messages in thread
From: boyd, rounin @ 2004-08-06 20:15 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

yeah, a company knocked me back for 2 2-3km cab fares 'cos this
international comms corporation had located their paris office some
30km to the south of paris.  no way was i gonna pay for cab, if
i could find one, after heading  30km out into the sticks for
non-existant jobs.  i don't have a car & nor do i want one.  they
couldn't even see that sending someone to pick me up at the
nearest SNCF [rail] station would be a cheap solution.

conclusion: these people are not serious.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06  5:17               ` Charles Forsyth
  2004-08-06  7:27                 ` Skip Tavakkolian
@ 2004-08-07  6:04                 ` dvd
  2004-08-07 12:17                   ` vdharani
  2004-08-07 22:56                   ` Taj Khattra
  1 sibling, 2 replies; 47+ messages in thread
From: dvd @ 2004-08-07  6:04 UTC (permalink / raw)
  To: 9fans

>
> mind you, if you've seen the size of J2XX for any XX recently, you might wonder
> if you might need the 20 years just to comprehend the documentation properly.
> i get lost in the com.maze.twisty.little.passages.all.different

It is smaller than Inferno distribution.



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-07  6:04                 ` dvd
@ 2004-08-07 12:17                   ` vdharani
  2004-08-07 22:56                   ` Taj Khattra
  1 sibling, 0 replies; 47+ messages in thread
From: vdharani @ 2004-08-07 12:17 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

>>
>> mind you, if you've seen the size of J2XX for any XX recently, you might
>> wonder
>> if you might need the 20 years just to comprehend the documentation
>> properly.
>> i get lost in the com.maze.twisty.little.passages.all.different
>
> It is smaller than Inferno distribution.
smaller than J2EE? I dont know about J2EE but in general Java is huge.

Inferno may look huge because it gives a lot of things like fonts, emu for
variour platforms, native kernel source for various platforms, graphics,
networking, security, and the compiler and other utilities.

in any case, i used to think size of inferno also will increase in size
considerably if it implements (completely) all of what java has
implemented (but still, inferno will be short and sweet!).

thanks
dharani



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-07  6:04                 ` dvd
  2004-08-07 12:17                   ` vdharani
@ 2004-08-07 22:56                   ` Taj Khattra
  1 sibling, 0 replies; 47+ messages in thread
From: Taj Khattra @ 2004-08-07 22:56 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> It is smaller than Inferno distribution.

but a lot heavier


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06  5:07             ` geoff
  2004-08-06  5:17               ` Charles Forsyth
@ 2004-08-08  0:05               ` Brantley Coile
  2004-08-08  0:09                 ` boyd, rounin
  1 sibling, 1 reply; 47+ messages in thread
From: Brantley Coile @ 2004-08-08  0:05 UTC (permalink / raw)
  To: 9fans

> must have 20 years experience in Java, Oracle, CORBA, Windows XP,
> Apache, Perl and any other fad of the moment.

You know, I meet more people with 20 years experience than I remember
being around 20 years ago.

 Brantley



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-08  0:05               ` Brantley Coile
@ 2004-08-08  0:09                 ` boyd, rounin
  2004-08-08  0:27                   ` Bruce Ellis
  0 siblings, 1 reply; 47+ messages in thread
From: boyd, rounin @ 2004-08-08  0:09 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> > must have 20 years experience in Java, Oracle, CORBA, Windows XP,
> > Apache, Perl and any other fad of the moment.

    Q: so you were using WiFi in 2000?

    A: err, no, there was no WiFi in 2000.

what are yer gonna say?



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-08  0:09                 ` boyd, rounin
@ 2004-08-08  0:27                   ` Bruce Ellis
  2004-08-08  0:29                     ` boyd, rounin
  0 siblings, 1 reply; 47+ messages in thread
From: Bruce Ellis @ 2004-08-08  0:27 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs


boyd, rounin wrote:

>>>must have 20 years experience in Java, Oracle, CORBA, Windows XP,
>>>Apache, Perl and any other fad of the moment.
>
>     Q: so you were using WiFi in 2000?
>
>     A: err, no, there was no WiFi in 2000.
>
> what are yer gonna say?

perhaps "i had a wavepoint in 1996", or pass me the google ...

http://www.guerrilla.net/reference/wavelan/docs.html


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-06 20:01                             ` Skip Tavakkolian
@ 2004-08-08  0:29                               ` Brantley Coile
  0 siblings, 0 replies; 47+ messages in thread
From: Brantley Coile @ 2004-08-08  0:29 UTC (permalink / raw)
  To: 9fans

> What kind of interview Rob or other superstars like him conduct?

I wasn't interviewed by Rob, I don't think.  Met with Doug, Dave,
Dennis, Fred and Al. We just talked about a lot of Unix internal
stuff, so I guess things just came out in the interview.  I had
duplicated streams in a V7 kernel, so they all knew about that
already.  But then, I was just a lowly MTS--not a big gun researcher.

I enjoyed the process.

  Brantley



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [9fans] rc mystery
  2004-08-08  0:27                   ` Bruce Ellis
@ 2004-08-08  0:29                     ` boyd, rounin
  0 siblings, 0 replies; 47+ messages in thread
From: boyd, rounin @ 2004-08-08  0:29 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> perhaps "i had a wavepoint in 1996", or pass me the google ...
>
> http://www.guerrilla.net/reference/wavelan/docs.html

yeah i wanted a lucent card in 2001, but it was not
perceived to be useful.

in context, WiFi is a new thing here.

i've heard noises about ramping it up to compete with 3G,
at a 10th of the price.



^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2004-08-08  0:29 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-04 16:35 [9fans] rc mystery Skip Tavakkolian
2004-08-04 16:46 ` Charles Forsyth
2004-08-04 17:17   ` Charles Forsyth
2004-08-04 17:18 ` boyd, rounin
2004-08-04 17:42   ` boyd, rounin
2004-08-05  8:22 ` C H Forsyth
2004-08-05 22:31   ` Skip Tavakkolian
2004-08-05 23:26     ` Charles Forsyth
2004-08-06  2:47       ` Skip Tavakkolian
2004-08-06  3:51         ` George Michaelson
2004-08-06  3:52           ` boyd, rounin
2004-08-06  5:07             ` geoff
2004-08-06  5:17               ` Charles Forsyth
2004-08-06  7:27                 ` Skip Tavakkolian
2004-08-07  6:04                 ` dvd
2004-08-07 12:17                   ` vdharani
2004-08-07 22:56                   ` Taj Khattra
2004-08-08  0:05               ` Brantley Coile
2004-08-08  0:09                 ` boyd, rounin
2004-08-08  0:27                   ` Bruce Ellis
2004-08-08  0:29                     ` boyd, rounin
2004-08-06  7:12           ` Skip Tavakkolian
2004-08-06 15:56             ` George Michaelson
2004-08-06 17:06               ` ron minnich
2004-08-06 17:54                 ` Skip Tavakkolian
2004-08-06 17:55                   ` boyd, rounin
2004-08-06 18:03                   ` andrey mirtchovski
2004-08-06 18:16                     ` Roman Shaposhnick
2004-08-06 18:17                     ` George Michaelson
2004-08-06 18:45                       ` Skip Tavakkolian
2004-08-06 18:49                         ` George Michaelson
2004-08-06 19:01                           ` boyd, rounin
2004-08-06 19:52                           ` Skip Tavakkolian
2004-08-06 20:08                             ` andrey mirtchovski
2004-08-06 20:15                               ` boyd, rounin
2004-08-06 18:23                     ` Skip Tavakkolian
2004-08-06 18:37                       ` boyd, rounin
2004-08-06 18:49                         ` Skip Tavakkolian
2004-08-06 18:55                           ` boyd, rounin
2004-08-06 20:01                             ` Skip Tavakkolian
2004-08-08  0:29                               ` Brantley Coile
2004-08-06 17:16               ` boyd, rounin
2004-08-06 18:21               ` Skip Tavakkolian
2004-08-06 18:17             ` Chunky Kibbles
2004-08-06 18:47               ` Skip Tavakkolian
2004-08-06 18:54                 ` boyd, rounin
2004-08-06 19:06                 ` Chunky Kibbles

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).