jwenting 1,905 duckman Team Colleague

You don't want to keep that much data in memory...

Use a SAX parser for large amounts of data, as it doesn't need to retain the data in between operations.

jwenting 1,905 duckman Team Colleague

no, instance variables are (as I pointed out) NOT a good idea in a multithreaded environment.

Pretty much all coding standards btw tell you to limit the scope of variables to the smallest possible. So do not use instance variables unless you need to share information between methods (aka maintain state between method invocations).

jwenting 1,905 duckman Team Colleague

ever heard of the Date class? Or the Calendar class?

jwenting 1,905 duckman Team Colleague

We do! But, yall have been bombed so damn much.. especially during the blitz. Oh, I remember watching that JFK (?) airport scare the other day. That and that dude with the rare form of TB.

Yes, that JFK scare was typical overreaction.
Someone taking pictures of aircraft and airport buildings who has a map of the airport at home gets arrested on suspicion of being a terrorist.
Thousands of people worldwide do that as a hobby...
I've maps of literally hundreds of airports all around the world and will go there to take photos if and when I am in the area.
It's just a hobby kids, in fact with us around it's a lot harder for a terrorist to do anything as he'd get lynched before he could get that weapon readied for use...

jwenting 1,905 duckman Team Colleague

and its wierd that you never hear about afghanistan anymore. I hear its even more of a hellhole than iraq at the moment

not that hard, as most of Iraq is quiet and being rapidly rebuilt.
Which is precisely why every single incident HAS to be blown way out of proportion, lest people find out the truth.

Another factor is that it's easy to get into Iraq, almost impossible to get into Afghanistan.
It's also a lot easier to get around in Iraq than it is in Afghanistan, and there are more foreign terrorists in Iraq as a result (mainly Syrian and Iranian backed and trained) who have excellent PR machines like Al Jazeera where the Taliban are considered weirdos even by other extremist Muslims.

In addition the brunt of the action in Afghanistan doesn't cause US casualties, so US media have no stories of how the glorious local rebels fight off the invading imperialist US forces.
Instead the action is in the areas controlled by the Dutch and Brits, who do quite a lot of killing terrorists with very few casualties to themselves.

jwenting 1,905 duckman Team Colleague

Im pretty sure 9/11 was real because 7/7 was real (i know people who were there)

oh, it's real alright. but the conspiracy theorists say it's not Al Qaeda that did it but Bush...
They also claim the CIA was responsible for 7/7 as well as the Madrid bombings (why the CIA would bomb a train in Madrid that caused a pro-US government to loose the elections the next day was never explained).

And yes, the idiots are blaming Bush for pretty much everything bad that ever happened to the world.
Katrina? Bush caused that storm
Bush caused the tsunami in the IO (yes, I've heard it claimed)
etc. etc.

jwenting 1,905 duckman Team Colleague

sentence was reduced to 3 days ~ celebrity's could get away with murder......
a flutter of the eyelids and the guards drop to the floor like dogs......

HAVE gotten away with murder...
Remember OJ Simpson? He got away with murder because he's famous and black.

jwenting 1,905 duckman Team Colleague

was laughing at all of the skillfully worded questions. A lot of them exhibit a logical fallacy and the rest are carefully biased. I got some funny looks when I read the Death Match Challenge question.

yes, seen such things before. Designed to make you choose answers that lead to a leftwing political view.
But not as blatant a fraud as what they had here during election time a few years ago. Whatever answers you gave the result was advise to vote for the Stalinist/green party.
Here I was, Ronald Reagan my hero, being told I fit best with the likes of Stalin and Ho Chi Minh.
And choosing different answers didn't make any difference whatsoever, it ALWAYS gave the same result.

Also, their placement of political ideologies in their "result" graph is highly questionable.
Fascism for example is hardly where they place it, but very close to (in fact in many areas overlapping with) communism.
Socialists ARE totalitarian...
So-called "democrats" ARE socialists.
etc. etc.

jwenting 1,905 duckman Team Colleague

no, that wouldn't matter one bit (unless MAYBE they're all primitives).

And when the time almost inevitably comes that that class is used in a multithreaded environment it's far easier to get it threadsafe if there are no or very few instance variables (and especially statics).

jwenting 1,905 duckman Team Colleague

hehe.
O'Reilly books... yah, nice coverdrawings them ;)

As I've not studied C++ nor (introductory) Java in some years I can't suggest Java books that are similar to C++ books.
But here's a list to get you started:

