45 Posted Topics
Re: In a database, you can just keep the count of every part, and as the users take or return stock, the count changes. If you want to know about the activity, you can have a table of activities, which can either be the primary and the stock level is the … | |
Re: Google sheets keeps track of all changes and who entered them, and allows multiple user concurrent access. An RDBMS app needs to know who is logged in to make changes, and could have a complete history as well as status (the latest history) rows and active (the status is active) … | |
Re: Hash tables are containers. Hashing creates an integer from other types, usually the characters of a key, where it represents the values and positions of those characters. One divides the hash by the bucket count to select a bucket, which is a simple container like linked list where you can … | |
Re: The major methods for image reduction in size are compression, like in jpeg, and resampling. Resampling may take something like a weighted average, which can make things muddy, or select the pixels that are closest to the original position, a center-of-pixel strategy where a minor artifact may grow in relative … | |
Re: DHCP operates a pool of IPs for clients that need them. Usage is a bit worthless unless they stay assigned a long time. As noted, the mac from the ethernet layer is a better id. | |
Re: The Securities/Stock trading crowd like c++ for the speed, and XWindows was there long before most others. | |
Re: The hollow diamond is about distance from center column and distance from center row; their sum s/b half the height to print. In this case, 3. So: for ( int c = 0 ; c < 7 ; c++ ){ for ( int r = 0 ; r < 7 … | |
Re: Maybe put the array and indexes in parens after the & ? Debug messages on stderr , which, unlike stdout, is unbuffered! | |
Re: There are just 4 rules to parsing a CSV: Commas separate fields Carriage return linefeed separates rows Unless inside “ But “” is a literal “ | |
Re: A palindrome check should be a loop through the first half of the string or 1/2 less checking the mirror byte for a match. To make it a number check, filter for numbers along the way or format number types to a string. For instance, for 9 places check 1 … | |
Re: JDBC tools like SQuirreL and jisql let you extract schema and data. I like to use LINUX sed to pipe a select into an insert, no intermediate files. | |
Re: To read a file, you need to declare an ifstream, open it, read from it using using >> into the appropriate types and check for eof(), bad(), fail() to detect errors and end of file. Note that >> at EOF sets fail (you didn't get what you asked for) as … | |
Re: Comparing null terminated char arrays is: #include <string.h> int strcmp(const char *s1, const char *s2); but for known length unterminated strings: #include <string.h> int memcmp(const void *s1, const void *s2, size_t n); Both return an integer less than, equal to, or greater than zero if s1 is found, respectively, to … | |
Re: The keyboard and monitor data is 'cooked', not raw, unless you turn on raw orocessing like with stty in UNIX. The enter key is a carriage return 0x0D or ctrl-M, but is cooked into carriage return and linefeed 0x0D0A ctrl-M ctrl-J. On the teletype, one makes the typehead go to … | |
Re: For masking, write the random numbers directly, not as ascii. Write with fwrite() so each number is buffered into large block writes. Note that RAND_MAX is just 31 bits: /usr/include/stdlib.h:#define RAND_MAX 2147483647 You can write 3 bytes at a time to have pure randomness. Remember that the bytes you want … |