Linux-Development-Apps Digest #401, Volume #6     Sun, 5 Mar 00 18:13:19 EST

Contents:
  Re: Very stupid newbie question (Wolfgang Sourdeau)
  Re: Idle time (fvw)
  Re: Idle time (fvw)
  Re: I can't stand this X anymore! (Darren Winsper)
  Re: I can't stand this X anymore! (Donovan Rebbechi)
  Re: editor (Len Philpot)
  Re: I can't stand this X anymore! (Donovan Rebbechi)
  Re: How to catch SIGKILL signal? (Mark Hamstra)
  which ODBC or other API for Linux ([EMAIL PROTECTED])
  Re: How to catch SIGKILL signal? ([EMAIL PROTECTED])
  Re: Interfacing With A Doorbell ("Ross Crawford")
  Re: Linux/Windows (Stefan Rieken)
  Re: Idle time (Francesco 'Kinkie' Chemolli)
  Re: I can't stand this X anymore! ([EMAIL PROTECTED])
  Re: How to safely interrupt select() ? ([EMAIL PROTECTED])
  Re: problems running ./configure ([EMAIL PROTECTED])

----------------------------------------------------------------------------

From: Wolfgang Sourdeau <[EMAIL PROTECTED]>
Subject: Re: Very stupid newbie question
Date: Sun, 05 Mar 2000 19:11:58 GMT

On Fri, 3 Mar 2000, NotGeop wrote:

> I am learning C, and I have made a simple program.  for the purposes of
> this question, let's call it hello.  I make it with gcc, and get no compile
> errors (# gcc -o hello hello.C) (can't remember if it was capital c or not,
> but i was right k??)  I try to run it.  Bash can't find the command.  I
> look around some help files, and it seems that it has to be "enabled".  How
> do I do this.  btw, the file permissions are -rwxr-xr-x.  Can anyone help
> please??
> 
> any help is much appreciated.
> 
> thanks, James.
> 
What's happening when you try ./hello?
Btw, .C files are normally C++ whereas .c files are plain C.

W


------------------------------

From: [EMAIL PROTECTED] (fvw)
Subject: Re: Idle time
Reply-To: [EMAIL PROTECTED]
Date: Sun, 05 Mar 2000 20:07:02 GMT

In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:
>Say I have a bit of code like this:
>
>while (something_hasnt_happened_yet)
>{
> //...Idle...
>}
>
>Is there a function I can put inside the idle loop that will return the
>processor control back to the kernel?  If I can do this, what's the
>longest time my program will have to wait for the processor again?

Try sleep or usleep. See the manpages. You can choose how long it sleeps.

-- 

                        Frank v Waveren
                        [EMAIL PROTECTED]
                        ICQ# 10074100

------------------------------

From: [EMAIL PROTECTED] (fvw)
Subject: Re: Idle time
Reply-To: [EMAIL PROTECTED]
Date: Sun, 05 Mar 2000 20:07:45 GMT

In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:
>Hi,
>Say I have a bit of code like this:
>
>while (something_hasnt_happened_yet)
>{
> //...Idle...
>}
>
>Is there a function I can put inside the idle loop that will return the
>processor control back to the kernel?  If I can do this, what's the
>longest time my program will have to wait for the processor again?

BTW, often it's much easier (and uses less cpu time) to use select... See 
the manpages for that too...

-- 

                        Frank v Waveren
                        [EMAIL PROTECTED]
                        ICQ# 10074100

------------------------------

From: [EMAIL PROTECTED] (Darren Winsper)
Crossposted-To: comp.os.linux.x,comp.os.linux.advocacy
Subject: Re: I can't stand this X anymore!
Date: 6 Mar 2000 04:49:43 GMT

On Fri, 03 Mar 2000 23:52:12 GMT, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:

> X looks like crap no matter what you do to it.

That's like saying art looks like crap no matter what it is.

> Installing pirated True-type
> fonts from Windows helps, but it still lacks the smoothness that Windows
> has and even more so that Mac has.

Considering Windows has a worse font engine than that which RISC OS 2
had, it's still crap.

