The Linux Page

library

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.

Getting username or computername with MS-Access

Introduction

These are common questions for MS-Access users:

  • How can I get the name of the currently logged on user?
  • How can I get the name of the computer the user is working on?

Both names are available in the Kernel and we can make use of a function declaration to access those names.

MS-Access Functions

To determine the name of the current user:

Private Declare Function GetUserName Lib "advapi32.dll" _
    Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Public Function GetLogonName() As String
    Dim lpBuf As ...

PHP Startup: Unable to load dynamic library http.so: undefined symbol: Z_ADDREF_P in Unknown on line 0

Today I helped a customer get a PECL extension going. The first error I was getting was as follow:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/http.so' - /usr/lib64/php/modules/http.so: cannot open shared object file: No such file or directory in Unknown on line 0

Obviously the extension was not yet installed... I run pear install pecl/pecl_http in order to get it to work, which it did after I installed the C compiler, the curl header files, and a few other things.

After a few minutes, I got the message:

install ok: ...

MFC80U.dll, MSCRT80.dll, etc. missing

As I was working in Visual Studio today I had a problem with AQtime which I just installed. More or less, AQtime attempts to read the file that you're just writing and at the time you try to save the manifest in the output, it fails because AQtime has the .exe open in Read Only mode.

To fix the problem I simple said don't generate the manifest, which seemed the be the right solution. That made the compilation work great, but then AQtime would not be able to start the executable. Seemingly nothing would happen (i.e. type F5, made sure the parameters were fine, click Run, AQtime and the ...

Qt and DLL mismatch / error

My Story

I'm using Qt under Linux and MS-Windows.

When I started with MS-Windows, I could not run the Release version. I thought the problem was because I was using a pre-compiled version of Qt 4.6.x and let it go for a while.

At some point, I finally upgraded to Qt 4.7.x thinking that would clear off that Release problem.

This time around, I actually compiled the library, see instructions here:

  Compile Qt 4.7.x with Visual Studio 10 (VC++ 2010)

The result was that a few bugs I noticed while running with 4.6.x were gone. Nice. However, I still couldn't run with the release version. Why would that be?

I

Norton Anti-Programmers

Today I discovered why I was having a few hurdles last week.

The IT department pushed the installation of Norton Anti-virus with some Internet controls, whatever the exact name is...

The utility installs itself intrinsically in the operating system. This means it actually transforms a certain number of low level functions to manipulate your data files and check them as soon as they are created.

The potential results are that as your compile files:

  1. The file may be found to be locked (Norton locks it to verify it even if the compiler isn't finished.)
  2. The file may be removed ...

Find Qt version: command line, compile time, run time

Introduction

The Qt library version can be retrieved in all sorts of ways. There are a few I use:

Command Line Version

The Qt tools will display the version. One of the simplest way is to use qmake as in:

qmake --version

It will tell you which version of the Qt library it is using.

When writing a configuration script, you most certainly want to make use of the pkg-config tool (at least under Linux and Cygwin):

pkg-config --modversion QtCore

The result is just the version of the specified module. To find all the available module look in the ...

Compile Qt 4.7.x with Visual Studio 10 (VC++ 2010)

Try to recompile Qt with Pavel's instructrions...

I did not encounter much problems, although the examples failed. It looks like jom would be the problem as some people reported not having problems following the same steps, but using nmake instead of jom.

The instructions go like this: [Update: the links below all stopped working.]

  1. Visual C++ 2010 contains all necessary SDKs for Qt compilation. However if you plan to use Qt with Phonon you need to install additional software from Qt for Windows Requirements list.
     
  2. Download and extract Qt 4.7.4 Sources. (Or Qt ...

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 application was unable to start correctly (0xC0150002). Click OK to close the application.

On MS-Windows, you get really strange errors and at times some of those errors are difficult to fix.

Sams Teach Yourself C++The error 0xC0150002 means that a DLL could not be loaded and thus the software could not get started since a piece of it was missing. The only solution is to "close the application" (since it wasn't really started, closing it sounds a bit funny here.)

There are several ways to find out about the problem. In Visual Studio, the output should tell you what is happening and that a library could not be loaded. However, many times, low level libraries will not be displayed in the ...

Syndicate content Syndicate content

SMS From Me Logo

SMS From Me

To automatically start one on one conversations with your online leads.

     

   

Terms of Site Index

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

  • Postfix
  • Windows
  • bug
  • number

    All software make use of numbers. Everything is a number. The most basic number in a computer is 0 or 1. This is called a bit. These are represented with electricity. Although in most cases we see it as 0 - Ground and 1 - Voltage (i.e. 1 volt), the bit representation in software and in hardware may be interpreted either way (i.e. a 0 could mean that the voltage is 1V and not 0V.)

    Combining these zeroes and ones we offer end users to handle much larger numbers. With 8 bits, you can have numbers from 0 to 255 (unsigned) or -128 to +127 (signed.) Now a day, computers can handle a much larger number of bits in one cycle. Most processors use 64 bits but they can calculate numbers on 128, 256, and for some 1024 bits at once. Also with parallelism, the size can be viewed as even larger (i.e. handling a 64 bit number in 1,536 threads like on my old nVidra Quadro 600 is equivalent to one large number of 98,304 bits! That would be 2 power 98,304 possibilitie or about 2.8359e+29592 in decimal.)

    Integers are easy to handle. Although when working on math problems you generally see the set of avaialble numbers as equivalent to N although mathematicians know that computers can really only handle a limited set of numbers. For example, on a 64 bit computer, the usual range is -9223372036854775808 to 9223372036854775807, This is generally enough although at times some equations have to be reworked to avoid really large or small intermediate numbers that work fine in math equations, but not so well on computers.

    Now, math also includes other sets of numbers such as D, R, and C. Computers do not offer any way to represent numbers in R or C but they can offer D to some extend. These numbers are called floating point numbers because we do math using an exponent. The exponent makes the decimal point "float" in any location as the number used for the exponent offers. Using a 64 bit floating point, you can have positive and negative numbers with precision varing betwee 10-308 and 10+308. This includes a positive zero (+0) and a negative zero (-0), which is import in a few cases (although +0 = -0 is true, you can get the sign of a number and distinguish both zeroes). Note that at first decimal numbers were going to also have a positive and negative zero, but it was instead decided to have one more negative number (remember, with 8 bits we have signed numbers from -128 to +127, this is because in the positive numbers we have a 0 which we don't have in the negative numbers.)

  • qemu