Comatose 290 Taboo Programmer Team Colleague

Ok, I understand the file naming convention, but now I need to know a few number of things.
A) This will be all web-based right?
B) A list of all the possible filenames (inc, sal, etc, etc)
C) A List of the directory structure (/ourfiles/001/sal) or whatever
D) Is There A Username and Password Needed, If So, Where Will the password file be stored? Is It A Unix Encrypted Password? Is It using PAM? Will it be just a plain text password file?

Comatose 290 Taboo Programmer Team Colleague

Javascript, IMO. Javascript is more readily understandable to most browsers. While VBScript is making some kind of attempt at becoming popular, it may very well only be supported by "popular" browsers. I'm not 100% sure, but I don't think the little guys, such as opera, support VBScript, while they are much more likely to support Javascript. It just seems like the better plan.

Comatose 290 Taboo Programmer Team Colleague

It Casts an expression to a long value. If, for instance, you have a string, or a hex value, you can use clng to convert it to a long. It takes any valid expression and returns a long value. Plain and simple. Read Here For Details:

http://17.webmasters.com/caspdoc/html/vbscript_clng_function.htm

Comatose 290 Taboo Programmer Team Colleague

The Very Simple Answer is no. I'm sorry. The only way to do what you want, would be to build it yourself (using frames, or some other funky magic) with a whole lot of .visibles..... I thought maybe messing with it through some of the API's might be helpful, but no.... it's pretty much just what it is. I believe you can find a custom .ocx for it on the web, to replace Microsoft's Tabbed Dialog, but you may need to fork out a few bucks for it.

Comatose 290 Taboo Programmer Team Colleague

Good Solution. I also appreciate you posting your solution to the site, so that others with similar problems have a chance to fix the same issue. Thanx.

Comatose 290 Taboo Programmer Team Colleague

I'll be honest, I only vaguely understand what you need done. I can assist you in building a perl program that logs someone in, etc, etc, but I'm a little lost on your whole file structure with dates and stuff. I don't have enough information to help you with your problem, but if you could elaborate, I'd be glad to see what I can do.

Comatose 290 Taboo Programmer Team Colleague

Goodness, My mistake. In the context it was posted, in such a heated debate, it seemed fairly agressive, and looked as though it was viewed with negativity, never happier to be wrong.

Comatose 290 Taboo Programmer Team Colleague

The only real way to find out, is to have the VB IDE running the program when it crashes, so that the debugger can highlight the problem line. I'm guessing that you are compiling it to an EXE and then running it on the client machine. It may be a paperbin problem if the system doesn't have it on the client machine. You SHOULD be able to test for how many bins there are and if there is only one, just don't mess with it.... let me know what you come up with.

Comatose 290 Taboo Programmer Team Colleague

What's wrong with getting poems out of books?

Comatose 290 Taboo Programmer Team Colleague

Let's be clear about something, I am a soldier, and I live with this war on terror every single day. I know how many people Sadam has injured, and killed, and I think he was lunatic. However, your defination (wherever your source was taken from) could be defined also as a "group" of people... not just a person who uses violence and intimidation for political aims.... now, don't take this out of context, because I fight this war on the side of the states every day, but with your definition of a terrorist, The U.S. could be viewed as a terrorist. I'm not 100% sure, no, yes I am. I am 100% sure that we used violence and intimidation to remove a political power. Do I think I am a terrorist for helping? No. Your definition would define me as one though. So, maybe it depends on which side of the fence you are standing on?

Comatose 290 Taboo Programmer Team Colleague

;) Good Stuff.

Comatose 290 Taboo Programmer Team Colleague

0, makes it hide the window, so that it doesn't show up to the user (otherwise, they'd get some stupid dos window).
1, makes the Run Method of the WSH Object wait until the spawning process completes, before continuing on.

Comatose 290 Taboo Programmer Team Colleague

Are You trying to make the batch file pause, or the VB Program wait until the batch file is done? If you are trying to wait until the batch file is done, don't use shell. (you can use shell, but it's a lot more code than this here). Use WSH within VB, as such:

dim wsh
set wsh = createobject("WScript.Shell")
wsh.Run "c:\somebatchfile.bat", 0, 1
Comatose 290 Taboo Programmer Team Colleague

Have you tried actually booting to the CD? (Shut off the computer with the CD in the drive, and try to boot to it). That usually works for me.

Comatose 290 Taboo Programmer Team Colleague

*Just Shakes His Head*

