- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 22
- Posts with Upvotes
- 22
- Upvoting Members
- 6
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Sr. Software Engineer
228 Posted Topics
Here's a question for you: I often use remote desktop to connect to my office pc. Often times, I'm writing a document on the office pc and I need to include a screenshot of an application etc. Over RDP, how do I make the office pc take a screen shot … | |
Is there a standard algorithm that can take the output of difftime (which is in seconds) and use it to print out the number of minutes, hours, days, weeks, etc.? I was going to try and calculate this myself by using the modulo, etc. but thought that something might pre-exist.. | |
Re: Here's what I went with. Note you want to do a break if you find out it's divisible as there is no point in checking all the numbers beyond it for divisibility.. [code] #include <iostream> using namespace std; void prime_num(int); int main() { cout << " Enter a number and … | |
Re: [code] #include <iostream> #include <sstream> using namespace std; int main() { int a =23545; ostringstream o; o<<a; cout<<o.str().size()<<endl; return 0; } ./Temp 5 [/code] | |
Re: Basically, the only way to do this is what narue suggested and pass in the actual size as a parameter to the function. Either that, or use an STL collection, and use .size() | |
Re: Let me give you this hint - since several of the months have the same behavior - ie 1,3,5,7,8,10,12 are all 31 days, while 4,6,9,11 are all 30 days, then you could easily use a 'switch' statement on your month and not have to repeat all of that logic. | |
Hi Guys, So I'm trying to experiment with threads, though I'm running into some problems. Basically I'm trying to create multiple threads, where each thread is passed a different set of data. In my small example below, I'm starting off with a vector<string> of data. Each element of the vector … | |
Re: Try making the service not 'automatic', and then try starting it yourself manually via the service. See if it has the same problem... | |
Re: [QUOTE=degamer106] If x > y then the result is x. Am I tripping out o_O?[/QUOTE] if x is 6 and y is 2, then the result is 0. | |
Re: Google [url="http://www.google.com"]www.google.com[/url] | |
Re: You are using time for purposes of generating the random number, but only once before the loop. You should probably reset the time each part of the loop. (void) time(&t1); (Though you may continue to have the same problem as I think time only holds seconds... ) Also, what you … | |
I am trying to write a variable argument function on SUN solaris. According to MSDN, the _vscprintf function that I'm using on windows should work on unix as ANSI is listed. [b]_vscprintf[/b]<stdio.h>ANSI, Win 98, Win Me, Win NT, Win 2000, Win XP [size=2]However, including stdio.h doesn't seem to help. Is … | |
I sometimes get a lot of traffic from certain ip's that are clearly trying to break in/snoop. Is there a way in IIS to block access for certain ip's? (or ranges?). I can do this in my ftp server software (non IIS)... | |
Re: If you want to make sure there are no numbers in a string, you can do a find_first_of( "01234567890"). If it equals anything other than string::npos, it's got a number in there. | |
Re: I found this: [url="http://www.eskimo.com/~scs/C-faq/q2.13.html"]http://www.eskimo.com/~scs/C-faq/q2.13.html[/url] and this: [b]9.10: Why does sizeof report a larger size than I expect for a structure type, as if there was padding at the end? [/b] Structures may have this padding (as well as internal padding; see also [url="http://www.lysator.liu.se/c/c-faq/c-9.html#9-5"][color=#800080]question 9.5[/color][/url]), so that alignment properties will be … | |
Re: Missing a semicolon here: unsigned long k //k as an unsigned long integer also, either change cout to std::cout or put a 'using namespace std;' at the top after the include. | |
| |
Re: You must be using visual studio 6. You can disable the warning with a pragma statement. | |
Re: gebbit, you can also look into sprintf, which gives you a lot of options. | |
Re: This won't compile: k=n*[color=red]fact[/color](n-1); should be k=n*[color=red]facto[/color](n-1); After making that change, seems to work fine.. enter the number for which you want to find the factorial 7 the factorial of yhe number 7 is 5040 (Be careful though factorials get large very quickly and you have a risk of blowing … | |
Hi, I'm trying to write some code that will validate if we are trying to write to nfs and if so, complain. From what I've read, the stat() call populates the st_dev with value of the file system type. On an nfs mount it tells me that it's '14'. I'd … | |
Re: Couple of problems: if (day = "m" || "M") must be if ( day == 'm' || day == 'M' ) because day is a single character. (Even if it were a string you couldn't do a comparison like that, you'd need to use strcmp) You must specify day once … | |
Consider this working code: [icode] #include <iostream> using namespace std; class Base { public: void print(string val) { cout<<val<<endl; } virtual void print(int val) { char temp[1000]; sprintf( temp, "%d", val ); string tempstring = temp; print ( tempstring ); } }; int main() { Base a; string whatever= "BLAH"; … | |
Hi, Trying to play with multithreading by taking some of my existing apps and converting them over. In doing so, I noticed a strange phenomenon that I've been able to reproduce in a very simple program. let's say I create 2 threads. Each thread simply does a for loop from … | |
OK - so I installed windows 2003 server on my desktop, which is in the basement. I have a laptop upstairs (xp) which I want to connect to the desktop over remote desktop. This is working ok (networking, etc), except the way that 2003 server is working, it's making it … | |
Hi, I have a swing app where I am using (among other things obviously) an editable JComboBox and a jButton. when the JButton is clicked, it does some processing and uses the value in the JComboBox as one of it's inputs. I'm finding that everything is fine when: - The … | |
Re: inside the if, you should be comparing $CHECKA and $CHECKB, not CHECKA and CHECKBKeep the space there. Also, try removing the ; and move 'then' to the next line. (not sure if this matters) | |
| |
Hi, If I have a JComboBox which has a list of Strings which can be selected, is there a way to insert a line/horizontal rule inside to indicate some sort of grouping of values? If so, how do I do it? (Also, the actual line ------ should not be selectable … | |
Re: You should look into one of the online savings banks like ING, Emigrant Direct, HSBC, etc. Really good rates, no minimum balance, etc. ![]() |
The End.