jwenting 1,905 duckman Team Colleague
for (int i=1;i<65536;i++)
  {
%>
  <tr>
    <td><%= i %></td>
    <td style="border-right=thin solid blue;">&#<%= i %></td>
    <td>&nbsp;&nbsp;&nbsp;</td>
    <td><%= ++i %></td>
    <td style="border-right=thin solid blue;">&#<%= i %></td>

part of a JSP I wrote that outputs the entire UTF-8 character set.

jwenting 1,905 duckman Team Colleague

Of course. You can read a text file in binary mode without it getting corrupted, but not vice versa.

Not quite sure, but I think binary mode adds a layer of encoding to the transfer to ensure no data is lost (this is transparent).
FTP was originally created to transport only text data, and if I'm not mistaken uses 7 bits per byte (discarding one) just like SMTP.
Therefore binary data needs to be encoded from 8 down to 7 bits before being sent over the line.
Text data already fits in 7 bits (unless it's UTF-8 for exampl with the high bits in use, for example Chinese) and therefore needs no special treatment.

jwenting 1,905 duckman Team Colleague

the html file itself is plain text. What protocol you use to retrieve it doesn't change that.
Of course any graphics and plugins (applets, flash, etc.) linked to for embedded display will be typically binary (though you can embed plain text as well).

Linked JS and CSS are text as well.

jwenting 1,905 duckman Team Colleague

With your popularity you don't have to :)

jwenting 1,905 duckman Team Colleague

I'm not here for a popularity contest so unlike some other people likely did I didn't vote for myself :)

jwenting 1,905 duckman Team Colleague

Depending on the server (whether it defaults to text mode, binary mode, or autodetects which is needed) the first may return a corrupted file.
You will get a connection in either case, but unless the data you are retrieving is text only not adding the 'i' flag may result in corruption as most ftp servers will transfer in text mode unless told otherwise.

jwenting 1,905 duckman Team Colleague

He even posted a picture of some of those people together at a Dave appreciation party :)

jwenting 1,905 duckman Team Colleague

Indeed, why should we go to a site we don't know on the basis of someone we don't know asking us to press a button there that does something we don't know?

jwenting 1,905 duckman Team Colleague

Rethink your architecture. Ever more people block all popups on general principle as 99% of them are advertising.
Use a 0-sized div on your page instead.

jwenting 1,905 duckman Team Colleague

Correct. And employers don't look for unique solutions, they look for working solutions that can be maintained by others when you're gone.

jwenting 1,905 duckman Team Colleague

You will need to get the complete html data anyway else you can't render it :)

If the data is properfly formatted XHTML it's easy as 1-2-3, just create a DOM parser and look for all "a" tags, then take the href arguments from those.
If it's not properly formatted XHTML you're out of luck and will basically have to write something to do that yourself (and all possible corrupted alternatives, like uppercase and combinations of upper and lowercase).

jwenting 1,905 duckman Team Colleague

the worst education then.
Without knowing how to write code (and thus what works and what doesn't in real life rather than in theory) you'll never create a design that's both theoretically good and can be implemented to an efficient working solution.

jwenting 1,905 duckman Team Colleague

Well, you'd have to put in a very serious security layer to prevent harmful code from being executed.
Too many websites (and other applications) forget about that, allowing the user to execute unguarded code on the server with often disastrous results.
That would be the real project, the presentation and user interface the icing on the cake.

Neat idea.

jwenting 1,905 duckman Team Colleague

hmm, I'm honoured to be in the shortlist :)

There can be only one choice though for me, given my sexual orientation (and a good choice it is)...

jwenting 1,905 duckman Team Colleague

Don't go and implement those things yourself. There's many libraries available to take care of such things for you that do a far better job than what you could come up with.
Security is a complex issue, and very hard to get right (be careful selecting your tools therefore, many of them are bound to have serious flaws).

SSL for example starts at your webserver but doesn't stop there.

ALWAYS doublecheck all your input data, both clientside and serverside validation should take place on it.
Login details should be stored such that they can't be decrypted (just in case your database server gets compromised.
If that sounds impossible, it isn't (I've done it myself) :)

