comp.lang.java.programmer
http://groups-beta.google.com/group/comp.lang.java.programmer
[EMAIL PROTECTED]

Today's topics:

* JCE: generateing HmacSHA1 - 2 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6a091351c38fd2c9
* [OT] Using hobby source code in your job ? - 3 messages, 3 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a60dfe865a7807c4
* "static" prefix - to parallel "this" prefix - 3 messages, 3 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5dde10882ac2157
* Java Architect Required Immediately - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/29501f9dc05fd745
* Parse Array of Objects - string delimiter java - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6f00a610222e5584
* Help using String.split(..) - 3 messages, 3 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fca5e4b22d736835
* Zip/UnZip char [] - 4 messages, 3 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/becaa86f0228fd4f
* why does this program not end? - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9d6aab266b4c0a16
* Java speed vs. C++. - 3 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e29354c898cb3523
* JavaScript:Download - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f0a22cb5dd10a223
* applet security issues - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/826c15e115e334c0

==============================================================================
TOPIC: JCE: generateing HmacSHA1
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6a091351c38fd2c9
==============================================================================

== 1 of 2 ==
Date: Sun, Dec 5 2004 3:52 pm
From: Timo Nentwig  

Timo Nentwig wrote:

> I used to generate the hash (or MAC or whatever) with a Windows util
> called HashCalc (google :). I can enter the data to create the SHA1 from
> and I can enter data for HMAC - and the latter is the problem. I didn'
> figure out how this can be done with JCE.

Ok, in other words:

I can archieve what I want using the implemention of freenet.crypt:

            final byte[] msg = Hex.decodeHex( "010a".toCharArray() );
            final byte[] hmac = Hex.decodeHex( "090f".toCharArray() );

            final HMAC s = new HMAC( SHA1.getInstance() );
            byte[] mv = s.mac( hmac, msg, 20 );

            for ( int i = 0; i < mv.length; i++ )
                System.out.print( byte2hex( mv[i] ) );

How do I implement the same with JCE?



== 2 of 2 ==
Date: Sun, Dec 5 2004 4:04 pm
From: Timo Nentwig  

Timo Nentwig wrote:
> How do I implement the same with JCE?

            final byte[] msg = "foo".getBytes();
            final byte[] key = "bar".getBytes();

            final SecretKeySpec hmac = new SecretKeySpec( key, "HmacSHA1" );

            final Mac mac = Mac.getInstance( hmac.getAlgorithm() );
            mac.init( hmac );

            final byte[] digest = mac.doFinal( msg );





==============================================================================
TOPIC: [OT] Using hobby source code in your job ?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a60dfe865a7807c4
==============================================================================

== 1 of 3 ==
Date: Sun, Dec 5 2004 2:58 pm
From: [EMAIL PROTECTED] 

In comp.lang.c E. Robert Tisdale <[EMAIL PROTECTED]> wrote:
> Andrew Koenig wrote:

>> E. Robert Tisdale wrote:
>> 
>>>Who owns you?
>> 
>> No one.  Not any more.  That's part of the reason.

>       http://careerlaunch.jpl.nasa.gov/

Wow, now I am deeply impressed:

   "The JPL Career Launch website is compatible with
   
     Microsoft Internet Explorer versions 5.5 & 6.0
     and Netscape Navigator version 4.7 & 7.0
   
   In order to access the JPL Career Launch website using a Macintosh
   you must use Internet Explorer under a PC emulator."

And even for that they need an image... They can't create a working
website when they are supposed to do rocket science?

                                   Regards, Jens
-- 
  \   Jens Thoms Toerring  ___  [EMAIL PROTECTED]
   \__________________________  http://www.toerring.de



== 2 of 3 ==
Date: Sun, Dec 5 2004 3:03 pm
From: Joona I Palaste  

[EMAIL PROTECTED] scribbled the following
on comp.lang.c:
> In comp.lang.c E. Robert Tisdale <[EMAIL PROTECTED]> wrote:
>> Andrew Koenig wrote:
>>> E. Robert Tisdale wrote:
>>> 
>>>>Who owns you?
>>> 
>>> No one.  Not any more.  That's part of the reason.

>>      http://careerlaunch.jpl.nasa.gov/

> Wow, now I am deeply impressed:

