Dec16

2012 Top Safety Pick

Posted by: Brian Chan | Filed in: Uncategorized | Tags: | 10:13 am, December 16th, 2011 No Comments »

The Insurance Institute for Highway Safety (IIHS) is a nonprofit organization dedicated to reducing deaths, injuries, and property damage that result from crashes on the nation’s roads. Our research focuses on three main areas: human factors, or preventing crashes by changing driver behavior; vehicle factors, or reducing deaths and injuries by improving vehicle design; and environmental factors, or changing roadway design, signs, and signals to reduce crashes.

They just released the 2012 Top Safety Pick winners report.

ALL 115 WINNERS

Minicars
Fiat 500 built after July 2011
Ford Fiesta sedan and hatchback
Honda Fit
Toyota Yaris 4-door hatchback

Small cars
Chevrolet Cruze
Chevrolet Sonic
Chevrolet Volt
Ford Focus
Honda Civic 4-door
Honda CR-Z
Honda Insight
Hyundai Elantra
Kia Forte sedan
Kia Soul
Lexus CT 200h
Mazda 3 sedan and hatchback
Mini Cooper Countryman
Mitsubishi Lancer except Ralliart and Evolution
Nissan Cube
Nissan Juke
Nissan Leaf
Scion tC
Scion xB
Scion xD
Subaru Impreza except WRX
Toyota Corolla
Toyota Prius
Volkswagen Golf 4-door
Volkswagen GTI 4-door

Midsize moderately priced cars
Audi A3
Buick Verano
Chevrolet Malibu
Chrysler 200 4-door
Dodge Avenger
Ford Fusion
Honda Accord
Hyundai Sonata
Kia Optima
Subaru Legacy
Subaru Outback
Toyota Camry
Toyota Prius v
Volkswagen Jetta sedan
Volkswagen Jetta SportWagen
Volkswagen Passat
Volvo C30

Midsize luxury/near luxury cars
Acura TL built after September 2011
Acura TSX sedan and hatchback
Audi A4
Lincoln MKZ
Mercedes C-Class
Volkswagen CC except 4-wheel drive
Volvo S60

Large family cars
Buick LaCrosse
Buick Regal
Chrysler 300
Dodge Charger
Ford Taurus
Toyota Avalon

Large luxury cars
Audi A6
BMW 5 series except 4-wheel drive and V8
Cadillac CTS sedan
Hyundai Equus
Hyundai Genesis
Infiniti M37/M56 except M56x 4-wheel drive
Lincoln MKS
Mercedes E-Class sedan
Mercedes E-Class coupe
Saab 9-5
Volvo S80

Small SUVs
Honda CR-V
Hyundai Tucson
Jeep Patriot with optional side torso airbags
Kia Sportage
Subaru Forester
Volkswagen Tiguan

Midsize SUVs
Chevrolet Equinox
Dodge Durango
Dodge Journey
Ford Edge
Ford Explorer
Ford Flex
GMC Terrain
Honda Pilot
Hyundai Santa Fe
Jeep Grand Cherokee
Kia Sorento
Subaru Tribeca
Toyota Highlander
Toyota Venza

Midsize luxury SUVs
Acura MDX
Audi Q5
BMW X3
Cadillac SRX
Infiniti EX35
Lexus RX
Lincoln MKT
Lincoln MKX
Mercedes GLK
Mercedes M-Class
Saab 9-4X
Volvo XC60
Volvo XC90

Large SUVs
Buick Enclave
Chevrolet Traverse
GMC Acadia
Volkswagen Touareg

Minivans
Chrysler Town & Country
Dodge Grand Caravan
Honda Odyssey
Toyota Sienna
Volkswagen Routan

Large pickups
Ford F-150 crew cab models
Honda Ridgeline
Toyota Tundra crew cab models



Dec6

Lucky self-check credit/debit card readers tampered

Posted by: Brian Chan | Filed in: Uncategorized | Tags: | 01:35 pm, December 6th, 2011 No Comments »


Affect stores are listed below:

Lucky- Pinole
Lucky- Milpitas
Lucky- Mountain View
Lucky- Redwood City
Lucky- El Cerrito
Lucky- Daily City
Lucky- Foster City
Lucky- San Carlos
Lucky- Millbrae
Lucky- Alameda
Lucky- Santa Clara on 234 Saratoga Ave.
Lucky- San Francisco on 1515 Sloat Blvd.
Lucky- Hayward on 25151 Santa Clara St.
Lucky- Fremont on 5000 Mowry Ave. and 35820 Fremont Blvd.
Lucky- San Jose on 5510 Monterey Highway, 200 El Paseo De Saratoga, 844 Blossom HillRd., and 3270 South White Road
Save Mart- Watsonville

