Syndicate content

print

Recover name of message registered with RegisterWindowMessage()

Today I was confronted with an error in a process that would run in the background and slowly fill up the Windows message queue when it should have been dormant.

I looked at the messages that were being processed once the process woke up and the message number was 0xC10C or so. Nothing in the software has such a number. So I looked around and found out that the message was one of those created using the RegisterWindowMessage() function. (This is wrong in that application since the messages are never used from external applications, but oh well... that does not change the basic problem.)

So, ...

How to only upgrade packages with a security requirement in Ubuntu/Debian?

Today I wanted to upgrade some packages that had security issues. Ubuntu (like Debian) provides the apt-get tool that allows you to do upgrades the easy way:

sudo apt-get upgrade

However, that upgrades all the packages present. In some cases, you may want to skip on some packages because you know they are not ready (i.e. your own packages).

In order to only upgrade security issues, you want to get a list of packages that are to be upgraded for security issues:

apt-get -s dist-upgrade | grep "^Inst" | grep -i securi

That apt-get command line lists all the packages ready for ...

HP Printer options not offering "Color: Off" option anymore

As I upgraded to Ubuntu 13.10, I noticed that I lost the option to turn off the color when printing.

Looking around all the available options, no one to make it black and white (although the old option was saying something like: Color: Off; it was somewhat weird.)

Now that option is completely gone. There is no way for me to turn off my HP Printer color when I am in Acrobate or LibreOffice. I searched on the Internet to see whether that was just HP trying to get you to use colors on your printer or whether the option was available... somewhere else.

Indeed, I had to go to the System ...

log4cplus bug in handling %q in older versions

In the last few days I've been trying to find the reason for a slowness in one very specific case in a software. It looks like it crashes and since it includes many try/catch with (...) it certainly captures the fact, but contrary to what it is expected to do, this one does not get logged! In any event, I wanted to prove that the area where we first were looking was not affected, and sure enough it was not. The problem is somewhere else. However, to prove that I needed to have a way to log milli-seconds because things happen very fast and a 1 second decimation is definitively not enough.

get_defined_vars() PHP function

Once in a while, I need to get the complete list of all the variables available in a PHP piece of code.

This is done with the get_defined_vars() PHP function. It's very simple, it returns an array of name / value pairs. You can then print that value using print_r() or var_dump().

That's it!

Verifying the md5sum of Installed Debian or Ubuntu packages

I always wondered why we couldn't just use dpkg to verify that the installed packages have not be tempered with. I know that the feature is hardly safe if the md5's are saved on the same computer, even the same hard drive...

Still, once in a while it's just a manual error that requires me to check that I did do something wrong on my computer.

Under Red Hat the rpm packager offers the -V option: Verify.

Under Debian and thus Ubuntu and other derivatives, the debsums tool has to be installed and used for that purpose.

  sudo apt-get install debsums
  debsums -s <package ...

Trace PHP code with xdebug

xdebug

XDebug "logo"I'm very much working on Drupal and once in a while, I just have no clue what the code does... especially when there are callbacks that call callbacks in forever loops.

MS-Access Report not printing

Reports, Print and Load() Event

I wrote many forms and in general everything works just fine.

In this case, I wanted to enter the data with a function so I could properly format several of the fields (especially the billing and shipping addresses.) That was done on the Load() event. That function working great when looking at the report from within MS-Access (on screen report). However, when directly sending the report to the printer, it was not working well at all.

[toc hidden:1]

wsprintf() limit under MS-Windows

Today I wanted to check out a set of floating value in my Visual C++ development environment.

You can use the OutputDebugString() to print a debug string in the VC++ output window when running a software. This is quite handy, but when working in C++, string handling can be tedious. I need to create a message and wrote something similar to this:

wchar_t msg[128];
swprintf(msg, "Float: %f\n", my_float);
...

[toc hidden:1]

Drupal SimpleMenu & Javascript errors

Somehow, once in a while, I just don't get my navigation menu at the top of my screen.

I use the Drupal SimpleMenu module. It works in most cases, yet you have to make sure that your theme include the print $closure before the closing body tag. Something like this:

    ...
    <?php print $closure; ?>
  </body>
</html>

This will print the simplemenu variable. It is a Javascript variable used to create the menu. It is an array tree with all the menus and sub-menus and their corresponding label and URL. Simple stuff... The author uses SuperFish to get everything ...

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
Salesperson
Lic. # 02024063

Cory Marcus, Broker
Lic. # 01079165

     

Terms of Site Index

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