>    "The JPL Career Launch website is compatible with
>    
>      Microsoft Internet Explorer versions 5.5 & 6.0
>      and Netscape Navigator version 4.7 & 7.0
>    
>    In order to access the JPL Career Launch website using a Macintosh
>    you must use Internet Explorer under a PC emulator."

> And even for that they need an image... They can't create a working
> website when they are supposed to do rocket science?

As well as that, I seriously doubt any part of their website actually
*requires* Billware or Netscape. I am using Mozilla 1.7.3 on Linux (an
OS which I doubt the designers of the website have ever heard of), and
I could enter as a guest and search for available jobs just fine. I
tried referring a job to another person but that option is for
registered visitors only.

-- 
/-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"We're women. We've got double standards to live up to."
   - Ally McBeal



== 3 of 3 ==
Date: Sun, Dec 5 2004 4:10 pm
From: CBFalconer  

[EMAIL PROTECTED] wrote:
> <[EMAIL PROTECTED]> wrote:
>
... snip ...
> 
>>       http://careerlaunch.jpl.nasa.gov/
> 
> Wow, now I am deeply impressed:
> 
>  "The JPL Career Launch website is compatible with
> 
>    Microsoft Internet Explorer versions 5.5 & 6.0
>    and Netscape Navigator version 4.7 & 7.0
> 
>  In order to access the JPL Career Launch website using a Macintosh
>  you must use Internet Explorer under a PC emulator."
> 
> And even for that they need an image... They can't create a working
> website when they are supposed to do rocket science?

For further (and similar impression) follow the writings of a
certain ERT in c.l.c over the past few years.  You will be amazed
that any US space entities ever reached any objectives.  I suspect
that JPL should refund any and all monies received.

-- 
Chuck F ([EMAIL PROTECTED]) ([EMAIL PROTECTED])
   Available for consulting/temporary embedded and systems.
   <http://cbfalconer.home.att.net>  USE worldnet address!






==============================================================================
TOPIC: "static" prefix - to parallel "this" prefix
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5dde10882ac2157
==============================================================================

== 1 of 3 ==
Date: Sun, Dec 5 2004 8:31 am
From: Chris Smith  

Tim Tyler <[EMAIL PROTECTED]> wrote:
> Has this been suggested before?
> 

Not that I'm aware of.

> Does it make sense to you?
> 

I don't agree with it.  The only reason that it even comes up is that 
you're refusing to use the existing language feature that allows you to 
omit the qualifier on static variables that are declared in the same 
class or a superclass.  So, in essence, instead of simplifying syntax 
you are making it more complicated.

I see use of these prefixes as adding information in places where it 
doesn't make sense in the flow of program logic.  The result is that I'd 
much rather read code that uses unqualified access to static variables 
than code that uses 'static.variableName'... though admittedly either is 
preferable to 'ThisClassName.variableName' where ThisClassName is the 
current class.

-- 
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation



== 2 of 3 ==
Date: Sun, Dec 5 2004 3:59 pm
From: Tim Tyler  

Chris Smith <[EMAIL PROTECTED]> wrote or quoted:

> The only reason that it even comes up is that 
> you're refusing to use the existing language feature that allows you to 
> omit the qualifier on static variables that are declared in the same 
> class or a superclass.  So, in essence, instead of simplifying syntax 
> you are making it more complicated.
> 
> I see use of these prefixes as adding information in places where it 
> doesn't make sense in the flow of program logic.  The result is that I'd 
> much rather read code that uses unqualified access to static variables 
> than code that uses 'static.variableName'... [...]

There's a cost to doing this sort of thing in terms of verbosity.

However there are some compensating benefits:

You get to see whether a variable is a local variable, a class
variable or an instance variable whenever you look at usage of it;
it prevents you from bending your variable names out of shape by
using a naming convention to do the same thing; and it can be
checked automatically by compilers and lint tools.

Avoiding bending names out of shape is a significant concern if
those names appear in your public interface - e.g. this:

class Point {
  public int m_x;
  public int m_y;
}

...would be painful.

IMO: currently, the biggest win comes by using "this" to distinguish 
member variables everywhere.

