| ++i is faster than i++ in Java? |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- edit jtable with enteri am having a problem with jtable which i was unable to solve for a
last couple a days. i think there needs to be much more docs on some
tricky uses of jtable than basic JTable/TableModel usage. so far i
managed to move to the next cell when i press enter (right hand side,
instead of moving down).
i'd like to start editing in the next cell after moving from previous
cell. so, if i was in editing mode in some cell, enter should bring me
to the next cell with caret blinking in it. of course, if i wasn't
editing some cell i don't want to edit next cell.
basicly, i want to make "row edit session", for example user starts
editing a cell with f2, and as long as he press enter he edits next
cell, until he reaches the end of the row and then changes are
commited to database, just like M$Access and SQLserver does. i think i
can do this myself, all i need is little help to start edit next cell
if user moves from previous cell. i checked BasicTableUI source, and
as i see i should get the editor component and request focus on it.
but i am stuck with that.
thanks!
- 1
- Reading from URLConnection stops at JavaScript alert callHi all,
when I post form content to a server (HTTPS protocol) using a
URLConnection and then reading the servers response using a
BufferedReader, the reader seems to stop just before reading the code
for a JavaScript alert. The code for reading the response looks like
this:
in = new BufferedReader(
new InputStreamReader(connection.getInputStream()));
stbResult = new StringBuffer(5000);
while ((sResult = in.readLine()) != null) {
stbResult.append(sResult);
}
When accessing the same site with a browser a dialog pops up at the
crucial point. After clicking away the alert the rest of the HTML page
gets loaded by the browser.
When looking at the code of the HTML page later on, I can see that the
response read by my java app ended just before the JavaScript code:
<SCRIPT LANGUAGE="JavaScript">alert("xyz");</SCRIPT>
I need to read in the whole page including the alert message. How can
I get my java app to read in the JavaScript code within the HTML page
(no problem occured with the JavaScript code in the header) and the
remaining HTML code?
Thanks for thinking about this one!
Ralf
- 1
- Beginner, this will be a quick fix, so please check it out!!Hi, extreme noob here (less than one week of Java exerience, or any
programming exp)
This program i am writing from a book is suppose to ask the question
"How many gumballs? How mand kids? " , and then allow the user to
input the 2 answers. for example : 80 4
but it doesn't ask that question, it just answers without asking! any
help... ? this is from the Beginner Programming with Java for Dummies
- 2nd Edition. I typed it straight out of the book, and checked it
vary carefully. the output im currently gettins is... "Each kid gets 6
gumballs"
import java.util.Scanner;
class KeepingMoreKidsQuiet {
public static void main(String args[]) {
Scanner myScanner = new Scanner(System.in);
int gumballs;
int kids;
int gumballsPerKid;
System.out.print("How many gumballs? How many kids? ");
gumballs = myScanner.nextInt();
kids = myScanner.nextInt();
gumballsPerKid = gumballs / kids;
System.out.print("Each kid gets ");
System.out.print(gumballsPerKid);
System.out.println(" gumballs.");
}
}
- 3
- Porting C++ Template to Java GenericI've run into a road block with porting some C++ code that makes use
of templates to Java. In it, there is a main class I'll call A that
is a template class:
// C++
template <class T> class A
public:
virtual T Evaluate() const = 0;
};
Other classes extend this class:
// C++
template <class T> class B : public A<T> {
public:
B(const T &v) { value = v; }
T Evaluate() const { return value; }
private:
T value;
};
Now all of this is easy to implement in Java using Generic
programing. The issue I'm having is when I try to implement code like
this:
template <class T1, class T2> class C : public A<T2> {
public:
C(A<T1> a, A<T2> b) { t1 = a; t2 = b; }
T2 Evaluate() {
return t1->Evaluate() * t2->Evaluate();
}
private:
A<T1> t1;
A<T2> t2;
};
Java complains about about the * operator being undefined for
arguments T1, T2; Since Java doesn't have operator overloading, I
can't really see how to implement the same functionality. Has anyone
ever encountered this type of problem, or can anyone see a way around
this issue?
- 6
- web page and image processingHello,
I need to do the following. Given an URL I need to produce a thumbnail
of the webpage. If you did something similar in the past, can you
please give me some pointers?
Thank you,
Nadina
- 7
- A question about Java ThreadI see a code like this:
in a Thread:
--------------------------
public void run() {
Thread currentThread = Thread.currentThread();
while (thread == currentThread) {
try {
repaint();
thread.sleep(100);
}
catch (InterruptedException ex) {
}
}
}
---------------------------
what's the "while (thread == currentThread) " codes mean?
what is it used for?
Thank you in advance.
- 8
- Log4J problemHi everyone,
Consider the following piece of code:
Logger mylogger = Logger.getLogger(Log4JFileDeletionTest.class);
public Log4JFileDeletionTest() throws Exception
{
FileAppender fapp = new FileAppender(new
XMLLayout(),"/tmp/Log4JFileDeletionTest.log",true);
mylogger.setLevel(Level.DEBUG);
mylogger.addAppender(fapp);
mylogger.info("This is a test log");
Thread.sleep(7000);
mylogger.info("This is after deleting the file");
}
If during the Sleep(), I delete the log file, then none of the
subsequent log statements re-create the file. It remains deleted, no
exceptions get thrown and all the logs are lost.
Is there any solution to this, other than modifying the log4J code ?
Thanks in advance.
- 8
- How Robots Will Steal Your JobHumour. Lost on you?
CyberLegend aka Jure Sah <email***@***.com> wrote in message
news:email***@***.com...
> Airy R Bean wrote:
> > Are owls more intelligent than chickens?
> > Have you ever seen a shop selling Kentucky Fried Owl?
> As a mater of fact I have never seen a shop selling Kentucky Fried
> Chicken. I don't live in the USA.
> It would be curious to know what your point was tho.
- 12
- Strange problem!!(it is, atleast to me!!)Although, this is not a programming or development problem instead its
an end user problem which im facing and thought programmers /
developers could help.
I have Win XP SP2, JRE 1.5 installed with IE. Now for certain sites my
applets dont refresh after i click them (well ofcourse i click where a
click is expected :) this happens when i connect using my cable
broadband connection.
(I am connected to a local provider via LAN who provides me connection
to the primary ISP). On the other hand evrything works as expected
when i use dial up connection(using the phone line). Ive tried with
many browsers and it doesn work. Ive tried everything i could. And the
same site works well at my frnds place who has the same broadband ISP
but hes on a different LAN and rest all settings are the same.
The error i see on the console- " java.lang.NullpointerException Could
not send message".
I know the error wouldn be of much use but hope the explanation of the
problem may have some solutions.
Kindly help me.
- 15
- policy file in eclipse.Hello.
How can I declare in Eclipse the policy file (like policy.all : I don't know
if that's matter, but I have version 3.3) ?
Thanks :)
- 15
- Struts & JSTL <c:out>Greetings:
Relative newcomer to Struts and JSTL. My question is about using
<c:out>, pageContext, and request.
My experience has been doing to following in an appropriate action
class. Setting an object as an attribute of the request in the execute
method of the Action Class:
request.setAttribute("object1", Obj1);
Then in the corresponding JSP, pulling the object off the request and
casting it for use:
<% Obj1 local_Obj1 = (Obj1)request.getAttribute("object1");
Then being able to use dot notation to access methods of Obj1.
My question is that with JSTL <c:out> the object needs to be on the
pageContext. Do I need to explicitly set this? If so where? How does
this tag work in this situation?
Any help on the matter is greatly appreciated.
Thank you,
Tim Morrissey
- 16
- Sun's WTK2.5 is asking for permission to contact network every timeI've just started using the final release of Sun's wireless toolkit
(WTK) 2.5. It's asking for permission to contact the network each and
every time network access happens - I'd like to switch it to asking only
once times (or never, if possible), but can't find the option in the
docs or via the tools in WTK2.5/bin. Can anyone shed any light on this?
thanks,
lex
- 16
- Shoes,Nike Discount Shoes,( paypal accept ) ( www.gotoorder.cn )Nike Cheap Shoes,footwear, Sports ( paypal accept ) ( www.gotoorder.cn )We are the professional and serious holesaler of brand products such as shoes clothing handbags sunglasses hats belts and so on We ha e man brands such as nike adidas puma Gucci North face All goods are ith best ser ice highest qualit competiti e price and safe timel deli err If ou are interested in these goods don t hasitate to cantact us please our ebsite: http: top saler cn MSN email : top saler@hotmail com Ma 90 Sneakers pa pal accept gotoorder cn Nike Air Ma 91 Supplier pa pal accept gotoorder cn Nike Air Ma 95 Shoes Supplier pa pal accept gotoorder cn Nike Air Ma 97 Trainers pa pal accept gotoorder cn Nike Air Ma 2003 Wholesale pa pal accept gotoorder cn Nike Air Ma 2004 Shoes Wholesale pa pal accept gotoorder cn Nike Air Ma 2005 Shop pa pal accept gotoorder cn Nike Air Ma 2006 Shoes Shop pa pal accept gotoorder cn Nike Air Ma 360 Catalogs pa pal accept gotoorder cn Nike Air Ma Ltd Shoes Catalogs pa pal accept gotoorder cn Nike Air Ma Tn Men s Shoes pa pal accept gotoorder cn Nike Air Ma Tn 2 Women s Shoes pa pal accept gotoorder cn Nike Air Ma Tn 3 Customi e pa pal accept gotoorder cn Nike Air Ma Tn 4 Shoes Customi e pa pal accept gotoorder cn Nike Air Ma Tn 6 Suppl pa pal accept gotoorder cn Nike Sho NZ Shoes Suppl pa pal accept gotoorder cn Nike Sho OZ Sale pa pal accept gotoorder cn Nike Sho TL Store pa pal accept gotoorder cn Nike Sho TL 2 Shoes Store pa pal accept gotoorder cn Nike Sho TL 3 Distributor pa pal accept gotoorder cn Nike Sho Bm Shoes Distributor pa pal accept gotoorder cn Nike Sho Elite Shoes Manufacturer pa pal accept gotoorder cn Nike Sho Monster Manufacturer pa pal accept gotoorder cn Nike Sho R4 Running Shoes pa pal accept gotoorder cn Nike Sho R5 Mens Shoes pa pal accept gotoorder cn Nike Sho Ride Womens Shoes pa pal accept gotoorder cn Nike Sho Ri al Shoes Wholesaler pa pal accept gotoorder cn Nike Sho Energia Wholesaler pa pal accept gotoorder cn Nike Sho LV Sneaker pa pal accept gotoorder cn Nike Sho Turbo Suppliers pa pal accept gotoorder cn Nike Sho Classic Shoes Suppliers pa pal accept gotoorder cn Nike Sho Dendara Trainer pa pal accept gotoorder cn Nike Air Jordan 1 Seller pa pal accept gotoorder cn Nike Air Jordan 2 Shoes Seller pa pal accept gotoorder cn Nike Air Jordan 3 Collection pa pal accept gotoorder cn Nike Air Jordan 4 Shoes Collection pa pal accept gotoorder cn Nike Air Jordan 5 Chaussure Shoes pa pal accept gotoorder cn Nike Air Jordan 6 Catalog pa pal accept gotoorder cn Nike Air Jordan 7 Shoes Catalog pa pal accept gotoorder cn Nike Air Jordan 8 Customi ed pa pal accept gotoorder cn Nike Air Jordan 9 Shoes Customi ed pa pal accept gotoorder cn Nike Air Jordan 10 Wholesalers pa pal accept gotoorder cn Nike Jordan 11 Shoes Wholesalers pa pal accept gotoorder cn Nike Air Jordan 12 Factor pa pal accept gotoorder cn Nike Air Jordan 13 Shoes Factor pa pal accept gotoorder cn Nike Air Jordan 14 Shoes Sell pa pal accept gotoorder cn Nike Air Jordan 16 E porter pa pal accept gotoorder cn Nike Air Jordan 17 Shoes E porter pa pal accept gotoorder cn Nike Air Jordan 18 Offer pa pal accept gotoorder cn Nike Air Jordan 19 Shoes Offer pa pal accept gotoorder cn Nike Air Jordan 20 Manufacture pa pal accept gotoorder cn Nike Jordan 21 Shoes Manufacture pa pal accept gotoorder cn Nike Air Force 1 Lo Director pa pal accept gotoorder cn Air Force 1 High Shoes Director pa pal accept gotoorder cn Nike Air Force 1 Custom Importer pa pal accept gotoorder cn Air Force 1 Dollar Shoes Importer pa pal accept gotoorder cn Nike Air Force 1 Clear Sales pa pal accept gotoorder cn Air Force 1 Car ing Shoes Sales pa pal accept gotoorder cn Timberland Boots High Offers pa pal accept gotoorder cn Timberland Boots Lo Sell pa pal accept gotoorder cn Timberland Boots Mid Shoes Bu er pa pal accept gotoorder cn Timberland Boots Womens Bu er pa pal accept gotoorder cn Adidas Good Year Bu pa pal accept gotoorder cn Adidas Running Shoes Bu pa pal accept gotoorder cn Adidas Football Shoes Selection pa pal accept gotoorder cn Adidas Basketball Shoes Discount pa pal accept gotoorder cn Adidas 35 Years 35th Anni ersar pa pal accept gotoorder cn Adidas T MAC 3 5 4 5 5 6 pa pal accept gotoorder cn Adidas 35 Years 35th Anni ersar pa pal accept gotoorder cn Jordans Wholesale pa pal accept gotoorder cn Cheap Jordans Wholesale pa pal accept gotoorder cn Jordans Retro Wholesale pa pal accept gotoorder cn Air Jordans Wholesale pa pal accept gotoorder cn Nike Shoes Wholesale China pa pal accept gotoorder cn Discount Jordans Price Wholesale pa pal accept gotoorder cn Wholesale Nike Distributor pa pal accept gotoorder cn Wholesale Nike Sneaker pa pal accept gotoorder cn Wholesale Nike Air Force 1 pa pal accept gotoorder cn Air Clear Force One Wholesale pa pal accept gotoorder cn Nike Air Force Wholesale pa pal accept gotoorder cn Bu Jordans Wholesale pa pal accept gotoorder cn Wholesale Nike Tennis Shoes pa pal accept gotoorder cn Jordans Retro Wholesale pa pal accept gotoorder cn Wholesale Kid Jordans pa pal accept gotoorder cn Wholesale Nike Dunk pa pal accept gotoorder cn Authentic Jordans Wholesale pa pal accept gotoorder cn Nike Shoes Wholesale China pa pal accept gotoorder cn Wholesale Custom Jordans pa pal accept gotoorder cn Air China Jordans Wholesale pa pal accept gotoorder cn Jordans Retro Wholesale pa pal accept gotoorder cn Nike Air Jordan Wholesale pa pal accept gotoorder cn Nike Golf Wholesale pa pal accept gotoorder cn Wholesale Jordans pa pal accept gotoorder cn Wholesale Nike Sho pa pal accept gotoorder cn Wholesale Basketball Shoes Nike pa pal accept gotoorder cn Air Jordans Price Wholesale pa pal accept gotoorder cn Jordans Kid Wholesale pa pal accept gotoorder cn Wholesale Air Force One And Jordans pa pal accept gotoorder cn Jordans Shoes Wholesale pa pal accept gotoorder cn Wholesale Air Jordans pa pal accept gotoorder cn Air Jordans At Wholesale Price pa pal accept gotoorder cn Wholesale Nike Tennis Shoes pa pal accept gotoorder cn Wholesale NIKE Sneakers pa pal accept gotoorder cn Nike factor pa pal accept gotoorder cn Nike shop pa pal accept gotoorder cn Nike store sale and Wholesale all of Nike stock Shoes e ha e man t pe of NIKE Sneakers :Nike discount Shoes pa pal accept gotoorder cn Nike cheap Shoes Nike stock Shoes pa pal accept gotoorder cn Nike Trainers Nike Sneakers pa pal accept gotoorder cn Nike Running Shoes Nike Basketball pa pal accept gotoorder cn Shoes Nike Discount Shoes pa pal accept gotoorder cn Nike Cheap Shoes foot ear Sports pa pal accept gotoorder cn Shoes Nike Shoes Wholesale si es include pa pal accept gotoorder cn Nike men s Shoes Nike pa pal accept gotoorder cn omen s Shoes Nike mens Shoes pa pal accept gotoorder cn Nike omens Shoes Nike men Shoes Nike pa pal accept gotoorder cn omen Shoes Nike kids Shoes pa pal accept gotoorder cn Nike child Shoes Nike discount pa pal accept gotoorder cn Shoes Nike in pa pal accept gotoorder cn
- 16
- jsp - fetching fresh inserted data - reload issue?hi ng,
i have a form, where a user can input some data.
after pressing submit, the controller.jsp makes some
validations and shall list up this new entry.
in short, my problem is, that this newest entry is
not shown - but is correctly inserted into the db.
+ form.jsp : holds the form
+ controller.jsp : inserts form data into db,
and queries the db to show the newest entry.
after refreshing the site by hand, the newest entry
is listed, BUT also in the db (duplicate in db!).
i tried some java script solutions, top.mainFrame.location.reload()
and adding some META-TAG in the HEAD-Tag of HTML, but no
effects...
feedback is appreciated, thanks in advance.
with regards,
jonas
- 16
- Unc path on IntellijHi
Is there a I can add unc path when ading Jar/Directory to Module
Libraries on Intellij ?
|
| Author |
Message |
jrefactors

