Jump to content

ezzetabi

Active Members
  • Posts

    1,917
  • Joined

  • Last visited

Profile Information

  • Member Title
    さくらが さいた

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

ezzetabi's Achievements

Universalist

Universalist (7/7)

4

Reputation

  1. What about that? Func _xcopyWithDialog($sStartingDir, $sDestDir, $sSettings = '/i/c/e/d/h/r/y') Local $iPid, $iSDSize, $iODSize If FileExists($sStartingDir) And StringInStr(FileGetAttrib($sStartingDir), 'd') Then $iPid = Run(@comspec & ' /c xcopy "' & $sStartingDir & '" "' & $sDestDir & '" ' & $sSettings) $iSDSize = DirGetSize($sStartingDir) ProgressOn ( "XCopy", "Coping...") While ProcessExists($iPid) $iODSize = DirGetSize($sDestDir) ProgressSet(Round(100 * $iODSize / $iSDSize) ) Sleep(100) WEnd ProgressOff( ) Else Return -1 EndIf EndFunc
  2. Nice job Proph, but you should always put all func in the bottom or in the begin of the script. Putting Functions in the middle as you did is ugly (even if it works exactly at the same way...). In fact your program seems incomplete at the first look. I usually even put a EXIT just before the functions, in order to make clear that the main program is ended, if I need OnAutoItStart() I put it as first function. The program is more tidy that way... ;Main program Exit Func OnAutoItStart() ;Blah EndFunc ;Other funcs....
  3. ...I hate this kind of answers... Why not use XXCopy? It permit also copying NTFS rights! So? What? He asked something different! just use $cmdline[] if $cmdline[0] > 1 Then _CopyDirWithProgress($cmdline[1], $cmdline[2]) ;Some error checking here endif
  4. Grrr blindwig, why you never commented my func? Is it more or less the same...
  5. @Proph It is pretty easy, inside the _FileSeach function subfolders are added in the $sBuffer list. Just check if the name you want exclude matches. If it does do not add it. But I can't do it outright, since I have no time... :| @blitzkrg dirmove is pretty straightforward, just changes those FileCopy with FileMove and just before the end use some thing like: If $sLost <> '' Then;tries to write the log somewhere. If FileWrite($sDestDir & 'notcopied.txt',$sLost) = 0 Then If FileWrite($sOriginalDir & 'notcopied.txt',$sLost) = 0 Then FileWrite(@WorkingDir & '\notcopied.txt',$sLost) EndIf EndIf Else DirRemove ($sOriginalDir, 1) EndIf So the original dir is removed if everything went allright, otherwise unmoved files and all folders will still stay there. About subfolders or not, it is pretty useless. Coping only the root files is extemly easy. Help yourself.
  6. Maybe people should just drop the idea of learning scripting languages... The only two parameters of the func are $sOriginalDir $sDestDir What they could mean?
  7. There is no need of thinking about useless scripts, just use the seach button.
  8. 0.00000000000000101 in base two is about 0.00003814697265625 [ that is (1/2^15) + (1/2^17) ] in base ten... something is wrong. If it is not a bug probably something is wrong in your code. I have a question, not to brag about my code, but since I already done it why do not use my implementation? If you want a real _any2any converter just use the two function altoghter like _Dec2Any(_Any2Dec())...
  9. Wikipedia math sometime have little mistakes or imprecision. Anyway, the idea is simple, since every number is the sum of its digits*base^position (starting from 0) a non iteger have values where position is negative.
  10. Something like this? http://www.autoitscript.com/forum/index.php?showtopic=6899 N00b? Aren't you?
  11. Also accept non integers. http://www.autoitscript.com/forum/index.php?showtopic=7282
  12. Considering the lack of answers I would say that non actually care.
  13. So be it, new version. Also some bug fixing... #include <Array.au3> Dim $Array[101] $Array[1]=100 For $X=1 to 100 if $x<>35 Then $Array[$X]=Int(Random(0, 111)) Else $Array[$X]=$X EndIf Next _ArraySort($Array) $Out='' For $c = 1 to 100 $Out = $out & $c&'='&$Array[$c] & ' ' Next $Out = $Out & @LF $Timer=TimerInit() $Pos=_ArrayBinarySearch($Array,35,1) $ABST=TimerDiff($Timer) $Timer2=TimerInit() $Pos2=_IntBinarySearch($Array,35,1,100) $IBST=TimerDiff($Timer2) $Out=$out & "----ABS----" & @CRLF & "POS:" & $Pos & @CRLF & "Time:" & $ABST & @CRLF & "----IBS----" & @CRLF & "POS:" & $Pos2 & @CRLF & "Time:" & $IBST MsgBox(0,"Stats",$Out) ClipPut($Out) Func _IntBinarySearch(ByRef $avSortedArray, $vSeek, $iStartingPoint, $iEndingPoint) Local $iPivot If $iStartingPoint < 0 Or $iEndingPoint > UBound($avSortedArray) Then $iPivot = -1 Else While $iEndingPoint <> $iStartingPoint $iPivot = $iStartingPoint + Round( ($iEndingPoint - $iStartingPoint) * ($vSeek - $avSortedArray[$iStartingPoint]) / ($avSortedArray[$iEndingPoint] - $avSortedArray[$iStartingPoint]) ) If $iPivot < $iStartingPoint Then $iPivot = $iStartingPoint ElseIf $iPivot > $iEndingPoint Then $iPivot = $iEndingPoint EndIf If $avSortedArray[$iPivot] = $vSeek Then $iEndingPoint = $iPivot $iStartingPoint = $iPivot ElseIf $vSeek < $avSortedArray[$iPivot] And $iEndingPoint <> $iPivot Then $iEndingPoint = $iPivot ElseIf $iStartingPoint <> $iPivot Then $iStartingPoint = $iPivot Else $iPivot = -1 ExitLoop EndIf WEnd EndIf Return $iPivot EndFunc
  14. $sT = 'If they make mistakes, lets follow them! (Remainder lesson)' $sPass = 'a pass!' MsgBox(16,'', _Rot($st, $sPass, 0)) MsgBox(16,'', _Rot($st, $sPass, 1)) Func _Rot(ByRef $sInput, $sPass, $bMode) Local $sChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz' Local $iNofC = StringLen($sChars) Local $c, $iPos, $sChr Local $ipl = StringLen($sPass) Local $isl = StringLen($sInput) Local $aiPass[$ipl] For $c = 0 to $ipl - 1 $aiPass[$c] = Asc(StringMid($sPass, $c + 1, 1)) + 17 Next $sPass = 0 For $c = 1 to $isl $sChr = StringMid($sInput, $c, 1) $iPos = StringInStr($sChars, $sChr, 1) If $iPos > 0 Then If $bMode = 0 Then $sChr = StringMid($sChars, _Mod($aiPass[Mod($c - 1, $ipl)] + $iPos, $iNofC), 1) Else $sChr = StringMid($sChars, _Mod(- $aiPass[Mod($c - 1, $ipl)] + $iPos, $iNofC), 1) EndIf EndIf $sInput = StringLeft($sInput, $c - 1) & $sChr & StringTrimLeft($sInput, $c) Next Return $sInput EndFunc Func _Mod($iDividend, $iDivisor) Local $iMod If $iDivisor <> 0 Then If $iDividend < 0 Then $iDividend = $iDividend * -1 $iMod = Mod($iDividend, $iDivisor) if $iMod = 0 Then Return $iMod Else Return $iDivisor - $iMod EndIf EndIf Return Mod($iDividend, $iDivisor) Else SetError(1) Return '-1.#IND' EndIf EndFunc Exit
×
×
  • Create New...