- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 26
- Posts with Upvotes
- 20
- Upvoting Members
- 19
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
PhD student in Computer Science Education
Re: The intent of C++ code is very simple, even though it doesn't compile. It simply takes the sum of the values in an array. When you understand the purpose of a program, it's much easier to port it, since you aren't blindly translating code. You really don't seem to show … | |
Re: If you want to develop a game completely using C, the [Allegro library](http://alleg.sourceforge.net/) is a pretty comfortable choice. Other folks use engines like [SDL](http://www.libsdl.org/) and [OpenGL](http://www.opengl.org/) to power games. I find Allegro to be easier to get started with, since it's much easier to go from nothing to a graphical … | |
Re: Hi! I love the new site - very nice-looking. I got an issue when I tried to update my avatar - just look to the left and see. :P I'm on firefox 10.0.2 on Ubuntu LTS 10.04 with noscript disabled. I tried uploading pngs and jpgs between 50x50 and 100x100 … | |
I've been unable to connect to the Daniweb IRC server for the past few days. Is it temporarily down? My life just doesn't feel complete unless I'm idling in there and not doing anything. :| | |
Re: This is an initiative I can definitely get behind. I've been idling there for over a year now, but things seem to have been picking up recently. Maybe there's hope after all. ;) /me changes his signature. | |
Recently, whenever I try to visit any user's profile here on DaniWeb, I get an ugly and intrusive browser dialog trying to push Flash on me. It's more than intrusive... it's very weirdly-worded. [quote] You need Adobe Flash Player 8 (or above) to view the charts. It is a free … | |
Re: Your recursive method has no base cases. Even if they did, your entire program is written in tail recursion, so whenever you return to a previous point in the stack, you don't have any control there because the only time you make the recursive call is in a return statement. … | |
Re: You know, since day one, I've tried to avoid looking at the reputation system as if it were some kind of a video game. It seems to be in bad taste and undermines the point of being part of the community. ... but this feature makes that [B][I]really[/I][/B] hard. I … | |
Re: On my system, this opens the 'nano' editor. To close out of nano, press 'Ctrl-x'. If you changed your command, then hit 'y' and Enter to save the changes. Once you exit, the command will run. | |
Re: Out of your choices, I'd pick Nethack, but I've always been quite partial to [url=http://roguebasin.roguelikedevelopment.org/index.php?title=Dungeon_Crawl_Stone_Soup]Crawl[/url]. | |
| Re: What version of Ubuntu are you using? If you're using a version that has 4.3 in the repositories, you will have a very hard time trying to upgrade it to 4.5. It might be easier to install a new version of Ubuntu than it is to upgrade the compiler. |
Re: So it looks like you're going out of the bounds of the array. Try to find out what the values of k and l are when the code fails. You could use the debugger, or just put a [icode]printf("%d %d\n,k,l);[/icode] before the if-statement and trace what the values are while … | |
Re: OK, your function definitions are causing some errors for me. Whenever you are simply writing a function prototype, you use a semicolon. But when you are defining a function, you don't. [code] my_prototype( int a, char b ); my_function( int a ) { } [/code] After I did that, the … | |
Not sure where bug reports should go, so I'm posting mine in feedback. This morning when I logged in to DaniWeb, instead of getting the redirect page, I somehow obtained a 'login.php' file for the page instead. Opening the file in emacs, it contained (in this order): - A bunch … | |
Re: It looks like you have some code that's sitting outside of functions. For example, the switch statement that's between lines 17-30 is not contained within a function. You can't have code just sitting around like that. You've also got a function inside of another function... i2c_readbyte is inside of i2c_writebyte. … | |
Re: I remember having the same problem back when I was goofing off with OpenGL. I'm not sure how much it will help you, but I'll contribute this anyway. I wrote a brute-force method that allows me to rotate along any object's local axis, and then I can use that as … | |
Re: Happens to me every once in a while in Firefox on Ubuntu 9.04. Sometimes it goes away and sometimes it doesn't. It doesn't mess with my typing, though. Just thought I'd throw that out there. | |
Re: The path to the shell that is currently running in a terminal can be found in the 'SHELL' environment variable. You can run 'echo $SHELL', which, on my machine, prints out '/bin/bash'. Is this what you're looking for? | |
Re: I'm assuming that 'student_file' is an array of strings? Do these changes help at all? [icode]11. sprintf(student_file[k], student_file, "%s %s %c", last, first, middle);[/icode] [icode]16. printf("%s\n", student_file[i]);[/icode] If they don't help, can you post your declaration of 'student_file'? | |
Re: My knowledge of signals is rusty, but here goes nothing... I think that after a handler is executed (in this cause, 'handleSIGCHLD'), the handle is released, and the function is no longer associated with the signal. Therefore, from inside the handler, you need to call the 'signal' function at the … | |
Re: Here's a simple pseudocode solution. [code] boolean[10] array /* Array of all false values */ int count = 5 /* Number of true values we want */ while count > 0: int k = Math.random()*10 /* Random integer from 0 to 9, inclusive */ if array[k] == false: array[k] = … | |
Re: Double variables just don't have that much precision. If you need numbers that are that fine-tuned, you need to look for an "arbitrary/multiple precision" library - something like GMP [url]http://gmplib.org/[/url] Hope this helps. | |
Re: It's not really Python-specific, but I would use the 'tee' command here. On *nix, the invocation of the script would be [code] python myscript.py | tee out.txt [/code] I'm sure Windows has a similar command as well. Hope this helps. | |
Re: I changed your function in the following way: [CODE] public String parsePath(String path) { String parsedString=""; String[] arr = path.split("\\\\"); System.out.println(arr.length); for(int i=0;i<arr.length-1;i++) parsedString+=arr[i]+"/"; return parsedString; } [/CODE] The first change I made was to path.split. You will probably think that this looks pretty ridiculous. This function takes a regular … | |
Re: Your function 'slope' should return the value of 'm' when it finishes. [code] def slope(x1, y1, x2, y2): a = (float(y2 - y1)) b = (float(x2 - x1)) m = float(a / b) return m [/code] | |
Re: What platform are you compiling this on? Some compilers have built-in stack-smashing protection that would prevent this code from working as expected. If you're using GCC, for example, try the following command: [icode]gcc -fno-stack-protector programcode.c[/icode] | |
Re: [icode]A*B[/icode] means 'A times B' [icode]A**B[/icode] means 'A to the power of B' Hope that helps you out. | |
Re: You're getting a timeval structure back. You need to do a little formatting before you can use it. Here are some highlights from the man page... [url]http://linux.die.net/man/3/localtime[/url] [LIST] [*] tm_year is the number of years since 1900... so add 1900 to your tm_year result. [*] tm_mon is the month where … | |
Re: A Python for-loop is pretty much like Java's for-each loop, where instead of going through the loop with an incrementing value each time, you go over a list of values, instead. Here's a simple example. [code] classes = ["English","Math","History","Physics"] for s in classes: print s [/code] If you prefer the … | |
Re: [CODE] file.write ( "%-10s%6d" % (item[0], item[1]) ) ^ ^ [/CODE] Worked fine for me after I put these parentheses in. |