- Strength to Increase Rep
- +9
- Strength to Decrease Rep
- -2
- Upvotes Received
- 77
- Posts with Upvotes
- 62
- Upvoting Members
- 54
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
I love to program, just a fact. I'm also very good at both programming and mathematics. I am from near Toronto in Canada. I ski.
- Interests
- Programming, Skiing, Kayaking, Mathematics, Chess, Computer Gaming
- PC Specs
- I have a very nice computer running Arch Linux on dual monitors. Ask me for more info if necessary!
Re: "I'd hate to die twice. Its so boring." - Richard Feynman's dying words. | |
Re: I'm the same way with javascript, I find it very hard to get anything done. However most C++ constructs do exist in javacript, including multidimensional arrays, for loops, etc. You can easily google for "How to do <something> in javascript" and get loads of answers and examples. Post a first … | |
Re: It stops working because you have no code in those sections. If you choose 'B' you will execute this code: else if (choice== 'B' || choice=='b') { } Which of course does nothing. Similarly after you create your arrays you don't do anything with them, so again it stops working. … | |
Hello, I am having a bit of an issue with my networking addition to my game engine. The engine uses SDL to provide an event-driven programming environment. I tried adding networking functionality, but it doesn't seem to work. Here is the relevant code: //includes #if defined(_WIN32) #include <winsock2.h> typedef int … | |
Re: I got 22... but that was with a 0 in the relationship questions, but I have never really been in any serious relationships and I am pretty sure that I would eek a few more points out of those. Also I have been diagnosed with ADHD,OCD, and Aspberger's syndrome... so … | |
Hello, I am working on a moderately large web development system and have been charged with developing the server-side application for the web site. As a primarily local developer I have by far the most experience in C/C++. My favourite language is Ada, just to give you a sense of … | |
Re: I don't normally resurrect dead threads, but I will make an exception. These types of esoteric programming problems are often frowned upon for teaching bad programming practices. This is not their purpose. As the IOCCC explains, these types of problems promote thinking into what might occur that would be bad … | |
Hi. I am familiar with the following C graphics libraries: Cairo, SDL, SDL2, and OpenGL. The problem I have found with these is that they either require shared libraries (Cairo/SDL/SDL2) or are difficult to make cross-platform (OpenGL). I am wondering if there are any graphics libraries for C that do … | |
Re: `cin >> t1 >> t2 >> t3` I know that it seems like an unintuitive way to get 3 values from input, but it makes sense once you learn about istreams and the fact that cin is one. | |
Re: By hand. What they did was they wrote out the code of the compiler in some slightly-higher language. Then they manually went through the code and compiled it themselves. Once that was done they could use the compiler to compile any future sources. New compilers would then be 'bootstrapped' using … | |
Re: First of all the code `for (a=4; a<5; a=a++)` is undefined behaviour, you probably meant `for (a=4; a<5; a++)` which 'loops' a from 4 to 5 (essentially just running the loop once on the value a=4. To use a value found inside the loop outside of it, it must be … | |
Re: Judging by your code it looks like you are doing Android development and trying to pass data from one activity to another. Due to the nature of Android activities (multithreaded, and can be GC'ed at any moment if, e.g. you get a phone call) you can't deal with passing data … | |
Hello, I recently wrote a program that I wish to be portable (IE: no installer, just raw files). I have made an icon for the program and can attach it to a shortcut, but not to the executable itself (it stays as the default). On top of that I have … | |
Re: Functions are used to pack repeated code together. The general form of a function is this: <return-type> <identifier>(<arguments>) { <body> } This means for example that these two programs are effectively identical: A version with no functions #include <stdio.h> int main() { int mode,num; printf("Please choose to print (1) Increasing … | |
Re: In your current code you populate the array with `sc.nextInt()`, now you want to populate them with random numbers. There is a method called `Math.Random()` which gives you a random number from 0 to 1 (including 0, not including 1). You will have to 'stretch' the number you get to … | |
Re: First of all that is C++, not C. Second your problem description is poor, however I think I understand what you are after. Of interest is this code snippet: //This code returns the n'th cycle of string s std::string tmp; for (int i=0; i<s.length(); ++i) tmp+=s[(i+n)%s.length()]; The way it works … | |
Hello, I posted on this forum two times before about a particular pair of non-printing characters being inserted into my code. You can find the threads [here](https://www.daniweb.com/software-development/threads/441611/stray-non-printing-characters-in-my-programs) and [here](https://www.daniweb.com/software-development/cpp/threads/450296/arbitrarily-appearing-non-printing-character). Two great posters tried their best to solve this problem (mike_2000_17 and deceptikon) to no avail. Finally, using the hints that … | |
Re: Your problem is that you are printing the number of semicolons (which is the correct name for 'dotcoma', its like a colon (':') but only half ';') The line in question is printf("Row %d: %f\n", j+1, (float)dotcoma[j]); The issue here is three-fold. 1: j is uninitialized, some compilers will set … | |
Re: Granted, the great war for the moon breaks out. I wish I invented interstellar flight. | |
Re: I find that "Quinary son of a genetic algorithm" rolls of the tongue quite nicely when I want to let off some steam. As for a single word... Queueing's vowels sound awesome. (as noted by Randall http://xkcd.com/853/) | |
Hello, I used to use Code::blocks and eclipse for code editing, but started to find them slow. I started searching for lightweight IDE's and found that the prevailing opinion is that if you are looking for lightweight code creation you should use vim/emacs, gcc and the other gnu utilities. I … | |
Re: Heavy rain followed by negative temperatures = black ice... black ice everywhere :O. (Waterloo, ON... I think Toronto, ON too) | |
Hello, I have an issue with a plain TeX document I am writing. I need to compile drawings as well as images into pdfs. I know how to get images into a pdf using \pdfximage which works if I compile with pdfTeX. I also know how to get drawings into … | |
Hello, I have a USB key on which I do all of my programming. It is formatted as an NTFS drive with 32 gigabytes of space. On this drive I have large C::B projects which contain both windows and linux executables. When I try to run the linux executables it … | |
Re: In java, `x<<y` shifts x y bits to the left. `x>>y` [arithmetically](http://en.wikipedia.org/wiki/Arithmetic_shift) shifts x y bits to the right. `x>>>y` [logically](http://en.wikipedia.org/wiki/Logical_shift) shifts x y bits to the right. These operations are invaluable when you need to manipulate individual bits of a value. For example, lets say you are using a … | |
Hello, I have a bug in my program somewhere and I cannot understand why. The program merely prints data from a binary file. Here is the code: #include <iostream> #include <fstream> #include <vector> #include <cstdint> using namespace std; int main(int argc, char *argv[]) { if (argc!=2) { cout<<"Invalid argument count, … | |
Hello, I have learnt a few assembly languages (MIPS/x86/ARM/MIX) and I have a question about the call stack. Each of those languages uses a different method for subroutine linkage, and the way I learnt them was not conducive to recursion. Granted, if I continue reading my copy of The Art … | |
Hello, I recently took a course on assembler/compiler construction. In it we covered parsing algorithms such as LL(n), LR(n), LALR(n), and SLR(n). I understand how these parsing algorithms can be used to determine **if** an input string follows a context free grammar (CFG). At some point I also understood how … | |
Re: The issue is that `localtime` and `localtime_s` are slightly different. The _s stands for safe, it is a memory safe version of `localtime`. As such it does not create it's own `tm*` to return, rather you have to send it one. The correct code would be: time_t now = time(0); … | |
Re: This is one of those sneaky bugs. Basically it is telling you that if you declare a variable in the for loop, it only lasts as long as the for loop. At first glance it looks like you only ever use 'n' inside your loop. You are wrong. Let me … |