Linux-Development-Apps Digest #591, Volume #6     Mon, 8 May 00 11:13:17 EDT

Contents:
  Re: sony memorystick download under linux (Glitch)
  Re: Need to find my IP address (Mark Wilden)
  Re: Need to find my IP address ([EMAIL PROTECTED])
  Re: Need to find my IP address ([EMAIL PROTECTED])
  Re: C++ GUI library question (Robert Berry)
  Re: C++ GUI library question (Mikko Rauhala)
  SINGAL FAILS !!! (David)
  Re: Two really easy (I'm sure) questions (Eric)
  Re: Aplications source code ("netghost")
  Re: java/C++ integration in linux. (James Moger)
  Lower to Upper ? (Bonny Gijzen)
  Re: Lower to Upper ? (Lew Pitcher)
  Re: Lower to Upper ? (Jerry Gilyeat)
  Re: Lower to Upper ? (John McKown)

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

Date: Mon, 08 May 2000 02:54:54 -0400
From: Glitch <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,comp.os.linux.misc
Subject: Re: sony memorystick download under linux

complain to sony then

Jon Stahl wrote:
> 
> Hi,
> 
> Anyone know of a way to download images from the sony
> handycam serial port adapter (msac-sr1) under linux.
> 
> You plug a memory stick into the adapter and run
> "picturegear" software under win95/98 normally.
> This is the last thing in the world that I boot
> win98 for, and I'd like to stop doing it ...
> 
> Thanks,
> Jon Stahl

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

From: Mark Wilden <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system,comp.os.linux,comp.os.linux.misc
Subject: Re: Need to find my IP address
Date: Mon, 08 May 2000 08:02:44 +0100

Kaz Kylheku wrote:
> 
> Many programmers, like me, maintain code that is poorly documented, if at all.
> Yet it doesn't bother them.

By this logic, of course, commenting is also unnecessary.

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

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.development.system,comp.os.linux,comp.os.linux.misc
Subject: Re: Need to find my IP address
Date: 8 May 2000 01:57:33 -0700

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
says...
 
>
>You don't seem to understand that having the source code is far better than
>having documentation.  In the proprietary world, you need documentation simply
>because the source is not available, so people cling to the myth that
>documentation is essential. Documentation isn't for dummies, it's for people
>without source code. It's not an elitist assumption that developers can
>understand source code.
>

interesting discussion.

I think we need to be more clear what we mean by documentation. 

There are in general two levels of documentation, one level that 
describes the high level design of the program (architecture, 
components interactions, main data flow etc..) and then, for 
library type of software, a lower level of documentation that 
describes the API as seen by the client of the library.

The first level is important to have, and can be in separate document.
In the open source world, I noticed that level of documentation
is somewhat lacking, although it is improving. I guess programmers usually
prefer to write code than to write documentation (I am one of those
weired programmers who enjoys writing doftware documentation as 
much as coding :)

Yes, the API level of documentation, can be found by looking at
the code itself, but if you are going to do that, then the code 
needs to be well documented as to the API. I've seen many code, 
where there is no documentation at all that describe the function 
calls. Not even a single line that describes what the function is 
supposed to do.

There are also tools similar to javadoc (also for C/C++) that will
generate API docs from the source code automatically. May be 
those can be used to help with this.

I happened to prefer to document the API first, in a separate document,
before the implementation, this way, the API is already documented
before I start coding. Of course, as one does more coding, the API
might have to change, and the API document, would need to remain in
sync with the code. But that was never a  problem really, unless the boss
wants the code working first thing monday morning !

One advantage of having the documentation in the source code, is that
the documentation is not lost or separated from the code, this is
what a system like javadoc is the best of both world. You can have your
cake and eat it too ;)

Nasser


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

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.development.system,comp.os.linux,comp.os.linux.misc
Subject: Re: Need to find my IP address
Date: 8 May 2000 02:05:52 -0700

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
 
>Herein lies one of my biggest complaints about the Linux development
>environment: there should be no reason why an application programmer must
>rely on undocumented "catch-all" calls to accomplish simple tasks.  The
>"man ioctl_list" page is a complete waste of time-- it's hopelessly out of
>date and only contains the argument type for each command without any
>explaination of where, why or how each should be used. 

I agree that man pages need to be updated. The problem it seems that
it is hard to keep them in sync with the code development. It should
be the task of each programmer to make sure the man page is up-to-date
for their program/tool/command before making a new sw release. There should
be a defined process setup as to how to do this in the open source
world. 

btw, does anyone use 'info' any more?

Nasser
 


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

From: Robert Berry <[EMAIL PROTECTED]>
Subject: Re: C++ GUI library question
Date: Mon, 8 May 2000 12:49:11 +0100

