CodeMash Nuggets

codemash2010

This year I was fortunate enough to attend CodeMash in Ohio. Just like last time, it was an amazing experience. The speakers, the venue, the food, the folks in attendance. All of it made for a great experience. I learned, I laughed, I left exhausted.

General Observations

I went to mostly mobile-oriented talks, and over a two day period every single speaker I watched used a Mac. On top of that, all the presentations were very minimalist. I don’t know if that’s the tools on the platform or folks finally rejecting the glitz of PowerPoint and focusing on content. I hope it’s the latter. Sales folks take note.

Mobile developers are actively rejecting the BlackBerry platform. One even pointed out how his company just stopped accepting work for that platform. Another who was building a mobile product pointed out that the expense of supporting the BlackBerry platform across three different active versions was too much. Has any technology died so publicly?

In the Java-oriented talks I saw, there was very little Eclipse. Mostly I saw IntelliJ Idea. This was interesting for me, because I love ReSharper for .Net work, and have been using WebStorm for HTML5/JavaScript coding.

Notable Quotes

As always, there were a number of notable quotes that summed up so many aspects of what was being conveyed.

Ted Neward, Keynote Address

“Reject the Goal of Reuse”

I’ve been seeing this message more and more lately. Reuse happens so rarely unless you are actually building a library, that otherwise you are probably wasting effort and introducing bugs by striving for reuse in code that was not necessarily intended for reuse.

“Best practices are merely average”  “Best practices == avoid thinking”

The bigger the company, the more they care about best practices. So there will be fewer risks, fewer rewards, and overall mediocre results. Seen it, sadly still living it.

“Reject the temptation of the familiar”

I’ve been working on this one for almost the last year. I’m learning the mobile paradigm, learning Java, writing services in something other than .Net. I am very surprised how much I had blinders on when I was immersed in Microsoft-only development.

Bill Pugh, Effective Use of FindBugs in Large Software Development Efforts

“The challenge for FindBugs is to find the intersection of stupid and important.”

I have long been a fan of automated tools for helping me tighten up code. His quote sums up the intent perfectly, finding the stupid mistakes you may have made that could result in important problems in your code.

Ted Neward, Android: Where You Can Stick Data

Answering questions about SQLite on Android: “It’s not Oracle, and if you treat it like it is you’re doing it wrong.”

Understand your platform and user paradigm. Enough said.

Bruce Eckel, Polyglot Programming: The Power of Hybridization

“You don’t know where the difficult parts will be”

So don’t plan to optimize anywhere, you won’t be right ahead of time. I have seen this myself more than once. The real trouble isn’t visible at the beginning. See any article on estimating for another aspect of this issue.

“Typing is noise”

Bruce favors languages with minimalist syntax, believing those languages express your solutions clearly for those who come after to read your code. This has inspired me to start learning Python.

“Go will replace C++ as the low-level language used in high performance applications”

I’m recording this for posterity. Bruce says he’s remarkably good at predicting these things, even though no one listens. I’ve read some of his work and have faith, so you read it here first.

Bruce Eckel, Reinventing Business

“The best people would be leaving companies all around you to come work for you if you were hiring the best

There is a metric for your recruiting staff.

Geeks Are Funny

After dinner on Thursday, there was a Pecha Kucha competition which was great entertainment, hosted by the inimitable Scott Hanselman, with a geek celebrity panel of judges consisting of Ted Neward, Julie Lerman, and Keith Elder. The winner was Leon Gersing, the heartfelt and real @rubybudda. Here are a couple cell phone videos of the event:

Jon Skeet Coding in the Style of Glee

Mel Grubb Urinal Rules

Leon Gersing On Love  Tiebreaker (Talking to a set of slides he’s never seen before)

Just as good as the talks was the Twitter stream on the big screen behind the presenters. You see a brief glimpse of it at the beginning of Jon’s talk. Geeks are funny.

Migrating from DasBlog to WordPress

Due to many circumstances, I have a need to upgrade my shared hosting from .Net 3.5 to .Net 4.0. Normally this is no big deal, but I was running my blog on DasBlog, which hasn’t been officially updated since 2009, and it won’t just recompile and run under .Net 4. While there are some branches of their code re-compiled for .Net 4.0, I decided that un-tested code was not for me. I then decided on WordPress for a platform, mostly to continue expanding my horizons outside of Microsoft technology, and also because my hosting provider supports it, and I have more MySQL instances available for database use than SQL Server. I found an excellent post on migrating from DasBlog to WordPress, and used it mostly for a template on what I did, but since I did do some things differently, I decided to document my process. So below are the steps and technologies I utilized to migrate my blog.

