Solution to Euler project in Python Problem 1-10 [sourcecode language="python"] ## For class Helper see below helperObj = Helper() def problem1(self): ''' Add all the natural numbers below one thousand that are multiples of 3 or 5. ''' numbers = range(0,1000) return reduce(lambda x,y: x+y, filter(lambda(x):x%3==0 or x%5==0, numbers)) def problem2(self): ''' By considering the … Continue reading Euler project in Python
Category: Tools
PowerShell: Clear Event logs from Windows machine
Problem Statement: Need to clear off Application, Security and System Event logs of your Windows PC? Well here's the solution. [sourcecode language="powershell"] foreach($computer in $args) { $ALive=get-wmiobject win32_pingstatus -Filter "Address='$computer'" | Select-Object statuscode if($ALive.statuscode -eq 0) { $logs = [System.Diagnostics.Eventlog]::GetEventLogs("$computer") $Applogs = $logs|where-object {$_.logdisplayname -eq "Application"} $Applogs.clear() $Securitylogs = $logs|where-object {$_.logdisplayname -eq "Security"} $Securitylogs.Clear() $Systemlogs … Continue reading PowerShell: Clear Event logs from Windows machine
Perl: Package to work with ReviewBoard 2.0 APIs
Perl class to work with exported ReviewBoard2.0 APIs. Please use this package and post your comments. Code here: https://gist.github.com/1047290
PyRebootOps
Introduction Often in Windows systems we observe that move or delete operations can't be executed on a file if it's locked. Files can get locked if different processes start accessing it or if the file has already been loaded in RAM. Such problems can be resolved by scheduling file operations for the next system restart … Continue reading PyRebootOps