Linux-Development-Apps Digest #419, Volume #7    Mon, 21 May 01 02:13:05 EDT

Contents:
  Re: Advice needed. ("Rajarshi Guha")
  Re: Faster than strstr (Ben Pfaff)
  Re: Cross compiling from Windows to Linux (Shankar Unni)
  kdevelop-libkdefakes.so ("news.tpi.pl")
  Re: How to get a number of processors (John Beardmore)
  gui for linux (Torsten Edeler)
  Re: Newbie programmer (Nix)
  i18n, decompiler for .mo files ? (Thomas Eschenbacher)
  Re: Advice needed. (Yury Petrov)
  Moving from Motif to... (Yury Petrov)
  Re: Glade program compiled error ? (=?iso-8859-1?Q?=C1ngel=20Su=E1rez?= Rivero)
  Gnome App compilation problem ("Jamie Ridgway")
  Re: Moving from Motif to... (Daniel Franklin)
  mcheck and MALLOC_CHECK_ (rud zel)
  Re: crypt() function syntax (Villy Kruse)

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

From: "Rajarshi Guha" <[EMAIL PROTECTED]>
Subject: Re: Advice needed.
Date: Sun, 20 May 2001 07:24:20 +0530

> 1.  I want to try Linux but am bewildered by the different Linux
offerings.
> What Linux O.S. should I try?

I think the question should have been 'What Linux distro should I try'.
There's only one Linux OS - but you can obtian it inseveral different
packages. In my opinion the RedHat distro's are good for newcomers -
SuSe seems OK, but I still prefer RedHat.

> 3.  What database could replace my Microsoft Access 2000?

If your requirement is SQL then you can have PostgreSQL or MySQL

> 4.  What programming language would you recommend to replace Visual Basic?

Perl/Python

> disillusioned with Microsoft and would like to escape to a better
world - I'
> m hoping it's Linux

It is, it is...:)

Bye,
=============================================================
Rajarshi Guha

email: [EMAIL PROTECTED]
web: http:/www.psynet.net/jijog






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

Subject: Re: Faster than strstr
From: Ben Pfaff <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Crossposted-To: comp.lang.c.moderated,comp.lang.c
Date: 20 May 2001 17:53:47 GMT

CBFalconer <[EMAIL PROTECTED]> writes:

> mmf wrote:
> > 
> > In article <[EMAIL PROTECTED]>, DB <[EMAIL PROTECTED]> wrote:
> > 
> > >My current project for SPI Dynamics made extensive use of the strstr()
> > >function to detect malicious activity in web server log files. The
> > >performance of that search routine was quite a bottleneck while LogAlert
> > >was detecting exploit strings. The strstr() function seemed to be part
> > >of the problem, I had to find a way to speed things up.
> > 
> > why not move laterally? instead of a faster way to repeatedly scan text
> > why not find a way to scan text once
> 
> A technique used in ID2ID (to replace id strings in multiple
> source files in one pass) inputs the candidate strings and forms a
> binary tree.  It uses an AVL tree to avoid imbalance, but could
> also use red-black trees. [...]

If the table of candidate strings does not change during a
program run, then there's a good chance that a balanced tree is a
waste of time and too complicated to boot.  I would probably use
qsort() followed by bsearch() for simplicity or a hand-coded
binary search for speed, or maybe a hash table or trie, myself.

Though AVL and red-black trees are pretty, there's an even
prettier algorithm for giving an ordinary binary tree perfect
balance in O(n) time and O(1) space.  If you really want to use a
binary tree, then, for a tree with static content, you can't beat
this.  Just build a tree that's unbalanced any which way and run
it through the balancer.

This algorithm is implemented in the latest ALPHA release of
libavl, FWIW.  As always, libavl is available from
<URL:http://www.msu.edu/~pfaffben>.
-- 
"What is appropriate for the master is not appropriate for the novice.
 You must understand the Tao before transcending structure."
--The Tao of Programming
-- 
comp.lang.c.moderated - moderation address: [EMAIL PROTECTED]

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

From: Shankar Unni <[EMAIL PROTECTED]>
Subject: Re: Cross compiling from Windows to Linux
Date: Sun, 20 May 2001 11:52:14 -0700

Daniel Lux wrote:

> We are using a cvs like system in our company wich runs under windows only,
> we are now developing programs for linux and would like to cross compile
> under windows to linux.
> I already took a look at cygwin, but could not see any switches for cross
> compilation to linux.

Several different solutions to this problem.

Solution 0:
==========

Did you know that you can get a PVCS client for Linux? That should take
care of your entire problem right there - check out onto a Linux box and
build.

