George Birbilis' blog
...discussing pretty much everything
Παρουσίαση με Ετικέτες
Όλες οι Ετικέτε...
»
Gotcha
(RSS)
.NET
Anchor
API
Arguments
ASP.net
Audio
AutoPlay
Batch
BeforeUnload
Binding
Bookmark
Bugs
C#
Calendar
Capture
Characters
Cleanup
ClipFlair
Closing
Color
Comments
Compatibility
Conditional
Confirmation
Conversion
Date
Day
Debug
Defer
DependencyProperty
Dialogs
DOM
DragDrop
DropHandler
Events
Excel
Execution
Expression
Expressions
Fail
Filename
Filenames
Filesystem
Firefox
Hash
HowTo
HTML
HtmlBridge
IE
Image
Inconsistency
Increment
Index
Inline
Invalid
IsMoveToPointEnabled
Java
Javascript
Media
MediaElement
MediaOpened
Operators
Player
Posts
RegEx
Replace
Scripts
Security
Sheets
Silverlight
Slider
Smart Classroom
Source
Speadsheet
Speed
Standards
String
StringConcatenation
Syntax
Ternary
Timeline
TimelineMediaMarker
Tracking
trafilm
Transforms
UI
Unicode
Uri
URL
UserControl
VBScript
Windows
Workaround
Workarround
Worksheets
WPF
XAML
XAMLParseException
XPath
XSL
Gotcha: VBScript DropHandler doesn’t support Unicode filenames
09 Σεπτεμβρίου 18 12:33 πμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
It seems VBScript (.vbs) script file’s DropHandler on Windows is broken regarding Unicode filenames, as described at https://stackoverflow.com/a/4366906/903783 A workaround suggested by user DG there (https://stackoverflow.com/a/13587850/903783) was to use a batch file to accept the dropped file, then pass the filename(s) to the VBScript script file (.vbs) as command-line parameters. If you just care about […]
Gotcha: use parentheses around ternary op conditional expressions
25 Αυγούστου 18 03:42 μμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
Just came across the following case in C# that puzzled me momentarily, especially since the strings involved were long enough and the expression was broken on multiple lines: bool flag = true; string test1 = flag? "xa" : "xb"; string test2 = "x" + (flag? "a" : "b"); string test3 = "x" + flag? "a" […]
Gotcha: Calling a label in a batch file fails to redirect output to pathless file
24 Μαΐου 16 07:06 μμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
In case this bites you too with a "Path not found" error, note that calling a label in a batch file, fails if you redirect its output (useful to log the output of the batch file to a file) and not use a full path for the file to redirect to @echo off call :process […]
Gotcha: WPF UserControl SizeChanged event not firing at resizing
28 Νοεμβρίου 15 04:15 μμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
Useful to know: If you set the Width and Height on the UserControl though, you have set a fixed size and thus even if its parent tool window changes size, the UserControl never will. You should not set Width and Height on the UserControl if you want that event to be raised as the parent […]
Gotcha: MarkerReached event of MediaElement returns new Markers
20 Μαρτίου 15 08:50 μμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
I just checked in the implementation code for a new feature for ClipFlair Studio’s Captions/Revoicing component: When playing back recorded (or loaded from a WAV or MP3 file) audio for a caption/revoicing entry, the playback is now limited to the duration of the respective caption, (End-Start) time that is (btw that component has a duration […]
Gotcha: Worksheets property is read-only, Sheets is not – Excel Workbook
26 Ιανουαρίου 15 07:27 μμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
My contribution to: http://stackoverflow.com/questions/14109102/how-do-i-add-a-worksheet-after-all-existing-excel-worksheets Seems Worksheets property is read-only Returns a Sheets collection that represents all the worksheets in the specified workbook. Read-only Sheets object. https://msdn.microsoft.com/en-us/library/office/ff835542(v=office.15).aspx whereas Sheets is the real thing where you can also add Sheets dynamically A collection of all the sheets in the specified or active workbook. https://msdn.microsoft.com/en-us/library/office/ff193217(v=office.15).aspx Tagged: API, […]
Gotcha: MediaElement Source=null releases stream, SetSource(null) fails
12 Δεκεμβρίου 14 05:32 πμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
This is my contribution to: http://stackoverflow.com/questions/19294258/forcing-mediaelement-to-release-stream-after-playback/27436323 If you use MediaElement, make sure you don’t get bitten by this one: http://msdn.microsoft.com/en-us/library/cc626563(v=vs.95).aspx ArgumentNullException – The mediaStreamSource is null. … After calling this method, MediaElement.Source returns null. If this is called and MediaElement.Source is set, the last operation wins. If a MediaElement is removed from the UI tree […]
Gotcha: MediaElement must be in visual tree for MediaOpened, MediaEnded to be fired
18 Νοεμβρίου 14 04:18 μμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
At ClipFlair’s AudioRecorderControl (used in Captions/Revoicing component of ClipFlair Studio), I use the following code to initialize a MediaElement to use for playback. After a long time a found out that if the MediaElement is not in the visual tree (for example defined in XAML, or defined in code and then added to the visual […]
Gotcha: MediaElement AutoPlay faster than doing Play at MediaOpened
18 Νοεμβρίου 14 02:27 μμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
Just added the following comment to: https://github.com/loarabia/ManagedMediaHelpers/issues/15 Managed Media Helpers contains the very useful Mp3MediaSource class for .NET / Silverlight / Windows Phone. Added compile-time SWITCHES and respective code to Silverlight demo code for PRELOAD (into memory stream) and AUTOPLAY (this was a bit tricky, need to call Play at MediaOpened event, not right after […]
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: don’t use ‘{$…}’ syntax or ‘$…’ syntax in XSL-XPath’s concat
15 Αυγούστου 14 11:57 μμ
|
Μπιρμπίλης Γεώργιος
|
1 σχόλια
<xsl:template match="cxml:Item" mode="col"> <xsl:variable name="FILENAME" select="…someXPathQuery…"/> <xsl:variable name="IMAGE" select="concat(‘http://gallery.clipflair.net/activity/image/’, $FILENAME, ‘.png’)"/> … I got confused a bit today after a long day of fiddling with XSL and ClipFlair Activity Gallery’s CXML (Collection XML) data (as used in PivotViewer control), and didn’t understand why I couldn’t use an XSL variable’s (FILENAME in the sample […]
Gotcha: no prefix increment/decrement VB.net operators, but get parsed
09 Αυγούστου 14 03:39 πμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
In C/C++ and C# one has useful prefix (++index) and postfix (index++) increment operators and corresponding decrement ones. Although they have a single operant, they’re not working like functions as single + or – prefix would do, but instead they cause side-effects – they edit the variable passed to them. The prefix increment operator first […]
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 […]
Gotcha: OnLostMouseCapture always called by CaptureMouse at WPF
14 Μαρτίου 14 12:08 πμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
It seems that CaptureMouse is behaving differently in WPF and Silverlight, in that in the former one it immediately calls OnLostMouseCapture at a Visual, whereas in Silverlight it doesn’t get called if the element didn’t have the mouse capture already (btw, in Silverlight that method is at a UIElement – there is no Visual ancestor […]
Gotcha: .NET Point and PointConverter inconsistency in string format used
22 Νοεμβρίου 13 01:47 μμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
I have submitted the following issue to Microsoft Connect (product feedback center): http://connect.microsoft.com/VisualStudio/feedback/details/809084/point-class-issue-with-two-way-databinding Point class issue with two-way databinding In Silverlight, when using databinding code like the following: <StackPanel Orientation="Vertical" Name="propPosition"> <sdk:Label Style="{StaticResource PropertyLabelStyle}" Content="Position:" Target="{Binding ElementName=edPosition}" /> <TextBox Name="edPosition" Text="{Binding Position, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=true}" /> </StackPanel> and binding (via DataContext) to […]
Gotcha: must set document.location.hash only at end of page in Mozilla
07 Σεπτεμβρίου 13 11:35 μμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
I just came across a different behaviour between IE and Mozilla Firefox: scripts at the former seem to execute after the page has fully rendered, while the later they seem to execute when they’re met by the page parser or something like that. The HTML script tag has a defer attribute for running scripts after […]
Gotcha: use server-side comment, not HTML comment in ASP.net
29 Ιουλίου 13 01:15 πμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
I try to remember to use <%– and –%> instead of <!– and –> for comments in server-side web pages, to avoid having implementation details (for security reasons that is) in the output HTML and to keep the download size smaller / have the pages load faster. What came to me though the other day […]
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 […]
Gotcha: var x = x() in Javascript gives “Object Expected” error
14 Ιουνίου 13 12:27 μμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
At ClipFlair Studio (a Silverlight app), I had some time ago implemented a confirmation warning upon user trying to close the webpage (when it was running inside the web browser), which then had stopped functioning. It seems at some refactoring I had added code like the following: var activityView = activityView(); and it was failing […]
Gotcha: Image component not loading remote URLs during debugging
18 Δεκεμβρίου 12 01:13 πμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
At ClipFlair’s Image component I use the following XAML to make it show an image from a URL that its ViewModel holds at a property named “Source”, of type Uri (URI = Uniform or Universal Resource Identifier in W3C parlance, something like a superset of the old classic URLs). <Image Name="imgContent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" [...]
Can’t step-through Silverlight file dialogs with Visual Studio debugger
02 Δεκεμβρίου 12 08:58 μμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
While stepping through “ShowDialog()” method of OpenFileDialog with Visual Studio 2010 debugger, at the Silverlight code pictured below (for loading a ClipFlair window’s stored options), I got a “Dialogs must be user-initiated” exception. Same behaviour will be shown with SaveFileDialog too, every time you try to step through the “ShowDialog()” method. This is because of [...]
HowTo: Clear contents of Silverlight’s RichTextBox control
23 Νοεμβρίου 12 12:12 πμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
Was just debugging an issue with loading of saved state at ClipFlair’s Text component, when I realized that Silverlight’s (and WPF’s) RichTextBox control doesn’t accept an empty string at its Xaml proprerty to clear its contents as one would expect. Instead clearing the contents of the RichTextBox requires a call to Blocks.Clear(). In ClipFlair’s case, [...]
Gotcha: Silverlight DependencyProperty metadata: 0d not 0 for double
09 Αυγούστου 12 11:38 μμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
Just came accross a runtime error message that troubled me a bit to resolve while adding Prezi-like content scaling functionality in ClipFlair‘s FloatingWindowHostZUI (ZUI = Zoomable User Interface) container. I had added the following: /// Identifies the <see cref="FloatingWindow.Scale" /> dependency property. /// </summary> /// <value> /// The identifier for the <see cref="FloatingWindow.Scale" /> dependency [...]
Gotcha: Silverlight’s Uri class constructor eats up part after last slash
22 Ιουλίου 12 10:54 μμ
|
Μπιρμπίλης Γεώργιος
|
0 σχόλια
Via trial and error, I recently found out that when creating a Uri combining another Uri and a suffix part (tried at Silverlight, but I guess it’s a .NET issue in general), it eats up the last part of the (first) Uri if it doesn’t end with "/". That is, if you combine http://test.com/a with [...]
Search
Go
Το Ιστολόγιο
Αρχική Σελίδα
Επικοινωνία
Ετικέτες
.NET
ASP.net
Audio
Automation
Binding
Browser
Bugs
C#
Class
ClipFlair
Compatibility
Compression
Computers
Computers and Internet
Configuration
Controls
CSS
Database
Downloads
Ecology
Education
Errors
E-Slate
Events
Extensions
Fail
Filesystem
Filters
Firefox
Fix
Free
Games
Google
Gotcha
Hash
HowTo
HTML
HTTP
IE
IE9
IIS
Installation
Installers
Javascript
Kinect
Law
Layout
Links
Maps
Media
MediaElement
Methods
Microsoft
MMPPF
Mouse
None
Operators
Plugins
Posts
Programming
Prometheus
Properties
Python
RegEx
Security
Sharing
Silverlight
Smart Classroom
SMF
Source
String
Suggestion
Suggestions
Syntax
Text
trafilm
Transforms
Troubleshooting
Twitter
UI
Updates
URL
Usability
Video
Visual Studio
Visualization
VisualStudio
Windows
Windows 10
Windows 7
Word
WordPress
Workarround
WPF
XAML
XML
YouTube
ZIP
ZUI
Αταξινόμητα
Πλοήγηση
Αρχική σελίδα
Ιστολόγια
Συζητήσεις
Εκθέσεις Φωτογραφιών
Αρχειοθήκες
Ιστορικό Δημοσιεύσεων
Ιούνιος 2021 (1)
Απρίλιος 2021 (1)
Φεβρουάριος 2021 (2)
Ιανουάριος 2021 (2)
Αύγουστος 2020 (3)
Ιούλιος 2020 (2)
Απρίλιος 2020 (2)
Μάρτιος 2020 (3)
Φεβρουάριος 2020 (2)
Δεκέμβριος 2019 (1)
Νοέμβριος 2019 (1)
Οκτώβριος 2019 (2)
Αύγουστος 2019 (1)
Ιούνιος 2019 (2)
Απρίλιος 2019 (3)
Ιανουάριος 2019 (1)
Νοέμβριος 2018 (4)
Οκτώβριος 2018 (4)
Σεπτέμβριος 2018 (2)
Αύγουστος 2018 (2)
Ιούνιος 2018 (3)
Μάρτιος 2018 (2)
Φεβρουάριος 2018 (1)
Νοέμβριος 2017 (4)
Ιούνιος 2017 (1)
Απρίλιος 2017 (1)
Μάρτιος 2017 (1)
Μάιος 2016 (5)
Ιανουάριος 2016 (1)
Δεκέμβριος 2015 (7)
Νοέμβριος 2015 (12)
Οκτώβριος 2015 (2)
Σεπτέμβριος 2015 (3)
Αύγουστος 2015 (9)
Ιούλιος 2015 (1)
Ιούνιος 2015 (3)
Μάιος 2015 (1)
Απρίλιος 2015 (2)
Μάρτιος 2015 (2)
Φεβρουάριος 2015 (1)
Ιανουάριος 2015 (2)
Δεκέμβριος 2014 (3)
Νοέμβριος 2014 (3)
Οκτώβριος 2014 (1)
Σεπτέμβριος 2014 (2)
Αύγουστος 2014 (6)
Ιούλιος 2014 (1)
Μάιος 2014 (1)
Απρίλιος 2014 (2)
Μάρτιος 2014 (3)
Φεβρουάριος 2014 (2)
Δεκέμβριος 2013 (2)
Νοέμβριος 2013 (2)
Σεπτέμβριος 2013 (2)
Αύγουστος 2013 (3)
Ιούλιος 2013 (5)
Ιούνιος 2013 (2)
Μάιος 2013 (3)
Απρίλιος 2013 (2)
Μάρτιος 2013 (2)
Φεβρουάριος 2013 (4)
Δεκέμβριος 2012 (6)
Νοέμβριος 2012 (11)
Οκτώβριος 2012 (5)
Σεπτέμβριος 2012 (2)
Αύγουστος 2012 (9)
Ιούλιος 2012 (11)
Ιούνιος 2012 (8)
Μάιος 2012 (2)
Απρίλιος 2012 (2)
Φεβρουάριος 2012 (5)
Ιανουάριος 2012 (5)
Δεκέμβριος 2011 (8)
Νοέμβριος 2011 (3)
Οκτώβριος 2011 (4)
Σεπτέμβριος 2011 (8)
Ιούλιος 2011 (3)
Ιούνιος 2011 (2)
Μάιος 2011 (2)
Μάρτιος 2011 (4)
Φεβρουάριος 2011 (8)
Ιανουάριος 2011 (2)
Δεκέμβριος 2010 (1)
Νοέμβριος 2010 (3)
Οκτώβριος 2010 (12)
Σεπτέμβριος 2010 (2)
Αύγουστος 2010 (2)
Ιούλιος 2010 (9)
Ιούνιος 2010 (3)
Μάιος 2010 (11)
Απρίλιος 2010 (15)
Μάρτιος 2010 (13)
Φεβρουάριος 2010 (15)
Ιανουάριος 2010 (4)
Δεκέμβριος 2009 (3)
Νοέμβριος 2009 (15)
Οκτώβριος 2009 (26)
Σεπτέμβριος 2009 (13)
Αύγουστος 2009 (8)
Ιούλιος 2009 (8)
Ιούνιος 2009 (4)
Μάιος 2009 (4)
Απρίλιος 2009 (7)
Μάρτιος 2009 (8)
Φεβρουάριος 2009 (8)
Ιανουάριος 2009 (3)
Δεκέμβριος 2008 (31)
Νοέμβριος 2008 (24)
Οκτώβριος 2008 (1)
Μάιος 2008 (2)
Αύγουστος 2007 (1)
Νοέμβριος 2006 (1)
Σεπτέμβριος 2006 (1)
Συνδρομές
RSS 2.0
Atom 0.3