Made to Order Software Corporation Logo

function

PostgreSQL and Drupal conflict

We have been running Drupal for some time now and we have noticed that it generates a very large amount of warnings in our log files.

The warning is in link with improperly formatted strings. PostgreSQL tries to follow the SQL specification to the letter and that means you cannot use the backslash character to escape special character sequences (such as \n for a newline character.)

I knew that in most cases the error was generated because of the function saving a full page or some other content in the cache. In that case, the system includes the characters: \012 and \015 (\n and \r.) That ...

Adding a Table of Contents to a view with parameters

It is possible to add a Table of Contents to a view that has to accept parameters1.

In this case, you do not want to use the solution of including the view in a node (with the Insert view filter, see Can't find doc_table_of_contents_for_views to include!) because then you lose the capability of assigning different parameters to your view (although, if the number of parameters is ...

  • 1. Note that you need to write some PHP code. If you do not know how to do that, I'm afraid that this won't work for you. You may want to check out the Table of Contents and Insert view solution instead.

Made to Order Software releases Turn Watcher 1.4 and a new website!

Made to Order Software is proud to announce the release of Turn Watcher version 1.4 and a brand new website!

Turn Watcher version 1.4 incorporates not only some much needed bug fixes (specifically the Stabilize function) but the addition of a brand new feature: Soft Columns.

Use Soft Columns to add, edit and remove rolls and information columns to each of your combatants. For example, you may remove the Spot/Listen columns and replace them with Perception. Add new rolls such as Move Silently and Persuasion. You may also add information-only columns such as Armor Class and Condition Track, ...

The odbcpp library is now available!

Made to Order Software now uses the ODBC library with its modb library (which is part of our molib product.) Unfortunately, it is not only written in C, it generates many errors. Actually, every single function has the potential of returning an error. For this reason, using the C interface is simply not a safe option.

For this reason, Alexis Wilke, our CEO, wrote an C++ wrapper called odbcpp. It encapsulates all the necessary ODBC calls to access any ODBC compatible database.

The odbcpp library ensures the proper management of all the resources for you. It allocates and frees the handles as ...

Pointers and proper exception handling...

Many C++ programmers have been C programmers first. Therefore, a lot of times, you find statements written this way:

ptr = new type;

if(ptr == 0) // handle error...

This is a C programmer that does not yet know that the new operator will throw an error if the allocation cannot happen. This makes a lot of sense, but what does that mean to the C++ programmer?

The assert() macro in C/C++

 

This is a subject that comes back all the time in C/C++ boards.

Should you use assertions?

The answer is clearly yes. But the C/C++ assert() function is usually defined using a macro. Macros have several problems. The most common ones are: they offer no type checking, they do not warn you about weird side effects, they have a different syntax than the C/C++ language itself.

One good thing: for a fast program, the debug code used to check parameters, results, etc. is gone.

One really bad thing: if the expression in the macro has a side effect, the release program is different from ...

HTML Forms and the action attribute

Today I had to debug a set of HTML pages. One feature of a website would not work with Internet Explorer. The code was like this:

WordPress at Made to Order Software!

Welcome on Alexis’ Blog at Made to Order Software Corporation.

This is my first blog! I’m glad I got WordPress to work with the m2osw style sheet. It is quite different from the default blogging board setup! Also I needed to make it work for several people on the same website without duplicating the code each time.

I did make changes to the code in order to achieve this feat. First, I had to access a specific database for each person to have its own blog (this may be just me who did not know how to use all the available features of WordPress, though.)

The following function ...

Increase Security with a Reverse Proxy Server

What is Reverse Proxy?

There are three excellent reasons to switch to a Reverse Proxy Server right away:

  1. Protect all of the sensitive data on your servers;
  2. Have only one gateway to the outside world;
  3. Ease the load on your web server by allowing the reverse proxy server to distribute the requests.

Figure 1 below presents a simplified setup of a Reverse Proxy Server.