On Sun, 07 May 2000, [EMAIL PROTECTED] wrote:
>I've made many console apps so I know some c++, but I'm a beginner in
>making GUI apps.  I've researched and found GTK, qt, tcl/tk on the
>internet.  Which of these is the best for a beginner? Or is there one
>better than these?
>
>Thank you for your help.

I personally prefer QT as the KDE libs are based on QT. So you can easily
transfer your program to use KDE features. GNOME is based on GTK, so therefore
it becomes a matter of taste which desktop environment you would prefer to
develop for. The last time I looked GTK which C based and QT is C++ based. I
believe work has gone into making a C++ wrapper for GTK but I am not sure if
this is avaliable yet.  

TCL/TK is a scripting language so is easier to use but does not produce as
efficient  apps. 

Rob.



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

From: [EMAIL PROTECTED] (Mikko Rauhala)
Subject: Re: C++ GUI library question
Date: 8 May 2000 12:11:36 GMT
Reply-To: [EMAIL PROTECTED]

On Mon, 8 May 2000 12:49:11 +0100, Robert Berry <[EMAIL PROTECTED]> wrote:
>develop for. The last time I looked GTK which C based and QT is C++ based. I
>believe work has gone into making a C++ wrapper for GTK but I am not sure if
>this is avaliable yet.  

Yes, the C++ interface is called gtk-- and has - just recently, I think -
hit a stable release. Additionally, gnome-- provides C++ bindings for the
gnome libraries. See <URL:http://gtkmm.sourceforge.net/>.

-- 
Mikko Rauhala - [EMAIL PROTECTED] - http://www.iki.fi/mjr/

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

From: David <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system
Subject: SINGAL FAILS !!!
Date: Mon, 08 May 2000 14:55:33 +0200

This is a multi-part message in MIME format.
==============23A24375709CFDAB0CB22CA6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

HI,

I contacted you before, but now theme is diferent.

I am trying to use si_sigaction to obtain memory direction error, but it
doesnt work.

I have proved it into Solaris Sysyem and it works OK.

I pass you the short file:
sigaltstack.c

I install a signal handler and then I produce bad mem access. is_addr
says that I have access to 0x0 direction memory ALWAYS.

THANKS FOR YOUR TIME,
DTM

P.D.: Why a process can be defuncted afer an mprotect call is executed
??? (sigaltstack and signal handler are well installed. NO signal
appears (using strace...)). Mprotect, unprotect (PROT_NONE) a data code
(LEGAL data zone).
==============23A24375709CFDAB0CB22CA6
Content-Type: text/plain; charset=iso-8859-1;
 name="sigaltstack.c"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
 filename="sigaltstack.c"

#include <stdio.h>
#include <signal.h>

void trat_segv ( int s , siginfo_t *si , void *extra ) // __attribute__ (=
( section( ".shared") ))
{
  printf( "----SEGV -------------------\n" ) ;
  printf( "SIGNAL_NUMBER: %d\n" , si -> si_signo ) ;
  printf( "Errno value: %d\n" , si -> si_errno ) ;
  printf( "Signal Code: %d\n" , si -> si_code ) ;
  printf( "PID_T: %d\n" , si -> si_pid  ) ;
  printf( "UID_T: %d\n" , si -> si_uid ) ;
  printf( "SI_STATUS: %d\n" , si -> si_status ) ; /* Exit value or signal=
 */
  printf( "SIGNAL VALUE: %d\n" , si -> si_value ) ;  /* Signal value */
  printf( "SIGNAL INT: %d\n" , si -> si_int ) ;    /* POSIX.1b signal */
  printf( "SI_PTR: %d\n" , si -> si_ptr ) ;    /* POSIX.1b signal */
  printf( "SI_ADDR: %d\n" , si -> si_addr ) ;   /* Maemory location which=
 caused fault */
  printf( "SI_BAND: %d\n" , si -> si_band ) ;   /* Band event */
  printf( "SI_FD: %d\n" , si -> si_fd );     /* File descriptor */       =
                   =


  exit(0);
}

int main ( )
{
  stack_t segv_stack ;
  struct sigaction accion; =


  segv_stack.ss_sp    =3D (void *)malloc( SIGSTKSZ )  ;
  segv_stack.ss_size  =3D SIGSTKSZ   ;
  segv_stack.ss_flags =3D 0 ;

  printf("Direcci=F3n baja de pila: %p, Direcci=F3n alta de pila: %p\n",
        segv_stack.ss_sp, segv_stack.ss_sp+SIGSTKSZ);
  if ( sigaltstack ( &segv_stack , 0 ) < 0 )
    {
      perror( "SIGALTKSTACK: " ) ;
      printf( "ARGUMENTOS:\nSP: %p\nSIZE: %d\nFLAGS: %d\n" , =

              segv_stack.ss_sp , segv_stack.ss_size , segv_stack.ss_flags=
 ) ;

      return ;
    }

  =

  accion.sa_sigaction =3D trat_segv ;
  sigemptyset(&accion.sa_mask);
  accion.sa_flags =3D SA_RESTART | SA_NOCLDSTOP | SA_ONSTACK | SA_SIGINFO=
 ;
  sigaction(SIGSEGV, &accion, NULL);

  {
    int *a =3D (int *)0x1 ;
    *a =3D 10 ;
  }
  return 0 ;
}