Comatose 290 Taboo Programmer Team Colleague

Not to my knowledge. However, if you have free compiler or something like that, and distribute it then you can write the C code out to a file and compile it, but actually doing good stuff like inline asm in C with VB and C, probably not. Something else to consider, however, is that debug seems to still exist as far up as XP :D.

Comatose 290 Taboo Programmer Team Colleague

I don't remember the exact number, I think at 100 posts you get promoted. I'm guessing this collection concern is for .NET?

Comatose 290 Taboo Programmer Team Colleague

I go idea is to use a msgbox or some other method to see the actual string. Say msgbox input, that will tell you exactly what the string is that you are trying to get the substring of. I'm guessing there isn't 2 or 3 characters in the string, so when you try to get 2, it doesn't exist. I could be wrong, but I don't have .NET installed to try it :(

Comatose 290 Taboo Programmer Team Colleague

I'm not sure I know what you mean about having the socket change over. There are only 2 kinds of socket. A Listener, and A Client, you can't have 1 socket do both. Plain and simple. You can't change in the middle, either. Once a client makes a connection to the server, the server has to remain that type of socket, and the client has to remain it's type of socket. Once you are connected, however, you can send data back and forth from the server socket to the client and vice versa.

Comatose 290 Taboo Programmer Team Colleague

I don't know exactly what you mean, but I'm guessing that you want to set the "multi-line" property of the textbox, so that it can have more than 1 line of text in it right?

Comatose 290 Taboo Programmer Team Colleague

The thing is this.... 1 winsock control needs to be a "listening" socket, and 1 needs to be a client socket. Here, read this mini-tutorial about winsock, and it will give you a better understanding. Basically, 1 socket needs to say "ok, I'm gonna listen and if you try to connect, I will accept your connection". The other socket needs to say "hey, I'm gonna try to make a connection to you". Here is the tutorial:

http://www.devx.com/vb2themax/Article/19879

Keep in mind, that if you make them the same program, then that project will need to have 2 sockets... one that listens (server socket) and 1 that tries to make a connection (client socket).

Comatose 290 Taboo Programmer Team Colleague

If one is a listening socket, and one is a client socket, then it might work. I'm not so sure that windows is going to like the idea of you trying to use 10101 for both listening and trying to connect on though. If it's the same code though, it should be just 2 programs trying to connect to the same port.... I usually get that same error when I try to have 2 server sockets (sockets that accept a connecton) on the same port and IP address.

Comatose 290 Taboo Programmer Team Colleague

No problemo, If you need any further help, especially with the project your currently undertaking, just let me know. I am working on a project of a very similar nature....

Comatose 290 Taboo Programmer Team Colleague

oh, no problem then, try with this:

Private Sub connect_Click()
Winsock.RemoteHost = ipadd.text
Winsock.RemotePort = 10101
Winsock.connect
End Sub
Comatose 290 Taboo Programmer Team Colleague

ok, is ipadd a variable that contains an IP Address or host name?
you could try removing "ipadd" and replacing it with an actual IP or host:

Private Sub connect_Click()
Winsock.RemoteHost = "google.com"
Winsock.RemotePort = 10101
Winsock.connect
End Sub

I'm fairly certain that google will have 10101 (port number) blocked... but I'm pretty sure it will have 80 open ;)

Comatose 290 Taboo Programmer Team Colleague

Appreciate it.... but most of that credit goes to Narue. I put forth my stretch of effort, but without her I'd still be looking.

Comatose 290 Taboo Programmer Team Colleague

Ok, where I got confused, was that my version of passwd didn't support --stdin, which caused a big headache. Knowing that the version you are going to run it on does support --stdin (you should do a man first on passwd to make sure for the server to ensure that --stdin will work with passwd on that server). This should suffice, however, to work with --stdin:

print "Enter Your Password: "; $oldpass = <STDIN>;
print "Enter Your New Password: "; $newpass = <STDIN>;

open (PASSWD, "| passwd --stdin");
     print PASSWD "$oldpass";
     print PASSWD "$newpass";
     print PASSWD "$newpass";
close(PASSWD);

This is assuming that the passwd command will require 3 lines of text. The first line being the current password, the next line being the new password, and the last line being the confirmation of the new password. There is a more complicated Method, which I have to give the huge majority of credit to Narue, which requires detaching the process from the controlling terminal using ioctl, and if needed, I'll go back through that mess, and help with that. If, however, passwd on the server this will be run, supports --stdin, that's the way to go.

