Gospel study notes and technical journal

I love OneNote. I’ve become so much more organized since I’ve made it the central tool I use to all of my note taking and planning.

For me the key to being really proficient with it has been learning and using as many of the keyboard shortcuts as I can. One new keyboard shortcut that OneNote has added by default is for bulleted and numbered lists. I really like the default as it makes sense and is easy to remember. It is Ctrl + . for bulleted lists and Ctrl + / for numbered lists. The period naturally makes me think of a bullet and the slash is right next to the preiod and can also be remembered (at least for me) as a slanted “1” which of course we would begin our numbered list with.

The only problem is this is not the default and not uniform throughout the office suite of products. Here’s how to remedy this (at least for the bulleted and numbered list keyboard shortcuts. In Word 2007 click on the “Office Button”

Next, click on “Word Options” at the bottom right.

Word Options

Then choose “Customize” on the left side

Click on “Keyboard shortcuts: customize” as shown below.

On the left side under categories scroll down until you see “all commands.” Click on that and then on the right side under commands scroll down until you see “FormatBulletDefault” and click on that. If that seems unintuitive to you then you are not alone. You’d think it would begin with Insert… right?

Format Bullet Default

Now you click in the “Press new shortcut key” input box and then actually press the keyboard combination that you want to assign. Then click on “Assign” at the bottom left. You’re done!

Rather than stepping through the code in a debugger, the first thing you should think of when a title isn’t being rewritten as you’d expect when using an SEO plugin such as yoast seo is FILTERS.

WordPress uses the “add_filter()” function to register or associate a custom function as a filter for a core wordpress function. In the case of controlling the formatting of the <title></title> tag for pages, the “wp_title()” function is the core wordpress function that comes into play.

When a custom function gets registered as a filter for a core wordpress function the custom function gets added to an array that holds a list of the filters that are associated with the core wordpress function in question. So, if we’re having a problem with the title tag not being formatted the way we expect it should be, then we should begin by getting a list of all of the custom functions that are registered as filters for the wp_title() wordpress function.

Thanks to t31os, we have a function that will provide the list that we are looking for. Here is the function he provides. Just in case that link goes down, I’m reproducing his code here:

function print_filters_for( $hook = '') {

global $wp_filter;

if( empty( $hook ) || !isset( $wp_filter[$hook] ) )

return;

print '<pre>';

print_r( $wp_filter[$hook] );

print '</pre>';

}

Call it where you need it.

print_filters_for( 'the_content');

In our case, ‘the_content‘ is going to be ‘wp_title‘.

Here’s the output that was generated from this for a site I was working on:

Array

(

[10] => Array

(

[wptexturize] => Array

(

[function] => wptexturize

[accepted_args] => 1

)

[convert_chars] => Array

(

[function] => convert_chars

[accepted_args] => 1

)

[esc_html] => Array

(

[function] => esc_html

[accepted_args] => 1

)

[2f4715287fb31e3313798458a40aab59title] => Array

(

[function] => Array

(

[0] => WPSEO_Frontend Object

(

)

[1] => title

)

[accepted_args] => 3

)

[ts_filter_wp_title] => Array

(

[function] => ts_filter_wp_title

[accepted_args] => 2

)

)

)

I got this by adding the print_filters_for() function to the theme function.php file at the top. ie. -> /wp-content/themes/[your theme]/functions.php

And then adding the function call in the header.php template file somewhere where it would show up on the page (being sure to put “wp_title” instead of “the_content”). Then I loaded the home page so the information showed up, then before I even looked through the array results I commented out the call to the print_filters_for() function and saved it so that visitors to the site wouldn’t be seeing the array output.

So the output that we get represents all of the functions that are registered as filters for the wordpress wp_title() function. Any of them could be the culprit, but my attention immediately gets drawn to the last one -> [ts_filter_wp_title]

I’m sure there’s some way for the print_filters_for() function to also display the file where the function is defined, but I’m not going to take the time to figure out how to do that. Because of that, we’ll just have to pull down all of the php files in the theme and search through all of them for the “ts_filter_wp_title” function. It ends up for the site I’m working on that it’s in /wp-content/themes/[my theme]/includes/theme-function.php.

Now that we’ve found it, we just need to comment out the line where it actually registers the filter.

It looks like Intuit finally provided an easy fix for the perpetual and never-ending problem with the Ayumani print driver that comes with quickbooks previous to Quickbooks 2011 (I think).

Your mileage may vary, but this worked for me. Just download this file and run it.

I actually did a google search to find the file online so I could point to it, but now I can’t find it. I’m sure glad I did find it and that I kept a copy on my local pc. Only problem is that some of you will probably be leery of running a program that you’re not downloading straight from intuit. Nothing I can do about that except to say that I haven’t modified this file in any way and you’re just going to have to take a leap of faith and try it out.

The key to getting things working is to return google to it’s glory days when it didn’t have all of the extra stuff. You can do that with one checkbox in the options for the google enhancer add-on.

You also need to install the greasemonkey add-on and then restart firefox. After you’ve restarted you can navigate to the site where the greasemonkey script resides that will number the result for you. You could also just turn on the numbering option in the GoogleEnhancer options

but it wasn’t working for me for some reason. Also, when it did work, it would include numbering for the blended results which would throw off the regular numbering.

When the search results include a 7 pack, it does not number those. But when we get blended results as in the image above, it does number those results, which is not the most ideal, but beggars can’t be choosers.

This was difficult information to find. I searched for a method using Notepad++, Vim for windows, and a few others, but finally found the easy way to do this using – of all things – Microsoft Word.

I’ll spare you the details of the other methods I attempted and just give you the detailed answer of how to accomplish this with Microsoft Word.

So I’ll use my scenario as the example for what you might want to use this for.

I had a bunch of html code from which I needed to extract every instance of anchor text between the <a href=”…”></a> tags. In this particular case here is how you accomplish this:

Paste the html code you are working on into a new word document.

Press ctrl+f to bring up the “Find and Replace” dialog box.

In my particular case I used this code in the “Find what:” field. -> \”\>(*)\<\/a\>

Your needs will most likely be different and you will need to research a bit if you’re unfamiliar with regular expressions. Even if you are familiar with regular expressions (as I am) you’ll still probably need to do a little research to get the exact expression that will work for you. I’m sure there are regex gurus out there who dream in regex, but in my case I find that I always have to spend more time than I would like just coming up with the syntax for the regular expression that will provide me the results I am looking for. Microsoft Word regular expressions.

In the “Search Options” portion on the bottom half of the dialog box you’ll need to check the box “Use wildcards”. This is what enables the regular expression functionality of Microsoft Word.

Just to get a preview of your results click on the “Reading Highlight” drop-down box and choose “Highlight All”

Here are the results in my scenario (which is exactly what I want… well, not exactly. I’d like to just get the text in between the <a> and </a> tags, but I don’t know how to do that in one step. The only way I know to do it is to include the “> and the </a> at the beginning and end of the regular expression so that it captures what I’m looking for):

Once you’ve verified that you’re getting the results you want by choosing “Highlight All” to preview it, then you click on “Find in” and choose “Main Document”

All of your highlighted text will now actually♦ be selected. Now right click on top of any of the selected areas in the document and click on “copy”.

Press ctrl+n to create a new document.

Press ctrl+v to paste what you’ve just copied to the clipboard into your new document.

Press ctrl+f to bring up the “Find and Replace” dialog box again. Now click on the “Replace” tab.

In the “Find what:” field make sure you still have this code -> \”\>(*)\<\/a\>

In the “Replace with:” field put this code -> “\1” (without the quotation marks)

Make sure the “Use wildcards” checkbox is checked and then click “Replace All”

I could not figure out for the life of me why the QM overlay for modX was not working. When you’re logged in as admin on the backend then when you preview a page you’re supposed to get what’s called the “Quick Manager” overlay at the top. I was getting this when inexplicably it disappeared and I was only able to get it to come back here and there. I could not figure out what caused it to work and what caused it not to work specifically.

Here’s some pics just to make this look nice:

This is without the QM overlay.

Here it is with the QM overlay before it is extended when you hover over it (the thin little darker strip at the top)

Here it is fully extended.

So, I went through A LOT to finally figure it out. I tested it on valleywideplumbing.com with my firefox browser by backing up the DB and the templates folder and putting them into a fresh installation on that domain. I avoided interrupting the production environment because right now it is set up statically with .html files and the apache web server is set to give precedence to .html extensions over .php. The modX engine works beginning with the index.php file which is located in the root folder for your modX installation. So, since there was an index.html file there it did not matter that the index.php file was there because the .html is what was displayed. That’s how I was able to test this in parallel with the production site running.

Anyway, from my MANY different tests I was convinced there was something wrong with my firefox install. I completely uninstalled firefox together with searching through the registry and removing any references to firefox and mozilla there. I did back up my extensions, passwords, etc. with MozBackup which I am very glad I did as it was a huge time saver. After all of that I got it to work and I thought “problem solved”. But then it went back to not coming up again.

**Tld = “Top Level Domain”

Finally I discovered the difference. For Valleywideplumbing.com the mod_rewrite 301 redirect for valleywideplumbing.com -> www.valleywideplumbing.com was working correctly including for the tld**/manager/ folder. For some reason the redirect was not working correctly for brinformation.com for the tld/manager folder. I had worked on this extensively before and could not figure out how to get it to work. It would redirect for the tld and other folders that were created via the “#friendly urls” mod_rewrite rules, but would not for manager. Anyway, I copied what was set up for valleywideplubming and finally got it working for brinformation.

So, that was the problem. You HAVE TO log in to the manager using the domain name that you have configured within modx. Ie: www.brinformation.com if that’s how it’s set up in modx, or just brinformation.com if that’s how it’s set up. The [(site_url)] system variable is created via the config.inc.php file which resides in /manager/includes/ and is generated with the following line of code (within config.inc.php)

$site_url .= $_SERVER[‘HTTP_HOST’];

So, it pulls it from the apache $_SERVER[‘HTTP_HOST’] variable which is based on what was requested by the user-agent (me in this case.. Or my browser on my behalf technically). So, since I was putting in “brinformation.com/manager” and it wasn’t getting rewritten properly to www.brinformation.com/manager then when previewing the pages the url was being written correctly with the preceeding www. and so the http_host variable was different between the http://brinformation.com/manager and the http://www.brinformation.com/index.php?id=1 (or whatever page id we’re previewing)

Whew. I think that makes sense. Even if it doesn’t, it’s fixed! Woohoo!

I spent a while figuring out what was causing firefox to go up to 99% CPU utilization and Move Media Player was not playing at all.

I found a few other posts through google of people having stability issues with firefox 3.6 in general. But the particular fix for Move Media Player was to upgrade to the latest version of the player (of course). But where do you find it? I was trying to use the Move player to watch General Conference at beta.lds.org/general-conference. As of 4/8/2010 the version they have you download is not the latest one offered by Move.