Create a Test Environment

For my purposes, the first thing I did was create a Windows 7 virtual machine to do the migration testing. My production site is using shared hosting, so I can’t run a .exe on the server to get the content, which one of the tools I wanted to use required. I installed IIS, PHP, MySQL, and WordPress. I also made a new instance of WordPress in a virtual directory that matched the name of the virtual directory on my production WordPress install.

Set Up DasBlog Locally

I downloaded both the app files and the content from my hosting provider, then placed them in a virtual directory under IIS in my test environment, inside a virtual directory named to match the directory from production. I changed the site name in the DasBlog site.config file to reference the new location so the app would work.

Extract the DasBlog Content

I used DasBlogML to extract the data from DasBlog on the local instance of DasBlog, which outputs a blogML XML file. Some articles imply you need to remove any non-breaking spaces (   ) from the resulting XML, but I didn’t and had no issues.

Import the Data

I added the BlogML Importer plug-in to both my local install of WordPress and my production instance. I used that plug-in from the test instance to import the data and examine the results. For me it worked without issues, bringing over all the posts, comments, and categories. I had about 160 posts to migrate.

Create A WordPress theme

I am still enamored with the current look and feel of my blog which I built for myself as a DasBlog theme. I decided to migrate that HTML layout into a new WordPress theme, instead of using one of the myriad of available themes. I started with the HTLM5 Reset WordPress theme as a base and added the HTML structure and CSS from my DasBlog theme. I ended up modifying quite a few files in the theme in order to get it to work, and getting accustomed to PHP along the way.

Migrate Data and new theme to Production

I zipped up the WordPress theme directory on my test machine, and uploaded it as a theme in my production WordPress instance. Then I migrated the data using the BlogML Importer plug-in. I also had to configure the widgets in the navigation area and manually migrate some data into them.

Redirection

This is where the real work for the migration begins. Since my blog has existed since 2003, I wanted to maintain my links in search engines as much as possible. I already lost this once when DotNetJunkies (where I began to blog originally) got closed down by Dr. Dobbs, and it killed my comment traffic going forward. The post by Andreas that I was following advocated writing your own Http Module in .Net to handle all the redirects. I initially thought that was the way to go, but I found out that my hosting provider has the URL Rewriting feature installed for IIS7, so I could use the config file route. I figured that would perform better than any code I would write and is likely less buggy, even though over time the code should be used less and less. It also let me handle some of the one-off pages I added on the site that looked like part of DasBlog but really were just static HTML files, as well as some other media content.

There are a number of type of pages that DasBlog uses that need redirect templates:

  • Permalink
  • Permalink by Guid
  • Categories
  • Dates
  • CommentView

DasBlogML also generated a CSV file matching up the DasBlog permalinks with the WordPress permalinks. I used that as a starting point, and also queried the blogML XML file for the guids and dates of each post, and then matched them up with the CSV file in Excel.  I then used simple formulas in Excel to generate the XML needed for a static re-write file. Because the number of rewrites is so numerous, I decided to store the mappings in an external file called “maps.config” and reference that from web.config. The basic structure (one example per type) of maps.config is:

  1. <rewriteMaps>
  2.   <rewriteMap name="StaticRedirect">
  3.     
  4.     <!– Permalink –>
  5.     <add key="/blog/2011/12/16/AndroidAVDProblem.aspx" value="/2011/12/16/android-avd-problem/"/>
  6.     <!– Category –>
  7.     <add key="/blog/CategoryView,category,Mobile.aspx" value="/category/mobile/"/>
  8.     <!– Permalink by guid –>
  9.     <add key="/blog/PermaLink,guid,d280262b-e81e-496b-abde-453b6381574f.aspx" value="/2011/12/16/android-avd-problem/"/>
  10.     <!– Comment View –>
  11.     <add key="/blog/CommentView,guid,d280262b-e81e-496b-abde-453b6381574f.aspx" value="/2011/12/16/android-avd-problem/"/>
  12.     <!– Track back –>
  13.     <add key="/blog/Trackback.aspx?guid=d280262b-e81e-496b-abde-453b6381574f" value="/2011/12/16/android-avd-problem/trackback/"/>
  14.     <!– Date –>
  15.     <add key= "/blog/default,data,2010-01-04.aspx " value= "/2011/12/"/>
  16.     
  17.   </rewriteMap>
  18. </rewriteMaps>