> When I have to look at a screen all day, especially a 19inch state of the
> art monitor/video card combination it better look good. X hurts my eyes and
> while the themes are nice the meat and potatoes (the applications) look
> horrible in my opinion.

That makes no sense.  If you install a Gtk theme, all Gtk applications
take up that theme.  To say the theme looks nice but then the
application doesn't is a rather odd statement.

> >Besides, the font on X windows are so bad, it wastes display resource. Why,
> >because it need more pixels to achieve the same result.
> 
> It also seem sluggish to me, even running a Matrox G400. Dragging Windows
> around produces "shadows" and remanent's of destroyed Windows. Sucks if you
> ask me.

Is this a known bug?  Driver bugs should not be blamed on X.

> It lacks crispness. I am talking about
> kde/Windowmaker/Enlightenment and worst of all Gnome/Enlightenment.

Gnome, with a decent theme looks much nicer than Windows IMHO.

> See the above. Putting Linux side by side with other OS's is a real joke as
> far as display is concerned. Sure the themes look nice but what happens
> when you launch the applications?
> Boxy, fuzzy and generally cheap looking.

Fuzzy?  Boxy?  Would you care to post screenshots?

-- 
Darren Winsper (El Capitano) - ICQ #8899775
Stellar Legacy project member - http://www.stellarlegacy.tsx.org

DVD boycotts.  Are you doing your part?
"Microsoft is estimating that 28,000 of these [bugs] are likely to be 'real'
 problems [in Windows2000]."
-http://www.zdnet.com/zdnn/stories/news/0,4586,2436920,00.html?chkpt=zdhpnews01

------------------------------

From: [EMAIL PROTECTED] (Donovan Rebbechi)
Crossposted-To: comp.os.linux.x,comp.os.linux.advocacy
Subject: Re: I can't stand this X anymore!
Date: 5 Mar 2000 20:56:22 GMT

On Fri, 03 Mar 2000 23:52:12 GMT, [EMAIL PROTECTED] wrote:
>On Fri, 03 Mar 2000 23:39:25 GMT, Michael Gu <[EMAIL PROTECTED]> wrote:

>X looks like crap no matter what you do to it. Installing pirated True-type
>fonts from Windows helps, 

What do you mean by "pirated" ? 

(*)     It's not that simple to define "pirated" when you talk about fonts. 
        Most of the fonts that you get on those "zillion fonts" CDs are pirated
        in some sense

(*)     The "standard" Microsoft TrueType fonts are publically available from
        Microsoft.com

(*)     Most application software does not tell you that you can't use the 
        fonts on more than one platform ( especially if it's the same 
        computer ! )

In conclusion, there are much worse things you can do regarding fonts 
( both legally and ethically ) than use licensed fonts on your Windows 
platform on Linux.

Font antialiasing would be nice admittedly. However, there is more to 
life than font smoothing.

-- 
Donovan

------------------------------

From: [EMAIL PROTECTED] (Len Philpot)
Subject: Re: editor
Reply-To: [EMAIL PROTECTED]
Date: Sun, 05 Mar 2000 20:57:16 GMT

On 04 Mar 2000 15:31:04 -0800, Michael Powe <[EMAIL PROTECTED]>
wrote:

>>There's nothing "intuitive" about vi, joe, jed, or pico.  I've never
>>used nedit, but I suspect that the same holds true there, as well.  I

For someone moving from the Mac or Windows, NEdit is probably the most
intuitive editor on *nix I've come across. I won't get into an argument
about the relative capabilities of editors, but NEdit outwardly
functions much like Mac and Windows editors. In fact, some of key
shortcuts for NEdit match Windows exactly (Ctrl+C, Ctrl+X, Ctrl+V for
copy, cut and paste).


>>I've only been using emacs about 2 and 1/2 years.  I've been using it
>>since about a month or so after I installed linux.  I am one who
>>migrated from Windows to linux and almost immediately started using
>>emacs -- first I tried vi: the horror! the horror!  Anyone who would
>>claim that vi is easier to learn than emacs needs to increase the neck
>>size of his shirt -- there's obviously a constriction preventing
>>blood-flow to the brain.  Pardon me if I express my opinion that your
>>opinion is, as the saying goes, "unencumbered by the thought process." 

