Friday, May 7, 2010

stop php deprecated warnings in browser

I just installed newest version of wamp server on a new windows 7 machine. When I installed the web app, I got a bunch of following printouts in the browser at the top of every webpage:
Deprecated: Assigning the return value of new by reference is deprecated in [...]\cake\libs\inflector.php on line xxx

After spending an hour looking, here is what worked:

1. in cake/lib/object.php: add following in next line after <&ques;php
error_reporting(E_ALL ^ E_DEPRECATED);


2. in cake/libs/configure.php replace
error_reporting(E_ALL);
with
error_reporting(E_ALL ^ E_DEPRECATED);


3. in your php.ini, search for error_reporting and replace the entire line with
error_reporting = E_ALL & ~E_DEPRECATED

Monday, April 12, 2010

svn webdav - view previous revisions

So, if you want to see the previous revision for path
https://svn.company.com/platform/trunk/app/webroot/images/welcome/

Use this URL:
https://svn.company.com/platform/!svn/bc/2615/trunk/app/webroot/images/welcome/

Where 2615 is the revision number I want to see.

Thursday, January 28, 2010

160043 "Could not open the requested SVN filesystem"

After about a year since we set up subversion server, I needed to create a new project. So I ran
>svnadmin create myproject
We have svn hooked with apache - that is, https protocol.
When I tested the new url in a browser, I got the following error:
160043 "Could not open the requested SVN filesystem"

I found a lot of posts on the web that discussed this error message, but none suggested a solution other than upgrading svn and apache builds.
Since existing projects were working fine, I didn't see the need to upset my stable environment.

When I looked at apache logs, I saw the message:
Expected FS format between '1' and '3'; found format '4'

So that give me the hint - what search results for error 160043 were saying was correct, the version of apache's svn mod and svn server doesn't match. What they didn't tell me (or I missed the search result that did mention it) was that the easier fix is to create the project as follows:
>svnadmin create myproject --pre-1.5-compatible

This solved the problem for me.

Sunday, November 1, 2009

Cakephp slow on Windows Vista

I use Vista for development. I find that cakephp development on Vista is painfully slow. Some of my coworkers use mac. I, being a (relatively) poor entrepreneur cannot afford a mac (yet), so I have no option but to keep waiting for page to load for sometimes upto 60 seconds.

I tried various ways to handle the problem - apc and xcache both didn't work with my version of php and apache on windows. Then one day it occurred to me - apc is just an elaborate in-memory cache, so why dont I put my cakephp cache files in memory?
So started search for a (free) RAM Disk. After trying few, I found Dataram RAM Disk was the only one that didn't crash on Vista. Those folks have done a good job with their product. I just need a 10M disk, so their free option works well for my dev server.

Next updated the core.php with:

      Cache::config('_cake_core_', array(
'engine' => 'File',
'path'=> 'E:/',
));
First few times were still painfully slow, but as cache filled up, the website now loads blazing fast. I can now again develop on Vista!

Monday, September 28, 2009

Android - detect device on Vista 64 bit

I spent few hours trying to get it to work. Here are the instructions that helped:

I got these from the following link:
http://forum.xda-developers.com/showthread.php?t=502010&page=21

First set up environment variable:
  1. In VISTA hit WindowKey + Pause\Break to bring up the system properties
  2. Click Advanced System Settings
  3. Under The Advanced Tab click Environment Variables
  4. Click the New button below the System Variables panel.
  5. In the New System Variable dialog box, type devmgr_show_nonpresent_devices in the Variable Name text box and 1 in the Variable Value box.
  6. Click OK, then OK again to close that Window
Now device manager:
  1. Now go to the device manager and go to View > Show Hidden Devices
  2. Look under Hard Drives and delete the HTC Android Phone USB Device
    ** This may show up as Generic Mass Storage **
    Note: When trying to delete the USB controller for the phone, have the phone plugged in first and see how many usb devices are actually conected. Once you disconnect the phone, you will obviously have 1 less connected device. Plug the phone in 1 more time and see which one is now connected and delete just that one. This will help avoid having to reinstall a bunch of usb devices.
  3. Look Under Portable Devices and delete the Android Phone
  4. Look Under Universal Serial Bus Controllers and Delete ANY USB Mass Storage Devices with a greyed out icon ... one if these is for your phone....
  5. Now with the device manager still open ... unplug and plug your phone in. When the window pops up, choose the android 1.6r1 usb driver directory for the device driver dialog.

Friday, May 29, 2009

vi - global search and replace?

I use vi heavily. Every time I have to do global search and replace, I have to do google search first. So documenting it here:

:%s/lookForMe/ReplaceWithMe/g

Saturday, May 2, 2009

Subversion - query what files will be updated

Another subversion entry!
Before I push changes out to the production website, I wanted to see what files will get pushed out. So I wanted to see if I run svn update, which files will be updated. I was hoping to find something like 'svn update 'dry run'" or 'svn update -query'.

So I looked hard at 'svn update' documentation but still didn't find anything. After a few searches on the manual, the command turned out to be on the least expected svn command. So, the summary is - if you want to see what svn update will do, run this command:
svn status -u