|
That allows you to specify "Manufactured for Company X by Company Y".
|
|
|
|
|
A guy that worked here for 7 months left for us a mvc application that only has 1 view model for 17 views.
Where do you think he put all the data? yes, on that view model.
That thing has properties that differ only by casing, only by swapping 'c' with 'ç', only by using accentuation (like 'Região' and 'Regiao') and by all of that('regiao', 'região', 'Regiao', 'Região').
All of those properties have a different meaning.
You're lucky that you only need to deal with low/upper case differences.
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
"Given the chance I'd rather work smart than work hard." - PHS241
"'Sophisticated platform' typically means 'I have no idea how it works.'"
|
|
|
|
|
Ho yeah! That's a better one hey!!
|
|
|
|
|
|
Sentenryu wrote: That thing has properties that differ only by casing, only by swapping 'c' with 'ç', only by using accentuation (latike 'Região' and 'Regiao') and by all of that('regiao', 'região', 'Regiao', 'Região'). Coool. What does "regiao" mean, anyway? A LOT of ?
Greetings - Jacek
|
|
|
|
|
Portuguese for region, but he also has properties for coffe, 5 different types of coffe. And some bird species. Sadly, no woody woodpecker
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
"Given the chance I'd rather work smart than work hard." - PHS241
"'Sophisticated platform' typically means 'I have no idea how it works.'"
|
|
|
|
|
Is there a single property for each actual type of coffee or each type of coffee has it's own set of properties (with various accentation variants, like Blackcoffee, blackçcoffee, Milkçoffee, milçcoffee, etc..)?
Greetings - Jacek
|
|
|
|
|
I could copy and paste the code and you wouldn't believe, you nailed it. Each type of coffe has it's own set of properties.
I'm very luck that i don't have to deal with that code... yet...
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
"Given the chance I'd rather work smart than work hard." - PHS241
"'Sophisticated platform' typically means 'I have no idea how it works.'"
|
|
|
|
|
Excuse me, but it is getting very interesting. Region + birds + coffee = . What kind of app would need all of those... tags [^]>? You are pulling my leg, don't you?
Greetings - Jacek
|
|
|
|
|
A *much* better version:
public class DesignRegistrationSearchCriteria
{
private string _Manufacturer;
private string _manufacturer
{
get { return _Manufacturer; }
set { _Manufacturer = value;
}
public string Manufacturer
{
get { return _Manufacturer; }
set { _Manufacturer = value; }
}
public string manufacturer
{
get { return _manufacturer; }
set { _manufacturer = value; }
}
}
|
|
|
|
|
public class TrafficLightsWentWrong
{
public string manufacturer
{
get { return Manufacturer; }
set { Manufacturer = value; }
}
public string Manufacturer
{
get { return _manufacturer; }
set { _manufacturer = value; }
}
public string _manufacturer
{
get
{
return manufacturer;
}
set { manufacturer = value; }
}
}
Greetings - Jacek
|
|
|
|
|
Compilation error on line 8. '}' expected.
brisingr_aerowing@Gryphon-PC $ rake in_the_dough
Raking in the dough
brisingr_aerowing@Gryphon-PC $ make lots_of_money
Making lots_of_money
|
|
|
|
|
Capital M is for days on which you are gonna be paid your slavery subsistence allowance (aka Salary). small m is at all other times.
|
|
|
|
|
OK, this is almost certainly my own damn fault, but I prefer to blame Microsoft.
I'm playing around with some of the new features of ASP.NET 4.5 on my local Win7/x64 box. One of the features I wanted to try was the build-in support for using the AntiXssEncoder[^] for any calls to HttpUtility.HtmlEncode[^]; this will replace my existing HttpEncoder class.
I updated the httpRuntime element in my web.config :
<httpRuntime encoderType="System.Web.Security.AntiXss.AntiXssEncoder, System.Web" />
and launched the test site.
Imagine my surprise when, instead of a nice web-page, I got a modal error dialog telling me that w3wp.exe has crashed in kernelbase.dll ! Trying to debug the error with Visual Studio produces, after ten minutes of downloading symbols, a great big pile of assembly code.
Eventually, after digging through the event log, I found the problem: the encoderType attribute needs to be set to System.Web.Security.AntiXss.AntiXssEncoder, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - obvious, really!
The event log entries:
- ASP.NET 4.0.30319.0 - Warning
Exception type: ConfigurationErrorsException
Exception message: Could not load file or assembly 'System.Web' or one of its dependencies. The system cannot find the file specified. - ASP.NET 4.0.30319.0 - Error
An unhandled exception occurred and the process was terminated. - Application Error - Error
Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7afa2
Faulting module name: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b8479b
Exception code: 0xe0434352
Fault offset: 0x0000000000009e5d
It seems that this error occurs at a point in the pipeline where ASP.NET can't recover, so it crashes the process instead. Which is good, in that it prevents the application from running in an unknown state. But it's also a pain in the arse to try to debug!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Oh yes, configuration is often a PITA. Why is just a <httpRuntime encoderType="System.Web.Security.AntiXss.AntiXssEncoder"/> not enough? OK, it could be in some obscurely named dll. But why then is it so absolutely necessary to insist in a particular version, culture, and even PublicKeyToken?
|
|
|
|
|
Bernhard Hiller wrote: But why then is it so absolutely necessary to insist in a particular version, culture, and even PublicKeyToken?
because the assembly is signed?
http://msdn.microsoft.com/en-us/library/wd40t7ad.aspx[^]
the runtime is just trying to ensure you load what you expect.
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
"Given the chance I'd rather work smart than work hard." - PHS241
"'Sophisticated platform' typically means 'I have no idea how it works.'"
|
|
|
|
|
I just spent nearly two days debugging an COM exe server using ATL and boost. There is a boost thread, acting as an asynchronous task manager that gets task queued which do callbacks into COM objects (into JScript objects).
The thread was hanging in join() , even though a breakpoint set at the end of the thread function was hit.
The code was written by a collegue, who is a god with boost, but rather new to ATL - and he hates it. Me in turn did not use a lot of boost (yet), but with COM/ATL I have quite some experience, and I like it. So first I suspected boost to be somehow buggy, although I could not really imagine that such a widely used thing like boost::thread would have such a serious bug or a somehow screwed functionality.
Here is (shortened) how the thread looks:
void operator()()
{
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
BOOST_SCOPE_EXIT_ALL(&) { CoUninitialize(); };
try {
} catch (boost::thread_interrupted &) {
ATLTRACE(L"Thread interrupted\n");
}
}
As I said: A breakpoint set at the last closing curly brace got hit, but the join() call from the main thread that triggered the thread interruption never finished.
After a while (quite a while!) of playing around, debugging (a release version btw, since the problem happened only in a release build) and staring at the code I noticed the neat little line near the top of the thread:
BOOST_SCOPE_EXIT_ALL(&) { CoUninitialize(); };
"Wait a sec! What's that?"
"BOOST_SCOPE_EXIT_ALL - Maybe this means, it executes some code when the current scope exits? Maybe CoUninitialize() ?. And doesn't CoUninitialize() block, when the current thread still holds some COM object references?"
So I started to dig into the code of the actual tasks that were executed here, and one of them in deed creates some objects. But since my colleague learned COM from me and I slap his fingers everytime I see a raw pointer somewhere, and also from what I found in the code there should not be a problem. The object was created nicely via
CComPtr<IDispatch> createJSObjectInstance()
{
CComPtr<IDispatchEx> creatorObject = threadMarshaller->get();
DISPPARAMS params = {0};
_variant_t result;
HRESULT hr = creatorObject->InvokeEx(DISPID_VALUE, LOCALE_USER_DEFAULT, DISPATCH_METHOD,
¶ms, result.GetAddress(), NULL, NULL);
return CComPtr<IDispatch>(static_cast<IDispatch*>(result));
}
"Safepointers everywhere, correct _variant_t handling, yada yada.. Looks good.."
Or not?
Well - looking at the implementation of _variant_t I found this:
inline _variant_t::operator IDispatch*() const
{
if (V_VT(this) == VT_DISPATCH) {
if (V_DISPATCH(this) != NULL) {
V_DISPATCH(this)->AddRef();
}
return V_DISPATCH(this);
}
_variant_t varDest;
varDest.ChangeType(VT_DISPATCH, this);
if (V_DISPATCH(&varDest) != NULL) {
V_DISPATCH(&varDest)->AddRef();
}
return V_DISPATCH(&varDest);
}
There are AddRef() calls! That would explain a lot!
And in deed: Changing the line
return CComPtr<IDispatch>(static_cast<IDispatch*>(result));
to
return CComPtr<IDispatch>(result.pdispVal);
fixed the problem.
My boss just said "Geez!"
Some coding guidelines forbid operator overloading. Google e.g. says: "Do not overload operators except in rare, special circumstances." Although they have other reasons I would say that such side effects is exactly what operators should not have. This is very bad design, and this one is clearly on MS.
However, my boss is smiling again and I had a more or less successful day.
Geez!
|
|
|
|
|
Interesting!!
|
|
|
|
|
I am new to C# and WPF. I have a legacy bag of C++ code and dialogs. C# has this neat facility called "HwndHost" that lets you put legacy, message pump driven, windows inside a border control. My dialog is successfully hosted and running. The XAML also has a button with an accelerator. In my native dialog if I have an edit box and I try to type the letter of the accelerator it causes the accelerator to fire and the letter to be stolen from the edit box that had the focus. I can't begin to know what the heck is wrong and I suspect it has to do with weird and not so wonderful way that events are handled.
My solution was to remove the accelerator or tell the user to paste in the letter 'o' when they needed it.
|
|
|
|
|
|
Thank you! That is indeed timely information.
|
|
|
|
|
You're very welcome. Did it provide a feasible solution?
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
As a matter of fact it did. I had to explicitly implement the OnMnemonic function to trap the accelerator and send it along as the character that it was supposed to be. Pretty clunky. I'm surprised that the interoperability is not better but I get that is what happens when HWND based dialogs are mixed with XAML based dialogs.
|
|
|
|
|
I thought I knew, but I was wrong.
double x0 = 1 / 0.0;
double x1 = 1 / -0.0;
double x2 = 1 / double.Parse("0.0");
double x3 = 1 / double.Parse("-0.0");
Obviously these are all going to be some sort of infinity (yes you can divide by zero[^], and the result is infinity). One might reasonably expect both x1 and x3 to be Negative Infinity .. however, only x1 is Negative Infinity. x3 is Positive Infinity, which is about as wrong as any answer could possibly be.
This implies that double.Parse blatantly ignores the sign of zero.
|
|
|
|
|
harold aptroot wrote: the sign of zero
Sounds like something Sherlock Holmes (or his smarter brother) would investigate.
|
|
|
|