Re: [techtalk] switch function in C (or how to read commandline args?)

2001-07-05 Thread Conor Daly

On Thu, Jul 05, 2001 at 04:06:57PM +1200 or so it is rumoured hereabouts, 
Penguina thought:
> 
> 
> 
> "Tokenizing" is the right term.
> 
> My response was to CD's token defs
> 
> >CD>So, I can do something like:
> >CD>
> >CD>#define FORCE_SWITCH "--force"
> >CD>#define CONFIG_SWITCH "-C"
> >CD>
> >CD>and so on?
> 
> > [EMAIL PROTECTED] said:
> >P> No.
> 
> CD asked "Can I do X" this is P answering "No" to CD.
> But P (me) wasn't entirely correct, musta been...tokin'

So I guess, as Almut said, we need some kinda... hash?

> >P> What this will accomplish is setting the constants
> >P> to be strings, which will then require slow strcmp
> >P> processing as above.  When you tokenize something,
> >P> you come up with a unique *numerical* constant to
> >P> represent a particular string.  You can also have
> >P> several different strings parse to the same token.
> >P> So I could say
> >P> #define HOLA   23
> >P> #define HELLO  23
> >P> #define AMIGO  24
> >P> #define FRIEND 24
> 
> On Wed, 4 Jul 2001, Jeff Dike wrote:
> J> Exactly, that's what I meant.  I should have been more clear about that.
> J> Also, "tokenizing" might be the wrong term, but I don't know of a better one
> J> offhand.
> 
> But actually a token doesn't necessarily need to be a number.
> It's just a lot clearer what's going on when numbers are used,
> and they're faster and easier to perform operations on.
> 
> Technically, there's nothing wrong with Conor's defining
> literal string tokens as above (if she doesn't mind processing
> them as such) but they wouldn't work in the following context:
> 
> >> >CD>
> case FORCE_SWTICH:
> force=1;
> break;
> case CONFIG_SWITCH:
> strcpy(config_file_name, argv[2]);
> break;
> >CD> <<
> 
> in the above, had FORCE_SWITCH and CONFIG_SWITCH been tokenized
> as ints, it would be OK, but in this example, they're strings.
> 

So, the upshot is that to use a switch on string values, we need to use a
hash table to tokenise the strings.  After that, the switch works as:

switch(hash("String value")) {
case FORCE:
force=1;
break;
case CONFIG_SWITCH:
strcpy(config_file_name, "String Value");
break;

where hash("String value") returns the token (int) associated with 
"String value"


> Strings.  A Parable.
> 
> Three strings were walking down the road one day, and were very
> thirsty.  After being rejected from two watering-holes, the third
> string gets an idea.  He unravels all his strands and gets them in
> an enormous tangle.  They enter the third watering hole.  The
> publican looks down at them and says "You know, we don't serve
> strings here.  You wouldn't happen to be a string, would you?"
> 
> And the third string answers, "No.  I'm afraid not."

Hur Hur! 

Conor
-- 
Conor Daly <[EMAIL PROTECTED]>

Domestic Sysadmin :-)
-
Faenor.cod.ie
 11:20am  up 20 days, 11:37,  0 users,  load average: 0.08, 0.02, 0.01
Hobbiton.cod.ie
 11:28am  up 20 days, 11:46,  1 user,  load average: 0.06, 0.03, 0.01

___
techtalk mailing list
[EMAIL PROTECTED]
http://www.linux.org.uk/mailman/listinfo/techtalk



[techtalk] X issues

2001-07-05 Thread Michelle Murrain

Hi Folks,

