Linux-Development-Apps Digest #389, Volume #7     Tue, 8 May 01 17:13:16 EDT

Contents:
  Re: PostgreSQL_question (Robert Lynch)
  Re: libstdc++ errors when compiling various apps (mozilla, texmacs, ...) ("_=^> 
chRØMi$X)
  Re: inode to filename? (Eric P. McCoy)
  Re: Faster than strstr (Kaz Kylheku)
  Re: Handling large numbers of sockets? (Ferenc Wagner)
  why a thread running in a separate process on Linux? ("Alex Ho")
  Re: PostgreSQL_question (Jorge Escalante)
  Linux Perl Client -> MSSQL Server 2000;  Can be possible? (Jose Gilberto Torres)
  Re: Adding default libraries to every link ("Norm Dresner")
  how to have owner, size, and group of a file? ("clement")
  Re: how to have owner, size, and group of a file? ("Norm Dresner")
  Re: why a thread running in a separate process on Linux? ("Arthur H. Gold")
  Re: Linux Perl Client -> MSSQL Server 2000;  Can be possible? (J.H.M. Dassen (Ray))
  Re: PostgreSQL_question ([EMAIL PROTECTED])
  Re: PostgreSQL_question ([EMAIL PROTECTED])
  Re: Linux Perl Client -> MSSQL Server 2000;  Can be possible? (Edward Avis)

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

From: Robert Lynch <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: PostgreSQL_question
Date: Tue, 08 May 2001 09:14:55 -0700

Jorge Escalante wrote:
> 
>   -----------------------------------------------------------------
> I just got the book "PostgreSQL Introduction and Concepts" by Bruce Momjian.
> The book explains that to create the test database one has to type
> the following command at the prompt:
> 
> 'createdb test'
> 
> However, when I do this I get a message that reads:
> "Connection to database template1 failed.
> FATAL 1: SetUserId: user jorge is not in pg_shadow."
> 
> How do I solve this problem? anyone?

You need to su to user postgres and run "createuser".  The
questions you'll need to answer are self-explanatory.

HTH. Bob L.
-- 
Robert Lynch     Berkeley CA USA    [EMAIL PROTECTED]

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

From: "_=^> chRØMi$X <^=_" <[EMAIL PROTECTED]>
Subject: Re: libstdc++ errors when compiling various apps (mozilla, texmacs, ...)
Reply-To: [EMAIL PROTECTED]
Date: Tue, 08 May 2001 16:30:07 GMT

-=¡[ Erik Max Francis <[EMAIL PROTECTED]> wr0Te: ]!=-

>"_=^> chRØMi$X <^=_" wrote:
>
>> Anyone can give me a hint, a possible solution or a tip?? I hope so,
>> since i presume this problem may likely cause problems with other
>> packages as well.
>
>We'll need to see what your linking command line looks like.  Hint:  You
>should be running g++.
Ok. I had the problem when i tried to compile mozilla and texmacs.
These are the executed lines causing the compiling failure:

=================== texmacs ===================
c++  -Wl,-Bdynamic -L/usr/src/TeXmacs-0.3.0-7-src/TeXmacs-0.3.0-7/lib
-lserver -lglue -ledit -ltypeset -lconvert -lwindow -lresource -lbasic
-L/usr/X11R6/lib -lXext -lX11 -L/usr/lib -lguile -lm -ldl
Objects/texmacs.o -o 

