 |
 |
Index ‹ java-programmer
|
- Previous
- 6
- OSes people bitch about vs. OSes people don't useThomas G. Marshall wrote:
> JTK coughed up:
>
> ...[rip]...
>
>
>
>>Yes. XP just doesn't go down friend.
>
>
> So you'd call me a liar if I said it has BSOD'd on me several times?
>
Nope. I'd call you a liar if you tried to claim that your experience,
which differs from that of 99.44% of the rest of the SP2-using
population, is somehow indicative of serious and fundamental problems
with XPSP2.
>
>
>>All you "H8rs" better sharpen
>>up and take a good hard look at why Linux continues to be an also-ran,
>>because your last-grasp "Windows crashes when the sun goes behind a
>>cloud, Linux never has even once!" delusion is becoming laughable.
>
>
> I'm not a linux junkie, I much prefer PC's even though my origin is in the
> unix arena 20+ years ago. Once I can tame a pc with cygwin and other
> helpers, then I'm much happier in an environment that has so many more
> titles written for it.
>
You and me both friend. So if'n a guy has an XP box with Cygwin on it,
tell me again how that is somehow "inferior" to a Linux box?
> And even so, I will just have to admit that the linux boxes that I've seen
> as firewall/nat's just run and run and run, and have so even when linux was
> relatively young.
>
"firewall/nat's". Ok, assuming that's true, do you see the logical
fallicy there? How many XPSP2 boxes do you see being used solely as a
"firewall/nat"? Zero? Less than zero?
>
> (Thomas G. Marshall complaint regarding SP2 for XP goes here)
>
Yeah, whatever.
>
>>Hmm. Well, that makes one unsatisfied customer out of... what, a few
>>billion?
>
>
> Try smacking your head against a wall for a few times to realize what you
> just said. If that doesn't work, then google for the population of the
> planet. If so inclined, look up the estimate of how many PC's and in fact
> PC's running xp there are. Then on top of that realize that you also don't
> have a notion as to whom SP2 affects adversely, and then rephrase.
Yeah I'll get right on that. While I'm busy not doing that, you get
busy not realizing that Linux is a niche player, "why you just restart
the window manager!" == crash, and the tired old "Linux never crashes!"
saw is now about as meaningful as the "Linux is virus-proof!" saw.
- 7
- Forth versus C -- and JavaUlrich Hobelmann wrote:
> Wolf Wejgaard wrote:
> > I once wrote a short intro to Forth as a comparison with C. You
> > find it at http://holonforth.com/holon/forthc.htm I wonder if it
> > is useful.
>
> In power.htm you might want to point out at the end that because it
uses
> the stack, Forth can even return more than one return value, while C
> can't. It is strange that a language can call a function with one
> parameter, but can't call the return continuation with more than one.
Forth, C, and Java/Lisp/Scheme are harmonious.
Both the parameter stack and return stack are 'unframed' in native
machine code or Forth. The parameter stack frame is 'framed' with C,
however, the return stack framing is compiler implementation defined.
With Java, Lisp and Scheme both the parameter stack and return stack
are 'framed'.
The framing causes the functional equivilant of a stack 'frame' pointer
referencing and de-referencing for every lambda/function/subroutine.
example of particular,
FORTH $FFFE ;
C *f();
A JAVA example is not possible with Java, Lisp or Scheme without a
direct native core machine code subroutine call ( and closure violation
( RPLCAR , maybe in Lisp/Scheme, depending upon compiler implementation
), acronym, RPLCAR, Replace Contents of Adress Register, or, maybe, a
write to the A bus with Chuck Moore's new architectures, C18, 25X )
maw
- 7
- help! compilation error in javai am getting this error when i compile my java code
Exception in thread "main" java.lang.NoClassDefFoundError:
D:\STest\TestClient/java
plzz tell me what to do.. i hv included all possible library files in the
classpath..still the same error. plz tell me how resolve it..
- 7
- M'I`5'Persecu tion ' how an d w hy di d it s tart?-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-= how and why did it start?. -=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
The harassment didn't. start by itself, so someone must have been there at
the outset to give it a firm push and set the. "animals" after me. It looks
as if I was set up in June 1990, and the timing indicates. someone from
university was. responsible.
>One thing which has. been missing from this discussion is this simple
>prognosis: that. maybe he is right and that, despite his admitted
>mental condition, there really is a campaign against him. organised by
>now-influential ex-students. of his university.
In May or June 1990, Alan Freeman. on Radio 1 read out a letter from someone
who had known me for a few years, who wrote of the. one who "wore out his
welcome with random precision" (from the Pink. Floyd song). Freeman went on
to say to the writer "that's a hell of a. letter you wrote there". The
indication is strongly. that people I had parted from soon before nursed a
grudge against me and were trying. to cause trouble for me.
The suggestion is that Freeman might have shown the. letter to other people,
and things. could have snowballed from there. Right from the start the real
source (security services. presumed) didn't announce themselves as the
origin, but let the. "talkers", the radio DJs, believe that they were the
originators.. Think about it; if you announce, "we're MI5 and we have a
campaign against. this bloke" then people might not go along with it; but if
you say, "everyone. else is getting at this bloke because he 'deserves' it"
then people will join in with. fewer qualms.
>Why would "they" wish to assassinate. your character?
It's the. classic case of hitting a cripple to prove you're stronger. Why
would the security services expend hundreds of thousands of. pounds and more
than six years of. manpower to try to kill a British citizen? Because they
are motivated by people who knew. me at university and feel personal
animosity; because they. knew me to be emotionally weak, and it is in the
nature of bullies to prey on those. known to be weak; and because they can
rely on the complicity of the establishment, which the security. services
manipulate and derive funding. from. This is England's biggest humiliation
today, and the British security services. are intent on preventing their
humiliation becoming reality. by continuing their campaign of attempted
murder to suppress. the truth from becoming public.
1032
- 9
- DER decoding from x.509 v3 certificateI need to read the extension field of a x.509 v3 certificate.
I use the java method getExtensionValue().
The method return an array of bytes DER-encoded.
I want to read it as a String and print it on screen. So I have to decode
the array and convert it.
I try a lot of way to do that but I never obtain good result.
Someone can help me?
Then, the DER encoding is equal to Base64 encoding or not?
Thanks
- 9
- Treasure Trooper what you do here is you complete simple surveys and offers, some
require a credit card, but i just do all the free ones :D
its easy to do, you just register and do the offers, then click the
"done" button when you have completed it to what the instructions say,
here is the website if you want to check it out
www.treasuretrooper.com/111524 (copy and paste into browser
this is how the payment works: say in june you made 60$, then on the
15th of next month, so on july 15th you would get your money. they send
a check in the mail so yes, you have to provide your correct address,
not a fake one (dont worry they dont spam you with shit) and you will
get a check in the mail from them and you can cash it like any other
check.
so far, i have been doing this thing for 2 months and i have been payed
$156.50 total. its easy money and only takes about half an hour a day
if your really keen on it, but usually 10 minutes is fine. on their
forums i ha ve heard that people are making like $200+ i hope i can get
that much in the future. im pretty close.
once again, if you are interested in signing up, here is where you go:
www.treasuretrooper.com/111524 (copy and paste into your browser)
- 13
- JList Font BugConsider this SSCCE. If you take out the comment on the setFont
statement, it stop working -- displaying a blank screen in W2K/JDK 1.0
Why. It fails even when I set it to the default Dialog, 12 , BOLD.
// sample use of jList
// The code is quite different from AWT List.
import java.awt.Color;
import java.awt.Font;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.ListSelectionModel;
public class TestJList
{
/**
* Debugging harness for a Frame
*
* @param args command line arguments are ignored.
*/
public static void main ( String args [] )
{
final JFrame frame = new JFrame();
final JList flavour = new JList( new String[] { "strawberry",
"chocolate", "vanilla"} );
flavour.setForeground( Color.BLUE );
flavour.setBackground( Color.WHITE );
System.out.println( flavour.getFont() );
// flavour.setFont( new Font( "Dialog", 12, Font.BOLD ));
// setting the selection
flavour.setSelectedIndex( 0 );
flavour.setSelectedValue ( "chocolate", false /* scroll */ );
// allowing multiple selections, the default.
flavour.setSelectionMode(
ListSelectionModel.MULTIPLE_INTERVAL_SELECTION );
// set multiple selections
flavour.setSelectedIndices( new int[] { 0, 2} );
// there is no setSelectedValues method
flavour.addListSelectionListener( new ListSelectionListener()
{
/**
* Called whenever the
value of the selection changes.
* @param e the event that
characterizes the change.
*/
public void valueChanged(
ListSelectionEvent e)
{
// detecting individual
selection
System.out.println(
"--selection--" );
// will be null if there
are none or multiple selections.
String choice = (String)
flavour.getSelectedValue();
System.out.println(
choice );
// will be -1 if there
aare none or muliple selections.
int which =
flavour.getSelectedIndex();
System.out.println(
which );
// detecting multiple
selections
System.out.println(
"--multiples--" );
Object[] choices =
flavour.getSelectedValues();
for ( Object aChoice :
choices )
{
System.out.println(
aChoice );
}
int[] indexes =
flavour.getSelectedIndices();
for ( int index :
indexes )
{
System.out.println(
index );
}
}
});
frame.add( flavour );
frame.setSize( 100, 100 );
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
frame.validate();
frame.setVisible( true );
} // end main
}
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
- 14
- eclipseAndreas Kohn wrote:
>Works for me on FreeBSD/i386 6.0-CURRENT. I applied attached build to
>have eclipse build with mozilla-devel instead of the default mozilla.
>
>
I've combined this fix with the one Bruno sent, as well as a few other
random cleanups. Here's an updated package:
http://www.varju.ca/alex/freebsd/eclipse-devel-3.1m6-3.tgz
The libswt-mozilla library is building now, but I don't think it's
working correctly on my system. I'm not positive, but I think the Help
system uses it .. if I try to go to Help Contents, nothing happens.
(This is better than before the plugin was built, as then it created a
mozilla process that spun forever).
This patch is still missing Motif support. I've just flagged this as
broken, as I don't actually expect to track this down myself. My i386
system is far too slow to do test builds on, and it doesn't like there
are linux x86_64 motif build files to base an amd64 build on.
>One strange thing: At one build stage, it looked like it would build
>gtk64 support things, is this to be expected on i386?
>
>
It's possible that I've messed something up there, but it's also
possible that Eclipse builds more than it actually needs. What exactly
are you seeing?
Alex.
- 14
- RTF parser componentHi all.
i want component which is sperating text frm rtf text.rtf text contains
images and some embedded objects which i want to seperate.
Does anyone know it.
Please help me.
- 14
- ibatis sqlMap, LIKE operatorI've been using iBatis sql maps in my J2EE application with great
results so far, but I've come across a bit of a roadblock, and my usual
savior, Google, hasn't been able to help me out of this one. The one
hits that seems to be exactly what I am looking for seems to have
vanished from the web:
http://www.mail-archive.com/email***@***.com/msg00284.html
I can't seem to get queries that use the LIKE operator to work.
According to the sqlmap docs, this should work:
SELECT * FROM PRODUCT WHERE PRD_DESCRIPTION LIKE '%dog%'
OR
SELECT * FROM PRODUCT WHERE PRD_DESCRIPTION LIKE #value#
// description property == "%dog%"
When I run the SQL against my MySql db, I get results. When I run the
SQL using sqlMaps (substituting my String and the % operators for
#value#), I get no results. Here is my SQL (with table/column names
replaced):
select count(*) myCount from table_t
where field_f like '%45111q%'
in my sqlmap XML file, I have this SQL:
select count(*) myCount from table_t
where field_f like #value#
// (I know string appends waste mem)
I am passing in a String like this: String s = "%" + someStr + "%"
I have tried specifiying the parameterClass as java.lang.String as well
as not specifying at all.
I suspect the % sign is being escaped somehow, but cannot determine
this. Both my logging and MySQLs loggnig just show ? in the statement.
SqlMap logging shows this:
PreparedStatementLogProxy - {pstm-100121} Parameters:
[%h80111n6gb111c31o8zezojqdh111111%]
Has anyone managed to use LIKE successfully? It would be a huge help to
overcome this problem.
Thanks,
-BR
- 15
- C++ to JVM compilerThere used to be an alpha quality JVM backend for RedHat's branch of
GCC, but it was abandoned, because FOSS luminaries did not approve of
Java (strange, because both are out to crush Microsoft)
Now that Java is going open-source again, I hope this project will be
resurrected. C++ and Java are the most widely used languages. It's a
shame that C++ can not be compiled to JVM, even though there is a ton
of platforms that it can be compiled to, and there is a ton of
languages that do compile to JVM.
Let me list the advantages:
* definitively determine memory corruption caused by a C++ program
(valgrind and VC++2005's debug mode help, but can not always detect
it; also they are much slower than JVM; it would also be nice to be
able to detect uninitialized memory access, but I don't think JVM can
help with that, since it has everything initialized)
* call C++ programs more easily from Java, presumably
* run C++ on some exotic platforms with JVM and no C++ compiler (rare)
* run some C++ code faster (Java sometimes beats C++ on numerics-heavy
tests - currently rare, but things seem to be changing in favor of
JIT)
* run C++ safely - I know there are arrogant C++ coders who would
claim that their C++ code can not be exploited, but is there an
automated way to prove that?
(This could make a great summer-of-code project, unless it's too hard
- I don't actually know)
- 15
- Problem with JNI on LinuxI am having a problem getting JNI to work on Linux. I think it is with
how I am creating the shared object file. I am using Java 1.5.0_8 and
Redhat Enterprise version 3 release 4. I have not used JNI before so I
did a web search and found a simple example that I am trying to get to
work. The problem is that I am getting an UnsatisfiedLinkError. It looks
like there are many flavors of this error and I can get at least three
of them :(
My Java program is:
class FirstJNI
{
public native void displayHelloWorld();
public native void displayOther();
public native String getLine(String prompt);
static {
System.out.println("in static");
System.loadLibrary("FirstJNI");
}
public static void main(String[] args)
{
System.out.println("entered main");
System.out.println("creating new FirstJNI");
FirstJNI jN=new FirstJNI();
jN.displayHelloWorld();
jN.displayOther();
String input = jN.getLine("Enter Some Thing ");
System.out.println("You Entered " + input);
}
}
and my c library is:
#include "FirstJNI.h"
#include <stdio.h>
JNIEXPORT void JNICALL
Java_FirstJNI_displayHelloWorld(JNIEnv *env, jobject obj)
{
printf("Hello world! \n");
return;
}
JNIEXPORT void JNICALL
Java_FirstJNI_displayOther(JNIEnv *env, jobject obj)
{
printf("Hello world! This is Other Function.\n");
}
JNIEXPORT jstring JNICALL
Java_FirstJNI_getLine(JNIEnv *env, jobject obj, jstring enter)
{
char buf[128];
const char *str = (*env)->GetStringUTFChars(env, enter, 0);
printf("%s", str);
(*env)->ReleaseStringUTFChars(env, enter, str);
scanf("%s", buf);
return (*env)->NewStringUTF(env, buf);
}
I am building them with the following commands:
/usr/java/jdk1.5.0_08/bin/javac FirstJNI.java
/usr/java/jdk1.5.0_08/bin/javah -jni FirstJNI
gcc -O2 -I/usr/java/jdk1.5.0_08/include
-I/usr/java/jdk1.5.0_08/include/linux -fno-strict-aliasing -fPIC
-fno-omit-frame-pointer -W -Wall -Wno-unused -Wno-parentheses -c FirstJNI.c
gcc -Wl,-soname=libFirstJNI.so -shared-libgcc -lc -shared -o
libFirstJNI.so FirstJNI.o
If I then try and run it (after setting my LD_LIBRARY_PATH) I get:
[hsr@palain8 jni]$ /usr/java/jdk1.5.0_08/bin/java FirstJNI
in static
Exception in thread "main" java.lang.UnsatisfiedLinkError:
/users/hsr/apache-tomcat-4.1.32/webapps/perf/jni/libFirstJNI.so:
/users/hsr/apache-tomcat-4.1.32/webapps/perf/jni/libFirstJNI.so: cannot
open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at FirstJNI.<clinit>(FirstJNI.java:9)
This is strange since it is giving me a fully qualified path and if I do
an ls of that path the file is there. So, just for fun I removed the
file, tried again and got:
[hsr@palain8 jni]$ /usr/java/jdk1.5.0_08/bin/java FirstJNI
in static
Exception in thread "main" java.lang.UnsatisfiedLinkError: no FirstJNI
in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at FirstJNI.<clinit>(FirstJNI.java:9)
This indicates to me that in the first example it really knew the file
was there and that there was something else wrong. Next I went to the
demo directory of the java 1.5.0_8 install and grabbed an .so file out
of there and copied t to my directory. Now I get:
[hsr@palain8 jni]$ /usr/java/jdk1.5.0_08/bin/java FirstJNI
in static
entered main
creating new FirstJNI
Exception in thread "main" java.lang.UnsatisfiedLinkError: displayHelloWorld
at FirstJNI.displayHelloWorld(Native Method)
at FirstJNI.main(FirstJNI.java:20)
This is exactly what I would expect and the fact that this time it found
the .so indicates to me that it has nothing to do with my misnaming the
methods. So, I can only conclude that it is seeing my .so but not
recognizing it as valid which indicates that I am not linking it correctly.
After this long winded posting does anyone have any words of wisdom or
suggestions?
Thanks
Howard
- 16
- Need a second (mouse-) pointerHi!
I need a second (mouse-) pointer in my swing-based application. I like
to use it as a "ghost mouse pointer". It'll be controlled by the
application and not by an other input device.
So, do you know a way to do that trick?
Much thanks in advance,
Christian
- 16
- How to use an unsigned number in Java?People, is there a library that allow me to use unsigned numbers? I need
this to implement a protocol but I don't want to have to keep masking a
long number.
- 16
- SinotticoDovrei sviluppare un sinottico in java qualche idea non so da dove partire
Grazie
|
| Author |
Message |
buffer_88

|
Posted: 2004-9-26 9:40:00 |
Top |
java-programmer, Project confusion
Okay I'm not exactly sure what I'm supposed to do. I know I should
create a file that creates an abstract tree but I can't figure out
exactly what the other programs do and how I should use them to
implement an abstract tree. So if someone could please shed some light
as to what direction I should be going in it would be a lot of help.
The website as to where the assignment is located is as follows:
http://www.cs.uiowa.edu/~slonnegr/plc/. The pdf that describes the
homework is under the link Parse Homework under the Homework header.
Agains thanks for the help.
|
| |
|
| |
 |
Hal Rosser

|
Posted: 2004-9-26 13:25:00 |
Top |
java-programmer >> Project confusion
"Henry Jordon" <email***@***.com> wrote in message
news:email***@***.com...
> Okay I'm not exactly sure what I'm supposed to do. I know I should
> create a file that creates an abstract tree but I can't figure out
> exactly what the other programs do and how I should use them to
> implement an abstract tree. So if someone could please shed some light
> as to what direction I should be going in it would be a lot of help.
> The website as to where the assignment is located is as follows:
> http://www.cs.uiowa.edu/~slonnegr/plc/. The pdf that describes the
> homework is under the link Parse Homework under the Homework header.
> Agains thanks for the help.
You should really get clarification from Professor Slonneger
Also, you should have noted in your syllabus:
Policies
1) You are encouraged to discuss the course material with other students,but
all written work and programming projects must be your work alone.The grader
will be looking for similarities in assignment submissions.
2) The Departmental policy with regard to cheating suggests a penalty
between a zero on the assignment and an F in the course for a first offense.
A second offense will result in a penalty between an F in the course and a
recommendation of expulsion to the Dean of the College. The full policy on
academic misconduct is on-line in the College's Student Academic Handbook
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.769 / Virus Database: 516 - Release Date: 9/25/2004
|
| |
|
| |
 |
Professor Slonneger

|
Posted: 2004-9-26 17:21:00 |
Top |
java-programmer >> Project confusion
Quite correct young man.
|
| |
|
| |
 |
Brusque

|
Posted: 2004-9-26 18:28:00 |
Top |
java-programmer >> Project confusion
"Professor Slonneger" <Professor email***@***.com> wrote in message
news:yRv5d.4987$email***@***.com...
> Quite correct young man.
>
>
ROFL
|
| |
|
| |
 |
Mark Murphy

|
Posted: 2004-9-27 5:46:00 |
Top |
java-programmer >> Project confusion
Henry Jordon wrote:
> Okay I'm not exactly sure what I'm supposed to do. I know I should
> create a file that creates an abstract tree but I can't figure out
> exactly what the other programs do and how I should use them to
> implement an abstract tree. So if someone could please shed some light
> as to what direction I should be going in it would be a lot of help.
> The website as to where the assignment is located is as follows:
> http://www.cs.uiowa.edu/~slonnegr/plc/. The pdf that describes the
> homework is under the link Parse Homework under the Homework header.
> Agains thanks for the help.
I'd give you 2 points for acknowledging that this is a HW problem and
asking for direction rather than asking for anyone to solve the problem
for you!
Anyway, first you should try to clarify this with the teacher, he's the
only one that really matters, you need to understand what he is looking
for. When you talk to him I would also talk to him about posting to
newsgroups. Some teachers will realize that used correctly it is a
resource to help you learn, some don't. Find out his stance, you don't
know if he visits here! And if something comes of it, it is better to be
open early before you come to finals and then he raises a stink.
If I get your question right, you don't understand why he is asking for
multiple files. Think of it this way. Except for very simple programs
you never throw everything into one method. Instead, you write multiple
methods that do one thing well, this eliminates redundant code. You do
the same thing with multiple class/files. Ex. ParseWren.java should be
passed exactly what he describes and should return exactly what he
describes. It should not contain anything to print the output, thats
handled in ParseDriver.java.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Java Newbie Question: Character Sets, Unicode, et al [Long]Roedy Green wrote:
> Ve need some definitions that make clear the distinction between:
> an character set,
> a character
> a glyph
> a font
> an encoding.
I'll take a stab at it.
I decided to see what Unicode had to say on the matter. That seemed
relevant, but may have been a mistake. In any event, here are some
possibly relevant defintions from the Unicode 4.0 glossary
(http://www.unicode.org/glossary/):
==== From the Unicode 4.0 Glossary ====
Abstract Character. A unit of information used for the organization,
control, or representation of textual data. (See Definition D3 in
Section 3.3, Characters and Coded Representations .)
Character. (1) The smallest component of written language that has
semantic value; refers to the abstract meaning and/or shape, rather than
a specific shape (see also glyph), though in code tables some form of
visual representation is essential for the reader's understanding. (2)
Synonym for abstract character. (See Definition D3 in Section 3.3,
Characters and Coded Representations .) (3) The basic unit of encoding
for the Unicode character encoding. (4) The English name for the
ideographic written elements of Chinese origin. (See ideograph (2).)
Character Encoding Form. Mapping from a character set definition to the
actual code units used to represent the data.
Character Encoding Scheme. A character encoding form plus byte
serialization. There are seven character encoding schemes in Unicode:
UTF-8, UTF-16, UTF-16BE, UTF-16LE, UTF-32, UTF-32BE and UTF-32LE.
Character Set. A collection of elements used to represent textual
information.
Coded Character Set. A character set in which each character is assigned
a numeric code point. Frequently abbreviated as character set, charset,
or code set.
Code Point. (1) A numerical index (or position) in an encoding table
used for encoding characters. (2) Synonym for Unicode scalar value.
Code Unit. The minimal bit combination that can represent a unit of
encoded text for processing or interchange. (See Definition D5 in
Section 3.3, Characters and Coded Representations .)
Encoded Character. An abstract character together with its associated
Unicode scalar value (code point). By itself, an abstract character has
no numerical value, but the process of "encoding a character" associates
a particular Unicode scalar value with a particular abstract character,
thereby resulting in an "encoded character."
Encoding Form. (See character encoding form.)
Encoding Scheme. (See character encoding scheme.)
Font. A collection of glyphs used for the visual depiction of character
data. A font is often associated with a set of parameters (for example,
size, posture, weight, and serifness), which, when set to particular
values, generate a collection of imagable glyphs.
Glyph. (1) An abstract form that represents one or more glyph images.
(2) A synonym for glyph image. In displaying Unicode character data, one
or more glyphs may be selected to depict a particular character. These
glyphs are selected by a rendering engine during composition and layout
processing. (See also character.)
Glyph Image. The actual, concrete image of a glyph representation having
been rasterized or otherwise imaged onto some display surface.
==== End of Glossary Excerpt ====
Note: the glossary does not contain a definition of "character
encoding", but it seems to be used in the Unicode context as an
abbreviation for "character encoding form" (_not_ "character encoding
scheme").
The Java documentation is a bit confused and inconsistent in its
terminology with respect to characters, character sets, and character
encodings. For instance "the Java platform uses Unicode as its native
character encoding" (i18n docs), but at the same time UTF-8 and UTF-16
are referred to as "character encodings" that all Java implementations
must support. Elsewhere in the docs these are the names of "charsets",
which is to say that in some places the docs call them "encodings" and
in others "charsets." Moreover, in Java 1.4 there is now
java.nio.charset.Charset, "A named mapping between sequences of
sixteen-bit Unicode characters and sequences of bytes." This is
consistent with MIME, but different from Unicode usage (which would call
such a thing a "character encoding scheme", except that it also implies
a certain collection of characters to which it can apply).
RFC 2045 (MIME) says, in part:
NOTE: The term "character set" was originally to describe such
straightforward schemes as US-ASCII and ISO-8859-1 which have a
simple one-to-one mapping from single octets to single characters.
Multi-octet coded character sets and switching techniques make the
situation more complex. For example, some communities use the term
"character encoding" for what MIME calls a "character set", while
using the phrase "coded character set" to denote an abstract mapping
from integers (not octets) to characters.
That describes terminology similar to Unicode's current terminology, but
not exactly the same.
Java documentation has also changed over the years with regard to how it
names these things.
What a muddle.
As this is a Java newsgroup, we are stuck with the inconsistencies of
the Java documentation, at least to some extent. We are also stuck with
the ambiguity of some of our terms (note, for instance, the four (four!)
different definitions of "character" above -- I find that I personally
use the word in each of those ways). On the other hand, there seem to
be some points on which there is little disagreement (at least in
official douments) such as a "font" as a collection of glyphs, a "glyph"
as a depiction of a character, and a definite distinction between glyphs
and characters (whatever those are).
Luckilly, in a Java context there is little call for usage of the term
"character set" in the Unicode sense, so it seems reasonable and
appropriate that in this venue we should use it in the MIME / Java NIO
sense (as defined by java.nio.charset.Charset.) "Charset" is a synonym.
By an "encoding" or "character encoding", I think we generally mean what
Unicode calls a "character encoding scheme" with the implicit
recognition that in a Java context the "character encoding form" is the
one defined by Unicode. This is closely related to a "charset" as
defined in the previous paragraph.
That leaves only "character" of the five terms of interest, and I don't
think I can do much better than the Unicode glossary there, except to
note the existence of class java.lang.Character, a related but distinct
entity. A character is definitely distinct from a glyph -- the latter
is a possible representation (or part of one) of the former, for some of
the defintions of the former.
John Bollinger
email***@***.com
- 2
- basic question on Java in XPHello,
can someone please tell me how to ascertain what version (if any) of Java is
installed in a WinXP platform?
my friend needs some kind of Java module installed so that she can do a
tutorial for an online registration service.
any help would be appreciated.
Cynthia
- 3
- arrays of generic typesEclipse tells me that arrays of generic types are not legal, e.g.: it
won't allow the following:
QuadTree<MyNodeType> [] allQuadTrees;
Anyone know why this is the case?
- 4
- efficient way to replace char in StringBufferI normally use strings. Just starting to use StringBuffer.
How can I do the following better? (Replace <cr> and <lf>
with <space>)
String s = DynamicPanel.dynamicCmdArea.getText(0, len);
StringBuffer ss = new StringBuffer(s);
int j = -1;
while ((j = ss.indexOf("\n")) != -1)
ss.setCharAt(j, ' ');
while ((j = ss.indexOf("\r")) != -1)
ss.setCharAt(j, ' ');
- 5
- XMPP Java bot loop questionI want to write a bot for XMPP (Jabber) in Java (1.6) using smack
libraries (http://www.igniterealtime.org).
I have already written a GUI client using smack, so I'm familiar with
how it works.
For the bot however, I'm in doubt about the main loop in combination
with event listeners. The bot basically just sits idly (until explicitly
stopped) listening for presence changes of contacts. The presence
changes are dealt with by a roster listener.
How would I wait for those events and have the application keep
executing? I am a bit clueless aobut threads in Java, but I have used
them in Delphi...
On a side note, if anyone can shed light on how to use the commons
daemon (http://commons.apache.org/daemon/), that would be useful later
on.
Many thanks in advance,
--
Sabine Dinis Blochberger
Op3racional
www.op3racional.eu
- 6
- public static final - compilation errorOn Tue, 28 Jun 2005 17:49:11 +0200, Kamil Roman wrote:
> Hi,
>
> is it possible to initialize a public static final member of a class in
> the class' constructor? I try to do this and I receive error message:
>
> variable PLUS is declared final; cannot be assigned.
{... code ...]
No, the static finals need to be initialized before that. Why don't you
use a static initializer block (static { /* ... */ }), which would be
called at class load, in which you can initialize your members.
--
You can't run away forever,
But there's nothing wrong with getting a good head start.
--- Jim Steinman, "Rock and Roll Dreams Come Through"
- 7
- odd mouselistener issueHi Guys
I'm probably doing something stupid... but:
I've got a JFrame with borderlayout. In the centre box, I've got a
JPanel. If I add a mouselistener to the jframe, it works fine (but
I've got coords relative to the frame which is correct but not what I
want - I want coords relative to the panel). However, when I add the
mouselistener to the panel, I get no mouseevents being returned at all.
Any ideas in what way I might be being stupid?
TIA
Peter.
- 8
- Reporting tool to be used with swingHello All,
I'm looking for a report generation tool to be used in a swing project
I'm working. The resports will involve very complex charts and graphs.
Kindly suggest tools which will meet these requirements.
Thanks and Regards
Chanchal
- 9
- GUI and command lineHello,
I need to connect my GUI program with a terminal in Linux (command
line). The task is to input inside a textField the command to exectue as
for exemple: "ls -al" or "gcc whatever.c -o whatever" but everything
must be done by a GUI program.
How can I call the terminal or execute these commands?
thanks,
Marcelo
- 10
- Socializing site EXCLUSIVELY for TECHIESTechnopax.com, (http://www.technopax.com) the first socializing web
portal exclusively catering to the IT Professionals world over is
launched.
This web portal will be a common online platform for IT industry
related professionals. Technopax.com primarily targets computer
software and hardware professionals, networking & system
administrators, nano Technologists, bio-technologists, graphics &
animation designers, BPO/Call Center/ITES employees, telecom experts,
employees of IT Departments of all business organizations and
technology students etc as its members.
According to the promoters, an online platform exclusively for Techies
will improve their technical and professional skills through the
sharing of knowledge base, methodologies and skill sets. Apart from
building vast friends circle, this will also help them to be abreast
with the latest developments that happen in the tech front world over.
Technopax.com has many features for the members to collaborate and
socialize. It has text/audio and video chat, online clubs, events,
forums, classified advertisements, discussion rooms, music and video
sharing, web profiles etc. Please verify.
- 11
- ArrayList
Why this doesn't work:
ArrayList l = new ArrayList();
l.add(new String("aaa")));
String[] s = l.toArray();
JavaClassCast exception I got. What should I do?
- 12
- Arrays - component type vs Element typeCan anyone explain to me the difference between an element type and a
component type?
In the java literature, arrays are said to have component types, whereas
collections from the Collections Framework are said to have an element
type.
http://java.sun.com/docs/books/jls/second_edition/html/arrays.doc.html
states:
> The *component type* of an array may itself be an array type. The components of
> such an array may contain references to subarrays. If, starting from any
> array type, one considers its component type, and then (if that is also an
> array type) the component type of that type, and so on, eventually one must
> reach a component type that is not an array type; this is called the *element
> type* of the original array, and the components at this level of the data
> structure are called the elements of the original array.
Reading that - I thought I'd 'got' the difference, but then in 10.1 (a
para later) the terms seem to used synonomously!
> An array type is written as the name of an *element type* followed by some
> number of empty pairs of square brackets []. The number of bracket pairs
> indicates the depth of array nesting. An array's length is not part of its
> type.
> The element type of an array may be any type, whether primitive or reference.
> In particular:
>
> € Arrays with an interface type as the *component type* are allowed. The
> elements of such an array may have as their value a null reference or
> instances of any type that implements the interface.
> € Arrays with an abstract class type as the *component type* are allowed.
> The elements of such an array may have as their value a null reference or
> instances of any subclass of the abstract class that is not itself
> abstract.
When describing collections from the Collections framework there is
never any of this ambiguity/distinction - it is always "element type",
even when talking about a collection whose elements are themselves
collections.
Am I missing a "big idea"?
Any thoughts greatly appreciated.
Rob
email***@***.com
- 13
- How to download metafiles using a signed appletI want an applet which, once launched, downloads 3 metafiles (files
that it will need later on to work properly) and proceeds into a
processing phase only if the files have been successfully fetched.
So far I do not have a solution for requesting these files and writing
them locally.
Am I following the right track with URL and HttpURLConnection, or
should I be looking into packages like the Apache Jakarta project?
Is there possibly a more straightforward way to instruct the JRE to go
get file "http://www.foo.com/dist/localdata.dat" and put it at
location "C:\localdata.dat" ?
Is there possibly some correlation between the domain mentioned in my
signing certificate and the domain from which I download any
particular file?
Thanks for any ideas,
Brian Herbert Withun
- 14
- executeQuery() doesn't time out, blocks indefinitely on network failureI am developing an application that must gracefully recover from
network failures, however I noticed that executeQuery() never returns
or throws an exception for a time out when the network goes down (which
I simulated by unplugging my ethernet cable). The TCP connections of
all my pooled database connections remain open and dead even after
plugging the cable back in. Calling queryTimeout() explicitly has no
effect--executeQuery() stays blocked on network IO forever. Is there a
way to time out executeQuery(), or some way to stop it from never
returning?
I'm using version 10.2.0.1.0 of Oracle's JDBC driver with the 1.5 JDK.
Code:
import java.util.*;
import java.sql.*;
import oracle.jdbc.pool.*;
public class Oracle
{
private OracleDataSource oracleDataSource;
public Oracle() throws Exception
{
oracleDataSource = new OracleDataSource();
oracleDataSource.setURL("jdbc:oracle:oci:@dev");
oracleDataSource.setUser("dbp");
oracleDataSource.setPassword("dbp");
oracleDataSource.setConnectionCachingEnabled(true);
}
public void validate()
{
Connection c = null;
Statement s = null;
ResultSet r = null;
try
{
System.err.printf("connecting...\n");
c = oracleDataSource.getConnection();
System.err.printf("connected\n");
s = c.createStatement();
s.setQueryTimeout(1);
for (;;) {
System.err.printf("executing...\n");
r = s.executeQuery("select 1 from dual");
System.err.printf("executed\n");
r.close();
try { Thread.sleep(1000); } catch (Exception e)
{ }
}
}
catch (Exception e)
{
e.printStackTrace();
try { r.close(); } catch (Exception ee) { }
try { s.close(); } catch (Exception ee) { }
try { c.close(); } catch (Exception ee) { }
}
}
public static void main(String[] args)
{
Oracle oracle = null;
try
{
oracle = new Oracle();
oracle.validate();
}
catch (Exception e)
{
e.printStackTrace();
System.exit(1);
}
}
}
Output:
> javac -cp ./ojdbc.jar Oracle.java && java -cp .:./ojdbc.jar Oracle
connecting...
connected
executing...
executed
(ethernet cable unplugged...)
executing...
(i waited a very long time, and nothing happened...)
- 15
- TextArea and imagesHi,
I am working on a chat applet, and I would like it to show an image
next to some text received from the server. I have looked everywhere I
can think of for a similar piece of code, but I haven't succeeded yet.
I use a TextArea for inserting the text received but I don't know how
to insert the image into the TextArea next to the text. Is there any
way to do this?
I also want some of the text and the image to be hyperlinked to other
web pages for loading upon cliking. I think I have found how to do
this, although I haven't tried it yet.
Any help specially with the first question will be appreciated.
Thank you
Miguel
|
|
|