Comatose 290 Taboo Programmer Team Colleague

You need to remove the 'mysql' parameter from connect. Should look something like this:

use DBI;

$dsn="DBI:mysql:database=mysql";
$dbh=DBI->connect($dsn, 'root', 'root', {RaiseError => 1});
Comatose 290 Taboo Programmer Team Colleague

In Samba, the dollar sign has special meaning (something to do with netbios and/or hidden shares). Try sharing the name on the 'doz box without a $, and try to connect to it. You MIGHT be able to escape the $ or replace it with \044 or something crazy, but you might as well just make a share without the $, and use it.

Comatose 290 Taboo Programmer Team Colleague

ah, you are missing a slash of some kind it seems... you are escaping the first backslash with the second. You probably need to add something like this:

$map_drive = '/cygdrive/c/windows/system32/net use x: \\\\share1\\share2';

I dunno if there is a cleaner way to say "hey, don't escape this stuff", but this should work.

Comatose 290 Taboo Programmer Team Colleague

Wait What?

You're running a script on *nix, and want that script to map a drive on a windows machine?????

Comatose 290 Taboo Programmer Team Colleague

Nah, in the overridden virtual wage() method, simply put something like cout << "Manager" in the Manager's method, and cout << "Casual" in the Casual's method.

Or make a virtual overridden method for each class that is like "GetType()", and have wage() call GetType(). The proper way to do what you want to do, is to use polymorphism... regardless of how you choose to get the type.

Comatose 290 Taboo Programmer Team Colleague

Here Here!

Comatose 290 Taboo Programmer Team Colleague

mkay. Have you done a msgbox on rs.RecordCount, to ensure it has the right number of elements? Like, just before the first if?

Comatose 290 Taboo Programmer Team Colleague

How 'Bout using code tags, and reading the office tutorial?
http://www.daniweb.com/tutorials/tutorial51307.html

Comatose 290 Taboo Programmer Team Colleague

what does your xorg.conf look like? (can be found I think in /etc/X11/xorg.conf, not 100% sure about where it is in BSD)

Comatose 290 Taboo Programmer Team Colleague

Yes. I'm not sure about if it exists through a web page... but you could connect to it with a program like Mirc, IceChat, or Chatzilla the firefox add-on. Then you just connect to server: irc.daniweb.com (port 6667), and join channel #Daniweb. There is probably still a web client for it somewhere, but I'm not sure.

Comatose 290 Taboo Programmer Team Colleague

One of the biggest problems here, is getting the shell to handle floating point numbers. I'm not using / have access to a solaris machine, so I'm going strictly of bash in slackware.... but the shell doesn't handle floating point numbers. In a Perl script, I could knock this out, or in a C++ program, it would be a breeze... but doing this as a shell script, is an entirely different beast. Parsing the data with awk or sed would be alright, but converting the numbers is an entirely different challenge. In perl, it is pretty easy:

#!/usr/bin/perl

push @lines, "d15 509MB c1t0d0s5";
push @lines, "d13 7.0GB c1t0d0s3";
push @lines, "d11 1.5GB c1t0d0s1";
push @lines, "d10 10GB c1t0d0s0";
push @lines, "d25 509MB c1t1d0s5";
push @lines, "d23 7.0GB c1t1d0s3";
push @lines, "d21 1.5GB c1t1d0s1";
push @lines, "d20 10GB c1t1d0s0";

foreach $line (@lines) {
	($dcode, $unit, $drive) = split(/\s/, $line);

	if (substr($unit, (length($unit) -2), 2) eq "GB") {
		$unit = substr($unit, 0, length($unit) -2);
		$unit = ($unit * 1024); 		# // Convert To MB
	} else {
		$unit = substr($unit, 0, (length($unit) -2));
	}

	print "$dcode\t$unit\t$drive\n";
}
Comatose 290 Taboo Programmer Team Colleague

You need to setup and configure "samba"

Comatose 290 Taboo Programmer Team Colleague

Yeah, it's .c_str()

Comatose 290 Taboo Programmer Team Colleague

Sounds like it was saved in a different format.... is this the same machine you made the file on?

Comatose 290 Taboo Programmer Team Colleague

you can't put variables inside double quotes. That means it's a literal string then. You want the value of the variable, so you must take it out of the quotes..... You can't just take it out of quotes either, you must concatenate it.

system("AdjustSeaLevel.exe " + tosend);
Comatose 290 Taboo Programmer Team Colleague

you can't concatenate it?

float Pi = 3.14;
system("AdjustSeaLevel.exe " + Pi + " 5.4 11.2 c f g");

or make a variable that contains the string to pass in, and then issue that?

#include <iostream>
#include <cstdio>
#include <cstring>
#include <sstream>

using namespace std;