=================== mozilla ===================
`/mnt/storage/usr_src/mozilla-source-0.9/rdf/tests/rdfcat'
c++ -o rdfcat -I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall
-Wconversion -Wpointer-arith -Wbad-function-cast -Wcast-align
-Woverloaded-virtual -Wsynth -pedantic -Wno-long-long -pipe -pthread
-DDEBUG -DDEBUG_root -DTRACING -g -DWIDGET_DLL=\"libwidget_gtk.so\"
-DGFXWIN_DLL=\"libgfx_gtk.so\" -I/usr/include/gtk-1.2
-I/usr/lib/glib/include -I/usr/X11R6/include  rdfcat.o
-L../../../dist/bin -L../../../dist/lib -lmozjs -L../../../dist/bin
-lxpcom -L/mnt/storage/usr_src/mozilla-source-0.9/dist/lib -lplds4
-lplc4 -lnspr4 -lpthread -ldl -lc  -L/usr/lib -L/usr/X11R6/lib -lgtk
-lgdk -rdynamic -lgmodule -lglib -ldl -lXext -lX11 -lm  -ldl -lm  -lc

Thanks in advance!

   /-- -   -    -   -  -\..
   \ #   # -- --  - --  /````
-- -  # # / Blablabla.... 
chromis# | E-mail at chromisx (at) home.nl
- --  # # \ Greetings from Holland!
   / #   # --  -  -\..
   \-- - - ----  --/````

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

Subject: Re: inode to filename?
From: [EMAIL PROTECTED] (Eric P. McCoy)
Date: 08 May 2001 12:42:49 -0400

"Markku Parviainen" <[EMAIL PROTECTED]> writes:

> If I can ask which inode is associated with certain file name, and I'll get
> response quickly, there should be some kind of table, which links file names
> to inodes, right?

Yes.  It's called a directory.  Last I checked, it was pretty much
just a packed list of filenames and inode numbers.

> Then why it can't do reverse lookup through the same table instead of
> seeking through the whole disk looking for that file name?

It certainly can do that, but inodes have no concept of current
working directories (whereas files do).  If you specify the file
"/foo/bar.baz", then the driver starts looking in the root directory
inode for a directory "foo"; then it looks in that directory's inode
for a file "bar.baz"; then it has the inode number of the file.

But if you just say "inode 895," there's no fast way to determine
which directory inode contains the filename.  Moreover, since there
can be many filenames associated with that same inode, you may get a
"wrong" answer unless you search the entire hard disk.  To simulate
the performance of your program, find some obscure point in the
directory structure, create a uniquely-named file, change to the root
directory, and run `find' to get it.

> And if that table was constructed like:
>     file1 -> 123
>     "hard link to file1" -> 123
>     file2 -> 456
> Then it should be no problem to return those two names for #123...
> (Or at least first of them)

If there were only one directory on a disk, you'd be right.  But there
are many directories, and any inode number is valid for a file in any
directory.

> Err, maybe I should get a book:  "Understanding ext2 file system" ...   :)
> (I wonder if there is one...)

Probably.  There's barely dirt about it on the Internet, though.

-- 
Eric McCoy <[EMAIL PROTECTED]>
  "Knowing that a lot of people across the world with Geocities sites
absolutely despise me is about the only thing that can add a positive
spin to this situation."  - Something Awful, 1/11/2001

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.lang.c
Subject: Re: Faster than strstr
Reply-To: [EMAIL PROTECTED]
Date: Tue, 08 May 2001 16:46:57 GMT

On 08 May 2001 15:57:12 GMT, David Rubin <[EMAIL PROTECTED]> wrote:
>DB wrote:
>
>[snip - strstr not fast enough]
>> I found strchr() to be the fastest search available on the X86. This
>> became the front-end to my new search routine. The result is strchrstr(),
>> that uses a fast strchr() to find potential matches, and then does a
>> strncmp() on the remainder of the target string.
>
>...or you can try a regex package.

For a literal search pattern, a regex package won't necessarily be faster than
a naive search. The naive ``sliding comparison'' algorithm is equivalent to
what a regex machine may do; it may try the pattern match at every character
position. There is no requirement that an implementation of <regex.h> do
anything better than this.

A clever algorithm advances its comparison position by more than one
character, because it realizes that certain overlaps are not possible.
If you are looking for the word "string", but you matched 
the first four characters of "strident" before bailing on the 'd',
you should resume the match starting at the letter which follows 'd', rather
than naively sliding by one position to the 't'. 

There is nothing inherent in the concept of regular expressions which 
calls for this optimization. It requires additional preprocessing,
not related to the function of pattern matching. With each state, it's possible
to associate a value which tells by how much the next matching attempt should
be displaced, should the input have no valid transition out of that state.

In its purest form, a regular expression codes for a machine that either
matches some input sequence or does not. Using regular expressions to search
for sub-matches is an extension of the idea; in the theory, regular expressions
behave as though they are ``anchored'' front and end.  There is nothing
inherent in regular expressions that makes them superior for finding
a matching substring.

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