Comatose 290 Taboo Programmer Team Colleague

Right, but what I'm asking is if LDAP is already installed on that box. If LDAP, or Expect.pm is on the box in question, then it will be no problem. If he does NOT have root access (which it seems he won't), then even manually opening and editing the shadow and passwd files isn't going to fly. I've got myself and 2 other people checking into this right now... it seems that passwd, along with su, demand input from the keyboard.... for security reasons. I'll keep you posted. I'm also unsure what --stdin does, I know it should be redirecting something to stdin, but what are you trying to pass this switch to?

Comatose 290 Taboo Programmer Team Colleague

What type of privs do you have on the box, or do you have super user/root access? Is LDAP installed on the system already, or PAM, or Expect.pm? I'll keep digging around and see what I can't make happen, but it may come down to editing the md5 digest pm, and finding the sub that actually creates the MD5 hash, and just adding that sub into your script, and then shelling it with the md5, but let me see what I can do.

Comatose 290 Taboo Programmer Team Colleague

As I've been helping you, I'm sure that this post is probably not needed to solve your problem any more, however, regex is a very important part of working with strings, and therefore, I have a page that helps breakdown regex into a pretty easy form:
http://www.troubleshooters.com/codecorn/littperl/perlreg.htm

Comatose 290 Taboo Programmer Team Colleague

I realize this is an extremely old post, that has gone left unanswered for close to a year, but if you still need help with that, give me the names of the form fields, and what they are (or link me to your HTML), and I'll help you out with it.

Comatose 290 Taboo Programmer Team Colleague

Works Fine, What Are You Talking About ;):

#!/usr/bin/perl

# number to factor is passed as an argument
$number = $ARGV[0];

# $left is the unfactored part that remains
$left = $number;

# loop through all possible factors
foreach $test (2..$number){

        # exit when  no factoring left to do
        if ($left == 1) {
                last;
        }

        # doest $test divide $left?
        if ($left % $test == 0) {

                $left /= $test;

                #print a space between factors
                if ($first) {
                        print " ";
                } else {
                        $first = 1;
                }

                # now print the factor
                print "$test";

                # try this factor again
                redo ;
        }
}

print "\n" if $first;

Ps:
I changed this:

print ("test");

to this:

print "$test";

and this:

print ('\n') if $first;

to this:

print "\n" if $first;
Comatose 290 Taboo Programmer Team Colleague

Ok, what I Meant was that when you post code on the site, use code tags. Open a code tag with [ CODE ] with no spaces. Then close the code tag with [ / CODE ] no spaces. It will look like this, and will preserve tabs on this page for readability:

This is in code Tags

Also, I don't know why you are using the same array that contains all the parts of the split to push and pop from. I would have used a different one, but if it works, cool. I just don't understand HOW it works. Anyway, if you know where the indents need to be, then you can:

foreach $line (@lines) {
	@fields = split(/ /, $line);
	if ($fields[0] eq 'OPAREN') {
		push(@fields, $fields[1]);
		print OUTPUT "$fields[0] ";
		print OUTPUT "$fields[1]";
	}elsif ($fields[0] eq 'CPAREN') {
		pop(@fields);
		print OUTPUT "$fields[0] ";
		print OUTPUT "\t$fields[1]";    # I modified this line, to add a tab first
	}elsif (($fields[0] ne 'OPAREN') && ($fields[0] ne 'CPAREN')) {
		print OUTPUT "$fields[0] ";
		print OUTPUT "$fields[1]";
	}
}
Comatose 290 Taboo Programmer Team Colleague

I'm not sure I know what you mean..... I am not understanding "parse tree" so much, and I'm not quite understanding what you want done with Tabs. If you post code, also, it might be beneficial to use code tags which is bracket [ then the word CODE then ]. If you could just elaborate a little bit on what you need done, I'll see what I can do.

Comatose 290 Taboo Programmer Team Colleague

Alright, it's not "pretty" by way of displaying it to the page, but it does exactly what you want it to do:

#!/usr/bin/perl

print "Content-type:text/html\n\n";

open(INF,"data.txt") or dienice("Can't open data.txt: $! \n");
        @grok = <INF>;
close(INF);

print <<EndHdr;
        <html><head><title>My Data</title></head>
        <body>
        <center>
        <h2 align="CENTER">My Data</h2>
        <table border="1">
        <tr>
EndHdr

$cnt = 1;

