Submitted by patrick on Sun, 03/04/2012 - 16:26
The following code scales a bitmap from the filesystem to a defined width:
Submitted by patrick on Sun, 03/04/2012 - 16:18
Execute code in the UI Thread
Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, () => {
Mouse.OverrideCursor = Cursors.Wait;
});
Submitted by patrick on Sun, 03/04/2012 - 16:14
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
Submitted by patrick on Sun, 03/04/2012 - 16:12
First you need to activate it and call the script:
set serveroutput on format wrapped;
call SOME_SCRIPT(150);
In the script you can output something with that line:
dbms_output.put_line('Start');
After the script has been executed you can see the output for example in the Script Output tab of SQLDeveloper.
Submitted by patrick on Sun, 03/04/2012 - 16:05
If you get a PInvokeStackImbalance exception it could be:
- One parameter has a wrong type (p. x. int changed to long)
- The CallingConvention of the DllImport. Change it in the declaration:
[DllImport("user32.dll", EntryPoint="SetWindowLongA", SetLastError=true)]
private static extern long SetWindowLong (IntPtr hwnd, int nIndex, long dwNewLong);
for example to
Submitted by patrick on Thu, 03/01/2012 - 20:55
Use the following snippet to declare the Win32 function
[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool AllocConsole();
and this one to show the console
AllocConsole();
Console.WriteLine("test");
Submitted by patrick on Mon, 02/27/2012 - 23:35
The most fundamental difference between Git and other revision control systems like SVN or CVS is the way how you work with it. With Git you will usually clone a repository. This creates a directory on your desktop where all the data about all revisions is stored. This means that you are not depending on a server somewhere. You can easily just use git locally.
Submitted by patrick on Wed, 02/22/2012 - 22:50
Some things you could look for in the code
Submitted by patrick on Sat, 01/07/2012 - 15:56
exiv2 -r'%Y-%m-%d %H%M :basename:' rename $(ls)
Renames all pictures in a directory. For example the file DSCF1200.jpg will be called 2011-12-30 1210 DSCF1200.jpg.
Submitted by patrick on Sat, 01/07/2012 - 15:40
Mounts the folder photo on from the server 192.168.0.16 into the directory mount on our local machine. It uses youruser and youpassword to authenticate
sudo mount -t cifs -o username=youruser,password=yourpassword //192.168.0.16/photo /mount/
Pages