Παρουσίαση με Ετικέτες

HowTo: Extract numeric suffix from a string in Python
24 Αυγούστου 20 11:15 πμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
I recently needed to extract a numeric suffix from a string value in Python. Initially I did the following: import re def extractNumSuffix(value):     return (None if (search:=re.search(‘^\D*(\d+)$’, value, re.IGNORECASE)) is None else search.group(1)) Note that return has a single-line expression. So print(extractNumSuffix("test1030")) prints 1030 Tried it online at: https://repl.it/languages/python3 However, then I found out […]
Δημοσίευση στην κατηγορία: , , , , , , , , , , ,
HowTo: round a number up to N decimal digits in Javascript
17 Ιουνίου 19 05:21 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
Was just trying to round-off some Google Maps coordinates for display in Javascript up to 3 decimal digits and that was a bit like a blast from the past (the end of the ‘90s to be more accurate)… So here’s my contributed answer at: https://stackoverflow.com/questions/2221167/javascript-formatting-a-rounded-number-to-n-decimals This works for rounding to N digits (if you just […]
Δημοσίευση στην κατηγορία: , , , , , , , , , , , , ,
Prime links
08 Ιουλίου 11 05:48 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
http://io9.com/5819325/the-bizarre-mathematical-conundrum-of-ulams-spiral http://scienceblogs.com/goodmath/2010/06/the_surprises_never_eend_the_u.php http://img529.imageshack.us/img529/615/ulam3.png http://imprompt.us/2010/ulam-spiral-take-2/ http://home.manhattan.edu/~peter.boothe/ulam.pdf http://mathworld.wolfram.com/PrimeSpiral.html http://blog.morphism.com/2010/05/building-numbers.html http://blog.morphism.com/2010/07/pdfs-from-building-numbers.html http://math.ucr.edu/home/baez/roots/ http://math.ucr.edu/home/baez/roots/polynomialrootssmall.png http://incubator.quasimondo.com/flash/wheel_of_primes.php http://incubator.quasimondo.com/flash/Primeverse_1024.html http://rob.tarrfamily.com/share/Triangle.gif http://www.numberspiral.com/ http://www.numberspiral.com/p/p006.html http://www.numberspiral.com/p/common_diff.html http://punarvak.blogspot.com/2010/07/ulam-spirals-and-its-variants.html http://oeis.org/A113688   btw, via the last link I came across to the very interesting “On-Line Encyclopedia of Integer Sequences” http://oeis.org/Seis.html (a service of http://oeisf.org/). Their search facility allows you to enter a series of numbers separated by space [...]
Δημοσίευση στην κατηγορία: , , , ,

Search

Go

Ιστορικό Δημοσιεύσεων

Συνδρομές