- 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
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..
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 …
[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]
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()
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 …
Try making the service not 'automatic', and then try starting it yourself manually via the service. See if it has the same problem...
[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.
Google [url="http://www.google.com"]www.google.com[/url]
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)...
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.
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 …
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.
You must be using visual studio 6. You can disable the warning with a pragma statement.
gebbit, you can also look into sprintf, which gives you a lot of options.
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 …
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 …
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 …
You should look into one of the online savings banks like ING, Emigrant Direct, HSBC, etc. Really good rates, no minimum balance, etc.
Is there a way using file handling functions to search within a text file to find the position of certain text WITHOUT having to read each character/line and evaluating it? For example, let's say I have a file of 'messages', where a message has a distinct start and end characters. …
I'm new to perl (and actually not even really trying to develop this skill - I inherited some code and am trying to enhance it). Basically, I want to get the text between parts of a text string. How do I get the parsed variable to contain "WHATEVER IT IS"? …
[quote=bops;278440] I need to know how to connect to my computer from outside also on a specified port. anyone know how?[/quote] You need to set up port forwarding on the router, which says when a request comes in on this port, send it to this ip address inside the network …
If you've been working on it for 3 days, surely you have developed a starting point. Why don't you post your code, indicate specifically what's not working, and someone will help you.
There is also sqlapi [url="http://www.sqlapi.com"]www.sqlapi.com[/url]
So here's what I'm trying to do. Basically, I have a huge text file of strings which are delimited by a delimiter. I would like to read each string separately based on the delimiter. Note that each chunk can span several lines, so I don't want to read it line …
Hi, I've inherited some code in C that acts as a server and receives requests over a socket. That is all working fine. I wanted to make a very small change to the server code to print out the hostname of the client connection. However, I'm always getting 0.0.0.0 as …
[quote] void bull(char[]); void bull( char crap[] ) { std::cout << crap; } [/quote] Assuming you won't in fact attempt to change 'crap' inside the 'bull' function, simply change the above to: [code] void bull( const char[] ) and void bull( const char crap[] ) { std::cout << crap; } …
So I'm trying to learn how to use function pointers (ie to pass the address of a function to another function to execute it - like a call back). I have it working when I use it as follows: Classes.h: [code] #include <iostream> using namespace std; class Class1 { public: …
Show us the code where you are requesting and accepting the string to begin with, then we'll show you how to modify it for the error checking.
If I have a swing app where I have 3 JPanels inside the content pane. By default, it makes it so that all 3 panels take up 33% of the overall size of the app. I would like to make it so that the first panel takes up a smaller …
The Senate, This: [url="http://www.eternallyconfuzzled.com/about.html"]http://www.eternallyconfuzzled.com/about.html[/url] Should help clear up any confusion.... (read the second paragraph)
Faced with the choice of code and no question vs. a question with no code, I prefer the former... ;)
I am trying to write a large file, but it always stops writing when it hits 2GB. (2147483647 bytes to be exact). I know it's not an O/S or disk issue (I'm on solaris) as I'm able to use the mkfile command to create a 3GB file. I'm using the …
You're treating deck[i] like a pointer when it's not.
You're gonna have to give us a bit more than that - how about some source code?
Why are you doing cout so many times inside the loop? You're going to get like 400 printouts...
I'm probably missing some math aspect here, but couldn't you convert 4.33 to a string, find out what position the . is and have your answer?
The End.
winbatch