Tips .Net: Do not Split your Strings

It could result in an "Out of Memory Exception" on really large strings as a colleague experienced last week.

Click to Read More

I admit I used to call Split a lot too as it's really easy and spares me a bunch of code. Ex.: to parse lines of a CSV file. And yet, the documentation on MSDN is clear about Split performances:

The Split methods allocate memory for the returned array object and a String object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the IndexOf or IndexOfAny method, and optionally the Compare method, to locate a substring within a string.

Here is a guy who deeply analyzed the memory issue which occurs when splitting a very large string : "Out of Memory Exception"

And if you need to parse the content of a large .csv, here is an efficient custom parser that can be used instead of calling Split on each line: "Fast CSV Reader"

TipsWordpress Line Break versus Paragraph in WordPress

For a WordPress beginner (at least for me, who used to write html in notepad++), when editing a post, it is irritating that the 'Enter' key is not simply adding a line break but starting automatically a new paragraph instead, especially when typing some pieces of code.

Fortunately, there is a trick to add a line break without starting a new paragraph.

Click to Read More

A new paragraph is usually started after a "Hard break" also known as a "Carriage Return", which is indeed the default when typing "Enter" in a Word Processor. At the opposite, a simple "Line break" also known as "Soft Break" does not start a new paragraph and result in a normal line-spacing.

Ex.: The white-space between the previous text and this line is due to a "paragraph separator". But here after, you will see two lines A. and B. separated by a simple line break.

A. first line of text
B. second line of text

Instead of typing "Enter" at the end of the line A., press "Shift-Enter" instead. That wilt result in a "soft break" (line break) instead of a "hard break" (carriage return).

Wordpress Add categories as dropdown menu in WordPress Navigation Bar

Edit the file header.php of your theme to add such a menu.

Click to Read More

On Synology, this file is accessible via the "web" shared folder (See here for details) at:


Find the right location in the code generating the navigation bar and add something like this (using the adequate 'class' from you own theme. Here after, I am using TwentyEleven.)