At first I thought vi was more cryptic than emacs, but I changed my mind
after using it (vi) a while. Vim is vastly better than vanilla vi (on
Solaris, for example), but to me both are more straightforward than
emacs, when considered within their own "operating paradigm".


>>People can use what they want to use.  That doesn't bother me.  I've
>>encounted people who write code in notepad.  That's their choice --
>>let 'em.  Nonetheless, Emacs is a perfectly valid choice of editor for
>>anyone who wants and needs a powerful text editor -- be they
>>programmers or just plain writers.  And they don't have to wait for
>>some mythical elevation to the status of "expert" to get started
>>learning to use it.

True, and I agree. However, there's no denying that emacs presents a
formidable learning cliff to those wanting to become proficient at it.

 
 -------------------------------------------------------------
 - Len Philpot -> [EMAIL PROTECTED]           (personal)
 ---------------> [EMAIL PROTECTED]                 (work)
 ----- ><> -----> http://www.centuryinter.net/lphilpot/  (web)

------------------------------

From: [EMAIL PROTECTED] (Donovan Rebbechi)
Crossposted-To: comp.os.linux.x,comp.os.linux.advocacy
Subject: Re: I can't stand this X anymore!
Date: 5 Mar 2000 21:03:45 GMT

On Fri, 03 Mar 2000 23:39:25 GMT, Michael Gu wrote:

>Consider such a senario, a application like to create a area of a size just
>to fit in certain text. And the application does not want a dynamic sized
>area, because the area is part of a pixel based layout. Now, if the
>application does not know the exact size of the font, how can it achieve such
>a goal. I have seen countless applications that either have a botton that
>does not have all characters displayed, or the botton is truncated because it
>exceeds the frame border and all sorts of bad displays.

What toolkit was the app written in ? Sounds like a combination of bad code
and a bad toolkit.

>Besides, the font on X windows are so bad, it wastes display resource. Why,
>because it need more pixels to achieve the same result.

Not clear on what you're talking about. Are you complaining about TrueType,
Type1 or bitmap fonts ? Your complaint doesn't make any sense.

Actually, the biggest problem with X fonts is they *don't use enough 
resources* ie they insist on sticking to 1bpp rendering.

>So, I believe X need to include a basic set of font as part of its standard,
>if my speculation of the way it works is correct, otherwise, you will always
>see broken bottons, truncated texts, and ... frustrating users.

I think you're wrong -- the widgets should be able to help that, at least 
partly. Using a loose grid style layout, the buttons should just expand 
to swallow the available text.

Further, I'll say that hard coding in particular font choices, as you seem
to be suggesting is a stupid idea. Users should be able to set this kind
of thing.

-- 
Donovan

------------------------------

From: Mark Hamstra <[EMAIL PROTECTED]>
Subject: Re: How to catch SIGKILL signal?
Date: 05 Mar 2000 15:36:56 -0500

"Duy Nguyen" <[EMAIL PROTECTED]> writes:

> It seems that SIGKILL cannot be catched? Refer to sample code below.

No need, it doesn't matter what you've done, you can't specify a
signal handler for SIGKILL or SIGSTOP; nor can you ignore or block
them.

--
Mark Hamstra
Bentley Systems, Inc.

------------------------------

From: [EMAIL PROTECTED]
Subject: which ODBC or other API for Linux
Date: Sun, 05 Mar 2000 21:38:42 GMT

I looked at some ODBC solutions a while back and found nothing that
I felt I could use for a number of reasons.  I'm interesting in
looking again, as there seem to now be quite a number of different
options.  However, as before, it sees the documentation is either
very incomplete on them, or it assumes more knowledge about databases
and ODBC concepts than I have.

I need to run a client on Linux that accesses data on a Microsoft SQL
server running on NT.  Installing anything on the NT side is unlikely
to be an option.  On the Linux side it should be just a shared library.

