How to convert Infix notation to postfix notation

S

spinoza1111

No, I won't try because I have no interest at all in C Sharp.  (And actually,
I don't think I can functionally get it free, because I don't have a Windows

El cheapo HP netbook: less than 500.00. Stop smoking and you can save
up for one.
machine on which to get it...)  There are plenty of languages I don't know
in which I could presumably do this.

I love how you brag about how expert you were in C, how you taught it, and
so on, and then complain that it's an unfamiliar language, when the mistakes
you make would have been just as wrong twenty years ago.

You know the deal, so stop misrepresenting it. I knew it 20 years ago
and am relearning it now.

"The horror! The Horror!" - Colonel Kurtz, Apocalypse Now

And my C code after all the years is better than yours ya ha ha.

And as I have said, you are not qualified to address anything abpve
language details. You have said that you have a low level gofer-looker-
atter job and nothing you have posted shows enough technical or
general culture for me to find it useful.
 
S

spinoza1111

That is an unconstructive comment. 99.999% of code (esp C) doesn't
work and sucks stylistically.  [...]

I don't see how that's an excuse for inventing a new style that
sucks :)

It's not, but my new style (which isn't really new, but is of the sort
found in more academic books) doesn't suck. It's laid out for
readability, uses the right form of Hungarian and is easy for
intelligent people to read.
--
"The way I see it, an intelligent person who disagrees with me is
 probably the most important person I'll interact with on any given
 day."
--Billy Chambless

True. And this is also true of stupid people who disagree with me,
which is why I'm here.
 
B

Ben Pfaff

spinoza1111 said:
It's not, but my new style (which isn't really new, but is of the sort
found in more academic books) doesn't suck. It's laid out for
readability, uses the right form of Hungarian and is easy for
intelligent people to read.

Which books use your style of function declarations and
definitions?
 
F

Flash Gordon

bartc said:
Flash Gordon said:
bartc said:
spinoza1111 wrote:

Grow up. Most platforms are Microsoft.

Absolute rubbish. [...] MS is a tiny drop in a rather large puddle.

I keep hearing all this. But since the 80's, most of the computers
I've been able to buy have come with a MS operating system. Most of
the rest have been Macs.

How many mainframe systems have you bought, personally, in the last
twenty years? How many minicomputer systems? And of course most of
the computers that you /have/ bought in the last twenty years aren't
MS platforms.

They don't seem to stock mainframes at PC World or Dixons.

So? That isn't where most computers (even most desktops and laptops, I
would guess), are bought.

My point-of-view is that of a hobbyist programmer. But even when I worked
for a (very small) company we were buying PCs with DOS or Windows, since
that was most of our clients had or could easily buy. I can't remember
where
they were from, they just appeared.

(This has come up before and I understand some hobbyists do have esoteric
systems of various kinds.)

I'm not a hobbyist. Well, I am, but I'm also a professional. I deal with
the people who buy computers for companies, and believe me companies do
not pop over to PC World to buy a few hundred PCs.

I suspect that most people who have what you consider a computer at home
also have one at work. Lots of people who have computers at work don't
have them at home. So at the very least a significant number of
computers are bought by compunes rather than individuals. Add on the
individuals who have more sense than to buy PCs from PC World and the
like, and I suspect most of what you consider to be PCs are *not* bought
from places like PC World.
Actually I've little idea what a server is. I'd imagine it's some machine
accessed across a network. I would call it specialised,

Why? When it is running MORE software and a larger variety of software,
including all of the desktop applications (as opposed to games) that you
might be running on your desktop? Not, I say IS running, not could run,
since I'm talking about servers on which remote users ARE running Word,
Excel and load of other stuff.
although the way
the
internet works is blurring some of the distinctions.

No, you are adding a distinction that was never there in the first
place. You are saying the modern equivalent of what people called
computers before desktop machines came along are not computers. You are
also saying that machines that *are* used for all the purposes you use
your desktop PC for are not computers, even if they are running a
version of the same OS and have the same processor.