As said, use a proper architecture. Servlets, Javabeans, and JSP (using JSTL of course, not scriptlets).
Forget (IMO) about EJB, they're overkill for almost every scenario.

Write proper analysis and design documents. Those are IMO even more important than the actual code for a small project like this, especially in an academic setting (of course in the real world the code is the only thing that counts, but if the design sucks so will the code and most likely it will never get done).

jwenting 1,905 duckman Team Colleague

Use JSTL and it's a breeze.

And indeed you shouldn't do SQL and any other non-display related stuff in a JSP.

jwenting 1,905 duckman Team Colleague

Did you even listen?
This is NOT a forum about Javascript. Go ask your questions where they belong, you might get an answer there but I doubt you're going to like it.

jwenting 1,905 duckman Team Colleague

And what did you learn by slavishly copying it?
Nothing at all.

jwenting 1,905 duckman Team Colleague

JSP Wiki already exists :)
In fact there's an open source wiki with exactly that name (which is indeed written as a set of JSPs).

the original idea is indeed not very complicated. RSS feeds are just standard components to plug into existing frameworks and servers so add only the little complexity of adding a few lines to some configuration files.
You'll have to come up with something that actually requires some programming rather than plugging ready-made products together and maybe making some graphics and stylesheets.

jwenting 1,905 duckman Team Colleague

That's a pretty loaded question, about which libraries full of books have been written.

If you're really interested, throw some money into it and get yourself some professional software analysis and design training.

I took Sun's OO-226 course which was great, and at just over €2000 for a week very nicely priced too.
That will teach you a lot more (and prevent you from picking up a lot of bad habbits) than reading some books and websites with no guidance.

jwenting 1,905 duckman Team Colleague

String.indexOf

jwenting 1,905 duckman Team Colleague

Yup, that's it.
If your book is old it may not even mention the package, it was introduced in 1.4 (so only several years ago).

There are a lot of resources online about regular expressions, and an excellent book from APress about using them in Java.

jwenting 1,905 duckman Team Colleague

What's the question anyway?

jwenting 1,905 duckman Team Colleague

Don't use a single massive monolith of a class. That way lies disaster.

For the rest, sit down and write a design. Doesn't have to be a lot, just put some thoughts onto paper how you're going to do this thing.
Then start your text editor and start writing Java (or better expand that design document until it starts to write the code for you).

We're NOT going to write your program for you, that's your job.

If you have specific details you're stuck on be free to ask for help of course, but "write my program" is NOT a good question to ask (it's not even a question, it's an order and you're not paying us).

jwenting 1,905 duckman Team Colleague

You do understand that the regular expression package has a standard system for doing just that?
It's already there and far more flexible than any rigid function to do a single small thing can provide.
After all, as I said, there's tons of small things someone somewhere may find useful. Adding them all would be a mess of monumental proportions so a generic system was provided instead using standard regular expressions.

jwenting 1,905 duckman Team Colleague

what's wrong with getting -1 if something isn't found?
It's a non-existent index for a string, therefore easy to check for.

If you get any number greater than -1 the substring (in your case a single character) you look for exists in the target string, couldn't be easier.

If Sun were to provide every possible special case as a function of its own we'd get a complete mess of methods.
You're interested only in having a number in there, I may want that number to fall inside a given range, or maybe only want to know if a certain number occurrs more than once but less than 4 times in the input string, my colleague may want to know whether the string contains a word that in Swahili would be the phonetic spelling of a number, etc. etc.

jwenting 1,905 duckman Team Colleague

Why should it be? You have no inalienable right to every piece of old (or new) software out there.

If companies were to release every piece of old software as freeware they'd have a massive support burden as well as massive loss of sales on newer products.

jwenting 1,905 duckman Team Colleague