I'm not committed to any library.  In other words, I'm not porting
some program that expects to use some particular API.  I will be
writing the code in C so I can adapt to some API's.  However, I do
NOT want any library that runs its own event loop.  The event loop
will be in my code only.  It is also preferrable to have asyncronous
access (e.g. so my code doesn't get blocked in some function call
while waiting on the database).

None of the documentations I have looked at cover these areas.  Now
there are many more, and it would take quite a long amount of time to
go digging deep into all of them to discover exactly how they work;
time that I do not have.

Ideally I would like a standardized protocol for basic database access
(would not necessarily be capable of advanced proprietary features, but
I won't be using those anyway).

-- 
| Phil Howard - KA9WGN | for headlines that | Just say no to absurd patents |
| [EMAIL PROTECTED] | really matter:     | Boycott Amazon.Com (AMZN)     |
| Dallas - Texas - USA | linuxhomepage.com  | Shop http://bn.com/ instead   |

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: How to catch SIGKILL signal?
Date: Sun, 05 Mar 2000 22:00:14 GMT

On Sun, 05 Mar 2000 19:11:09 +0100 Duy Nguyen <[EMAIL PROTECTED]> wrote:
| It seems that SIGKILL cannot be catched? Refer to sample code below.
| Is there a way to have a routine called to do cleanup on reception of SIGKILL?

I need a way to be able to make sure a process is absolutely positively
done away with, or at times, absolutely positively stopped in its tracks.

There can't be both a way to do what I need, and a way to do what you need.
The needs are contradictory.

One reason my need will prevail is because processes could get hung or loop
or otherwise do nasty things in the signal handlers.  This is why SIGKILL
(as opposed to SIGTERM and others) was created.

As for cleaning up, since almost everything you'd need to clean up is in
the process itself, the kernel will take care of that.  If there are external
things that need to be cleaned up, such as video mode (a problem if you do
a SIGKILL on your X server), you'll need to find ways to do that not in that
process (for video mode, there are tools like savetextmode, restorefont,
restoretextmode, restorepalette, and the ALT-SysRQ-r keyboard sequence if
your kernel has CONFIG_MAGIC_SYSRQ compiled in).  One option is to leave a
parent cleanup process waiting for the actual child process to exit.  Then
if the child is SIGKILLed, the parent wakes up and cleans up the external
mess (such as leftover files, etc).

-- 
| Phil Howard - KA9WGN | for headlines that | Just say no to absurd patents |
| [EMAIL PROTECTED] | really matter:     | Boycott Amazon.Com (AMZN)     |
| Dallas - Texas - USA | linuxhomepage.com  | Shop http://bn.com/ instead   |

------------------------------

From: "Ross Crawford" <[EMAIL PROTECTED]>
Subject: Re: Interfacing With A Doorbell
Date: Mon, 6 Mar 2000 09:19:42 +1000

I did something similar, but used a DP switch on the doorbell, connected it
to my games port on one of the button inputs. Worked great.

ROSCO

Jerry McBride <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> In article <72rU3.38250$[EMAIL PROTECTED]>,
> "Dirk Bhagat" <[EMAIL PROTECTED]> wrote:
> >Hi all,
> >
> >I'm working on an app that requires interfacing with a
> >doorbell. I basically need to know when the doorbell is pressed.
> >
> >I was hoping I could somehow connect the doorbell (via a serial port) to
a
> >computer, and then poll the Receive pin on the port. When the pin goes
high,
> >the doorbell is pressed.
> >
> >Is this feasible? what system calls would I use to test a pin's value?
> >
>
> Ahhh... a hardware hacker...
>
> YES! It can be that simple. In fact, you can limit the powersupply to a
single
> 9volt battery. I did something similar on a TRS80 Model I computer many,
many
> years ago when auto-answer modems were un-affordable...
>
> Anyway, wire up your push button, your battery, pick a data bit out from
the
> connector carefully observing polarity and then have your program simply
poll
> the serial port that you connected the button to. You will probably have
to
> "debounce", the switch and maybe even stretch the button event a tad bit
with
> resistors and a capacitor...
>
> Have fun and happy hacking... :')
>
> --
>
>
****************************************************************************
***
>
> My name is Inigo Montoya. You stole my tagline. Prepare to die.
>
>
****************************************************************************
***
> * NetRexx - The onramp to the Internet -
http://www2.hursley.ibm.com/netrexx  *
>
****************************************************************************
***
>



------------------------------

From: Stefan Rieken <[EMAIL PROTECTED]>
Subject: Re: Linux/Windows
Date: Sun, 05 Mar 2000 23:35:44 +0100

[EMAIL PROTECTED] wrote:
> 
> After a couple of months I tried everything that Linux had to offer:
> Emacs, Vim, Jed, Kdevelop, etc... but I didn't find anything as slick as
> MS Visual Studio at all...
[snip]
> But... after a few more months, I started looking at these editors and
> discovered how amazingly complex they actually were.
[snip]
> Morale is, U/Li - nix is different to Windows. Don't write off programs
> that aren't a graphically pretty as Windows. It has strengths that
> Windows' graphical nature hinders.

Hi Jeremy and others,

I will not dicuss the quality of the Microsoft products themselves here,
but I will reenstate the old wisdom that "no matter how good a system,
there is always someone who cannot work with it". (Was that Einstein?
did I quote that literally right? guess not.)

