Converting Latitude And Longitude Coordinates Between Decimal And Degrees, Minutes, Seconds
I received an email yesterday from a reader who needed help with implementing my blog post, “Calculating The Bearing And Compass Rose Direction Between Two Latitude / Longitude Coordinates In PHP.”
His problem: He has latitude and longitude coordinates in his database tables that are in degrees-minutes-seconds (DMS) format, rather than decimal format. In other words, his coordinates look more like 55° 45′ 06″ N, 37° 37′ 04″ E than 55.751667, 37.617778.
So, my reader needed a way to convert back and forth between the two.
Fortunately, that’s easily done with a couple PHP functions. And since there’s not a lot that comes up in a Google search about how to make those conversions in PHP (lots of standalone converters, some JavaScript code, little PHP), I’ll fill the void here.
I should also note this function can be used for my other PHP latitude / longitude post, “Getting All ZIP Codes In A Given Radius From A Known Point / ZIP Code Via PHP And MySQL.”
Continue reading: Converting Latitude And Longitude Coordinates Between Decimal And Degrees, Minutes, Seconds »
Disable Windows Antivirus When Installing aspell English Dictionary
A lesson I learned the hard way today, while installing aspell support for Notepad++:
If you’re installing Kevin Atkison’s English dictionary for aspell, you need to disable your antivirus program (at least, if you’re using Avast, as I am).
If you don’t, the dictionary installer can’t write its unpacked files to disk and will fail silently. As in, it just plain closes, and Notepad++ will report something along the lines of “Aspell and/or dictionaries are missing.”
FYI.
Also, if you haven’t heard of Notepad++, you should check it out. It’s an open-source, GPL-licensed Win32 text editor. (It runs perfectly fine in Win64).
Highly extensible via plugins, translated to all kinds of languages, exceptionally powerful, with support for syntax highlighting in just about every programming language under the Sun and syntax checking for a fair number of them, too.
It’s pretty much the only tool I use any more for Web coding, even when writing ASP.NET Web Forms. (I still use Visual Studio for some Windows coding. But Notepad++ has completely replaced Dreamweaver.)
All links in this post on delicious: http://delicious.com/dougvdotcom/disable-windows-antivirus-when-installing-aspell-english-dictionary
Working With authorize.net Server Integration Method (SIM) Payment Gateway, Part 2: Proper Form Design
The most important step in using the authorize.net Server Integration Method (SIM) payment gateway is properly designing your ordering system / shopping cart, well before you ever request payment.
Let me repeat that: If you want a secure, sensible and error-free checkout experience, you need to design a storefront that makes those things possible. Just as it is with building a house, if the foundation is crap, it won’t stand up to a storm.
I promised in a recent post to show how to properly send transaction requests to SIM. So, here’s the first step: An overview of best practices, and a sample order form that follows them.
Let me offer this, right up front: If your Web sales are casual — say, you want to let people buy annual banquet tickets online, or you sell a couple coffee mugs / T-shirts each week — you should seriously consider using a third-party turnkey solution.
The legal, practical and technical requirements of running your own ecommerce solution generally aren’t worth the hassle if you’re not doing a significant volume of sales.
I like EventBrite for handling ticket sales and CafePress for selling merchandise. There are other storefront options out there, but those are ones I have used and found reliable.
That said, there are circumstances where low-volume sellers still need custom ecommerce solutions. So, with that in mind, let’s cover the basics of making a secure, simple ordering system.
Continue reading: Working With authorize.net Server Integration Method (SIM) Payment Gateway, Part 2: Proper Form Design »
Subscribe To Seth Godin’s Blog. Do It Now.
If you aren’t reading Seth Godin’s blog, you ought to be. Especially if you’re an entrepreneur, independent contractor, in sales or a client-facing role, or are otherwise responsible for leadership or the bottom line.
Since that describes pretty much every developer, probably you should be checking out Seth’s Blog.
He posts once a day, usually in the morning. Which is actually a trick he recently blogged about: Rather than looking at Twitter or Facebook or whatever first thing, and thus following, make a point of doing something — anything — productive, first thing, so that you’re leading. Then you can check out your social media channels.
I’m trying to learn that habit; it’s difficult, but it does make a huge difference in terms of productivity.
Detractors and naysayers consider Godin’s posts tripe and self-promotion. Sure, some of it can come off as a bit pandering, important or simplistic. Don’t confuse the words for the message. And it’s always good to be reminded of the basics.
I subscribe to Godin’s RSS feed via Google Reader. He notes blog posts on Twitter at @ThisIsSethsBlog and on his Facebook page.
However you get Godin’s thoughts, get them. You’ll be doing yourself a favor.
All links in this post on delicious: http://delicious.com/dougvdotcom/subscribe-to-seth-godins-blog-do-it-now
Working With The authorize.net Server Integration Method (SIM) Payment Gateway, Part 1: Don’t Use JavaScript
I got an email a few days ago from a reader seeking help with the authorize.net Server Integration Method (SIM) credit card payment gateway.
Specifically, he was asking how he could use JavaScript to pass a calculated total to a PHP page that contains the SIM code.
- A customer chooses a series of options from some select lists, radio buttons and the like;
- the page calculates an order total;
- the end user hits a submit button;
- the results are posted to the SIM processing page, which acts as a “confirmation page”; and
- The customer presses another button, which takes him to authorize.net to provide payment info and actually charge the card.
You can see an approximation of what I’m talking about here: http://www.dougv.com/demo/js_form_values. The questioner’s form is similar to this approximation in function.



