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)

Something 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 ...

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

Today I opened a document 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.

  • array
  • authentication
  • free
  • preferences
  • reboot

    The action of restarting a computer is called reboot. This reloads the operating system and your different auto-start software.

    There are two types of reboots: a cold reboot and a warm reboot.

    The cold reboot is the one where you turn your computer all the way off and back on. It is considered to be the ultimate reboot which ensures that everything is alright.

    The warm reboot is when you just reboot your operating system. This means some of the hardware parts may not be fully reset as expected in a cold reboot. There are several reasons for this, at times the BIOS of your system does not give the correct signals to all the parts, and at times the signal doesn't propagate to all the parts as it should.

    This is why a warm reboot does not always work (i.e. think when you change a driver and the new driver is not able to properly reset the state of a board or chip... turning the computer all the way off and back on may resolve the problem.)