Im having a strange problem here. When im reading from my db in my perl script, everything goes fine. However when I write to the db, the perl script goes from 1% CPU load to 60% CPU load, and stays there. This happens every now and then so not every time when writing to the db. What could cause...
haha it's ok dude! Im not asking to validate this code as it probably is crap. Im not into perl. What im asking is a correct and easy way to achieve the masking goal.
In my vision substr($x, $ran, $ran) would be the $ran'th letter of the string $x?
say i have $answer = 'apple'
what i want to achieve is getting the string masked and show only 1/3 of the original letters and place this in $hint
So $hint could be *p*** or **p*e
It seemed to me that when $ran was 2 for example, this line
substr($hint, $ran, $ran) = substr($answer, $ran...
well thats just my lack of knowledge of perl... ;)
in PHP i have this
$hint[$ran] = $answer[$ran];
this replaces the $ran'th element of the mask string with the $ran'th element of the original string, showing part of the original string in the mask string.
i thought i could do this in perl...
i have written the following PHP function that masks a string with ***'s and then unveils 1/3 of its original letters to form a hint:
$length = strlen($answer);
$hint = "";
for ($x=0;$x<$length;$x++){
$hint .= "*";
}
for ($x=0;$x<($length/3);$x++){
$ran = rand(0,$length-1);
$hint[$ran] =...
I have the following code
Dim objFSO As FileSystemObject
Dim objTS As TextStream
Dim strPath As String
Dim strLine As String
Set objFSO = New FileSystemObject
strPath = "c:\vb\files.txt"
Set objTS = objFSO.OpenTextFile(strPath, ForReading)
Do While objTS.AtEndOfStream = False...
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.