Shelton/C# should be able to match my HTM_TXT.EXE .

J

Jeff_Relf

Hi Tom, You showed: <<
private const string PHONE_LIST =
"495.1000__424.1111___(206)564-5555_1.800.325.3333";

static void Main( string[] args ) {
foreach (string phoneNumber in Regex.Split (PHONE_LIST, "_+")) {
Console.WriteLine (phoneNumber); } }

Output:
495.1000
424.1111
(206)564-5555
1.800.325.3333 >>

Thanks Tom, that's very interesting,
but not enough to switch me away from LoopTo(),
RegEx simply isn't as flexible.

#define LoopTo( StopCond ) \
while ( Ch && ( Ch = ( uchar ) * ++ P ) \
&& ! ( Ch2 = ( uchar ) P [ 1 ], StopCond ) )

It's a very simple matter to convert HTML to plain text,
following these rules:

These are valid HTML tags: <! Comment --> <Alpha> </Alpha>
But, due to the leading space, < Alpha> is not.
Things like &Unknown are sent through untranslated, for obvious reasons.

Pass HTM_TXT.EXE a .HTML file and it spits out a .TXT file.
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.EXE
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.CPP
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.VCPROJ

If RegEx is as powerful as you say,
you should be able to produce something that works at least as well,
and which is just as readable, or more, to me.
 
T

Tom Shelton

Hi Tom, You showed: <<
private const string PHONE_LIST =
"495.1000__424.1111___(206)564-5555_1.800.325.3333";

static void Main( string[] args ) {
foreach (string phoneNumber in Regex.Split (PHONE_LIST, "_+")) {
Console.WriteLine (phoneNumber); } }

Output:
495.1000
424.1111
(206)564-5555
1.800.325.3333 >>

Thanks Tom, that's very interesting,

I'm glad you find it so.
but not enough to switch me away from LoopTo(),

Fine by me. I'm not trying to get you to switch.
RegEx simply isn't as flexible.

I have to disagree with that...
#define LoopTo( StopCond ) \
while ( Ch && ( Ch = ( uchar ) * ++ P ) \
&& ! ( Ch2 = ( uchar ) P [ 1 ], StopCond ) )

It's a very simple matter to convert HTML to plain text,
following these rules:

These are valid HTML tags: <! Comment --> <Alpha> </Alpha>
But, due to the leading space, < Alpha> is not.
Things like &Unknown are sent through untranslated, for obvious reasons.

Pass HTM_TXT.EXE a .HTML file and it spits out a .TXT file.
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.EXE
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.CPP
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.VCPROJ

If RegEx is as powerful as you say,
you should be able to produce something that works at least as well,
and which is just as readable, or more, to me.

I might take you up on this if I have time...
 
T

Tom Shelton

Hi Tom, You showed: <<

These are valid HTML tags: <! Comment --> <Alpha> </Alpha>
But, due to the leading space, < Alpha> is not.
Things like &Unknown are sent through untranslated, for obvious reasons.

Pass HTM_TXT.EXE a .HTML file and it spits out a .TXT file.
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.EXE
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.CPP
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.VCPROJ

If RegEx is as powerful as you say,
you should be able to produce something that works at least as well,
and which is just as readable, or more, to me.

Here is the code. I wrote this fast since I had a few minutes while the
dishwasher finished. It doesn't handle the &#x20. I wanted to ask you
what you wanted with that? Stripped? Converted? And are we only
looking for &#x20? I'll add that in once I know the answer.

using System;
using System.IO;
using System.Text.RegularExpressions;

public sealed class App
{
public static void Main(string[] args)
{
try
{
// TODO: IMPROVE COMMAND LINE PARSING
if (args.Length > 0)
{
// original text buffer
string htmlText = null;

// read in the file
using (StreamReader sr = new StreamReader (args [0]))
{
htmlText = sr.ReadToEnd ();
}

// strip the tags...
htmlText = Regex.Replace (
htmlText,
@"<(?:/{1}|[a-zA-z]+|! +)[\s\S]*?>",
string.Empty);

// write the file...
using (StreamWriter sw = new StreamWriter (Path.ChangeExtension (args [0], "TXT")))
{
sw.Write (htmlText);
}
}
else
{
Console.WriteLine ("No File Name Supplied");
}
}
catch (Exception ex)
{
Console.WriteLine (ex.ToString ());
}
}
}

Someone more expert in regex might be able to do it better :) I have
never been an expert, and I haven't done it for quite some time - but
there you have it.

Here is the modified input (modified to see if it followed the rules):

<Html>< head><title>Jeff Relf's Home Page</title></head><body><pre>
Welcome to my home page: http://www.Cotse.NET/users/jeffrelf/
e-mail: (e-mail address removed)

I'm Jeff Relf and I was born in North Seattle at the start of 1960
to a Mormon family consisting of two parents, four brothers and one sister.

