Okay, so I solved this problem, but if you have any insights into why the above caused a set fault, I'd still be interested to learn.
I solved the problem by putting this into the while (<FH>) loop.
# skip lines with only zeros
/^(0\s)+$/ && next;
Does the quadratic number of regex statements...
Oops...
If I still have your attention, I need it to ignore identical lines that are all zeros. I tried adding this to sub identical:
if ($x =~ /^(0\s)+$/) {
return 0;
}
else {
return ($x eq $y);
}
And that causes a seg fault. The lines can't be too big for regex stuff since it's...
Mike, you are the MAN! Worked perfectly!
I tend to think too much like a C programmer in perl, and I forget how incredibly easy (and fast) it is to just manipulate whole lines like that to set up really easy, non-looping comparisons. Not only does this work, but it's almost instantaneous...
Sorry again mike.
1 2 3 0 0 4 5 6 0 7 8 9
1 2 3 0 4 5 6 7 0 0 8 9
Are not identical. Each point is a reference to a distinct place in a large vector. 0's don't shift out or anything.
Chaz, thanks for the new trick. I've wondered if there was an easy way to get array-style access to a file...
Sorry this wasn't clear in earlier posts. Two lines are considered identical iff there are ANY non-zero values in the whole string of 3000 integers AND the values at each point in the array are identical.
So:
0 0 0 0 0 0
0 0 0 0 0 0
are not identical, and:
0 0 0 0 0 0
0 0 1 0 0 0
are also...
Yeah, it's looking for duplicate lines in the whole file. I tried introducint "use strict;" but I got all kinds of package warnings. Do I have to put main:: in front of every single line if I use strict?
A couple questions about your advice:
1) Reading the file line by line (and not saving...
I'm getting a segmentation fault at varibale times in my program. I've had this problem before, on other basic formatting scripts on similar files. Basically this program is just reading in a giant text file, ~300 lines with 3000-5000 number data on each line separated by white space. This...
haha! Unfortunately I am the network admin :)
I did actually find that solution on microsoft support. Unfortunately, they told me to boot into the recovery console and copy winnt/repair/security to winnt/system32/config/security first. I removed the computer accound in ADUC and together that...
All my regular users are in the same group. The logon locall and deny logon locally settings were both undefined in that GPO. I specifically added mydomain.com/Domain Computers to the logon locally policy, but that did nothing. I'm not sure how to specifically get to an individual computer...
So I have a win2k server with win2k clients. One client (on the network 4 or 5 months already) "suddenly" stopped being able to logon sometime in the past couple days. The worker came in on Sunday, reportedly to a functioning computer. He was out of the office M + T, now when he tries to log...
All the money here comes from grants for education from the governments of the US, Australia, Japan, and a few others. These grants rarely support recurring costs. Before I got here someone got some grant money to set up a single server machine with win2k server and exchange, but then left and...
I know this place isn't supposed to be an advertising forum or anything, but I have a serious question, so I thought I'd ask it.
The monopoly telecom in the country I work is my only available ISP. I have my own internal exchange server, and I need register my domain and have someone else host...
Not sure if this is the right forum for this, but can't find a specific wireless forum here, and I'll be running it with a win2k served network, so here goes.
I have a long thin building: 150-200 feet corridor, one room on each side of corridor. There is lots of alluminum plating and struts...
If you have 200 computers already up and running and highly modified you might be screwed. I'm not a big windows scripter though. Anyone here with expertise there know if this kind of thing can be automated? Perhaps the server can run a script when a new local domain account is created on a...
I had this same problem. Look into C:\Docs and Settings\.
There should be a folder for each user account, the admin, and a default user or all users folder. I've found that with only one account set up, usually the changes made to the desktop, start menu, and all that go into the All Users...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.