You are not correct. Performance is a cost consideration in these situations. Predictability of code execution time is the requirement. Performance just changes the cost of deployment. (ie do I need a 20Mhz proc v's a 10Mhz proc, Do I need 64K of ram or 32K). For example, there are real time java implementations. They meet the RT requirements however the, perhaps, increased cost of deplying them may be the deciding factor. Many embedded systems have very tight unit cost limits.
For most porblems of this type the only effective optimisation is to find a more efficient algorithm that allows the problem to scale more favourably (perhaps using stochastic methods). That is not always possible of course. Constant time optimisations tend to be a waste of time.
There is always a trade off between development cost, maintenance cost and the cost to use it. For a large software dev company developing a program it would often make sense to use the fastest language/compiler/libaries/talent available as they will sell or not sell thier software of the perceived speed. Perhaps the company will sell it on better security in which case the optimisation is a waste of time.
Optimisation is not always necessary. In many cases it is cheaper to throw more hardware at the problem. In many cases it is necessaray, however most slow software I have come accross is slow because of poor algorithm design not the efficency of the language. In a few cases making a function 5% faster is important.
A lot of what is done using templates (the STL for example) is purely language preprocessing. There are a few preprocessors of this type available for java (and other languages that don't have meta programming as part of thier spec). Many people do use them to generate code. Actually a lot of the NIO code in jdk1.4 is created in this manner. There are also libraries for java that contain STL functionality (again often created using code generation techniques). (Im not talking about the changes that will be introduced in 1.5 as they are not comparable to templates).
As for RAII, most java constructs obay these principles. A file is opened when you construct its FileReader/FileInputStream/RandomAccessFile. It can be closed manualy, however if you do not it will (should) be closed when it gets GC'd. There are some poorly designed classes in java that do not obay the principles but that is true of any language.
Java Advanced Imaging has been around for a long time. It took quite a while to be released as a "finished API" partly due to some fundamental changes needed in the AWT libraries. It is 100% java. There are additional native modules that can perform some of the operations slightly faster then the default pure java implementaion however they get most of thier performance boost from using platform specific hardware (SSE/MMX/other SIMD style hardware). If you were writing the same operation in C++ you probably would have to jump though hoops to use it too.
The performance of Java's Math library under 1.4 is a problem with suns implementation. As of jdk1.4 there are two Math classes for java. The highly accurate one (used to be called Math) has been renamed to StrictMath and the Math class has had its requirements reduced. This allows implementers to use faster less accurate implementations of the Math class. However Suns implementaion of the Math class directly calls the StrictMath class.
Actually I need to refine that a bit. The Math class was renamed StrictMath and forces bit level reproducable results on all platforms. The requirements for the Math class were then reduced to allow for faster implementations. However Suns implementation of Math calls the functions in StrictMath.
By default java allocates itself 64Meg of heap. This is in addition to the amount of memory the JVM itself takes up. You can reduce this with command line options.
Java is not C++. A number of conventions from C++ do not map well onto the java language. Some aspects of structs, for example, can be mimicked in java by using classes with publicly accessible members. However a class takes up a fair bit more memory then the equivelent struct. This is a major source of memory related problems when C/C++ programmers get their hands on java.
The CPU instructions on intel hardware do not meet the standards that the JLS requires. Therefore they cannot be used and a software implementation is needed instead.
This isn't quite true as java contains two different classes for Math functions such as this. One, Math, is supposed the be less standards complient but faster then the other, StrictMath. In jdk1.4 Math and StrictMath are actually the same code. But then the JDK released by sun is only a reference implementation.
Suns implementaion is only a reference implementaion. Other providers can provide faster/different implementaions.
the reason for the slowdown between 1.3 and 1.4 is that 1.3 introduced a new class called StrictMath that provided better cross patform consistency the standard Math class. It was slower though. In 1.4 the standard Math class was rewritten so that internally it uses the StrictMath class.
Other implementaions do not have to use this approach.
The colossus mark 1 and mark 2 were both working in 1944. Eniac was not finished until 1945.
Babbage was British (1791-1871) and made programmable mechanical computers that were used by the british and american governments.
The EU is not a country but most of its member states share a common currency, have centralised banks, have common regulations regarding trade and migration and human rights. In many respects you could compare the EU now to the US a couple of hundred years ago.
>I am proud that that military has kept the world safe from dictators and bullies There are an large number of dictator and bullies in the world today. Many of them supported by the US.
"Who is the main supporter of the UN? Uhm, you got that right.... The US. Without us they are nothing. They do nothing but throw out sanctions and rest on it. More broken promises. The UN functions in a similar manner as my child. If I tell him no, don't do that, failure to listen to me will result in X punishment yet he does it anyhow. If I don't respond with that punishment, it just showed him how serious I am. Failure to follow through is unacceptable. "
No, the US is not the main supporter of the UN. The US does not even pay its required membership fees. In addition the US has no rights in the UN to tell other countries what they should do. It does have the right to stop the UN doing things (Veto rights) but then so do other countries, including france. America is not the parent of the world. In fact more often then not it behaves like a child grown to big for its parents to control it.
> Wow... the EU (almost an entire continent) has > a GNP larger than America (one country).
Most of the EU is on the Asian continent. Therefore the member countries (often called states) occupy only a small percentage of the continent.
The USA is one country that covers about the same land area as all of the states that make up the EU put together. Like the states of the US the members of the EU have a common currency and shared central bank.
> NAFTA is still larger.. idiot
Why yes, you are an idiot.
I would not make that promise (unless you are a politician). exponentiation makes the numbers very large very fast.
As to one of the other posters. Free donations of money result in a two party state where both parties have the same policies. Limited funding and contols on advertising allow any candidate an equal opportunity. Currently independents in the US need to be multi-millionaires in thier own right. You have a system that may perhaps vote in a very rich independent (not happened yet) or a very rich and powerful party.
I think you ment "The end can always be made to justify the means"
The problem is that it is very hard to quantify the benefits an individual obtains from privacy. It is therefore, quite easy to justify removing those rights.
>Sure there is. We have the strongest economy and >the largest GNP in the world. We have the >greatest technology (though I fear that may >change if we do not shape up) in the world. We >have the strongest military. We invented the >computer you are using to connect to the website >(also invented here) over the internet (invented >here) using broadband (invented here) or the >telephone (also invented here). Slashdot itself >was invented here and is hosted here.
Thanks for that. America did not invent * the computer. * websites (or the WWW). * the telephone. * Broadband encompases many technologies, including 3G techs, not all of which can be claimed to be invented by america.
Also, currently the EU has a larger GNP then America.
I will give you the military though as you seem so proud of it.
The ESA is a pretty commercial operation. It gets a fair bit of its funds from commercial launches. It also undertakes a lot of governement funded research (and is heavily subsidised)
> Sorry, we're going to be sore over here for a > while until we get over being called > imperialists for wanting to fix a problem that > cost us 2500 or so of our fellow citizens in > one day, on our own soil. Blasting the shit out > of the Arabian peninsula and the near environs > is about the only choice short of rolling over > and dying that we had left, but that doesn't > seem real obvious to the critics in Europe, > now, does it?
Many Europeans critisise the US cos we have no idea what "Blasting the shit out of the Arabian penisula" has to do with solving "your problem". So, no it is not real obvious.
Of course you have rights when you enter another country. Well you do if they have signed international human rights treaties. Strangely america has not signed any such treates.
We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness.
Its not quite that simple. Although the compartments can be sealed, doing so is quite complex. There are many electrical and other connections between the compartments that are routed through the access hatches. These have to be dismantled and assessments made of how this will effect the functionality of the station. (note they can just yank the cables in an emergency but doing to can cuase problems that they probably wish to avoid)
> Canada has lots of guns too. Not too many > shootings there. Shootings have nothing to do > with the number of guns or the number of > people. I can't tell you why we shoot each > other a lot, but I can sai that the number of > guns have nothing to do with it.
The level of gun related crime is very strongly linked to the number of guns. The relationships are:
Countries with strong gun controls have lower levels of gun related crime.
Countries that have high levels of gun related crime also have large numbers of easily avaiable guns. (bit obvious really).
That is not to say that more guns == more gun related crime. It is saying that gun related crime cannot happen without guns.
Many contries like canada have large numbers of guns and low gun crime stats. All the better for them they have gun cultures that seem to work. They don't need to ban/control guns any further. however if you look at the US then you will notice that there is a bit of a problem with the levels of gun related crime. The question is what, if anything, you are going to do about it.
You are not correct. Performance is a cost consideration in these situations. Predictability of code execution time is the requirement. Performance just changes the cost of deployment. (ie do I need a 20Mhz proc v's a 10Mhz proc, Do I need 64K of ram or 32K). For example, there are real time java implementations. They meet the RT requirements however the, perhaps, increased cost of deplying them may be the deciding factor. Many embedded systems have very tight unit cost limits.
matfud
For most porblems of this type the only effective optimisation is to find a more efficient algorithm that allows the problem to scale more favourably (perhaps using stochastic methods). That is not always possible of course. Constant time optimisations tend to be a waste of time.
There is always a trade off between development cost, maintenance cost and the cost to use it. For a large software dev company developing a program it would often make sense to use the fastest language/compiler/libaries/talent available as they will sell or not sell thier software of the perceived speed. Perhaps the company will sell it on better security in which case the optimisation is a waste of time.
Optimisation is not always necessary. In many cases it is cheaper to throw more hardware at the problem. In many cases it is necessaray, however most slow software I have come accross is slow because of poor algorithm design not the efficency of the language. In a few cases making a function 5% faster is important.
matfud
A lot of what is done using templates (the STL for example) is purely language preprocessing. There are a few preprocessors of this type available for java (and other languages that don't have meta programming as part of thier spec). Many people do use them to generate code. Actually a lot of the NIO code in jdk1.4 is created in this manner. There are also libraries for java that contain STL functionality (again often created using code generation techniques).
(Im not talking about the changes that will be introduced in 1.5 as they are not comparable to templates).
As for RAII, most java constructs obay these principles. A file is opened when you construct its FileReader/FileInputStream/RandomAccessFile. It can be closed manualy, however if you do not it will (should) be closed when it gets GC'd. There are some poorly designed classes in java that do not obay the principles but that is true of any language.
matfud
You mean distribute something like this
1 .h tm
GNU super optimizer
http://www.programmersheaven.com/zone3/cat35/79
matfud
Java Advanced Imaging has been around for a long time. It took quite a while to be released as a "finished API" partly due to some fundamental changes needed in the AWT libraries. It is 100% java. There are additional native modules that can perform some of the operations slightly faster then the default pure java implementaion however they get most of thier performance boost from using platform specific hardware (SSE/MMX/other SIMD style hardware). If you were writing the same operation in C++ you probably would have to jump though hoops to use it too.
The performance of Java's Math library under 1.4 is a problem with suns implementation. As of jdk1.4 there are two Math classes for java. The highly accurate one (used to be called Math) has been renamed to StrictMath and the Math class has had its requirements reduced. This allows implementers to use faster less accurate implementations of the Math class. However Suns implementaion of the Math class directly calls the StrictMath class.
matfud
Actually I need to refine that a bit. The Math class was renamed StrictMath and forces bit level reproducable results on all platforms. The requirements for the Math class were then reduced to allow for faster implementations. However Suns implementation of Math calls the functions in StrictMath.
Bad programming exists in all languages. Java does remove some of the pig pitfalls that poor programmers make.
You have to let references go stale in Java. There is no way to deallocate an object.
Why do you have a links to the STL and a discussion of "resource allocation is initialization." with stroustrop. What relevence do they have?
matfud
There are GPL'd JVM's
here are some
http://www.kaffe.org/links.shtml#freevms
matfud
By default java allocates itself 64Meg of heap. This is in addition to the amount of memory the JVM itself takes up. You can reduce this with command line options.
Java is not C++. A number of conventions from C++ do not map well onto the java language. Some aspects of structs, for example, can be mimicked in java by using classes with publicly accessible members. However a class takes up a fair bit more memory then the equivelent struct. This is a major source of memory related problems when C/C++ programmers get their hands on java.
matfud
The CPU instructions on intel hardware do not meet the standards that the JLS requires. Therefore they cannot be used and a software implementation is needed instead.
This isn't quite true as java contains two different classes for Math functions such as this. One, Math, is supposed the be less standards complient but faster then the other, StrictMath. In jdk1.4 Math and StrictMath are actually the same code. But then the JDK released by sun is only a reference implementation.
matfud
Suns implementaion is only a reference implementaion. Other providers can provide faster/different implementaions.
the reason for the slowdown between 1.3 and 1.4 is that 1.3 introduced a new class called StrictMath that provided better cross patform consistency the standard Math class. It was slower though. In 1.4 the standard Math class was rewritten so that internally it uses the StrictMath class.
Other implementaions do not have to use this approach.
matfud
The colossus mark 1 and mark 2 were both working in 1944. Eniac was not finished until 1945.
Babbage was British (1791-1871) and made programmable mechanical computers that were used by the british and american governments.
The EU is not a country but most of its member states share a common currency, have centralised banks, have common regulations regarding trade and migration and human rights. In many respects you could compare the EU now to the US a couple of hundred years ago.
>I am proud that that military has kept the world safe from dictators and bullies
There are an large number of dictator and bullies in the world today. Many of them supported by the US.
"Who is the main supporter of the UN? Uhm, you got that right.... The US. Without us they are nothing. They do nothing but throw out sanctions and rest on it. More broken promises. The UN functions in a similar manner as my child. If I tell him no, don't do that, failure to listen to me will result in X punishment yet he does it anyhow. If I don't respond with that punishment, it just showed him how serious I am. Failure to follow through is unacceptable.
"
No, the US is not the main supporter of the UN. The US does not even pay its required membership fees. In addition the US has no rights in the UN to tell other countries what they should do. It does have the right to stop the UN doing things (Veto rights) but then so do other countries, including france.
America is not the parent of the world. In fact more often then not it behaves like a child grown to big for its parents to control it.
> Wow... the EU (almost an entire continent) has
> a GNP larger than America (one country).
Most of the EU is on the Asian continent.
Therefore the member countries (often called states) occupy only a small percentage of the continent.
The USA is one country that covers about the same land area as all of the states that make up the EU put together. Like the states of the US the members of the EU have a common currency and shared central bank.
> NAFTA is still larger.. idiot
Why yes, you are an idiot.
I would not make that promise (unless you are a
politician). exponentiation makes the numbers very large very fast.
As to one of the other posters. Free donations of money result in a two party state where both parties have the same policies. Limited funding and contols on advertising allow any candidate an equal opportunity. Currently independents in the US need to be multi-millionaires in thier own right. You have a system that may perhaps vote in a very rich independent (not happened yet) or a very rich and powerful party.
I think you ment "The end can always be made to justify the means"
The problem is that it is very hard to quantify
the benefits an individual obtains from privacy. It is therefore, quite easy to justify removing those rights.
>Sure there is. We have the strongest economy and
>the largest GNP in the world. We have the
>greatest technology (though I fear that may
>change if we do not shape up) in the world. We
>have the strongest military. We invented the
>computer you are using to connect to the website
>(also invented here) over the internet (invented
>here) using broadband (invented here) or the
>telephone (also invented here). Slashdot itself
>was invented here and is hosted here.
Thanks for that. America did not invent
* the computer.
* websites (or the WWW).
* the telephone.
* Broadband encompases many technologies, including 3G techs, not all of which can be claimed to be invented by america.
Also, currently the EU has a larger GNP then America.
I will give you the military though as you seem so proud of it.
The ESA is a pretty commercial operation. It gets a fair bit of its funds from commercial launches. It also undertakes a lot of governement funded research (and is heavily subsidised)
> Sorry, we're going to be sore over here for a
> while until we get over being called
> imperialists for wanting to fix a problem that
> cost us 2500 or so of our fellow citizens in
> one day, on our own soil. Blasting the shit out
> of the Arabian peninsula and the near environs
> is about the only choice short of rolling over
> and dying that we had left, but that doesn't
> seem real obvious to the critics in Europe,
> now, does it?
Many Europeans critisise the US cos we have no idea what "Blasting the shit out of the Arabian penisula" has to do with solving "your problem".
So, no it is not real obvious.
matfud
Of course you have rights when you enter another country. Well you do if they have signed international human rights treaties. Strangely america has not signed any such treates.
We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness.
unless they are foreigners of course.
Its not quite that simple. Although the compartments can be sealed, doing so is quite complex. There are many electrical and other connections between the compartments that are routed through the access hatches. These have to be dismantled and assessments made of how this will effect the functionality of the station. (note they can just yank the cables in an emergency but doing to can cuase problems that they probably wish to avoid)
> Canada has lots of guns too. Not too many
> shootings there. Shootings have nothing to do
> with the number of guns or the number of
> people. I can't tell you why we shoot each
> other a lot, but I can sai that the number of
> guns have nothing to do with it.
The level of gun related crime is very strongly
linked to the number of guns. The relationships are:
Countries with strong gun controls have lower
levels of gun related crime.
Countries that have high levels of gun related
crime also have large numbers of easily avaiable
guns. (bit obvious really).
That is not to say that more guns == more gun
related crime. It is saying that gun related crime
cannot happen without guns.
Many contries like canada have large numbers of
guns and low gun crime stats. All the better for
them they have gun cultures that seem to work.
They don't need to ban/control guns any further. however if you look at the US then you will notice
that there is a bit of a problem with the levels of
gun related crime. The question is what, if
anything, you are going to do about it.
matfud