If you have gone to Lucky or Save Mart recently (within this past year?), check your bank statements immediately…

ref: http://www.luckysupermarkets.com/index.php?id=287, http://www.luckysupermarkets.com/index.php?id=289



Dec5

Wells Fargo Cash Back(SM) Program – redemption

Posted by: Brian Chan | Filed in: Uncategorized | Tags: | 11:56 am, December 5th, 2011 No Comments »

If you have the question “Just how to get the freaking cash back out?”, well, in short, you just need to know these two things:

  1. Cash rewards can only be redeemed in twenty-five dollar ($25.00) increments.
  2. Cash rewards may be redeemed either by automatically applying it to a qualified Wells Fargo Checking, Savings, Loan or Line product (“Redemption Account”) or through a statement credit or paper check by calling Customer Service at 1-800-642-4720.

The whole text I found is at https://www.wellsfargo.com/credit_cards/cashback/terms:

The Wells Fargo Cash BackSM Program – Summary of Program Rules and Conditions

Effective: April 2011

  1. In these Rules and Conditions, “You,” “Your,” and “Cardholder” refer to the primary cardholder and/or any co-cardholder (if a joint account – excludes authorized users of the card) on the Wells Fargo® consumer Credit Card account(s), as applicable, (“Account(s)”) linked to the Wells Fargo Cash BackSM program (Program). “Wells Fargo,” “We,” “Us,” and “Our” shall mean Wells Fargo Bank, N.A.
  2. Program eligibility, the ability to earn cash rewards, and/or the ability to redeem cash rewards are each restricted to Cardholders whose Account(s) linked to the Program is/are open, current, and not in default or delinquent, as applicable to their Account(s), as of the time of their then-current monthly billing statement date and so long as the Program has not been terminated or canceled pursuant to these Rules and Conditions.
  3. Cardholders will earn a one percent (1%) cash reward for every one dollar ($1.00) in net purchases (purchases minus returns/credits) made on their Credit Card Account, rounded to the nearest one cent ($0.01).
  4. The following purchases/transactions do not earn cash rewards: cash advances of any kind, balance transfers, SUPERCHECKSTMcasino gaming chips, wire transfer, off-track wager, lottery ticket transactions, or bets or wagers transmitted over the Internet. Any interest or fees posted to a linked Account, including but not limited to returned payment fees, late fees, and monthly or annual membership fees do not earn cash rewards.
  5. There are no annual cash reward maximums.
  6. Cash rewards will not expire on this Program.
  7. Changes to this Program: Wells Fargo reserves the right to amend, cancel, or temporarily suspend the Program, in whole or in part, or change any of the Program Rules and Conditions, at any time for any or no reason, including without limitation, in the event of fraud, abuse of Program privileges or violation of the Program Rules and Conditions, as determined in Our sole discretion (examples of Program violations include any attempt to sell, exchange or transfer cash rewards or any instrument exchangeable for cash rewards), without notice to You, which may result in the forfeiture of cash rewards not yet redeemed.
  8. If the Credit Card account is closed or the Program is canceled for any reason or you violate these Rules, membership in the Program is terminated and any cash rewards not yet redeemed are forfeited. You have no property or other legal right in any cash rewards not yet redeemed including, but not limited to, the cash rewards forfeited as a result of account or Program closure or for violation of these rules.
  9. Cash rewards can only be redeemed in twenty-five dollar ($25.00) increments.
  10. Cash rewards may be redeemed either by automatically applying it to a qualified Wells Fargo Checking, Savings, Loan or Line product (“Redemption Account”) or through a statement credit or paper check by calling Customer Service at 1-800-642-4720.
  11. This is only a summary of the Program rules and conditions. Other restrictions and requirements apply. The full Program rules and conditions will be provided upon enrollment.


Nov30

Commit failed (details follow): File ‘your_file’ is out of date

Posted by: Brian Chan | Filed in: Uncategorized, technology | Tags: | 02:12 pm, November 30th, 2011 1 Comment »

I have no idea, but all of a sudden I got this svn error during my commit.

My solution is roughly the following.

1
2
3
4
5
6
cp your_file your_file.bak
svn revert
svn update
cp your_file.bak your_file
svn commit
rm your_file.bak

A nice workaround that helped me move on.



Nov17

Carrots