==============23A24375709CFDAB0CB22CA6==


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

Crossposted-To: comp.os.linux.development,comp.os.linux.development.system
From: Eric <[EMAIL PROTECTED]>
Subject: Re: Two really easy (I'm sure) questions
Date: Mon, 8 May 2000 11:45:58 GMT
Reply-To: [EMAIL PROTECTED]

Mark Graybill wrote:
> 
> Alan Donovan wrote in message <[EMAIL PROTECTED]>...
> >Mark Graybill wrote:
> >
> >> Although I have participated in other OS development projects, I am
> >> new to Linux and have no experience with command shells.
> >
> >That explains it then.   The Bourne shell (aka UNIX shell) is a complex
> >beast, but very (very) much more useful than the joke command-line
> >interpreter that comes with MS-DOS.  People who confuse the two tend
> >think UNIX is a dinosaur,
> 
> I agree with you about the shell, but not your blindly placing me in the
> category of people described above.
> 
> DOS itself, is a joke - and always has been.  There were real multi-tasking
> OS's that humiliated DOS when it made it's appearance (e.g. Convergent
> Technologies CTOS.)
> 
> Unfortunately, many advanced operating systems fell by the way side because
> of their maker's marketing ineptitude.
> 
> >when, as anyone proficient in shell will tell
> >you, there are few, if any, more expressive languages for both scripting
> >programs and interactive use.
> 
> I agree with you in shell scriptings capabilities, but your experience with
> "languages for both scripting programs and interactive use" is obviously
> limited here (the mainframes have had scripting languages that puts shell in
> its place.)
> 
> >It is also very important to understand the role of the shell in a UNIX
> >system if you want to make it as a programmer. Implicit in this is
> >understanding the difference between system and fork, and how file
> >redirection, command-line processing, job control, etc all work. Read a
> >good book or two on the design of UNIX.
> 
> Keep in mind Linux is not really unix - it is not a direct decendant of
> unix.  The following unix systems I've already studied and have experience
> with:  AT&T 3B2 System V, AIX, HP-UX, SCO, BSD, OSF1, mach kernel, and IBM
> microkernel.  What books would you recommend?
> 
> >
> >> Since the underlying code is a shell, I wouldn't think it would be
> calling
> >> system calls for such things.
> >
> >The underlying code is not a shell. The command you are writing is
> >interpreted directly by the shell. It is the shell that parses "2>&1",
> >not gcc or make or anything else. What the shell does when it sees this
> >is to duplicate the output filedescriptor stdout (using the dup2()
> >system call) so that writes to stderr in the child program (gcc)
> >actually go to the same file as stdout. Note that the file can be a real
> >file (on disk), a pipe, a pseudofile (a device) or a terminal (where
> >unredirected stdout/err go). Depending on your command line, any of
> >these may be used.
> >
> >As Kaz said, 2>&1 is correct. 2<&1 is not, but it just happens to work
> >because dup'ing an fd for write is the same as dup'ing for read.
> 
> You missed the "other OS development projects" above, didn't you?  (I have
> no experience *developing* command line shells - it's not a statement of my
> experience using them.)    Perhaps your assumptions are in error.  :)
> 
> BTW, I still have no technical explanation as to why.  Just as Kaz couldn't
> tell me why it is bad practice to use void main() instead of int main().
> Some of this stems from frustration with recent graduates that have come
> into my projects who have ridiculously rigid do's and don'ts, and will not
> change - even if they hinder productivity.  I had one graduate student
> graduate (sounds like chiasmus), who insisted it was "lazy" to use a task
> list to select the window of a desired running program, and would waste time
> clicking title bars to send windows to the back until she found the right
> one (I've watched her miss the one she wanted in succession, and start the
> process all over again, wasting time - especially mine.)  These people were
> also not very good team players because of their egos and propensity to
> competition, and unwillingness to improve their skills - they hindered team
> dynamics.  Team playing is a requirement in today's IT.  The lack of being a
> good team player and willingness to improve your productivity are qualities
> used to weed out candidates.
> 
> So these news threads are really manifestations of issues I have, where I am
> really trying to prove a point to programmers that are great computer
> scientists, but cling to practices they learned in school that they cannot
> ratify - and they hinder their growth as professionals.  They aren't willing
> to let go of old dogma.
> 
> I guess after 20 years, I've lost all the bulls#!t "do's and don'ts" my
> professors could never explain why.  Based on what is real (and confidence
> in my own intelligence to discern what axioms are valid regardless of my
> professors' idioms), in the real world of commercial software engineering,
> I've developed my own set of do's and don'ts.  I use void main() if it suits
> my purpose (especially in a test program), and I've used 2<&1 because it
> suited my purpose.   If we should use 2>&1, tell us why.  (I could really
> care less which one I use - actually I may even have remembered it
> incorrectly and it just happened to work this way when I tried it to verify
> it.)
> 
> Again - please explain in technical terms WHY 2<&1 (and void main()) is
> incorrect.  I'm looking for solid technical reasons - not ethical reasons.

I haven't followed the entire thread, so forgive me if I make a remark
that  was made before.
void main() wouldn't be usable if you are interested in the succes of
you're program. Catching a program's return value (0 on success, else
failure) does require a return value.

> 
> Or are all we are really doing is showing off?  :)
> 
> Thanks,
> Mark

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

