Re: readInt() & byte order

2001-03-22 Thread Matthias Pfisterer

Matthias Pfisterer wrote:
> 
> Ashish wrote:
> >
> > Answer is simple
> >
> > Java program expects file bytes in big-endian format, while C uses little
> > endian
> 
> Sorry, wrong. C uses the native byte order of the system. I.e. it
> depends on the processor.
> x86 (Intel, AMD) => little endian
> PowerPC, Alpha, Sparc => big endian

Sorry, I made a mistake. Alpha is little endian.

Matthias

> 
> Matthias
> 
> > 2175 = > 1000   0111
> >
> > so java will interpret after assuming it's big endian will be 0111
> > 1000 => 32520
> >
> > -Ashish
> >
> > - Original Message -
> > From: "Joaquin Rapela" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, March 21, 2001 9:56 AM
> > Subject: readInt() & byte order
> >
> > > Hello,
> > >
> > > I have a binary file containing short integers. I wrote a C program to
> > read
> > > the file and it works as expected. I wrote a java program to read the file
> > > using a DataInputStream and its readInt() method and it is reading the
> > short
> > > integers in inverted order Instead of a 2175 (1111) I get a 32520
> > > (1111000). To read the integers I read the following code:
> > >
> > > File inputFile = new File(filename);
> > > in = new DataInputStream(new FileInputStream(filename));
> > > short current = -1;
> > > current = in.readShort();
> > >
> > > Is there something wrong with this? Shall I use another method?
> > >
> > > Thanks in advance, Joaquin
> >
> > --
> > To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
> 
> --
> Matthias Pfisterer  
> 
> Share your knowledge.
> It's a way to achieve immortality.
> 
>  (from a nepalese mantra)
> 
> Java Sound Examples:
> http://w3studi.informatik.uni-stuttgart.de/~pfistere/jsexamples/
> Tritonus, the open source implementation of the Java Sound API:
> http://www.tritonus.org/
> --
> 
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

-- 
Matthias Pfisterer  

Share your knowledge.
It's a way to achieve immortality.

 (from a nepalese mantra)

Java Sound Examples:
http://w3studi.informatik.uni-stuttgart.de/~pfistere/jsexamples/
Tritonus, the open source implementation of the Java Sound API:
http://www.tritonus.org/
--


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




RE: Typing International Text

2001-03-22 Thread Martin, Stephen

One way to do this is to use the unicode escape sequences.
eg: \u00a9

