avatar

Andres Jaimes

Working with dynamic arrays in Delphi

One advantage of Delphi’s dynamic arrays is that they are automatically freed once they go out of scope. That simplifies memory management and gives you more flexibility on your applications. You can declare a dynamic array like this: Customers: array of string;  Before adding an element, you have to call the SetLength function to specify the number of elements you are going to use (3 in this case): SetLength(Customers, 3);  Now you can go ahead adding values:

Tips to help you deal with Delphi Threads

Multithreading is one of those operating systems feaures that make your programs work in a more efficient way and give your users a better interactive interface. However they are not used by all developers. In this article I will focus on some important points you must have in mind when using threads on Delphi.  How to create them There are two simple steps to accomplish it: Create a new class that inherits from TThread and Override the Execute method.

Minor changes

I have applied some minor changes to this website: caching – to improve performance – and micro-blogging entries. Later I will add some style to the micro-entries.

How to manage local or remote services from command line

Starting or stopping services on Windows is a task commonly performed by using the Services snap-in on the MMC console. From time to time you want to perform such tasks from the command line. A possible reason for this is when you are creating scripts (batch files). To achieve this, you have two options: net for managing local services and sc.exe for remote ones. The net command is included in your default Windows installation.

Exchange: The database files in this storage are inconsistent

This morning I got a new surprise from my Exchange server. Outlook clients could not connect to the servers, however the server seemed to be working pretty normal. After some research I found out the Exchange databases were corrupted. But, how did this happen? Well, they can get corrupted when Windows is not shutdown in a proper way, or a service or process misbehavior leaves them in an inconsistent state or when there are physical errors on your hard disk.

Creating Shortcodes in WordPress

Shortcodes enable developers to create special kinds of content, following the idea of macros. One very famous short code is “gallery” needed to insert a gallery of images into a post. The good thing about shortcode’s is that final users are free to decide where to insert them. WordPress’s Shortcode API handles all the tricky parsing, making developers life much easier. The following is a snippet for a Shortcode – in order to make it work you have to add it to your functions.

Add a Thumbnail to Admin Post Columns in WordPress

Here is a snippet to add 64×64 images to the Admin Post Columns in WordPress. Having thumbnails may result extremely helpful, specially if you have hundreds of posts. You have to copy and paste the following code into the functions.php file of your theme. function posts_columns($defaults){ $defaults['the_post_thumbs'] = __('Thumbs'); return $defaults; } function posts_custom_columns($column_name, $id){ if($column_name === 'the_post_thumbs'){ echo the_post_thumbnail( array(64, 64) ); } } add_filter('manage_posts_columns', 'posts_columns'); add_action('manage_posts_custom_column', 'posts_custom_columns', 10, 2);  Instead of array(64, 64) you can also use default image sizes like ‘featured_thumbnail’, ‘thumbnail’, ‘medium’, ‘large’ and ‘full’.

How I made my HP LaserJet P1102w work with my iPad

I got an HP LaserJet P1102w about a year ago, so long before I thought I was going to get an Apple’s iOS device. I purchased it just because I thought it would be useful to have a printer that could work wirelessly. At that time I made it work using wireless, but for some reason it stopped working. I didn’t care because it was very simple to connect it via USB to my computer and get my stuff done.

Download YouTube videos using Java

From time to time we all have needed to show a YouTube video where no Internet connection is available. This program will allow you to download a video from YouTube for later playback. It is important to say that YouTube constantly changes its video URL, so someday it may need some rework. The following code was tested on Aug 12, 2012 and it works. Have a good day.  /** * YouTubeDownloader * * Modified by Andres Jaimes https://andres.

Free Image Resizer for Windows

This time I want to share with you a Windows application for image resizing. It’s a fact, size matters. That is why Image Resizer can be very useful for sharing pictures through email, uploading images to websites or posting them to social networks. If your images are smaller, then it will take you less time to share them. This application can load a list of jpeg, gif, png or bmp files, resize them and then put them on a selected folder.