The corresponding approach for a) methods and b) static entities
does not appear to have such convincing benefits at the moment.
-- 
__________
 |im |yler  http://timtyler.org/  [EMAIL PROTECTED]  Remove lock to reply.



== 3 of 3 ==
Date: Sun, Dec 5 2004 8:55 pm
From: Daniel Sjöblom  

Tim Tyler wrote:
> http://checkstyle.sourceforge.net/config_coding.html#RequireThis
> 
> This forces you to distinguish between local variables,
> instance variables and static variables in you code -
> buy using "this.var" for all instance variables and
> "Classname.var" for all static variables.  It (optionally)
> does the same for all method calls.
>
> Are there any other proposals to deal with the same issue?

Try using the latest Eclipse version. It can highlight local, instance, 
static and even final variables in a different color. This is probably a 
better idea than uglifying your code, or introducing new language syntax.

-- 
Daniel Sjöblom
Remove _NOSPAM to reply by mail




==============================================================================
TOPIC: Java Architect Required Immediately
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/29501f9dc05fd745
==============================================================================

== 1 of 2 ==
Date: Sun, Dec 5 2004 10:32 am
From: [EMAIL PROTECTED] 

Java Architect, 

We currently have an opening for an Architect. The ability to work in
an agile environment is a must.

Skills Required as a "MUST HAVE"
 
· Master's degree preferred, or Bachelor's Degree in one of:
Engineering, Computer Science or Math 
· Experience using object-oriented programming languages & concepts
(6+ yrs). 
· Fluency in Java (3+ yrs), XML, Smalltalk, UML, HTTP, TCP/IP, HTML,
Windows, UNIX, Servlets. 
· Experience designing or developing distributed applications (5+
years). 
· Intense problem solving abilities 
· Ability to interact with clients and lead user requirements
definition from concept to application architecture 
· Proven track record of technical proficiency 
· Ability to work independently 
· Diverse outside interests 
· Project management experience 
· Research skills 
"Nice to have" skills:
· Experience with Extreme Programming or other agile practices 

Please forward your resume to attention:
Donald Lascelle
[EMAIL PROTECTED]
www.Objectsearch.com




== 2 of 2 ==
Date: Sun, Dec 5 2004 4:04 pm
From: "xarax"  

<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Java Architect,
>
> We currently have an opening for an Architect. The ability to work in
> an agile environment is a must.
>
> Skills Required as a "MUST HAVE"
>
> · Master's degree preferred, or Bachelor's Degree in one of:
> Engineering, Computer Science or Math
> · Experience using object-oriented programming languages & concepts
> (6+ yrs).
> · Fluency in Java (3+ yrs), XML, Smalltalk, UML, HTTP, TCP/IP, HTML,
> Windows, UNIX, Servlets.
> · Experience designing or developing distributed applications (5+
> years).
> · Intense problem solving abilities
> · Ability to interact with clients and lead user requirements
> definition from concept to application architecture
> · Proven track record of technical proficiency
> · Ability to work independently
> · Diverse outside interests
> · Project management experience
> · Research skills
> "Nice to have" skills:
> · Experience with Extreme Programming or other agile practices
>
> Please forward your resume to attention:
> Donald Lascelle
> [EMAIL PROTECTED]
> www.Objectsearch.com

Well, now we know what you want and when you want it. What are
you willing to pay for it?






==============================================================================
TOPIC: Parse Array of Objects - string delimiter java
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6f00a610222e5584
==============================================================================

== 1 of 1 ==
Date: Sun, Dec 5 2004 10:52 am
From: "marvado"  

seems to work,
all suggestions are valid for me
thank you !

"Boudewijn Dijkstra" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> "Jim Cheng" <[EMAIL PROTECTED]> schreef in bericht 
> news:[EMAIL PROTECTED]
>>
>> Pedro is asking fir a String (comma delimitted) including the name, desc, 
>> and age.
>> So the following does not work.
>>> ---------------still not tested ---------------
>>> String catlist;
>>>
>>> for (int j = 0; j < Cat.length; j++)
>>> {
>>>  if(j!=0) catlist += ",";
>>>  catlist += Cat[j].cName;
>>> }
>>>
>>>
>>
>> try:
>>
>> String catlist;
>>
>> for (int j = 0; j < Cat.length; j++)
>> {
>>  if(j!=0) catlist += ",";
>>  catlist += Cat[j].cName +","+ Cat[j].cDesc +","+ cat[j].cAge;
>> }
>
> StringBuffer buf = new StringBuffer(cat.length * 30);
>
> buf.append(cat[0].cName).append(',').append(cat[0].cDesc)
>  .append(',').append(cat[0].cAge);
> for (int j = 1; j < cat.length; j++)
> {
>  buf.append(',').append(cat[j].cName).append(',')
>    .append(cat[j].cDesc).append(',').append(cat[j].cAge);
> }
>
> String catlist = buf.toString();
>
> 






