- Strength to Increase Rep
- +16
- Strength to Decrease Rep
- -4
- Upvotes Received
- 330
- Posts with Upvotes
- 257
- Upvoting Members
- 112
- Downvotes Received
- 17
- Posts with Downvotes
- 17
- Downvoting Members
- 15
1,171 Posted Topics
Re: *I don't know how many of you have ever met Dijkstra, but you probably know that arrogance in computer science is measured in nano-Dijkstras. - Alan Kay* | |
Re: Recently I was looking for books about C#. Since this thread doesn't have alot of book suggestions I'll add the results of my search to it in the hope that it will be useful to others as well. * [A C# Reading List by Eric Lippert](http://www.informit.com/articles/article.aspx?p=1769249): * [Essential C# 4.0](http://www.amazon.com/Essential-4-0-Microsoft-Windows-Development/dp/0321694694/ref=sr_1_2?s=books&ie=UTF8&qid=1360450257&sr=1-2&keywords=essential+c%23) … | |
Re: Of course we are able to help you. Could you show us your code and point out what issue you are having? | |
Re: Compiler output: FriedmanRPSgame.java:3: error: package hsa does not exist import hsa.Console; ^ FriedmanRPSgame.java:7: error: cannot find symbol static Console c; // The output console ^ symbol: class Console location: class FriedmanRPSgame FriedmanRPSgame.java:11: error: cannot find symbol c = new Console (); ^ symbol: class Console location: class FriedmanRPSgame FriedmanRPSgame.java:21: error: … | |
Re: Do you have a specific question about this piece of code? Or was this intended to be a code snippet? | |
Re: Sounds like a class will be useful to implement it ... | |
Re: The exception message tells you exactly what the problem is: *Multiple decimal separators in pattern "#.##0.00"* A decimal separator in this context is a dot, and your formatter pattern contains *multiple* (more than one, two to be precise) of these. | |
Re: [QUOTE=paruse;1017271]I'm a beginner in C++. I saw \b and \r in a program source code. I've seen \n and I know its purpose. But why do we use \r and \b in C++? Please clear my doubt. Thank You.[/QUOTE] Those codes are called backslash codes (or character escape sequences), there's … | |
Re: Very nice snippet ! I didn't know it was actually such a small code ... | |
Re: Actually to be correct, the [Color constructor](http://docs.oracle.com/javase/6/docs/api/java/awt/Color.html#Color(int,%20int,%20int)) we're talking about takes 3 values in the range 0-255 (255 inclusive!) Thus, to be entirely correct you'd need to call the constructor as follows: `new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256))` >How do I return just int numbers I can use somewhere else? You could … | |
Re: [QUOTE=VernonDozier;865671]That's a star? I doesn't look like any star I've ever seen.[/QUOTE] It isn't a star but a 'star pattern' (or asterisk pattern) | |
Re: Very nice snippet ! | |
Re: Your code is total rubbish, void main(), conio.h, no code indenting, magic numbers et al. Have you even ever heard about code conventions? I think those boring library and hotel management stuff are already way too difficult for you to code. If you think so high of yourself that you're … | |
Re: >So Far I Havent Started to Code On My 'OWN' What are you waiting for? Get started! Cheapest way, and you learn something too ;-) | |
Re: 1. No need for String conversion here: `System.out.println(""+multiply(-8,8));` PrintStream.println has an [overload](http://docs.oracle.com/javase/7/docs/api/java/io/PrintStream.html#println(int)) that takes int as argument. 2. No need to roll your own abs, [Math.abs(int)](http://docs.oracle.com/javase/7/docs/api/java/lang/Math.html#abs(int)) provides one. 3. Another possible approach that satisfies the (2 years old) request: `new BigInteger(a).multiply(new BigInteger(b))` **[1] [2] [3]** **[1]** `a` and `b` denote … | |
Re: Well, why don't you just check out the [URL="http://www.daniweb.com/code/forum2.html"]code snippets section[/URL]? Plenty of good stuff about pointers can be found [URL="http://www.eternallyconfuzzled.com/tuts/languages/jsw_tut_pointers.aspx"]here[/URL]. Edit:: The nicest code snippets I've ever seen on this forum, were the ones which you can find [URL="http://www.daniweb.com/code/coder5020.html"]here[/URL] (though they're more about C than about C++, I'd strongly … | |
Re: The following link describes in detail how to code edge detection yourself: [URL="http://www.pages.drexel.edu/~weg22/edge.html"]http://www.pages.drexel.edu/~weg22/edge.html[/URL] And maybe this link is useful too: [URL="http://www.intelliproject.net/articles/showArticle/index/image_proc_edge_detect"]http://www.intelliproject.net/articles/showArticle/index/image_proc_edge_detect[/URL] | |
Re: Because I don't eat tree. Why can't I think of a stupid question? | |
Re: Seems like you're using Microsoft Visual C++ ... > Did you put the header file in the project ? > Is the header file in the same directory as the '.cpp' file(s) where you're including it in ? | |
Re: With me your code compiles (I'm using MinGW), but when running, your program will crash :) | |
One of the things which attracted my attention was that there are often newbies asking how to create a password program in C/C++, often they don't succeed, well here's my response, you can use it for any purpose you want, one thing you'll have to keep in mind is that … | |
Re: [B]>use fgets() instead of scanf() because it avoids buffer overflow problems if you type in more characters than name will hold.[/B] I'm not going to repeat what Tom Gunn said once, I'm just going to link you: [url]http://www.daniweb.com/forums/post956935.html#post956935[/url] | |
Re: >What you provided is great but not really portable. How is a digital version of the standard "not really portable"? **Edit:** Take a look [here](http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list). | |
Re: In my opinion the [Head First Design Patterns](http://shop.oreilly.com/product/9780596007126.do) book is a pretty good and understandable introduction to design patterns. I believe good examples of how design patterns can be applied are key to making them easier to understand for newcomers. Also I'd recommend to clearly demonstrate the benefit of applying … | |
Re: You can use [Arrays.asList](http://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html#asList(T...)): List<Sector> sectors = Arrays.asList( new Sector(12345, 13455), new Sector(12745, 13755) /* etc. */ ); Note however that the returned List is not **structurally modifiable [1]**, if you want to structurally modify (e.g. add, remove, insert sectors) the returned List later, then consider the following: List<Sector> sectors … | |
Re: Try [this](http://lmgtfy.com/?q=jtable+database) next time. | |
Re: >I want it to display automatically when I run the programme without the need to press any buttons Set the text field's content in your constructor. | |
Re: Here's a readability tip: use constants defined in the [KeyEvent](http://docs.oracle.com/javase/6/docs/api/java/awt/event/KeyEvent.html) class. Example: if (e.getKeyCode() == KeyEvent.VK_UP) { // ... } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { // ... } else if (e.getKeyCode() == KeyEvent.VK_LEFT) { // ... } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) { // ... } | |
Re: >the same teacher today said that a main method doesn't require a void return type, or any return type at all. The Java compiler disagrees... If your teacher said that about Java **[1]**, then (s)he is plain wrong as per [JLS 12.1.4](http://docs.oracle.com/javase/specs/jls/se5.0/html/execution.html#12.1.4) ***The method main must be declared public, static, … | |
Re: I'm writing this post for everyone who - like me - is trying to send requests with: `Content-Type: application/json`. I figured it out the hard way (by capturing the packet sent from the PHP code sample) that the `Content-Type` needs to be `multipart/form-data`. | |
Re: To be honest, I have never liked Java's Date and Calendar stuff, and luckily there's [this](http://joda-time.sourceforge.net/) available. | |
Re: In [this post](http://www.daniweb.com/software-development/java/threads/445362/java-books#post1919671) I point out the books that I find especially helpful to get proficient with Java. >The complete Java reference book 2 Are you perhaps referring to an old version of [this](http://www.amazon.com/Java-Complete-Reference-Herbert-Schildt/dp/0071606300/ref=sr_1_1?s=books&ie=UTF8&qid=1362433453&sr=1-1&keywords=java+complete+reference)? That book is probably not as "complete" as a reference as its title suggests. If I … | |
Re: >What on earth is LSL? (guess) [LSL](http://wiki.secondlife.com/wiki/LSL_Portal). | |
Re: Why even bother dealing with multiple frames? http://stackoverflow.com/questions/9554636/the-use-of-multiple-jframes-good-bad-practice Try a [CardLayout](http://docs.oracle.com/javase/tutorial/uiswing/layout/card.html). | |
Re: [B]>Can you please explain a little how you derived the formula c = c * (y - x) / (x + 1); ....just to get the idea of what steps to do in order to reach this formula[/B] Dude, are we going the reinvent the whole history of maths? No! … | |
Re: It is safer if no echo feedback is given at the time you enter your password. That way if somebody behind you is looking over your shoulder, that person can't tell how long your password is by counting the number of asterisks on your screen. Perhaps you find this a … | |
Re: You could even compact it further using the conditional operator: return ((a * d) == (b * c)) ? 0 : 1; Keep in mind however that compact code does not necessarily contribute to readability. **Edit:** You seem to have defined your isSolvable() method with **int** as return type. A … | |
Re: [Integer.toBinaryString(int)](http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#toBinaryString(int)) in case you don't have to implement the algorithm yourself. Also note that if you write e.g. `int x = 5;` the 5 is *actually* stored in binary. `System.out.println(x);` prints 5 because the binary value in x is converted to base 10 for display. | |
Re: I've written a C++ class to estimate the roots of a number: you can check it out [URL="http://www.daniweb.com/code/snippet1150.html"]here[/URL] ... Maybe the following page might be helpful too: [URL="http://en.wikipedia.org/wiki/Methods_of_computing_square_roots"]http://en.wikipedia.org/wiki/Methods_of_computing_square_roots[/URL] Hope this helps ! | |
Re: >Write System.exit(0); in your code whenever you are in stress..:) It won't reduce stress, it will create stress in the long run. Because 1. Whenever the program appears to be shutting down for no apparent reason it will cause headache to your colleague(s) (and you, if you forget about the … | |
Re: It seems to have affected my upvoted / downvoted lists too: There's one post with 0 votes in my upvote list, and I know it hasn't been downvoted because my downvote count hasn't changed. In fact I even noticed that after my name change all of my previously downvoted posts … | |
Re: *"The greatest mistake you can make in life is to be continually fearing you will make one." - Elbert Hubbard* | |
If I check my profile page I read "Total Down-Votes Received: 16", yet if I click the [Posts Voted Down](http://www.daniweb.com/members/495627/mvmalderen/posts/downvoted) button, only one downvoted posts shows up. My gut feeling tells me that it is related to my nickname change, because since then the downvoted posts list seems to give … | |
It's me *again* ;) The other day the endorsement counts of high-level forums ("Hardware & Software", "Software Development", "Web Development", etc.) caught my attention. Here's a screenshot of the endorsements strip shown above the page footer of the Software Development forum. If I hover over an avatar (in this case … | |
Re: Take a look at [entrySet()](http://docs.oracle.com/javase/6/docs/api/java/util/Map.html#entrySet()) and [Map.Entry](http://docs.oracle.com/javase/6/docs/api/java/util/Map.Entry.html). | |
It seems like sometimes when someone signs in using Facebook, something like this happens:   Is this considered to be "normal"? **Edit:** I noticed that while composing this post, I couldn't remove attachments I added. The remove option was available only in edit mode, *after* I posted. |
The End.