From: Ferenc Wagner <[EMAIL PROTECTED]>
Subject: Re: Handling large numbers of sockets?
Date: 08 May 2001 18:48:49 +0200
Reply-To: [EMAIL PROTECTED]

Steve Connet <[EMAIL PROTECTED]> writes:

> Are your arrays of fixed size, say 5000? Or are they dynamic so that
> you have to spend time allocating and deallocating?
> 
> Because there's a lot of details about allocation and deallocation
> that must occur.

I feel like this is a good place to use Obstacks
(info libc obstacks in case you didn't know).

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

From: "Alex Ho" <[EMAIL PROTECTED]>
Subject: why a thread running in a separate process on Linux?
Date: 08 May 2001 18:26:36 GMT

Does anyone know why both LinuxThread and PThreads on Linux are forking a
process for each thread?  Is there a thread lib for Linux that doesn't do
that.

I just want all secondary threads belonging to an application to run in the
same process as the main thread.


Best Regards,
Alex Ho



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

From: Jorge Escalante <[EMAIL PROTECTED]>
Subject: Re: PostgreSQL_question
Date: Mon, 07 May 2001 20:43:14 -0500

Robert Lynch wrote:

> Jorge Escalante wrote:
> >
> >   -----------------------------------------------------------------
> > I just got the book "PostgreSQL Introduction and Concepts" by Bruce Momjian.
> > The book explains that to create the test database one has to type
> > the following command at the prompt:
> >
> > 'createdb test'
> >
> > However, when I do this I get a message that reads:
> > "Connection to database template1 failed.
> > FATAL 1: SetUserId: user jorge is not in pg_shadow."
> >
> > How do I solve this problem? anyone?
>
> You need to su to user postgres and run "createuser".  The
> questions you'll need to answer are self-explanatory.
>
> HTH. Bob L.
> --
> Robert Lynch     Berkeley CA USA    [EMAIL PROTECTED]

It worked, I could use the command 'su postgres'. Now, it is asking me for the
password, and I don't have a clue what it is!

Let me explain. I am running Debian Linux on an Intel machine. PostgreSQL is
installed by Debian at installation time; I was never asked, by the installation,
any questions regarding account setups for PostgreSQL, thus, I have no idea  what
the password would be for PostgreSQL::postgres

Do you know a way to find out what the pswd would be?

Thanks in advance.


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

From: Jose Gilberto Torres <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.perl.modules,comp.databases,comp.databases.ms-sqlserver
Subject: Linux Perl Client -> MSSQL Server 2000;  Can be possible?
Date: Tue, 08 May 2001 12:02:18 -0700

Hi to everyone in cyberspace!,
I don't know the appropriate newgroup to ask this question so please
don't attack me for it :-)  !!    I have be searching all over the 'net
to find a way to get a Linux (or Solaris) perl client script to access
data from a MSSQL Server 2000 server.  So far I found the OpenLink
driver but on my box it continues to seg fault on me when I try to
access these drivers.  I was wondering if anyone had successfully able
to do get perl and mssql to talk to each other.  So far it does not seem
to be possible.  I hope I am wrong?    Help?  Thanks!!!!!!


Jose Torres


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

From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Re: Adding default libraries to every link
Date: Tue, 08 May 2001 19:30:04 GMT

Kaz Kylheku <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Mon, 07 May 2001 23:51:10 GMT, Norm Dresner <[EMAIL PROTECTED]>
wrote:
> >Bill Medland <[EMAIL PROTECTED]> wrote in message
> >news:01c0d74b$6f63bba0$6f0c10ac@medbi01...
> >> Norm Dresner <[EMAIL PROTECTED]> wrote in article
> >> <huEJ6.9520$[EMAIL PROTECTED]>...
> >> > In other operating systems it's almost trivial to specify to the
linker
> >a
> >> > list of additional libraries that should be searched for each linking
> >> > operation.  For example, in DEC's VMS for VAX-like systems, it's
nothing
> >> > more than (the equivalent of) defining additional entries in the
> >> > environment.
> >> --cut--
> >>
> >> >
> >> > Thanks
> >> >     Norm
> >> You could use makefiles and environmental variables.
> >>
> >> Bill
> >
> >Sure.  As they say, "Been there, done that."  I was hoping for something
> >with the utter simplicity of the VMX approach, where
> >    cc -o b b.c
> >would search through several "local" libraries without "manual
> >intervention".
>
> What does that do? Just look in some bunch of libraryes for symbols or
objects
> that satisfy unresolved references in b?  Shouldn't b.c kind of know what
> library it wants and be accompanied with some kind of build system?
>
> Why don't we treat headers that way too:
>
>     /* start of file, no #include's */
>     struct foo x; /* Just find this in some ``local'' header */
>
> And of course, the user should just have to type
>
>     cc
>
> and it will find some "local" program to build. ;)