See http://www.pvcs.synergex.com/pvcs-plt.htm.



Solution 1: (if you don't want to shell out the $$ for the PVCS client
on Linux)
==========

Do the build on a Linux box. To get the sources to compile, you have to
check them out on the windows and be able to access them on a linux box.
Several ways of doing this:

1. rsh windows_host pvcs checkout to Windows-local path
2a. Access the files remotely on the Linux box in one of two ways:
   * Export the directory as a Windows share, and mount it on the 
     Linux box using "smbmount".
   * Install a PCNFS server (several available for Windows) on the
     Windows box, export your directory as an NFS filesystem, and
     "mount -t nfs" on a Linux box.
OR
2b. Just ftp the sources from Windows to a local build directory
    on the Linux box, by continuing as follows:
       rsh windows_host zip -o files.zip directory directory..
       ftp -n windows_host <<! -EOF-
         user username password
         cd directory_containing_zip_file
         bin
         get files.zip
         quit
       EOF
     And then unpack the sources on the Linux side, and build as usual.



Solution 2: (The hardest - build a cross-compiler)
==========

While Cygnus doesn't supply a standard Windows-to-Linux cross-compiler,
it should be quite simple to actually build one with Cygnus. You would:

* Download a binary Cygnus distribution as a toolset, and install it.
This gives you a native GCC on Windows generating Windows binaries.
* You then download the GCC 2.91.6x *sources*, and unpack it.
* Run the "configure" script, telling it that the *target* is i386-linux
(and the host, by default, will be assumed to be the current host, ==
Win32).

* Run "make depends", "make", and "make install".

By default, this will produce a cross-compiler which you can access as
"i386-linux-gcc" (or maybe something quite similar - it'll use the
normalized target name as a prefix).  You can compile and link programs
using this compiler.

Of course, to make this environment complete, you'll have to get a copy
of the contents of /usr/{lib,include} (and whatever other libraries you
need) from a Linux distribution, and put it on your Windows box, so that
you can *link* your Linux target programs.

Once you've successfully linked your programs, you can tar them up, and
unpack and run them on a Linux box.

--
Shankar Unni.

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

From: "news.tpi.pl" <[EMAIL PROTECTED]>
Subject: kdevelop-libkdefakes.so
Date: Sun, 20 May 2001 20:56:07 +0200

hello,

I've installed kdevelop 1.4.beta 2-0 but cannot start the appl as it
complains about a missing file libkdefakes.so.0
I don't have such a file in my system (suse7.0, qt2, kdelibs 2.01-2)
as far as I know it should be included eg.in the kdelibs
do I need a newer version of kdelibs or is the solution lying somewhere else
?

thanks
kamil



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

From: John Beardmore <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system
Subject: Re: How to get a number of processors
Date: Sun, 20 May 2001 20:02:22 +0100

In message <[EMAIL PROTECTED]>, Eric P. McCoy 
<[EMAIL PROTECTED]> writes
>John Beardmore <[EMAIL PROTECTED]> writes:
>
>> >  While it's certainly possible for an app to figure out
>> >what other apps are doing, it's bad for it to base its behavior on any
>> >of that information because it has _no idea_ what the other app is
>> >doing.
>
>> Pardon ?
>
>Wow.  That makes no sense to me, either.
>
>My best guess is that I meant to say: while app A may be able too how
>much system resources app B is using, app A can't make any predictions
>on how long those resources are going to be in use, what patterns
>they're going to be following, and so on.  The kernel is still limited
>in this respect, but it has a better chance of guessing, assuming some
>heinously complicated logic, based on syscalls being used.
>
>In fact, it might not be that tough, I just haven't thought about it
>enough to have a solid guess.

I can't think of any way to guess from sys calls.


>> >If you can guarantee that your Magic Parallelizing App is going to be
>> >the only process running at any given time,
>
>> Well, the only process requiring significant resource.
>
>> > then you can damn well
>> >guarantee you'll have an operator smart enough to know how many CPUs
>> >are in the machine (and how to tell your app about it).
>
>> So anybody writing // apps can (has to!) afford a better class of
>> operator ??
>
>If they can afford a dedicated computer, they can afford to pay
>someone $10 to explain to a group of people how to configure the
>program properly.  I'm talking just about large bunches of computers,
>here; for small numbers (say, <10) the programmer/admin can do it
>himself.

Hmm.  OK, I'm happy to concede that people will always be able to do a 
better job, but I still see no reason to stop the app deciding on the 
basis of the hardware if that's will do the job the developers want.


