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

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 […]
Δημοσίευση στην κατηγορία: , , , , , , , , , , ,
Gotcha: JS replace on document.location fails, use document location.href
20 Αυγούστου 14 03:17 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
This is my contribution to: http://stackoverflow.com/questions/2652816/what-is-the-difference-between-document-location-href-and-document-location Here is an example of the practical significance of the difference and how it can bite you if you don’t realize it (document.location being an object and document.location.href being a string): We use MonoX Social CMS (http://mono-software.com) free version at http://social.ClipFlair.net and we wanted to add the language bar […]
Δημοσίευση στην κατηγορία: , , , , , , , ,
Gotcha: System.IO.GetInvalidPathChars result not guaranteed
04 Απριλίου 14 12:54 πμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
at System.IO.Path.GetInvalidPathChars one reads: The array returned from this method is not guaranteed to contain the complete set of characters that are invalid in file and directory names note: can also call this method from non-trusted Silverlight app – not as Intellisense tooltip wrongly says in Visual Studio 2013 with Silverlight 5.1 I just found […]
Δημοσίευση στην κατηγορία: , , , , , , , , ,
HowTo: Remove invalid filename characters in .NET
12 Ιουλίου 13 11:28 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
In ClipFlair Studio I use DotNetZip (Ionic.Zip) library for storing components (like the activity and its nested child components) to ZIP archives (.clipflair or .clipflair.zip files). Inside the ZIP archive its child components have their own .clipflair.zip file and so on (so that you could even nest activities at any depth) which construct their filename […]
Δημοσίευση στην κατηγορία: , , , , , , , , , , , ,
Validating E-mails using Regular Expressions in Java
01 Ιουνίου 12 05:27 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
To sum up the discussion at http://stackoverflow.com/questions/1360113/is-java-regex-thread-safe/, you can reuse (keep in static variables) the compiled Pattern(s) and tell them to give you new Matchers when needed to validate those regex pattens against some string: import java.util.regex.Matcher; import java.util.regex.Pattern;  /** * Validation helpers */ public final class Validators {  private static final String EMAIL_PATTERN = [...]
Δημοσίευση στην κατηγορία: , , , , ,

Search

Go

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

Συνδρομές