HDTenEightyP/NetNews huggingface dataset:
From: azhao@cs.arizona.edu (Qiang Alex Zhao)
Newsgroups: comp.windows.x,comp.lang.c
Subject: Universal random number generator better than just rand()
Date: 6 Jan 93 06:16:15 GMT
Followup-To: comp.windows.x
Organization: Computer Science Dept, Univ of Arizona, Tucson

Hi there,

Concerning about ANSI-C and POSIX portability of a program, I'm looking
for a "universal" random number generator. It must be better than just
rand().

Suppose I'm using <X11/Xfuncproto.h> and <X11/Xos.h> -- then what? Do
all System V platforms have drad48() kind of functions? Can anybody
tell me an easy way to distinguish different kind of machines in this
aspect so that I can do:

	#if "something"
	/* use drand48(), etc. */
	#else if "something"
	/* use random(), etc. */
	#else
	/* better not use, rand(), etc. */
	#endif

Now I only know:
	Sequent DYNIX has random(), etc.
	SunOS has both series.
	SGI IRIX has both series.

How about other systems?

-- 
= Qiang Alex Zhao                 ___       .             ______
  Computer Science Dept          /   )     /|   )          __//  )
  University of Arizona         /   /     /_|  / _        //    /_  _. ._
  azhao@cs.arizona.edu         (__)(_o   /  (_(_(-'_)(   ((____/ (_(_(_(_)
Newsgroups: comp.windows.x
From: lwv26@cas.org (Larry W. Virden)
Subject: xterm translation manager question
Reply-To: lvirden@cas.org (Larry W. Virden)
Organization: Nedriv Software and Shoe Shiners, Uninc.
Date: Thu, 7 Jan 1993 18:17:47 GMT

I have trying to map a key under X.
xmodmap -pm says:
xmodmap:  up to 5 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x6a),  Shift_R (0x75)
lock        Caps_Lock (0x7e)
control     Control_L (0x53)
mod1        Meta_L (0x7f),  Meta_R (0x81)
mod2        Num_Lock (0x69)
mod3        Mode_switch (0x14)
mod4        Alt_L (0x1a)
mod5        F13 (0x20),  F16 (0x3a),  F18 (0x50),  F19 (0x66),  F20 (0x68)


xmodmap -pk says:

     77         0xffda (F29)    0xffb9 (KP_9)   0xff55 (Prior)

I am not sure, but I THINK that this means that with no modifier pressed,
the keysym that the translation manager sees is F29.  With the Num_Lock
key pressed, I should see KP_9.  But what about that 3rd colum.  Is that
when the Mode_switch key is pressed?

Now, when I am writing translation manager actions, I currently have:

        Mod2<Key>KP_9:                    string("9")   \n\
        ~Mod2<Key>KP_9:                   string(0x1b) string("[216z")   \n\
	Shift <KeyPress> Prior:        scroll-back(1,halfpage) \n\


listed amoung the actions.  Is the second entry going to keep the 3rd
entry from being recognized?
-- 
Larry W. Virden                 UUCP: osu-cis!chemabs!lvirden
Same Mbox: BITNET: lvirden@cas  INET: lvirden@cas.org
Personal: 674 Falls Place,   Reynoldsburg, OH 43068-1614
Xref: sparky comp.windows.x:20950 comp.windows.x.intrinsics:740 comp.windows.x.motif:8460
From: cq377@cleveland.Freenet.Edu (David C. Williss)
Newsgroups: comp.windows.x,comp.windows.x.intrinsics,comp.windows.x.motif
Subject: Re: Specifying text in different languages in a resource file
Date: 9 Jan 1993 05:12:43 GMT
Organization: Case Western Reserve University, Cleveland, OH (USA)
Distribution: inet
Reply-To: cq377@cleveland.Freenet.Edu (David C. Williss)
NNTP-Posting-Host: hela.ins.cwru.edu


In a previous article, jarnold@spot.wrc.xerox.com (jeff arnold esc1-318) says:

>
>Hi,
>  I'm reposting the following question.  If you know the answer, please
>reply to henry_wong.lax1b@xerox.com
>
>  Is it possible to specify a character string (e.g. XmNlabelString for
>a push button) in a resource file using MOTIF 1.1.X in different languages 
>(i.e. French, German, ...)? If not, what's a good way of doing it?
>NLS catalog, maybe? Does MOTIF 1.2 support it?
>
>Thanks,
>
>Henry 
>
>P.S. I'm using MOTIF 1.1.X on an RS6000 running 3.2
>
Actually, if anybody can answer this, please post the answer here and/or
maybe add it to the FAQ.  I'd like to know too.  Especially languages
such as Chinese.


-- 
		-Dave Williss
---------------------------------------------------------------------------
Standards are great!  Everybody should have one of their own!
The opinions stated above are Mine!  All Mine!  You can't have them.
Newsgroups: comp.windows.x
From: mazur@bostech.com
Subject: Problems using kterm on sun
Reply-To: mazur@bostech.com
Organization: Boston Technology, Inc.
Date: Mon, 11 Jan 93 19:23:05 GMT

I'm attempting to display kana/kanji in a kterm.  The kterm( version???)
is on a sun running X11R5/Motif 1.2.

The strings were entered on a Macintosh using KanjiTalk and transferred to
Unix.  I then ran 'jis' on the strings to put them in the ^[$B ... ^[(J
format.

If I compile/link my test programs using Sun's BSD curses and run the
program in a kterm the strings show up in Japanese.

If I compile/link my test program using Sun's System V curses and run the
program in a kterm the strings show up as jibberish.  It doesn't seem
to interpret the escape sequences properly.  The escape (^[ ) is displayed
on the screen.  I installed terminfo.kt and set TERM=kterm without any luck.

Could the net provide any wisdom for getting Japanese strings to display 
properly using Sun's System V curses on a kterm?

Thanks in advance,
dave
Newsgroups: comp.windows.x
From: dan@watson.ibm.COM (Walt Daniels)
Subject: Public domain ISO10646 fonts
Organization: The Internet
Date: Mon, 11 Jan 1993 03:49:17 GMT

>I would like to know are there any public domain ISO10646 fonts available?
Not yet.  In fact there are no commercial ones either.  Both would be
hard since the final IS document has not been published yet, but
coming soon.

Newsgroups: comp.windows.x
From: pancamo@blkbox.COM (Daniel Pancamo)
Subject: UNIX/X-Window Report Tool
Organization: The Internet
Date: Fri, 8 Jan 1993 05:12:06 GMT


   I'm in need of a report generation tool (unix based) that will
   read ASCII and/or preferably binary data. A X-Window based
   reporting tool similar to the DbaseIV report generator or RR report
   generator would great, however, even a command line tool would suffice. 
   The tool should be able to process large amounts of data. 
   (approx. 150MB) in a short period of time (< 30 min).
   If anyone knows of such a tool please drop me a note
     Thanks
         Dan

    pancamo@blkbox.com
From: dforan@pilot.njin.net (David Foran)
Newsgroups: comp.windows.x
Subject: FreeAllPieces, memory leak
Keywords: X application help
Date: 6 Jan 93 16:40:38 GMT
Distribution: usa
Organization: Rutgers Univ., New Brunswick, N.J.

Hello,

I am running X11R5 on a Sun386i RoadRunner with SunOS 4.0.1. I have
just begun to learn X and I have resorted to hacking X window software
available via ftp to learn the fundamentals.

I have written an X window application for rudimentary image processing
tasks. The program allows the user to select various options from a 
menu and the program handles all file management, etc.

All is running fine except that repeated calls to display an image to
the screen results in the following message:

"Programmer Botch in FreeAllPieces, there may be a memory leak."

The menu is then obliterated from the screen, and a core dump follows.
It is interesting that even after all of this confusion the image
is successfully displayed to the screen. But further processing
requires restarting the program.

Do any of you X-perienced programmers have any idea as to how I can 
run down the problem??

please respond........

		david (djf@mirage.umdnj.edu)
Newsgroups: comp.windows.x
From: rkc@xn.ll.mit.edu
Subject: alternating window images - flicker in Xlib
Organization: MIT Lincoln Laboratory
Date: Mon, 4 Jan 93 18:03:04 GMT


	I have an C, Xlib based program with a main loop built around
XNextEvent, and I want to periodically flicker the screen.  I have early
copies of the O'Reilly books for Xlib, but I cannot figure out a good way to
periodically send/receive an event that says "change screen now".  The
peridicity is on the order of 6 times per second.  Can someone send me a code
snippet, or point me to the correct routine?  Thanks for your help.


			-Rob
			Robert K. Cunningham
			rkc@xn.ll.mit.edu

-- 
			Robert K. Cunningham
			rkc@xn.ll.mit.edu
Machine Intelligence Group		     Cognitive and Neural Systems Dept.
MIT Lincoln Laboratory			     Boston University (Occasionally)
From: snail@lsl.co.uk
Newsgroups: comp.windows.x
Subject: Re: Too Big XCreatePixmap returns ?
Date: 7 Jan 93 12:42:58 GMT
Organization: Laser-Scan Ltd., Cambridge

In article <1993Jan4.195342.13271@news.dfrf.nasa.gov>, todd@fred.dfrf.nasa.gov (Todd Vernon) writes:
> 
> O'Reilly VII (page 108)  - XCreatePixmap returns a pixmap ID
> 
> Also BadAlloc, BadDrawable, BadValue can result.  I think I have
> an idea why however my question is a follows.
> 
> How do I trap for instance BadAlloc as would happen if I ask for
> a pixmap that is too big ?  This seems like a common problem
> since off screen memory in X Servers is often limited ?
> 
> Is BadAlloc returned in place of the pixmap id ?

No, any error and you end up in the XErrorHandler, the default behaviour of
which is to kill you program.

>  is zero 
> returned ? help how do I do this ?

Just before you make the pixmap install an XErrorHandler using
XSetErrorHandler(). If you get an X error the program will go to the function
you've declared. Remove the error handler afterwards tho!

I'd be surprised if you make a pixmap this big, the server has paging space
too!

We have one in place all the time (for debugging, put a breakpoint in the
error handler and step up through the trace, useful in synchronise mode,
although sometime the stack trace is sheepdip), we don't use it to trap
specifics though.
-- 
snail@lsl.co.uk      

"Washing one's hands of the conflict between the powerful and the powerless
 means to side with the powerful, not to be Neutral."
                                                     Quote by Freire.
                                                     Poster by OXFAM.
Newsgroups: comp.windows.x,comp.windows.x.intrinsics
From: john@proteus.jpl.nasa.gov (John Veregge)
Subject: Re: Xt and CPU usage (Summary)
Reply-To: john@proteus.jpl.nasa.gov
Organization: Jet Propulsion Laboratory, Pasadena CA
Distribution: comp
Date: Fri, 8 Jan 1993 19:01:21 GMT

> In article <1992Dec29.044957.19576@llyene.jpl.nasa.gov>, john@pluto.Jpl.Nasa.Gov (John R Veregge) writes:
>> We have developed several large Motif applications that are complete CPU
>> hogs and I don't know why.
>> 
>> Each application has 300 to 500 XtCreateWidget() and 8 XtAppCreateShell()
>> calls. These calls are all made before XtAppMainLoop() is called. Widgets
>> are not destroyed until the application exits.
>> 
>> Each application is driven by both the GUI and serialized data using
>> XtInputCallbackProc's.
>> 
>> We run 2 to 4 application on a workstation.
>> 
>> 2 applications will put CPU usage of a Sparc 2 at 97%, even when
>> completely idle with no serialized data input and no X events (GUI input),
>> using X11R4, on Sun Sparc 2's with 32+ megs of memory and 20+ megs of swap.
>> 
>> Can anyone tell me (1) Why? and (2) How can I fix (optimize) this?

The problem was in XtAppAddInput()...

The application read two sockets and a Bourne shell pipe from stdin. I had
dutifully read the FAQ prior to posting so I 'knew' the problem could not be
XtAppAddInput() doing select() on a regular file. I also performed a profile
in the testing environment and found no obvious problems prior to posting.

The problem was that the test environment used the highest data rate the
application could handle, while the user's environment had much slower data
rates, with lots of idle time.  It was during this idle time that select()
kept getting called and in turn causing the XtAppAddInput() callbacks to be
called. When the input was completely idle, the application was chewing up 90%
of the CPU and 75% of it's time was spent in 4500 select() calls per second.

I switched to using XtAppAddTimeout() with an interval that adjusts to the
data rate and prioritizes X events ahead of input events. This solved the
problem. Weird, but it worked. (-;

Thanks to all who replied.
________________________________________________

 John R Veregge		john@proteus.jpl.nasa.gov
Newsgroups: comp.windows.x
From: raw@ushiva.wariat.org (Roland Wilcher)
Subject: X11r5 Fonts
Organization: The Software Sandbox
Date: Sat, 9 Jan 1993 00:57:22 GMT



We are having a problem using fixed-width bitmap fonts using X11R5 
on a Sun SparcClassic running Solaris 2.1. We have created 6 fixed 
width fonts and when the application loads them by specific name, 
the server scales the font.  Is there any way to turn off this
feature or create the font so scaling will not occur ?




-- 
"If aint broke, don't fix it"                   raw@ushiva.ncoast.org
-Bert lance                                     raw@ushiva.wariat.org
 Roland A. Wilcher                   6207 Luther Ave. Cleve Oh. 44103
---------------------------------------------------------------------
From: A M Shihab <ams90@ecs.soton.ac.uk>
Newsgroups: comp.windows.x
Subject: HELP: Window not initialising?
Date: 6 Jan 93 18:45:59 GMT
Originator: ams90@gloriana

hi,

  I have an application, written entirely in XLIB for X11R5.  My problem is
that I am creating a window, which has some text in it then I return from 
the rotuine only after an expose event has taken place and a XDrawImageString
has been run.

  The problem is that the window comes up and the text does not until near the
end when the window is anout to be shut down.

any pointers will be appreciated.

thanks in advance.


ams....
Newsgroups: comp.windows.x
From: todd@fred.dfrf.nasa.gov (Todd Vernon)
Subject: Re: Basic help with XSendEvent
To: ramakris@csgrad.cs.vt.edu (S.Ramakrishnan)
Organization: NASA Dryden
Date: Tue, 12 Jan 1993 16:35:20 GMT



Could you send me the answer also ?

todd@fred.dfrf.nasa.gov


Newsgroups: comp.windows.x
From: ebell@egs.com (Ed Bell)
Subject: Feedback on X interface developmen tools (SPARC)
Organization: Enron Gas Services
Date: Fri, 8 Jan 1993 22:41:12 GMT

I'm considering alternatives for several large development projects to
be don in a SPARC (4.1.3) Motif 1.1.2 environment (Xsun) server.

Does anyone have recommendations as to which one is the most robust
for rapid prototyping an development (ANSI-C)??

Thanks in advance.

Ed Bell
ebell@egs.com
Newsgroups: comp.windows.x,news.answers
From: mam70@ccc.amdahl.com (Michael Musta)
Newsgroups: comp.windows.x
Subject: Strange behaviour under MWM
Date: 6 Jan 93 20:11:27 GMT
Reply-To: mam70@juts.ccc.amdahl.com ()
Distribution: usa
Organization: Amdahl Corporation, Sunnyvale CA

I have an application program written with OPENLOOK Toolkit that runs fine
under the OPENLOOK Window Manager but will occasionally crash under the
Motif Window Manager.

If my application's toplevel window is not selected and you select the 
minimize button, it fails about 80% of the time with the following error
message:

       X Error of failed request: BadMatch (invalid parameters attributes)
       Major opcode of failed request:  42 (X_SetInputFocus)
       Serial number of failed request: XXXXX(a number)
       Current serial number in output stream: XXXXX(same number as above)

If you select my application's toplevel window then select the minimize button
the error never occurs.

This problem is driving me crazy!   I am relatively new to X window programming
and I hope someone could shed some light on this problem.

                                             Thanks in advance.
Newsgroups: comp.windows.x
From: kswatek@FREEDOM.ess.harris.com (Ken Swatek)
Subject: Re: Positioning xdm-login window
Date: Mon, 4 Jan 1993 17:43:52 GMT
Reply-To: kswatek@FREEDOM.ess.harris.com
Organization: Harris Corporation, Government Aerospace Systems Division

In article 9KF@animal.er.bell.ca, blain@blmc45.QE.Bell.CA (Stephane Blain) writes:
>
>-- 
>Hi everybody,
>
>	I have to position my xdm-login window because I've put
>a picture behind it.  In the documentation say that we have to
>set the following resources:
>
>	xlogin.Login.x:
>	xlogin.Login.y:
>	xlogin.Login.width:
>	xlogin.Login.height:
>
>That's work for width and height, but not for x and y.  I have read 
>the FAQ, but nothing on it.  There's someone have an idea?
>
>I use xnews, xdm from OpenWindows 3.0 and SunOS 4.1.1.
>
>

These settings can be changed in the '/usr/openwin/lib/xdm/Xsession'
file.  Look for the 'exec xterm' line and add the 'geometry' option.
For example I use:

	exec xterm -geometry 80x24+250+200 -iconic -ls

Good Luck,
Ken
______________________________________________________________________________

Ken Swatek                             INTERNET: kswatek@su19az.ess.harris.com
Harris Corporation                     UUCP:     uunet!su19az!kswatek
Government Aerospace Systems Division  CCMail:   harris.kswatek
Mail Stop: 102-4827                    FAX:      407-729-3116
P.O. Box 94000                         Pager:    407-690-8548 (Digital)
Melbourne, Florida 32902               Voice:    407-727-6081
______________________________________________________________________________

Newsgroups: comp.windows.x
From: kobet@xsun2a.ct.picker.com (Harry J Kobetitsch)
Subject: X user groups
Organization: Picker International, Inc.
Distribution: us
Date: Thu, 7 Jan 1993 22:19:47 GMT

Are there any user groups related to X that
are located in the Midwest (Ohio preferably) ?
From: ajg4885@zeus.tamu.edu (GANSLE, ANTHONY JOSEPH)
Newsgroups: comp.windows.x
Subject: Color Xterm
Date: 12 Jan 1993 07:28 CST
Organization: Texas A&M University, Academic Computing Services
Distribution: world
NNTP-Posting-Host: zeus.tamu.edu
Keywords: color  xterm
News-Software: VAX/VMS VNEWS 1.41    

The other day I was roaming around an archive FTP site looking for X
programs when I remembered reading an index file which said something
about a "color xterm".  I do not remember where I saw this nor what it
had meant.  I was wondering if there is anyone out there who *does* know
where this is or what it is.  I am curious to find out what, exactly, does
it do.

Thanks.
From: oj@miki.pictel.com (Oliver Jones)
Newsgroups: comp.windows.x
Subject: Re: Does XtCloseDisplay() destroys windows?
Date: 11 Jan 93 15:22:52 GMT
Reply-To: oj@world.std.com
Organization: PictureTel Corporation

In article <1iin9eINN2lr@charnel.ecst.csuchico.edu> durian28@ecst.csuchico.edu (dl) writes:
>
>I am writing a single application context program with multiple displays
>in hpux 8.0/Motif1.1 environment.
>
>I seemed to have problems with XtCloseDisplay().
>
>	1. Created a display with XtOpenDisplay() and used XtAppCreateShell(),
>	     XtCreatePopupShell() to create a toplevel widget as the parent
>            for other windows in that display.
>        2. Then, I remove the display with XtCloseDisplay().
>	3. When I reopens the same display (step #1) and 
            tried to create widgets,
>	    I get the following warning:
>   		"Warning: Try to change value of a registered window."
>	     and then core dumps.

When you close the display, destroy all the widgets associated with
that display connection.  (XtDestroyWidget on the top level shell will
do the trick.)  The widgets have corresponding windows on the X
server, and closing the display connection destroys the windows (there
is a way around this, by changing the connection's close-down mode,
but it won't help you much).

Use X11R5 Xt Intrinsics.  (Earlier versions are known to be buggy in
this respect.)

>Temporary solution:
> - Instead of XtCloseDisplay(), I use 
      XtDestroyWidget() on the toplevel widget.
      Now, the program runs perfectly, I think.  
      Will there be any future problem
>     by not closing those displays with XtCloseDisplay()?

I'm a little confused by your question.  I take it you want
to cease displaying anything on one or more of your program's
multiple displays.  Destroying the widgets does indeed remove
all the visible evidence of the display connection.  However,
if your program has no further use for a particular X server,
you should ALSO close the display connection (to free up the
port on the server).

Oliver Jones
From: snail@lsl.co.uk
Newsgroups: comp.windows.x
Subject: Re: Help with XmCreateScrolledText
Date: 11 Jan 93 18:13:27 GMT
Organization: Laser-Scan Ltd., Cambridge

In article <1993Jan8.213117.12635@b8.b8.ingr.com>, paries@b8.b8.ingr.com (Randy Paries) writes:
> 	My problem is that I can't seem to stop/force the user
> 	to 60 chars lines.
> 
> 	My Goal is at 60 chars to either ring a bell so that they 
> 	have to hit <CR> or even better have it wrap.
> 
> 	At present with the resources above I can make the TextWidget
> 	apprear with 60 columns and not change widths, but they can 
> 	continue to Type for ever.

Okay, right first thing, do what you want with your resources, it'll make not
a lot of difference, really.

You need to add an XmNmodifyVerifyCallback to your text widget.

static XtCallbackProc callback_func(Widget                     w,
                                    XtPointer                  client_data,
                                    XmTextVerifyCallbackStruct str)
This callback
can then check the length of the existing text and incoming text and decide
wether it should break the incoming text up, or disallow the incoming text.
A delete is detected by looking for inserted text of length zero, the 
str->text->ptr and str->text->length fields of the callback structure will be
NULL and zero. You can in general ignore the str->text->format field.

For instance you can set the str->doit field to FALSE if the text is too long
(remember that deleting from one line across a \n may cause a line to be too
long). If you set the XmNverifyBell resource to TRUE, the bell will
automatically sound if the user tries to do something which results in you
setting str->doit to false.

See the XmText man page.

This works, I've done similar stuff this way. You could also implement enough
stuff to remember how to do an undo/redo function, although I haven't had the
need to do this yet.

You can also use XmNvalueChangedCallback, except this gets called after the
event. I wouldn't recommend this.
-- 
snail@lsl.co.uk      

"Washing one's hands of the conflict between the powerful and the powerless
 means to side with the powerful, not to be Neutral."
                                                     Quote by Freire.
                                                     Poster by OXFAM.