>> >  If you can't
>> >guarantee that, then you need to leave process management up to the
>> >kernel, which can understand the situation far better than any
>> >individual app.
>
>> If you know the circumstances in which the app will be run, why not
>> give it an indication of the number of CPUs ?  Why give the operator
>> something else they can get wrong ?
>
>Because they won't.  If necessary, print up a bunch of labels and
>stick them on front of the computers.  Still not a real great
>solution, but at least it's no longer a platform-dependant one.

So long as the call to reveal the number of CPUs works, that is a step 
towards platform independence in as far as it lets the app adapt to // 
hardware, albeit imperfectly.


>> >Seems like what you're _really_ advocating is some powerful process
>> >management stuff in the kernel.
>
>> No.  That would be the good long term solution.  What I'm advocating,
>> or at least endorsing is a horrible bodge to give a better behaviour
>> in a limited set of circumstances.
>
>Ah, so we agree it's a bad thing.

It's a poor substitute for "some powerful process management stuff in 
the kernel" but better than nothing.


>  I'll grant you it may sometimes be
>necessary under certain conditions; my only original complaint was
>that it seemed like a hack.

Hacks are only bad if they stand in the way of better long term 
solutions.


>If we agree on that, we're settled.  I hope we meet up a year or so
>down the road rewriting the Linux scheduler, or something.  Although
>if you see my name in the project, you should probably tell Linus to
>come over and personally kick my ass, as I have no idea how to even
>begin programming a scheduler.

:)   I did it once for a Z80 process controller.  Worked real well. 
Access to the metal is something I miss.  You can probably tell !

So much to do !  So little time !


Cheers, J/.
-- 
John Beardmore

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

From: Torsten Edeler <[EMAIL PROTECTED]>
Subject: gui for linux
Date: Sun, 20 May 2001 21:43:18 +0200

hello,
i want to programm a very simple GUI for my programm under linux.
but i don't want to use gnome, kde and such thinks because they need too
much resources.

do anyone know how to programm the grafics-controller under this os?

cu torsten

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

From: Nix <$}xinix{$@esperi.demon.co.uk>
Crossposted-To: alt.os.linux.mandrake,comp.os.linux.development.system
Subject: Re: Newbie programmer
Date: 20 May 2001 20:37:05 +0100

[Followup-To: overridden, I do not take that group]

On Wed, 16 May 2001, Thorsten Roggendorf said:
> xemacs is a frontend for emacs

I don't know *where* you got that from.

XEmacs is a fork of GNU Emacs, not a frontend of any kind; there are
substantial differences between them, but more similarities than
differences. Which to use is a religious matter. :)

-- 
`LARTing lusers is supposed to be satisfying. This is just tedious. The
 silly shite I'm doing now is like trying to toothpick to death a Black
 Knight made of jelly.' --- RDD

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

From: Thomas Eschenbacher <[EMAIL PROTECTED]>
Subject: i18n, decompiler for .mo files ?
Date: Sun, 20 May 2001 22:12:45 +0200


does anybody know a way how to decompile a .mo file back to a .po file ?

(my original po file has been accidentally deleted and now I have only the 
"useless" .mo output file)

please help,
   Thomas
-- 
________________________________________________________________________
Thomas Eschenbacher                           [EMAIL PROTECTED]

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

From: Yury Petrov <[EMAIL PROTECTED]>
Subject: Re: Advice needed.
Date: Sun, 20 May 2001 21:08:23 GMT



David Kistner wrote:

> I need advise.
>
> <...>
>
> 4.  What programming language would you recommend to replace Visual Basic?

Look at Panther for Linux (http://www.possl.org)
I use a commetrial version (any not Linux platform - Win32, SVR4's, some exotic
dialects of Unix) of this tool at work and pretty happy with it.
Panther is the same sort of tool as VB, Powerbuilder, Delphi etc., except it's
available on much more platforms.
And, of course, it allows a development of database applications not only with
char or GUI user interface, but web-based too.


> Any additional advice would be greatly appreciated.  I'm very very
> disillusioned with Microsoft and would like to escape to a better world - I'
> m hoping it's Linux.

--
YP



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

From: Yury Petrov <[EMAIL PROTECTED]>
Subject: Moving from Motif to...
Date: Sun, 20 May 2001 21:24:21 GMT

Hello,

There is the Motif 2.1 application with source code (pure C). The
application is big enough (couple of Mloc).
There is the wish to port it to some non-Motif X.
So the questions are:
1. What will you suggest as "non-Motif" X? gtk, Qt something else?
2. Are there any proven methods, approaches for such a job?

Thanks in advance,
Yury.

--
YP



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

From: =?iso-8859-1?Q?=C1ngel=20Su=E1rez?= Rivero <[EMAIL PROTECTED]>
Subject: Re: Glade program compiled error ?
Date: Sun, 20 May 2001 22:43:08 +0100

[EMAIL PROTECTED] wrote:
> 
> When I compiled the glade programe, it shows the error messages:
> 
> /usr/bin/ld: cannot find -ldb1
> collect2: ld returned 1 exit status
> make[2]: *** [calc] Error 1
> make[2]: Leaving directory `/root/Projects/calc/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/root/Projects/calc'
> make: *** [all-recursive-am] Error 2
> 
> I don't know what is the problem ? Please Help me.
> Thanks. Best Regards, Jackie.
> 
> PS. I make sure the libdb1.so.2 library is installed well.
>     And the library path is correct in the /etc/ld.so.conf.

