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

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 […]
Δημοσίευση στην κατηγορία: , , , , , , , , , , ,
Python rstrip and whitespace
10 Ιουλίου 20 04:10 πμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
Was just reading https://www.w3schools.com/python/ref_string_rstrip.asp which says The rstrip() method removes any trailing characters (characters at the end a string), space is the default trailing character to remove. Notes: 1) the chars param was added at Python 2.2.3, can’t use it at older versions as noted at https://docs.python.org/2.6/library/string.html string.rstrip(s[, chars]) Return a copy of the string […]
HowTo: make raw_input & input work the same in both Python 2 and 3
10 Ιουλίου 20 04:00 πμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
Was just trying to make a Python 2 script work in Python 3 and at first it seemed I just needed a small change to add missing parentheses to the argument of a couple of print statements. But then another issue came up, it wasn’t understanding the command raw_input(somePrompt) that was occuring at various places […]
Δημοσίευση στην κατηγορία: , , , , , , , , , , ,
HowTo: Tell IE to use compatibility mode without editing your web pages
22 Αυγούστου 14 07:07 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
at http://www.mono-software.com/Mono/Pages/Discussion/dtopic/_YyUBIlx5kiqHaNqAQeltg/br-brake-bug-in-IE11-and-clipflair-text-editor/ one reads: We are using Telerik’s rich text editor (RadEditor), and it seems that RadEditor has specific behaviour regarding insertion of break tags. To circumvent this issue please try to add host header in ISS 7 (website level): Name = "X-UA-Compatible" Value = "IE=EmulateIE10" Or, you can insert Html Meta tag on a […]
Δημοσίευση στην κατηγορία: , , , , , , , , , , , ,
Gotcha: Java Calendar class returns 0-based month, but 1-based days
18 Ιουλίου 13 02:02 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
Just noticed that the Java Calendar class breaks the least-user-expected rule (that is don’t make something behave in the least expected way) regarding the indexing of the month value it returns, compared to all other indexed variables it can return (like day of year, day of month, day of week etc.). The former is using […]
Δημοσίευση στην κατηγορία: , , , , , , , , ,
Single statement ScaleTransform initialization in both WPF and SL
11 Αυγούστου 12 06:32 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
With Silverlight using a cut-down .NET API, some decisions have been at least ackward, causing Silverlight code to be sometimes unnecesserily more complex than its WPF counterpart and WPF code needing several changes to get ported for Silverlight. In ClipFlair I’ve implemented a WPFCompatibility layer to ease compiling WPF code for Silverlight (and vice-versa too) [...]
Δημοσίευση στην κατηγορία: , , , , , , ,
How to compile code that uses WPF Decorator type in Silverlight
04 Ιουλίου 12 09:57 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
At ClipFlair I’m using a modified version of FloatingWindow control, where I try to make the WPF and Silverlight flavours of the original control share as much code as possible (this is work in progress currently, hoping to eventually have the WPF and Silverlight projects both link to the same source files [this is currently [...]
Δημοσίευση στην κατηγορία: , , , , , , , , ,
Zoom and Pan control for WPF and Silverlight (via WPF compatibility layer)
18 Ιουνίου 12 08:50 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
I’ve managed to combine http://www.codeproject.com/Articles/85603/A-WPF-custom-control-for-zooming-and-panning and a cut-down version of it for Silverlight that was out there: http://www.codeproject.com/Articles/167453/A-Silverlight-custom-control-for-zooming-and-panni I did it in a way that the Silverlight version is source-code compatible with the WPF version (via a WPF compatibility layer that even implements value coercion), so that both the WPF and the Silverlight projects share [...]
Δημοσίευση στην κατηγορία: , , , , , ,
IsolatedStorageSettings for WPF
18 Ιουνίου 12 04:01 πμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
System.IO.IsolatedStorageSettings doesn’t exist in WPF (only in Silverlight) but can easily be ported from Mono project’s Moonlight implementation (the Moonlight project home is at http://www.mono-project.com/Moonlight), as suggested at: http://groups.google.com/group/wpf-disciples/browse_thread/thread/4ed6c009f3fb7d69 I found that implementation at the following URL: http://vega.frugalware.org/tmpgit/moon/class/System.Windows/System.IO.IsolatedStorage/IsolatedStorageSettings.cs Did some modifications to IsolatedStorageSettings.cs to make it work with WPF (whether the application is deployed via [...]
Δημοσίευση στην κατηγορία: , , , , , , ,
Running E-Slate (Αβάκιο) on Windows 7 and Vista
02 Μαρτίου 11 05:22 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
For those who wonder what E-Slate is, it’s a componentized authoring environment for the creation of (interactive) educational microworlds, see my previous post for more info. As I mentioned at that post, the latest official version (ignoring any unofficial / experimental versions that you might find around at some educational research labs’ websites) doesn’t work [...]
Δημοσίευση στην κατηγορία: , , , , , , ,

Search

Go

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

Συνδρομές