What to do when Visual Studio 2008 Debugger Kills Dreamweaver?

Visual Studio 2008 Debugger Kills Dreamweaver

Quoted “I’m not sure what caused the problem, but I know what fixed it. I ended up repairing Dreamweaver CS3, which the suite made pretty easy to do. I was going to uninstall DW and reinstall, but I tried the repair option first and sure enough, that fixed it. I still have no idea  what caused it to begin with.”

I have just encountered this problem with ‘unhandled win32 exception error in Dreamweaver.exe’ and VS2008 Debugger killing the application. I found that neither repairing/reinstalling Dreamweaver nor disabling debugging within IE fixed the problem. What has fixed the problem however is that the error was within a particular batch of files rather than with the actual application. I restored a last known good file batch from backup and everything returned to normal. It was only two corrupt files (html and css) that I was working on when the problem arose, that was causing me all the problems.

This worked for me:

If Dreamweaver is open, quit the application. Delete the WinFileCache-AD76BB20.dat file from the Dreamweaver user configuration folder. Note that on Windows, the Application Data and AppData folders are hidden by default, so verify that your Windows Explorer folder options are set to View Hidden Folders. The location of this file is as follows: Dreamweaver CS3 on Windows Vista:

C:\Users\{Yourusername}\AppData\Roaming\Adobe\Dreamweaver 9\Configuration

Dreamweaver CS3 on Windows XP:

C:\Documents and Settings\{Yourusername}\Application Data\Adobe\Dreamweaver\Configuration

Restart Dreamweaver.

Hope my article helps someone.

How to use an array variables with Google Map

I’m working on a Google Map integration project for a company who owns X-Cart online software. The project is to display all dryclean providers of 50 states in the US on the Google Map. Each state will have multiple city and each city will include multiple dryclean providers who register to the service.

When a customer clicks on a location on the map, it will zoom in to that exact location. At the same time, the information about that laundry provider will be displayed on Google Map. Sine this map will be for all hotel subscribers, if a customer click on a particular hotel, a popup of room selection box will appear. When customer select a room #, it will take him/her to a purchase page which will allow him/her to add laundry items in the cart and check out with credit card on a secure SSL server.

This is a part of a Smarty sample codes how you embed multiple laundry provider information into a Google Map, given $hotel_lists is an array of all hotels across the United States. This data can be retrieved from a any database such as MySQL or MSSQL or Oracle.

var json = [

 {foreach from=$hotel_lists key=index item=ht}
 {"locationID":"{$index}","address":"{$ht.address}","state":"{$ht.us_state|upper}"
,"city":"{$ht.city|capitalize}","lat":"{$ht.map_lat}","lon":"{$ht.map_lon}"
,"companyName":"{$ht.membership}","info":"<table><tr>
<td valign=top><u>{$ht.membership}<\/u><br>{$ht.address}<\/td><\/tr>
<\/table>","abbreviation":"k"},
 {/foreach}}

 ];

Project 3 with AW/BT

Given multiple zipcodes of USA, calculate polygon to connect all points together. The results will be returned to a web service to be used by a third party software (clients)

  • How do we do that?

Each zipcode can be converted to a Geo point which will include Latitude and Longitude. Yahoo, Google, and Bing Map provide a web service that we can call to convert this value.
Now we have the geocodes, let’s sort the arrays of longitudes first. Then loop through to calculate the distance of 2 adjacent points. At the end of the array, use the 1st element as the 2nd point to calculate, so that you can close the loop. Now you’ll have all the points as a result to draw a polygon on a Google map, or Bing map.

  • Sample function to do the calculation of the 2 geo points
Pass these values to a function first before this calculation can be executed.

$lat1, $lon1, $lat2, $lon2, $unit = 'M'

$theta = $lon1 - $lon2; $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) +  cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); $dist = acos($dist); $dist = rad2deg($dist); $miles = $dist * 60 * 1.1515; $unit = strtoupper($unit); if ($unit == "K") { return ($miles * 1.609344); } else if ($unit == "N") { return ($miles * 0.8684); } else { return $miles; }

Moving WP Database to another hosting server

After moving WP website to another server, you’ll try to login to Admin Control Panel, you might see this error “You do not have sufficient permissions to access this page.” This is how to fix it:

UPDATE `{%TABLE_PREFIX%}usermeta` SET `meta_key` = replace(`meta_key`, 
'{%OLD_TABLE_PREFIX%}','{%NEW_TABLE_PREFIX%}');
UPDATE `{%TABLE_PREFIX%}options` SET `option_name` = replace(`option_name`,
'{%OLD_TABLE_PREFIX%}', '{%NEW_TABLE_PREFIX%}');

Using glob() function in PHP

To find pathnames matching a pattern such as .html or .php, you’ll use this glob() function. The return value is an array of files that has the matched pattern that you defined.
Function:

array glob ( string $pattern [, int $flags = 0 ] )

Usage:

foreach (glob("*.htm") as $filename) {
    echo "$filename size " . filesize($filename) . "\n";
}

You can use this function to manage file system on your server.

Example: Using array_map function to perform a callback to the elements of a given arrays. This script will remove all files that has the pattern “.txt” in a defined directory.

array_map('unlink', glob($my_doc_root . $test_dir."*.txt"));