==============================================================================
TOPIC: Help using String.split(..)
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fca5e4b22d736835
==============================================================================

== 1 of 3 ==
Date: Sun, Dec 5 2004 7:51 am
From: [EMAIL PROTECTED] (Miss. Michelle Heigardt) 

Hi, don't reply to this e-mail message it doesn't exist and is to stop
my real address getting spammed.

The following Java displays

c:\dir1\dir2\fred
txt

which is what I expect. Here is the Java.

  public static void main(String[] args)
  {
    String s="c:\\dir1\\dir2\\fred.txt";
    String[] sa=s.split("[.]");
    for (int i=0;i<sa.length;i++)
      System.out.println(sa[i]);
  }

But I want to display 

c:
dir1
dir2
fred.txt

How do I use String.split to do this. When I try this I get the error
message.


  public static void main(String[] args)
  {
    String s="c:\\dir1\\dir2\\fred.txt";
    String[] sa=s.split("[\\]");
    for (int i=0;i<sa.length;i++)
      System.out.println(sa[i]);
  }

[\]
  ^
        at java.util.regex.Pattern.error(Pattern.java:1489)
        at java.util.regex.Pattern.clazz(Pattern.java:2002)
        at java.util.regex.Pattern.sequence(Pattern.java:1546)
        at java.util.regex.Pattern.expr(Pattern.java:1506)
        at java.util.regex.Pattern.compile(Pattern.java:1274)
        at java.util.regex.Pattern.<init>(Pattern.java:1030)
        at java.util.regex.Pattern.compile(Pattern.java:777)
        at java.lang.String.split(String.java:1795)
        at java.lang.String.split(String.java:1838)
        at mypackage7.Class1.main(Class1.java:19)


Thank you
Michelle. I am using Java 1.4.



== 2 of 3 ==
Date: Sun, Dec 5 2004 4:00 pm
From: "Ike"  

Backslashes are escaped...so I think you want to use:
String[] sa=s.split("[\\\\]"); //4 backslashes
-or maybe even-
String[] sa=s.split("[\\\\\\]"); //6 backslashes

try them both - one should work.

Recently, I found that if I wanted to split on, say "}{" I had to speciy
this as "\\}\\{"

 -Ike


"Miss. Michelle Heigardt" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi, don't reply to this e-mail message it doesn't exist and is to stop
> my real address getting spammed.
>
> The following Java displays
>
> c:\dir1\dir2\fred
> txt
>
> which is what I expect. Here is the Java.
>
>   public static void main(String[] args)
>   {
>     String s="c:\\dir1\\dir2\\fred.txt";
>     String[] sa=s.split("[.]");
>     for (int i=0;i<sa.length;i++)
>       System.out.println(sa[i]);
>   }
>
> But I want to display
>
> c:
> dir1
> dir2
> fred.txt
>
> How do I use String.split to do this. When I try this I get the error
> message.
>
>
>   public static void main(String[] args)
>   {
>     String s="c:\\dir1\\dir2\\fred.txt";
>     String[] sa=s.split("[\\]");
>     for (int i=0;i<sa.length;i++)
>       System.out.println(sa[i]);
>   }
>
> [\]
>   ^
> at java.util.regex.Pattern.error(Pattern.java:1489)
> at java.util.regex.Pattern.clazz(Pattern.java:2002)
> at java.util.regex.Pattern.sequence(Pattern.java:1546)
> at java.util.regex.Pattern.expr(Pattern.java:1506)
> at java.util.regex.Pattern.compile(Pattern.java:1274)
> at java.util.regex.Pattern.<init>(Pattern.java:1030)
> at java.util.regex.Pattern.compile(Pattern.java:777)
> at java.lang.String.split(String.java:1795)
> at java.lang.String.split(String.java:1838)
> at mypackage7.Class1.main(Class1.java:19)
>
>
> Thank you
> Michelle. I am using Java 1.4.





