- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 31
- Posts with Upvotes
- 29
- Upvoting Members
- 26
- Downvotes Received
- 15
- Posts with Downvotes
- 13
- Downvoting Members
- 10
166 Posted Topics
Re: The two reasons with the greatest probability (IMO) are as follows: 1) The hardware specifications of your computer are too low. Reasons include but are not limited to: CPU clock speed, RAM amount and timing, motherboard front side bus speed, hard disk read and write rates, and graphics processing ability. … | |
Re: You'll want to set a keyboard hook using the Win32 API, to detect when the key combination is pressed. Here is the [MSDN documentation for SetWindowsHookEx](http://msdn.microsoft.com/en-us/library/windows/desktop/ms644990%28v=vs.85%29.aspx) Here is [some random tutorial I found](http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=11920&lngWId=3) about setting a hook, with code examples given. | |
Re: Let's say you want Player 1's average of Stat #1 for both games, This means, array[0][0][0] + array[0][1][0] / 2 (games) = average | |
Re: Firstly you should pick a problem that requires automation. The subject is broad, to say the least. Is the project physical, or purely virtual? In what way is change required? Can you map the change logically? Can you define every factor which may have to be adapted? Current intelligence models … | |
Re: One and two have fixed width, which consume the entirety, so it returns. | |
Re: I don't see a destructor at all. You can define one this way: `~CObject( ) { delete [] mName; }` | |
Re: addArticle( ... ) will be interpreted in the context of the pointer. You'll want to cast it first, // C++11 auto Magazine((CMagazine*)A3); // C++3 CMagazine * Magazine((CMagazine*)A3); Before you call the function itself Magazine->doSometing( ); // To be quite honest it doesn't really matter what the buffer pointer is L1.addArticle((void*)Thing); … | |
Re: To answer your broad question broadly, open the text file, separate it into lines, delimit each line by comma It's a comma and line break separated file. | |
Re: Unlike iamthwee, I also enjoy "plain ole sockets", it can be useful to understand in a lot of cases. I looked through your source and saw no "overt" errors at a glance. I did wonder, are you sure that static cookie does what you think it does? If you accept … | |
Re: Call me crazy, but I'm pretty sure you misinterpreted "Do not use any string or array **functions**" How can you store a letter (sentence, letter as in formal message) without at least allocating memory for it in some arbitrary place or another? This tells me that it must be OK … | |
Re: Something like this? public void backgroundthread() { while (true) { // Forever, do... if(runsomeCode) { // Check for this necessary condition once per 10ms this.Invoke((MethodInvoker)delegate { runsomeCode = false; // Disable this one-off condition MessageBox.Show("Some code will run here!"); } } // This sleep belongs to the parent loop. Thread.Sleep(10); … | |
Re: Personally, I like the [sieve of eratosthenes](http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) for most problems requiring evaluation of primes under 100,000,000,000 or so. It's especially beautiful in its ease of implementation in any language. | |
Re: typedef char * (*stringReturn) (); // This is a function taking no arguments and returning string stringReturn * (*funcArray[256])(); // This is an array of functions returning the above type DWORD (*funcArray[256])(); // Alternatively, you could cast the function address to unsigned int // return (DWORD)&stringReturnObject; | |
Re: Some context please? I would open a socket on port 80 to the host with winsock. You could use something like selenium if you're OK with opening the browser. What are the limitations of your objective? | |
Re: Vi is a text editor, much like notepad. It has nothing to do with your question, probably... Check out the [locate](http://linux.die.net/man/1/locate) command. | |
Re: Like pritaeas said, `if( ! $total_deals ) die("Query failed.")` or `if( $result = mysql_query("") ) { /* ... */ }` | |
Re: For some reason, the compiler seems to think that you have a open parenthesis. To be honest, it could be from the line before. I won't pretend to know about DX9, I don't make games. Perhaps one of the all caps defines you are using is in fact a function. … | |
Re: In order to solve this problem, perhaps some [light reading about general Python syntax](http://docs.python.org/2/tutorial/classes.html) may guide you. | |
Re: Redefine SWAP this way. `#define SWAP(a,b) float * t=a;a=b;b=t;` I'm not sure how you can pass implicit type to the define pre-processor. If anyone has any idea, I'd love to know. By the way, you could also perform a XOR swap. #define SWAP(a,b) a^=b;b^=a;a^=b; #define SWAPPTRCONT(a,b) *a^=*b;*b^=*a;*a^=*b; | |
Re: [The GNU Awk User's Guide](http://www.gnu.org/software/gawk/manual/gawk.html) This is a good place to start. | |
Re: $files = array( ); $dir = opendir( $name ); while( false !== ($file = readdir($dir)) ) { if( $file != '.' && $file != '..' ) { $pop = explode('.',$file); $ext = ""; if(count($pop)>1) $ext = array_pop($pop); $files[implode('.',$pop)][] = $ext; } } closedir($dir); print_r($files); | |
Re: Why is everything based on deque size instead of content? | |
Re: int threeDim[x][y][z]; Algorithm is a synonym of calculus, it means "method" | |
Re: You can also traverse the array linearly, int height(13), width(7); int matrix[height][width]; for(int i=0;i<height*width;++i) { if( !(i%width) ) printf( "\r\n" ); printf( "%d ", matrix[ i / width ][ i % width ] ); } | |
Re: I'll help you, start by defining the entire state of the game. We'll call this `int board[9] = { 0 };` A 3x3 space in two dimensions. 0 - Unknown state 1 - Player 1 claims 2 - Player 2 claims Next, you want to allow input. The simplest inputs … | |
Re: Hey, the error is vector.empty() doesn't take 1 argument | |
Re: First you want to start a session. session_start(); ![]() | |
Re: switch(...) { } // The switch ends while( expr ) ; // Do nothing // Forever... | |
Re: Well, update doesn't return anything. So of course you can't translate NOTHING into ROW. Also, you don't need to wrap your query in parenthesis [ UPDATE table SET value=('value') ] Why not [ SET value='value' ] ??? Plus, it's better if you refer to post with quotes rather than symbol. … | |
Re: It helps to boil down linked list to its simplest form, without answering your homework, here is my example of simplified form struct Node { int value; Node * next; Node() : next(NULL), value(0) { } Node(int v) : next(NULL), value(v) { } ~Node() { delete next; } // add … | |
Re: Before I attempt to read about COM communication with IE, is there a reason you can't get the webpage instead? Must it involve an active user session? (Assuming java alters the div or something) It seems more simplistic to open a socket and perform a GET request yourself. Additionally, I … | |
Re: Check out [DOMDocument()](http://php.net/manual/en/class.domdocument.php) and [DOMXPath()](http://php.net/manual/en/class.domxpath.php) | |
| |
Re: Open a socket on port 80 and send a standard HTTP header, I'm sorry, I don't really code VB and responded from the main page, but the concept is the same, I'll give some equivalent C++ code. This is the constructor of a class object: urlsock(char * URL, char * … | |
Re: It's better if you include a sample of the HTML you use to submit files, along with the .php file which receives that submission. Especially considering you're confident about file permissions. | |
Re: Can you explain the nature of getpixel? Are you able to read the memory of the executable in real time? | |
Re: Once you're in the new windows context, and you've logged into windows 8, you should mount the partition and access it. | |
Re: void getFileNames( char ** fileNames ); // This is a function which receives a pointer to char pointer const char * someFile = "Hello"; // this is a const char pointer to the start of Hello const char ** someFiles = { "Hello", "World" }; // This is a const … | |
Re: `$data = "UPDATE crew SET shirtnumber=$_POST['shirtnumber'] WHERE ID=$_GET['ID']";` | |
Re: On Ln95, you're setting last_id to last_insert_id when last_insert_id is the query for INSERT INTO directives | |
Re: The easiest way to approach this is with sprintf char buf[MAX_LEN]; sprintf( buf, "%s\-%s", &s[0], &s[3] ); You can also memcpy if you have enough space [ Assuming s[] is fully initialized ( s[260] = { 0 }; ) ] char tmp[3]; memcpy( tmp, &s[3], 3 ); memcpy( &s[4], tmp, … ![]() | |
Re: A descriptive tutorial regarding [the whole process of adding startup scripts to the init.d file](http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/boot.html). | |
| |
Re: Sure, assuming you're allowed to execute the compiler. | |
Re: It may be in your best interest to add a default constructor. `Node::Node() : frequency(0), left(NULL), right(NULL), letter(0) { }` void traverse(Node * node) { // NULL pointers equal false if(node) { // This may not output in the order you expect. cout << node->frequency << endl; traverse(node->left); traverse(node->right); } … | |
Re: I thought that this summarization of the [homophonic substitution cipher](http://practicalcryptography.com/ciphers/homophonic-substitution-cipher/) was both simple and provided a thorough explanation of the underlying mechanics. | |
Re: printf("%d", expr); printf("UINT:\t%u\tSYMBOL:%s\r\n", expr1, expr2); // return type of expr, when evaluated, must match symbolic type given to printf ("%u, %s") | |
Re: You'll want to start with the PHP manual. Here is the [basic document regarding sessions](http://www.php.net/manual/en/session.examples.basic.php). This is the [entire sessions document tree](http://www.php.net/manual/en/book.session.php). A specific [document about the container $_SESSION[]](http://www.php.net/manual/en/reserved.variables.session.php). |
The End.