foreach $i (@grok) {
        chomp($i);
        ($Item,$Page,$Desc,$Pack,$Price) = split(/\|/,$i);

        if ($cnt == 5) {
                print "<td>$Item</td><td>$Page</td><td>$Desc</td><td>$Pack</td><td>$Price</td>\n";
                print "</TR><TR>\n";
                $cnt = 1;
        } else {
                if ($Item ne "") {
                        print "<td>$Item</td><td>$Page</td><td>$Desc</td><td>$Pack</td><td>$Price</td>\n";
                        $cnt++;
                }
        }
}

print <<EndFoot;
        </tr>
        </table>
        </center>
        </body>
        </html>
EndFoot

sub dienice {
        my($msg) = @_;
        print "<h2>Error</h2>\n";
        print $msg;
        exit;
}
Comatose 290 Taboo Programmer Team Colleague

Welcome Aboard

Comatose 290 Taboo Programmer Team Colleague

Ok, I just wanted to make sure that you REALLY wanted 5 records per row, because you already have 1 record, with 5 fields in a row.... I'll work on this problem though and let you know what I come up with. You know how that will like right?

Item1 Page1 Desc1 Pack1 Price1 Item2 Page2 Desc2 Pack2 Price2 Item3 Page3 Desc3 Pack3 Price3 ...

If you have no problems with attaching the file that you are reading this info from, I will gladly help you to set this code in motion.

Comatose 290 Taboo Programmer Team Colleague

I could be wrong, but it seems to me that line:

if ($Item eq "") {
print "<td>$Item</td>"<td>$Page</td>"<td>$Desc</td>"<td>$Pack</td>"<td>$Price</td>\n";
}

is not correct. You are saying "if $item variable is empty, then print this to the web page". Maybe you planned for $item to be empty, and if so, then to print the stuff to the page, but I'm guessing that's partly why it's not working. If I am wrong, please let me know. Also, That would not print 5 records, per row, it would print 1 record with 5 fields, per row. I'm figuring that is what you want. The code should probably look like this:

#!/perl/bin/perl
print "Content-type:text/html\n\n";

open(INF,"data.txt") or dienice("Can't open data.txt: $! \n");
     @grok = <INF>;
close(INF);

print <<EndHdr;
     <html><head><title>My Data</title></head>
     <body>
     <center>
     <h2 align="CENTER">My Data</h2>
     <table border="1">
     <tr>
EndHdr

foreach $i (@grok) {
     chomp($i);
     ($Item,$Page,$Desc,$Pack,$Price) = split(/\|/,$i);

     # /* Changed The Line Below */
     if ($Item ne "") {
          print "<TR><td>$Item</td>"<td>$Page</td>"<td>$Desc</td>"<td>$Pack</td>"<td>$Price</td></TR>\n";
     }
}

print <<EndFoot;
     </tr>
     </table>
     </center>
     </body>
     </html>
EndFoot

sub dienice {
     my($msg) = @_;
     print "<h2>Error</h2>\n";
     print $msg;
     exit;
}
Comatose 290 Taboo Programmer Team Colleague

you could do a regular expression on it, or a substitution on it. I'm a bit confused about the SUB -, though, because I'm not sure if the - that comes after SUB is SUPPOSED to belong to the 1 or not. Is SUB - and INT -1 2 different "-"s, or is it moving the - from INT up to SUB? When you read the data in from the file, test it (match test) for INT - like:

# /* Assuming $_ is the line we are checking */
if (/INT -/) {
     ($cmd, $integer) = split(/ /, $_);
     $newdata = "$cmd \-$integer";
} else {
     $newdata = $_;
}

That would set $newdata to contain the correct INT line, either with a - if needed, or without if not. Something to try, is to have the perl program print to stdout, the file input line by line, just to make sure that what you are reading in, is what your program is getting. So, something like:

while (<FH>) {
     print $_;
}

This way you know for sure that you Perl file is getting the proper data, then you can add the - if necessary if the file is recieving everything correctly. ;)

Comatose 290 Taboo Programmer Team Colleague

I'm not sure which version of acrobat you are using, but if you go here: http://partners.adobe.com/public/developer/acrobat/sdk/index.html, and download the SDK (you'll have to register for a free account), it comes with sample code of how to automate Acrobat processes with Visual Basic (and C/C++). Download and install the sdk and samples, and I'm certain you'll find what you need.

Comatose 290 Taboo Programmer Team Colleague
Comatose 290 Taboo Programmer Team Colleague