== 3 of 3 ==
Date: Sun, Dec 5 2004 4:09 pm
From: Andrew Thompson  

On 5 Dec 2004 07:51:08 -0800, Miss. Michelle Heigardt wrote:

> Hi, 

Hi.  Could you post questions of this nature to comp.lang.java.help *
rather than c.l.j.programmer in future?

* <http://www.physci.org/codes/javafaq.jsp#cljh>

<sscce>
class TestSplit {
  public static void main(String[] args)
  {
    String s="c:\\dir1\\dir2\\fred.txt";
    /* a RegEx pattern inside Java source
    needs to be 'double escaped'  */
    String[] sa=s.split("[\\\\]");
    for (int i=0;i<sa.length;i++)
      System.out.println(sa[i]);
  }
}
</sscce>

HTH

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane




==============================================================================
TOPIC: Zip/UnZip char []
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/becaa86f0228fd4f
==============================================================================

== 1 of 4 ==
Date: Sun, Dec 5 2004 3:56 pm
From: "Ike"  

Is there a means for zipping and unzipping the contents of a char [] ? I
dont want to read or write to a file, but rather, take a char array of
gzipped data (that, say, has not been written to a file) and return a char
array of unzipped data (still, not writing it to a file). Is there some
means for doing this? Thanks, Ike





== 2 of 4 ==
Date: Sun, Dec 5 2004 11:12 am
From: Sudsy  

Ike wrote:
> Is there a means for zipping and unzipping the contents of a char [] ? I
> dont want to read or write to a file, but rather, take a char array of
> gzipped data (that, say, has not been written to a file) and return a char
> array of unzipped data (still, not writing it to a file). Is there some
> means for doing this? Thanks, Ike
> 
> 

The ZipInputStream constructor takes an InputStream as an argument.
There's also a StringBufferInputStream (yes, I know it's deprecated).
So you could do something like this:

    ZipInputStream z = new ZipInputStream( new StringBufferInputStream(
      new String( char [] ) ) );

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.




== 3 of 4 ==
Date: Sun, Dec 5 2004 12:10 pm
From: Chris Smith  

Ike <[EMAIL PROTECTED]> wrote:
> Is there a means for zipping and unzipping the contents of a char [] ? I
> dont want to read or write to a file, but rather, take a char array of
> gzipped data (that, say, has not been written to a file) and return a char
> array of unzipped data (still, not writing it to a file). Is there some
> means for doing this? Thanks, Ike

You have two requests: to zip up a char[], and to unzip a char[].

If you need to zip up a char[], then that's easy, but you need to 
convert it from characters to bytes first, and then use the standard 
java.util.zip classes to zip up those bytes.  That means choosing a 
specific character encoding.  If you don't have any prior knowledge of 
the contents of your character array, then you'll need an encoding with 
100% coverage of the Unicode character set, and UTF-8 is generally the 
best choice.  If you have special knowledge -- for example you know that 
all characters will be in the more limited US-ASCII or ISO8859-1 
character sets -- then you can use those encodings instead.  You'll then 
zip up the resulting byte[], getting a second byte[] as a result.  When 
you unzip that byte[] later, you'll then need to decode the resulting 
bytes into characters using the SAME ENCODING you used to encode it in 
the first place.

Your second request doesn't make any sense at all.  The gzip algorithm 
produces bytes, not characters.  So it's impossible that you have some 
char[] containing the results of a previous gzip operation.  The only 
thing that can be unzipped via the gzip algorithm is something else 
that's already been zipped, and you therefore can't possibly unzip a 
char[].

If you need to store the results of a zip operation for some reason as 
characters, then the best way to do this is with BASE64 encoding.  This 
ensures that your data is stored as printable characters that are pretty 
much universally available in all major character sets.  You can then 
decode the resulting characters with BASE64 before unzipping it later.  
If you need a more efficient means of storage for your zipped data as 
characters, then there's a bit of a kludge that works: since the 
ISO8859-1 encoding happens to define a one-to-one mapping between 
characters and bytes, so instead of BASE64, you can decode the result of 
the gzip operation as if it were an ISO8859-1 string (or a string in any 
other encoding that defines such a one-to-one mapping), and you'll have 
characters.  However, many of those characters will not be printable, 
and may have special meaning in network transfer protocols and other 
such things; which is why BASE64 is useful.

