Syndicate content


Convert XML tags and text to a String

Today I started testing a lot of my JavaScript / jQuery code from a website I am building for a customer. I got an error, at some point, saying:

SCRIPT5007: Unable to get property 'replace' of undefined or null reference

The error was in link with the 'replace' function being referenced on an innerHTML of an element. More specifically, one of those XML element (probably the top most one.)

The fact is that Internet Explorer does not support innerHTML in an XML document. Not to be too surprised about that, XML is not HTML so there is really no reason why innerHTML should be ...

A C++ implementation of a UDP client/server

I have noticed that quite a few people were trying to create UDP communication and I thought that proposing my class could help them. This is very basic as it does not define anything such as the size of a packet or any protocol to ensure arrival of the packets. However, it can be useful if you want to send a signal from one process to another, which is exactly how I use this implementation.

This code is part of the Snap! C++ implementation. It can be found in the corresponding repository.

Header file:

// UDP Client Server -- send/receive UDP packets
// Copyright (C) 2013 ...

Setting up an array of JavaScript functions in jQuery

Today I worked a bit with jQuery to create an advanced form. Advanced just because it is tabbed and appears in a pop-up, nothing too major really. Maybe later I'll add some tests to validate the data being entered before someone can submit the form...

In any event, I ran in a problem which was to create a set of click callback functions (event handlers) and each of which should make use of a different index. So... I have 4 tabs and each one has a number: 1, 2, 3, and 4.

Say I call each one of these numbers #tab1, #tab2, #tab3, and #tab4. Now I want to create a click function on each one ...

Drupal blocks all disappeared!

Today I had an interesting experience... all of a sudden, all the blocks of a given theme disappeared.

It has been working just fine for months, so I really wasn't sure what the heck it could be.

The fact was that the theme was called the same as the module (as I work for a given client, I tend to do that...)

At some point, I must have added a function with a specific name and that would influence the theme. The result being blocks going bye bye!

I checked and the block content is computed just fine, the problem is the theme('block', $block) call. Although the ...

AddThis is down, how to prevent the slow download of your pages?

Today AddThis is down, big time! For hours...

So to make my websites load faster (although I did not delete all the caches, which is a problem too?!) I removed the functionality. If you have Drupal, there is what I have done to leave the settings the same but still hide the AddThis button and thus get all the pages of all my websites to load fast.

First we remove the link by returning an empty array:

 * Implementation of hook_link(). 
function addthis_link($type, $node=NULL, $teaser = FALSE) {
return array(); // immediate return
  $links = array();

  if ($type ===  ...

Code references

The following are three distinct nodes using geshifilter which is a filter used in Drupal (and other systems) to transform the content of the node from code to colorful HTML.

And here is the end of this page (from the <hr> to the bottom)

Draw circle

void Image::DrawCircle(float x, float y, float radius)
  // TODO: add tests to prevent computing all the points for nothing
  //       (i.e.


// slow integer factorial function
int factorial(int n)
  int r = 1;
  while(n > 1) {
    r *= n;
  return r;


MS-Access defines many different types, including a newer one called DECIMAL.

You are supposed to be able to create tables with the DECIMAL type. So a statement such as:

   CREATE TABLE MyTbl (decimal_test DECIMAL(20, 5))

should work. Right?

I have been using CurrentDb.Execute for a while and that statement was causing the Execute function to return an error saying that the field definition was erronous (Syntax error in field definition, to be exact).

The trick is very simple!

PHP glob function does not return softlinks

I use all sorts of tricks in order to duplicate functionality without actually duplicating PHP code.

One of the main, easiest way under Unix is to create softlinks. First put all your code in one folder, then create a softlink to it. That gives you two paths:

Syndicate content Syndicate content

Diverse Realty

Diverse Realty Team

Want a New Home?
Want to Sell Your House?

Call Alex at
+1 (916)
220 6482

Alexis Wilke, Realtor
Lic. # 02024063

Cory Marcus, Broker
Lic. # 01079165


Terms of Site Index

Find the page/content you are looking for with our index.