Posted by: Brian Chan | Filed in: Uncategorized | Tags: | 09:50 am, November 17th, 2011 No Comments »


Nov11

PHP command line memory limit error

Posted by: Brian Chan | Filed in: Uncategorized | Tags: | 12:00 pm, November 11th, 2011 No Comments »

Very often, when data size gets bigger and bigger, some scripts will break due to default memory limit. I got the following error today.

1
2
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /someDir/myScript.php on line 15
Segmentation fault: 11

I checked my php help. I am using version 5.3.6.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
$ php -h
Usage: php [options] [-f] <file> [--] [args...]
       php [options] -r <code> [--] [args...]
       php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]
       php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]
       php [options] -- [args...]
       php [options] -a
 
  -a               Run as interactive shell
  -c <path>|<file> Look for php.ini file in this directory
  -n               No php.ini file will be used
  -d foo[=bar]     Define INI entry foo with value 'bar'
  -e               Generate extended information for debugger/profiler
  -f <file>        Parse and execute <file>.
  -h               This help
  -i               PHP information
  -l               Syntax check only (lint)
  -m               Show compiled in modules
  -r <code>        Run PHP <code> without using script tags <?..?>
  -B <begin_code>  Run PHP <begin_code> before processing input lines
  -R <code>        Run PHP <code> for every input line
  -F <file>        Parse and execute <file> for every input line
  -E <end_code>    Run PHP <end_code> after processing all input lines
  -H               Hide any passed arguments from external tools.
  -s               Output HTML syntax highlighted source.
  -v               Version number
  -w               Output source with stripped comments and whitespace.
  -z <file>        Load Zend extension <file>.
 
  args...          Arguments passed to script. Use -- args when first argument
                   starts with - or script is read from stdin
 
  --ini            Show configuration file names
 
  --rf <name>      Show information about function <name>.
  --rc <name>      Show information about class <name>.
  --re <name>      Show information about extension <name>.
  --ri <name>      Show configuration for extension <name>.

Looks like -d with do it. So I ran the following:

1
php -d memory_limit=512M myScript.php

It worked fine.

If you can afford to change your php.ini file, use – -ini to see where your php.ini file is, then make your changes accordingly. You can also use -n to ignore your php.ini file, but then you will be using default parameters which may be even harder to debug.



Nov10

Validate line by line

Posted by: Brian Chan | Filed in: Uncategorized | Tags: | 04:14 pm, November 10th, 2011 No Comments »

Here is a good compilation of codes doing string format validation in C#, VB.NET, Java, Javascript, PHP, Perl, Python, and Ruby. It’s a good reference page.

http://answers.oreilly.com/topic/224-how-to-search-line-by-line-with-a-regular-expression/



Nov8

max_allowed_packet error during mysqldump

Posted by: Brian Chan | Filed in: Uncategorized | Tags: | 02:15 pm, November 8th, 2011 1 Comment »

Got a “max_allowed_packet” error during mysqldump. This happened after I added a longblob to one of my tables. Below is the error:

1
2
mysqldump --routines --user=root -p localDB > backup.mysql.txt
mysqldump: Error 2020: Got packet bigger than 'max_allowed_packet' bytes when dumping table `table2` at row: 86

It turns out max_allowed_packet is set to something less than whatever is in my row 86. Longblob can go up to 4Gb so I will need to override the max_allowed_packet value.

I found the following way the easiest to re-enable the dump.

1
mysqldump --routines --max_allowed_packet=100M --user=root -p localDB > backup.mysql.txt


Nov2

launchctl list

Posted by: Brian Chan | Filed in: Uncategorized | Tags: | 12:32 pm, November 2nd, 2011 No Comments »

Here is what the output of “launchctl list” means:

1
2
3
4
5
6
7
8
list [-x] [label]
          With no arguments, list all of the jobs loaded into launchd in
          three columns. The first column displays the PID of the job if
          it is running.  The second column displays the last exit status
          of the job. If the number in this column is negative, it repre-
          sents the negative of the signal which killed the job.  Thus,
          "-15" would indicate that the job was terminated with SIGTERM.
          The third column is the job's label.

So when you run “launchctl list | grep something”, the columns correspond to:
1. PID (if it’s running)
2. last exit status code
3. process name

Ref: http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/launchctl.1.html



Nov2

Gmail app on iphone

Posted by: Brian Chan | Filed in: Uncategorized | Tags: | 10:01 am, November 2nd, 2011 No Comments »

Here is the link: http://itunes.apple.com/app/gmail/id422689480?mt=8