What is Dependency Injection and Inversion of Control in Spring Framework?

Spring helps in the creation of loosely coupled applications because of Dependency Injection. In Spring, objects define their associations (dependencies) and do not worry about how they will get those dependencies. It is the responsibility of Spring to provide the required dependencies for creating objects. For example: Suppose we have an object Employee and it … Read more

How to make overlay control above all other controls?

If you are using a Canvas or Grid in your layout, give the control to be put on top a higher ZIndex. From MSDN: <Page xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” WindowTitle=”ZIndex Sample”> <Canvas> <Rectangle Canvas.ZIndex=”3″ Width=”100″ Height=”100″ Canvas.Top=”100″ Canvas.Left=”100″ Fill=”blue”/> <Rectangle Canvas.ZIndex=”1″ Width=”100″ Height=”100″ Canvas.Top=”150″ Canvas.Left=”150″ Fill=”yellow”/> <Rectangle Canvas.ZIndex=”2″ Width=”100″ Height=”100″ Canvas.Top=”200″ Canvas.Left=”200″ Fill=”green”/> <!– Reverse the order to … Read more

Word wrap for a label in Windows Forms

Actually, the accepted answer is unnecessarily complicated. If you set the label to AutoSize, it will automatically grow with whatever text you put in it. (This includes vertical growth.) If you want to make it word wrap at a particular width, you can set the MaximumSize property. myLabel.MaximumSize = new Size(100, 0); myLabel.AutoSize = true; … Read more

How can I find WPF controls by name or type?

I combined the template format used by John Myczek and Tri Q’s algorithm above to create a findChild Algorithm that can be used on any parent. Keep in mind that recursively searching a tree downwards could be a lengthy process. I’ve only spot-checked this on a WPF application, please comment on any errors you might … Read more

How do I capture SIGINT in Python?

Register your handler with signal.signal like this: #!/usr/bin/env python import signal import sys def signal_handler(sig, frame): print(‘You pressed Ctrl+C!’) sys.exit(0) signal.signal(signal.SIGINT, signal_handler) print(‘Press Ctrl+C’) signal.pause() Code adapted from here. More documentation on signal can be found here.  

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)