<!-- Add a drop dow menu with all the categories -->
<div style="text-align:center;">
 <ul id="menu" style="padding:0; margin:0;">
 <li class="cat-item">
   <a href="#" title="Filter by categories.">Categories</a>
   <ul class="children">
     <?php wp_list_categories('sort_column=name&sort_order=asc&
               title_li=0&exclude=1'); ?>

Instead of href="#" (to stay on the current page when selecting the head of that menu), you could also use:

href="<?php echo esc_url( home_url( '/' ) ); ?>"

The parameter "exclude=1" is used to skip the category "Uncategorized". You can add other category IDs to be skipped separated with a comma. To determine the ID of a category, go to "Administration Dashboard > Posts > Categories" and move the mouse over the "Edit" link for that category. Look at the URL displayed by the browser for that link; this one includes the category ID as a parameter: "&tag_ID=xxx"

TFSTips Connect to TFS from VS with multiple accounts

Assuming that you are using Windows Integration Authentication to access TFS, any instances of Visual Studio run during a Windows session will always use the current user to access TFS... Fortunately, there is a simple trick to connect on TFS with multiple accounts without starting new Windows sessions with other users.

Click to Read More

If like me you are a TFS administrator, you could indeed need to switch quite often from one user account to another. e.g.: to work in TFS with another profile (Contributor or Builder) and validate various configuration settings (security, etc...).

In such a case, the easiest is to right-click on the Visual Studio Shortcut (e.g.: in the Start Menu >  All Programs > etc...) and select "Run As...". Then enter the windows account to be used to connect to TFS.

Notice: Each time you will do that for the first time with a new account, Visual Studio could start much slower than usually as it has to create a new profile...

Notice: The account used to "Run As..." Visual Studio won't become the new default account. I.e.: it won't be reused the next time you run Visual Studio!

You can also edit the properties of the shortcut to Visual Studio (or create a copy of that shortcut). Then, click on the "Advanced" button in the "Shortcut" tab and tick the option box "Run with different credentials". Doing that, you will always be prompted to enter an account when running Visual Studio.

To permanently change the default account used by Visual Studio to connect on TFS, I read that we have to change the credentials used for the that TFS server in the "Credentials Manager" (Control Panel > User Accounts > Credential Manager). Unfortunately  I may not do that here at the office :/

To check with which user you are connected to TFS, check-out any file and have a look on the "User" column in the "Source Control Explorer".

Notice: You may run two instances of Visual Studio with distinct accounts simultaneously. There won't be any "conflict".

Freewares Drivers Update Monitor: My-Config



My-Config is from far the best and less intrusive online tool I found to check if your drivers are all up-to-date. And it's free.

Click to Read More

My-Config which is mainly a web based tool (online) can detect your hardware and software configuration. It find next the appropriate drivers and  search for WHQL-certified (or beta as an option) updates compatible with your computer on the web site "". It comes however with an offline modules to, among other, run analysis when disconnected from Internet.

Depending on your hardware (i.e.: if there are the adequate sensors) My-Config is also able to report on your components' activity: voltage or temperature of the processor, of the graphics card, etc. .

After a complete analysis of your PC, you should focus on the summary pane. This one displays the drivers for which an update has been found. Next to each one, you have a button to download the update from "" web site.

The other panes show information on your hardware, installed applications, running process, startup programs, .... But nothing out of the ordinary here.

A great feature is however the "network mode". The offline module of My-Config can indeed be installed on remote PC in your LAN and configure to run as a service protected with a password. This remote service can next be query from any PC to display its analysis report. The offline module can be configured as a service via the menu Start > All Programs > > Settings. In that window, select the Network mode, a password, and click "start".

On PC not connected to Internet, you can run an offline analysis using the offline module via the menu Start > All Programs > > Settings. In that window, click the "Detect" button. This is going to save an analysis report in a file. Copy this file on a USB ley and go to a PC connected to internet. Finally, upload the file on (see the bottom of that page)

Notice: if you PC runs fine, there is no reason to update anything. Updates are usually more a source of issues than a real improvement for your PC (except "Security" updates)...

To check for programs update, have a look on Sumo

Freewares File Unlocker: Lock Hunter

Lock Hunter

Lock Hunter

Lock Hunter is a must have for me. It helps to find which process is locking a file that you want to, e.g.: remove, replace or edit...

Click to Read More

I used to use Unlocker but moved to Lock Hunter when I first started with a x64 version of Windows, not supported at that time by Unlocker. Both are freewares.

Once installed, Lock Hunter add a contextual menu "What is locking this file/folder" on the files and folders in the Windows Explorer. This menu open Lock Hunter to:

  • View the processes locking the file/folder and all its DLLs
  • Kill the locking processes or unload its DLLs
  • Unlock, delete, copy or rename the locked file/folder
  • Delete the locking processes from the PC

The deleted items are move into the recycle bin's, so it's quite "safe"...



If you like it, the same company has developed another piece of software (not free) to safely remove Usb devices which are "locked" (and throwing the error "device cannot be stopped" when you try to eject it via the native windows "Safely Remove Hardware" systray icon) :

Freewares Startup Manager: CodeStuff Starter

CodeStuff Starter

CodeStuff Starter

CodeStuff Starter is the simplest and most efficient piece of software I found to manage the programs that starts automatically whenever windows is loading, as well as all the running services and processes (although I usually use respectively the native "Services Administration Tool" of Windows and "Process Explorer" of SysInternals to manage those). It's also a freeware

Click to Read More

It enumerates usually much more that the native System Configuration's startup pane (press Start key-R and type msconfig to open this one) and from the following sources:

  • the hidden registry entries used to start a soft once or each time windows boot.
  • the startup folders' items (accessible via the menu: Start > All Programs > Startup)
  • some of the initialization files inherited from the old windows versions (E.g.: Win.ini)
The two first sources are grouped by Current User, All Users and Default User (the profile used to create new users). Notice that the native "System Configuration" only shows the sources for the current user...

Using Starter, the user could choose to disable selected entries, edit them, create new, or delete them permanently (while they can only be disabled via the native "System Configuration" tool of Windows). You have also various interesting contextual menu available on each item, like "search on internet", "Launch", "File Properties", "Explore file folder" and the whole "System context menu"...



Found Issue: on Windows 7 x64, CodeStuff starter is not showing entries from "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" (local machine) but only from "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" (current user) and "HKLM\Wow6432Node\Software\Microsoft\Windows\CurrentVersion\Run". The native "System Configuration" is therefore still usefull as it's showing those entries!

Tips Samsung Kies licence agreement: "Accept" button not visible

I am starting to hate Samsung's softwares as much as those of HP (I experience too many issues with their softs on my PC, mainly due to my atypical hardware, I admit) !

I have been stuck on the "licence agreement" dialog window of the latest Samsung Kies update for a while because this stupid window does not auto-resize on PC with small display (e.g.: Mini-Laptop). As a consequence, the "accept" button is not visible. And no, it's not possible to move the window, it's a fixed size not movable dialog box :(

Fortunately, you can accept the licence agreement with the keyboard.

Click to Read More

  1. Click on the licence agreement screen to give it the focus.
  2. Press on "Tab" and "Enter" successively until you get a message "do you really want to cancel" ("Tab" move the focus to the next control in the screen. You get the message when the focus reach the "accept" button).
  3. Click "No" (The focus goes back to the "accept" button).
  4. Press "Shift-Tab" to go back to the previous control. This one is the checkbox "I agree" (I guess :))
  5. Press the "Space Bar" to check the checkbox.
  6. Press "Tab" and "Enter" to accept the licence agreement

That's it.

Tips Galaxy S2: Hardware ID Missing

Since a recent Kies update, my Galaxy S2 started to throw the exception "Hardware ID Missing" every time it was plugged into my PC.

The reason is a "bug" in the version of the SAMSUNG USB Driver for Mobile Phones installed with the Kies update. Fortunately, there is a elementary solution.

Click to Read More

This solution consists in installing an older version of the Samsung Driver. E.g.:  v1.4.8.0 available here, or 1.4.103 available here. I did use the 1.4.103 with success. No need to uninstall first the version currently installed. You will simply have to confirm during the setup that you want to install that version although another one is already installed.

This issue prevents Kies to connect with the phone via USB. Concretely you see the "connecting" message for a while as well as a spinning icon looping indefinitely.

Tips Samsung Kies error: PDLR has stopped working

After a recent update, Kies started to throw the exception "PDLR has stopped working".

If you are looking how to solve that issue, I did google on that too and found a radical solution.

Click to Read More

A solution often mentioned on the web is to remove the following line from the config file (or to completely delete the file) :

This config file is located in "%programfiles%\Samsung\Kies\External\FirmwareUpdate\KiesPDLR.exe.config" (on x64 platform: "%programfiles% (x86)").

This fix didn't work for me. But another one did the trick: I did an "advanced" uninstall of Kies using the free "Revo Uninstaller" and did next a fresh re-install.