Indeed. Get the JDK (latest version is 5.0_04 (compiler version 1.5.0_04) from http://java.sun.com and use your favourite programmer's editor to create the code.
Don't touch those fancy IDEs until you understand what they're doing and can do the same by hand (albeit MAYBE slower).

VI, jEdit, Emacs, even Notepad.

jwenting 1,905 duckman Team Colleague

Any process is better than no process with the exception that using a process you don't understand is a sure way to disaster.

jwenting 1,905 duckman Team Colleague

You shouldn't use an IDE at all until you're comfortable with the commandline tools and the language.
In fact you shouldn't use an IDE to do anything you can't do yourself...

I see way too many people saying they know a language when in fact all they know is how to use some IDE to create half their code for them and then fill in the details.
When left with a text editor, a command line compiler, and a language reference, they fail to produce anything at all.
They learned the tool instead of the language, all the time thinking they learned the language.

jwenting 1,905 duckman Team Colleague

No.

You don't ask any questions, you order us around, why should we help you?

If there's something wrong and you can't find it, tell us what it is and what it should do and then ask nicely.
Maybe then we can hint you towards a solution.

jwenting 1,905 duckman Team Colleague

I've not checked your sources, but you need to work on a 2D coordinate system if you're taking elevation into account.
Your cannon fires from a set point, and the parabolic trajectory starts from there. If that point is translated vertically, the entire trajectory is translated vertically by the same amount (and extrapolated at the far end of course).

If you wanted to get real fancy you'd have to take things like changes in gravitational pull with increased altitude, changes in air pressure (and thus drag) at different altitudes, and curvature of the earth into account, but if you design your physics engine for flexibility those could be added later.

jwenting 1,905 duckman Team Colleague

The internet as a whole isn't fragile.
While indeed parts of it may be cut off from the rest or even destroyed the net as a whole can go on regardless.
Indeed entire continents could be cut off from the rest of the world and each of the parts still function correctly internally.

It would be fragile only as a single small failure could bring the entire structure down.

jwenting 1,905 duckman Team Colleague

Start by laying down the business requirements, then do a thorough usecase analysis.
Basically run through the entire development cycle and don't just sit down with a code editor and stare at your screen hoping that someone will write your software for you (or even more optimistic, hoping it will write itself if you just wait long enough).

Any system that's more than trivial needs an analysis and design phase, now's the perfect time to learn how to do that and apply that knowledge.
Sadly many people don't and end up producing poorly designed and written and undocumented software that doesn't function as expected, is over budget, buggy, and leaves customers unhappy and companies in debt.

jwenting 1,905 duckman Team Colleague

JavaMail makes creating mail clients a breeze. Servers are more interesting.

jwenting 1,905 duckman Team Colleague

Read "The Art Of Java", it includes a full blown email client.

I've yet to find a book creating a complete IRC or SMTP/POP3 server.

jwenting 1,905 duckman Team Colleague

While it was under warranty the tech support was unbeatable, but just last night one of their very non-understandable indian managers told me it wasn't their problem.

And it isn't. More precisely it isn't their problem that your system needs repairs after the warranty expired and you think it's too expensive.
It's your choice, pay to have it repaired or replace the thing. Whichever, it's not their problem.

If you decide you want it repaired and are willing to pay for it, it then becomes their problem to arrange for that repair in cooperation with you (getting you a tracking number, shipping details, etc.).

jwenting 1,905 duckman Team Colleague

http://www.sun.com/training/catalog/courses/SL-275.xml
cough (the course ends with creating a complete chat application on the last day).

jwenting 1,905 duckman Team Colleague

Not technicalities at all. As long as the software has "substantial legal use" (that's the exact clause in the law prevailing in the US) and the company marketing it doesn't explicitly market it for illegal use (which some do) the software itself is legal.
When you opt to use it for illegal purposes that's your choice, and the company cannot be held liable because they didn't provide or create (at least for the courts) the software for that illegal purpose.

This is a direct means of protecting other businesses as well. For example many criminals use knifes and guns. If the manufacturer were to be held responsible for illegal use of their products, it would be impossible to produce those (and that includes kitchen knifes and military weapons which after all can be and have been stolen).
It would also include (for exampl) screwdrivers which have been used to break open doors and windows and on occasion to stab people to death.

jwenting 1,905 duckman Team Colleague

As Alex said, you get what you pay for.
Had they opted for extended warranty the things would have been repaired under warranty. They didn't, which was their own choice, so they have to foot the bill.

I know of only one company that ever deliberately designed a system to fail shortly after warranty expired (or so went the rumour at the time, as almost every machine of that model failed within a month of the warranty expiring, which was more than random chance would allow for), and they got seriously burned over it.

Personally I don't usually go for extended warranty myself, but on a laptop with its expensive to replace parts I would.
Most things either fail rapidly or don't fail until the economic life of the device is long over after all.

jwenting 1,905 duckman Team Colleague

DaniweB.
Thought it was pretty obvious.

jwenting 1,905 duckman Team Colleague

Stop is deprecated ages ago because it's extremely dangerous.
It potentially leaves a lot of objects in undeterminate states.

I'd not be surprised if Sun has resolved the native part of the code to silently fail and not actually do anything for that reason (they've done so with several other inherently unsafe operations that were deprecated).

jwenting 1,905 duckman Team Colleague

That indeed won't work (not sure if it will give a compiler error or just result in nothing getting printed, never tried something like that). What you can do is use System.print() inside main to print part of the line, in the method to print something else, then use System.println() without arguments in main to generate the newline.
Not pretty, and I'd not recommend it for anything but throwaway experiments (I'd not use printing to console in general except in experimental code), but it works.