And in web.config of the DasBlog virtual directory I added the following section:

  1. <system.webServer>
  2.     <rewrite>
  3.       <rewriteMaps configSource="maps.config"/>
  4.            <rules>
  5.           <rule name="RedirectRule" stopProcessing="True">
  6.               <match url=".*" />
  7.               <conditions>
  8.                     <add input="{StaticRedirect:{URL}}" pattern="(.+)" />
  9.               </conditions>
  10.               <action type="Redirect" url="http://localhost/wp{C:1}" redirectType="Permanent" />
  11.           </rule>
  12.       </rules>
  13.     </rewrite>
  14. </system.webServer>

To get it to take effect I had to recycle the app pool of the DasBlog app. The important part of the rule is the action. By setting the redirectType to Permanent, it causes IIS to issue a 301 response for the redirect, which tells the caller this is a permanent change. So any search engine should re-write the link in their database and not start you all over again in search engine results. And any other links outside of your site will just redirect automatically.

At this point it seems the new blog is running fine and the redirects are all working. I left the DasBlog instance running, at least for a while. I’m keeping my eye on Google Analytics to see if any other hits show up on the old blog. I am not an expert as DasBlog, so if any other page types show up I’ll find out about it and fix it in the redirect file.

Ubiquitous Tech Predictions – Mobile Edition

Every year there are a bunch of articles this time of year predicting what will happen in 2012. So I’ll join the fray and reference a few with my own thoughts, mostly about mobility.

Mark W. Smith from the Detroit Free Press

  • BlackBerry users continue their exodus
    This is low-hanging fruit. I’ve been on this bandwagon for a while. I’ll amend his prediction to say RIM abandons the North American market for the third world, where they are currently making their money. They will focus on the BES in the North American marketplace. If they were smart they would focus on enterprise customers instead of consumers, but there is no evidence of good decision making at RIM. RIM should be bought by Google for the BES business alone in order to help Google get a foot hold in the enterprise back-end space. If not Google, the next most likely buyer is Microsoft, followed by Amazon.
  • Apple Releases the iPad3
    I think the iPad3 will be incremental, like the iPhone 4S, but will continue to dominate the consumer space. With no real competition at this point, there is little incentive for Apple to introduce innovative features that may be hit-or-miss. The real prediction in the tablet space will be Windows 8. Business are craving an enterprise-oriented tablet, and the inclusion of Microsoft Office will make Windows 8 tablets sell like crazy to business customers. Business users want Excel and PowerPoint on their tablets in meetings. The lack of Office on a Windows 8 tablet or late delivery will kill the platform.

Galen Gruman at InfoWorld

  • NFC gets real traction – but not for payments
    There are not enough phones with NFC support today.  Until NFC is common in phones, there is no incentive for businesses to adopt it on the other side. Users have two year contracts, and very few normal folks change phones during the contract time frame (unless you are an iPhone addict, and still no iPhones have NFC). So even if a bunch of phones get NFC in 2012, there will not be enough users to cause a change. Currently there is no widespread NFC infrastructure on the non-phone side because of that, so it will be 2013 before the common user gets NFC.
  • Make that two mobile shakeouts
    Mobile device management (MDM) will be huge in 2012. 2011 saw the proliferation of bring your own device to businesses. The enterprise will have to figure out how to do this securely, and I think MDM is the key. I agree this will cause buyouts and consolidation.
  • Google finally gets its Android act together
    I think Google side-steps the fragmentation by buying RIM/BES to get an MDM solution, and adapting it to hook into Android as a core feature that still allows the hardware makers to customize Android in crazy ways and still be secure for business. The good news for Google is that users largely blame the hardware maker and not the OS for issues with their phones. Google is selling to the hardware vendors, not the consumers directly, so they have a large incentive to please those vendors.

Buzz Out Loud from CNET

  • Amazon buys Netflix
    No way. Netflix is the biggest user of the Amazon cloud, and probably a huge source of revenue for that business, which is really important to Amazon’s future plans. Why buy your biggest customer? Unless Netflix is going to go out of business, there is no point for Amazon to acquire them, it will hurt their cloud business.
  • Video Conferencing on Phones
    Video conferencing has not caught on and still won’t in 2012. Why? No one really wants everyone to see you while on the phone for lots of reasons. PJs, bathrooms, hair, and many more.
  • Users lose confidence in Android, WP7 gains because of this
    Again, I don’t think users blame Android as the problem, but the hardware vendor, whose name is prominent on the front of the device. Look at bad reviews for apps in the MarketPlace. The disgruntled users often list their device. The fragmentation is squarely on the hardware vendors’ shoulders, and they will pay for bad implementations. There is no alternative OS for the hardware vendors. (Bada? MeeGo? Can I get Angry Birds on that?) Users are not smart enough to understand the problem and move to a platform consistent across hardware vendors like WP7. It would be great if Google would stand up to vendors and reduce the crapware and customization, although Microsoft never has for Windows and still dominates. Android is open-source after all, and fragmentation is one of the often discussed possible outcomes of an open source project.
