{{error}}
{{(quickSearchResults.length>10)?'10+':(quickSearchResults.length)}} {{(quickSearchResults.length==1)?'result':'results'}}
{{result.title}} {{result.timeStamp | mysql2ymd }}
I am sorry, no such article was written yet.
Great PNG transparent icon finder site - http://www.iconfinder.com/
A great icon finder site: http://www.iconfinder.com/ - Icon Finder.Com
Advantages:
  1. Ability to filter by pixel size (16x16, 24x24, ranges, etc.);
  2. Ability to show the icon with transparent background;
  3. Easy to download, no registration, no forms, no procedures;
  4. Licence filtering - free, commercial.
Programatic HTML automatic selection
A very useful way to programatically select text in your HTML.
Usage as in usage.html.
2 files attached: selectElementContents.js usage.html
selectElementContents.js usage.html
<a class='dms-button' href='#' onclick='selectElementContents($(this).siblings()[0])'><%icon:copy%></a>
Easy way to install the Microsoft Expression Encoder - using the MS WebPI
An easy way to install the Microsoft Expression Encoder (in case you need to process multimedia streams (via C#, etc.) is to simply follow the link http://www.microsoft.com/web/downloads/platform.aspx from where you install the Web Platform Installer - were you select the Microsoft Expression Encoder and it will automatically install the dependencies - Azure, .NET Web Express, etc. And all of it is free and easy.
Simple Dynamic C# Execution
A simple way to execute C# code, without using the Visual Studio is shown in RunCS.cs. Steps:
  1. Compile the code as RunCS.exe;
  2. Create a CS file;
  3. Execute RunCS.exe "my_file.cs" param1 param2
The CS file must contain the following lines, as in Program.cscript.
2 files attached: RunCS.cs Program.cscript
RunCS.cs Program.cscript
//@main MyNameSpace.MyClassName
//@assembly %programfiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll
using System;
//@title This is optional, and it will be the window title
//@include ..\\my_dependency_file.cs
using System;
namespace MyNameSpace{
 public class MyClassName{
  public static void Main(string[]args){
    Console.WriteLine(args[0]+" "+args[1]);
  }
 }
}
How to execute remote programs on Windows
Recently I needed to start a program on a remote machine, so I used the following C# code (after adding the System.Management assembly).
1 files attached: Remote.cs
Remote.cs
Tray icon flash on new messages in Outlook
Using the utility class from the previous post I wrote a small utility that is running through all the Outlook accounts and counts all the unread messages from inbox. Once a change is detected, the icon starts blinking, that will stop once you click once with the mouse on it.
Right now it is working for me with two Exchange accounts configured on my Outlook.
Very important note: before importing, you must add the reference to Microsoft.Office.Interop in order to access the Outlook interoperability automation engine.
The code is attached.
1 files attached: OutlookNotification.cs
OutlookNotification.cs
C# counter in a Tray Icon - utility
Below is a small class I wrote in order to put a small tray icon with a custom background color, foreground color, and a text.
The particularity of this application is that it does not use any form.
1 files attached: TrayCounter.cs
TrayCounter.cs
Visual Basic and other applications don't start anymore after MS Windows update
It seems that recently Microsoft rolled out some new updates, among which one of them is related to a vulnerability in MSCOMCTL.OCX related to the RTF file handling. It might seem minor, but as a consequence the OCX file got fixed and it is not registered anymore.

In order to fix it, you have to run one of the following commands: 
  • regsvr32 c:\windows\system32\mscomctl.ocx
  • regsvr32 c:\windows\syswow64\mscomctl.ocx
depending on the operating system's bitness (either 32 or 64 bits).

For further information please consult also http://www.net-security.org/secworld.php?id=13429.
How to safely migrate data between databases in MySQL with PHP
I saw many people using lots of complex methods in attempt to move data between databases and file systems.

One of the most frequent methods is storing sequential data records in CSV, TSV, XML, or other formats. Obviously, each syntax requires specific escaping algorithms, a fact that most of times is omitted or forgotten by developer.

The last time I had to move data between two different instances of MySQL from two different sites I followed the approach:
  1. Select the database records and put them in an object (array);
  2. serialize the array;
  3. encode the array in base64 to ensure the text needs no escaping algorithm;
  4. copy the text on a support (file, ftp, mail, etc.);
  5. decode the array from base64 to native format;
  6. deserialize the array;
  7. take each record and save it to the database.
Some of the advantages are:
  1. you don't transfer database records, but business objects;
  2. if you have complex relations or fields, they just get wrapped, irrelevant on the database representation.
A code example is in sample.php.

And the result will be similar to sample.txt.
2 files attached: sample.php sample.txt
sample.php sample.txt
Right click functionality on some buttons - how to, and demo
To use at best the screen estate it is indicated sometimes to implement right-click handlers that trigger menus or other activities.

Recently I thought implementing such functionality on http://my.sorescu.eu/. The functionality implemented was triggering a dialogue box; the complete functionality is still under development, but the right-click handler has been implemented.

First, I looked for a library, and I found one that looked nice and simple (implemented using jQuery): http://www.abeautifulsite.net/blog/2008/05/jquery-right-click-plugin/#demo.

I am using Google Chrome right now to test it, and I saw the following misbehaviour: if I right-click on the "MY Place" button after right-dragging, I get the event triggered multiple times.

I patched the code by inserting a line after line 53:
$(this).mousedown( function(e) {
					var evt = e;
					$(this).unbind('mouseup');//added by dragos-matei@sorescu.eu to avoid double right click events, or ghost right clicks for right dragging events starting from this button
					$(this).mouseup( function() {
						$(this).unbind('mouseup');
						if( evt.button == 2 ) {
							handler.call( $(this), evt );
							return false;
						} else {
							return true;
						}
					});
				});
The issue seems to be in the original code that every time the  rightMouseDown   occurs, a new  rightMouseUp handler is added. 
What I did was to remove the rightMouseUp event also when rightMouseDown event.

Thanks to http://www.abeautifulsite.net and I hope it was useful for you.

N.B.: No guarantee that the script in discussion and the modification I did is useful, safe, good, or whatever else - just take it without any warranty, of any kind, under any circumstances.