mySQL Statement Monitor in DataGrid

2011.05.23

Working around lately with MySQL and C# I created a small and quite simple application that visualizes MySQL Commands to a DataGrid.

With SQL Statement Monitor v. 0.0.0.1 you can connect to a MySQL Database, execute MySQL commands and see the result straight on the DataGrid. For example, when you can execute a “Select” command and only the selected columns will be visible in the DataGrid. Similarly, you can add Tables, Entries, Columns etc.

In this Beta version of SQL Statement Monitor v. 0.0.0.1 are two buttons. One “Select” and one “Execute”. The “Select” button is used to filter the data (i.e. the Select example above). While the “Execute” button is used when an alteration to the Database is required (i.e. add an entry).
In addition, the code of some basic SQL Commands is included. Just select the command from the “Common SQL Commands” drop down menu and the code will be inserted for you in the commands field.

In order to use SQL Statement Monitor v. 0.0.0.1 MySQL Community Server is required. Personally, I suggest you to download MySQL Workbench (GUI Tool) too, so that you can manage your databases easily from a GUI. Both of these tools can be downloaded for free from MySQL official website.

How to use:
1. Download SQL Statement Monitor v. 0.0.0.1, unzip it and run the executable
2. Download MySQL Community Server and install it
3. Download MySQL Workbench and install it
4. Create a Database (write down the Username, Password and Hostname)
5. Start SQL Statement Monitor v. 0.0.0.1 (some errors may pop up that it cannot connect to Database)
6. Click ‘Connect to Database’ and give the correct information (Database name, Username, Password, Hostname and Table Name)
7. If the database has no tables yet an error will pop up. You should create a table
8. You are ready! Add some data and play around with SQL commands

If you have any question/suggestion please comment below.

If you need a copy of the source code do not hesitate to contact me.

Categories : Programming  C#  Programming

Random Password Generator in C#

2011.05.12

With Give Me a Password v. 1.0 you can create strong random passwords difficult to crack or guess, because of the combination of lower and upper case letters, numbers and special characters.

Give Me a Password v. 1.0 is written in C# and does not need install. However, to run the application, Microsoft .NET Framework 4 Client Profile must be installed.

Just download Give Me a Password v. 1.0, unzip it and run the executable. Select what characters should be included in the password(s) (i.e. lower/upper case letters, numbers, special characters), the length of the password(s) and the quantity of passwords to generate.

The code for Random Password Generation is based on the copyrighted sample code of Obviex™, which can be found here. Some alterations have been made to the initial code, in order to implement it with GUI and enhance the group of available characters.

If you need a copy of the source code please contact me.

If you find any bug or have any suggestion please contact me.

For more projects visit the Programming Section.

Categories : Programming  C#  Programming

Standard, Automatic (auto_ptr) and Scoped (scoped_ptr) (Boost Library) pointers in C++

2011.05.09

A (potential) “drawback” in C++ is the lack of a built-in garbage collector. However, there is a variety of techniques that help you get over with that.

To follow that post and the attached example (keep reading…) you must have a familiarity with pointers in C++. If you do not you can read an introduction here.
In addition, if you do not know what an automatic pointer is in C++ you can read here (you will need it)
Finally, if you have not heard the Boost Libraries in C++ before, then you can find more information in the official website.

Cpp Pointers Example v. 1.0 is a small C++ project in Visual Studio that will help you to understand better all the above concepts about pointers.

The code is fully commented but let me explain the main concept of the example.
We have a class (called myClass) and three different functions, where each one uses a different kind of pointer to point to myClass.
As it can be easily seen from the example when the standard C++ pointer goes out of scope, it does not call the destructor of the class. So, the object which was initially created is never destroyed.
With automatic pointer (auto_ptr) and scoped pointer (scoped_ptr) the destructor is called and the initially created object is destroyed.

The big difference between the automatic pointer and the scoped pointer is that scoped_ptr is not Transferable. On the other hand, auto_ptr is Transferable, which as you can see from the example code can lead you to have references to null.

Download Cpp Pointers Example v. 1.0, play around with the code (read the comments inside the code) and if you have any question feel free to comment here.
If you are using Visual C++ Express you can double click SmartPointerBoostLib.sln. Otherwise, the file containing all the C++ code is SmartPointerBoostLib.cpp

Note: In order to run the example of scoped_ptr, Boost Libraries must me installed. For help how to install (and compile if needed) the Boost Library files read the official documentation here (it is quite straight forward).
If you want you can comment the code referring to Boost Library and run the example normally (only the standard and automatic pointer examples will be shown)

For any suggestion and/or question you can comment bellow ;)

Personal Documents Organiser new version 0.2.0.0

2011.04.01

A new version (still in Beta) of the Personal Documents Organiser for Windows in C#, Documents Order Obsession v. 0.2.0.0 is here.

The updated version brings many new features with a new interface, that will help you to organise your documents (and your files in general) better.
Some of them are:

+ Documents Order Obsession v. 0.2.0.0 has a proper installer now
+ New re-ordered main menu
+ Icon menu for easier access to frequent actions (i.e. creation and edit of Entries)
+ Export your entries to CSV file (open it in Excel)
+ Open the associated file directly from Documents Order Obsession v. 0.2.0.0
+ Star your “favorite” entries
+ Filter to view only your Starred entries
+ Completed tasks now are indicated with icons
+ Check online for new versions

Other features include:

+ Create up to six categories, filter them and color them to find easier what you are looking for
+ Show/Hide completed tasks
+ Keep History of your changes
+ Import/Export the entries from/to a XML file

Documents Order Obsession v. 0.2.0.0 is written in C# and requires Microsoft .NET Framework 4 (x86 and x64), SQL Server Compact 3.5 SP2 and Windows Installer 3.1.
If you do not have them installed do not worry. The installer will download all the prerequisites from Microsoft.

To install:
1. Download Documents Order Obsession v. 0.2.0.0
2. Unzip it
3. Run the executable

Note 1: If you get an error that cannot connect to database you should run the program as Administrator (Shift + Right click > Run as Administrator)

Note 2: This is a Beta version. If you find any bugs or have any suggestions please contact me.

If you need a copy of the source code please contact me.

Feel free to comment ;)

Directory Activity Monitor for Windows

2011.03.30

Now you can monitor and log the create, change, rename and delete events of files and folders in any directory, in a local or network hard drive!

With Directory Activity Monitor v. 0.1.0.0 you can set a directory and get notifications for any change happened in any file or folder. You can even keep history of the events and export it to a file. So, you will know exactly when a file or folder, was created, changed, renamed or deleted.

Directory Activity Monitor v. 0.1.0.0 is a software written in C# and works under Windows with Microsoft .NET Framework 4 (x86 and x64) and SQL Server Compact 3.5 SP2 installed. If you do not have them installed the installer will download them from Microsoft’s web site.

Some of the features of the current version are:

+ Set any directory to monitor (in a local or network drive)
+ Enable/Disable history of all the events
+ Export history to CSV or TXT format
+ Enable/Disable the monitoring of subdirectories
+ Enable/Disable the monitor of specific events (create, change, delete and rename)
+ Enable/Disable the balloon notificatiosn in System Tray
+ Select to start automaticaly with Windows
+ Check online for new versions

To install:
1. Download Directory Activity Monitor v. 0.1.0.0
2. Unzip it
3. Run the executable file

Note: This is a Beta version. If you find any bugs or have any suggestion, please do not hesitate to contact me.

If you have any question about parts of the code you can comment below.

If you need a copy of the source code please contact me.

For more software check the Programming Section.