Posted on:
Posted in Mobile, Reviews | Comments Off

Looking Back and Forward

What Happened in 2011

  • I spent too much time with SharePoint (as the Cloud lead developer) so
  • I changed jobs which means
  • I moved into mobile development
  • And therefore I learned to write code for BlackBerry and Android which means
  • I learned Java
  • I got to deploy my first apps in the cloud for mobile back-ends, using both Azure and Google
  • Spent a fair amount of time with Mobile Web

Goals for 2012

Today I found a great post by Michael Crump about goals for the coming year. I guess I’m doing OK because I am already doing most of the things he advocates, and I agree with all of them. I’m going to incorporate some of those with modifications for myself.

My own goals for 2012:

  • Continue becoming a polyglot developer
    • Learn a new programming language (Objective-C)
    • Learn and use a new design pattern (TBD)
  • Read and Contribute to Stack Overflow more often
  • Get an app in two app stores
  • Consistently generate blog and Twitter content
Posted on:
Posted in Programming | Comments Off

Living in a Mobile Bubble

I’ve been so entrenched in learning the mobile paradigms over the past few months, that I suddenly realized I’m living in a mobile bubble. I have come to the stark realization that most companies don’t get mobile. I don’t think it’s that hard or a long way to go, but I can see it’s not happening yet.

Lunch with my wife yesterday was a perfect example. It was a sub shop (that I love), and they had advertising cubes on the table. I picked one up, and was briefly excited to find a QR Code on the bottom. I immediately thought, “Wow, these guys are addressing mobile!”, until I actually scanned the code. The URL was a link straight to their home page. OK. I followed the link on my phone. The page opens and the main content is one single graphic, but at least the navigation and header are not. If you have a smart phone, you would know that you can’t scroll the page easily by swiping a big graphic, especially when the page/graphic is loading. So to scroll I had to carefully swipe the obligatory right “social media” box to scroll the page to find out there was nothing below the huge picture. The whole experience was disappointing to me. So lets enumerate the mistakes here:

  1. The QR Code
    1. It contained only the link to the home page. Huge opportunity lost. How are they tracking users coming from the code? They are not. No query string parameters, no redirection/click-through.
    2. No reward for scanning the code. Does this company use email promotions? Why yes they do. Did they give me some incentive to scan any of their QR codes again later? Nope.
  2. The web site
    1. The site is not mobile friendly, yet they made an effort to get me there on a mobile device.
    2. The navigation menus on the web site rely on hover. There is no hover in mobile.
    3. Big graphics load really slowly on mobile networks. Abandon the 1990’s, come to the present. One big picture might look good, but it’s not functional. If pretty pictures sell your food, why bother with mobile devices and QR codes?
    4. Of course the site isn’t formatted for mobile devices. It’s a fallacy to think that because it renders OK on the newer mobile browsers, that forcing the user to pinch-zoom to read anything is acceptable.

This brings me back to my bubble. I probably have unrealistic expectations of how companies are using or embracing mobile. The information on how to do this well is out there. Why aren’t companies finding it? Is it that the technical audience knows these things, but the marketing audience does not? Or is the mobile customer base really that small, and the companies just don’t care at this point? I think in this case they must care if they made the effort to put QR codes on their tables. So maybe I’m in a bubble, expecting these things because it’s what I’ve been immersed in for the past few months. Maybe normal mobile users don’t have that expectation. Maybe next year companies will get mobile.

Android AVD Problem

If you move your user profile off of your c:\ drive (in Windows 7 x64 in my case), Eclipse will no longer be able to start the Android emulator (AVD). It gives the following error message in the console:

PANIC: Could not open:  C:\Users\dave\.android/avd/myAVD.ini

This issue has been documented here, and also a few solutions. The solution that worked for me was to make a symbolic link on the command line to the directory that actually contains the AVD settings:

mklink /J "C:\Users\dave\.android" "D:\users\dave\.android"

Now when Eclipse asks for C:\Users\dave\.android it is redirected to D:\Users\dave\.android where this directory actually exists.