int main(int argc, char **argv)
{
	float Pi = 3.14;
	std::string tosend; 
	std::ostringstream buff;
	buff << Pi;

	tosend = buff.str() + " 5.4 11.2 c f g";
	cout << "something " + tosend;
	return 0;
}
Comatose 290 Taboo Programmer Team Colleague

Your loop, where you have buttons = button... yeah, that doesn't create new instances of ButtonFoo. You are taking button[0] and pointing it to button. Then taking button[1] and pointing it to the same object as button[0]....

Comatose 290 Taboo Programmer Team Colleague

Just remember scope when playing with those braces. If you declare something inside the braces, it will only exist between the braces:

int main(int argc, char **argv)
{

	int a;
	
	{
		int a;
		a=5;
	}

	cout << a << endl;
}

That is a whole different beast. Be careful of that "Gotcha!".

Comatose 290 Taboo Programmer Team Colleague

You have gcc (The C compiler) installed, but not g++ (The C++ compiler). cc1plus is the binary you need, but it comes bundled with g++ (not gcc). Look for build-essential, or at a prompt apt-get install build-essential. Possibly you might just do apt-get install g++, but I think build-essential has more tools.

Alibeg commented: Quick&precise problem allocation +1
Comatose 290 Taboo Programmer Team Colleague

Bah :icon_eek:

Wish I would have caught that it was homework :/

Comatose 290 Taboo Programmer Team Colleague
dim x as string
x = "hello world"
if instr(1, x, " ") <> 0 then
     msgbox "yeah, space."
else
     msgbox "no sir!"
end if
nagatron commented: Thank you, here is good reputation for you. +1
Comatose 290 Taboo Programmer Team Colleague

For which browser (firefox)?

Comatose 290 Taboo Programmer Team Colleague

I wonder if somehow the C++ program is introducing an EOF character prematurely. I strongly doubt it's a crlf \n issue (that is linux uses a different mechanism for new lines than does DOS/Windows). If I'm not mistaken, in linux EOF is ^D, and in M$ I think it's ^Z.... soooooooooo maybe there is an issue there... also, make sure it's not a permissions issue, though I imagine if it were, the web server would give you an error, other than a blank HTML.

Comatose 290 Taboo Programmer Team Colleague

replace will work, and is more efficient than using left$().

Comatose 290 Taboo Programmer Team Colleague

Module:

Declare Function mciSendString Lib "winmm" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

Play Button:

