If you’re working with a laptop and you’re used to have a second monitor attached, you might tend to place some apps/windows on the secondary screen.
Once in a while you might start your laptop without having this handy little second monitor (for e.g. on the road :)) while traveling). Some apps tend to popup on the screen they were last used – and this is according to Murphy’s Law always the second monitor which is right now neither available nor connected.
So in order to access the app, you can do the following little trick:
- start the app (which is being displayed on the “wrong” display)
- click on the context-menu of the app in the taskbar and select “move”
- even though you don’t see the mouse-pointer/cursor move the mouse towards your primary display (if the second monitor is to the right of your laptop, the you might want to move left 🙂 ).
- you should see your app moving into sight!
Sometimes you just need a slow query to simulated a real big load of data being processed by the SQL-Server. You could either fill-up you database with a whole shit-load of data, or you use
WaitFor Delay instead:
WaitFor Delay '00:00:10'
Will pause the execution of the SQL-statement for 10 seconds – well, isn’t that sweet.
I thought – hey, let’s use the WindsorContainer deal with all my dependencies, that exist in my presenter-class. So I don’t have to worry about all the kinds of repositories and other stuff I might need. So I added my presenter:
But when I accessed my presenter from a ASP.Net webpart, registered some eventhandler on the presenter, which pointed back to the WebPart:
public class MyWebPart : WebPart
protected override void CreateChildControls()
var presenter = Container.Instance.Resolve<SelectionPresenter>();
presenter.OnItemSelected += HandleOnItemSelected;
Then I raised the event (in a postback!!) which sould be handled within the WebPart – boom!
NullReferenceException while accessing the WebPart from the presenter!
After an enourmous amount of time I finally figured it out … the default behavior of the WindsorContainer is to provide singleton instances of objects. So in my case the presenter is being created the first time the WebPart is executed, and when the postback occurs the same instance of the presenter is being returned – this is wrong!
OK, so changing the component-registration did take care of this problem:
So after getting my latest project up and running I wanted to look behind the scenes, and to do so I took a deep look into the sql-statement which are being executed against the database – yes I know, this might seem a little geeky.
So I figured, that I have two objects
B which have a one-to-one association. And since I declared
B to be lazy loaded from
A I expected only to hit the ‘A’-table when fetching all ‘A’s from the DB. But I was far off –
B where both completely scanned 🙁
After some quick google-ing I figured – this is just the way a one-to-one association works; there is no lazy loading! 🙁
OK, so I might switch to use something else instead …
It is about time to present a new keyboard: DasKeyboard. It comes in two falvours: professional (with labled keys) and ultimate (with 100% blank keys!!). Talking about touch-typing!
Well, according to Scott Hanselman this is the most loud-ass keyboard ever!