Comments for Java Competence Centre LogicaCMG https://www.bloggingaboutjava.org/cms/wordpress ...All about Java technology... Thu, 20 Sep 2007 14:40:20 +0000 http://wordpress.org/?v=2.0.2 Comment on Two-0-Four, Twelve times faster by Charles Oliver Nutter https://www.bloggingaboutjava.org/cms/wordpress/2007/04/two-0-four-twelve-times-faster/#comment-20835 Thu, 19 Apr 2007 12:35:11 +0000 https://www.bloggingaboutjava.org/cms/wordpress/2007/04/two-0-four-twelve-times-faster/#comment-20835 When we claim a "times" improvement in JRuby, we're talking about specific benchmarks that are either widely-used in the Ruby world or fairly generic. In the case of IO, we managed to improve a number of file read/write benchmarks many times...on average the improvements meant those sorts of IO operations had improved by around 6.5 times over the previous release. This is interesting and important, since those IO operations were a known bottleneck in previous releases, and since this is a runtime concern, unlike Spring's improvement at bean creation time (fairly rare in the grand scheme of execution, unlike IO). When we claim a “times” improvement in JRuby, we’re talking about specific benchmarks that are either widely-used in the Ruby world or fairly generic. In the case of IO, we managed to improve a number of file read/write benchmarks many times…on average the improvements meant those sorts of IO operations had improved by around 6.5 times over the previous release. This is interesting and important, since those IO operations were a known bottleneck in previous releases, and since this is a runtime concern, unlike Spring’s improvement at bean creation time (fairly rare in the grand scheme of execution, unlike IO).

]]>
Comment on Differences between C++, Java and C# by Matthijs Aalbregt https://www.bloggingaboutjava.org/cms/wordpress/2007/04/differences-between-c-java-and-c/#comment-20828 Thu, 19 Apr 2007 07:59:39 +0000 https://www.bloggingaboutjava.org/cms/wordpress/2007/04/differences-between-c-java-and-c/#comment-20828 Hi there, I am working in a Microsoft C# environment here (hostile territory ;-)) so I showed this post to my colleagues. We found that this is true for the primitive types like you showed in your example. However, when normal objects (another super and sub object) are used in C# then the best matching method is chosen, just as in Java. So it seems the difference between C# and Java on this matter only has to do with primitive types. Still it is a bit strange of course... Hi there,

I am working in a Microsoft C# environment here (hostile territory ;-) ) so I showed this post to my colleagues.
We found that this is true for the primitive types like you showed in your example. However, when normal objects (another super and sub object) are used in C# then the best matching method is chosen, just as in Java.
So it seems the difference between C# and Java on this matter only has to do with primitive types. Still it is a bit strange of course…

]]>
Comment on Differences between C++, Java and C# by Jesper de Jong https://www.bloggingaboutjava.org/cms/wordpress/2007/04/differences-between-c-java-and-c/#comment-20809 Wed, 18 Apr 2007 20:02:28 +0000 https://www.bloggingaboutjava.org/cms/wordpress/2007/04/differences-between-c-java-and-c/#comment-20809 The answer is...: C++: method(double): 10 method(double): 3.2 Java: method(int): 10 method(double): 3.2 C#: method(double): 10 method(double): 3,2 What is happening here? In C++ and C#, methods from superclasses are not automatically inherited into the subclass, as in Java. In Java, we are used to the fact that the compiler will look for the best matching method and call that. So, if you call method(...) with an int as a parameter, the method in the superclass will be called, because it matches exactly. In C++ and C#, the compiler first looks if it can find a method in the subclass that it can use, even if the method doesn't match exactly (i.e., it will use the method(double) in the subclass even though there is a method(int) in the subclass that matches exactly). Only if it can't find a matching method, it looks in the superclass. Note that you can make C++ behave the Java way - you'd have to add a 'using' statement to the subclass, like this (this is what was mentioned in Bjarne Stroustrup's FAQ): class Sub : public Super { public: using Super::method; void method(double d) { // ... etc. } }; I don't know how to do this in C# or if it is even possible (the C++ syntax doesn't work). I like the way Java does this better than how C++ and C# do it - it seems more logical to me to find an exactly matching method first. The answer is…:

C++:

method(double): 10
method(double): 3.2

Java:

method(int): 10
method(double): 3.2

C#:

method(double): 10
method(double): 3,2

What is happening here?

In C++ and C#, methods from superclasses are not automatically inherited into the subclass, as in Java. In Java, we are used to the fact that the compiler will look for the best matching method and call that. So, if you call method(…) with an int as a parameter, the method in the superclass will be called, because it matches exactly.

In C++ and C#, the compiler first looks if it can find a method in the subclass that it can use, even if the method doesn’t match exactly (i.e., it will use the method(double) in the subclass even though there is a method(int) in the subclass that matches exactly). Only if it can’t find a matching method, it looks in the superclass.

Note that you can make C++ behave the Java way - you’d have to add a ‘using’ statement to the subclass, like this (this is what was mentioned in Bjarne Stroustrup’s FAQ):

class Sub : public Super {
public:
using Super::method;

void method(double d) {
// … etc.
}
};

I don’t know how to do this in C# or if it is even possible (the C++ syntax doesn’t work).

