Monday, October 18, 2010

Garage Cleanup Idea

Ran across this website. I need to forward it along to my parents. I don't think they've seen their garage floor in years.

Thursday, March 18, 2010

LNK2019 - Undefined External Symbol

LNK2019 errors are fun to track down. Nothing like "Undefined External Symbol" to strike fear in your mind.

LNK2019 means that one of the functions or classes that you are using cannot be found. Well duh, but why can't the linker find it?

So you have 2 projects. One is a static lib project, the other is using the static lib. When linking to the static lib, it can't find one of the functions or classes that you are using in your non static lib project.

First make sure that the project settings are looking in the right place for the static lib. Then use dumpbin.exe to analyze the static lib and make sure the symbols are actually defined in the static lib.

If you don't find the symbol your looking for in the output from dumpbin.exe, then take a look at your static lib. What is most likely happening is some of your functions have prototypes, but the actual implementation is missing. i.e. look for .cpp files that need to be added to the static lib, or actually code up the prototypes that are missing bodies.

Turn Text in Drupal to HTML

So you have some text in drupal, and you want it to be formatted with HTML. Use check_markup.

Friday, November 27, 2009

Joomla: Redirect to same page after login

Here's some code to redirect Joomla to the page you want, after forcing a user to login first.


$uri =& JFactory::getURI();
$redirect = '&return='.base64_encode($uri->toString());
$this->setRedirect(JRoute::_('/index.php?option=com_user&view=login'.$redirect),
"Please login.");

Wednesday, November 25, 2009

A TAB is 4 Spaces

A TAB is 4 Spaces.

In .vimrc or _vimrc add these lines:

set autoindent
set smartindent
set tabstop=4 shiftwidth=4
set expandtab

Tuesday, November 10, 2009

Mac Quirks: Multiple From Emails with Apple Mail

Thanks to Michael Voong for this tip. There is bare minimal documentation from Apple on how to add multiple email addresses to a single account in their email program.

The solution, edit your email account settings using a comma separated list for all the email addresses or email aliases you want to be able to use in Apple Mail.

Wednesday, October 14, 2009

Recursively Remove .svn directories on Linux

To recursively remove .svn directories on Linux:


rm -rf `find . -type d -name .svn`

Wednesday, August 26, 2009

Python 2.6, py2exe, and VC++ Runtime Issues

I got this annoying error the other day, while freezing a python 2.6 executable on Windows:

py2exe msvcp90.dll no such file or directory

Background:

Python 2.6 uses Visual Studio 2008, and so it requires the Visual Studio 2008 C++ Runtime (vcredist).

I saw a few posts on the web, here and here. They get the solution partially right.

The Correct way to fix py2exe msvcp90.dll no such file or directory.

In your setup.py file first exclude the dll so you can build the exe.

options = {
"py2exe": {
"compressed": 1,
"optimize": 2,
"bundle_files": 2,
"dll_excludes": [
"MSVCP90.dll",
]
}}


Then add this to your manifest file in between the tags:

<dependency>
<dependentassembly>
<assemblyidentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorarchitecture="x86" publickeytoken="1fc8b3b9a1e18e3b"></assemblyidentity>
</dependentassembly>
</dependency>

This allows you to use the vcredist to install the required vc++ dlls on the target system.