- Head First Java, 2nd Edition
- Effective Java (not O'Reilly)
- Java Puzzlers (not O'Reilly)
- Java Concurrency in practice (not O'Reilly)
- (optionally) Java Network programming (the O'Reilly one, there are other books with the same title)
- Head First Design Patterns

other books pretty much depend on WHAT you want to do with Java. As you get deeper into the material you'll want more specialised books, like
- Java Server Pages
- Enterprise JavaBeans 3.0
- Professional Java Development with the Spring Framework (not O'Reilly)
- Spring MVC and Web Flow (not O'Reilly)
- Pro EJB 3 Java Persistence API (not O'Reilly)
- Java Messaging (not O'Reilly)

and many others.
I buy on average 1 book a month, most of them getting only partially read and then used as reference.

jwenting 1,905 duckman Team Colleague

that's how recruiters think... If you survive the initial trial period at the place they put you they get paid a ton of money (usually a good portion of your yearly income).

Mind there are some recruiters who care, seeking a longterm business relationship with the companies they send you to, but the vast majority use it as a get-rich-quick scheme, hoping to retire in a few years.
If they can place 2 people per week at €10.000 each that's even after taxes a quarter million income a year.
If business expenses are half that again (unlikely) you're talking €125.000 net profit per year per recruiter working for the recruitment firm.

At that money most don't care if the potential well of customers dries up after a few years, they'll be made.

And of course in some parts of the world HR flunkies are still wood more by acronyms on a resume than by work experience, and will hire people as long as they have the correct ones listed without second thought, leaving it up to the workfloor to weed out the chaff from the corn (or more likely as these are often bodyshops, leaving it to the customers' workfloors).

jwenting 1,905 duckman Team Colleague

true, but the same goes for variables as well.
And a lot of people seem to think that because you pass references in Java you're always passing by reference...

jwenting 1,905 duckman Team Colleague

yes, you can cram the information into your head in a few weeks. BUT if you do that you won't actually know any of it, you'll have shortterm retention just long enough to pass the exam.
And without practical experience to back it up that knowledge is worthless anyway, possibly worth than useless as book knowledge without knowledge about its realworld application is extremely dangerous.

If you're serious about learning Java, rather than just cramming for the exam to get another acronym on your resume, take several months at least to seriously dive into the subject and learn not just the lines but what they actually mean and why they are as they are.

jwenting 1,905 duckman Team Colleague

some stock went up 45% today, sure... penny stocks, most likely, that you'd be hard pressed to find before they moved. By time you get anything from the mainstream media, they'll be reporting it because it moved 45%. You won't earn your money back by jumping into this. All stocks should go up, afterall.

yeah, we had major problems with that last year. New functionality to determine fast moving stock kept picking up inconsequential penny stocks going up 5 cents on a value of 25 cents while missing major stocks going up 1 Euro on a value of 50.

We're now I think doing a lot of analysis behind the scenes to filter out those things and show only what people are really interested in (our customers being mostly major investment banks and not people lured by spammers into trading penny stock).

jwenting 1,905 duckman Team Colleague

Yes, you WILL loose money if you rely on public sources.
ALL those sources are delayed, typically by 15 minutes or more.
So when you see a stock updating that update actually happened 15 minutes ago (or longer).

The realtime data IS available, but will cost you (and many of the public trading sites don't offer it even at a price because that price is REALLY high, think tens of thousands of dollars per exchange per year plus a fee per user using the data).

The streaming quotes too that some sites offer to paying customers are usually delayed, they're just a service for you so you don't have to hit refresh all the time.

That's how we deliver it. Regular customers get data that's 15 minutes+ delayed, special customers (who thus pay a hefty premium) get realtime data as fast as we can push it through our systems (which effectively means they have it within a few seconds of the trade happening at the exchange).

That data AFAIK is nowhere displayed on public websites, only on a few intranet and extranet sites and special trading terminals connected directly to our dataservers (and no, you're not getting an account for those ;)).

Daytrading can be fun, and you can make money if you spend a lot of time at it and get lucky, but don't try to bet on changes happening in the space of seconds or minutes as it won't work.

jwenting 1,905 duckman Team Colleague

huh?

jwenting 1,905 duckman Team Colleague

Yeah i hate the way that our country now (eek maybe ill be arrested by the thaught police). Its a police state now.

That's what you get for voting IngSoc into power (even if they call themselves "New" Labour, you should know by now that IngSoc doesn't care about truth).

jwenting 1,905 duckman Team Colleague

JBuilder will let you use whatever you want if you know how to use JBuilder...
The fact that you don't confirms yet again your status in society as someone who doesn't do this for a living (and most likely uses a pirated copy of JBuilder that doesn't include the documentation).

jwenting 1,905 duckman Team Colleague

Another homework assignment... Don't help those kids, they have to do it themselves.

jwenting 1,905 duckman Team Colleague

nesting jarfiles isn't supported.
There are some proposals to allow for it, but nothing has yet reached prototype stage.

So at current the only way would indeed be to unpack the jars into one folder and repack them as a single archive.

Better (usually) to just add them all separately to your classpath.
It's a very rare case where there is a need to repack jars, usually it's only applicable when deploying packages to an application server where they would interfere with older versions of those same packages that the application server needs internally, a situation rare enough that most people never encounter it (I myself only have seen it once so far in a decade of using Java professionally).

jwenting 1,905 duckman Team Colleague

The DOM API has methods for retrieving sets of child elements from an element given that elements tag name.
You can also retrieve the values of attributes by attribute name.

Using those and given knowledge about the structure of the XML you can address any node/element in the parsed Document.

Some experimenting and reading of the API documentation goes a long way towards understanding how it works.

You may also look at http://xerces.apache.org/xerces2-j/ for tutorials (mind that they may need some modification in details to work with the built-in XML functionality of the core libraries, but the general idea is the same).

jwenting 1,905 duckman Team Colleague

and everything is a reference, except primitives. Just not references in the C++ meaning of the word :)

Java is ALWAYS pass by value. When you're passing a reference you're passing a reference by value.

So the following does NOT have any effect in Java:

public void swap(int a, int b) {
  int c = a;
  a = b;
  b = c;
}

when the following C++ would work

public void swap(int& a, int& b)
{
  int& c = a;
  a = b;
  b = c;
}

Effectively everything you pass to a method is final as far as the calling method is concerned (though you CAN call methods on object references passed which affect the state of the objects referred to by those references), changes to the actual method argument value are never reflected outside the method (remember that in Java when you pass an object reference the value passed is that reference, not the object itself so that can change state but cannot be replaced by another object).

jwenting 1,905 duckman Team Colleague

"So you think you're a great dancer? #1 "

uh, no :)

jwenting 1,905 duckman Team Colleague

"First tip: don't trade just based on someone's advice. Do your own research to make sure you agree with them. This doesn't mean to ignore them, just not to blindly follow."

Second tip: spread your investment. Never put all your chips in a single basket.

Third tip: never buy small volume. The brokerage fees will take forever to offset.

jwenting 1,905 duckman Team Colleague

yet another piece of worthless advise from someone who doesn't know how things work...

jwenting 1,905 duckman Team Colleague

it's not. If it were you would a) happily use a third party library because it saves you work and b) not bother writing your own version of something that's already in the standard library.

Only homework assignments have both the requirement to not use external libraries and to build from scratch something that's available in the core API.

jwenting 1,905 duckman Team Colleague

speed chess seams impossible....

why? I used to play speed chess regularly. In highschool I came second in the school tournament, loosing only the final in a 5 minute match when I made a stupid mistake under time pressure.

jwenting 1,905 duckman Team Colleague

Bebo is better than myspace

and the Onion beats them both :)

jwenting 1,905 duckman Team Colleague

better h/w support. Vista out of the box detected every piece of hardware I havever owned. XP needed drivers for everything

unfair comparison. Out of the box XP had drivers for most any hardware available when it went Gold as well, it's just that in the last 5 years (yes, it's been 5 years since XP was launched) there's been a lot of new hardware released that of course isn't handled as standard by XP (how can it, when it didn't exist to be included back in 2001?).

Your statement is like blaming DOS 1.0 for not having support for XVGA videocards out of the box when there were no videocards at all when DOS 1.0 was written.

jwenting 1,905 duckman Team Colleague

request.getParameter("someparameter") comes to mind. Executed in a servlet of course, not a JSP.

jwenting 1,905 duckman Team Colleague

normally, you would not try to write a web server yourself.

Someone has to do it ;)
Been thinking of writing my own IRC server but things keep getting in the way.

jwenting 1,905 duckman Team Colleague

And as always the level of work required to port between compilers depends on the amount of code you write that's dependent on compiler specific functionality and libraries rather than on the compilers themselves.

And yes, it's good for games. But given your level of understanding you're not.

jwenting 1,905 duckman Team Colleague

Seems like a pretty well predigested assignment, you shouldn't have any trouble implementing that.
Even if you're braindead and can't think much for yourself you should find it pretty easy to do by just following the instructions to the letter, no independent thinking required.

jwenting 1,905 duckman Team Colleague

do your own homework kiddo.
and don't go around reviving long dead threads.

jwenting 1,905 duckman Team Colleague

You can't, period.
When you refresh the page you place another request for the exact same page, which means you get the state of the page before you selected that item.

jwenting 1,905 duckman Team Colleague

Replace luck with research and effort. And being able to withstand the psychological impact of a loss. There are many successful traders who do quite well by having a developed system, not lots of luck points...

all that research only enables you to make a slightly more educated guess.
Nothing more, nothing less.

My job is writing software for stock traders (and other traders and analysts in the financial markets) for a consortium of major banks and trading houses (think Meryll Lynch, HSBC, those kind of names).
The shortterm movements are chaotic, period.
Daytraders trade on luck, betting fortunes on minute changes in the market.
Unless you have the time and equipment to be able to buy and sell at a moment's notice (literally, a few seconds and the situation can have changed), you don't want to go that way.

The only thing you can say about he stockmarket is that in the long run on average the stocks on it will increase in value.
But you can't tell which commodities will go up or down in the short term (or even at all), or even which will survive.

A few years ago "experts" here told everyone to invest heavily in Getronics (traded on Euronext Amsterdam).
At the time the stock was nearing 10 Euro and rising rapidly.
One bad press release later the stock plumetted to below 10 cents in a matter of days.
It's now about 5 …

jwenting 1,905 duckman Team Colleague

and don't use scriptlet code in JSP (which would be required for what you're planning to do).
and don't insult us all by claiming your "problem" is so important that the entire world should drop whatever they're doing and help you instantly. Your problem is NOT urgent, and if there is urgency to you it most likely indicates you should have started working on solving it sooner.

jwenting 1,905 duckman Team Colleague

first find out how to print things.
next find 15 prime numbers (that's easy, there's sure to be lists of the thing, so no need to calculate them).

Combine the two and you have your solution.

jwenting 1,905 duckman Team Colleague

and using Swing GUI components in that class is even worse...

jwenting 1,905 duckman Team Colleague

Schroedinger's cat is actually not dead and alive at the same time.
You cannot know whether the cat is dead or alive without killing the cat at which point you know it's dead.
That's the paradox (if it is one), that observation always influences that what's being observed.

Similarly if you start spying on people you influence their behaviour. If you insert a probe into a pan of boiling water you influence the currents in that pan as well as the temperature of the water (as the probe will have a different temperature from the water) and therefore influence the results of your test.

The same holds true anywhere. Were behaviour as predictable as OP suggests society would collapse. Noone would do anything at all, after all what use is it if everything is predetermined to happen anyway?

jwenting 1,905 duckman Team Colleague

you don't need anything like that. You need either a good book on JSP to tell you what you do need or a good spanking if you have that good book and choose to ignore its teachings.

You do NOT use scriptlets in JSP.

jwenting 1,905 duckman Team Colleague

rather disturbingly though he named his class "test" rather than "Test" and forgot to use a proper package structure (the latter can be excused as it's often omitted from beginners' tutorials, a serious omission).

It should still compile though, leading to a file test.class next to the file test.java which should contain the source code (of course if no such sourcefile exists the compiler would immediately complain).

jwenting 1,905 duckman Team Colleague

well, that would be the problem...
ANT sets up its own classpath for each task, disregarding (as any serious Java application does) the system classpath completely.
So if you don't tell ANT to use that jar, it won't use it and not find any classes in it.

jwenting 1,905 duckman Team Colleague

Take Sun's SL-275 course, which is pretty much geared towards people making the transition from another language to Java.

After that, read Effective Java, the Java Language Specification, and other mid-high end Java texts like Java Concurrency in practice (though that might be over your head for a while), Java Puzzlers, and pretty much every Java book that looks interesting from the O'Reilly catalogue (yes, I own a lot of them, sadly no stock in the company though).

jwenting 1,905 duckman Team Colleague

best guess is that the kid wants a commercial IDE without paying for it (so piracy) and doesn't know the difference between an IDE and a compiler...

jwenting 1,905 duckman Team Colleague

if your serverside code that tracks the answers and questions were smart enough it would detect such blatant cheating attempts and immediately fail the student (or subtract the amount of time they thought to gain by cheating)...

jwenting 1,905 duckman Team Colleague

indeed he is.
In some highly specific situations you may want to avoid any reliance on third parties, but usually you want to write as little code yourself as possible.

Why reinvent the wheel? Why go through months or years of development and testing to get to the stage where those third parties (often highly experienced in their field) are already?

If you go that way, why rely on a programming language written by others?
Why rely on an operating system written by others?
You could even question the decision to use hardware created by others made out of raw materials mined by others with tools made by others...

jwenting 1,905 duckman Team Colleague

well, everything you need to create your own charting library is right there in the core class libraries.
But why go to the trouble (unless of course it's a homework assignment you want to trick us into doing for you) of doing that when there are perfectly good components available?

jwenting 1,905 duckman Team Colleague

and it would not be a TSR. That name is specific to a category of DOS programs that would load and stay in the background.

jwenting 1,905 duckman Team Colleague

he could never have had the business success Bill Gates had. Even if he had a decent product (Gates needed quite some effort to turn it into DOS) he lacked the business savviness that helped Gates make Microsoft into the successstory it has become.

Most likely had he sold to IBM he'd have been forgotten as so many small suppliers to large companies have been forgotten or gobbled up.
Quite likely also the IBM compatible PC would never have become the major breakthrough in computing that it did when Microsoft started selling their OS to other companies willing to create and sell computers based on the same hardware architecture IBM had created (and failed to patent because they didn't think it was important enough...).