I like the way Java does this better than how C++ and C# do it - it seems more logical to me to find an exactly matching method first.

]]>
Comment on A short one by Anonymous coward https://www.bloggingaboutjava.org/cms/wordpress/2007/02/a-short-one/#comment-20773 Tue, 17 Apr 2007 20:13:24 +0000 https://www.bloggingaboutjava.org/cms/wordpress/2007/02/a-short-one/#comment-20773 Of course this problem would be trivial to detect with some unit tests. Of course this problem would be trivial to detect with some unit tests.

]]>
Comment on Differences between C++, Java and C# by okke https://www.bloggingaboutjava.org/cms/wordpress/2007/04/differences-between-c-java-and-c/#comment-20625 Thu, 12 Apr 2007 07:38:54 +0000 https://www.bloggingaboutjava.org/cms/wordpress/2007/04/differences-between-c-java-and-c/#comment-20625 And the answer is ..... And the answer is …..

]]>
Comment on AppFuse Review by Quayum Sagri https://www.bloggingaboutjava.org/cms/wordpress/2005/12/appfuse-review/#comment-20323 Fri, 30 Mar 2007 09:33:26 +0000 https://www.bloggingaboutjava.org/cms/wordpress/2005/12/appfuse-review/#comment-20323 Thomas Delnoij wrote: AppFuse also generates Test Cases and the ant targets to run them. Is it stated in its true meaning. if so how does it generate. I did not find an interface to do that. Why does appFuse uses only jMock? Why not strutstestcases, springframework.test or any other implementation of junit, though they are made for the use with appropriate framework. Thomas Delnoij wrote:
AppFuse also generates Test Cases and the ant targets to run them.
Is it stated in its true meaning. if so how does it generate. I did not find an interface to do that.

Why does appFuse uses only jMock?
Why not strutstestcases, springframework.test or any other implementation of junit, though they are made for the use with appropriate framework.

]]>
Comment on Javacard introduction by Maarten Metz https://www.bloggingaboutjava.org/cms/wordpress/2007/03/javacard-introduction/#comment-20232 Tue, 27 Mar 2007 08:21:30 +0000 https://www.bloggingaboutjava.org/cms/wordpress/2007/03/javacard-introduction/#comment-20232 Hi Afsina, In our project we’re using a <a title="SmartMX" target="_blank" rel="nofollow" href="http://www.nxp.com/products/identification/smartmx/"> SmartMX</a> card featuring <a rel="nofollow" target="_blank" title="JCOP" href="http://www.zurich.ibm.com/csc/infosec/smartcard.html">JCOP</a>. The card is integrated into a (yet to be released) samsung phone that has a <a rel="nofollow" target="_blank" title="NFC" href="http://www.nxp.com/products/identification/nfc/">NFC</a> Chip on board. This setup makes near field communication solutions possible. And yes, there’s a <a rel="nofollow" target="_blank" title="smart card API" href="http://jcp.org/aboutJava/communityprocess/final/jsr268/index.html">smart card API</a> available in java 6. Look at it closely and you’ll see it’s filled with byte(array)s. Although the API seems to support ints, the following can be read in the command APDU class comment: �For the header bytes CLA, INS, P1, and P2 the Java type int is used to represent the 8 bit unsigned values. In the constructors, only the 8 lowest bits of the int value specified by the application are significant. The accessor methods always return the byte as an unsigned value between 0 and 255.’ Hi Afsina,

In our project we’re using a SmartMX card featuring JCOP. The card is integrated into a (yet to be released) samsung phone that has a NFC Chip on board. This setup makes near field communication solutions possible.
And yes, there’s a smart card API available in java 6. Look at it closely and you’ll see it’s filled with byte(array)s. Although the API seems to support ints, the following can be read in the command APDU class comment: �For the header bytes CLA, INS, P1, and P2 the Java type int is used to represent the 8 bit unsigned values. In the constructors, only the 8 lowest bits of the int value specified by the application are significant. The accessor methods always return the byte as an unsigned value between 0 and 255.’

]]>
Comment on Javacard introduction by C. Enrique Ortiz https://www.bloggingaboutjava.org/cms/wordpress/2007/03/javacard-introduction/#comment-20225 Tue, 27 Mar 2007 01:02:15 +0000 https://www.bloggingaboutjava.org/cms/wordpress/2007/03/javacard-introduction/#comment-20225 Hi. Thanks for referring to my article above; I am glad you found it a nice introductions... Yes there are other APIs to consider, such as SATSA and a newer Smart Card API for J2SE (JSR 268, Smart Card I/O API). You can find more about Java Card, and SATSA at my <a target="_blank" title="www.cenriqueortiz.com" href="http://www.cenriqueortiz.com">website</a>  thanks. ceo Hi.

Thanks for referring to my article above; I am glad you found it a nice introductions… Yes there are other APIs to consider, such as SATSA and a newer Smart Card API for J2SE (JSR 268, Smart Card I/O API).

You can find more about Java Card, and SATSA at my website  thanks.

ceo

]]>
Comment on Javacard introduction by afsina https://www.bloggingaboutjava.org/cms/wordpress/2007/03/javacard-introduction/#comment-20139 Fri, 23 Mar 2007 11:55:36 +0000 https://www.bloggingaboutjava.org/cms/wordpress/2007/03/javacard-introduction/#comment-20139 well, would it be possible to tell what brand and type of card have you used? also i think there is a Java smart card io API available in Sun's JDK 6. well, would it be possible to tell what brand and type of card have you used? also i think there is a Java smart card io API available in Sun’s JDK 6.

]]>
Comment on A short one by Willem Spruijt https://www.bloggingaboutjava.org/cms/wordpress/2007/02/a-short-one/#comment-19486 Mon, 05 Mar 2007 22:39:58 +0000 https://www.bloggingaboutjava.org/cms/wordpress/2007/02/a-short-one/#comment-19486 Hi Jesper, I agree with you that this is a realy tricky problem which is hard to detect, because the the deviation is only 1 percent. Keep the tricky problems comin'! :-) -Willem Hi Jesper,

I agree with you that this is a realy tricky problem which is hard to detect, because the the deviation is only 1 percent.

Keep the tricky problems comin’! :-)

-Willem

]]>