I read about an analisys of MS RegClean once. Unable (= too lazy :-) to
find the URL again, but this was the idea:

The size of the MS RegClean .exe was about 1 Meg (it was some more, but
I can't do a safe bid higher than this). The folks started analyzing the
.exe, and found inside it:

- unused bitmaps (icons, splash screens, cursors etc.)
- unused MS Visual C++ templates (forgotten to delete)
- a complete battery of standard requesters, though not used
- a complete statically linked lib that was obsoleted years ago by a
dynamic version
- some of the above coming back many times
- even more, but I can't reproduce all.

They calculated that the actual REQUIRED .exe size for MS RegClean was
45k(!) and that the rest was all "bloat". So here's for the smooth
environments :-)

No actually, I like smooth environments. They only shouldn't be used by
smooth-talking people being unable to operate them*.

Greets,

Stefan

* actually, I shouldn't use them, too ;-). But one advantage of Open
Source is that when _I_ write some program like in this example, but put
it available as Open Source, there will always be some other guy (better
known as the "peer review"-er) to crush my code into the trashcan and
lock me away safely, far from humanity and mankind :-)

------------------------------

From: Francesco 'Kinkie' Chemolli <[EMAIL PROTECTED]>
Subject: Re: Idle time
Date: 06 Mar 2000 21:25:16 +0100
Reply-To: [EMAIL PROTECTED]

[EMAIL PROTECTED] (fvw) writes:

> In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:
> >Say I have a bit of code like this:
> >
> >while (something_hasnt_happened_yet)
> >{
> > //...Idle...
> >}
> >
> >Is there a function I can put inside the idle loop that will return the
> >processor control back to the kernel?  If I can do this, what's the
> >longest time my program will have to wait for the processor again?
> 
> Try sleep or usleep. See the manpages. You can choose how long it sleeps.

Or select, or poll.

-- 
  /Kinkie

Se sulla scatola c'e` scritto "Per windows 95 e superiori", dovrebbe
funzionare sotto Linux, vero?

------------------------------

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.x,comp.os.linux.advocacy
Subject: Re: I can't stand this X anymore!
Date: Sun, 05 Mar 2000 22:19:39 GMT

In comp.os.linux.development.apps Michael Gu <[EMAIL PROTECTED]> wrote:

| Consider such a senario, a application like to create a area of a size just
| to fit in certain text. And the application does not want a dynamic sized
| area, because the area is part of a pixel based layout. Now, if the
| application does not know the exact size of the font, how can it achieve such
| a goal. I have seen countless applications that either have a botton that
| does not have all characters displayed, or the botton is truncated because it
| exceeds the frame border and all sorts of bad displays.