Lost Standard Toolbar in Outlook 2007

I didn’t realize how much I use the tool bar in Outlook, but once it was gone, I felt crippled. I have no idea why I lost the toolbar. Corrupt file maybe? Even when I went into the Customize Toolbars dialog box, it was gone:

Missing Toolbar

My colleague Brian Cecile found the solution:

  1. Close Outlook
  2. Open your C:\Users\usernamehere\AppData\Roaming\Microsoft\Outlook directory
  3. Rename the file outcmd.dat to outcmd.dat.old
  4. Restart Outlook

Standard toolbar restored. Likely any other toolbar customizations you may have done are now gone/reset.

Technical Resumes and Interviews

Having done a few horrible technical reviews lately, I figured I should post a little info to help prospective interviewees out. So here are some of my pet peeves that I run across during interviews (or on resumes) that will immediately get you removed from consideration.

Listing Skills or Technologies You Don’t Know

Seems obvious, but clearly it is not. If you list a technology on your resume (especially the harder ones or ones not strictly in your specialty), I’m going to ask about it. For instance, if you list all the technologies in a project you were on, but all you did was update ASP.Net pages and someone else did the WCF/SQL Server/whatever it is, you shouldn’t list it. Technology acronyms may get the recruiter’s attention, but I am going to ask you about it, and if you don’t know it, I’m going to assume your resume is a batch of lies. I don’t have the time to figure out what you do know so I’m just going to eliminate you.

Listing Clients as Employers

Your clients did not hire you as an employee, but a contractor. Those are very different scenarios. If you work for a contract house and worked on a project at Proctor & Gamble, P&G is not your employer. I have personally seen contractors list Microsoft as an employer because they worked on a project led by MCS. You were not an employee of Microsoft, you were a sub-contractor. You did not go through the extensive hiring process at Microsoft and pass. Someone at MS hired your company to provide developers, and not specifically to hire you. That’s not the same thing at all.

Brush up on Basics

If you are a developer whose main skill set is Java or .Net, you should know OOP basics. How about the four pillars of OOP? I am amazed that interviewees with 10+ years of experience can’t answer this question. If you know C#/Java/whatever, you should be able to tell me what the language keywords mean and their effect. I expect you to be able to write code in the interview. I don’t think you should be able to write up a connector for WIF, but some basic coding without the benefit of Uncle Google is a prerequisite.

Opinions

I am consistently shocked by the number of developers who won’t express an opinion, on even the simplest of questions, like what do you like better about C# compared to language X?. I don’t want team members who won’t tell me what they think or even tell me if I’m wrong. I’m pretty sure if you can’t express your opinion in an interview you can’t work on my team.

Look up your Interviewer

Again, seems pretty basic, but it doesn’t happen. I know the recruiter gave you my name. In almost 10 years of interviews, only two people actually looked me up ahead of time. If you are reading this before I interview you, congratulations, you are on the right track, but I’m pretty sure you are the minority. This is an easy way to demonstrate some initiative.

Listen

Again, I can’t believe I have to write about this, but listening to the interviewer is kind of important. I can tell when you aren’t listening to what I say, and if you can’t listen to me in the interview, why would I think you would listen to your team once hired?

Ask Questions

If your only question is what is the project this interview is for, I’ll just assume you are just another contractor looking for a gig and not looking for a career at my company. Again, I don’t want you. If you don’t know anything about my company going in, I’m going to assume you are lazy in your work as well.

Learn About Tech Interviews

Do yourself a favor, learn about tech interviewing:

What Great .NET Developers Ought To Know

On Interviewing Programmers

The Guerrilla Guide to Interviewing

Java Posse Discussion

BlackBerry Simulator Error with SQLite and HTML5

When testing an HTML5 app on multiple BlackBerry simulators, on some of them I was getting the error:

SECURITY_ERR: DOM Exception 18

What this turned out to be was the lack of an SD card in certain simulators. The browser was expecting to use that storage space for the SQLite DB files. Once I set up the SD card for the emulator the error disappeared.

.Net to Java Resources

I found a few articles on getting started with Eclipse and Java, so I am posting them as a follow up to A .Net Developer’s Journey into Java:

An introduction to Eclipse for Visual Studio users

Eclipse IDE Tutorial

Comparison of the Java and .NET platforms

Debugging with the Eclipse Platform

Comparison of C Sharp and Java

Posted on:
Posted in Java | Comments Off

Bad Behavior has blocked 53 access attempts in the last 7 days.