Καλώς ορίσατε στο dotNETZone.gr - Σύνδεση | Εγγραφή | Βοήθεια
σε

 

Αρχική σελίδα Ιστολόγια Συζητήσεις Εκθέσεις Φωτογραφιών Αρχειοθήκες

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

Όλες οι Ετικέτε... » Gotcha » Posts   (RSS)
  • Gotcha: VBScript DropHandler doesn’t support Unicode filenames

    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 ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Σεπτεμβρίου 9, 2018
  • Gotcha: use parentheses around ternary op conditional expressions

    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? ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Αυγούστου 25, 2018
  • Gotcha: Calling a label in a batch file fails to redirect output to pathless file

    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 […]
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Μαΐου 24, 2016
  • Gotcha: WPF UserControl SizeChanged event not firing at resizing

    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 […]
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Νοεμβρίου 28, 2015
  • Gotcha: MarkerReached event of MediaElement returns new Markers

    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 ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Μαρτίου 20, 2015
  • Gotcha: Worksheets property is read-only, Sheets is not – Excel Workbook

    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. ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Ιανουαρίου 26, 2015
  • Gotcha: MediaElement Source=null releases stream, SetSource(null) fails

    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 ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Δεκεμβρίου 12, 2014
  • Gotcha: MediaElement must be in visual tree for MediaOpened, MediaEnded to be fired

    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 […]
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Νοεμβρίου 18, 2014
  • Gotcha: MediaElement AutoPlay faster than doing Play at MediaOpened

    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, ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Νοεμβρίου 18, 2014
  • Gotcha: JS replace on document.location fails, use document location.href

    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 ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Αυγούστου 20, 2014
  • Gotcha: don’t use ‘{$…}’ syntax or ‘$…’ syntax in XSL-XPath’s concat

    <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 ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Αυγούστου 15, 2014
  • Gotcha: no prefix increment/decrement VB.net operators, but get parsed

    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 ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Αυγούστου 9, 2014
  • Gotcha: System.IO.GetInvalidPathChars result not guaranteed

    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 ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Απριλίου 4, 2014
  • Gotcha: OnLostMouseCapture always called by CaptureMouse at WPF

    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 ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Μαρτίου 14, 2014
  • Gotcha: .NET Point and PointConverter inconsistency in string format used

    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 ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Νοεμβρίου 22, 2013
  • Gotcha: must set document.location.hash only at end of page in Mozilla

    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 […]
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Σεπτεμβρίου 7, 2013
  • Gotcha: use server-side comment, not HTML comment in ASP.net

    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 […]
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Ιουλίου 29, 2013
  • Gotcha: Java Calendar class returns 0-based month, but 1-based days

    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 […]
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Ιουλίου 18, 2013
  • Gotcha: var x = x() in Javascript gives “Object Expected” error

    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 […]
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Ιουνίου 14, 2013
  • Gotcha: Image component not loading remote URLs during debugging

    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"        ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Δεκεμβρίου 18, 2012
  • Can’t step-through Silverlight file dialogs with Visual Studio debugger

    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()” ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Δεκεμβρίου 2, 2012
  • HowTo: Clear contents of Silverlight’s RichTextBox control

    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 ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Νοεμβρίου 23, 2012
  • Gotcha: Silverlight DependencyProperty metadata: 0d not 0 for double

    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. /// ...
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Αυγούστου 9, 2012
  • Gotcha: Silverlight’s Uri class constructor eats up part after last slash

    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 [...]
    Δημοσιεύτηκε στο George Birbilis' blog (Weblog) από το μέλος birbilis στις Ιουλίου 22, 2012
Με χρήση του Community Server (Commercial Edition), από την Telligent Systems