CommandString = "open """ & FileName & """ type mpegvideo alias " & FileName
RetVal = mciSendString(CommandString, vbNullString, 0, 0)

Then research MCI with vb6.

Comatose 290 Taboo Programmer Team Colleague

Split the data in the textbox by space... and then trim the extra characters... so something like:

parts = split(textbox1.text, " ")
rlname = parts(0)
rfname = parts(1)
rmname = parts(2)
label1.caption = rlname
label2.caption = rfname
label3.caption = rmname

You may want to do some error checking and exception handling... but meh.

Comatose 290 Taboo Programmer Team Colleague

It's missing { }

Comatose 290 Taboo Programmer Team Colleague

edit curses.h and look around about line 559, and 1017 or so. My copy of curses.h, however includes this:

/* these names conflict with STL */
#undef box
#undef clear
#undef erase
#undef move
#undef refresh

Which in theory should fix your issue. I guess you could do something like this at the top of your code:

#define __cplusplus

should probably fix it, or even a simple #undef erase . Anyway, let me know if it works, or if I'm crazy.

Comatose 290 Taboo Programmer Team Colleague

Ah.... You are posting VB.NET code in the VB 4/5/6 Forum.

Comatose 290 Taboo Programmer Team Colleague

At the top of your header, you have:

#ifdef shape_h
#define shape_h

that should really be ifndef . Why define it if it is already defined? ;)
Also, you don't have "draw" defined in your class definition for Square. Lastly... you are missing an int main :icon_eek:

Comatose 290 Taboo Programmer Team Colleague

you should put your code in code tags. Look ssomething like this:
[code=vb] ' your code goes here

[/code]
Will Look like this (how we like it):

'your code goes here

That said, somewhere in your form, probably on form load, (you usually only need to do this once, doing it more than once may cause a performance hit):

Randomize Timer
Comatose 290 Taboo Programmer Team Colleague

*Mumbles something about std::reverse()*

verruckt24 commented: Like the way you say it. +2
Comatose 290 Taboo Programmer Team Colleague

*Point Above*

You were assigning the value of the caption to the textbox, not the other way around. You can do this:

dim x
x = 5

you cannot do this:

dim x
5 = x

These are not interchangeable....It only works the first way. So when you put:

form1.text1.text = form2.label1.caption

you are saying (with no exception) "I want text1 to now contain the data stored in label1".

Comatose 290 Taboo Programmer Team Colleague

aha! No Caption Set Yet!

Comatose 290 Taboo Programmer Team Colleague

I guess you could put your entire project on here as a .zip file.... the code you have there, I see nothing wrong with. It is perfect.

Comatose 290 Taboo Programmer Team Colleague

I'm not sure how using session to store the invalid attempt count works, but it's sounding like a DoS waiting to happen. What if I (not legit user) want to stop you (legit user) from accessing your account? I guess I could try three times to get your password (and get it wrong). Then you (legit user) will be locked out of your own account :icon_eek:

Comatose 290 Taboo Programmer Team Colleague

How is the linker supposed to know about the object/variables?

Comatose 290 Taboo Programmer Team Colleague

if you know the caption / title of the window you can try this: appactivate "title of window here"

Comatose 290 Taboo Programmer Team Colleague

You are passing no parameters to the Point class's constructor. It expect 3 floats, during instantiation (Point myLocation). You need to give it three floats.

Comatose 290 Taboo Programmer Team Colleague
#!/usr/bin/perl

$filename = "/root/file";
$var = `cat $filename | wc -l`;

print "$var";

EDIT: you shouldn't be stomping around a system as root.

Comatose 290 Taboo Programmer Team Colleague
#!/usr/bin/perl
system("cat '/something/something/something/darkside.txt'");
Comatose 290 Taboo Programmer Team Colleague

sounds like a fun homework assignment.

Comatose 290 Taboo Programmer Team Colleague

Look Up Declaring Variables and
Basic I/O. That should get you on a roll.... you might even try this link for help. That first link... boy it's a doosey.

Comatose 290 Taboo Programmer Team Colleague

What code do you have done so far?

EDIT: if your answer is none... start here:

#include <iostream>

using namespace std;

int main(int argc, char **argv)
{
     // Declare Length, width, area and perimeter

     // Display message about length to user
     // Get length from user

     // Display message about width to user
     // Get width from user

     // Calculate perim
     // Calculate area

     // Show perim to user
     // Show area to user

     return 0;
}
Comatose 290 Taboo Programmer Team Colleague

Yeah....

This is the easy way to do it, without the major headaches.... the other way to do is a little less "fluky" that is, sometimes if you are on the edge of the label, it might not always hide or something like that... try it out and see if it suits your needs. The alternative is to use an ugly mesh of API calls.

Comatose 290 Taboo Programmer Team Colleague

Sorry to back to back post (edit is now gone):

#include <iostream>
#include <cstring>
#include <vector>

using namespace std;

int main()
{
	char input[255];
	int countWrite = 0;
	int countLink = 0;
	int countDir = 0;
	string owners[255];
	char *s;
	char *result = NULL;
	string pid,perm,dir,owner,group,size,date,file,mtime;
	char d,l,w;
	
	while (cin.getline(input,255,'\n'))//read lines from output of unix cmd ls -ali
	{	
	
		vector<string> parts;
		std::string tmpstr(input);
		if (tmpstr.substr(0, 5) == "total") continue;	

		s = input;	

		result = strtok(s, " ");

		while (result != NULL)  {
			if (result != "" && result != " ") {
				parts.push_back(result);
			}

         		result = strtok(NULL, " ");
     		}


		pid = parts[0];
		perm = parts[1];
		dir = parts[2];
		owner = parts[3];
		group =parts[4];
		size = parts[5];
		date = parts[6];
		mtime = parts[7];
		file = parts[8];
		

		cout << "pid: " << pid << endl;
		cout << "perm: " << perm  << endl;
		cout << "dir: " << dir  << endl;
		cout << "owner: " << owner << endl;
		cout << "group: " << group << endl;
		cout << "size: " << size  << endl;
		cout << "date: " << date  << endl;
		cout << "time: " << mtime << endl;
		cout << "file: " << file << endl;


		// I dunno about the rest of your code, but it works up to here
		// This is a hack job... I didn't want to have to rewrite your 
		// entire code, so I made it work with what you have.

			
		if (perm == "d*")//count directories
			countDir++;

		if (perm == "l*")//count …
Comatose 290 Taboo Programmer Team Colleague

Your while loop, for loop, and cout's, you don't seem to think are part of your int main?

anyway, have you looked at the output of ls -ali? I see the distance between some of the columns in only one space.... but output of some of the others is not simply 1 space, but varies based on the length of the other column, and so forth and so on.

edit: oh, and don't forget the first line that is output: total 1532 (some number, mine is 1532).. yeah, you might want to discard that first read.

Comatose 290 Taboo Programmer Team Colleague

Probably is, you've pointed to VB.NET, this is vb 4/5/6

Comatose 290 Taboo Programmer Team Colleague

Implicit cast to long long int seems to work....(at least on Fedora 8 with g++)

edit: forgot about precision... discard. (you may need to use GMP, if in linux)

Comatose 290 Taboo Programmer Team Colleague

Other than you have two mains ;)

you need to change the [ ] around the return value of strtok to ( )... don't count on it showing you anything though.... (you have no data output)