jwenting 1,905 duckman Team Colleague

I don't know anyone called "u"...

But I suggest you think about where you can use System.println, as your understanding of how to use it seems to be lacking.

jwenting 1,905 duckman Team Colleague

RTFM... There's a very good manual included in your documentation package that comes with the JDK (you did download and install the documentation did you?).
There's also a very nice tutorial on Sun's website, and every beginners' book on Java worth the name contains the information as well.

jwenting 1,905 duckman Team Colleague

Sun's already partnered to Microsoft, IBM, and many others :)

Google is on an empire-building spree, they may be looking into branching out into hardware and operating systems, in which case Sun would make a nice acquisition.
At the very least a close partnership with Sun would give them access to very nice hardware at below market prices.

What I don't see is what Sun would get out of such a venture.

jwenting 1,905 duckman Team Colleague

Well said. Of course in the real world there's often a layer of non-programming technical people shielding the programmers from the harsh world of the end user.

Whether analysts, helpdesk staff, or project managers, their task is to act as a kind of translators and intermediaries between two often disparate worlds.

While programmers and the end users of their products can talk, there's almost always a disparity brought about by completely different thought patterns.
The programmer thinks of how the product will do what it does, the user only thinks of the end result of that process.
They also often have different views of reality resulting in say a user interface designed by a programmer being extremely powerful but at the same time incomprehensible to the non-technical end user.

jwenting 1,905 duckman Team Colleague

Idiotic analysis.
Healthy companies (which Sun and Google both are) don't set agendas based on wanting to destroy other companies.
Neither Google nor Sun could exist at this stage without Microsoft and they know it.

Google will never dominate the software market. They don't have the culture for it.
In fact I doubt any company could step up to dominate the market the way Microsoft has been able to do over the last 25 years or so, at least not for a long time.
The socialist/communist attitude prevailing in the press (which in turn decides how people view companies) makes that impossible to achieve. Any company trying would be treated to all kinds of legal hurdles preventing them from branching out into other areas.
Microsoft only prevented being broken up by the socialist anti-corporate lawyers because of deft legal maneouvering of their own a few years ago, those lawyers won't allow any company to reach the stage where they could do the same.

jwenting 1,905 duckman Team Colleague

Not bragging, merely making a point. Anyone can say that something is commonplace but unless you've the experience to back up such a statement what's it worth? ;)

jwenting 1,905 duckman Team Colleague

Geek is chic. A geek is someone well versed in the latest technology with a strong passion and understanding of math and science. A nerd is a socially inept person with thick glasses and a pocket protector. Not all geeks are nerds and not all nerds are geeks.

I lack the pocket protectors... Does that make me a nerdy geek or a geeky nerd (and proud of it either way)? :mrgreen: