- Strength to Increase Rep
- +12
- Strength to Decrease Rep
- -3
- Upvotes Received
- 240
- Posts with Upvotes
- 207
- Upvoting Members
- 103
- Downvotes Received
- 25
- Posts with Downvotes
- 24
- Downvoting Members
- 16
Tech writer. Coder for sport, not for pay.
- Interests
- Brewing. Translation. Accordion.
- PC Specs
- UNIX. Tops-20 for fun.
713 Posted Topics
| |
Re: At any given point there is one largest number. Either the new number isn't larger than the previous largest number, or it is. What do you do in the first case? What do you do in the second? | |
Re: Prem - are you looking for function prototypes in Java? If so, there are none. In C, you have a header file with int foo(int dollars); float bar(void); and so forth. This is neither necessary nor possible in Java. This may be too much detail, but this is because Java's … | |
Re: [QUOTE=VEGETA_DTX;1458646]My dear god! What an insolent person you are Narue, do you even hear yourself? I think that any further discussion with somebody as insolent and as poor-mannered as you, especially for a female, would be ultimately ridiculous.[/QUOTE] "Especially for a female?" Care to explain what you mean by that? | |
Re: For the N>=10, I'd assumed you would use hex. :) Okay, step away from the code for a minute. Think about what you're trying to do, and then see if the code comes clearer. In short, you want to print n rows, each one composed of the descending-ascending sequence n..1..n. … | |
Re: [QUOTE=Agilemind;1300900]a single Canada Goose (not Canadian Goose) poos every 5 minutes. [/QUOTE] Yeah, I've had days like that. I think it was the chili the last time. | |
Re: Sure. What's your question? (I think I can guess, but I'd rather you state the problem explicitly) | |
Re: Sounds like you're new at this. Have a go at writing it and see where you get. First thing to do is to work out what the steps are. So for part one, you've been told to use a while loop to prompt a user to enter five integers and … | |
Re: If you allow entry of filename and then search for the files, you'll have to be ready to handle multiple files with the same name. (ie, programs/java/foo.java and programs/java/bar/foo.java) An easier task would be to ask the user to operate a standard file chooser, where they have to actually specify … | |
Re: Very interesting. I hadn't thought about the implications of devanagari and unicode representation for this problem. For those who haven't looked at Indian languages, the representation is syllabic, with consonants followed by short a unless otherwise specified, and consonant clusters represented by compounding the consonant signs: सरस्वती would be read … | |
Re: What sorts of things are you interested in doing with programming? Different languages offer different possibilities - or, perhaps, different languages incline towards different tasks. If you want to learn general programming skills, Java might be a good place to start, although there's a lot of overhead to absorb. Some … | |
Re: Java operators are actually a bit more involved of a list. Look in the Language Spec (search google for Java Language Specification, and bookmark it, you'll be referring to it a lot, especially if I answer your questions) To help you out, here's the relevant section: 3.12 Operators The following … | |
Re: [QUOTE=prem2;1301975]Hi team, Can any one say what is instance Method in java with example? Thank you, with Regards, Prem[/QUOTE] An instance method is a method of an instantiated class. A simple example might be this: You have a Class representing Cat. Each Cat can do some things - it can … | |
Re: Talleyrand - the smartest man in Europe in his day. Managed to keep himself on top from monarchy to revolution to Terror to Napoleon, and did it in style. | |
Re: I have friends who will never get old. I miss them like hell. Growing old isn't such a bad option, all things considered. | |
Re: Chris Moore (aka Moore and Sons). Will be listening to something else another day, but this one just came in the door, so I'm still pretty high on it. | |
Re: Funny, I just started playing with Python and primes was the first thing I tried. Here's what I came up with - appreciate any feedback, especially the useful kind. What I was really wanting to learn, of course, was file io, hence the trick of storing a batch of primes … | |
Re: What happens if you find a composite while count is a multiple of 9? You'll hit line 38, and that condition is true, so it prints a new line. | |
This is really just too cute. Anyone having trouble with QuickSort? Watch [URL="http://www.youtube.com/user/AlgoRythmics"]this[/URL], it'll all make sense. :) | |
Re: Um, please don't post stuff like that. Not only is it godawful ugly, it also defeats the purpose of a switch, and, by the way, won't even look like compiling. Switch is a mechanism for comparing a value against a range of primitive constants, and the cases have to be … | |
Re: [QUOTE=characteredu;1447497]Today i learn how to control your feelings when you are getting angry with someone.[/QUOTE] Duuuude.... I'll have to be careful about getting angry with people, if it gives you the power to control my feelings. | |
Re: I'm not sure I see what it is you're trying to do with these interfaces. What does it buy you to implement (sorry) these categories as interfaces, and not, say, as booleans or as enums or named constants? I can't think of any method signatures that would be required of … | |
Re: the .NET platform is popular in business, but it's limited to the Windows environment, obviously. Java is still in demand, but it's not the hot thing any more. For web stuff, honestly, I don't think either is your first choice these days. People seem to be developing in Python (although … | |
Re: I disagree entirely with the notepad part. Haven't tried notepad++, so I can't say about that, but if you learn some flavor of vi (vim, gvim, elvis...) you might find that it's worth the effort to use a full-featured text-oriented editor. Some people like Emacs, but I don't talk to … | |
Re: Coming in late to the game, I just want to point out to the original poster that proving to yourself that you don't need to check past the square root is a worthwhile exercise, and not a tremendously difficult one. | |
Re: A few notes. [QUOTE][B]Abstract Class[/B] 1.Cannot be initated.[/QUOTE] instantiated - "initiated" doesn't mean anything here... [QUOTE]4.A class extending the abstract class does not need to use all the abstract methods from the abstract class.[/QUOTE] Does not need to use them, but it must provide code for them, even if the … | |
Re: This is a neat problem - if you think about it, you might be able to work out the final state of the "experiment", but it does take a bit of an "aha!" moment. While you're mulling that over, the best way to start writing a program like this is … | |
Re: Any computation involving a double returns a double - basically, numbers are promoted to the highest type in the expression before the expression is evaluated. See the Java Language Spec for the gory details - worth reading, honestly. So you don't actually need the cast in this case, because the … | |
Re: Pass the String args[1] as a parameter to the method, and parse it as int or double if needed. Alternatively, you could parse it as int or double if needed and then pass the result to the method. The latter is nice because it allows you to detect bad input … | |
Re: You know, here we've put these guys into a war zone for the last year, or two, or three, or who knows how long some of them have been there, getting shot at every day by some sorry sonuvabitch who might be selling them a kebab tomorrow, watching their buddies … | |
Re: [QUOTE]4) we evolve from apes or fish- if this is true, then why are there still apes and fish? usually when something evolves..the form they evolve from ceases to exist.[/QUOTE] There is nothing even vaguely correct about this assertion - it isn't even sensible enough to be properly wrong, it's … ![]() | |
Re: I play a fair bit of music, brew beer, and translate novels from Spanish, German, and Portuguese. Man, I love not having a TV. | |
Re: I have to say, some of these questions are really not very good ones at all. There are some factual questions which are either true or false, but what about these? [QUOTE]4. All objects use the same value for class variables 5. Set methods require a parameter 6. Primitive data … | |
For those of you who have noticed the missing JLS, here's a [URL="http://jls3.ru/j3TOC.html"]mirror [/URL]that I found (through Stack Overflow). I'd like very much to know where it's gone, if anyone has any good information... | |
Re: The command line arguments are optional, and in fact they are seldom used. The String[] parameter is not optional. Java is not looking for a method called main() - you could have any number of methods called main, and as long as they all take different parameters, that's fine. What … | |
Re: You could set an increment variable. Start it at 1, and flip it to -1 when the counter reaches 100. Then your increment step is simply counter += increment. Be sure to set your loop exit condition to counter >= 0, or you'll keep counting down forever. ![]() | |
Re: But you don't want to do that. There's a reason it's called "object-oriented" programming, yeah? | |
Re: [QUOTE]some (other) people might be dyslectic[/QUOTE] Muphry strikes again! | |
Re: Usually I'd do something like [CODE] public char pop(){ ListNode return node = null; try { node = getMeANodeOrDieTrying(); // dangerous assignment } catch (DieTryingException dte) // catch the specific exceptions you expect, so you can handle them correctly { notifyWidow("He knew it was a dangerous assignment"); //handle, don't eat … | |
Re: [QUOTE]For example, can I expect to be a competent programmer after finishing this course? [/QUOTE] I know nothing about Hillegass or his programs. However, asking this question about any one-week course, my reflex answer is "only if you're already a competent programmer". I don't think there's a one-week course in … | |
Re: I need a program to plot routes for my salespeople. The program should take an arbitrary set of cities that should be visited on a given tour of sales, and plot the cheapest itinerary. I don't mind if they have to make a lot of connections, but I want to … | |
Re: The way you're going about this is a little odd. Why are you creating sub-arrays and copying over to them, and then copying them into your final array? Why not just fill in from 0..start from the original array, then fill from start+1..replacement.length from replacement, then fill again from original? … | |
Re: I usually figure if I'm in disagreement with AD, it's good to take a second look, because it's likely me that's wrong. So I took a second look. I still think it looks gross. | |
Re: I say you shouldn't do either, but if you must allow one class to monkey with another's data, you should at least keep some control over it. Really, if one class is thinking about the fields of another class (instead of what it would like that other class to do … | |
Re: How would you solve this by hand? One way would be like this: 450 pages first 100 pages: $3 leaves 350 pages second 100 pages: $2.50 Total is now $5.50, 250 pages left to deal with. third 100 pages: $2.00 Total is now $7.50, 150 pages left to deal with. … | |
Re: Set up a build file in ant. Put your dependencies in a directory and include them in the jar. Run the build file. |
The End.