I hope that answers your questions.

-- 
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation



== 4 of 4 ==
Date: Sun, Dec 5 2004 12:11 pm
From: Chris Smith  

Sudsy <[EMAIL PROTECTED]> wrote:
> The ZipInputStream constructor takes an InputStream as an argument.
> There's also a StringBufferInputStream (yes, I know it's deprecated).
> So you could do something like this:
> 
>     ZipInputStream z = new ZipInputStream( new StringBufferInputStream(
>       new String( char [] ) ) );

Bad Idea.  StringBufferInputStream defines a rather arbitrary mapping of 
bytes to characters, and it's unlikely to be what you want.  See my 
other post for details of better solutions.

-- 
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==============================================================================
TOPIC: why does this program not end?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9d6aab266b4c0a16
==============================================================================

== 1 of 1 ==
Date: Sun, Dec 5 2004 4:06 pm
From: "xarax"  

"Sudsy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> andthen wrote:
> <snip>
> > public class Test {
> >     public static void main(String[] args) throws Exception {
> >         Test2 h = new Test2();
> >         System.out.println("before start");
> >         h.start();
> >         System.out.println("after start");
> >     }
> > }
> >
> >
> > public class Test2 extends Thread {
> >     public void run() {
> >     System.out.println("starting run");
> >     System.out.println("ending run");
> >     }
> > }
>
> Works as expected for me, once you remove the public qualifier
> from class Test2. Here's the output from 'java -version':
>
> java version "1.4.2_02"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_02-b03)
> Java HotSpot(TM) Client VM (build 1.4.2_02-b03, mixed mode)
>
> Here's the output:
>
> before start
> after start
> starting run
> ending run
>
> Command prompt immediately follows.

Too late. You missed his reply. It was a D.U.E.
(Dumb User Error). The posted code is not the
same as what was failing.






==============================================================================
TOPIC: Java speed vs. C++.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e29354c898cb3523
==============================================================================

== 1 of 3 ==
Date: Sun, Dec 5 2004 6:36 pm
From: "@(none)" <""kanze\"@(none)"> 

Chris Uppal wrote:
 > Mike Cox wrote:

 >>Would that be a concern when I use Jakarta to run a web application?  Or
 >>does Jakarta start up and never shut down the engine?

Jakarta starts the engine at start-up, and never shuts it down.  I think
there is even a possibility to configure it to preload classes, so even
the first request can be relatively rapid.

 > The startup time is only an issue for applications that either need 
to start
 > really fast or which only run for a short time (like your example). 
For any
 > reasonably long running program, the startup time is essentially 
irrelevant
 > (however irritating while debugging).

 > One thing to beware of, though, when considering Java in a server 
environment,
 > is that the startup time makes Java a very poor choice for writing 
pure CGI
 > programs.  (But then I don't think CGI is such a wonderful idea 
anyway...)

Like everything, it has its advantages and its disadvantages.  A
separate process is the ultimate sand-box, for example, and nothing, but
absolutely nothing, in the CGI can possibly crash your server.

For most uses, however, I agree with you.

 > Incidentally, the latest Sun JVM has some tweaks to reduce the 
minimum startup
 > time.  I find them quite effective.

I seem to recall reading somewhere that there was a possibility of
having the JVM (with the standard jar-files) pre-loaded somehow, so that
start-up times would be equivalent of those for other languages.  Don't
know the details, of course.

-- 
James Kanze                                      home: www.gabi-soft.fr
Conseils en informatique orientée objet/
                        Beratung in objektorientierter Datenverarbeitung
9 pl. Pierre Sémard, 78210 St.-Cyr-l'École, France +33 (0)1 30 23 00 34



== 2 of 3 ==
Date: Sun, Dec 5 2004 11:48 am
From: Chris Smith  

