{{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.
Screen Capture Update
My wife, the user of the Screen Capture application as described in  http://www.sorescu.eu/article/120220221500/Free-Screen-Capture-application explained me that she needs to run it also while in Full Screen mode.


For this I had to hook to the Windows Hot Key events, after I registered with the desired shortcut.

The chosen shortcut is <CTRL>+<ALT>+<PRINT_SCREEN>, and the code update is as in file below. Main call as following:
Thread t=new Thread(new ThreadStart(ProcessHotKey));
            t.IsBackground=true;
            t.Start();
Worthy mentioning are the following:
  • I used
    GetMessage(ref msg,IntPtr.Zero,0,0)
    for avoiding message queues to any form, but to the current thread;
  • It was required
    int hashCode=("hash-"+modifiers+"-"+key).GetHashCode();
    to ensure that the Hot Key is unique in Windows;
  • The Hot Key handler had to be ran in a separate thread, using
    new Thread(new ThreadStart(ProcessHotKey))
1 files attached: RegisterHotKey.cs
RegisterHotKey.cs
A small Java program to generate transparent images (for dynamic background colours)
Somebody requested me to generate a web page with a wall background that should change the wall colour based on the user's desire.
I thought a transparency-enabled background will suffice, with a dynamic background of the image.
Steps:
  1. Take the background image from my customer;
  2. Generate a mask image as a copy of the background image, and remove the area (set it to black) where I want to have transparency;
  3. Run the Java program that is written below;
  4. Use the final result image and put it in a web page.
You can check the result (while the web page is still there) at: http://dev-alexandru-doors.sorescu.eu/products-en_GB where you may click any image from gallery and the background image will appear.
1 files attached: ImageTansparency.java
ImageTansparency.java
Sending dynamic client-side parameters in URL fragments and manipulating them
Seldom I was in need to perform client filtering on tables and other data, and eventually save the filter. One solution was sending the filter to the server and generate the filtered page.
The functions below (I am using them few years already in Internet Explorer) are used to store and get the properties from fragments.
Some useful clues:
  • When the page is loaded, check all the fragment parameters and update the controls and perform filtering, etc.;
  • Whenever you update a filter in a text field, etc., you can save it in the fragment;
  • You can send the link with fragment to anybody else, and if the first bullet (filter executed on page loading) is accomplished, the URL receiver will see the same page as you.
1 files attached: getFragmentValues.js
getFragmentValues.js
Scripted C# - or how to run dynamic C# code, without compilation
As I started to develop small applications in C#, I thought why shouldn't I use the same paradigms that I used in Java... dynamic code execution, execution without compile/build/deploy process, hot-swap, etc.

I am far away from acomplishing the same functionality, but I started with writing a small program (81 lines) mentioned below.

When executing, it is able to compile and execute C# code that is written in text files, on the spot.

The mechanism is quite simple: it expects in the command line the name of an XML file (mentioned below this script) that describes:
  • the list of CS files that should be compiled;
  • the list of external binaries, if required;
  • the title of the application;
  • the entry point (the class name that contains the Main function).
An example (SMTPServer.csscriptof the input XML looks like attached.
Useful information:
  • the class mentioned in the CSScript/EntryClass node must have a Main(string[]args) method;
  • the Main method must be public and static!
  • additional parameters to be sent to the Main method are added to the executed command line!
Example of using the script attached.
In my development (that I started yesterday evening) I used some information from the following links:
The application code is straight forward, and I don't think any comment is required. If you need any comment, then either you should learn programming, or study a bit some C-like languages.

If you wonder why I don't also give the EXE file, please feel free to open the Visual Studio, create an empty project, add a class and paste this code.
3 files attached: RunCS.cs SMTPServer.csscript start.cmd
RunCS.cs SMTPServer.csscript start.cmd
Translating the DOCX file in machine-readable contents
One of my last tasks is to build clear requirements based on customer WinWord documents; I also do have a strong feeling that the documentation will change in time, and it will be a dirty work to trace it.
As a consequence, I wrote a small utility to render to the browser the contents (not rendition) of a diven DOCX file. And the transformation (in incipient phase) is below.
2 files attached: RenderWindWord.dsp Transform.xsl
RenderWindWord.dsp Transform.xsl
Outgoing mails got blocked by Trend Microsystems firewall
My mail server (developed in .NET) is running on IP 188.240.44.77. I used to send and receive mails, everything is fine. However, there is a domain (let's say anonymousdomain.com) where everytime I try to send an email I get the error below:
550 5.7.1 Mail from 188.240.44.77 blocked using Trend Micro RBL+. Please see http://www.mail-abuse.com/cgi-bin/lookup?ip_address=188.240.44.77
Fine, I understand, and I do remember I tried to test my outgoing SMTP connections with another email address hosted on anonymousdomain.com. At the same time I noticed that the Google servers were delivering just fine my mails, without any issues.
I do acknowledge my actions were not ethical, moral, maybe not even legal to do in some countries (running mail tests on other people's addresses).
As a step forward, I shall contact the Trend Microsystems http://www.mail-abuse.com team to inform them that those mails were legitimate and for testing purposes, hoping I shall be removed from the black list.
Light Web Proxy Switcher - simple DOT NET 14,0 KB (14.336 bytes) IE Proxy Switcher
http://static.sorescu.eu/Applications/WebProxySwitcher-1203280028/WebProxySwitcher.exe

During this time I faced the need to switch between various proxy switches on my computers and laptops. Hotels with specific proxies, public spaces without proxy, work network specific settings, etc.

At the end it became quite annoying to switch proxies between sessions, etc., getting disconnected from work VPNs, hanging between proxies while roaming between my work desk and public places.

And all this must come to an end... hence, I wrote a small Proxy switcher, which simply can to one of the following settings:

  • disable the proxy;
  • set the proxy to a prespecified value;
  • proxy management:
    • Add proxy authority with description;
    • Edit/add proxy based on a pre-existing setting;
    • Delete a proxy setting

As of now I tested the proxy on my Windows 7 with DOT NET 4; further on I shall continue testing this application also on other platforms.

The application can be found at http://static.sorescu.eu/Applications/WebProxySwitcher-1203280028/WebProxySwitcher.exe.

1 files attached: WebProxySwitcher.cs
WebProxySwitcher.cs
I just received an encoded message...
I got the message inbox from a guy that sometimes likes challenging people with unusual quests. In few minutes I replied with reply.
I hope I put the proper values at the proper place.
Are you curious what does it mean? Check and execute the code.
3 files attached: inbox.txt reply.txt DecryptSecretMesage.java
inbox.txt reply.txt DecryptSecretMesage.java
Online Favicon program
I was looking for some time for an online application that generates icon files (for sites). Googling a bit I reached today at http://www.favicon.cc/ which in my opinion is quite simple and easy to use and generate icons. Go on and use it!
SMTP Server illegal access failure

I took a look in the logs of my ad-hoc SMTP server (running on the main domain) sorescu.eu and I noticed a series of denied authentications.

I did not understand what happened, but I saw the user and the password list encoded in Base64. After I collected all the encoded values, I was curious which credentials were tested. I shall present below the application that I wrote to help me in decoding them, and, the list of passwords used to log in.

Java Base64 decoder code:

Worthy saying, before listing the password list:

  • the client presented itself as GOD-E49531CFA2A (really?!?);
  • the client was a bot that was simply dumping plain text to port 25, as it continued sending the mail spam, without even looking that the access was denied;
  • my SMTP server and relay are the product of one white-night, but this test is a first realistic test of my server;
  • many more things remain to be implemented in server, including white and black lists, including changing the password with a strong one;
The password series is attached.

2 files attached: Base64Decoder.java passwords.txt
Base64Decoder.java passwords.txt