|
|
|
|
|
|
|
The guy was a French Revolutionary [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
Sign In·View Thread·PermaLink | |
|
|
|
|
|
|
If so he would not mention february either, but name all months differently, as in Pluviose, Ventose, Germinal, ...
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
|
Sign In·View Thread·PermaLink | |
|
|
|
|
|
|
That kind of people was so fascinating indeed...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
Sign In·View Thread·PermaLink | |
|
|
|
|
|
|
Liam O'Hagan wrote: and there was no October!
I don't know if you were teasing me that I left out 10/31 in my original post.
|
Sign In·View Thread·PermaLink | |
|
|
|
|
|
|
Liam O'Hagan wrote: The developer made a few assumptions, namely every month had 30 days, including February Every month has at least 28 days
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
Sign In·View Thread·PermaLink | |
|
|
|
|
|
|
Hi,
I've been involved in a web application that allows the user to download files stored in a database. Those files were added to the database through various sources: from scanner, from folders, and through my application which is a plugin into Office, so the users can save Office files directly from Outlook/Excel/Word. Getting an Office plugin to work correctly with various versions of Office is not for the faint hearted, I might even write an article about that one day. But that's not what this message is about.
We were having problems with certain files on certain computers at the client site: when they were downloaded - and the user selected to open the file instead of saving it to disk first - the application responsible for opening the file wasn't able to, and claimed that the file could not be found. And this only happened if the user was using IE, this was not a problem with Firefox. It seemed to mostly apply to .msg files, but there were reports that it also happened to other file types. When we finally found a development machine where we could reproduce the problem, I began by using Filemon[^] to monitor what happened when I tried downloading an .msg file, and if the file was indeed created or what was happening.
It turned out that Internet Explorer DID download the file, AND it did request that this file should be opened by the correct application (Outlook.exe), but just before the application would try to open the file, IE would simply delete the file! No wonder the application was having trouble with opening it. Then I tried using Regmon[^] to figure out if there was some security setting that was being read that controlled this behaviour, but I didn't find anything useful there.
I also found out that this wasn't a problem with other websites: I could download files from other websites I had access to (entirely different websites, written by other programmers using other languages), so that meant that the problem had to be with our code on the webserver. I remembered having seen a blog post about some HTTP traffic monitor tool on the IE website, so I downloaded Fiddler[^] and I used it to inspect the headers that were beint sent with the files.
At first, the biggest difference was that our web application wasn't setting the "content-length" header entry. Adding that didn't change anything though. But another thing was different: we were setting cacheability to "no-cache". And as it turned out, then removing this entry fixed the problem!
Apparently, IE would (under some circumstances, but not all) decide to delete the file when it detected that "no-cache" was specified in the headers, and even do so before the application in question would get a chance to open it.
I believe that this would qualify as a subtle bug, but I'm not sure if the real bug was in our code, or if it is in IE....
Regards, Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
Sign In·View Thread·PermaLink | 4.40/5 (2 votes) |
|
|
|
|
|
|
dabs wrote: believe that this would qualify as a subtle bug Same here. I'll keep note of this in case I run into it, too.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
Sign In·View Thread·PermaLink | |
|
|
|
|
|
|
|
|
|
Exactly
This didn't happen all the time though, I'm not sure what configuration of IE causes this problem. Most of our development machines never displayed this behaviour.
Regards, Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
Sign In·View Thread·PermaLink | |
|
|
|
|
|
|
|
|
|
You could try using the content-disposition header to set the filename. We had some similar problems and this seemed to resolve them.
Additionally, are the failing cases on Windows Vista/Ie7? I believe there are security features that prevent some downloaded files types from being opened in certain cases (think it's something to so with the user the isolation tricks IE7 uses).
|
Sign In·View Thread·PermaLink | |
|
|
|
|
|
|
C++ code (simplified), VS2005:
if (!DescribeFG(PARAM_1, &vVal;, iIndex ), iType) { DisplayError(); }
With following prototype
bool DescribeFG(int a, int *value, int index, int type=0);
I do not know how the if line was understood by the compiler, but no error, no warning. Maybe the , operator ?
Actually, I searched quite a while why my type was always 0 (original code is not that trivial)
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
Sign In·View Thread·PermaLink | 4.29/5 (3 votes) |
|
|
|
|
|
|
IMO there is no error, it looks like valid C++ code; it does demonstrate the "synergy of two language features" both deemed unnecessary in C#.
|
Sign In·View Thread·PermaLink | 4.20/5 (2 votes) |
|
|
|
|
|
|
If I recall correctly, the comma operator returns the last value in the list. int x = 1, 2, 3, 4, 5; will assign x the value 5.
-- Raaaaaaaaaaaaaaaaaaaaa!
|
Sign In·View Thread·PermaLink | 4.67/5 (3 votes) |
|
|
|
|
|
|
Check out this[^]. It gives an example below.
Basically, your method is called with three parameters (using the default for type). Then to evaluate the if-statement it would take the last "part". So if it was logically "!false, 1", then 1 would be evaluated as the condition for the if-statement.
Take care, Tom
----------------------------------------------- Check out my blog at http://tjoe.wordpress.com
|
Sign In·View Thread·PermaLink | |
|
|
|
|
|
|
Rage wrote: Maybe the , operator ?
Of course, with default parameter complicity.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
Sign In·View Thread·PermaLink | |
|
|
|
|
|
|
Following some links I arrived at this MSDN link[^] on exploring the singleton pattern. Now if you scroll to the example you see this code:
sealed class Singleton { private Singleton() {} public static readonly Singleton Instance = new Singleton(); }
There is a subtle bug in this implementation (besides that the constructor is private so the sealed keyword is not needed - but this is not a bug).
Quote from the article:
"The Framework, during the JIT process, will initialize the static property when (and only when) any method uses this static property. If the property is not used, then the instance is not created. More precisely, what happens during JIT is that the class gets constructed and loaded when any static member of the class is used by any caller." However a simple test reveals that this is not quite true:
public class Singleton { public static readonly Singleton Instance = new Singleton(); private Singleton() { Console.WriteLine("Singleton constructor..."); } public void Test() { Console.WriteLine("Singleton.Test()"); } } public static void Main() { Console.WriteLine("In Main..."); Singleton.Instance.Test(); Console.WriteLine("Exiting Main..."); }
The correct way to do is to mark the constructor as static. More discussions on this page[^].
|
Sign In·View Thread·PermaLink | 3.40/5 (5 votes) |
|
|
|
|
|
|
Subtle Bugs is a forum to post examples of interesting, aggravating and subtle bugs that you've found and fixed.
|
Sign In·View Thread·PermaLink | 1.64/5 (7 votes) |
|
|
|
|
|
|
|
|
|
|
|
|
I really don't understand why are you so offended by my post. It presents a bug and the solution, but if that offends anyone else I will delete my post. Thank you!
|
Sign In·View Thread·PermaLink | |
|
|
|
|
|
|
don't delete your post, but what's probably bugging him is that this forum is about "I ran into this really weird and unexpected bug in my code... To fix it I had to....", not "Hahaha X messed up in the example they put in their documentation".
The proper place to report problems with MS material is the MSDN feedback site.
http://connect.microsoft.com/VisualStudio/feedback[^]
Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop. -- Matthew Faithfull
|
Sign In·View Thread·PermaLink | 3.00/5 (2 votes) |
|
|
|
|
|
|
Exactly.
If you wrote a program based on this faulty information and it took a long time to finally realize that the problem was with the documentation and then went and found the correct way to write your program, then say that.
But you certainly didn't fix the documentation.
Plus, that article is more than five years and two (or more?) generations of the framework old, so take it with a grain of salt.
|
Sign In·View Thread·PermaLink | 3.00/5 (2 votes) |
|
|
|
|
|
|
And 'sealed' means that the class cannot be inherted/destroys the 'virtuality' of a member variable/method, it has nothing to do with ctor accessibility.
|
Sign In·View Thread·PermaLink | |
|
|
|
|