- Had an interview
- Posted by Aly on April 27th, 2008
"Guy Macon" <http://www.guymacon.com/> wrote in message
news:qpqdndlOeq38Wo7VRVn_vwA@giganews.com...
ANY code which is difficult to interpret, or which when you come back to
6-months later, is useless.
The purpose of a high level language is to be understandable and obvious.
Tricks and gimmicks are really a bad thing. When you need things like this,
then you use assembly language.
It really is a man's world.. Worrying about gimmicks rather than just
getting the job done. They need a woman!
- Posted by Bill Leary on April 27th, 2008
"Robert Adsett" <sub2@aeolusdevelopment.com> wrote in message
news:MPG.227d7f4ceada43319898cc@free.teranews.com. ..
Yep.
Nope.
It was commented out and a more ordinary sequence replaced it. The original
comment (with the XORs) at least said "Swap A and B" or something to that
effect. The later code was also commented. Whoever made the change wrote
something like "Swap A and B (understandable version)"
- Bill
- Posted by CBFalconer on April 27th, 2008
nospam wrote:
The essential point is that xor use can cause data loss. Consider
"xchange(a, a);" which will destroy the content of a irreversibly.
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
- Posted by Thad Smith on April 27th, 2008
Robert Adsett wrote:
{regarding triple xor to exchange data in two variables]
When I was in college a few decades ago, an IBM instructor teaching PL/I, I
think, mentioned it as a way to swap two same-size strings. The IBM
mainframe computer had a single instruction to do byte-wise xor on a
string. Since the strings could be arbitrarily long, that would avoid a
long temporary or a loop for byte-wise swapping.
--
Thad
- Posted by CBFalconer on April 27th, 2008
Aly wrote:
Sounds like you are pretty solid. However I would worry that you
are doing the job and not getting recognized by the people that
hand out the green stuff. They (usually) have no idea what the job
really involves. And the use of rough language never helps,
regardless of sex.
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
- Posted by Robert Adsett on April 27th, 2008
In article <LIGdnWETmu-gQI7VnZ2dnUVZ_q-jnZ2d@giganews.com>, Bill Leary
says...
I think I like that maintainer.
Robert
** Posted from http://www.teranews.com **
- Posted by Robert Adsett on April 27th, 2008
In article <4813e1d0$0$87941$892e0abb@auth.newsreader.octanew s.com>,
Thad Smith says...
Is there much call for swapping strings? I've replaced strings and
swapped string references but I don't recall ever swapping strings
(which may just mean I don't deal with the kind of program that would
swap strings). The restriction on string size would further limit its
potential use rather sharply I would think unless you could do subsets,
eve then it would have to be a fairly common operation to be much more
than a parlour trick I would think.
Robert
** Posted from http://www.teranews.com **
- Posted by Aly on April 27th, 2008
"CBFalconer" <cbfalconer@yahoo.com> wrote in message
news:4813E226.DF9A0E66@yahoo.com...
Yes, totally acknowledged. I wondered how that portrayed after I'd written
it. Apologies.
Honestly though, I've given up pretty much. I'm kept, and I just fiddle
about with old computers now. Company politics is something that really
frustrates me. Like, if someone wants something done then I'll do it, and
if I don't know then I'll find out how. But that doesn't extend so far as
to educate everyone else. Explaining to someone how to address an EPROM who
works in management is pretty pointless, as it's something you need to
understand and almost see in your mind. If you know what I mean.
They think it's easy. It's taken me practically 10-years of ruining things,
things that don't work, and trial and error.
The programming is that the layers underneath kept on changing, I stopped
after Microsoft kept on moving the goalposts with OO C++. Hence my move to
embedded assembly language around the late 90's. C over UNIX though, that's
quite nice. Perl/CGI I like too, well, it's practically C anyway. When
designing websites I just write a page generator in Perl, which just renders
the whole lot in one go. Any changes; you make them in code. It's far more
predictable. Cascading Style Sheets are pretty good too, when implemented
properly. I don't like server side processing though, it's too open to
vulnerbilities. So, Perl the generate the pages offsite. (it produces html
source which is almost impossible to read).
Anyway.
- Posted by tims next home on April 27th, 2008
"Aly" <slfjh;sjb@DFv3rjgn34,..fv> wrote in message
news:r82dnQ8iwrRKVY7VnZ2dnUVZ8uOdnZ2d@bt.com...
This is a standard trick that a good compiler will do for you.
But the swapping vars trick is unlikely to produce optimum ASM in machine
that cannot do arithmetic with two memory locations. By the time you have
added in the extra move to/from registers, the temp variable option (which
the compiler will optimise out) is going to be quicker.
tim
- Posted by Chris H on April 27th, 2008
In message <y4udnWJVTeYawYnVnZ2dneKdnZydnZ2d@bt.com>, Aly
<slfjh@?.?.invalid> writes
You mean its social interaction you have a problem with? This is why
they do personality tests to see if people will fit in.
So you have pre-judged managers? Sounds like a serious personality
defect to me.
You learn by trial and error not using the correct procedures?
So that's the difference between programming and SW Engineering
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
- Posted by whygee on April 27th, 2008
Aly wrote:
I agree.
Unfortunately, there are not enough women in engineering to learn from.
I'm sure we (men) miss a lot !
yg
- Posted by Vladimir Vassilevsky on April 27th, 2008
Chris H wrote:
I am kinda pimp. How about you?
VLV
- Posted by Vladimir Vassilevsky on April 27th, 2008
Didi wrote:
Precisely.
That's the result of the potato chips and coca cola upbringing. Positive
stimulus, "We can do it", "We don't have bad students - we only have
good and average students" and the other BS like that. As the result,
they only know "THIS IS WHAT I WANT!!!" and if it goes other way they
either start screaming and complaining or they grab a gun and kill
everyone in their way.
I like people with military experience. They have seen the other side of
life and they understand the orders and the responsibility.
Not quite. You can employ a whore however he/she still be whoring on the
side. Being a whore or a slave is not just the terms of employment.
Those are the different ways of life with the completely different
philosophies, methods and goals :-)
Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com
- Posted by Chris H on April 27th, 2008
In message <%J1Rj.1240$506.1166@newssvr27.news.prodigy.net> , Vladimir
Vassilevsky <antispam_bogus@hotmail.com> writes
Not sure I fit any of them.
Certainly not a slave (unless you count for the wife/kids etc :-)
Don't whore as such... some pimping I think.
Some dealing I suppose.
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
- Posted by Mark Walsh on April 27th, 2008
I would never discount the value of trial and error and especially blowing
things up. It seems like many of the really significant advances we have
made at my company are preceded not by some engineer shouting "Eureka, I
found it", but by him muttering "Gee, that's funny".
Mark Walsh
- Posted by Alex Colvin on April 27th, 2008
or,
a += b; b = a-b; a -= b;
--
mac the naïf
- Posted by CBFalconer on April 28th, 2008
Alex Colvin wrote:
All of these are only valid when the int action on overflow is
suitably defined. It isn't. It is implementation defined. In
addition the algorithms fail (zeroing everything) when a and b are
the same item.
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
- Posted by Tim Wescott on April 28th, 2008
On Sun, 27 Apr 2008 22:46:03 -0400, CBFalconer wrote:
You mean the one using addition. The bitwise XOR one should always work.
The one using addition presumably assumes that the 'usual' 2-s
complement, wrap-on-overflow behavior is happening. You are correct that
this behavior is implementation-specific, but it's probably more
ubiquitous these days than compilers that actually adhere to the ANSI
standards in every way.
a = 2, b = 2.
a = 2 ^ 2 = 0.
b = 0 ^ 2 = 2.
a = 0 ^ 2 = 2.
Nope.
a = 2, b = 2.
a = 2 + 2 = 4.
b = 4 - 2 = 2.
a = 4 - 2 = 2.
Nope again.
--
Tim Wescott
Control systems and communications consulting
http://www.wescottdesign.com
Need to learn how to apply control theory in your embedded system?
"Applied Control Theory for Embedded Systems" by Tim Wescott
Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html
- Posted by nospam on April 28th, 2008
Tim Wescott <tim@seemywebsite.com> wrote:
He means implemented as a macro or function passed pointers
swap(a, a)
would set a to zero.
--
- Posted by Tim Wescott on April 28th, 2008
On Mon, 28 Apr 2008 06:19:38 +0100, nospam wrote:
Indeed -- if that is what he meant, I certainly misread it.
--
Tim Wescott
Control systems and communications consulting
http://www.wescottdesign.com
Need to learn how to apply control theory in your embedded system?
"Applied Control Theory for Embedded Systems" by Tim Wescott
Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html