Samsung Fascinate + CM7 + usb tethering

Samsung Fascinate + CM7 + usb tethering cyan logo I was recently needing Internet access on a desktop PC with Windows XP SP3 installed using a Samsung Fascinate running CyanogenMod 7(CM7). USB tethering had work easily using under Windows 7, but Windows XP would not recognize the USB device. Digging through dozens of posts and forums I found  the information from Google. Google as a help topic for installing Android based phones as USB modem interface using the tetherxp.inf file. I downloaded the file, and tried plugging in my Fascinate, enabled USB tethering, and still could not get Windows XP to recognize the USB device for tethering. So, here was a simple fix I got to get this working.

I opened up the the tetherxp.inf file and save a few of the usb identifiers for installing the device. You will see a line like this.

[AndroidDevices]
; Google Nexus One without adb
%AndroidDevice%    = RNDIS, USB\VID_18D1&PID_4E13

I then opened Device Manager in Windows XP by right-clicking on My Computer->Properties, click on Hardware tab, and then Device Manger button. There was the unrecognized USB device with the yellow question mark icon. I right-clicked on the item and chose Properties. Then click on the Details tab at the top. Here I could see the USB device ID. I copied those values into my tetherxp.inf file to see what would happen. My section of tetherxp.inf now looks like:

[AndroidDevices]
;Samsung Fascinate i500
%AndroidDevice%    = RNDIS, USB\VID_18D1&PID_4E24
 
[AndroidDevices.NT.5.1]
; Samsung Fascinate i500 with adb
%AndroidDevice%    = RNDIS.NT.5.1, USB\VID_18D1&PID_4E24

Saved the file. Back on the Details tab, I clicked on the Driver tab for the device, and clicked Update Driver button. Choose the tetherxp.inf you have saved. Windows XP will propmpt to accept to install and unsigned driver. Click Continue Anyway. It will proceed to install the device and will be named Android USB/RNDIS Ethernet. Your computer should then be able to connect now being tethered via the USB cable.

Posted in Other | Tagged , , | Comments closed

Zencart Reloaded Advanced Search module

Zencart Reloaded Advanced Search module zen cart logo

Zen-Cart

This module will help the relevancy of the products returned on your zencart advanced search results. The stock search runs a LIKE query for each word in the query. There is no regard to the relevancy of the word for the product associated with it.  When a user searches using a adjective like a color red, any product with “red” will be returned.  Now make the search “red shoes”, and you will receive any product with red or shoes. You may get red shirts, black shoes,  white shoes, or any other variation. As long as one of the words is in the name, model, description, or keywords it will be shown. Obvisously red shirts and white shoes are nothing like the users original query.  This zencart advanced search module uses a natural language search function in MySQL which will return more accurate results for multi keyword search phrases. Each keyword searched, is scored for its relevancy for each product, and the results are ordered by this relevancy score. It will also try to pluralize words to expand the search.  The module will create a configuration group in your admin panel for setting the weights for the product columns that are searched. The default values seem to be returning accurate results.

Only one original file is overwritten in /includes/modules/pages/advanced_search_result/header_php.php. Only a few lines where changed to modify the query being ran for the results. Installation is simple as uploading the zip file to your zencart installation. Login to your admin panel, and you will be prompted with a link to install the module. The installation link will install the proper database queries, and take you to the configuration page under Admin->Configuration->Reloaded Search.

An additional feature, is when only one product is returned in the search results, the product is displayed rather than the search result page.

Download Zencart Reloaded Search

Posted in Zen-Cart | Comments closed

WAMP + CodeIgniter + Sparks

WAMP + CodeIgniter + Sparks  ci logo flame I was recently decided to give the Get Sparks project a try. If you are not familiar with the Get Sparks project for Codeigniter, it allows you to download packages/modules for quickly installing into your app. Similar to the idea with PEAR extensions for PHP. I am setting this up on my Windows box using WAMP. I followed the setup instructions from the Get Sparks website, and everything went perfectly fine. I decided to download the popular spark “curl”, and kept getting the:

"You have to install PECL ZipArchive or `unzip` to install this spark."

I kept checking in my php.ini file that php_zip.dll was enabled.  Hmmm…..

So, I decided to create a test script to test the code that was creating this error message. Running the PHP script in the browser ran ZipArchive() successfully. Next, I ran this test PHP script from the command line (CLI). I got a “Fatal Error:  Class ZipArchive not found in …” error. I couldn’t quite figure out why PHP was throwing an error on the CLI and not when run in the browser. A little digging found that PHP run from the command line uses relative paths including php.ini. This the part where WAMP comes into play. For those using WAMP, your php.ini file that is used is located in C:\wamp\bin\apache\Apache2.2.11\bin not where PHP is being executed from. Ah ha! So I went and opened C:\wamp\bin\php\php5.2.9-2 and scrolled down to find:

;extension=php_zip.dll

So I changed this to:

extension=php_zip.dll
php tools\spark install -v1.2.0 curl

Enabling php_zip.dll in the PHP folder of WAMP, and ran the Sparks command again. Success! The spark was downloaded, unzipped, and installed with no more error.

Posted in Code Igniter | Tagged , | Comments closed

Zencart + USPS Webtools with Multiple Package Support

Zencart + USPS Webtools with Multiple Package Support zen cart logo