|
Posted: 2005-10-25 13:19:00 |
Top |
java-programmer, ++i is faster than i++ in Java?
I want to know in Java, is prefix operator faster than postfix
operator?
for example, ++i is faster than i++. I know in C++, this is the case,
but not sure if Java is the same.
please advise. thanks!!
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2005-10-25 13:59:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
email***@***.com wrote:
> I want to know in Java, is prefix operator faster than postfix
> operator?
What did your bechmark suggest? Post the code and I'll
give you some figures for my machine as well.
|
| |
|
| |
 |
Thomas Hawtin

|
Posted: 2005-10-25 15:01:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
email***@***.com wrote:
> I want to know in Java, is prefix operator faster than postfix
> operator?
>
> for example, ++i is faster than i++. I know in C++, this is the case,
> but not sure if Java is the same.
The issue in C++ occurs when the ++ postfix operator is overloaded. The
overload function needs to return a copy of the original object. The
prefix operator can get away with just returning a reference.
Java does not (yet) allow operator overloading, so the issue does not arise.
Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-10-25 18:04:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
On 24 Oct 2005 22:18:33 -0700, email***@***.com wrote, quoted or
indirectly quoted someone who said :
>I want to know in Java, is prefix operator faster than postfix
>operator?
>
>for example, ++i is faster than i++. I know in C++, this is the case,
>but not sure if Java is the same.
Java is a language. It does not have a speed. All you can talk about
is the code generated by some particular compiler/runtime
implementation on some particular computer.
In theory ++i should be slightly slower than i++ since i can be used
right away with i++, then incremented at leisure any time there is a
hole in the instruction pipeline to do it before i is again next
needed. With ++i, all has to wait while i is first incremented.
However, a clever optimiser could likely do either equally quickly by
fitting in the increment ahead of time in some unused pipeline time.
In a machine like the AMDs, you don't even see this level of
optimisation. It is all done on the fly by hardware.
It is not the sort of thing to fret over. Most idiomatic code uses
i++ for historic reasons. Avoiding confusing others by using i++ when
you have a choice.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
|
| |
|
| |
 |
