I recently needed a form input that acted like a select input with a droplist of items, but it also had to allow the customer to type in a custom value. The customer wanted an input with and autocomplete droplist that didn’t force the user to use one of the autocomplete items. In the jQuery docs there’s a jQuery UI Autocomplete Combobox Plugin. Since we use jQuery and the UI, I started with this code and did a simple update around where the autocomplete input is blanked out for “invalid”... Read the Rest →
I had an odd issue with UPS shipment methods the other day. A customer complained that their Canadian address was not returning UPS shipment pricing. It’s important to note that on this particular (old) website, Canadian addresses are hand typed by the user into standard text inputs. Oops! Don’t let users have the opportunity to enter garbage data. If you do, they will. It’s just one of those laws of the universe. Thermodynamics? Here’s the error: UPS: 111286: {Provided State} is not a valid state for the specified shipment. The... Read the Rest →
I found an article on setting up my .gitconfig file to launch p4merge as my custom merge tool: Using p4merge as a custom Git merge tool on Mac OS X The problem was I would get the following errors when there were spaces in my merge file paths. For a path like /path/to the/file.rb I would get something like: Incorrect parameters: Too many files: You may enter a maximum of 4 files. '/path/to' is (or points to) an invalid file. 'the/file.rb' is (or points to) an invalid file. ... Here’s... Read the Rest →
Via: Medical Billing And Coding And me at my standing desk:
I’m currently enjoying reading about algorithms that have been implemented in javascript. Here’s one called Duff’s Device that speeds up the execution of large loops by reducing the number of iterations over the loop: // Begin actual Duff's Device // JS Implementation by Jeff Greenberg 2/2001 var n = iterations / 8; var caseTest = iterations % 8; do { switch (caseTest){ case 0: [Do Something to tesVal here]; case 7: [Do Something to tesVal here]; case 6: [Do Something to tesVal here]; case 5: [Do Something to tesVal here];... Read the Rest →
I did a quick little Google search for a dynamic month and year droplist for credit card expiration dates. I tried two or three searches in Google and couldn’t find anything for PHP. So I rolled my own: //Inside my view <select id="exp_month" name="exp_month"> <?php MonthList() ?> </select> <select id="exp_year" name="exp_year"> <?php YearList() ?> </select> //In your model/controller or some other place you like to keep random stuff like this /** * Populate the credit card expiration month drop down */ function MonthList(){ for($i=0; $i<=11; $i++){ $time = mktime(0, 0,... Read the Rest →
Need webistrano installed on CentOS? Well do I have the step-by-step, leave nothing out, directions for you! Skip the sections you don’t need, but this includes: installing Ruby, MySQL, Rack 1.01, MySQL ruby gem, Webistrano w/ remote database. That’s right! All the little details, even how to connect to that fathomdb database. 1) Ruby (and Rails) [okay... this is coming...] 3) “Fix” Rake $ gem uninstall rack $ gem install rack -v 1.0.1 2) MySQL (you need this even for a remote database, as it provides the necessary headers so... Read the Rest →
One of my favorite things to rant about when at work is “tight coupling”. If you’re into software design or development, hopefully you’ll appreciate this little review of coupling: HIGH COUPLING Content coupling (high): One module modifies or relies on the internal workings of another module Common coupling: two modules share the same global data (e.g. a global variable). Changing the shared resource implies changing all the modules using it. External coupling: two modules share an externally imposed data format, communication protocol, or device interface. Control coupling: one module controlling... Read the Rest →