Pixel based layout is a BAD way to design.

With people like you designing windows apps and web pages, no wonder I have
such a hard time reading the teeny tiny little letters on my 1600x1200 pixel
video display.  I make the default font larger for a reason and you and your
application are trying to screw it up?

I suppose if you were desiging web pages, they would be all scrunched up on
the left side like I see on quite many corporate web pages.  I have this
theory that such web pages were really design by graphical artists who came
from the print media (newspapers, magazines, brochures, etc) where the work
was done with the knowledge that the result would be produced in some exact
side they know in advance.

In computers this just isn't so.  Consider that the size of the pixels are
different between different video resolutions and different monitors.  Having
1600x1200 on a 17 inch (43 cm) monitor is quite different from 800x600 on a
21 inch (53 cm) monitor.  Maybe you should be forced to test your apps in
both of these scenarios.


| Besides, the font on X windows are so bad, it wastes display resource. Why,
| because it need more pixels to achieve the same result.

If smaller fonts that use fewer pixels are too small to even read, then what
good are they?


| And I don't think any widgets or window manager can do anything to help that!

That I can't tell you because I don't do windows applications.
However, I do web pages and I don't scrunch them up on the side.


| So, I believe X need to include a basic set of font as part of its standard,
| if my speculation of the way it works is correct, otherwise, you will always
| see broken bottons, truncated texts, and ... frustrating users.

Maybe.  I believe it has what works.  In X windows I'm just a "user" and it
works fine for me (save for a few bad apps, but the percentage of bad X apps
is a lot lower than the percentage of bad web pages).

If you're chopping the bottoms off your text, maybe you need to consider what
size you're making the cells.  Maybe your math is wrong.

-- 
| Phil Howard - KA9WGN | for headlines that | Just say no to absurd patents |
| [EMAIL PROTECTED] | really matter:     | Boycott Amazon.Com (AMZN)     |
| Dallas - Texas - USA | linuxhomepage.com  | Shop http://bn.com/ instead   |

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: How to safely interrupt select() ?
Date: Sun, 05 Mar 2000 22:34:16 GMT

On Sat, 4 Mar 2000 20:27:08 +0300 Maxim Udushlivy <[EMAIL PROTECTED]> wrote:

|     I have a thread waiting on several descriptors in select(). This may
| take a long time, so I want to let user to cancel operation. My idea is to
| append to fd_set additional dummy descriptor (e.g. returned from dup()) and
| close it when it is needed to cancel. Is this method safe in multithread
| environment? Are there any other more nicely ways (except signals), such as
| not closing but direct changing dummy descriptor state?

It seems safe enough to me.  I probably would have done the same thing.

-- 
| Phil Howard - KA9WGN | for headlines that | Just say no to absurd patents |
| [EMAIL PROTECTED] | really matter:     | Boycott Amazon.Com (AMZN)     |
| Dallas - Texas - USA | linuxhomepage.com  | Shop http://bn.com/ instead   |

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: problems running ./configure
Date: Sun, 05 Mar 2000 22:36:48 GMT

On 04 Mar 2000 11:26:26 -0800 Michael Powe <[EMAIL PROTECTED]> wrote:

| At some point, I seem to have buggered my gcc system information.
| This may have happened after I upgraded gcc to 2.95.2.  But, it may
| have happened after a failed attempt to upgrade the kernel to 2.3.48.
| I had to give up the kernel because I could not get sound to work.
| I'm currently running kernel 2.2.12.

Did you restore the kernel source for 2.2.12 and reconfigure the kernel?
Many of the C headers are linked into the kernel headers to get system
info, and the linux headers need to be configured to get the platform
information linked in as well.

-- 
| Phil Howard - KA9WGN | for headlines that | Just say no to absurd patents |
| [EMAIL PROTECTED] | really matter:     | Boycott Amazon.Com (AMZN)     |
| Dallas - Texas - USA | linuxhomepage.com  | Shop http://bn.com/ instead   |

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.development.apps) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-Apps Digest
******************************

Reply via email to