10 Reusable Code Snippet Topics
Remove Filter
|
|
This snippet defines a function returning new identifiers created from reading the computer's time. |
|
This is just for fun. You know how old you are(I hope), but do you know how many days you are walking around on this planet? The two routines presented here could be used more practically in an ever present employee application. |
|
With the advent of Python33 the module time has received a high resolution timer/counter. Here we use time.perf_counter() in a decorator to conveniently time two test functions. |
|
Starting with Python 3.3 you now have access to a high resolution time counter (nanoseconds and better). |
|
//$time in the second php code hold the time stored in the database in the same format as above(ie TIMESTAMP Format) //Save the first php code as timeago.php //include first php code u saved in the second php code as i have done.. //Use the Second Php code Wherever You … |
|
Just a quick snippet for beginners |
|
Is it Mother Date and Father Time? Any way, getting all the different date and time displays working can be imperturbably perplexing at times. You take a look at it in this Windows Console Application. |
|
The code demonstrates running program limitted time by following going over endtime expressed in seconds since midnight, so might fail for playing just midnight (add check that endtime is less than 24*60*60 if you want to be sure). Exciting action :) of the program is that it shows remaining time … |
|
Here tool functions, which came up during discussions earlier. Expanded slightly, added elimination of traceback prints by try..except. Added dd.mm.yy routine as that is format in my home country Finland. Optimized docstring beginnings to be informative in editor tooltip (at least IDLE shows, but code must be run or imported … |
|
|
The user enters the full location of a file and the program determines whether the file is a sound file or an application and opens it after a user specified time. Example: Location: C:\Where ever\file.mp3 OR C:\Another Where Ever\prog.exe TIme(in mins): 10 |
The End.