- Strength to Increase Rep
- +4
- Strength to Decrease Rep
- -1
- Upvotes Received
- 22
- Posts with Upvotes
- 19
- Upvoting Members
- 9
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
45 Posted Topics
Re: There is consulting, where they run interference for you, freelance work, volunteer work, teaching, tutoring and open source collaboration to get your status up and your skills sharp. | |
Re: No RDBMS or ETL app has a magic bullet. Getting data in is the big challenge. Some RDBMS have bulk input for CSV or the like. One pitfall is that a big insert may trigger long and many row/page/table locks. One middle path is to import in bulk to a … | |
Re: I optimized a Binomial min heap in c++, great for low costs when you discard the heap not empty because you have your spanning tree or shortest route. I changed the root to an array for fast merge. | |
Re: C is pretty married to ASCII but that leaves 128 more characters 128-255. ISO8859-1 assigns them to support Nordic/Germanic languages, often called LATIN-1. Even in the old days of 6 bit characters and BCDIC, what you printed depended on what roller was in the printer. Later, what belt, even with … | |
Re: Generally any column named id is an artificial, auto-incremented, indexed key. Are your id's also primary keys, and so indexed? If a btree index, maybe make a hash index? A order date index btree not hash allows a range selection. | |
Re: There may be integration to get the drivers and decoders onto the same die as the LEDs, but yes, otherwise, 3020 connections x 3 (R G B) and a very fast scan rate. Any my TV is 4K, not 1080. I suspect they may be driving more than one dot … | |
Re: Assuming there is no magic free direct conversion tool, convert the python to pseudo code and then to JAVA. This will test your knowledge of when python does nice things for you automatically, which you may need to do manually in JAVA. You may be able to use more appropriate … | |
Re: Assuming the file is utterly consistent (3 line sets, ssn w/o dashes in the second line), you can toss a line, read a line as a string or int, toss a line in a 3 line loop. Now, you can drop you SSN into an (ordered) set, which eliminates duplicates … | |
Re: I write all my code in my brain as pseudo code, and later encode it in the language of the moment. Sometime I use paper in the middle. I have a bluetooth keyboard or two that make my phone pretty useful for data entry and programming. It is nice to … | |
Re: Wow, can of 'sorts'. You need some sort of container, and there are others besides array: linked list, tree, hash table, skip list. Tree sorts as it adds, and even C has tsearch(). For small sets, you can delete the min value when you find and print it, and scan … | |
Re: It depends on locks already held. Deadlock is p1 gets a and wants b bu about the same time p2 gets b and wants a. If all threads always lock resources in the same order, there is no deadlock or starvation. | |
Re: The newer 'find' has a batch execution mode, but I find it easier to use 'xargs'. I usually do 'xargs -n101 ...' to both prevent execution with no arguments and get the work started while still getting 99+% of the bulk savings. In fact, I wrote a fast xargs that … | |
Re: The easiest thing is to write CSV files, which follow 4 simple rules: 1) cells are separated by a comma, 2) rows are separated by a cr-lf, 3) unless the comma or cr-lf is enclosed in double quotes, and 4) a doubled double quote is a double quote in a … | |
Re: I usually go with another int set to -max (0x80000000) when seeking a max, so the first is generally greater and replaces it. Using <= means equal values get copied, and as writes are more expensive than reads (think cache), why bother unless either you are required to get the … | |
Re: Once you have the average, you need another loop that reviews the input against it and prints the desired items. | |
Re: Or better yet, make it an array of char*, since a double quoted literal value is a char pointer to a constant on the heap. | |
Re: Not seeing a lot of morphine, just a loop, a few ints, some io! | |
Re: == is a shallow comparison, like shallow copy, true only if the refrences are identical, not the objects. http://adripofjavascript.com/blog/drips/object-equality-in-javascript.html JAVA and C++ also have this sort of limitation unless you overload the == operator or use a method, like compareTo, equals, and JAVAScript isEqual. JAVA Sets use object.equals(), which is … | |
Re: The join table to itself tactic is very good for converting rows to columns. There are other tricks you can use with aggregates and case statements. | |
Re: identical switch within switch is just wrong, and printing inside swtch ouside any case is not at all nice. | |
Re: Wow, I just write a service that runs the query and reformats the column titles and values into an HTML table. If I wanted it to be more spreadsheet-like, there are caned javascript bits out there to allow you to re-sort the table. | |
Re: More values than columns! | |
Re: Since auto resizing arrays are not there in c, not classes, you might want to use a linked list or realloc() a char[] to size. ![]() | |
Re: I have had good luck with: "<HTML><HEAD><TITLE>My Title</TITLE>...</HEAD><BODY>...</BODY></HTML>" | |
Re: Generally, when you go to a web site without a valid timed login cookie, the server redirects you to the login page, possibly with a cookie or variable saying where to go (the original page) after login. | |
Re: If you open an output ofstream and use it not cout, the data is saved in a file. | |
![]() | Re: If stick 3 runs the machine OK alone, then incompatibility is a strong possibility. However, there is usually one way things can work and an infinite number of ways they can be broken! It might be broken so it runs but messes up any and all other cards on the … |
Re: Just like scanf() and the JAVA Scanner Class, when you >> the next string, int, double, char, etc., then it reads, initially skipping over white space, into the variable from input until it has what you want, and when it hits an incompatible character, like white space for a string, … | |
Re: dgp@dgp-p6803w:~ $ myCC c++rw dgp@dgp-p6803w:~ $ c++rw Type in file name followed by the extention ".txt" x.txt File created. Please enter text: hohoho File Information: hohoho dgp@dgp-p6803w:~ $ #include <iostream> #include <fstream> #include <sstream> #include <string> using namespace std; int main() { cout << "Type in file name followed by … | |
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 … |
The End.