From: "netghost" <[EMAIL PROTECTED]>
Subject: Re: Aplications source code
Date: Mon, 8 May 2000 11:13:55 +0800

go to    GNU...And you can got them from
linux distributions..
Federico Czerwinski wrote in message ...
>Hi there!!!, well I'd like to know where the source code of some
>aplications (such as ping, finger, traceroute, etc) can be found. Just
>that, thanx!!!!
>
>
>Federico
>
>--
>Posted via CNET Help.com
>http://www.help.com/



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

From: James Moger <[EMAIL PROTECTED]>
Subject: Re: java/C++ integration in linux.
Date: Mon, 08 May 2000 08:44:54 -0400
Reply-To: [EMAIL PROTECTED]

The most way to do this is with the JNI (Java Native Interfave).  Every
JDK comes with the tools necessary to do this.  The idea is you write
the java class(es) which will make the native calls (each native call
method is labelled with the keyword "native").  You then compile that
java class into its Class bytecode.  Then you use the javah program to
generate a header file for your C/C++ code.  The header file gives you
the syntax for the function calls and you fill in the c-routine bodies.
It works pretty well - I've used it for writing linux serial
communications routines for Java.  In addition, the JNI is platform
independent - so its the more elegant solution.

--
       James Moger
===---------------------===
    Software Engineer
 Transonic Systems, Inc.
{C/C++} {Java} {Smalltalk}
 Cornell Engineering '98
===---------------------===



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

From: Bonny Gijzen <[EMAIL PROTECTED]>
Subject: Lower to Upper ?
Date: Mon, 08 May 2000 15:09:20 -0400

Hello,

In Linux C is there a function which converts from LowerCase to
UpperCase (or vice versa) ??

Regards Bonny Gijzen,



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

From: [EMAIL PROTECTED] (Lew Pitcher)
Subject: Re: Lower to Upper ?
Reply-To: [EMAIL PROTECTED]
Date: Mon, 08 May 2000 13:39:42 GMT

On Mon, 08 May 2000 15:09:20 -0400, Bonny Gijzen <[EMAIL PROTECTED]>
wrote:

>Hello,
>
>In Linux C is there a function which converts from LowerCase to
>UpperCase (or vice versa) ??

toupper()
tolower()


Lew Pitcher
System Consultant
Toronto Dominion Financial Group

([EMAIL PROTECTED])


(Opinions expressed are my own, not my employer's.)

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

From: Jerry Gilyeat <[EMAIL PROTECTED]>
Subject: Re: Lower to Upper ?
Date: Mon, 08 May 2000 14:00:51 GMT


On Mon, 8 May 2000, Lew Pitcher wrote:

> On Mon, 08 May 2000 15:09:20 -0400, Bonny Gijzen <[EMAIL PROTECTED]>
> wrote:
> 
> >Hello,
> >
> >In Linux C is there a function which converts from LowerCase to
> >UpperCase (or vice versa) ??
> 
> toupper()
> tolower()

And you'll need to include ctype.h to use them.


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

From: [EMAIL PROTECTED] (John McKown)
Subject: Re: Lower to Upper ?
Date: Mon, 8 May 2000 09:02:20 -0500

On Mon, 08 May 2000 15:09:20 -0400, Bonny Gijzen <[EMAIL PROTECTED]> wrote:
>Hello,
>
>In Linux C is there a function which converts from LowerCase to
>UpperCase (or vice versa) ??
>
 Yes. tolower() and toupper(). They only convert a single character. If you
need to convert a "string", then you need to put them in a loop. Something
like:

/* assume s is a pointer to a null terminated string */
while (s*) {
 s*=tolower(s*);
 s++;
}

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


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