What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-09-13 20:49:03
php sprintf
There are already some comments on using sprintf to force leading leading zeros but the examples only include integers. I needed leading zeros on floating point numbers and was surprised that it didn't work as expected. Example: <?php sprintf('%02d',... Add solution -
Other 2021-09-12 12:50:02
uva 10570
#include <iostream> #include <cmath> #include <cstdlib> #include <set> #include <cstdio># Include <cstring>using namespace std;typedef long long ll;const int INF = 0x3f3f3f3f;const int MAXN = + 5;int a[ MAXN], b[maxn... Add solution -
Shell/Bash 2021-09-10 21:18:02
shell script current time
#!/bin/bash now="$(date)" printf "Current date and time %s\n" "$now" now="$(date +'%d/%m/%Y')" printf "Current date in dd/mm/yyyy format %s\n" "$now" echo "Starting backup at $... Add solution -
Shell/Bash 2021-09-07 01:40:04
rename all files in a folder with progressive numbers linux
for i in *.txt; do new=$(printf "%01d.txt" "$a") mv -i -- "$i" "$new" let a=a+1 done # "%01d.txt" 01 is the number of digits you want your name to be composed of, # Example: %01.txt --> 1.txt , 2.tx... Add solution
Best helpers
Christie
+5
Don Yarber
+5
Mike
+5
Jack Steele
+5
Bossylobster
+5
Tjb1982
+5
Alana
+5
Mythio
+5
Rane Chetan
+5
Androider
+5
Ms.Zizmor
+5
Joshua Burns
+5
Sea shell
+5
Zolani13
+5
Meldie Ching
+5
Nancye S....
+5
Oritatami
+5
FirstLegion
+5