Recent Tech Finds

Must Read: Twelve factors to creating bullet proof web apps/services.

Great article on software architecture.

The M# programming language looks to take over C# and reduce 90% of boilerplate code through meta-programming. Haxe looks promising too.

Great article on ugly code and how a company overcame a big ball of mud by switching to an event-based model. “The solution that Oliver finally came to was event sourcing. With this technique, you never store the state of an object, only events that have happened to the object.”

F# is a wonderful language! How to you track if an float represents inches or feet? C# and Java do not support unit of measures, like F# does. Although, this may be possible by using your own generics Measurable<Feet> and Measurable<Inches>. Thinking in unit of measures, not just data types can help with debugging and readability where necessary.

AI is good but is Super Intelligence bad for us?

Advertisements

Not So Liberated Yelp API

Recently, I wanted to develop a mobile app that displayed a walking city tour of your bookmarked places on Yelp so that if you are in a new city and want waypoints generated for the nearest favorite locations, you can quickly get them on the fly. This was harder than I thought because of the limitations of the Yelp API.

I wanted to produce a final solution all Node JS and Angular JS. This meant learning about Node JS, Angular JS and how to wire the two together. The implementation would utilize Google Maps and Geocoding services. I ran into several limitations with their free service, mostly OVER_QUERY_LIMIT errors which would require me to rewrite my code to handle these errors, wait a few seconds and then retry.

The NodeJS server returns some JSON with bookmarked locations which were queried directly from a Yelp URL using request and then parsed with cherrio. The reason I couldn’t use their API is that they did not include retrieving bookmarks!

[{title: "Pyramid Alehouse",
streetAddress: "1201 1st Ave S Seattle, WA 98134"
},{title: "Elysian Fields",
streetAddress: "542 1st Ave S Seattle, WA 98104"
},{title: "The Brooklyn Seafood, Steak & Oyster House",
streetAddress: "1212 2nd Ave Seattle, WA 98101"}]

The results were a list of waypoints starting from the user’s location.

2014-07-18_14-25-48

Unfortunately, after deploying the site to OpenShift, I encountered rejects from Yelp. Even after trying several popular proxies, Yelp would not let me call their site.

2014-07-18_13-21-59

Therefore, I sent an plea to Yelp, suggesting they open their API a bit more:

“I am a avid user of Yelp and an active reviewer. I am also a developer and would like to write a mobile app that integrated with Yelp. However, I’ve found the Yelp API to be limiting. For example, I cannot query a list of my bookmarks for a particular city. I plan on displaying these bookmarks on a Google map with waypoints indicating the ideal path to take from my starting point. This way, I can create a walking tour of my favorite Yelp bookmarks within walking distance from me. This appears to be an important feature which Yelp currently lacks. Upon discovery, I’ve found that I cannot even query my open public bookmarks from my web server as I get a 403: Forbidden error. Is there a legal reason for rejecting my server request? Please add the ability to query bookmarks from the API or provide a way I can get a list of bookmarks from a url such as “http://www.yelp.com/user_details_bookmarks?cc=US&city=Seattle&state=WA&userid=XXX&neighborhood=Downtown&#8221; from my web server without getting blocked.”

If you’re curious, you can find the implemtation here: https://github.com/szahn/YelpItinerary. It’s not finished yet and there is still a ton of refactoring to do.

Getting Started with DotNetNuke Development

DotNetNuke is a CMS in which I do a lot of web development in. For anyone that wants to get into DNN module development, below is an simple action plan to help get their feet wet.

  • Download DNN from Codeplex.

  • Make sure you are using Visual Studio 2012 for development in DNN 7.

  • Review UX Design Guidelines. Remember that each version of DNN varies in its standards and guidelines. Since comprehensive documentation is hard to find for each version, do your best to support at least one major version. Version 6 is the best version to build your module against.

  • Read up on module development basics.

  • Download some Visual Studio DNN templates. Here is another template that follows the MVP (model view presenter) pattern.

  • Download the tutorial on Module Programming 101 from DotNetNuclear.com. You can review the video tutorials as well.

  • Get to know the DNN 7 Web Services Framework. Building web services in DNN helps shift code away from your code behind and into the service layer, which is better oriented towards mobile development.

  • Know who you are developing your modules for. Most tutorials and examples on the web are not enterprise friendly. You have to adopt a whole new development philosophy to do real business heavy enterprise module development in DNN. Mitchel Sellers blogs about Enterprise DNN Development.

  • Check out XMod is a powerful DNN form builder.

Yii and PHP Frameworks

For a recent project of mine, I had to setup a fully functional web application as fast as possible. This meant that development had to be as automated and flexible as possible. For this solution, I chose a PHP framework called Yii. Within several hours, I was able to read through several chapters of documentation, setup and install an instance of my web application in my Linux Ubuntu machine. Not only does Yii help with installation, but configuring mysql tables, database wrappers, front-end user interfaces was basically a snap. The command line utilities were a huge time saver. 

PHP still is and has been for a long time, the programming language of the masses. I still remember a large corporation I worked for that dropped .NET for PHP simply because it was cheaper. Lately, there have been a set of fast, object oriented frameworks such as Phalcon. Today, I no longer develop for PHP. My days of hacking together WordPress themes and scriptlets are through. I’m sure I could make a decent living off enterprise PHP with Zend or Drupal, however, something about PHP still bothers me. I feel that Microsoft is advancing the C# language and tools a lot quicker. Even Java is gaining traction with the upcoming release of Java 8. C# and Java are still my favorite languages. I will always consider PHP to be more of an amateur scripting language.