Sunday, August 8, 2010

Get event keycode in both Firefox and Internet Explorer

This solution should work in both IE and Firefox.

JS -

function getCharCode(event)
{
var charCode = (event.which) ? event.which : event.keyCode;

// Might want to get the character representation of the Unicode keycode -

var character = String.fromCharCode(keycode);


}

HTML -

Just put an onkeypress="getCharCode(event)" event handeler in your input code (textarea, whatever)

Wednesday, July 14, 2010

Open files in a folder recursively with Notepad++

Open Explorer and drag the folder on top of the Notepad++ window (somewhere in the main window).

I'm posting this because I could not find out how to do this quickly with a simple Google search -- hopefully someone else will have this question and stumble on this post through the keywords.

Friday, June 4, 2010

Installing Canon MF3240 on Windows 7 64 bit (x64)

You probably inserted the CD that came with this printer and got a dialog box during the driver installation that complained about 64-bit incompatibility. Thanks, Canon, for providing the 64 bit drivers on the CD! (/sarcasm)

Anyway -- here's how you install the scanner and printer drivers for this device on Windows 7 64-bit machines --

  1. Detach the printer from the computer.
  2. Visit the follow link (http://www.usa.canon.com/consumer/controller?act=ModelInfoAct&tabact=DownloadDetailTabAct&fcategoryid=335&modelid=12943)
  3. Find the "Select OS" dropdown and select "Windows 7 (x64)" from the list.
  4. Click the red download link (MF3200_MFDrivers_Win_x64_us_EN_7.exe).
  5. Scroll to the bottom of the next page and click "I agree -- begin download".
  6. Save the executable to an easy to remember location on your computer. Browse to the folder in Explorer and run it. It will extract the drivers to a subdirectory in the same directory as the executable called "MF3200_MFDrivers_Win_x64_us_EN_7". Remember the location of this folder for later.
  7. Attach the printer to the computer.
  8. Ignore or cancel out of any automatic prompts that Windows tries to open. It will not be able to find the right drivers on Windows Update or elsewhere.
  9. Click the Start menu button and search for "Device Manager". Open it.
  10. Under both the "Imaging devices" and "Other Devices" tree menu subitems, you will see CanonMF3200 devices (there should be a CanonMF3200 entry in both tree menu subitems). They should have question marks or exclimation marks next to them, meaning they are not functioning or are not installed.
  11. Right click on both of these devices and select "Update Driver Software". Click
    Browse my computer from driver software" and browse to the driver folder ( that you extracted to earlier (called "MF3200_MFDrivers_Win_x64_us_EN_7"). Again, you will need to do this two times -- for both devices (scanner / fax and printer).
  12. You should be done.

Let me know if you need clarification or this does not work.

Friday, April 16, 2010

7-zip not in context menu 64-bit Windows 7

This is a known problem.

Solution / Workaround: Download 7-zip 32 bit version. This version should put items in the context menu.

Thursday, March 25, 2010

MagpieRSS question marks

If you are trying to use MagpieRSS, you might encounter an issue where quotation marks (single and double quotation marks), and other characters, are simply displayed as questions marks (?) in the RSS output.

The issue is an charset issue. 1) You need to tell Magpie to output in utf-8. 2) Additionally, your HTML page needs to be in the same charset.

For 1)

Before any of your MagpieRSS code ... include these PHP statements.

define('MAGPIE_INPUT_ENCODING', 'UTF-8');

define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');


For 2)

Make sure your page has this at the top ... you might need to replace whatever is already defined on the page.

EDIT: Blogger doesn't like META tags ... here is what you need at the top of your page: http://pastebin.ca/1852343


Thanks to http://forums.digitalpoint.com/showthread.php?t=309378 for the tips.

Saturday, March 6, 2010

Concatenate Date and Time From Two Fields -- MySQL

Example
In this example, I'm checking whether a time slot in a schedule table is in the future.

SELECT * FROM table
WHERE concat(date(appt_date)," ",time(start_time)) > NOW( )
ORDER by appt_date desc, start_time desc, end_time desc

Sunday, January 24, 2010

Change essays, application after submission of Common Application (CommonApp)

Copy and paste this is your browser --

https://www.commonapp.org/CommonApp/Default.aspx?allowcopy=true

Then sign in and follow the instructions. You'll want to click the "Replicate" button on this page.

Saturday, January 23, 2010

Bottled water - wasteful, expensive, and unsanitary

Bottled water has three general problems -- it's wasteful, expensive, and unsanitary.

Source: http://www.onlineeducation.net/bottled_water/

Wasteful
-----------

a) They are horrible for the environment (17 million barrels of oil are used in the production of water bottles every year).

b) It takes 3 times the amount of water to produce the bottle as it does to fill it.

Expensive
-----------

c) Bottled water is extremely costly relative to tap water (up to 10,000x as expensive) -- .0015 cents / gallon vs $10 / gallon). In some alternate universe, this might actually be worth it if the water was sanitary, but it's not (points d, e, and f).

Unsanitary
-----------

d) 40% of bottled water has been taken from municipal water sources (i.e. 40% of bottled water IS tap water).

e) 22% of bottled water contains chemical contaminants at levels above strict state health limits.

f) Bottled water isn't regulated like tap water is. It doesn't have to be checked for E Coli, it is not subject to quality reports, the companies that produce it are not required to provide the source of the water, and it can still be distributed when tap water standards (which are deplorable and outdated it and of themselves) are not met.

Basically, bottled water is even worse than tap water, on almost every count. Except, I think it tastes better, (but certainly not because it's cleaner)