Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
81% Quality Score
Upvotes Received
4
Posts with Upvotes
2
Upvoting Members
4
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
~36.2K People Reached
About Me

Student

51 Posted Topics

Member Avatar for mattyd
Member Avatar for vegaseat

To use the time as the seed is very simple. Make sure you include the <ctime> header. [code] #include <ctime> [/code] Then, inside ctime there is a function you can call like this: [code] time(0); [/code] When you pass this method zero, it returns the time elapsed since January 1, …

Member Avatar for rubberman
1
6K
Member Avatar for nanodano

[B]Introduction[/B] Hello everyone. This little code snippet shows you how to read in scan codes from the keyboard. It is slightly different than reading in a regular character. When you use the [INLINECODE]getch()[/INLINECODE] function, it is normally returning an ASCII value. Some keyboards have extra keys though. These include the …

Member Avatar for thendrluca
2
6K
Member Avatar for Ancient Dragon
Member Avatar for Ancient Dragon
0
953
Member Avatar for nanodano

This code snippet actually contains a few nifty things. There are two functions, hasVisited() and main(). hasVisited() makes use of a very handy function for CGI programmers: getenv. You can see I use it to retrieve REMOTE_ADDR which is the person's IP address. In main() it gets the count from …

Member Avatar for manutd
0
260
Member Avatar for nanodano

This snippet shows how to use command line arguments as variables in your program. A command line argument is extra information you give a program at runtime, by typing the information after the program name like so: Linux might look like this: user$: ./myprogram argument1 argument2 A windows command prompt …

0
186
Member Avatar for nanodano

I've been trying to solve this problem for a while now with no luck. I want to monitor an input buffer(cin) for a keypress. The catch is, I don't want it to hang if the buffer is empty. [INLINECODE]getch()[/INLINECODE] and [INLINECODE]peek()[/INLINECODE] won't work because one waits for a keypress and …

Member Avatar for cniggeler
0
150
Member Avatar for nanodano

I'm writing a Win32 application for Windows XP with Visual Studio 2005. It is a console program, and I'm trying to find the HWND attribute of my console. I need this because I need to use it as a parameter for a function. So, thanks to the MSDN library I …

Member Avatar for lenhattien
0
533
Member Avatar for nanodano

I think it is unfair to stick the Ruby discussion forum inside Web Development. Ruby on Rails is a really handy web framework, but Ruby has other capabilities. I think it should be put under Software Development, does anyone agree?

Member Avatar for peter_budo
0
241
Member Avatar for nanodano

Hi, I'm trying to write a program using named pipes, and I'm having trouble opening it. In another program I call this line: [code] mkfifo("./fife", 0777); [/code] So my named pipe exists and I see it in my list of files. Then I run the program I included below, but …

Member Avatar for Salem
0
183
Member Avatar for zellex

Hey zellex, I wrote a connect 4 AI agent a while ago. You can play it at [URL="http://students.csci.unt.edu/~jdl0107/conn4.exe"]http://students.csci.unt.edu/~jdl0107/conn4.exe[/URL] I know our code is different, but this is a link to my source code for my AI: [URL="http://students.csci.unt.edu/~jdl0107/leon.cpp"]http://students.csci.unt.edu/~jdl0107/leon.cpp[/URL] You are welcome to look through it. My leon::move method is the one …

Member Avatar for mentkapto
0
1K
Member Avatar for nanodano

When programming with pthreads, you pass the thread a function to run when you create it. When this function is done, is the thread cleaned up automatically? Is it necessary to put [inlinecode]pthread_join()[/inlinecode] in the calling function somewhere? Is [inlinecode]pthread_join[/inlinecode] only useful when you want to [I]wait [/I]for a thread …

Member Avatar for mcldev
0
208
Member Avatar for nanodano

I've been trying to find a function that returns the version number of the JVM. I found this website that does it, so I know it can be done: [url]http://www.javatester.org/version.html[/url] Can anyone help me out?

Member Avatar for Ezzaral
0
113
Member Avatar for nanodano

I need to research ways to run a diagnostic check on a user's browser. This includes [LIST] [*]Cookies enabled [*]Javascript available and version [*]Pop-up windows enabled [*]Javascript available and version [*]Flash available and version [/LIST] If anyone has any tips on how to integrate all of these checks on a …

Member Avatar for MattEvans
0
70
Member Avatar for nanodano

Do you think it is OK for a supervisor to fire an employee for getting a call from another company they applied for? Is it standard business practice to call someone's current employer to ask about them?

Member Avatar for joshSCH
0
91
Member Avatar for nanodano