I'm not sure if you can actually specify the name of the hash with content contained in a variable, but something you may be interested in checking out is "annonymous hashes"

Comatose 290 Taboo Programmer Team Colleague

you need to be careful when talking about events in perl. Events are a term coined for OOP program, which perl is not really made for. It's possible, sure, with things such as POE and the Tk Modules, but namely for standard perl programming, it's pretty much not event driven. My suggestion here, is to do an infinate loop, something really easy like:

while (1) {
     # /* Stuff To Do In Loop Here */
}

Then grab a time stamp. You can use the epoch, I believe, with time. So you can take a time stamp, set a variable to contain the old time, plus however many seconds you want the "timer" to be, and then test it against the new time, so something like:

$oldtime = (time + 10);
while (1) {
     if (time > $oldtime) {
         &sub_to_call;
         $oldtime = (time + 10);         
     }
}

The above code will take a timestamp, and add 10 seconds to it. Then it will go into an infinate loop, and keep checking if the current time is greater than the time we specified. If it is, so either 10 or 11 seconds have passed, we call a sub called "sub_to_call", and then we reset our oldtime variable to now, plus 10 more seconds. Basically, every 10 seconds this program should call the sub.

Comatose 290 Taboo Programmer Team Colleague

I know that perl has a built in hash (associative array) for environment variables. Take a look at $ENV{'PATH'}. That might be what you need. ;)

Comatose 290 Taboo Programmer Team Colleague

I wouldn't normally double post, but I found the best way that I would do it, and converted it into a sub that you can use:

sub strip_comment
{
        # /* Get The Parameter Passed To The Function */
        $theline = shift;

        # /* Search For The First Occurance Of : */
        $where = index($theline, ":");

        # /* If We Find No Comment, Return The Entire Line Passed To us */
        if ($where eq -1) {
                return $theline;
        }

        # /* Get The Part Of The String Up To, And Including The Colon */
        $goodpart = substr($theline, 0, $where);

        # /* Remove The Colon */
        chop($goodpart);

        # /* Return Only The Portion Of The String Before The Colon */
        return $goodpart;
}

just stick that at the bottom of your perl file, and then call it like this:

$retval = &strip_comment($theline);

Assuming $theline was the entire line, comments and all, then $retval would contain only the non-comment part of the line. Let me know how it works for you.

Comatose 290 Taboo Programmer Team Colleague

My personal suggestion, would be to do a split or regex on it. I would do a split, but I'm a bit silly. The thing is, if a colon starts a comment, then there can be no colon's within the "good string". what I mean is, if the line has:

she said: how are ya :this is the comment

then "she said" would be the only thing that would not be a comment. But, This is how I would do it:

($goodinfo, $comment) = split(/:/, $_) # you can replace $_ with the variable you use
print FH "$goodinfo\n";

obviously, the above line will need modifications in order to suite what it is you are doing, but split line works by searching for a colon, if it finds one, it sticks the stuff on the left of the colon, into the first variable, and the stuff on the right in the second variable (those that are in parenthesis). You could have it return an array, also, and just do a pop on the array, but in that way, only the data after the very last colon in the string would be ignored. Let me know what you come up with.

Comatose 290 Taboo Programmer Team Colleague

I understand your concern about jerks sending virus's with zip files. I will only post enitre projects in .zip format. However, you may not need my help at all. If you go to http://www.catalyst.com, and look up the freeware version of socketwrench, it comes with a freeware dialer control, that will enable your apps to see if the phone is in use, and can also dial a number for you. I'm not 100% sure if the oldest ways in the book will work, but it's also always possible to echo modem init strings to the com port that the modem is residing on.

Comatose 290 Taboo Programmer Team Colleague

If you ask me, that sounds like the way to do it. You make an EXE that will copy the updated programs from the network to the PC, removing the old version, and letting them use the new version. It's just 1 EXE that you make, that will auto-update the EXE on their machines. Hell, you could have it even setup to do it everyday (it won't matter if the EXE on the network is the same as the one on the PC anyway), at some late time after work. That way, every day they get the updates.

Comatose 290 Taboo Programmer Team Colleague

You are talking about a regular variable right? Or are you talking about an evirionment variable?

Comatose 290 Taboo Programmer Team Colleague

mount -t msdos /dev/hda6 /mnt/fat

that should do the trick. I'm not 100% sure about fedora core, I'm positive it's worked in every version of RH that I've tried.