would include the unicode character for the copyright symbol. You can
find the unicode values at www.unicode.org
> Does anyone know the secret to typing non-Latin-1 text into a 
> Java program
> on Linux? I've tried everything I can think of, but so far 
> Java programs
> stubbornly refuse to accept anything but Latin-1 characters from the
> keyboard.
> 
> Here's my setup:
> 
> Debian GNU/Linux (potato with some packages from unstable)
> Blackdown JDK 1.3 (I've also tried the IBM JDK 1.3)
> 
> One of the languages I would like to be able to type is 
> Greek, so I did
> the following:
> 
> Added ISO-8859-7 fonts to font.properties
> Set the locale to el_GR
> Set up a Greek keymap with xkbsetmap
> 
> I know that everything is set up properly on the X11 side because I've
> been able to type Greek characters in an xterm, but when I 
> start up a java
> program and switch to the Greek keymap, it substitutes the 
> upper half of
> Latin-1 rather than Greek characters.
> 
> Is this possible, or am I banging my head against a brick wall?
> 


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: GCJ on RedHat 6.x

2001-03-22 Thread David Brownell

The versions of GCJ worth trying are the one RedHat put
onto the RedHat 7.0 distribution ("GCJ 2.96rh"), and for
the truly bleeding edge user, recent GCC 3.0 snapshots.

The 2.95 versions are significantly out of date, and not
at all recommended.  On the other hand, the 3.0 versions
are restabilizing ... I'd recommend the 2.96rh version as
the best bet for the moment.  If you want to work with
3.0 snapshots, see the Java list at http://gcc.gnu.org/java
for current info; seems like next week's snapshot may
be interesting.

- Dave



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




servlet and graphics

2001-03-22 Thread Michael Remme

Hi all,

i am running a servlet on a suse 7.0 -server, running with blackdown jdk
1.2.2. This servlet shall create on the fly a gif-image and store that
somewhere on the server.

When the module of the servlet is reaching the point, where it shall call
the graphic-environment, the following error occurs:

java.lang.InternalError:
Can't connect to X11 window server using ':0.0' as the value of the DISPLAY
variable.

Since yesterday i am reading everything about xwindows, DISPLAY-variable eg
in the net and in some books but don't come to a real success. Can anybody
help me?

Best, Michael



Michael Remme
BrainT@GS GmbH
Neuhofstr. 48
D-41061 Mönchengladbach
Tel. 02161-243 136
Mobile: 0173 - 535 21 37


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




font properties again.

2001-03-22 Thread cindy

Hi,
I just installed j2sdk1.3.0 from blackdown and getting the error message
about
font properties. The error messages goes like this;
Font specified in font.properties not found [
--symbol-medium-r-normal--*-%d-*-*p-*-adobe-fontspecific]
I went to the archives and found Jueren Kreileder reply, but I didn't
understand  the reply.
could someone help me solve this?

Another warning message I'm getting is,
Warning: Cannot allocate colormap entry for default background
How do I fix this?
Thanks.
Wayne


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




RE: servlet and graphics

2001-03-22 Thread Martin, Stephen

This is because the call to the graphically environment is probably using
an awt component that is peered with a native X-Windows implementation.
This component is probably making a call to the X server for some service
(for example rendering a font). That call will be done in the context
of whoever started the jvm and will try to make connection to an X
server based on the runtime environment of the jvm process. A work around
to this is to set the DISPLAY variable to an X server running on the machine
that the jvm is runing and that allows access for the person that invoked
the jvm. This is not a good thing because if someone kills the server,
your code will stop working again.

A better solution would be to point to some non-graphical X server
instance or better yet to use a graphical toolkit that avoids awt.

> 
> Hi all,
> 
> i am running a servlet on a suse 7.0 -server, running with 
> blackdown jdk
> 1.2.2. This servlet shall create on the fly a gif-image and store that
> somewhere on the server.
> 
> When the module of the servlet is reaching the point, where 
> it shall call
> the graphic-environment, the following error occurs:
> 
>   java.lang.InternalError:
>   Can't connect to X11 window server using ':0.0' as the 
> value of the DISPLAY
> variable.
> 
> Since yesterday i am reading everything about xwindows, 
> DISPLAY-variable eg
> in the net and in some books but don't come to a real 
> success. Can anybody
> help me?
> 


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Fonts too big.

2001-03-22 Thread Miloslaw Smyk

Hi!

I've been playing with font configuration of JDK1.3.0_02 under Linux/i386
with the aim of getting it to look the same as under Windows. Unfortunately
setting font.properties file to immitate Windows setup didn't make it really
identical - basically the fonts displayed by Linux version are 1 point
bigger.

I investigated it a bit further:

- using Metal LAF, Windows uses 12 point font (Arial, with default setup),
- Linux uses 13 point font with the same Metal LAF,
- a peek into DefaultMetalTheme revealed that size should in fact be 12,
- the *.ttf font files I'm using are identical in Windows and Linux version
- X-Window when asked for 12-point Arial does the right thing.

Any suggestions?

Thanks,
Milek
PS. I'm talking about Swing app.
-- 
mailto:[EMAIL PROTECTED]   |  "Man in the Moon and other weird things" -
http://wfmh.org.pl/~thorgal/  |  see it at http://wfmh.org.pl/~thorgal/Moon/
 Fight for the good cause: http://www.laubzega.com/dvd/


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: font properties again.

2001-03-22 Thread Cynthia Jeness

I installed j2sdk1.3.0 from Sun, but had a very similar error message.  In
order to fix this, I changed  the various symbol lines in the
font.properties file like this;

FROM:

--symbol-medium-r-normal--*-%d-*-*p-*-adobe-fontspecific

TO:

-urw-symbol-medium-r-normal--*-%d-*-*p-*-urw-fontspecific

This change was made based on examining the fonts that I actually have
available on my system which is a stock RedHat 7.0 plus necessry patches.
So basically, you need to make the font.properties match what you actually
have avaialble.

Cynthia Jeness

cindy wrote:

> Hi,
> I just installed j2sdk1.3.0 from blackdown and getting the error message
> about
> font properties. The error messages goes like this;
> Font specified in font.properties not found [
> --symbol-medium-r-normal--*-%d-*-*p-*-adobe-fontspecific]
> I went to the archives and found Jueren Kreileder reply, but I didn't
> understand  the reply.
> could someone help me solve this?
>
> Another warning message I'm getting is,
> Warning: Cannot allocate colormap entry for default background
> How do I fix this?
> Thanks.
> Wayne
>
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: font properties again.

2001-03-22 Thread Nancy F. Maniquis

Wayne,

regarding the font problem, this solution worked for me:
http://www.jguru.com/faq/view.jsp?EID=229424

i don't know about the colormap warning though.

-- nancy


- Original Message - 
From: cindy <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 23, 2001 3:44 PM
Subject: font properties again.


> Hi,
> I just installed j2sdk1.3.0 from blackdown and getting the error message
> about font properties. The error messages goes like this;
> Font specified in font.properties not found [
> --symbol-medium-r-normal--*-%d-*-*p-*-adobe-fontspecific]
> I went to the archives and found Jueren Kreileder reply, but I didn't
> understand  the reply.  could someone help me solve this?
> 
> Another warning message I'm getting is,
> Warning: Cannot allocate colormap entry for default background
> How do I fix this?
> Thanks.
> Wayne



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]