I have an X problem (I always get nailed with X problems). I did a 
new Progeny Debian install (which uses XFree86 4.0, which detected my 
Video card - a 3D labs permedia, and, I guess is using that driver. 
XF86Config-4 has the right modes, horizontal and vertical refresh for 
the monitor (an LCD panel.)

The color once X is started (true of GNOME or KDE) is, well, off. The 
gradient background doesn't look right, the mouse is a wierd green 
color. About once every 4 times, X gives a blank white screen, and I 
have to ssh in and kill X.

So I think that the X driver I am using isn't the right one - but I'm 
not sure about how to go about fixing this - the generic VGA driver 
does not work.

Suggestions?

Michelle
-- 

Michelle Murrain
[EMAIL PROTECTED]

___
techtalk mailing list
[EMAIL PROTECTED]
http://www.linux.org.uk/mailman/listinfo/techtalk



Re: [techtalk] X issues

2001-07-05 Thread coldfire

> I have an X problem (I always get nailed with X problems). I did a 
> new Progeny Debian install (which uses XFree86 4.0, which detected my 
> Video card - a 3D labs permedia, and, I guess is using that driver. 
> XF86Config-4 has the right modes, horizontal and vertical refresh for 
> the monitor (an LCD panel.)

you're _certain_ that the horizontal and vertical refresh rates are set
correctly?  these can cause a real pain if not .. :)

> The color once X is started (true of GNOME or KDE) is, well, off. The 
> gradient background doesn't look right, the mouse is a wierd green 
> color. About once every 4 times, X gives a blank white screen, and I 
> have to ssh in and kill X.

now i'm not an X-pert .. but this sounds bad.

> So I think that the X driver I am using isn't the right one - but I'm 
> not sure about how to go about fixing this - the generic VGA driver 
> does not work.

as for trying the generic VGA driver, what exactly happens?  the same as
when you tried to use the driver for your video card?  or does X not even
launch?  grab us some logs from XFree86 .. maybe that'll help.  thanks



abe


___
techtalk mailing list
[EMAIL PROTECTED]
http://www.linux.org.uk/mailman/listinfo/techtalk



Re: [techtalk] X issues

2001-07-05 Thread Martin . Caitlyn


Hi, Michelle,

Are you sure the version is 4.0, as in the first 4?  If so buggy...
Seriously, try upgrading to either 4.0.3 or 4.1 and let us know if that
helped.

All the best,
Caity



___
techtalk mailing list
[EMAIL PROTECTED]
http://www.linux.org.uk/mailman/listinfo/techtalk



Re: [techtalk] X issues

2001-07-05 Thread Michelle Murrain

At 12:07 PM -0400 7/5/01, [EMAIL PROTECTED] wrote:
>Hi, Michelle,
>
>Are you sure the version is 4.0, as in the first 4?  If so buggy...
>Seriously, try upgrading to either 4.0.3 or 4.1 and let us know if that

Actually, it's a 4.0.2 package, but I'm going to upgrade the box to 
woody, since it's going through the freezing process. Woody is using 
4.03.

Michelle
-- 

Michelle Murrain
[EMAIL PROTECTED]

___
techtalk mailing list
[EMAIL PROTECTED]
http://www.linux.org.uk/mailman/listinfo/techtalk



Re: [techtalk] X issues

2001-07-05 Thread Michelle Murrain

At 12:04 PM -0400 7/5/01, coldfire wrote:
>  > I have an X problem (I always get nailed with X problems). I did a
>>  new Progeny Debian install (which uses XFree86 4.0, which detected my
>>  Video card - a 3D labs permedia, and, I guess is using that driver.
>>  XF86Config-4 has the right modes, horizontal and vertical refresh for
>>  the monitor (an LCD panel.)
>
>you're _certain_ that the horizontal and vertical refresh rates are set
>correctly?  these can cause a real pain if not .. :)

Yeah - I'm sure - checked with the manufacturer, and they match exactly.

>  > The color once X is started (true of GNOME or KDE) is, well, off. The
>>  gradient background doesn't look right, the mouse is a wierd green
>>  color. About once every 4 times, X gives a blank white screen, and I
>>  have to ssh in and kill X.
>
>now i'm not an X-pert .. but this sounds bad.
>
>>  So I think that the X driver I am using isn't the right one - but I'm
>>  not sure about how to go about fixing this - the generic VGA driver
>>  does not work.
>
>as for trying the generic VGA driver, what exactly happens?  the same as
>when you tried to use the driver for your video card?  or does X not even
>launch?  grab us some logs from XFree86 .. maybe that'll help.  thanks

It says it can't find any screens(?). Where are the logs? There's no 
detailed X info that I can find in syslog.

Thanks!

Michelle
-- 

Michelle Murrain
[EMAIL PROTECTED]

___
techtalk mailing list
[EMAIL PROTECTED]
http://www.linux.org.uk/mailman/listinfo/techtalk



[techtalk] Mutt functionality

2001-07-05 Thread Michelle Dukich

Hello all:

Okay, a while back I asked for recommendations for an
email client for Linux and the overwhelming favorite
was Mutt.  I am getting ready to download Mutt for my
friend and I who have a few serious issues we want to
address first.

1.  We tried to use Mahogany and slurped all our old
emails over to it.  It is COMPLETELY useless to search
for old messages by keyword which is a BIG need for
us.  From what I have read in Sven's Man pages, it is
indeed searchable.  Is this true?

2.  Can and how do we get all our emails from Mahogany
over to Mutt...with as little fuss and muss as
possible?

3.  Can we cut and paste text within and between
emails with Mutt?

Any pointers/suggestions anyone else can give are
greatly appreciated.  Thanks.

Michelle

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

___
techtalk mailing list
[EMAIL PROTECTED]
http://www.linux.org.uk/mailman/listinfo/techtalk



Re: [techtalk] Mutt functionality

2001-07-05 Thread Steph Donovan

On Thu, Jul 05, 2001 at 10:57:43AM -0700, Michelle Dukich wrote:
> Hello all:
> 
> Okay, a while back I asked for recommendations for an
> email client for Linux and the overwhelming favorite
> was Mutt.  I am getting ready to download Mutt for my
> friend and I who have a few serious issues we want to
> address first.
> 
> 1.  We tried to use Mahogany and slurped all our old
> emails over to it.  It is COMPLETELY useless to search
> for old messages by keyword which is a BIG need for
> us.  From what I have read in Sven's Man pages, it is
> indeed searchable.  Is this true?
> 
> 2.  Can and how do we get all our emails from Mahogany
> over to Mutt...with as little fuss and muss as
> possible?
> 
> 3.  Can we cut and paste text within and between
> emails with Mutt?
> 
> Any pointers/suggestions anyone else can give are
> greatly appreciated.  Thanks.
 
Go read Telsa's Mail Tinkering page, lots of handy stuff in there.
http://www.linux.org.uk/~telsa/BitsAndPieces/cave.html

> Michelle

Steph

-- 
Steph Donovan, Ottawa Linux Symposium, http://www.linuxsymposium.org
613-688-0707 (voice) -- 613-688-0708 (fax)
200-139 Bank Street, Ottawa, Ontario  K1P 5N7 

+--+
"Underneath every Cynic is a disappointed Idealist."
- George Carlin

 PGP signature


Re: [techtalk] X issues

2001-07-05 Thread ktb

On Thu, Jul 05, 2001 at 01:53:51PM -0400, Michelle Murrain wrote:
> At 12:04 PM -0400 7/5/01, coldfire wrote:
> >  > I have an X problem (I always get nailed with X problems). I did a
> >>  new Progeny Debian install (which uses XFree86 4.0, which detected my
> >>  Video card - a 3D labs permedia, and, I guess is using that driver.
> >>  XF86Config-4 has the right modes, horizontal and vertical refresh for
> >>  the monitor (an LCD panel.)
> >
> >you're _certain_ that the horizontal and vertical refresh rates are set
> >correctly?  these can cause a real pain if not .. :)
> 
> Yeah - I'm sure - checked with the manufacturer, and they match exactly.
> 
> >  > The color once X is started (true of GNOME or KDE) is, well, off. The
> >>  gradient background doesn't look right, the mouse is a wierd green
> >>  color. About once every 4 times, X gives a blank white screen, and I
> >>  have to ssh in and kill X.
> >
> >now i'm not an X-pert .. but this sounds bad.
> >
> >>  So I think that the X driver I am using isn't the right one - but I'm
> >>  not sure about how to go about fixing this - the generic VGA driver
> >>  does not work.
> >
> >as for trying the generic VGA driver, what exactly happens?  the same as
> >when you tried to use the driver for your video card?  or does X not even
> >launch?  grab us some logs from XFree86 .. maybe that'll help.  thanks
> 
> It says it can't find any screens(?). Where are the logs? There's no 
> detailed X info that I can find in syslog.

Start X from the command line like so -
$ startx > X.out 2>&1
or to just view the output of X -
$ X > X.out 2>&1 

This will create a log file X.out you can view.

You might also want to try reconfiguring X with -
dpkg-reconfigure xserver-xfree86
hth,
kent

-- 
 From seeing and seeing the seeing has become so exhausted
 First line of "The Panther" - R. M. Rilke



___
techtalk mailing list
[EMAIL PROTECTED]
http://www.linux.org.uk/mailman/listinfo/techtalk



Re: [techtalk] Mutt functionality

2001-07-05 Thread Arvid Warnecke

Hello Michelle,

On Thu, Jul 05, 2001 at 10:57:43AM -0700, Michelle Dukich wrote:
> 1.  We tried to use Mahogany and slurped all our old
> emails over to it.  It is COMPLETELY useless to search
> for old messages by keyword which is a BIG need for
> us.  From what I have read in Sven's Man pages, it is
> indeed searchable.  Is this true?
> 
You can search your mails by keywords, I use that very often coz there
are many mailinglists and often I remember when I have some trouble that
I already read about it somewhere.

> 2.  Can and how do we get all our emails from Mahogany
> over to Mutt...with as little fuss and muss as
> possible?
> 
Never heard of Mahogany...so what type of mailboxes does it use?

> 3.  Can we cut and paste text within and between
> emails with Mutt?
> 
What editor do you plan to use for that?
Normaly the editor appears in the same terminal mutt is in, so you can't
take a look at other mails then, but only on that one -quoted- you are
going to reply to. BUT you can open another mutt in another terminal if
you like to or maybe you can change the editor command to make it open
in a new terminal. That shouldn't be much trouble, but I already never
tried. OR you can quit the editor and get back to mutt and press 'q',
then it will ask to hold the message back. When you press 'm' for new
mail you will be able to finish the mail you begun.

Hope that helps a little, but you'll see: mutt rocks ;-)

Regards,
Arvid

-- 
 .''`. [Arvid Warnecke] [[EMAIL PROTECTED]] [05323-715724]
: :' : [ICQ 55906559] [ http://up.to/suck ] [PGP-Subject:"get pgp key"]
`. `'  Linux 2.4.2 i686  XFree86 Version 4.0.2  Uptime: 9 days, 9:34
  `--  BOFH #407: Route flapping at the NAP.

 PGP signature


Re: [techtalk] Mutt functionality

2001-07-05 Thread Telsa Gwynne

On Thu, Jul 05, 2001 at 10:57:43AM -0700 or thereabouts, Michelle Dukich wrote:
> 1.  We tried to use Mahogany and slurped all our old
> emails over to it.  It is COMPLETELY useless to search
> for old messages by keyword which is a BIG need for
> us.  From what I have read in Sven's Man pages, it is
> indeed searchable.  Is this true?

Searchable by the standard commandline tools 
(grep thing Mail/receive*) or by a keybinding which is 
usually escape-V (or do I mean escape-B? I forget :)) 
to search for a pattern in the bodies of all messages 
in the folder you're in. 