Mike Cox <[EMAIL PROTECTED]> wrote:
> Hi.  I recently ran a benchmark against two simple programs, one written in
> Java and the other in C++.  The both accomplish the same thing, outputting
> "Hello World" on my screen.  The C++ program took .5 seconds to complete on
> my 400 Mhz PC while the Java program took 6.5 seconds.  

Neither of these times are even in the ballpark of what you should be 
seeing.  Do to the startup overhead that's been well-discussed in this 
group, your Java application should be running in about half a second, 
while your C++ application should take something on the order of 10 to 
50 milliseconds (that's 0.01 to 0.05 seconds).  If these apps are really 
taking that long, then you've got some other serious problems that's 
affecting BOTH your Java and C++ code.

-- 
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation



== 3 of 3 ==
Date: Sun, Dec 5 2004 11:49 am
From: Chris Smith  

Ann <[EMAIL PROTECTED]> wrote:
> > Off topic, but Win XP doesn't even have command.com :)
> --------- ya does ---------------

Yes, Windows XP does have a command.com.  However, it is not used for 
anything, and the code probably hasn't been maintained for years.  
Making use of it yourself is very ill-advised.

-- 
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==============================================================================
TOPIC: JavaScript:Download
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f0a22cb5dd10a223
==============================================================================

== 1 of 2 ==
Date: Sun, Dec 5 2004 7:05 pm
From: " JCO"  

Can somebody help me write a JavaScript that will allow a download dialog to
display then download the selected file (regardless of the file type).  That
way, they won't open a word on the computer they will download it.  They
won't open a picture or an Excel spread sheet... it will all download.  I
don't want to use a zip program because of the many folks that can't seem to
grasp unzipping files (go figure).
Thanks





== 2 of 2 ==
Date: Sun, Dec 5 2004 11:20 am
From: "Rhino"  


" JCO" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Can somebody help me write a JavaScript that will allow a download dialog
to
> display then download the selected file (regardless of the file type).
That
> way, they won't open a word on the computer they will download it.  They
> won't open a picture or an Excel spread sheet... it will all download.  I
> don't want to use a zip program because of the many folks that can't seem
to
> grasp unzipping files (go figure).
> Thanks
>
Try asking on a Javascript newsgroup like comp.lang.javascript. Java and
JavaScript, despite similar names, have nothing to do with one another.

Rhino
>






==============================================================================
TOPIC: applet security issues
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/826c15e115e334c0
==============================================================================

== 1 of 1 ==
Date: Sun, Dec 5 2004 2:07 pm
From: "Matt Humphrey"  


"Matthijs Blaas thijs_blaas hotmaildotcom>" <<remthisat> wrote in message
news:[EMAIL PROTECTED]
> >> I found that it's possible to replace a cached applet by another one
and
> >> run
> >> that new applet instead of the original one :(
> >
> > You mean if the attacker has direct access to the machine?
>
> Well, local on the client:
> If someone downloads my game applet, replaces the cached game applet with
> his own modified version in his Java cache, browses back to my website and
> plays the game again his modified version will be excecuted by his jvm.
The
> jvm doesn't seem to check if the currently cached version matches the
> version on the server.

Naturally you wouldn't care if the user ran any kind of game different from
yours but that did not affect your internet activity so the real problem is
that your game applet keeps some kind of score or other data on your server
and you would like to ensure that only your applet access and modify that
data.  There is no solution to this problem for publically available games
(e.g. those that do not require authentication.)  A client can run whatever
code the user likes and there's nothing you can do about it.  Regardless of
whether they hack your applet directly via the browser cache or if they
simply copy it and run it directly, you have no way to authenticate the
communication from that applet to your website and they are free to spoof
that communication in any way they can try.  Bottom line: you cannot rely on
the client to perform security checks for you.

Cheers,
Matt Humphrey   [EMAIL PROTECTED]  http://www.iviz.com/





==============================================================================

You received this message because you are subscribed to the Google
Groups "comp.lang.java.programmer" group.

To post to this group, send email to [EMAIL PROTECTED] or
visit http://groups-beta.google.com/group/comp.lang.java.programmer

To unsubscribe from this group, send email to
[EMAIL PROTECTED]

To change the way you get mail from this group, visit:
http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe

To report abuse, send email explaining the problem to [EMAIL PROTECTED]

==============================================================================
Google Groups: http://groups-beta.google.com 

Reply via email to