Did you erase every script file from your system because you can just type
it all in again and again and again.

Have you deleted all aliases from your system too.   And links?

You must have because you want to do everything yourself.  Every time too.

You must not use your system very often, I sure wouldn't with no scripts or
aliases or links.

Are you so dense that you can't see that having the computer do something
for you so you don't have to do it every time is an advantage?

    Norm




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

From: "clement" <[EMAIL PROTECTED]>
Subject: how to have owner, size, and group of a file?
Date: Tue, 8 May 2001 12:00:37 +0200

I want to have the owner, the size, and the group of a file?
how function can i use with C?

Thanks in advance!


Clement




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

From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Re: how to have owner, size, and group of a file?
Date: Tue, 08 May 2001 19:46:01 GMT

clement <[EMAIL PROTECTED]> wrote in message
news:9d8fvf$4nd$[EMAIL PROTECTED]...
> I want to have the owner, the size, and the group of a file?
> how function can i use with C?
>
> Thanks in advance!
>
>
> Clement
>

    man    stat


        Norm




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

Date: Tue, 08 May 2001 15:31:21 -0500
From: "Arthur H. Gold" <[EMAIL PROTECTED]>
Subject: Re: why a thread running in a separate process on Linux?

Alex Ho wrote:
> 
> Does anyone know why both LinuxThread and PThreads on Linux are forking a
> process for each thread?  Is there a thread lib for Linux that doesn't do
> that.
There are several purely user-space libraries available that will
run threads in a single process; they, however, defeat (some of)
the purpose(s) of threading, as they cannot provide for
concurrency on multiprocessor machines.

Also, a correction -- under linuxthreads, threads are not
_fork()_-ed processes, they are _clone()_-ed processes. The system
call __clone(), a relative of fork(), provides (with the
appropriate arguments -- don't worry about it, you almost never
have any need to use the call directly) the ability to have
proceses share the same address space (as opposed to the
copy-on-write semantics of fork()). The ability to clone processes
is really the only kernel level support for threads on linux.
> 
> I just want all secondary threads belonging to an application to run in the
> same process as the main thread.
The important question is "Why?". 
Outside of some differences in the way signals are handled (a
result of there being multiple processes) and low-level scheduling
issues, the fact that each thread has its own PID is transparent.

