The Linux Page

svchost using 99% to 100% of the processor

Today I unearthed an old hard drive with Windows XP on it. After a few hours twiddling I finally got the wireless to work on it... although even before that, the svchost application would make use of 99%+ of the processing time.

With just the default System Manager it's hard to find out what really takes time, so I downloaded procexp.exe from the Windows website (DON'T DOWNLOAD A VERSION FROM ANYWHERE ELSE!) and that showed me the tree and thus which tool was using all the processor time.

Surprise! Surprise!

The problem was the automatic windows update. (the

Updating the BIOS on my GA-P55A-UD4P exclusively running Linux

Server Memory Upgrade

I got some new memory for my GA-P55A-UD4P motherboard. It is supposed to support 16Gb of RAM: sweet!!!

So, I got some Kingston which in general the Gigabyte motherboards support. (I had some before.)

I turned off the server and then the powersupply1.

I remove the 2 x 2Gb of RAM and install the new 4 x 4Gb sticks. Make sure it's well sited multiple ...

  • 1. I have one of those power supply you can turn off, there is a switch on it... Without doing so, I can still see some lights on the network connectors meaning that electricity is still running in the machine!

Why aren't my C++ class public functions exported with __dllexport?

I had a problem for the last 2 days and had a hard time to determine what it was...

Now I know how to resolve such a problem, so I wanted to share my finding! It's very simple, but writing about it here may help me later to save time...

So... I wrote a C++ class for a DLL, this means I want it's public functions to be exported:

class MY_CLASS_API myClass {
public:
    ... // declarations and functions
};

Up to here, nothing strange.

The MY_CLASS_API is a macro defined in some random header file:

#if defined(MSWINDOWS)
#  if MY_CLASS_EXPORTS
#    define MY_CLASS_API

The Expression On Load you entered as the event property setting produced the following error: User-defined type not defined

Problem

A few days ago, I made many updates in one of the MS-Access forms I'm working on.

Then, when I tried to open the form I'd get this error...

The Expression On Load you entered as the event property setting produced the following error: User-defined type not defined

This doesn't mean anything to me since I did not define any type... Removing the Form_Load function (commenting it out) made that very error go away, however, since that's the sub-form of another form, it still generates errors when the main form is trying to initialize the sub-form.

Note that 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 ...

unresolved external symbol "public: virtual struct QMetaObject const *__thiscall MyClass::metaObject[...]"

Got a problem with Qt today... and it took me a little time to figure out again and I'm sure some people have something about it, but I couldn't find the right answer anywhere.

Qt has those objects named QObject. You can derive them that class and to complete the object, you want to add a Q_OBJECT inside the class. Something like this:

  class MyClass : public QObject
  {
    Q_OBJECT
    [...your object definitions...]
  };

That Q_OBJECT is what makes your object visible in the Qt environment (i.e. a Find by name will find your object if you give it a name with setObjectName().

A strange looking "The following packages have unmet dependencies" error!

I just upgraded an Ubuntu server from version 9.10 (Karmic Koala) to 10.04 (Lucid Lynx) and started getting a strange error about some package dependencies being unmet. I'm sure I did not intentionally install those packages, so as I was upgrading, I would imagine that they should have been removed automatically if required.

  # apt-get install <some-module>
  Reading package lists... Done
  Building dependency tree      
  Reading state information... Done
  You might want to run `apt-get -f install' to correct these:
  The following packages have unmet dependencies:

Upgrade from Ubuntu 9.10 to 10.04

Today I did an upgrade of a server from 9.10 to 10.04. We were on a server version before upgrading to 9.10 but we could not directly upgrade to 10.04 (working upgrade paths are very specific; see a list here: https://help.ubuntu.com/community/UpgradeNotes )

The most surprising part was the python script at the end.

  /usr/bin/python /tmp/unique-folder/lucid --mode=server --frontend=DistUpgradeViewText

The command line itself is not specifically strange. However, the behavior at the end of the script is a bit strange, mainly because I hadn't see it before. Last time the upgrade was

MS-Access not limiting unbound text fields

When creating an unbound text in MS-Access it is not constrained in length. The text limit you get when the field is bound to the database table is really neat, but there is not direct way to access that code (it's probably something hard coded in the MS-Access system.)

This means you have to re-implement the behavior.

I found this page Unbound text box: limiting entry length which has a very good solution. Just in case the page disappears, there is what I use (a simplified version that doesn't manage errors because I do not like that — errors are not supposed to happen, when they do,

QtTest and "Cannot create a QWidget when no GUI is being used"

Problem

I have to use Qt these days. It's a good system, but there are a few tricks to know about.

As I was starting to write a test, the test needed a lot of numbers but nothing much otherwise. So I decided to limit the #include to a minimum by deleting all of those that I did not need.

The result was this error:

"Cannot create a QWidget when no GUI is being used"

I looked into it and sure enough people talking about it say: Well... where is your GUI?

Great, but I don't see how that helps me in fixing the problem, does it do it for you? Neither?!

Solution

...