2008-10-25

Reusing Custom Page Styles With @-moz-document

After using the Firefox Stylish add-in to increase the contrast between the text and background colours of domains, I wanted to apply the same rule to different domains. In this case, I want to reuse the text colour of P elements in two or more domains.

Open a Stylish script and note that it has a sequence of @-moz-document definitions, for example:

@-moz-document domain(addons.mozilla.org) {
  p { color : black; }
}

@-moz-document domain(msdn.com) {
  p { color : black; }
}

The @-moz-document rule can accept a comma-separated URL list, so I can re-use my style definition like this:

@-moz-document domain(addons.mozilla.org), domain(msdn.com) {
  p { color : black; }
}

See Also

2008-10-04

NetBeans and WinCVS local repository

On my Vista computer, I have a local CVS repository for version control in this folder: C:\Users\<user>\Documents\Repository. I checked out a module using WinCVS 2.0.2.4 Build 4, so the module's CVSROOT is C:\Users\<user>\Documents\Repository. When I start any CVS operation in NetBeans 6.1, the operation is queued and hangs, or NetBeans reports this error: The pipe has been ended.

If you look into the NetBeans log file, C:\Users\<user>\AppData\Local\Temp\outputN (where N is a number), you can find the following entry: cvs [server aborted]: C:\Users\<user>\Documents\Repository: no such repository.

Here's a workaround using CVSNT 2.0.51d.

First, add a repository name in the CVSNT Service. For me, I use Repository:

  1. Open Windows' Control Panel.
  2. Select the CVS for NT icon. Windows should open the CVSNT applet (in Vista, you have to confirm that you allow this legacy CPL applet to run).
  3. In the Status Service tab, stop CVS Service and CVS Lock Service.
  4. Select the Repositories tab.
  5. Press the Add button to create a new repository name. The Edit Repository dialog should appear.
  6. Set Location: = C:\Users\<user>\Documents\Repository.
  7. Set Name: = /Repository.
  8. Press the OK button save your repository name and close the Edit Repository dialog.
  9. Select the Service Status tab and start the CVS service.
  10. In the Status Service tab, start CVS Service and CVS Lock Service.
  11. Press the OK button to save your settings and close the CVSNT applet.

Second, edit all CVS/ROOT files in your project and replace the folder path with: :local:/Repository.

This entry tells NetBeans to use the :local: protocol to find Repository. However, WinCVS does not understand the :local: protocol, so you can't use WinCVS to maintain your project any more.

2008-09-30

Black Text, Please

It makes my eyes water to read grey text on a white background, so much so that I was motivated to learn how to use the Greasemonkey Ain't It Readable script to set text in <p> elements to black. Using Greasemonkey just to set a single CSS attribute was an overkill, so I turned it off and wrote this rule for the Stylish add-in: p { color:black; }.

See Also

2008-09-27

GDB 6.8 in NetBeans 6.1 Hangs

When trying to debug a C++ program in NetBeans 6.1 using MinGW gdb 6.8, gdb would hang when starting (and cause NetBeans to hang as well). My workaround was to restart NetBeans, open the debug window (see Windows / Debug menu item) and delete all breakpoints.

This thread gdb 6.8.0 debug process in netbeans 6.1 hangs? shows where to find gdb's log file to help solve the problem (in Vista, it's C:\Users\<user>\AppData\Local\Temp\gdb-cmdsX.log).