Zen-Cart

This is another shipping module for Zencart. I have been working on the UPS XML module for awhile now. I have ported over the more advanced packing algorithm from the UPS module, to allow packing support in the USPS shipping module. This module allows Zencart to calculate shipping for multiple boxes for a freight quote. The default behavior for Zencart is to place all items in one box with a total weight to send for quote. With this updated USPS shipping module, items will be packed into boxes you enter, or you may set items to always be packaged separately. The module then returns the aggregate shipping cost for your packages. This should provide much more accurate shipping quotes. Read More »

Posted in Zen-Cart | Tagged , , , | Comments closed

CodeIgniter + UPS Worldship

This is a post I have been to get around to for quite awhile. At work we have UPS WorldshipCodeIgniter + UPS Worldship ci logo flame installed on our desktops for shipping out packages. I had written a small php script that could open the UPS Worldship database, and report all of our tracking numbers with links. UPS had switched from being an unprotected Microsoft Access database file, to using a Microsoft SQL (MSSQL database). This kind of broke my little php script I had written, but I was eventual able to work something together. Recently, I installed the latest update UPS Worldship 2010 Version 12. Wouldn’t you know it, broken again. I couldn’t get my little script working again. ODBC access had been removed from this version. I could no longer connect to the MS SQL  dabatabe for UPS Worldship.

Read More »

Posted in Code Igniter | Tagged , , , | Comments closed

CodeIgniter + Chargify

I recently began integrating the Chargify service into a web app I am coding for codeigniter. CodeIgniter + Chargify ci logo flame Chargify is seems to be a slick web service for creating subscription based services. They provide a strong API, and along with a slick web based dashboard (GUI). One of the points on using the API are Chargify postbacks. I did some quick googling and didn’t turn up much in the way of chargify and codeigniter. I did find a great library for integrating the API called ChargeIgniter.

Chargify will send a json array back a POST var to your site. The docs for Chargify don’t state what variable they are submitted as. This is what I came up with.

function post_back(){
 
        $body = file_get_contents("php://input");
 
        $replace = array('[', ']');
        $replacements = array('', '');
 
        $body = explode(',', str_replace($replace, $replacements, $body));
 
       //$body now contains array of subscription ID's
       //Iterate through returned subscription IDs
       foreach($body as $subscription_id){
            $subscription = $this->chargify->get_subscription($subscription_id);
            //Do something here with $subscription details
      }
}
Posted in Code Igniter | Tagged , , | Comments closed

Zencart + Free Shipping USA Shipping Module

Zencart + Free Shipping USA Shipping Module zen cart logo

Zen-Cart

Many websites offer free shipping in the USA. The default shipping module for zencart does not allow a store owner to easily handle it. In the configuration of the shipping module, you set the desired country (USA) to display free shipping to, and any of the other options that are available in the standard freeshipper module included with zencart. The zip file contains just 2 files, the shipping total, and a english language define. Install instructions are included in the download. Very easy and fast to install.

You may download the module form bitbucket.org, or even help contribute to it.

Posted in Zen-Cart | Tagged , , | Comments closed

FreeNAS + Mercurial

FreeNAS + Mercurial mercurial logo I was recently tinkering around with Mercurial and getting my feet wet using a distributed source version control. I have been using Subversion for about the past year, and has served me well. I wanted to get involved with some of the projects hosted on Bitbucket.org in order to fork some projects.  The are a number of useful Codeigniter projects and zen-cart addons on there as well. One of the main ideas behind using a DSVC is not needing a centralized server. This seems great, if you are doing your work where will you have access to the network at some point to push/pull those changesets.  I work from a couple locations and need to be able to push/pull those changes. Pricing plans on Bitbucket.org are very reasonable, but I needed to host a few extra private repositories. Got me thinking to install mercurial on that FreeNAS box sitting quietly in my basement.  I am currently using FreeNAS .69. If you are running another build of FreeNAS, you will need to find the appropriate packages for your build. Read More »

Posted in Other | Tagged , , | Comments closed

PetFinder API PHP Class Library

I was interested in a project for a website as to what data could be retrieved from PetFinder.com. To my surprise, on their website located in the footer is a link to their API documentation. In order to use their API, you must first fill out a developer request for a key & password. I did a quick look to see if anyone had written a php class for accessing the api, but couldn’t find anything useful. I have created a php class that you can call the certain methods available to retrieve the records.

Update 6-30-2010:

I recently updated the class to enable caching the xml response from the Petfinder server. This should provide a nice little speed boost even though it was already pretty fast PetFinder API PHP Class Library icon smile . Caching is enabled by default, and caches expires in 3 minutes. The folder “cache_files” in zip folder must have write permissions. As shown in the instructions, you can change the paths of cache files.

Read More »

Posted in PHP | Tagged , , , | Comments closed

CodeIgniter + Whitepages.com API Library

CodeIgniter + Whitepages.com API Library ci logo flame I was recently working on another Codeigniter project that I needed to grab some phone, address, & map information for plotting on a map. After doing a little searching I found Whitepages.com has provided an API interface for retrieving data via REST. The methods seemed simple enough, and provided an easy way to create a CodeIgniter library to due the dirty work. Read More »

Posted in Code Igniter | Tagged , , , | Comments closed