Thomas Hawtin

|
Posted: 2005-10-25 22:57:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
Roedy Green wrote:
>
> It is not the sort of thing to fret over. Most idiomatic code uses
> i++ for historic reasons. Avoiding confusing others by using i++ when
> you have a choice.
Or ++i because it is more consistent with C++ code and is a simpler
operator. Just one or the other.
Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
|
| |
|
| |
 |
Tris Orendorff

|
Posted: 2005-10-26 0:36:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
email***@***.com wrote in
news:email***@***.com:
> I want to know in Java, is prefix operator faster than postfix
> operator?
>
> for example, ++i is faster than i++. I know in C++, this is the case,
> but not sure if Java is the same.
>
>
> please advise. thanks!!
I advise you to use the ++C compiler because I KNOW it is faster than the
C++ compiler.
--
Sincerely,
Tris Orendorff
[Two antennae meet on a roof, fall in love and get married. The ceremony
wasn't much, but the reception was excellent.]
|
| |
|
| |
 |
Kari Ikonen

|
Posted: 2005-10-26 2:12:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
email***@***.com wrote:
> I want to know in Java, is prefix operator faster than postfix
> operator?
>
> for example, ++i is faster than i++. I know in C++, this is the case,
> but not sure if Java is the same.
>
Neither one is faster in java, since code generated for
"i++", "++i", "i += 1" and "i = i + 1" is exactly same.
--
KI
|
| |
|
| |
 |
Benji

|
Posted: 2005-10-26 3:35:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
In comp.lang.java.programmer email***@***.com wrote:
> I want to know in Java, is prefix operator faster than postfix
> operator?
> for example, ++i is faster than i++. I know in C++, this is the case,
> but not sure if Java is the same.
rule 0: the compiler is smarter than you are.
chances are any code that you write with either ++i or i++ is going to
get compiled to the exact same code. if javac (or the java vm, depending
on where the optimization is made) detects that it doesn't to depend on
what the result is, it's probably going to generate the same native code.
Even if there were a slight performance increase, it would be SO
incredibly small compared to all of the other overheads in your program
that it is completely not worth worrying about. I guarentee you that a
there is no program you could write that would result in more than a
.01% overhead due to doing the increment the "wrong way", if there
was a wrong way.
Your real adversary is excessive memory usage on most systems. As far as
how you code your algorithms, what is more important is readability and
maintainability (within reason - obviously if you affect the big-O of
the algorithm, or if it is a very tightly-run loop)
If you have a program where something like that would matter, you
probably shouldn't be using java in the first place, since being
garbage-collected is a pretty big overhead.
But, in summation, I'd be willing to bed that they'd both get compiled
down to the same code. (in java or in c) Especially with variables with
function-scope, the java compiler has plenty of opportunity to optimize
away any "inefficiencies" you might have. You'd be surprised at how
smart they are on the method level.
A common mistake that people make in c is thinking that using inlined
assembly will make their program faster, when in reality, they're just
sticking a block of unoptimizable code in the middle of their function,
and crippling the compiler's ability to do its job as well as it could.
--
Of making better designs there is no end,
and much refactoring wearies the body.
|
| |
|
| |
 |
Benji

|
Posted: 2005-10-26 3:41:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
In comp.lang.java.programmer email***@***.com wrote:
> I want to know in Java, is prefix operator faster than postfix
> operator?
> for example, ++i is faster than i++. I know in C++, this is the case,
> but not sure if Java is the same.
rule 0: the compiler is smarter than you are.
chances are any code that you write with either ++i or i++ is going to
get compiled to the exact same code. if javac (or the java vm, depending
on where the optimization is made) detects that it doesn't to depend on
what the result is, it's probably going to generate the same native code.
Even if there were a slight performance increase, it would be SO
incredibly small compared to all of the other overheads in your program
that it is completely not worth worrying about. I guarentee you that a
there is no program you could write that would result in more than a
.01% overhead due to doing the increment the "wrong way", if there
was a wrong way.
Your real adversary is excessive memory usage on most systems. As far as
how you code your algorithms, what is more important is readability and
maintainability (within reason - obviously if you affect the big-O of
the algorithm, or if it is a very tightly-run loop)
If you have a program where something like that would matter, you
probably shouldn't be using java in the first place, since being
garbage-collected is a pretty big overhead.
--edit--
actually, if you have a program that is a series of tight loops,
java could actually be faster than c or c++, since it does the
actual compilation to native code on the fly. But anyway, the
point is, you don't really need to worry about it.
--end edit--
But, in summation, I'd be willing to bed that they'd both get compiled
down to the same code. (in java or in c) Especially with variables with
function-scope, the java compiler has plenty of opportunity to optimize
away any "inefficiencies" you might have. You'd be surprised at how
smart they are on the method level.
A common mistake that people make in c is thinking that using inlined
assembly will make their program faster, when in reality, they're just
sticking a block of unoptimizable code in the middle of their function,
and crippling the compiler's ability to do its job as well as it could.
--
Of making better designs there is no end,
and much refactoring wearies the body.
|
| |
|
| |
 |
Luc The Perverse

|
Posted: 2005-10-26 4:32:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
"Thomas Hawtin" <email***@***.com> wrote in message
news:435e4765$0$49772$email***@***.com...
> Roedy Green wrote:
>>
>> It is not the sort of thing to fret over. Most idiomatic code uses
>> i++ for historic reasons. Avoiding confusing others by using i++ when
>> you have a choice.
>
> Or ++i because it is more consistent with C++ code and is a simpler
> operator. Just one or the other.
>
> Tom Hawtin
C++ uses either. But I have seen i++ (by itself) much more than i++.
I don't know about . . . simpler?
When you are using i in a statement, use the one that is appropriate, they
don't return the same value.
|
| |
|
| |
 |
Thomas Hawtin

|
Posted: 2005-10-26 5:39:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
Luc The Perverse wrote:
>>
>>Or ++i because it is more consistent with C++ code and is a simpler
>>operator. Just one or the other.
>
>
> C++ uses either. But I have seen i++ (by itself) much more than i++.
You can use either in C++, but any half-decent body of code will prefer
pre-increment. The other choices are to be inconsistent or create
unnecessary temporaries.
> I don't know about . . . simpler?
Simpler in the sense that as it returns there is only one value
involved. ++i quite simply returns the value of i. i++ returns a copy of
the value that i used to have before the operation was performed, so you
have to contend with two values at once.
Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-10-26 9:07:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
On Tue, 25 Oct 2005 22:39:25 +0100, Thomas Hawtin
<email***@***.com> wrote, quoted or indirectly quoted someone
who said :
>Simpler in the sense that as it returns there is only one value
>involved. ++i quite simply returns the value of i. i++ returns a copy of
>the value that i used to have before the operation was performed, so you
>have to contend with two values at once.
Here is an SSCCE to investigate the byte code generated by i++ and
++i. Hotspot optimised code is quite another matter, investigating
pipeline lookahead yet another.
public class PreIncrement
{
/**
* investigate byte code for/pre post incremement
* disassemble with javap.exe -c PreIncrement
* @param args not used
*/
public static void main ( String[] args )
{
int post=0;
int pre=0;
for ( int i=0; i<5; i++ )
{
int m = post++;
int n = ++pre;
}
}
}
here is the disassembly
[c:\exper]javap -c PreIncrement
Compiled from "PreIncrement.java"
public class PreIncrement extends java.lang.Object{
public PreIncrement();
Code:
0: aload_0
1: invokespecial #1; //Method java/lang/Object."<init>":()V
4: return
public static void main(java.lang.String[]);
Code:
0: iconst_0
1: istore_1 // post
2: iconst_0
3: istore_2 // pre
4: iconst_0
5: istore_3 // i
6: iload_3
7: iconst_5
8: if_icmpge 29
11: iload_1 // load post
12: iinc 1, 1 // inc post
15: istore 4 // store m
17: iinc 2, 1 // inc pre
20: iload_2 // load pre
21: istore 5 // store n
23: iinc 3, 1
26: goto 6
29: return
So at the byte code level, they have the same code, only slightly
different order. Comments added are mine. JavaP has no idea what
local variables are named. They are not recorded in the class file.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-10-26 9:08:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
On Tue, 25 Oct 2005 21:12:01 +0300, Kari Ikonen
<email***@***.com> wrote, quoted or indirectly quoted someone
who said :
>Neither one is faster in java, since code generated for
>"i++", "++i", "i += 1" and "i = i + 1" is exactly same.
same number and types of instructions, but different order. See the
Javap dissassebly in my other post.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
Benji

|
Posted: 2005-10-26 9:27:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
Roedy Green, while high on whiteboard markers, wrote:
>>Neither one is faster in java, since code generated for
>>"i++", "++i", "i += 1" and "i = i + 1" is exactly same.
> same number and types of instructions, but different order. See the
> Javap dissassebly in my other post.
and, chances are that either
o the order doesn't matter, or
o the VM would generate the same native code when it compiled the
loading class.
(at least with
i++;
vs.
++i;)
if you actually use it as an expression inside of a mathematical
operation, all bets are off, because you're actually doing something
different. But still...worry more about readability than speed.
You should generally not be using an increment operator inside of an
expression. Even if it's easy for you to understand...it may not be
for someone else reading your code.
--
Of making better designs there is no end,
and much refactoring wearies the body.
|
| |
|
| |
 |
Tim Smith

|
Posted: 2005-10-26 11:36:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
In article <435e962b$0$8242$email***@***.com>,
"Luc The Perverse" <email***@***.com> wrote:
> > Or ++i because it is more consistent with C++ code and is a simpler
> > operator. Just one or the other.
> >
>
> C++ uses either. But I have seen i++ (by itself) much more than i++.
>
> I don't know about . . . simpler?
>
> When you are using i in a statement, use the one that is appropriate, they
> don't return the same value.
In C++, you have to consider the possibility of overloaded operators.
If you are doing the ++ just for the side effect of incrementing i, then
it is probably safest to use ++i, because if i is an object with an
overloaded ++ operator, then i++ logically involves making a copy of the
object. That copy is not used, and the optimizer *should* get rid of
it, but might as well play it safe and use ++i.
--
--Tim Smith
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-10-26 13:29:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
On Wed, 26 Oct 2005 03:35:36 GMT, Tim Smith
<email***@***.com> wrote, quoted or indirectly quoted
someone who said :
>That copy is not used, and the optimizer *should* get rid of
>it, but might as well play it safe and use ++i.
does this happen even when there are no overloaded operators defined
anywhere?
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
Matt Atterbury

|
Posted: 2005-10-26 14:36:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
Roedy Green <email***@***.com> writes:
> On Wed, 26 Oct 2005 03:35:36 GMT, Tim Smith
> <email***@***.com> wrote, quoted or indirectly quoted
> someone who said :
>
> >That copy is not used, and the optimizer *should* get rid of
> >it, but might as well play it safe and use ++i.
> does this happen even when there are no overloaded operators defined
> anywhere?
A C++ compiler can only optimise this if the postfix increment
operator is being inlined, as otherwise it has no control over the
code.
Virtual methods/operators cannot be inlined.
So, as long as the operator is not virtual and is being inlined, it
should make no difference about whether the operator is overloaded or
not, and it is *possible* for the compiler to optimise the return
value away.
However, it is not necessarily easy for the compiler to determine how
to do this; simply removing the `return' code might not be sufficient.
m.
|
| |
|
| |
 |
bcd

|
Posted: 2005-10-26 17:40:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
In article <email***@***.com>,
Tim Smith <email***@***.com> wrote:
>
>In C++, you have to consider the possibility of overloaded operators.
>If you are doing the ++ just for the side effect of incrementing i, then
>it is probably safest to use ++i, because if i is an object with an
>overloaded ++ operator, then i++ logically involves making a copy of the
>object. That copy is not used, and the optimizer *should* get rid of
>it, but might as well play it safe and use ++i.
IIRC, it might also have side effects that you can notice if the copy
constructor changes some global state. E.g., it might increase a
global counter that keeps track of how many objects if its kind have
been created.
Cheers
Bent D
--
Bent Dalager - email***@***.com - http://www.pvv.org/~bcd
powered by emacs
|
| |
|
| |
 |
Thomas Hawtin

|
Posted: 2005-10-27 2:15:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
Matt Atterbury wrote:
>
> A C++ compiler can only optimise this if the postfix increment
> operator is being inlined, as otherwise it has no control over the
> code.
The compiler will also need access to the relevant constructor code.
> Virtual methods/operators cannot be inlined.
For many, but not all compilers. Virtual methods can be inlined in a
similar manner to HotSpot. However, it helps to have profiling data.
Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
|
| |
|
| |
 |
Tim Tyler

|
Posted: 2005-10-27 15:34:00 |
Top |
java-programmer >> ++i is faster than i++ in Java?
In comp.lang.java.programmer Kari Ikonen <email***@***.com> wrote or quoted:
> email***@***.com wrote:
> > I want to know in Java, is prefix operator faster than postfix
> > operator?
> >
> > for example, ++i is faster than i++. I know in C++, this is the case,
> > but not sure if Java is the same.
>
> Neither one is faster in java, since code generated for
> "i++", "++i", "i += 1" and "i = i + 1" is exactly same.
Of course, the bytecode generated by i++ and ++i will usually
be different from each other when those statements are used
in an expression.
As I recall, a bunch of us once did some tests to see whether
for (int x = 0; x < max; x++) {...}
...was faster than...
for (int x = max; --x >= 0; ) {...}
At the time it wasn't - despite the fewer statmenents, and the compare
with 0.
The first loop was faster. Presumably, that was an idiom the
compiler recognised better and optimised for more successfully.
--
__________
|im |yler http://timtyler.org/ email***@***.com Remove lock to reply.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Sams Teach Yourself Java 6 in 21 Days - Installation ErrorHi,
I have just bought the book Sams "Teach Yourself Java 6 in 21 Days",
and am getting an error installing the JDK supplied with the book.
After running "start.exe", I select the AMD 64 installation package.
After the InstallShield package loads up, I get an error, "This
installation package is not supported by this processor type. Contact
your product vendor.".
The installation then aborts and I cannot get any further.
I have an HP PC with AMD Athlon 64 X2 processor, running Windows
Vista.
Has anyone installed the software successfully on a similar platform,
or knows what might be wrong?
Thanks in advance for any help.
- 2
- Loading a properties file using ResourceBundleI try to load a properties file using ResourceBundle. However, when I print
out the data in the map table, they are not in order as in the properties
file.
Is there a way lo load the properties file using the ResourceBundle so that
the data in the map table are listed in order as in the actual properties
file.
Example:
The properties file contains
ID1
ID2
ID3
After loaded and when printed out from tha map table, it displayed as
ID2
ID1
ID3
Thanks
--
Message posted via http://www.javakb.com
- 3
- How to set ProcessingInstruction in jdom Document?Hi all,
i try to make xml file with jdom, and also i made xsl file for presenting
xml in browser.
because of that i need to add processing instuction in xml file
...
<?xml-stylesheet type="text/xml" href="test.xsl" ?>
<root>
...
</root>
i did :
Element root = new Element("root");
Document document = new Document(root);
ProcessingInstruction pi = new ProcessingInstruction("xml-stylesheet",
"type='text/xsl' href='test.xsl'");
document.addContent(pi);
...
i got xml file like this
<?xml version=1.0 ?>
<root>
...
</root>
<?xml-stylesheet type="text/xsl" href="test.xsl" ?>
how to put this line
<?xml-stylesheet type="text/xsl" href="test.xsl" ?>
in front of <root>
thanks
- 4
- How to Call two servletsHi Everyone,
My most of programming experience is in Microsoft tools. mainly ASP. And in
ASP we can "Include" one ASP file in an another ASP file. Can we do some
thing similar with Servlets also..
Say i want to Display two Lines on my Web page.
This is First Test Line from Servlet one
This is Second Test Line from Servlet Two.
Where the line as it says come from servlet one and line two will come from
servelt 2.. Or say i have a Main Servlet and now i want to call these 2
servlets in there from my Main Servlet.
Please help me there
Thanks
RSB
- 5
- JComboBox with Image, text and autocompletition of textHi!,
I'd like to build a JComboBobox with a JLabel object which is an icon
with text, and also i'd like to add an autocompletition to the text (an
editable JComboBobox that when you write a text inside it, searches for
the text starts with).
I've tryed to use ListCellRenderer class for rebuild the visual
renderering, but i've got also a problem with the rendering of the
selected cell.
Thank you for your help.
-Trime-
- 6
- encoding troublesHi all!
I have a byte array of data which I want to post to an php script. So I send
the representing string of the byte array using a post with utf-8 encoding.
I figured java works with UTF-16BE internally, but after receiving the utf-8
encoded post in php and converting it to back to UTF-16BE it was not the
same...
I wrote a little test and it turns out if i conver a byte array to utf-8 and
back it wont match the original byte array, but the string representing it
is the same:
String test="some test";
byte[] dest,temp;
dest = test.getBytes();
try {
temp=new String(dest).getBytes("UTF-8");
}catch(Exception e) { System.out.println(e); }
try {
test=new String(temp,"UTF-8");
System.out.println(test);
dest=test.getBytes();
} catch(Exception e) { System.out.println(e); }
if(dest==temp) System.out.println("Success!");
else System.out.println("failed");
How can I convert the UTF-8 bytes back to the original byte array? And will
this work when posting to php? Its important the binary data remains intact
instead of the string representation...
Thanks in advance,
Matthijs
- 7
- Read data with delimater using stringtokenizerHei,
I have problem with this
if i have test with
aa,bb,cc,dd
aa,,cc,dd
and use
StringTokenizer str=new StringTokenizer(str,",",false)
after i read the data will be as
aa
bb
cc
dd
aa
cc
dd
the blank data in row 2 is missing. any suggestion or any suggestion on
method using beside stringtokenizer?
Cheers,
- 8
- JSP NTLM extraction of windows usernameI found this username extraction code on "Real's How to..." site. The code
work great, but I
need help with getting it to work in my jsp/servlet
What I have done is put this code into a jsp of my own. the jsp has a form
on it. this form gets submitted to a java servlet, but the parameters
(fields from the form) are all null. If I remove the NTLM username
extraction code from the jsp, the jsp works perfectly.
I am not sure how this java scriptlet is interfering with the field values
of my form submission.
I use the hidden field 'action' to determine what happens in the servlet...,
but when i get the parameter in the servlet, its value is null, despite
having the JavaScript set it just before
submitting.
Any help or insight would be greatly appreciated!
-Eric
--- code snippet---
<jsp:useBean id="username" scope="session" class="java.lang.String"/>
<%@ page import="sun.misc.BASE64Encoder" %>
<html>
<head>
<script language="javascript">
function createNew(){
document.getElementById('action').value = 'create';
document.getElementById('form1').action ='MyServlet';
document.getElementById('form1').submit();
}
</script>
</HEAD>
<%
if(((String)request.getSession().getAttribute("username")).length() < 1){
String auth = request.getHeader("Authorization");
if (auth == null) {
response.setStatus(response.SC_UNAUTHORIZED);
response.setHeader("WWW-Authenticate", "NTLM");
return;
}
if (auth.startsWith("NTLM ")) {
byte[] msg = new
sun.misc.BASE64Decoder().decodeBuffer(auth.substring(5));
int off = 0, length, offset;
String s;
if (msg[8] == 1) {
off = 18;
byte z = 0;
byte[] msg1 = {(byte)'N', (byte)'T', (byte)'L', (byte)'M',
(byte)'S',
(byte)'S', (byte)'P', z,
(byte)2, z, z, z, z, z, z, z,
(byte)40, z, z, z, (byte)1, (byte)130, z, z,
z, (byte)2, (byte)2, (byte)2, z, z, z, z, //
z, z, z, z, z, z, z, z};
response.setStatus(response.SC_UNAUTHORIZED);
response.setHeader("WWW-Authenticate", "NTLM "
+ new
sun.misc.BASE64Encoder().encodeBuffer(msg1).trim());
return;
}
else if (msg[8] == 3) {
off = 30;
length = msg[off+1]*256 + msg[off];
offset = msg[off+3]*256 + msg[off+2];
String ud = new String(msg, offset, length);
length = msg[off+9]*256 + msg[off+8];
offset = msg[off+11]*256 + msg[off+10];
String un = new String(msg, offset, length);
request.getSession().setAttribute("username",un);
request.getSession().setAttribute("userdomain",ud);
}
else
return;
}
}
%>
<body>
<form method="post" action="" name='form1' id='form1'>
<input type="hidden" name="action" id="action" value="">
<table>
<tr>
<td><input type="button" value="New" onClick='createNew()'></td>
</tr>
</table>
</form>
</body>
</html>
- 9
- WMA compatible handsetsHello,
does anyone have an idea where I can get a complete list of handsets
that support WMA 1.0 and 1.1.
I had a look at:
http://developers.sun.com/techtopics/mobility/device/pub/device/ but it
look quite outdated.
Also if the handset support wma - does it mean the j2me app will be
able to send sms messages?
Thanks in advance,
Kriton
- 10
- Browser shuts down....I am having some problems with sites that have certain Java features. At
some web sites I get a grey box with an X... other web sites the browser
shuts down and goes away completely. It also puts a Notepad text doc. on my
desk top every time the browser disappears. (copy of this is below)
I have done everything I can think of to resove this situation... MS JVM and
also Sun.... Uninstal - install.... I have almost given up. It is sad that I
can only access half of the internet. I have gone to the web sites listed in
this forum that checks Java. Some say I am Java enabled, some have the greay
box and others shut my browser down.
I am running XP and IE 6.0.2800.1106xpsp2.030422-1633
An example of a web site that shuts down my browser is here. This is just
the web site to our local news program. www.katu.com
I have been to the brink of frustration and back again more times than I can
count trying to troubleshoot this situation.
Gary
<<<<<<<<
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D1C4663
Function=[Unknown.]
Library=C:\Program Files\Java\j2re1.4.1_03\bin\fontmanager.dll
NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.
Current Java thread:
at sun.awt.font.NativeFontWrapper.registerFonts(Native Method)
- locked <161FA9F8> (a java.lang.Class)
at sun.java2d.SunGraphicsEnvironment.addPathFonts(Unknown Source)
at sun.java2d.SunGraphicsEnvironment.registerFonts(Unknown Source)
at sun.java2d.SunGraphicsEnvironment.access$100(Unknown Source)
at sun.java2d.SunGraphicsEnvironment$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.java2d.SunGraphicsEnvironment.loadFonts(Unknown Source)
- locked <10813C78> (a sun.awt.Win32GraphicsEnvironment)
at sun.java2d.SunGraphicsEnvironment.mapFontName(Unknown Source)
at java.awt.Font.initializeFont(Unknown Source)
at java.awt.Font.<init>(Unknown Source)
at advnewsticker.init(advnewsticker.java:81)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Dynamic libraries:
0x00400000 - 0x00419000 C:\Program Files\Internet Explorer\iexplore.exe
0x77F50000 - 0x77FF7000 C:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F46000 C:\WINDOWS\system32\kernel32.dll
0x77C10000 - 0x77C63000 C:\WINDOWS\system32\msvcrt.dll
0x77D40000 - 0x77DC6000 C:\WINDOWS\system32\USER32.dll
0x77C70000 - 0x77CB0000 C:\WINDOWS\system32\GDI32.dll
0x77DD0000 - 0x77E5D000 C:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x7807F000 C:\WINDOWS\system32\RPCRT4.dll
0x70A70000 - 0x70AD4000 C:\WINDOWS\system32\SHLWAPI.dll
0x71700000 - 0x71849000 C:\WINDOWS\System32\SHDOCVW.dll
0x76390000 - 0x763AC000 C:\WINDOWS\System32\IMM32.DLL
0x629C0000 - 0x629C8000 C:\WINDOWS\System32\LPK.DLL
0x72FA0000 - 0x72FFA000 C:\WINDOWS\System32\USP10.dll
0x71950000 - 0x71A34000
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0
.10.0_x-ww_f7fb5805\comctl32.dll
0x773D0000 - 0x77BC2000 C:\WINDOWS\system32\SHELL32.dll
0x77340000 - 0x773CB000 C:\WINDOWS\system32\comctl32.dll
0x771B0000 - 0x772D1000 C:\WINDOWS\system32\ole32.dll
0x5AD70000 - 0x5ADA4000 C:\WINDOWS\System32\uxtheme.dll
0x10000000 - 0x10056000 C:\Program Files\ACD Systems\ImageFox\IFOXDLL.dll
0x763B0000 - 0x763F5000 C:\WINDOWS\system32\comdlg32.dll
0x77C00000 - 0x77C07000 C:\WINDOWS\system32\VERSION.dll
0x74720000 - 0x74764000 C:\WINDOWS\System32\MSCTF.dll
0x75F80000 - 0x7607C000 C:\WINDOWS\System32\BROWSEUI.dll
0x72430000 - 0x72442000 C:\WINDOWS\System32\browselc.dll
0x75F40000 - 0x75F5F000 C:\WINDOWS\system32\appHelp.dll
0x76FD0000 - 0x77048000 C:\WINDOWS\System32\CLBCATQ.DLL
0x77120000 - 0x771AB000 C:\WINDOWS\system32\OLEAUT32.dll
0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll
0x009B0000 - 0x009DB000 C:\WINDOWS\System32\msctfime.ime
0x746F0000 - 0x74716000 C:\WINDOWS\System32\Msimtf.dll
0x76200000 - 0x76298000 C:\WINDOWS\system32\WININET.dll
0x762C0000 - 0x76348000 C:\WINDOWS\system32\CRYPT32.dll
0x762A0000 - 0x762AF000 C:\WINDOWS\system32\MSASN1.dll
0x76F90000 - 0x76FA0000 C:\WINDOWS\System32\Secur32.dll
0x76620000 - 0x7666E000 C:\WINDOWS\System32\cscui.dll
0x76600000 - 0x7661B000 C:\WINDOWS\System32\CSCDLL.dll
0x76670000 - 0x76757000 C:\WINDOWS\System32\SETUPAPI.dll
0x01600000 - 0x0160B000 C:\Program Files\Adobe\Acrobat
6.0\Reader\ActiveX\AcroIEHelper.dll
0x01790000 - 0x017C8000 C:\Program Files\NewDotNet\newdotnet4_88.dll
0x71AB0000 - 0x71AC5000 C:\WINDOWS\System32\WS2_32.dll
0x71AA0000 - 0x71AA8000 C:\WINDOWS\System32\WS2HELP.dll
0x017E0000 - 0x01893000 C:\PROGRA~1\SPYBOT~1\SDHelper.dll
0x5EDD0000 - 0x5EDEA000 C:\WINDOWS\System32\olepro32.dll
0x019B0000 - 0x019D2000 C:\Program Files\WS_FTP Pro\wsbho2k0.dll
0x75E90000 - 0x75F37000 C:\WINDOWS\System32\SXS.DLL
0x01A10000 - 0x01A2C000 C:\Program Files\Norton AntiVirus\NavShExt.dll
0x01A30000 - 0x01A4A000 C:\WINDOWS\System32\ccTrust.dll
0x55900000 - 0x55961000 C:\WINDOWS\System32\MSVCP60.dll
0x76B20000 - 0x76B35000 C:\WINDOWS\System32\ATL.DLL
0x1A400000 - 0x1A47A000 C:\WINDOWS\system32\urlmon.dll
0x76170000 - 0x761F8000 C:\WINDOWS\System32\shdoclc.dll
0x74770000 - 0x747FF000 C:\WINDOWS\System32\mlang.dll
0x71AD0000 - 0x71AD8000 C:\WINDOWS\System32\wsock32.dll
0x71A50000 - 0x71A8B000 C:\WINDOWS\system32\mswsock.dll
0x71A90000 - 0x71A98000 C:\WINDOWS\System32\wshtcpip.dll
0x76EE0000 - 0x76F17000 C:\WINDOWS\System32\RASAPI32.DLL
0x76E90000 - 0x76EA1000 C:\WINDOWS\System32\rasman.dll
0x71C20000 - 0x71C6E000 C:\WINDOWS\System32\NETAPI32.dll
0x76EB0000 - 0x76EDB000 C:\WINDOWS\System32\TAPI32.dll
0x76E80000 - 0x76E8D000 C:\WINDOWS\System32\rtutils.dll
0x76B40000 - 0x76B6C000 C:\WINDOWS\System32\WINMM.dll
0x722B0000 - 0x722B5000 C:\WINDOWS\System32\sensapi.dll
0x75A70000 - 0x75B15000 C:\WINDOWS\system32\USERENV.dll
0x02030000 - 0x02231000 C:\WINDOWS\System32\msi.dll
0x605D0000 - 0x605D8000 C:\WINDOWS\System32\mslbui.dll
0x76F20000 - 0x76F45000 C:\WINDOWS\System32\DNSAPI.dll
0x76FB0000 - 0x76FB7000 C:\WINDOWS\System32\winrnr.dll
0x76F60000 - 0x76F8C000 C:\WINDOWS\system32\WLDAP32.dll
0x76FC0000 - 0x76FC5000 C:\WINDOWS\System32\rasadhlp.dll
0x63580000 - 0x6382E000 C:\WINDOWS\System32\mshtml.dll
0x5C2C0000 - 0x5C2FC000 C:\WINDOWS\ime\sptip.dll
0x74C80000 - 0x74CAC000 C:\WINDOWS\System32\OLEACC.dll
0x02A00000 - 0x02A11000 C:\WINDOWS\IME\SPGRMR.DLL
0x02A50000 - 0x02A6B000 C:\Program Files\Common Files\Symantec
Shared\Script Blocking\scrauth.dll
0x02B80000 - 0x02B9E000 C:\Program Files\Common Files\Symantec
Shared\Script Blocking\ScrBlock.dll
0x76C30000 - 0x76C5B000 C:\WINDOWS\System32\wintrust.dll
0x76C90000 - 0x76CB2000 C:\WINDOWS\system32\IMAGEHLP.dll
0x0FFD0000 - 0x0FFF3000 C:\WINDOWS\System32\rsaenh.dll
0x73D50000 - 0x73D60000 C:\WINDOWS\System32\cryptnet.dll
0x6B700000 - 0x6B790000 c:\windows\system32\jscript.dll
0x746C0000 - 0x746E7000 C:\WINDOWS\System32\MSLS31.DLL
0x6B600000 - 0x6B671000 c:\windows\system32\vbscript.dll
0x66E50000 - 0x66E8B000 C:\WINDOWS\System32\iepeers.dll
0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV
0x74CB0000 - 0x74D1F000 C:\WINDOWS\System32\mshtmled.dll
0x72D20000 - 0x72D29000 C:\WINDOWS\System32\wdmaud.drv
0x72D10000 - 0x72D18000 C:\WINDOWS\System32\msacm32.drv
0x77BE0000 - 0x77BF4000 C:\WINDOWS\System32\MSACM32.dll
0x77BD0000 - 0x77BD7000 C:\WINDOWS\System32\midimap.dll
0x6D830000 - 0x6D83F000 C:\Program
Files\Java\j2re1.4.1_03\bin\npjpi141_03.dll
0x6D790000 - 0x6D7A6000 C:\Program Files\Java\j2re1.4.1_03\bin\jpiexp32.dll
0x6D7D0000 - 0x6D7E4000 C:\Program Files\Java\j2re1.4.1_03\bin\jpishare.dll
0x6D340000 - 0x6D46B000 C:\PROGRA~1\Java\J2RE14~2.1_0\bin\client\jvm.dll
0x6D1E0000 - 0x6D1E7000 C:\PROGRA~1\Java\J2RE14~2.1_0\bin\hpi.dll
0x6D310000 - 0x6D31E000 C:\PROGRA~1\Java\J2RE14~2.1_0\bin\verify.dll
0x6D220000 - 0x6D239000 C:\PROGRA~1\Java\J2RE14~2.1_0\bin\java.dll
0x6D330000 - 0x6D33D000 C:\PROGRA~1\Java\J2RE14~2.1_0\bin\zip.dll
0x6D000000 - 0x6D105000 C:\Program Files\Java\j2re1.4.1_03\bin\awt.dll
0x6D190000 - 0x6D1E0000 C:\Program
Files\Java\j2re1.4.1_03\bin\fontmanager.dll
0x51000000 - 0x51047000 C:\WINDOWS\System32\ddraw.dll
0x73BC0000 - 0x73BC6000 C:\WINDOWS\System32\DCIMAN32.dll
0x5C000000 - 0x5C0C8000 C:\WINDOWS\System32\D3DIM700.DLL
0x6D730000 - 0x6D741000 C:\Program Files\Java\j2re1.4.1_03\bin\jpicom32.dll
0x6D2E0000 - 0x6D2EE000 C:\Program Files\Java\j2re1.4.1_03\bin\net.dll
0x6D140000 - 0x6D162000 C:\Program Files\Java\j2re1.4.1_03\bin\dcpr.dll
0x6D510000 - 0x6D58D000 C:\WINDOWS\system32\DBGHELP.dll
0x76BF0000 - 0x76BFB000 C:\WINDOWS\System32\PSAPI.DLL
Local Time = Tue Jul 22 17:28:57 2003
Elapsed Time = 9
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1_03-b02 mixed mode)
#
- 11
- inner classes and static membersCan somebody please tell me a practical reason why you couldn't have
static members (not constants) within an inner class? I know that this
is forbidden, but I haven't found a practical, concrete reason for
this... I was wondering if this was just a whimsical decision from the
designers of the language.
Thanks a lot in advance...
- 12
- SSL HostnameVerifierWas getting "hostname wrong" when connecting via HttpsURLConnection.
Setup my own HostnameVerifier, returned true, and problem went away.
However, exactly what problem did I solve, and did I introduce a
security risk? When the substitute HostnameVerifier was called, first
argument "String urlHostName" was identical to second argument
"SSLSession session.getPeerHost()", i.e., the IP address of the server
from whom the certificate was obtained. What mismatch triggered the
call to the substitute HostnameVerifier?
Thanks.
- 13
- doing something after so many times something has loadedHi am currently writing a java application. The program that i am
writing allows people to be able log on to the program using a username
and password. I want to be able to edit information in a MySQL Database
when there has been a password error 3 times. How would i go about
checking to see how many times something has happened.
Any help would be apreciated.
Thank you
- 14
- Creating us map graphics?Hello,
Does anyone know of any Java freeware that can help me generate a
US map with states being different colors? I am running JDK 1.3 for
Solaris. My intention is to color code states based on the number of
users wwe have from each state.
Thanks, - Dave
- 15
- access web service over pluginHi All,
I'm trying to access a web service over a simple plugin. The web
service is
the "helloservice" example of jwsdp 1.3 .
When I compile and run the example as java-project in eclipse, it
works!
But when I try to make a plugin, I get the error:
Endpoint address = http://localhost:8080/hello-jaxrpc/hello
hello obj: staticstub.HelloIF_Stub@5e8d7d
java.lang.NullPointerException
at com.sun.xml.rpc.soap.message.SOAPMessageContext.createMessage(SOAPMessageContext.java:114)
at com.sun.xml.rpc.client.StreamingSenderState.<init>(StreamingSenderState.java:26)
at com.sun.xml.rpc.client.StreamingSender._start(StreamingSender.java:46)
at staticstub.HelloIF_Stub.sayHello(HelloIF_Stub.java:52)
at staticstub.HelloClient.main(HelloClient.java:46)
at hallo.actions.SampleAction.run(SampleAction.java:37)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:207)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:456)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:403)
at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:397)
at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:72)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2022)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1729)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
at org.eclipse.core.launcher.Main.run(Main.java:747)
at org.eclipse.core.launcher.Main.main(Main.java:583)
Can someone help me??
Thanks!
|
|
|