Category Archives: Misc - Page 14

WordPress Theme zBench: Show only Titles in Category listing

As far as I can tell this functionality is not built into theWordpress Theme zBench. So here is what I did to make it happen:

  1. Locate the file archive.php (wordpress_dir/wp-content/themes/zBench/archive.php)
  2. On row 32 there is a code snippet looking like this:
    <?php if ( $options['excerpt_check']=='true' ) { the_excerpt(__('Read more »','zbench')); } else { the_content(__('Read more »','zbench')); } ?>

    Now comment out the last part like this:

    <?php if ( $options['excerpt_check']=='true' ) { the_excerpt(__('Read more »','zbench')); } else { /*the_content(__('Read more »','zbench'));*/ } ?>
  3. Save the file and reload the page and you should now only see the titles of you posts in the Category listing

NOTE: The excerpt option has to be disabled in the theme for this to work

This was tested on WordPress 3.1.4 and zBench 1.2.4

mqjbnd.dll – Can’t load IA 32-bit .dll on a AMD 64-bit platform

For me this happened when I was trying to run a program that uses JMS to connect to a Websphere MQ queue. The solution was pretty simple.

My PATH variable looked like this:

PATH="C:Program Files (x86)\IBM\WebSphere MQ\Java\lib;C:Program Files (x86)\IBMWebSphere MQ\Java\lib64;..."

The problem here was simply that the first MQ lib pointed to ‘lib‘ and not ‘lib64‘. So after I swapped the order of the paths

PATH="C:Program Files (x86)\IBM\WebSphere MQ\Java\lib64;C:Program Files (x86)\IBM\WebSphere MQ\Java\lib;..."

Everything worked again. Pretty simple solution but it took me quite a while to find it.
The Path variables were set by the installation program. I guess that if I had set them myself I would have seen it sooner but you never know. Sometimes you just can see the forest for all the trees 😉

Happened on Websphere MQ Server 7.0

Use macros in VIM – a example

This is a very nice function in VIM. The ability to record your actions and play them back one or hundreds of times. Perfect for doing boring time consuming and repetitive tasks in text files.

Here is a problem that I solved using macro recording in VIM:

I had a list of 233 customer numbers from a database in a file like this:

0000003173
0000003064
0000003084
0000003540
0000003539
0000003140
0000003089
...

Now I had to use these numbers in a SQL expression. Problem was that the numbers actually were text strings. Going thru 233 rows adding ‘ to each side of the number plus a comma after each row would take quite some time and I would be very boring. So here is what I did:

I opened the the file in VIM.

Start recording

Esc  #switch to command mode
q    #start recording
a    #name macro 'a' - you can choose any low case letter here

This will start the recording process and place the text recording on the last line of the window

Now I pressed ‘i’ for Insert Mode (– – INSERT – – recording)

Then I simply added a before and after the topmost number and ended with a , (comma) so it looked like this:

'0000003173',
0000003064
0000003084
0000003540
0000003539
0000003140
0000003089
...

I then placed the cursor infront of the second number, pressed ESC (to exit INSERT mode) and then‘q’ to stop the recording (the word ‘recording’ disappears)

Now to run this on the rest of the 232 numbers you just write (in command mode):

232@a # This runs the macro named 'a' 232 times

If you one want to run it once just write ‘@a’ – the number before is how many times you want to run the macro

After this I ended up with a file looking like this

'0000003173',
'0000003064',
'0000003084',
'0000003540',
'0000003539',
'0000003140',
'0000003089',
...

Very smooth indeed 🙂