> 2.  Can and how do we get all our emails from Mahogany
> over to Mutt...with as little fuss and muss as
> possible?

I have been looking at the Mahogany web page but it doesn't
seem to say anything about mail formats. "slurped all our
old emails" to it makes it sound like it uses a different
format from whatever you last used, but I can't find out
what mahogany uses. 

> 3.  Can we cut and paste text within and between
> emails with Mutt?

Well, you can run two mutts open on different messages
and cut and paste like that. 

> Any pointers/suggestions anyone else can give are
> greatly appreciated.  Thanks.

Only thing I can think of is that mahogany is GUI, I believe? 
Mutt is firmly, adamantly, text-based. It will do things like
display pics if you tell it to, but it assumes you may be
reading on a console so it won't do that by default. (It
tells you the attachment is present, and you can either
open them on a "as you meet them" basis, or you can set it
up always to open certain sorts.

Telsa

___
techtalk mailing list
[EMAIL PROTECTED]
http://www.linux.org.uk/mailman/listinfo/techtalk



Re: [techtalk] X issues

2001-07-05 Thread coldfire

> Start X from the command line like so -
> $ startx > X.out 2>&1
> or to just view the output of X -
> $ X > X.out 2>&1 

by default, X dumps logs to /var/log/XFree86.0.log ... it should mention
that if you get the error "Fatal: No Screens Found" ..

abe


___
techtalk mailing list
[EMAIL PROTECTED]
http://www.linux.org.uk/mailman/listinfo/techtalk