Syndicate content

FreeBSD

A Unix operating system created by the University of Berkeley.

The for() in C, C++, Java, PHP, JavaScript...

As I am working on my as2js compiler, I stumble on a couple of problems with the for() loop parsing because of the in keyword. That made me think and the for() statement was actually a very funny one. Yes! You can actually write something like this and it compiles:

int zero;
for(3;2;1) zero;

As you can see, all 3 entries in the for() statement are valid expressions and therefore the compiler can compile that code. This creates a loop that runs forever, similar to:

for(;;) zero;

but much less clear to read, obviously.

Now that's food for thought, isn't it?

In JavaScript, you ...

#PCDATA and DTDs

If you are like me and write DTDs to check your XML files to make sure you don't have too many mistakes in them, then you probably have had this problem before.

The #PCDATA has a very special behavior and it is really restrained as follow:

  • #PCDATA must appear at the start
  • #PCDATA must be repeated from zero to infinity, so only * work with it
  • #PCDATA cannot be used with sub-groups (things between parenthesis)

Some like this:

<!ELEMENT Z (P | (#PCDATA | A | B | C)* | Q)+>

does not work because you use + and #PCDATA is within a sub-group.

What you need to do ...

Readonly content cannot be changed. Libreoffice preventing edits...

Today I opened a document I where I had to make a few edits and LibreOffice decided to tell me:

Readonly content cannot be changed.
No modifications will be accepted.

There is a screenshot of that message:

Error message: Readonly content cannot be changed. No modifications will be accepted.

The error may be justified, I do not know, but apparently not too many people know how to unlock a document. I found pages and pages that tell people to check the read/write protection of the file, as if a read-only file on disk could not be updated in the editor... (yes! you cannot write it back, but you can edit it and do a Save As ...)

One person, though, had the correct answer to ...

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.

Doxygen does not generate documentation for my C functions (or any global function)

As I write programs, mainly in C++, I document them using the Doxygen tool. This is a very powerful parser that is capable to finding functions, variables, macros, and many other things in the source code and attach the corresponding documentation to those functions, variables, macros, etc.

This is extremly practical when creating large projects or libraries that you want to share with others.

One problem though, by default it seems like global functions (and thus C functions) and variables do not make it to the documentation, when C++ classes work fine.

There are two potential issues:

...

Thunderbird Sent folder disappeared

A little while ago I had a problem with the Thunderbird Sent folder.

I'm not too sure what had happened but it just wouldn't work right.

I found a page talking about the problem here:

http://forums.mozillazine.org/viewtopic.php?f=39&t=763585

The solution that worked for me is actually documented in that post. Ther eit is:

  1. Go to your account folder and check the properties.
  2. Click on "Copies & Folders" and then make sure that you use the "Sent" folder option
  3. Enable Place a copy in under "When sending messages, automatically:"
  4. ...

Restore Firefox warnings when viewing non-secure data on a secure page

One thing that I quickly do on my browsers is turn off warnings about non-secure data when browsing secure pages (with HTTPS .)

It's rarely a problem and with all those features you like to have (Facebook, Twitter, AddThis, ShareThis, Google Plus, and othe fun widgets...) it's hard to avoid. Actually, many times the problem lies in one of these scripts and thus you cannot just fix your website. Without that 3rd party script owner fixing their code, it just won't work at all.

Now, once in a while I work on a customer website and they really want to have a 100% clean slate. Thus,

The C++ delete operator, will it do what you expect?

It has always been weird to me to see that the delete operator was not actually going to call all the destructor on objects. That is, if you create a class B that derives from a class A, deleting an object when cast to A does not (by default) call the destructor defined in class B.

The result is that ALL classes should define their destructor as virtual. This doesn't make sense because you shouldn't have to have a virtual table in all your objects just for the destructor to work right. On the other hand, class A has no way to know that it will be derived by class B so its destructor

Creating the right forum paths with autopath...

Today I finally found out how to fix the path of the forums.

The name of the vocabulary is "Forums". To access it as expected in pathauto, you use [vocab-raw].

The result of [vocab-raw] is "forums" (all lowercase.)

Then, by default, pathauto adds the list of categories to the path. This is done using the [catpath-raw]. Say you have a forum named "Linux Stuff", [catpath-raw] will return "Linux Stuff" as is. This makes sense because paths on Linux are case sensitive (actually, it's the same thing with Apache wherever you are using it, although it's a

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

...

Syndicate content Syndicate content

     

Terms of Site Index

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

  • CD-ROM
  • declare
  • dump

    The dump command, under a Unix system, is used to dump the entire file system to another device. By default, the dump output device is a tape device (/dev/tape). Now a day, however, it is often used with other devices such as another file system (from one hard drive to another.)

    Other systems use that same keyword. It is particularly the case of database systems. For instance, the PostgreSQL database has a pg_dump command.

    The opposite command is restore. That command is used to get the data from the output device and put it back on your hard drive.

  • table
  • wput