How to Map Two Tables To One Class in Fluent NHibernate?

Programming: What bugs have you had that took a long time to solve and were solved in just one or two keystrokes?

  • I've had two epic several-hour debug sessions to find a particular bug and solve it with just one or two keystrokes.  The first was in a C++ texture packing program about a decade ago where I was attempting to add some spacing between textures to prevent texture bleed.  I wrote this gem: x =+ 4;   // gutter space between textures It literally took me an hour of looking at this line, debugging, tracing et al to work out that instead of adding 4 pixels to the current x position, I was resetting it to +4. The second prompted this question.  I spent an hour debugging, stepping through and working out out why calls to getChildren end in a crash: class ANode {    std::map<uint8_t, ANode*> children;    const std::map<uint8_t, ANode*> getChildren() { return children; } }; The missing '&' before getChildren means a const copy of the list of children is created and returned, rather than just a const reference.  An hour. But these don't seem that interesting.  I bet there are more interesting ones out there..?

  • Answer:

    I once worked for a week on a bug and fixed it by removing a single line of code.

Paul Tomblin at Quora Visit the source

Was this solution helpful to you?

Other answers

The assignment was due next morning and due to my habit of procastination I started to work on it a day before. By evening I was done with the code and compilation of code was next. After compiling it reported segmentation fault. Generally I don't declare the variables as I use them and instead wait for the compiler to point it out. This also increased my effort. Then I exhausted all break points and found out that this was due to a silly mistake. Somewhere I used 'l' instead of '1' or vice versa. I almost spent 3-4 hours for this carelessness.

Nabh Choudhary

Date-time issue due to server's culture. I was facing some unbelievable results and after wasting more no of hours suddenly i found the solution... :) :(

Harsh Patel

I've had several JavaScript bugs caused by an extra comma.

Ken Fishkin

We were working on FX system for a French bank. The Front end was designed in C# and used multi-threading extensively for refreshing screens that displayed pricing info . A base class being used to fork a thread was using default thread locale. The code was deployed to server located in Paris for UAT. All trades initiated from london/Honkong/Singapore threw exception and exception messages were not very helpful (owing it the decision to use minimum diagnostic code to ensure speed). It took 3 days of non-stop debugging/guessing by entire team to figure that that Paris server was using "fr-FR" and all other tester/dev machines were using "en-US" locale.There were some characters that formed part of the Bid/offer quote that Paris server was not able to parse as it was using different locale. There are situations where you can't afford to look stupid but in this situation we all looked complete idiots. We never recovered for this loss of reputation.

Anonymous

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.