Is there any way to read or write to a socket besides using the [inlinecode]read()[/inlinecode] and [inlinecode]write()[/inlinecode] functions. Is there any way to treat it like a stream and use the insertion/extraction operators (<< and >>)? The reason I ask is because with read I have to put an arbitrary …

Member Avatar for vijayan121
0
187
Member Avatar for nanodano

Is it possible to have a perl script and a bash script in one file? Like: [code] #!/bin/perl print "This is perl"; #exit perl #!/bin/bash echo "This is bash" exit 0 [/code] This is probably just a complicated solution to a simple problem. I have a perl script, and at …

Member Avatar for KevinADC
0
151
Member Avatar for nanodano

I have a very specific problem. Does s/// work with strings that are contained in single quotes? I've been debugging and I'm trying to replace a string that contains a $ in it. If I use double quotes, it works for the string up until the $. If I use …

Member Avatar for KevinADC
0
142
Member Avatar for nanodano

I'm trying to create a general buffer that I can use in my program. It will work with ints as well as strings. So far I've been using a strstream, and it works without a hitch, but I was wondering if there is a way to just create a generic …

Member Avatar for iamthwee
0
76
Member Avatar for nanodano

I am working with form processing and text manipulation, and I found two useful functions; tr/// and s/// They do pretty much the same thing, but I was wondering if anyone could explain to me what the difference is and if one would ever be more useful than the other …

Member Avatar for KevinADC
0
124
Member Avatar for nanodano

Hi, I'm trying to write a simple Queue class, but I'm having trouble using it. It tells me I have undefined references to the functions I call in main. [code] // main.cpp #include <iostream> #include "queue.h" void main() { Queue<int> myq; myq.push(10); std::cout << myq.isempty() << endl; myq.makeempty(); std::cout << …

Member Avatar for Narue
0
149
Member Avatar for bops

If you want to connect to your own network by going outside and coming back in you need to know your external IP address, and you need to tell your [I]router [/I]to forward your port(1234) to your server computers internal ip address. Then using your client side code try to …

Member Avatar for bops
0
478
Member Avatar for MDGM

depends what operating system you have. on linux type chmod +x myscript.pl in windows...i dont think it differentiates files that are executable and text files except by the extension, which is .exe

Member Avatar for MattEvans
0
110
Member Avatar for nanodano

Does anyone know where I can find the pthread library for Linux? And I don't want any rude "go google it" responds. I tried that, and all I came up with was one download available for win32.

Member Avatar for nanodano
0
80
Member Avatar for Acquire

Acquire, The first thing I noticed was this [inlinecode]char names[99][28]= {" "};[/inlinecode]. If you get an error with that line, try using single quotes instead of double quotes. Double quotes are associated with strings, while single quotes are for char's, which is what you are using. It should look like …

Member Avatar for majicbeans
0
240
Member Avatar for nanodano

I'm trying to get into some practice with Mesa GL and I know it works for the X desktop. Will it work the same with Gnome or KDE? Are those based off of X?

Member Avatar for Rashakil Fol
0
45
Member Avatar for mattyd

I think the problem is because when you declare a variable static it affects the lifetime of it. You declare it inside the If brackets { }, so it will be destroyed at the end of the if statement. But, the static variable probably doesn't want to go away. It …

Member Avatar for nanodano
0
238
Member Avatar for newbie2c++

I compiled your latter source code, and it worked fine. I could input the four numbers and it would give me output. You say it quits before it outputs the text? If you are using Visual Studio, if you run the program normally in console mode, it will close after …

Member Avatar for John A
0
192
Member Avatar for nanodano

Is there a way to set global hot keys? I want to be able to run a program using a hotkey like CTRL-F12 or something. Any ideas how to do that?

0
51
Member Avatar for nanodano

I have a question and I was hoping someone could point me in the right direction. I know the IP address of a server I want to download a file from, and I know the path on the client hard disk I want to download it to. How could I …

Member Avatar for ~s.o.s~
0
99
Member Avatar for nanodano

Have any of you competed in the topcoder matches? Have you found them helpful?

Member Avatar for Ancient Dragon
0
64
Member Avatar for JRM

I am a college student right now and I do almost all of my school coding with JOE on linux systems and compile with g++. I've also had to use Visual Studio 2003, which did make it easy to debug. I prefer the text editors and the command line because …

Member Avatar for nanodano
0
147
Member Avatar for nanodano

When someone accesses a cgi script in their web browser is there a way to gather information, like IP address or user's web browser? I know how to read command line arguments, but I have a feeling that isn't how it would be passed via the web. Maybe someone can …

Member Avatar for ~s.o.s~
0
91
Member Avatar for nanodano