If you have further questions, post here, or to
news:comp.programming.threads (where the thread `heavies' hang
out).

HTH,
--ag

-- 
Artie Gold, Austin, TX  (finger the cs.utexas.edu account for more
info)
mailto:[EMAIL PROTECTED] or mailto:[EMAIL PROTECTED]
--
Clone Bernie!

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

From: [EMAIL PROTECTED] (J.H.M. Dassen (Ray))
Crossposted-To: comp.lang.perl.modules,comp.databases,comp.databases.ms-sqlserver
Subject: Re: Linux Perl Client -> MSSQL Server 2000;  Can be possible?
Date: Tue, 8 May 2001 20:25:25 +0000 (UTC)

Jose Gilberto Torres <[EMAIL PROTECTED]> wrote:
> I have be searching all over the 'net to find a way to get a Linux (or
> Solaris) perl client script to access data from a MSSQL Server 2000
> server.

I haven't used it myself, but DBI + DBD::ODBC is probably the best way to
go.

HTH,
Ray
-- 
The "free" in "free software" refers to freedom, not price; specifically,
that all computer users should have the freedom to study, change, and
redistribute the software that they use.
        RMS in http://weblog.mercurycenter.com/ejournal/stories/storyReader$664

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

From: [EMAIL PROTECTED]
Subject: Re: PostgreSQL_question
Date: Tue, 08 May 2001 20:32:28 GMT

Jorge Escalante <[EMAIL PROTECTED]> writes:
> Robert Lynch wrote:
> > Jorge Escalante wrote:
> > >
> > >   -----------------------------------------------------------------
> > > I just got the book "PostgreSQL Introduction and Concepts" by Bruce Momjian.
> > > The book explains that to create the test database one has to type
> > > the following command at the prompt:
> > >
> > > 'createdb test'
> > >
> > > However, when I do this I get a message that reads:
> > > "Connection to database template1 failed.
> > > FATAL 1: SetUserId: user jorge is not in pg_shadow."
> > >
> > > How do I solve this problem? anyone?
> >
> > You need to su to user postgres and run "createuser".  The
> > questions you'll need to answer are self-explanatory.
> >
> > HTH. Bob L.
> > --
> > Robert Lynch     Berkeley CA USA    [EMAIL PROTECTED]
> 
> It worked, I could use the command 'su postgres'. Now, it is asking me for the
> password, and I don't have a clue what it is!

> Let me explain. I am running Debian Linux on an Intel
> machine. PostgreSQL is installed by Debian at installation time; I
> was never asked, by the installation, any questions regarding
> account setups for PostgreSQL, thus, I have no idea what the
> password would be for PostgreSQL::postgres

> Do you know a way to find out what the pswd would be?

More likely than not, there isn't one.

What you need to do is to su to root (as with "su -" or "su - root"),
for which you hopefully _do_ have the password.

Root can "su" to any user ID --> "su - postgres"

It's a bit of a twisty road to get there; life...
-- 
(reverse (concatenate 'string "ac.notelrac.teneerf@" "454aa"))
http://vip.hex.net/~cbbrowne/resume.html
A  LISP programmer  knows the  value of  everything, but  the  cost of
nothing.  -- Alan Perlis

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

From: [EMAIL PROTECTED]
Subject: Re: PostgreSQL_question
Date: Tue, 08 May 2001 20:32:32 GMT

Jorge Escalante <[EMAIL PROTECTED]> writes:
> I just got the book "PostgreSQL Introduction and Concepts" by Bruce Momjian.
> The book explains that to create the test database one has to type 
> the following command at the prompt:
> 
> 'createdb test'
> 
> However, when I do this I get a message that reads:
> "Connection to database template1 failed.
> FATAL 1: SetUserId: user jorge is not in pg_shadow."
> 
> How do I solve this problem? anyone?

You first need to login as user postgres, and run the command "createuser."

As prompted, add "jorge," with the ability to add new databases.  (And
probably users.)

-- 
(concatenate 'string "aa454" "@freenet.carleton.ca")
http://www.ntlug.org/~cbbrowne/resume.html
Rules of the Evil Overlord  #220. "Whatever my one vulnerability is, I
will fake a  different one. For example, ordering  all mirrors removed
from the palace, screaming and flinching whenever someone accidentally
holds up a mirror, etc. In the climax when the hero whips out a mirror
and thrusts it at my face,  my reaction will be ``Hmm...I think I need
a shave.''"  <http://www.eviloverlord.com/>

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

From: Edward Avis <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.perl.modules,comp.databases,comp.databases.ms-sqlserver
Subject: Re: Linux Perl Client -> MSSQL Server 2000;  Can be possible?
Date: 08 May 2001 20:38:39 +0100

I haven't used Perl with MS SQL Server but I think you have two main
options:

- Use an old Sybase driver and hope it still works.  SQL Server is
descended from Sybase.

- Use a Windows box as an ODBC-to-ODBC bridge, or somehow proxy your
requests through a Windows box.  I believe that Perl on Windows can do
ODBC, and of course ODBC can do MSSQL.

-- 
Ed Avis
[EMAIL PROTECTED]

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


** 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 by posting to the
comp.os.linux.development.apps newsgroup.

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