one possible solutions one: find 'libdb1.so.x' everywhere, and create
one symbolic
 link to /usr/lib or /usr/local/lib if this is in the file
/etc/ld.so.... The ldconfig make This step automatic for you.

two ...: install the package libdb-dev_xxx, maybe this header is
necessary.

¡luck! Rgs.
--
···········································
| @NGEL   [EMAIL PROTECTED]   Citius22  |
···········································

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

From: "Jamie Ridgway" <[EMAIL PROTECTED]>
Subject: Gnome App compilation problem
Date: Sun, 20 May 2001 19:11:58 -0400

I am trying to compile Drip and when attempting make the encoder, an
error is generated when the -ldb1 library can't be found. I posted a
message to the Drip developers and got a response back saying this was
Gnome configuration problem and not a Drip problem. 

Could someone please point in the right
direction on resolving this. 

BTW, I am running Mandrake 8 with most
development packages installed.

TIA

Jamie

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

From: [EMAIL PROTECTED] (Daniel Franklin)
Subject: Re: Moving from Motif to...
Reply-To: [EMAIL PROTECTED]
Date: 21 May 2001 08:39:30 +1000

Yury Petrov wrote:
>Hello,
>
>There is the Motif 2.1 application with source code (pure C). The
>application is big enough (couple of Mloc).
>There is the wish to port it to some non-Motif X.
>So the questions are:

>1. What will you suggest as "non-Motif" X? gtk, Qt something else?

I'd suggest trying to isolate the GUI parts of the code... split it up into
GUI parts and non-GUI parts as much as possible.

GTK might be the best toolkit if you want to stick with C. For a bit more
work, you could port to C++ and use QT if you desire. If it's a commercial
app you might prefer Gtk due to it being LGPL as opposed to GPL. I prefer QT
myself because I use KDE. I think both QT and GTK are available on most Unix
platforms (and under Win32 to some extent).

>2. Are there any proven methods, approaches for such a job?

It probably depends to such a large extent on how the existing code is
structured. It will be painful, but if it's nice and modular you can do it a
bit at a time.

- Daniel

-- 
******************************************************************************
*      Daniel Franklin - Postgraduate student in Electrical Engineering
*      University of Wollongong, NSW, Australia  *  [EMAIL PROTECTED]
******************************************************************************

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

From: rud zel <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: mcheck and MALLOC_CHECK_
Date: Sun, 20 May 2001 22:13:22 -0300

hello all I have a application with free and malloc problems I try to
find out where the error occur using mcheck wiht mprobe call and I want
to set MALLOC_CHECK_ but don't know how.. can anybody help me... I used
mcheck like this 
I have a function says foo declare as 
void foo(status_check status){
//printf status
}

at the main I have 
int main(void) {
int i = mcheck(foo);
if(i == -1)//printf(fail to used mcheck)

}
but my app still fail 
I think mckech still make a call to abort
the doc claim if a funtion is provided to mcheck
the abort wont be call ....the user_define function
will be call 

thanks .

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

From: [EMAIL PROTECTED] (Villy Kruse)
Subject: Re: crypt() function syntax
Date: 21 May 2001 05:47:18 GMT

On Fri, 18 May 2001 14:45:53 +0000, John C. Griggs <[EMAIL PROTECTED]> wrote:
>Aranwen wrote:

>> 
>> Also,how can i make it work from the command line without writing a program?
>> 
>
>If I understand what you are asking here, the answer is that you cannot.
>
>Hope this helps,
>       John Griggs


You could use a perl oneliner, but that might be cheating:


$ perl -e print crypt "abcdefghi", "ab";
abYH7TYgEKz2Q



Villy

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


** 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