My first programming was on HP and TI calculators starting around 1974.
( e.g. in 1976, the HP 67 with it's magnetic cards ).
I broke and lost many of them.
<! Comment -->
I've been programming professionally since the start of 1982,
but I play much more than I work ( like a starving artist, if you will ).
..+.+.+
Here's my favorite pointing device:
<a
href="http://www.cotse.net/users/jeffrelf/MS_Trackball_Explorer.JPG">http://www.Cotse.NET/users/jeffrelf/MS_Trackball_Explorer.JPG</a>
This link shows my ramblings on Usenet ( Google Groups ):
<a href="http://google.com/groups?as_uauthors=Jeff_Relf&amp;scoring=d">http://Google.COM/groups?as_uauthors=Jeff_Relf&amp;scoring=d</a>
This link shows a Picture of me from around the start of 2003:
<a href="http://www.cotse.net/users/jeffrelf/Jeff_Relf.JPG">http://www.Cotse.NET/users/jeffrelf/Jeff_Relf.JPG</a>
Here's my main man:
<a href="http://www.cotse.net/users/jeffrelf/Bill.JPG">http://www.Cotse.NET/users/jeffrelf/Bill.JPG</a>
Here's Einstein, another guy I like:
<a href="http://www.loyno.edu/~brans/einstein.jpg">http://www.loyno.edu/~brans/einstein.jpg</a>
This link shows my daughter, Jenny, at her wedding ( Mid 2003 ):
<a href="http://www.cotse.net/users/jeffrelf/Jenny.JPG">http://www.Cotse.NET/users/jeffrelf/Jenny.JPG</a>
Here's my son, Jeff, at the Moab MUni Fest, summer 2001:
<a href="http://www.cotse.net/users/jeffrelf/JR.JPG">http://www.Cotse.NET/users/jeffrelf/JR.JPG</a>
Here's my ex, Janeen, at the Moab MUni Fest, summer 2001:
<a href="http://www.cotse.net/users/jeffrelf/Janeen.JPG">http://www.Cotse.NET/users/jeffrelf/Janeen.JPG</a>
..+.+.+
Here are my style sheet overrides for Moz FireFox 1.0,
userChrome.CSS and userContent.CSS:
<a href="http://www.cotse.net/users/jeffrelf/userContent.CSS">http://www.Cotse.NET/users/jeffrelf/userContent.CSS</a>
<a href="http://www.cotse.net/users/jeffrelf/userChrome.CSS">http://www.Cotse.NET/users/jeffrelf/userChrome.CSS</a>
They make pages look like this:
<a href="http://www.cotse.net/users/jeffrelf/CSS.PNG">http://www.Cotse.NET/users/jeffrelf/CSS.PNG</a>
..+.+.+
Here is my HTML to TXT converter:
<a href="http://www.cotse.net/users/jeffrelf/HTM_TXT.EXE">http://www.Cotse.NET/users/jeffrelf/HTM_TXT.EXE</a>
<a href="http://www.cotse.net/users/jeffrelf/HTM_TXT.CPP">http://www.Cotse.NET/users/jeffrelf/HTM_TXT.CPP</a>
<a href="http://www.cotse.net/users/jeffrelf/HTM_TXT.VCPROJ">http://www.Cotse.NET/users/jeffrelf/HTM_TXT.VCPROJ</a>
If, for example, you pass it a file named index.HTM ,
it creates a file called index.TXT .
..+.+.+
Here is my CPU/hard_disk benchmarker:
<a href="http://www.cotse.net/users/jeffrelf/Tom.EXE">http://www.Cotse.NET/users/jeffrelf/Tom.EXE</a>
<a href="http://www.cotse.net/users/jeffrelf/Tom.CPP">http://www.Cotse.NET/users/jeffrelf/Tom.CPP</a>
<a href="http://www.cotse.net/users/jeffrelf/Tom.VCPROJ">http://www.Cotse.NET/users/jeffrelf/Tom.VCPROJ</a>
( Tom is someone I met in Comp.OS.Linux.Advocacy )
For example, if you run Tom.EXE, you'll see that a 1.7 GHz Vaio notebook,
with a Centrino and 2 megs of L2 cache, is much faster than my
cheap Compaq Presario desktop with 2.7 GHz,
256 RAM, 128K L2 cache, 8 megs of actual VRAM ( 64 by emulation )
6 USB ports, at least 6 audio jacks, and a 40 gig hard disk.
( It cost 229 USD after rebates... a close out )

A lower clock rate is very desirable for notebooks
as it has little effect on actual performacne
and the power consumed rises with the square of the clock rate.

Tom.EXE can test both the the speed of your CPU/cache while task-switching
as well as the speed of your hard disk while swaping out to virtual memory.
You run it in a DOS shell,
passing it how many threads you want it to simultaneously hold.
If you don't pass a parameter it will create as many simultaneous threads
as possible, thereby invoking all of your virtual memory
( making the swap file very active for about 3-7 minutes ).

These are the numbers I get on my box:
&gt;&gt;&gt; Tom 2000
2,000 Simultaneous threads acheived.
58.7 Seconds per 100,000 simultaneously spawned/completed.
&gt;&gt;&gt; Tom
14,032 Simultaneous threads acheived.
17.3 Minutes per 100,000 simultaneously spawned/completed.

The 100,000 simultaneous threads standard refers to
a conversation Ingo Molnar had with Linus Torvalds
( see ).
..+.+.+
Here's X, my hand-rolled newsreader, Dialer, SMTP-AUTH and POP3 client:
X's settings are here:
<a href="http://www.cotse.net/users/jeffrelf/X.TXT">http://www.Cotse.NET/users/jeffrelf/X.TXT</a>
The .EXE file ( for MS_Win_XP ):
<a href="http://www.cotse.net/users/jeffrelf/X.EXE">http://www.Cotse.NET/users/jeffrelf/X.EXE</a>
The .CPP file ( MS_VC_7.1 ):
<a href="http://www.cotse.net/users/jeffrelf/X.CPP">http://www.Cotse.NET/users/jeffrelf/X.CPP</a>
The next two files are optional.
This contains my project settings ( VS.NET 2003, Microsoft C++ 7.1 )
( you can edit it with notepad to change the directories used ):
<a href="http://www.cotse.net/users/jeffrelf/X.VCPROJ">http://www.Cotse.NET/users/jeffrelf/X.VCPROJ</a>
This is just X's icon:
<a href="http://www.cotse.net/users/jeffrelf/X.RES">http://www.Cotse.NET/users/jeffrelf/X.RES</a>

I use X a lot, it's the only newsreader I use.
I never have to screw around with views or sorting
because my X ( in VS.NET ) allows me to slickly/quickly search
the full text of a newsgroup in one file.

Cola.TXT ( Comp.OS.Linux.Advocacy ) is a 3.8 MB example of that:
<a href="http://www.cotse.net/users/jeffrelf/Cola.TXT">http://www.Cotse.NET/users/jeffrelf/Cola.TXT</a>
This is what Cola.TXT looks like when browsing it in VS.NET:
<a href="http://www.cotse.net/users/jeffrelf/Cola_TXT.PNG">http://www.Cotse.NET/users/jeffrelf/Cola_TXT.PNG</a>
X is using Bit_Stream.TTF, a good monospaced font ( free ):
<a href="http://www.cotse.net/users/jeffrelf/Bit_Stream.TTF">http://www.Cotse.NET/users/jeffrelf/Bit_Stream.TTF</a>

X automatically excludes second-level quoting ( i.e. the " &gt; &gt; " )
HTML, PGP sigs, and other spam.

I have that newsgroup set up tp retain 2,000 unread articles,
800 read articles that were from/to me
( up to 5 levels away, per the Referencs header ),
and 200 read ( a.k.a. " Deleted " ) articles not To/From me.

A VBA macro assigned to F1 ( and a toolbar icon )
in Visual studio.NET appears to delete an article
but actually moves it to the end of the file
and prefixes it with the word " Deleted ".
X's VBA macros for VS.NET 2003:
<a href="http://www.cotse.net/users/jeffrelf/X.VB">http://www.Cotse.NET/users/jeffrelf/X.VB</a>

Then, when X.EXE updates Cola.TXT the articles are sorted like this:
1. To/From Me Unread. Most recent First ( as found on the server ).
2. Unread not To/From Me. Most recent First.
3. Deleted not To/From Me. Most recent Last.
4. To/From Me Deleted. Most recent Last.

Although I plan on adding an editor to X,
it currently works best with VS.NET .
In VS, proper updating/viewing of In.TXT and Cola.TXT
requires that these two boxes be checked
in VS's Options --&gt; Environment --&gt; Documents:
1. Detect when file is changed outside the environment.
2. Auto-load changes
( if not not currently modified inside the environment ).

X's update to Cola.TXT is an element in VS' undo/redo list,
so you have to be careful when undoing things.
The update produces a report like this in X:
1 FromMe, 5 ToMe, 55 New.
1,987 UnRead, 500 Read, 500 Read FromTos.

The 5 most recent MIDs from the References header ( youngest first )
are tagged ( e.g. AAE__ ) for quicker/slicker searching in VS.NET:
One click on one of my toolbar's up/down arrows
finds what's under the text cursor ( repeatedly so, of course ).
Another pair of arrows only repeats the last search, up or down.

An article from a newsgroup begins something like this:
.+.+.+
Comp.OS.Linux.Advocacy
[email protected]
AAW__cZlsd.509206$D%.175553@attbi_s51
(e-mail address removed)
ABH__Z%isd.508650$D%.378252@attbi_s51 .
Re: Firefox stability
John_Bailo ( 4, 11.39 A, rVH4W _BP7FiP D Earthlink.NET, KNode_0_7_7 ),
This is the second line of the article's body.

X.CPP also handles SMTP-AUTH ( which works from anyone's LAN ).
Just put what you want to e-mail in the cut buffer
( the Del_Art VBA script, assigned to a toolbar icon,
does that automatically for me ).
The format of the e-mail must be like this:
.+.+.+
Jack Black &lt;[email protected]&gt;
Jane Peters &lt;[email protected]&gt;
Albert &lt;[email protected]&gt; .
Re: This is the title.
Hi Jack ( and Jane, Albert ), Blah blah.
.+.+.+

When sending e-mails to multiple people,
the second address must be indeneted with exactly two spaces
and the last addess must end with a Space_Space_Dot .

Hit E-Mail in X's toolbar to send it.
Hitting In checks your POP3 account for e-mail,
appending your e-mails to the end of In.TXT .

Attachements are automatically placed in the shortcut's directory.
X will not send attachments
( because I prefer to use links to my web site instead ).
..+.+.+
This link shows a .CPP to .HTML converter with syntax highlighting,
I didn't wrap it in a main() because I call it from WinMain()
( too complex to show here ):
<a href="http://google.com/[email protected]">http://Google.COM/[email protected]</a>
..+.+.+
Here's my Games.EXE program:
<a href="http://www.cotse.net/users/jeffrelf/Games.EXE">http://www.Cotse.NET/users/jeffrelf/Games.EXE</a>
There's no help file.
It makes heavy use of my trackball ( wheel, 5 buttons ).
e.g. For quick exiting,
One of my buttons is set to Cntrl-F4 ( Close window ).
Games.EXE plays a kind of Random_Chess, Rapid Monopoly,
Random_Mario_Brothers, Reversie, and Solitaire.
The chess game is always one player ( white ),
and it's designed to be very very mindless.
Pieces can be quickly added or removed.
By default you have no king... so you can't lose.
Source code:
<a href="http://www.cotse.net/users/jeffrelf/Games.CPP">http://www.Cotse.NET/users/jeffrelf/Games.CPP</a>
Bitmaps:
<a href="http://www.cotse.net/users/jeffrelf/Games.RES">http://www.Cotse.NET/users/jeffrelf/Games.RES</a>
Project file ( VS.NET 2003, Microsoft C++ 7.1 ):
<a href="http://www.cotse.net/users/jeffrelf/Games.VCPROJ">http://www.Cotse.NET/users/jeffrelf/Games.VCPROJ</a>
..+.+.+
Here is my Dif.EXE program:
<a href="http://www.cotse.net/users/jeffrelf/Dif.EXE">http://www.Cotse.NET/users/jeffrelf/Dif.EXE</a>
It compares two plain-text files via a shortcut ( .LNK ), e.g.:
Dif.EXE AA.CPP BB.CPP
Hit escape or Cntrl-F4 to exit. Use the wheel to move lines.
Hold down the middle mouse button as you move the wheel
to page up and down.
The screen's output is sent to
a file called AA.TXT in the starting directory.
Source code:
<a href="http://www.cotse.net/users/jeffrelf/Dif.CPP">http://www.Cotse.NET/users/jeffrelf/Dif.CPP</a>
Project file ( VS.NET ):
<a href="http://www.cotse.net/users/jeffrelf/Dif.VCPROJ">http://www.Cotse.NET/users/jeffrelf/Dif.VCPROJ</a>
..+.+.+
Here are some quotes from Einstein: &lt;&lt;

People like us, who believe in physics,
know that the distinction between past, present,
and future is only a stubbornly persistent illusion. &gt;&gt;, &lt;&lt;

every true theorist is a kind of tamed metaphysicist,
no matter how pure a ' positivist '
he may fancy himself.
[ ... He believes in ] a conceptual system built on
premises of great simplicity. &gt;&gt;, &lt;&lt;

But the scientist is possessed by
the sense of universal causation. The future, to him,
is every whit as necessary and determined as the past. &gt;&gt;, &lt;&lt;

A human being is a part of a whole,
called by us ' Universe ',
a part limited in time and space.
He experiences himself, his thoughts and feelings
as something separated from the rest ...
a kind of optical delusion of his consciousness. &gt;&gt;, &lt;&lt;

Everything is determined,
the beginning as well as the end,
by forces over which we have no control.
It is determined for the insects as well as the star.
Human beings, vegetables, or cosmic dust,
we all dance to a mysterious tune
intoned in the distance by an invisible piper. &gt;&gt;, &lt;&lt;

If [ God ] is omnipotent, then every occurrence,
including every human action, every human thought,
and Every human feeling and aspiration is also His work ;
how is it possible to think of holding men responsible for
their deeds and thoughts before such an almighty Being ?
In giving out punishment and rewards he would,
to a certain extent, be passing judgment on Himself.
How can this be combined with
the goodness and righteousness ascribed to Him ? &gt;&gt;, &lt;&lt;

The more a man is imbued with
the ordered regularity of all events
the firmer becomes his conviction that
there is no room left by the side of
this ordered regularity for causes of a different
[ ? Supernatural ] nature. &gt;&gt;

These quotes are from Stephen Hawking: &lt;&lt;

one has to find a consistent solution
of the equations of physics &gt;&gt;, &lt;&lt;

It would imply that we were completely determined:
we couldn't change our minds. So much for free will. &gt;&gt;, &lt;&lt;

In summary, the title of this essay was a question:
' Is everything determined ? '
The answer is yes, it is.
But it might as well not be,
because we can never know what is determined. &gt;&gt;, &lt;&lt;

The boundary condition of the universe
is that it has no boundary.
The universe would be completely self-contained
and not affected by anything outside itself.
It would neither be created nor destroyed.
It would just Be .
What place, then, for a creator ? &gt;&gt;, &lt;&lt;

In relativity, there is no real distinction between
the space and time coordinates, just as there is
no difference between two space coordinates. &gt;&gt;

Hermann Weyl, Einstein's colleague said:
" The world doesn't happen, it simply is. "

From http://www.newadvent.org/cathen/02053a.htm : &lt;&lt;

The theory of Democritus [ Athens, 460 - 370 BC ]
may be summed up in the following propositions :
- All bodies are composed of atoms
and spaces between the atoms. &gt;&gt;, &lt;&lt;
- There is no purpose or design in nature,
and in this sense all is ruled by chance.
[ Jeff Relf adds: " Chance " is a mysterious,
yet still absolute, material determinism ]
- All activity is reduced to local motion. &gt;&gt;

Hawking wrote:
<a href="http://www.generationterrorists.com/quotes/abhotswh.html">http://www.GenerationTerrorists.COM/quotes/abhotswh.html</a>
&lt;&lt; There are something like ten million million million
million million million million million million million
million million million million
( 1 with eighty zeroes after it ) particles
in the region of the universe that we can observe.
Where did they all come from ?
The answer is that, in quantum theory,
particles can be created out of energy
in the form of particle/antiparticle parts.
But that just raises the question of
where the energy came from.
The answer is that
the total energy of the universe is exactly zero.
The matter in the universe
is made out of positive energy.
However,
the matter is all attracting itself by gravity.
Two pieces of matter that
are close to each other have less energy than
the same two pieces a long way apart,
because you have to expend energy
to separate them against the gravitational
force that is pulling them together.
Thus in a sense,
the gravitational field has negative energy.
In the case of a universe that is
approximately uniform in space,
one can show that this negative gravitational energy
exactly cancels the positive energy
represented by the matter.
So the total energy of the universe is zero.
Now twice zero is also zero.
Thus the universe can
double the amount of positive matter energy
and also double the negative gravitational energy
without violation of the conservation of energy. &gt;&gt;, &lt;&lt;

It is said that there's no such thing as a free lunch.
But the universe is the ultimate free lunch. &gt;&gt;
</pre></body></html>

Here is the output:

< head>Jeff Relf's Home Page
Welcome to my home page: http://www.Cotse.NET/users/jeffrelf/
e-mail: (e-mail address removed)

I'm Jeff Relf and I was born in North Seattle at the start of 1960
to a Mormon family consisting of two parents, four brothers and one sister.

My first programming was on HP and TI calculators starting around 1974.
( e.g. in 1976, the HP 67 with it's magnetic cards ).
I broke and lost many of them.

I've been programming professionally since the start of 1982,
but I play much more than I work ( like a starving artist, if you will ).
..+.+.+
Here's my favorite pointing device:
http://www.Cotse.NET/users/jeffrelf/MS_Trackball_Explorer.JPG
This link shows my ramblings on Usenet ( Google Groups ):
http://Google.COM/groups?as_uauthors=Jeff_Relf&amp;scoring=d
This link shows a Picture of me from around the start of 2003:
http://www.Cotse.NET/users/jeffrelf/Jeff_Relf.JPG
Here's my main man:
http://www.Cotse.NET/users/jeffrelf/Bill.JPG
Here's Einstein, another guy I like:
http://www.loyno.edu/~brans/einstein.jpg
This link shows my daughter, Jenny, at her wedding ( Mid 2003 ):
http://www.Cotse.NET/users/jeffrelf/Jenny.JPG
Here's my son, Jeff, at the Moab MUni Fest, summer 2001:
http://www.Cotse.NET/users/jeffrelf/JR.JPG
Here's my ex, Janeen, at the Moab MUni Fest, summer 2001:
http://www.Cotse.NET/users/jeffrelf/Janeen.JPG
..+.+.+
Here are my style sheet overrides for Moz FireFox 1.0,
userChrome.CSS and userContent.CSS:
http://www.Cotse.NET/users/jeffrelf/userContent.CSS
http://www.Cotse.NET/users/jeffrelf/userChrome.CSS
They make pages look like this:
http://www.Cotse.NET/users/jeffrelf/CSS.PNG
..+.+.+
Here is my HTML to TXT converter:
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.EXE
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.CPP
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.VCPROJ
If, for example, you pass it a file named index.HTM ,
it creates a file called index.TXT .
..+.+.+
Here is my CPU/hard_disk benchmarker:
http://www.Cotse.NET/users/jeffrelf/Tom.EXE
http://www.Cotse.NET/users/jeffrelf/Tom.CPP
http://www.Cotse.NET/users/jeffrelf/Tom.VCPROJ
( Tom is someone I met in Comp.OS.Linux.Advocacy )
For example, if you run Tom.EXE, you'll see that a 1.7 GHz Vaio notebook,
with a Centrino and 2 megs of L2 cache, is much faster than my
cheap Compaq Presario desktop with 2.7 GHz,
256 RAM, 128K L2 cache, 8 megs of actual VRAM ( 64 by emulation )
6 USB ports, at least 6 audio jacks, and a 40 gig hard disk.
( It cost 229 USD after rebates... a close out )

A lower clock rate is very desirable for notebooks
as it has little effect on actual performacne
and the power consumed rises with the square of the clock rate.

Tom.EXE can test both the the speed of your CPU/cache while task-switching
as well as the speed of your hard disk while swaping out to virtual memory.
You run it in a DOS shell,
passing it how many threads you want it to simultaneously hold.
If you don't pass a parameter it will create as many simultaneous threads
as possible, thereby invoking all of your virtual memory
( making the swap file very active for about 3-7 minutes ).

These are the numbers I get on my box:
&gt;&gt;&gt; Tom 2000
2,000 Simultaneous threads acheived.
58.7 Seconds per 100,000 simultaneously spawned/completed.
&gt;&gt;&gt; Tom
14,032 Simultaneous threads acheived.
17.3 Minutes per 100,000 simultaneously spawned/completed.

The 100,000 simultaneous threads standard refers to
a conversation Ingo Molnar had with Linus Torvalds
( see ).
..+.+.+
Here's X, my hand-rolled newsreader, Dialer, SMTP-AUTH and POP3 client:
X's settings are here:
http://www.Cotse.NET/users/jeffrelf/X.TXT
The .EXE file ( for MS_Win_XP ):
http://www.Cotse.NET/users/jeffrelf/X.EXE
The .CPP file ( MS_VC_7.1 ):
http://www.Cotse.NET/users/jeffrelf/X.CPP
The next two files are optional.
This contains my project settings ( VS.NET 2003, Microsoft C++ 7.1 )
( you can edit it with notepad to change the directories used ):
http://www.Cotse.NET/users/jeffrelf/X.VCPROJ
This is just X's icon:
http://www.Cotse.NET/users/jeffrelf/X.RES

I use X a lot, it's the only newsreader I use.
I never have to screw around with views or sorting
because my X ( in VS.NET ) allows me to slickly/quickly search
the full text of a newsgroup in one file.

Cola.TXT ( Comp.OS.Linux.Advocacy ) is a 3.8 MB example of that:
http://www.Cotse.NET/users/jeffrelf/Cola.TXT
This is what Cola.TXT looks like when browsing it in VS.NET:
http://www.Cotse.NET/users/jeffrelf/Cola_TXT.PNG
X is using Bit_Stream.TTF, a good monospaced font ( free ):
http://www.Cotse.NET/users/jeffrelf/Bit_Stream.TTF

X automatically excludes second-level quoting ( i.e. the " &gt; &gt; " )
HTML, PGP sigs, and other spam.

I have that newsgroup set up tp retain 2,000 unread articles,
800 read articles that were from/to me
( up to 5 levels away, per the Referencs header ),
and 200 read ( a.k.a. " Deleted " ) articles not To/From me.

A VBA macro assigned to F1 ( and a toolbar icon )
in Visual studio.NET appears to delete an article
but actually moves it to the end of the file
and prefixes it with the word " Deleted ".
X's VBA macros for VS.NET 2003:
http://www.Cotse.NET/users/jeffrelf/X.VB

Then, when X.EXE updates Cola.TXT the articles are sorted like this:
1. To/From Me Unread. Most recent First ( as found on the server ).
2. Unread not To/From Me. Most recent First.
3. Deleted not To/From Me. Most recent Last.
4. To/From Me Deleted. Most recent Last.

Although I plan on adding an editor to X,
it currently works best with VS.NET .
In VS, proper updating/viewing of In.TXT and Cola.TXT
requires that these two boxes be checked
in VS's Options --&gt; Environment --&gt; Documents:
1. Detect when file is changed outside the environment.
2. Auto-load changes
( if not not currently modified inside the environment ).

X's update to Cola.TXT is an element in VS' undo/redo list,
so you have to be careful when undoing things.
The update produces a report like this in X:
1 FromMe, 5 ToMe, 55 New.
1,987 UnRead, 500 Read, 500 Read FromTos.

The 5 most recent MIDs from the References header ( youngest first )
are tagged ( e.g. AAE__ ) for quicker/slicker searching in VS.NET:
One click on one of my toolbar's up/down arrows
finds what's under the text cursor ( repeatedly so, of course ).
Another pair of arrows only repeats the last search, up or down.

An article from a newsgroup begins something like this:
.+.+.+
Comp.OS.Linux.Advocacy
[email protected]
AAW__cZlsd.509206$D%.175553@attbi_s51
(e-mail address removed)
ABH__Z%isd.508650$D%.378252@attbi_s51 .
Re: Firefox stability
John_Bailo ( 4, 11.39 A, rVH4W _BP7FiP D Earthlink.NET, KNode_0_7_7 ),
This is the second line of the article's body.

X.CPP also handles SMTP-AUTH ( which works from anyone's LAN ).
Just put what you want to e-mail in the cut buffer
( the Del_Art VBA script, assigned to a toolbar icon,
does that automatically for me ).
The format of the e-mail must be like this:
.+.+.+
Jack Black &lt;[email protected]&gt;
Jane Peters &lt;[email protected]&gt;
Albert &lt;[email protected]&gt; .
Re: This is the title.
Hi Jack ( and Jane, Albert ), Blah blah.
.+.+.+

When sending e-mails to multiple people,
the second address must be indeneted with exactly two spaces
and the last addess must end with a Space_Space_Dot .

Hit E-Mail in X's toolbar to send it.
Hitting In checks your POP3 account for e-mail,
appending your e-mails to the end of In.TXT .

Attachements are automatically placed in the shortcut's directory.
X will not send attachments
( because I prefer to use links to my web site instead ).
..+.+.+
This link shows a .CPP to .HTML converter with syntax highlighting,
I didn't wrap it in a main() because I call it from WinMain()
( too complex to show here ):
http://Google.COM/[email protected]
..+.+.+
Here's my Games.EXE program:
http://www.Cotse.NET/users/jeffrelf/Games.EXE
There's no help file.
It makes heavy use of my trackball ( wheel, 5 buttons ).
e.g. For quick exiting,
One of my buttons is set to Cntrl-F4 ( Close window ).
Games.EXE plays a kind of Random_Chess, Rapid Monopoly,
Random_Mario_Brothers, Reversie, and Solitaire.
The chess game is always one player ( white ),
and it's designed to be very very mindless.
Pieces can be quickly added or removed.
By default you have no king... so you can't lose.
Source code:
http://www.Cotse.NET/users/jeffrelf/Games.CPP
Bitmaps:
http://www.Cotse.NET/users/jeffrelf/Games.RES
Project file ( VS.NET 2003, Microsoft C++ 7.1 ):
http://www.Cotse.NET/users/jeffrelf/Games.VCPROJ
..+.+.+
Here is my Dif.EXE program:
http://www.Cotse.NET/users/jeffrelf/Dif.EXE
It compares two plain-text files via a shortcut ( .LNK ), e.g.:
Dif.EXE AA.CPP BB.CPP
Hit escape or Cntrl-F4 to exit. Use the wheel to move lines.
Hold down the middle mouse button as you move the wheel
to page up and down.
The screen's output is sent to
a file called AA.TXT in the starting directory.
Source code:
http://www.Cotse.NET/users/jeffrelf/Dif.CPP
Project file ( VS.NET ):
http://www.Cotse.NET/users/jeffrelf/Dif.VCPROJ
..+.+.+
Here are some quotes from Einstein: &lt;&lt;

People like us, who believe in physics,
know that the distinction between past, present,
and future is only a stubbornly persistent illusion. &gt;&gt;, &lt;&lt;

every true theorist is a kind of tamed metaphysicist,
no matter how pure a ' positivist '
he may fancy himself.
[ ... He believes in ] a conceptual system built on
premises of great simplicity. &gt;&gt;, &lt;&lt;

But the scientist is possessed by
the sense of universal causation. The future, to him,
is every whit as necessary and determined as the past. &gt;&gt;, &lt;&lt;

A human being is a part of a whole,
called by us ' Universe ',
a part limited in time and space.
He experiences himself, his thoughts and feelings
as something separated from the rest ...
a kind of optical delusion of his consciousness. &gt;&gt;, &lt;&lt;

Everything is determined,
the beginning as well as the end,
by forces over which we have no control.
It is determined for the insects as well as the star.
Human beings, vegetables, or cosmic dust,
we all dance to a mysterious tune
intoned in the distance by an invisible piper. &gt;&gt;, &lt;&lt;

If [ God ] is omnipotent, then every occurrence,
including every human action, every human thought,
and Every human feeling and aspiration is also His work ;
how is it possible to think of holding men responsible for
their deeds and thoughts before such an almighty Being ?
In giving out punishment and rewards he would,
to a certain extent, be passing judgment on Himself.
How can this be combined with
the goodness and righteousness ascribed to Him ? &gt;&gt;, &lt;&lt;

The more a man is imbued with
the ordered regularity of all events
the firmer becomes his conviction that
there is no room left by the side of
this ordered regularity for causes of a different
[ ? Supernatural ] nature. &gt;&gt;

These quotes are from Stephen Hawking: &lt;&lt;

one has to find a consistent solution
of the equations of physics &gt;&gt;, &lt;&lt;

It would imply that we were completely determined:
we couldn't change our minds. So much for free will. &gt;&gt;, &lt;&lt;

In summary, the title of this essay was a question:
' Is everything determined ? '
The answer is yes, it is.
But it might as well not be,
because we can never know what is determined. &gt;&gt;, &lt;&lt;

The boundary condition of the universe
is that it has no boundary.
The universe would be completely self-contained
and not affected by anything outside itself.
It would neither be created nor destroyed.
It would just Be .
What place, then, for a creator ? &gt;&gt;, &lt;&lt;

In relativity, there is no real distinction between
the space and time coordinates, just as there is
no difference between two space coordinates. &gt;&gt;

Hermann Weyl, Einstein's colleague said:
" The world doesn't happen, it simply is. "

From http://www.newadvent.org/cathen/02053a.htm : &lt;&lt;

The theory of Democritus [ Athens, 460 - 370 BC ]
may be summed up in the following propositions :
- All bodies are composed of atoms
and spaces between the atoms. &gt;&gt;, &lt;&lt;
- There is no purpose or design in nature,
and in this sense all is ruled by chance.
[ Jeff Relf adds: " Chance " is a mysterious,
yet still absolute, material determinism ]
- All activity is reduced to local motion. &gt;&gt;

Hawking wrote:
http://www.GenerationTerrorists.COM/quotes/abhotswh.html
&lt;&lt; There are something like ten million million million
million million million million million million million
million million million million
( 1 with eighty zeroes after it ) particles
in the region of the universe that we can observe.
Where did they all come from ?
The answer is that, in quantum theory,
particles can be created out of energy
in the form of particle/antiparticle parts.
But that just raises the question of
where the energy came from.
The answer is that
the total energy of the universe is exactly zero.
The matter in the universe
is made out of positive energy.
However,
the matter is all attracting itself by gravity.
Two pieces of matter that
are close to each other have less energy than
the same two pieces a long way apart,
because you have to expend energy
to separate them against the gravitational
force that is pulling them together.
Thus in a sense,
the gravitational field has negative energy.
In the case of a universe that is
approximately uniform in space,
one can show that this negative gravitational energy
exactly cancels the positive energy
represented by the matter.
So the total energy of the universe is zero.
Now twice zero is also zero.
Thus the universe can
double the amount of positive matter energy
and also double the negative gravitational energy
without violation of the conservation of energy. &gt;&gt;, &lt;&lt;

It is said that there's no such thing as a free lunch.
But the universe is the ultimate free lunch. &gt;&gt;
 
J

Jeff_Relf

Hi Tom, You showed: << Regex.Replace ( htmlText,
@"<(?:/{1}|[a-zA-z]+|! +)[\s\S]*?>", string.Empty); >>

Parsing my homepage, the result should be like this:
http://www.Cotse.NET/users/jeffrelf/index.TXT

Giving me a link to a index.TXT, like that, instead of a dump,
would be kinder to the others here.

Re: The raw input:
http://www.Cotse.NET/users/jeffrelf/index.htm

Because you did a Save_Page_As, instead of an FTP download,
your copy of index.htm is Radically different from mine,
for example, contrary to what you showed, my copy says this:

http://Google.COM/groups?as_uauthors=Jeff_Relf&scoring=d</a>
and future is only a stubbornly persistent illusion. >>, <<

Here are some translations you haven't made: <<
http://Google.COM/groups?as_uauthors=Jeff_Relf&amp;scoring=d
Jack Black &lt;[email protected]&gt;
and future is only a stubbornly persistent illusion. &gt;&gt;, &lt;&lt; >>

&amp; becomes simply &, for example, likewise:
lt < gt > amp & quot " apos '

( hex ) and ( octal ) all become a space, ascii 32.
For simplicity's sake, I don't translate &# numbers greater than 255.
A RegEx_Search_and_Replace won't do it.

Another thing my HTM_TXT.EXE does is remove lines that contained only tags,
because HTML_Only e-mail from Hotmail.COM contains many lines of just tags,
Again, a RegEx_Search_and_Replace won't do it.

For example, all of these lines would be deleted:
<HTML>
<HEAD>
<style type=3D'text/css'>
</style>
</HEAD>
<BODY>
<TABLE>
</TABLE>
</BODY>
</HTML>

Of course, I know what you're going to say, RegEx is good enough,
....but it's just not good enough for me.
 
M

Mogul

Jeff_Relf said:
Hi Tom, You showed: << Regex.Replace ( htmlText,
@"<(?:/{1}|[a-zA-z]+|! +)[\s\S]*?>", string.Empty); >>

Why not just put the text into a WebRequest and then show the resulting
text, since any HTML browser will "remove the tags" already.
 
J

Jeff_Relf

Hi Mogul, Re: Converting HTML to plain_text,

You asked me: << Why not just put the text into a WebRequest
and then show the resulting text,
since any HTML browser will remove the tags already. >>

What ? You mean use COM to automate IE ?
That's very low_rent, I don't normally run IE,
I don't want to wait for it to load,
and I don't want to worry about IE zombies floating around.
 
M

Mogul

Mogul said:
Jeff_Relf said:
Hi Tom, You showed: << Regex.Replace ( htmlText,
@"<(?:/{1}|[a-zA-z]+|! +)[\s\S]*?>", string.Empty); >>


Why not just put the text into a WebRequest and then show the resulting
text, since any HTML browser will "remove the tags" already.


http://www.developer.com/net/csharp/article.php/10918_2230091_1

Parsing HTML in Microsoft C#
By Jeff Heaton


Because of this, I found it necessary to write my own HTML parser. In
this article, I will show you how my HTML parser was constructed, and
how you can use this parser with your own applications. I will begin by
showing you the main components that make up the HTML parser. I will
conclude this article by showing a simple example that uses the HTML parser.

The HTML parser consists of the following four classes:

* Attribute—The attribute class is used to hold an individual
attribute inside an HTML tag.
* AttributeList—The attribute list holds an individual HTML tag and
all of its attributes.
* Parse—Holds general text parsing routines.
* ParseHTML—The main class that you will interface with; the
ParseHTML class is fed the HTML that you would like to parse.

I will now show you how each of these classes functions, and how you
will use them. I will begin with the Attribute class.
 
M

Mogul

Jeff_Relf said:
Hi Mogul, Re:
http://www.developer.com/net/csharp/article.php/10918_2230091_1
<< The HTML parser consists of the following four classes... >>

That's overkill in my book.
First Tom wants to do a RegEx_Search_and_Replace, which is too weak for me,
and now you want to add a bunch of classes,
...sheesh, where's the middle ground ?

Bottom line: I can take those classes and manipulate the HTML -- live
from the Web -- to do almost anything.
 
T

Tom Shelton

Hi Tom, You showed: << Regex.Replace ( htmlText,
@"<(?:/{1}|[a-zA-z]+|! +)[\s\S]*?>", string.Empty); >>

Parsing my homepage, the result should be like this:
http://www.Cotse.NET/users/jeffrelf/index.TXT

Giving me a link to a index.TXT, like that, instead of a dump,
would be kinder to the others here.

Yeah... I realized that after I posted. Sorry.
Re: The raw input:
http://www.Cotse.NET/users/jeffrelf/index.htm

Because you did a Save_Page_As, instead of an FTP download,
your copy of index.htm is Radically different from mine,
for example, contrary to what you showed, my copy says this:

http://Google.COM/groups?as_uauthors=Jeff_Relf&scoring=d</a>
and future is only a stubbornly persistent illusion. >>, <<

Ok? So? I can do that if you want.
Here are some translations you haven't made: <<
http://Google.COM/groups?as_uauthors=Jeff_Relf&amp;scoring=d
Jack Black &lt;[email protected]&gt;
and future is only a stubbornly persistent illusion. &gt;&gt;, &lt;&lt; >>

I didn't do entity translations... I asked you if that is what you
wanted. Apparently, yes. Easy to do - but, I find this whole thing
pointless, so I doubt I'll do it.

I only did the other since I had about 10 minutes to spare.
&amp; becomes simply &, for example, likewise:
lt < gt > amp & quot " apos '

( hex ) and ( octal ) all become a space, ascii 32.
For simplicity's sake, I don't translate &# numbers greater than 255.
A RegEx_Search_and_Replace won't do it.

Ahh, yes it will.
Another thing my HTM_TXT.EXE does is remove lines that contained only tags,
because HTML_Only e-mail from Hotmail.COM contains many lines of just tags,
Again, a RegEx_Search_and_Replace won't do it.

Ahhh, yes it will.
For example, all of these lines would be deleted:
<HTML>
<HEAD>
<style type=3D'text/css'>
</style>
</HEAD>
<BODY>
<TABLE>
</TABLE>
</BODY>
</HTML>

Of course, I know what you're going to say, RegEx is good enough,
...but it's just not good enough for me.

fine.
 
J

Jeff_Relf

Hi Tom_Shelton, You showed me five things,

1. You can do a simple RegEx_Search_and_Replace.
2. Like Kelsey, You can't remove lines with just tags.
3. Like Kelsey, You can't handle cases like and
4. Like Kelsey, You couldn't do a decent job of translating my home page.
( to say nothing of translating HTML_Only e-mails )
5. Unlike Kelsey, You can't ftp my page.
 
M

Mogul

Jeff_Relf said:
Hi Tom_Shelton, You showed me five things,

1. You can do a simple RegEx_Search_and_Replace.
2. Like Kelsey, You can't remove lines with just tags.
3. Like Kelsey, You can't handle cases like and
4. Like Kelsey, You couldn't do a decent job of translating my home page.
( to say nothing of translating HTML_Only e-mails )
5. Unlike Kelsey, You can't ftp my page.


http://www.codeproject.com/asp/removehtml.asp
Removing HTML from the text in ASP
 
J

Jeff_Relf

Hi Mogul ( Bailo and Tom_Shelton ), Re:
http://www.developer.com/net/csharp/article.php/10918_2230091_1
<< The HTML parser consists of the following four classes... >>

You told me: << Bottom line:
I can take those classes and manipulate the HTML
-- live from the Web -- to do almost anything. >>

Reeeally... Prove it, translate this
( Download it by: View_Source --> File --> Save_Page_As ):
http://www.Cotse.NET/users/jeffrelf/index.htm
to produce something as good as this:
http://www.Cotse.NET/users/jeffrelf/index.TXT

Here's a Much tougher test file for you, AA.HTM:
http://www.Cotse.NET/users/jeffrelf/AA.HTM
Notice how HTM_TXT.EXE removed the lines with just whitespace and tags:
http://www.Cotse.NET/users/jeffrelf/AA.TXT

http://www.Cotse.NET/users/jeffrelf/HTM_TXT.EXE
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.CPP
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.VCPROJ
 
J

Jeff_Relf

Hi Mogul ( Bailo and Tom_Shelton, Kelsey, Spooky ), Re:
Shelton being unable to handle chevrons, >, quoted inside tags,
or remove lines with just whitespace and tags,
or translate tags like and ,
....Even though he claims he could do it with one hand tied behind his back,

You showed this link: << Removing HTML from the text in ASP >>
http://www.codeproject.com/asp/removehtml.asp

Reeeally... Prove it then, translate this: AA.HTM:
http://www.Cotse.NET/users/jeffrelf/AA.HTM

Notice how, in my result, AA.TXT,
HTM_TXT.EXE handled chevrons, >, quoted inside tags,
and removed lines with just whitespace and tags:
http://www.Cotse.NET/users/jeffrelf/AA.TXT

http://www.Cotse.NET/users/jeffrelf/HTM_TXT.EXE
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.CPP
http://www.Cotse.NET/users/jeffrelf/HTM_TXT.VCPROJ

And remember, HTM_TXT.CPP simply demos 38 lines of code in X.CPP,
it's not as trivial as Shelton's RegEx_Search_and_Replace
nor is it as complicated as your Big_Ass SourceForge project:
http://www.Cotse.NET/users/jeffrelf/X.EXE
http://www.Cotse.NET/users/jeffrelf/X.CPP
http://www.Cotse.NET/users/jeffrelf/X.VCPROJ

Long live #define, long live LoopTo(), death to C# !

#define LoopTo( StopCond ) \
while ( Ch && ( Ch = ( uchar ) * ++ P ) \
&& ! ( Ch2 = ( uchar ) P [ 1 ], StopCond ) )
 
M

Mogul

Jeff_Relf said:
Hi Mogul ( Bailo and Tom_Shelton, Kelsey, Spooky ), Re:
Shelton being unable to handle chevrons, >, quoted inside tags,
or remove lines with just whitespace and tags,
or translate tags like and ,

Jeff,

Your arguments are pointless.

In the worse case, c# can implement your code structure as is.

In other cases, we're merely showing you models that may achieve what
you are doing more efficiently.
 
J

Jeff_Relf

Hi Mogul, Re: Shelton and Kelsey being unable to match my code,

You told me: << Your arguments are pointless.
In the worse case, c# can implement your code structure as is.
In other cases, we're merely showing you models that
may achieve what you are doing more efficiently. >>

C# can Not implement my code as is, because it has no #define,
( nor memmove(), natively ).

Kelsey and Shelton claim to have superior methods, e.g. RegEx, String, STL.
Yet they can't match the 38 lines of X.CPP code I demo in HTM_TXT.CPP

The challenge is simple, given AA.HTM, View_Source --> File --> Save_Page_As
http://www.Cotse.NET/users/jeffrelf/AA.HTM
Produce a result this good or better:
http://www.Cotse.NET/users/jeffrelf/AA.TXT

That means handling <> chevrons quoted inside tags,
removing lines with just whitespace and tags,
and preserving blank lines that didn't have tags, i.e. preserving whitespace.
 
M

Mogul

M

Mogul

Jeff_Relf said:
That means handling <> chevrons quoted inside tags,
removing lines with just whitespace and tags,
and preserving blank lines that didn't have tags, i.e. preserving whitespace.

The bottom line is that any of the other designs are far more flexible
in adding these addtional requirements.

Yes, anyone can code a very optimized program to do one very specific thing.

But it's hard to build a program flexible enough to handle more and more
cases and requirements.

In the case of using Regex for this problem, it's far easier to provide
a system that allows the passing in a regex string as needs change.

All you ( Relf ) do is say:

"Oh, but c# can't do x".

Then it's shown that yes, it can't do x.

Then you say "oh, I meant x(2)". and so on.

The bottom line is:

Q: can c# implement a fast, flexible string parser in seven easy steps,
with far more robustness than whatever it is your doing?

A: YES!!!!!
 
J

Jeff_Relf

Hi Mogul, Re: This link of yours: << C# Programmer's Reference
#define lets you define a symbol, such that,
by using the symbol as the expression passed to the #if directive,
the expression will evaluate to true. >>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfdefine.asp

Get serious, for once, Bailo: <<
While the compiler does not have a separate preprocessor,
the directives described in this section are processed as if there was one;
these directives are used to aid in conditional compilation.
Unlike C and C++ directives,
you cannot use these directives to create macros. >>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfdefine.asp
 
M

Mogul

Jeff_Relf said:
Hi Mogul, Re: This link of yours: << C# Programmer's Reference
#define lets you define a symbol, such that,
by using the symbol as the expression passed to the #if directive,
the expression will evaluate to true. >>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfdefine.asp

Get serious, for once, Bailo: <<
While the compiler does not have a separate preprocessor,
the directives described in this section are processed as if there was one;
these directives are used to aid in conditional compilation.
Unlike C and C++ directives,
you cannot use these directives to create macros. >>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfdefine.asp



http://www.codeproject.com/csharp/prepro.asp

The Code Project - A Macro Preprocessor in C# - C# Programming
This library supplies the same macro substitution facilities as the
C/C++ preprocessor.
 
Top