You are doing the equivalent of saying my brothers transceiver is not
radio because as well as being used to listen to conventional radio
stations it is also used to listen to, and speak on, amateur bands,
marine channels and various other bands.
(I started in computing using timesharing terminals connected to a single
large computer.

Said computer would have been what is now called a server.
A few years later with no job I drifted into hardware and
started using simple microprocessor computers that were 100% personal and
hands-on.

Great! Finally we could get away from monster computers, operating systems,
logins, passwords, quotas, booking of terminals... but 25 years on and
we're
drifting back in that same direction, and in spades...)

Actually, those machines NEVER went away, it's just people had other
computers as well.
3 versions of Windows and 5 of Linux, and you think it's not specialised?..

Nope, it's far more general. Taking the example of one of our customers,
Citrix is being used so that remote users can run Excel, Word etc on the
server with full access to internal resources. The same server is also
running a Linux image running one of the cost management applications
(which is a client/server app). The same server is also running another
couple of copies of a different version of Windows to run MS SQL and the
accounts package used by the company. The same server is also running a
number of other OSs and apps I know nothing about. So the one machine IS
being used to run all the SW people run on their desktops at work as
*well* as lots of other stuff.

If it is doing all the stuff your computer does, and lots more at the
same time, how is it more specialised and not a computer?
All I'm saying is that my world is dominated by computers running MS
products and I don't think that's an uncommon situation. (Not all of us are
lucky to have been given cool jobs developing for all these other systems
that are always mentioned.)

Your little corner of the world might be, but the world itself is not.
If I had to write a utility, let's say in C, to be sent to half a dozen
people I know, then if I compile it for x86-32 under Windows, I know they
will be able to run it. Compiled for anything else, they won't.

For several years I would only have been able to run it because I had
some other server type software on my personal computer (which was not
running Windows). Now, to run it, I would have to use my company
computer, not my personal one!
 
K

Keith Thompson

bartc said:
I could never remember formulae like volumes of circles, but I could
just about derive them using bits of calculus.
[...]

The formula for the volume of a circle is easy to remember. Take the
radius, square it, multiply by pi -- and then multiply the result by
zero.
 
B

bartc

Keith Thompson said:
bartc said:
I could never remember formulae like volumes of circles, but I could
just about derive them using bits of calculus.
[...]

The formula for the volume of a circle is easy to remember. Take the
radius, square it, multiply by pi -- and then multiply the result by
zero.

You understand my problem...
 
S

Seebs

El cheapo HP netbook: less than 500.00. Stop smoking and you can save
up for one.

Why would I bother? It's useless to me. I have no interest in C#.
You know the deal, so stop misrepresenting it. I knew it 20 years ago
and am relearning it now.

The kinds of mistakes you make are not ones I would make even in something I
hadn't used for 20 years. I guess it takes all kinds.
And my C code after all the years is better than yours ya ha ha.
*snerk*

And as I have said, you are not qualified to address anything abpve
language details.

You keep using "as I have said" to provide the illusion that something has
a source, except of course, you use it only for things you've never supported.
You have said that you have a low level gofer-looker-atter job

Well, actually, no. :)
and nothing you have posted shows enough technical or
general culture for me to find it useful.

Uh, yeah, hope that works out for you. :)

-s
 
S

Seebs

It's not, but my new style (which isn't really new, but is of the sort
found in more academic books) doesn't suck. It's laid out for
readability, uses the right form of Hungarian and is easy for
intelligent people to read.

I love how you went from "it's Hungarian" to "it's the right form
of Hungarian".

Got any citations for that? The mere fact that you don't understand
my posts does not mean that my positions are prima facie evidence to the
contrary.

Hint: There are no citations for that, because everyone consistently agrees
that Systems Hungarian is crap. Well, everyone but you.

-s
 
S

spinoza1111

In <[email protected]>,

spinoza1111wrote:

[Seebs has] made a grand total of about one useful observation
during this code review.

If you post some code that actually compiles, you may well get some
more useful observations. Right now, though, that's the big stumbling
block.
Duh, change the big H to a widdle H. That was the problem. Non-
Microsoft systems don't have the power and generaliity of Microsoft
systems and therefore fail, like you, to see the forest for the
trees.

Like an incompetent manager in a dysfunctional company you actually
believe that repeating lies and half truths make them true, and if I
was your father, I'd kick your ass.
 
S

spinoza1111

I love how you went from "it's Hungarian" to "it's the right form
of Hungarian".

Got any citations for that?  The mere fact that you don't understand
my posts does not mean that my positions are prima facie evidence to the
contrary.

Hint: There are no citations for that, because everyone consistently agrees
that Systems Hungarian is crap.  Well, everyone but you.

I think "everyone" here is either a retiree or else holds down some
computer-related job of checker upper onner where they are prevented
from actually coding for real, and it's for this reason I discount
their wisdom. We have learned that Seebach merely sends problems on to
real programmers, for example, and only Bacarisse here gives evidence
of actual problem-solving capacity: he does not have to pad his emails
with dozens of idiot saws learned second-hand from the guys at the
office on break: instead, when he posts, it's usually a show stopper.

As to you, you appear to edited a book for an unethical publisher with
a known reputation for treating authors poorly and this meant you were
more of a chain gang boss, for a company which gets former editors
jailed for contempt of court when those former editors speak up. Not
once in our long and quite unpleasant acquaintance have you posted
anything original or insightful.

The fact is that in the detailed design of a large program you should
be able to identify the ranges of all significant values, and this
means that you should be able to assign them a systems Hungarian
prefix. People with actual experience in crafting large programs know
this.
 
W

Willem

Seebs wrote:
)> It should not recurse, I think It should only grab the declarations from
)> the named file.
)
) What if the named file refers to types it got from another file?

Err. (Thinking this up as I go along)

The declarations can only depend on types from other files if these are
from #include statements, so the #import should follow all the #include
statements to check for the external definitions. I think ?

)> Well, no. All you get are the declarations, basically.
)> Like I said, you #import the .c file, not the .h file.
)
) And what if the declarations depend on the defines?

Well, you could also say that the prototypes themselves have that info in
them, so that the compiler can check for compatibility of the calls, but
that to be able to use them in other code, you would still need to #include
them ?

Like that, the #import statements are used for all the common cross-file
linking of functions and variables, and then the #includes are for those
things (like definitions) that are shared across multiple files.

)> Although I see what you mean. Perhaps it could also pick up the variable,
)> struct and enum declarations (not static and in file-scope of course) ?
)
) Yeah, but that starts getting finicky.
)
) static enum foo { foo_a, foo_b };
) extern int whoops(enum foo bar);
)
) Obviously, we should pick up "whoops". What is its prototype?

err... Is that legal ?

If you have 'static enum foo { foo_a, foo_b } global_foo;'
Then I would guess the enum itself would/should be globally visible.
(As it's currently irrelevant.)

But like I said, it's just an idea I'm running with right now.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
 
K

Kenny McCormack

El cheapo HP netbook: less than 500.00. Stop smoking and you can save
up for one.

Caveat: I've never had any inclination to investigate it, but ...

Based on my reading, when I first started looking at .NET, there is
nothing per se that ties .NET to MS Windows. And, in fact, there are
implementations for other platforms, including Linux (and no, I don't
mean by running a Windows emulator).

Of course, MS isn't completely stupid. I'm sure there are gotchas
involved in using a non-Windows implementation. But, still, given that
this is a newsgroup obsessed with so-called "accuracy" (so labeled for
what should, by now, be obvious reasons), we should feel safe in
poo-poo'ing the notion that .NET is MS Windows only.

Incidentally, on the subject of things MS, let me re-iterate what I've
said all along about what really makes this NG tick. That is, a common
hatred of things MS. And believe me, I know of what I speak. I used to
be one. But at some point, to paraphrase St. Paul, you have to leave
childish things behind. Basically, once you realize that they aren't
getting you anywhere.

My basic thesis is that the lunacy that is CLC, pretty much came about
when, in the early 90s, the Unix-heads (and being once myself, I use
that term with love) realized that the world was going MS. And it
pissed them off (as it did me, for a long time). And so, rather than
see their beloved newsgroup(s) descend into endless discussions of
"lpParam", "GetWindowTitleName()", etc, they concocted this "what's in
the standard and only what's in the standard" nonsense. And that's
where we are today...
 
K

Kenny McCormack

Seebs said:
Hint: There are no citations for that, because everyone consistently agrees
that Systems Hungarian is crap. Well, everyone but you.

This of course is false, in the CLC sense of the term, since I am sure I
could find one person (in fact, with a little research, maybe even a
dozen) people who still like it.

So, we see Seebs go down in flames (*), once again...

(*) No pun intended...
 
S

Seebs

Duh, change the big H to a widdle H. That was the problem.

There were other problems.
Non-
Microsoft systems don't have the power and generaliity of Microsoft
systems and therefore fail, like you, to see the forest for the
trees.

This really isn't a power/generality question. It's a design tradeoff,
and different companies have made different choices.
Like an incompetent manager in a dysfunctional company you actually
believe that repeating lies and half truths make them true,

Man, you just blew out another milspec irony meter. That quote is awesome
coming from someone who uses "As I have said" as a way to introduce claims
for which he's never presented any kind of support other than his own
assertions.

-s
 
S

Seebs

I think "everyone" here

Not just here, though. Pretty much everywhere.
We have learned that Seebach merely sends problems on to
real programmers,

No, we have learned that you can't read for comprehension.

I wrote the filesystem interface code that we use for all our builds; it's
about 5k lines of code, written in three weeks, and we've had three bug
reports on it in a year of heavy use. :)

I don't actually change the compiler internals, 'cuz we subcontract that
to specialists, but that doesn't change much.
The fact is that in the detailed design of a large program you should
be able to identify the ranges of all significant values, and this
means that you should be able to assign them a systems Hungarian
prefix.

No, it doesn't.

For one thing, systems Hungarian is the wrong choice for that, because the
ranges of values aren't necessarily defined by those types; for instance,
"long" might not be the same size on different supported targets. In many
cases, the correct range is not related to a specific type.

For a concrete example, if you are storing "an inode number", the correct
type is ino_t, not int or long, and you don't need to know the range --
because the range is "whatever values the system yields in the range covered
by the existing type". When you're referring to a file, you don't need a
prefix to identify the inode; you just CALL it an inode and you're done.
Same thing goes for a whole lot of other standard types.

There are cases where it makes sense to indicate type information, but
usually systems Hungarian is the wrong way to do it. Consider, for instance,
that both an array index and the size of a block of memory are presumably
size_t. In systems Hungarian, used by idiots, they are described as being
the same type because they have the same range of values. In apps Hungarian,
used by people who are not as stupid, thye are not described as having
the same type because, while they have the same range of possible values,
the values are not interchangeable. Mistaking the range of values for the
data type is pretty much a newbie mistake.
People with actual experience in crafting large programs know
this.

People with actual experience in recognizing the use of vague appeals
to nonspecific authority to make up for the lack of a real argument
are familiar with your posting style. :)

-s
 
K

Kenny McCormack

Not just here, though. Pretty much everywhere.


No, we have learned that you can't read for comprehension.

I wrote the filesystem interface code that we use for all our builds; it's
about 5k lines of code, written in three weeks, and we've had three bug
reports on it in a year of heavy use. :)

Not into status at all, are we???

Nope, nope, nope.

Notes:
1) Granted, if somebody attacks you, it is pretty hard to resist the
temptation to start singing your virtues (listing your
accomplishments)
2) This point (#1 above) illustrates why it is a bad thing to claim
to not be motivated by status. Sooner or later (and in this
case, it didn't take long), you're going to end up looking like
a hypocrite (or worse...)
 
N

Nick

Not into status at all, are we???

Nope, nope, nope.

Notes:
1) Granted, if somebody attacks you, it is pretty hard to resist the
temptation to start singing your virtues (listing your
accomplishments)
2) This point (#1 above) illustrates why it is a bad thing to claim
to not be motivated by status. Sooner or later (and in this
case, it didn't take long), you're going to end up looking like
a hypocrite (or worse...)

I'm not convinced that saying "I'm capable of X, and I've done Y" in
response to "you cann't do anything and have never done anything" is
about status. Opening a conversation like that, sure. But giving it as
factual information in response to a challenge is pretty much all you
can do other than accept the original claim.
 
S

Seebs

I'm not convinced that saying "I'm capable of X, and I've done Y" in
response to "you cann't do anything and have never done anything" is
about status. Opening a conversation like that, sure. But giving it as
factual information in response to a challenge is pretty much all you
can do other than accept the original claim.

In particular, our poster child for inability to comprehend that other
people could be different from him has not considered the possibility
that someone might care about the factual claim without thinking of it
as a status claim. He sees things a given way; no matter what anyone
says, he always translates anything other people say into his frame
of reference.

Given his reaction, I can conclude that, in fact, Spinny's remark
might well have been intended as a status claim. (There is some humor
value in Spinny trying to make hay from my autism, while Kenny tries to
ignore the logical implications of it. At most one of them is right...)
It wouldn't have occurred to me to think of that as status; a factual
statement to do with qualifications, yes, but qualifications aren't
the same thing as status; they don't impose any social duties on other
people, they're just information to help you weigh claims you aren't
otherwise sure how to evaluate.

The people at Code Sourcery know compilers better than I do, no doubt
about it. I'm sure Kenny can tell us all whether that means that they're
higher-status than me or lower-status than me. I have no clue. They're
better at a technical task; I can tell them what technical task to perform.
How does that work out? Of course, the real answer is that it's not
a status relationship; it's a contractual one, in which they do their
thing, we do ours, and everyone's happy.

-s
p.s.: And what do I care if I look like a hypocrite? I'm a human with
a functioning metabolism; it is a safe bet that I am a hypocrite. I don't
see why I should care. :)
 
B

bartc

Nick Keighley said:
Richard Heathfield said:
spinoza1111 wrote:
Grow up. Most platforms are Microsoft.
Absolute rubbish. If you're going by installation count, there are
approximately 1,000,000,000 PCs out there, not all of which run MS
operating systems. [lots of examples]

I keep hearing all this. But since the 80's, most of the computers I've
been
able to buy have come with a MS operating system. Most of the rest have
been
Macs.

You probably haven't bought many articulated lorries either but they
still exist.

That's a good analogy, but it helps make my point not yours: when someone
takes driving lessons, do they also include sections on HGV and PSV driving?
[Ie. trucks and buses]
Some things like MP2 players, digital cameras and GSM phones can't be
built without microprocessors.

I'm not saying otherwise (although you will note that recorded music,
photography, and telephones used to work just fine without them...)
personnally I'd prefer a book that clearly distinguised standard stuff
from non-standard stuff. Some of us like to write software that runs
on multiple platforms. That 3/4 million line program has been ported
between OSs once and between DBMSs another.

OK, there's a huge amount of different kinds of computing that goes on in
academia, industry, business and so on.

For those of us outside that world, who only really have access to
consumer-level PCs, why should we concern ourselves with anything else? At
most we might worry about portability between Windows, MacOS and Linux.

And even someone who in their day job writes code for some jet fighter, who
in their spare time wants to exchange programs with a friend who writes
programs for a supermarket, what common platform do you think they might
use?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,078
Messages
2,570,570
Members
47,204
Latest member
MalorieSte

Latest Threads

Top