Ok, I have a small problem. I'm just trying to get my program to read a single line from a file at a time, and put the results in a vector. The problem is at the end of each vector. It repeats the last element twice and also adds a …

Member Avatar for nanodano
0
129
Member Avatar for nanodano

Hi everyone, I have a simple setback in my program. I'm not the best way to go about doing this. I'm trying to do it in the simplest way possible. I have an input file that looks like this 2.5 600 -2 10 20 30 I want to sort each …

Member Avatar for WolfPack
0
100
Member Avatar for nanodano

I have been writing some CGI scripts in C++, and I was wondering if anyone else has done the same? I have built a pretty decent sized library of functions I use a lot for formatting form inputs and such. The reason I chose C++ is because I'm so familiar …

Member Avatar for Rashakil Fol
0
493
Member Avatar for TMcIsaac

This is a code snippet I wrote about keyboard input. It includes a demonstration of the arrow keys being read. [url]http://www.daniweb.com/code/snippet497.html[/url]

Member Avatar for nanodano
0
258
Member Avatar for vietbong87

WolfPack is correct if you want to put the name of the file into your code. From the post, I read that you wanted to pipe a file into it. It would help if you posted your operating system. This is out you can pipe files on a Linux machine: …

Member Avatar for WolfPack
0
125
Member Avatar for nanodano

Hi, I'm using Windows XP Pro. I haven't had to do this since I used MS-DOS and I don't remember how: I have a utility program that I want to be able to run from the command prompt, but in any directory. Is there a specific directory to stick things …

0
43
Member Avatar for nanodano

I've been looking for information on threading, and I found information on POSIX pthreads. Apparently, Visual Studio 2005 does not have [INLINECODE]pthreads.h[/INLINECODE] in their library. I did a search on the computer, and I found pthreadlocale.obj in the LIB directory. Does this object file have anything to do with pthread.h? …

0
67
Member Avatar for nanodano

Hi, Let me explain a little background of the situation in case there is a wiser solution than vectors. I've got a loop running in a program, and for each loop, I need to add a new element at the end. I need to backtrack anywhere from 5 - 250 …

Member Avatar for Lerner
0
104
Member Avatar for Croft .L

[URL="http://www.gamedev.net"]Www.gamedev.net [/URL] has some useful stuff for interested game developers.

Member Avatar for nanodano
0
375
Member Avatar for mhm_ra

To get the address of the pointer depends on how it was initialized. If it was initialized as a pointer: [code] int* int_ptr; [/code] To send the address to an ostream just use [inlinecode] out << int_ptr; [/inlinecode] If you don't have a pointer, but only a variable: [code] int …

Member Avatar for Ancient Dragon
0
148
Member Avatar for nanodano

Hey everyone, I'm trying to write a simple program that can do more than one thing at once. I'm not an expert on the iostreams, so I don't know if I need to create threads to accomplish what I want. What I'm trying to do is run a loop while …

Member Avatar for dubeyprateek
0
115
Member Avatar for nanodano

Hey, I have a problem using Visual Studio 2005. In the MSDN library it says there is a function called SetConsoleDisplayMode. This function though is not in the 2005 library. I'm assuming its an old reference from VS 2003. Does anyone know how to tell a console program to switch …

Member Avatar for SpS
0
827
Member Avatar for moloza

The problem is with the hello variable. When you write [code] int *hello; // What you're saying is create a pointer called hello. // When you write cout << hello; // hello will be some arbitrary hexadecimal number(a memory address) // When you write cout << *hello; // *hello = …

Member Avatar for Dave Sinkula
0
3K
Member Avatar for GM2001

Well, I'm not sure about everything you need to do in the program but there are a few things I noticed. As the other reply says, your loop for the array should go from 0-4, not 1-5. After all of your if statements you have two lines of code. If …

Member Avatar for Dave Sinkula
0
93
Member Avatar for vietbong87

A good way of finding the highest of X number of integers is to use vectors, and to use the sort algorithm. They are both from the Standard Template Library STL. I'll give you an example of how to use it, but you will need to modify loops and such …

Member Avatar for nanodano
0
620
Member Avatar for nanodano

I was just curious is anyone has ever programmed a AI agent for Connect 4. I'm currently working on one right now for a class. I'm working on using backtracking/recursion to solve it. If you have, did you use recursion? Just curious what other methods are out there. I am …

Member Avatar for server_crash
0
185
Member Avatar for nanodano

I had the idea in my head to write a program that would let you select more than one image you want to set as your windows desktop wallpaper and have it rotate it every day, or every time you boot up or something similar. I really don't know where …

Member Avatar for vegaseat
0
104

The End.