have ever coded anything in Java before?
If not have ever read a single tutorial or beginners' book about Java?
All these questions are so basic they're part of the very earliest you should have been taught.
have ever coded anything in Java before?
If not have ever read a single tutorial or beginners' book about Java?
All these questions are so basic they're part of the very earliest you should have been taught.
if you get an exception on application shutdown there's something wrong with your application and you shouldn't blame the shutdown hook for it.
As to providing a menu, check your Swing tutorials...
A better way is to pass it to the second method as a parameter. Especially since main is static and pulling the variable outside main would cause all kinds of other problems (especially if multiple instances of the class are created).
read the posting guidelines and next time start earlier on your assignments.
what do you mean "move between methods"?
You want to call one method from another? Check your textbook, see those braces?
Learn the language syntax and all will become clear, or at least clearer than it is now.
You don't want the page numbers inserted into the text editor.
What will happen if you add or remove text? The numbers will now no longer be properly positioned, instead showing in the middle of the pages.
Instead you'd better customise your printing routine (I guess you want to print things?) to insert page numbers every X lines and a pagebreak directly after that.
getch() is platform specific, it's DOS/Win only.
We try to keep code as much platform independent as possible for as long as possible.
Besides, getch() gets a single character and the problem is about reading and parsing a string.
at least the exception will be handled :)
a) consider bytecode like an obj file for C or C++ with the JVM being the linker. Not quite what happens but close enough to start with.
b) if your book doesn't talk about that get a better book.
c) that's OS specific. What you type gets translated by the hardware into a hardware specific code which gets translated by the operating system into a potentially platform specific code which gets transferred to the JVM. The JVM works only with Unicode internally. ASCII is 8 bit, Unicode 16 bit. For those characters which exist in the ASCII set those will map to Unicode characters where the hi (or was it the low) byte have the same value as the ASCII code.
d) see b) and use your brain instead of mindlessly copying your homework.
you're parsing numbers from the input.
I guess you're using atoi to turn the input into ints as you'll be reading it as char* ?
Check the docs for atoi, it will return 0 if the input is not recognised.
Pagenumber 0 is highly unusual, you could use that as a boundary condition (or a negative number might even be better).
So say you want the user to terminate the input by typing -1. atoi("-1") will return -1 which will flag you that the user is done inputting text.
it's also better to use a descriptive topic and not demand instant attention as that's extremely rude.
your screaming you demand urgent help is enough reason to let your request sit for a few months before looking at it.
only 1 thread can access the file at once as the file pointer WILL move during the read and write operations.
Say you're reading and have read 100 bytes. Now the other thread moves in and starts to write after setting the file position 1000 bytes from the end.
After 200 bytes the read thread begins again and tries to write 900 bytes.
Not only will it read from the wrong part of the file it will also try to read beyond end of file.
hmm, I do believe in using the best tool for the job and that's the STL.
Another way would have you create a linked list of ints and read them into that instead of into a vector.
The STL solution probably does something similar internally, clearing you of all that messing around with pointers.
try something like
vector<int> v;
string s;
while (cin<<s)
{
if (s != "\n") v.push_back(atoi(s.c_str()));
}
replace \n with the corresponding value for your OS (or find some way to detect it and use the detected value).
whatever happened to WordStar? Do they still exist?
WordStar was the preferred choice of the scientific community in the 1980s and early 1990s, afterwards superceded by WordPerfect 5 which had a marvellous equation editor.
It's simple: that advertising pays for the movie. If it weren't there that DVD would cost you a lot more.
A typical movie will retrieve over half its production cost from sponsorship (read advertising).
If customers can just skip that advertising the advertisers will go running to other media like internet bannerads and popups with smart technology to evade blockers.
Or they'll turn the movie itself into an advertising freakshow instead of showing a few ads before and after.
This is already happening, with brand symbols and names being ever more publicly and for ever longer times shown in movies.
James Bond now rides a BMW instead of an Aston Martin because BMW paid a few million and donated the cars.
Another movie may feature the heroes in an airline terminal where a United Airlines aircraft is visible in the frame (plus a United checkin desk, a United luggage trolly, etc. etc) for minutes at a time.
Any advertising you see in movies on busstops, storefronts, etc. etc. is almost certainly not coincidental.
In some movies the heroes will walk around in clearly mark clothes from one brand or another not because it has any relation to the story line but because that designer paid for the privilege.
In the movie The Net Sandra Bullock very clearly used a Mac, the villains used PCs. Guess who sponsored that movie?
That's only bound to get worse. At least now it's mainly …
what does your constructor look like?
In it you should call the superclass constructor if I'm not mistaken (been a while since I've used Delphi...).
Every class you create inherits from TObject if memory serves...
If you don't want a dynamic object, don't call create. Create creates a new object of the class on the heap.
:= is a Pascal construct, Java uses = (so no :).
a, b, cc aren't defined anywhere. Compiler won't like that either.
You're trying to assign a value to a final variable.
Depending on the types you give a, b, and cc you will get other errors or not.
FireNet,
i've got it. but have not known how to use it. it's always giving the message:
Failed to locate protected mode loader (DPMILOAD.EXE).
can u put me thru. in using it?
thanks.
That sounds like a DOS compiler wanting to switch to DOS protected mode.
What are you using? Borland C++ 3.0?
Get the latest Borland C++ Builder (there's a free version) instead, it will do both GUI and command line Windows applications.
As to restrictions: it comes with less components for building systems by click and drag and doesn't allow commercial distribution of the created software.
Neither is a restriction when learning the language and the missing components aren't things typically used in freeware stuff either (most deal with relational databases, CGI programming for webservers, and highend stuff like that).
try song:= new song.create;
LOL. It's not a new browser. It's merely a new shell around IE, a skin if you like.
That's the power of IE, you can incorporate its functionality in nearly any application you like.
Along the lines of this product you have an alternative to IE built right into Windows itself: Windows Explorer. When you type a URL into the input box on top where you see your directory and drive letter it will go to there. It IS in effect IE with some extra functions on the side.
don't try to hijack other peoples' threads macman. It's rude.
as to SP2, better get used to it. After SP1 was released there were a lot of people who screamed they would never install it.
Those same people were the ones who afterwards screamed that Windows was so full of security leaks whenever they got hit with trojans and other malware which would have never gotten onto their systems had they but installed SP1.
Now with SP2 it's the same thing all over again.
Much of that malware is of course distributed by the P2P networks they use to download pirated software and music...
I've been using Borland compilers since their very first C++ compiler and never had problems with them...
Yes, their object code is incompatible with Microsoft linkers but the exe code generated by the linker works fine. That's why Borland have their own linkers...
if you hadn't said it was urgent I might have taken the time to help you along.
Claiming your problem is urgent is rude, it implies you consider yourself to be more important than anyone else here which you're not.
But I'll be nice and give a hint :)
Look at the API docs for java.util.Stack
when you read the file, you read it line by line I guess?
What's a special characteristic of a blank line? Hint: it has to do with the number of characters on it after stripping whitespace.
What's a vowel? How can you detect it? When you know that all you need to know is how to loop through your input and count them.
Eclipse and JBuilder are the best in the business. IDEA is supposedly also excellent, I've never used it so I can't tell.
I never liked Netbeans/Forte. Poor project management, poor performance and a memory hog (this goes for every version I've used which means every major release).
Shall we get into a VI versus Emacs battle? :)
Personally I don't give a gnat's ass about GUI builders, wizards, etc. etc.
When learning the language you should never use them and when you do know the lanuguage you'll typically find you can work faster by typing in the code than by modifying generated code.
He just copied the specs from Apple's website, the box comes with those things as standard.
Remains that what he's claiming to want as a webserver is really a highend graphics workstation for photographers and graphicists, not a server machine at all.
Which, if he knows what he's doing (which is someone doubtful but let's give him benefit of doubt for now) means he knows full well he doesn't want a server and just wants a free new workstation for a hobby or company at our expense...
also: asking for private help in a public forum is rude. Help is given so everyone can benefit from it, that means we're not going to send you an answer as an email.
write it down. How would you solve it on paper?
Forget that computer. Turn off your screen and get pen and paper.
Every problem can be solved without computers, it just takes time (in some cases more time than there is, but the idea is not to solve the problem but to determine HOW to solve it).
Work it out in detail, small steps.
Then when you have all that written down, think of how you'd tell the computer to do each of the small steps you've determined.
I see you haven't yet grapsed the concept of encapsulation of data.
Why do you keep your months, years and days outside your class?
Wouldn't it be a lot better to have an array of dates instead of 3 arrays of the parts of that array?
That would enable you to move the parser into the class as well and avoid a lot of parameter passing.
Where does your function go wrong?
It looks overly complex. If you're loosing grasp of what your code is doing usually it's a good sign you'd better redesign it.
Think about how you should go about implementing the calculation on paper, then code to do that calculation.
Write down in words what the program should do in detail, then translate that into code.
If you know modelling tools, you can use those too.
Make things like state transition diagrams, flow diagrams, etc.
It doesn't really matter, but understand what the code should do and how you want it to do it and quite often the code will start to seem to write itself.
It's hard to explain I know, I don't know how it starts to happen but it does.
It's probably a subconscious process that you need to tap into, once you reach that the actual programming language becomes an implementation detail. While it won't allow you to program in languages you don't know it does allow you to more easily learn languages and use them, to read existing code and understand it.
So start by writing out in words exactly what happens when, and then figure out how your ADT fits into that.
no you can't.
It just means the number is undefined. You're declaring an array of 3 arrays. The number of elements of each of those 3 arrays is unknown at this time but will have to be fixed at some point.
It doesn't even have to be the same number of elements for each I think (not 100% certain here, could be I'm confused with Java where such is the case).
Of course unlimited numbers are impossible as the index must be an integer type and therefore fit into a 32 bit (or 64 bit depending on compiler/platform) word. It's also limited by the amount of installed memory in the client machine.
Might be worth it depending on cost.
If it takes say $100 a year extra to not get ads it wouldn't be worth it for me (unless the number of ads for those who don't pay increase but that would then be reason enough to leave).
Of course without an alternative to PP donations are for many (including me) a pure hypothesis, so you might want to consider adding creditcard transations alongside PP which I think would get you quite a few more donations than offering an adfree alternative.
Had you purchased it as you're supposed to people might help you.
We're not here to support criminals stealing software or anything else.
Reported for criminal intent. Hope you gained a nasty virus downloading and installing your pirated software.
you will need to overload the operator<< for both Date and Event for certain.
Whether that alone is enough to have your program do what you want you'll have to try, but likely you'll need to print both key and value manually by accessing the pair which is the data structure pointed to by the iterator and calling its "first" and "second" members (which then triggers your operators).
All self-respecting C compilers from about 1985 onwards and all selfrespecting C++ compilers from about 2000 onwards (give or take a few years in each case) will support AT LEAST the same common set of functions as defined by ISO/ANSI.
On top of that each will come with a set of custom libraries for the operating system it's designed to work on, these will indeed differ per manufacturer and operating system.
As long as you stick to the standard when learning any modern compiler will do.
That will mean you're not going to make fancy GUI programs of course as that's where the most obvious platform specific libraries are :)
As to Borland and Microsoft, Borland has the better product with better standards support (though Microsoft is getting there, they currently have about 95% support where Borland has 97.5% or so) but Microsoft's is marketed better which gives them the edge commercially.
I've never experienced problems with Borland products having poor memory management code. Most likely grankor didn't know how to properly create such code and by the time he switched to Microsoft VC++ he had learned...
If you're so poor how are you going to fork out the cost of a datacenter to place your server?
Your ISP most likely will not allow you to host a large scale webserver from your bedroom and terminate your account when they find out (which they will).
As a hosting solution where you place your machine in a datacenter costs hundreds of dollars a month the cost of the actual machine is peanuts in comparison over time.
So you either plan to come here begging for more money to keep the machine running every month, never wanted a webserver at all but a nice machine to show off to your friends, or you didn't ever consider the hosting cost in which case you're going to have to rethink your plans.
In either case there's no reason at all for any of us to spend the money towards your playstation.
No, JBuilder USED to cost that much. 5 years or so ago that is when it was the current version.
Current version is version 10 I believe which is far more capable.
It's like saying your old computer cost $3000 when you bought it so you should get $3000 for it now when you sell it.
It just doesn't work that way.
But on eBay you never know. Someone may be stupid enough to fall for your attempt to trick them out of good money they could better have spent otherwise.
Why would anyone donate money to you for your new computer?
Did you donate money to any of us when we wanted a new toy to play with?
If it's for a company website the company should pay. If they don't have the money they should go to the bank with a sound investment plan and try to get a loan.
If it's for yourself save up until you can afford it.
you can pick up my old P200 for free and use that as a webserver...
You'll have to drive over and pick it up though :)
JB 3.5 is useless. It doesn't support hotplugging compilers and the compiler that comes with it is years out of date (as are the other supported techs).
$10 would indeed be a nice amount, for that it would fit right into my museum of old Borland products.
What does the iterator attempt to call the operator on though?
Not quite sure but I believe your iterator will return a pair<Date, Event> which will of course know of no operator<<.
You'd have to dereference the Event out of that pair using .second so you'd get iter->pair.second (or possibly iter->pair->second)
Mind that I'm not 100% certain about this, but look in that direction for your solution.
The latest from Microsoft research: a new language based on O'Calm, called F#.
Read about it and download the compiler and documentation to try it for yourself.
Make your colleagues scratch their heads wondering what the heck you're writing in :cheesy:
personally I'd use a switch statement where you use an if statement.
With just a few options it doesn't have significant impact but when things get more complext it greatly enhances readability.
Look at the error and tell why it has anything at all to do with map<T>.
It says you failed to define operator<< for your enumeration class.
P.S. don't post your source as attachments if you want us to look at it.
Take the relevant parts and paste those inside code tags (that means NOT to post hundreds of lines of code that does in no way relate to the problem you're having).
If I get everyone in the company and all our customers (several hundred) to vote next week will get a reward? :)
They'll all vote IE of course as that's what we outfit our machines (and those we supply to customers and support our software on) with.
and as to sorting, use the STL for that.
Put your strings into a list and call sort on that (though your teacher may want you to write your own sorting function, he should have told you specifically if he doesn't want you to explore and find out that the language has one built in IMO (*)).
(*) whether your teacher appreciates such an approach depends on how well you relate to that teacher.
With my teachers in the past they might not have liked it and said so but they would not hold it against me ever. In the next course they probably changed the assignment description, I never checked :)
ok, so you have had some IDE autogenerate a piece of code for you without the parts that are important to your application (what's called the business logic).
A few mouseclicks in JBuilder will give me the same.
Now comes the thinking, good luck with that and trying to find out what it is you want to happen when that mouse is clicked...
English isn't Latin. Sentences are allowed to be less than 3 lines in length.
Divide up your problem, word it so you can make it understood what you're trying to do.
And no, we're not here to build your code for you. That's your job. We CAN help you find logic or other errors in the code if you can show us your code and tell us 1) what it does and 2) what it should be doing.
just trying to make people think for themselves Dani... There's way too much "I don't want to think, I just want a canned solution so I won't fail my test" attitude these days.
If those people graduate without writing code they'll become problems for us as colleagues and we'll end up with more work as we'll have to do their work as well leading to unpaid overtime, missed deadlines, etc. etc.