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

Open Source Risks

It’s really surprising to me than a widely reported recent WordPress plugin hack was mostly brushed off as just another system getting hacked. I really see this as a much bigger issue. While the WordPress team did a good job of detecting and handling the situation, they still forced password resets on everyone using the system. As a developer, it looks like they were not 100% sure they had closed all the loopholes or found all the malicious code.

How did the hack actually happen? The hackers managed to impersonate developers on the project and check in a very few lines of code that created a back door for the hackers to get in through. At some point this was caught by the team reviewing check-ins, but the across-the-board password reset makes me wary. This post makes it seem like the code made it into the repository and was available to some users for a short period of time.

The bigger issue here is that hackers are actively targeting open source projects. This problem is much bigger than the hack itself, and no one is talking about it in the online conversation (that I have found). Large companies already prohibit the use of open source for this very reason, and are being proved right. Enterprise developers are forced into building sub-optimal solutions since they can’t use open source.

In this instance the project team was diligent enough to catch it before it got too far. What about other projects? Are there back doors out there now. I’m certain there are. As a developer, what is the quantifiable risk of using an open source library? We need to address this situation without killing the collaboration and openness of open source.

The large companies are addressing this by getting smaller companies to indemnify the open source project and take on the risk of being sued if a hack gets through. While this is working on some fronts, it certainly doesn’t scale. There are thousands of open source projects, most of which will never see indemnification by a third party.

I don’t have the solution in hand, but it seems to me the conversation needs to get moving.

Posted on:
Posted in Security | Comments Off

A .Net Developer’s Journey into Java

In my new job working in mobile development, I am getting know Java more in depth, because native applications for both BlackBerry and Android are typically built with Java. I was excited about Mono for Android as an option for me, but I think it’s a little too new to gather much acceptance for the kinds of clients I am currently dealing with, as well as my colleagues who are mostly Java developers. And now the uncertainty around the Mono project makes this untenable for the near future.

Differences

As I continue to dive deeper, I am genuinely surprised at how much Java and C# overlap. There are of course differences, but these are much fewer than the similarities.

IDE

Of course this point has nothing to do with the language differences, but it affects how you get there. Getting to know Eclipse has been interesting. Since I was a recent convert to ReSharper with Visual Studio, initially Eclipse seemed like a real step backward. The autocomplete is not as good as VS Intellisense, and the syntax highlighting isn’t as good. I learned about FindBugs, a plug-in for Eclipse that performs code quality inspections similar to ReSharper. It’s not as robust, but for the time being it’s workable. I still haven’t found the productivity tools ReSharper provides. I want to get to know IntelliJ IDEA (assuming it’s as good as ReSharper because it’s also from JetBrains), but I have two problems so far:

  • BlackBerry development can only be done with Eclipse
  • All the Java devs around me are using Eclipse

I’m going to try IntelliJ IDEA for doing some Android work on the side. If it’s much better I’ll work on swaying my colleagues.

It’s also interesting that most folks have multiple copies of Eclipse installed, each one configured with the plugins dedicated to a certain kind of development, i.e. one for BlackBerry, one for Android, one for back-end web services, etc. Apparently Eclipse doesn’t use the registry, so multiple copies is not an issue. Installing the plugins is a pain. Sometimes you get them from the IDE using a built in feature, other times you download and install them separately. I guess VS is similar, you just need to do it much less often.

Lack of Properties

Right off the bat this was difficult for me. You can make members public, but as in .Net this is frowned upon. So you end up creating getPropertyName() and setPropertyName(value) functions explicitly, and they show up as methods not as members. I guess I am spoiled by the auto-implemented properties in .Net. I needed to change the way I looked at accessing data in a class.

Strings

While string objects themselves are very similar (immutable, StringBuilder, etc), formatting them is different. There is a static String.format() function, but it requires a little more stringent parameters than the .Net version, akin to the string formatting you do in .Net during declarative databinding in ASPX pages. Java also has dedicated classes for formatting numbers and dates

Events

While events are built into the Java language, it’s in a much more rudimentary way in comparison to .Net. You have to do all the plumbing yourself. Frameworks like AWT and Swing help with this, but as a mobile developer these aren’t doing me any good. It seems to me there isn’t as much focus on this as there is in .Net.

Linq

The kind of functionality you get from Linq is not built into Java directly. You need a 3rd party library to do something similar, like lambdaj. In fact, using 3rd party libraries is more of a pattern in Java than in .Net. There are tons of open source libraries to extend the language, which is not as common in .Net.

Open source continues to be a problem for me. I keep doing work for large corporations, and mostly they will not accept open source in software solutions. Essentially they don’t trust the source from a legal perspective, so unless some third party comes along and indemnifies the source for them (like RedHat or Novell has done for Linux) large corporations just don’t want to use it. Now that I have seen how easily hackers can affect open source, I can see where their paranoia is coming from. Ultimately, they are actively choosing sub-optimal solutions to avoid any risk, instead of managing the risk. I’m sure there is a scaling factor here for the largest companies. This is another hidden contributor to the costs and failures of software development.

Null Pointer Exception

Null Pointer Exception == Object Reference not set to an instance of an object. Which one is a clearer message describing the actual problem? Neither one.

Naming

The naming conventions in Java differ somewhat from what is accepted in .Net. Methods start with lowercase letters. I’ve seen a bunch recent code written by other Java developers and am deeply disturbed that Hungarian notation is alive and well. It’s down but not out in the .Net world, I hope I don’t find it thriving in Java….

Class Duplication/Refactoring

I’m finding with all the different namespaces and open source projects available, that lots of open source developers adopt the “not invented here” attitude and create their own version of a class, ranging from slightly to wildly different. Classes for handling JSON are a great example of this. I have found at least half a dozen implementations of the JSONArray class. Uncle Google is no help for this newcomer. Which one should I be using? Will I need to build a façade into my designs so I can use more than one? Do I now need to build time into my estimation to research all the possible implementations of a concept.  How do Java teams manage that?

As I continue delving into the differences I’ll likely have more posts.

Posted on:
Posted in Java, Programming | Comments Off

Is RIM the Next Novell?

At one time, Novell was the king of the networking hill. Anyone interesting in becoming a network administrator had to know Novell. Then Microsoft came along and took their lunch money pitting the graphical and desktop friendly NT Networking against NetWare. Novell was seen as lacking vision and lagging behind their competitors. Sounds an awful lot like RIM today. Their last smartphone entries have been failures, and the upcoming PlayBook doesn’t look like an improvement in their track record. One of the strengths of the BlackBerry platform has been messaging, and they are releasing a product that doesn’t do that without being tethered to an existing BlackBerry device. The PlayBook is going to support Android apps instead of fostering their own third party developers because it’s another new platform that is coming out before there is a developer ecosystem. It feels rushed. RIM’s main customer is the enterprise, not the consumer. Enterprise executives want the sexiness of an iPhone or iPad with the security of a BlackBerry. RIM is not making that happen.

RIM has a definite hold on the enterprise market for mobile phones. This is in large part due to their tremendous security on the devices. The BES server is encrypting data transfers and improving network response time to the devices. Everything stored on the device is encrypted. Administrators can remotely wipe data from the devices. None of this is going to come from Apple. The enterprise is not their main customer, it’s the consumer. Google might be able to do this with Android, but more than likely it will come from the cloud. Google does not have the internal server market in hand.

Microsoft has built a huge empire in the enterprise with sever software and networking. They are the most likely competitor to take out RIM. Why haven’t they focused on extending their enterprise platform for mobile devices? If they came out with a secure phone that was integrated with their products (Exchange, Office, SharePoint, CRM) RIM would be out of the game. Microsoft has been blinded by the iPhone’s success (and now Android) in the consumer market.  Recently, they have seen consumer success with the XBox and Kinect. It seems to me they want Windows 7 phones to do the same thing. I really don’t think that is the market for them. RIM is trying to give the enterprise market to someone, why isn’t Microsoft taking it this time?

Posted on:
Posted in Mobile | Comments Off

Merging The History of Two Documents in SharePoint 2010

The problem I needed to solve was this: Two users were independently creating the same document. Once this was discovered, one of them was chosen to be the master document. But the users didn’t want to lose the other document, even though it was not chosen as the master. The users wanted to merge this document into the history of the master document. Technically, it is not possible to alter the history of any document in SharePoint. So I decided we would create a new third document, which was generated based on the two documents to be merged. By using the SharePoint API I could control the dates and merge the histories of the two documents into a third one. Once that was done, the original documents could be deleted.

The basic algorithm works like this:

  1. Choose 2 documents, one to be the master, one to merge into the master
  2. Fetch the history of both items into a List<>
  3. Sort the list by date
  4. Loop through the list and write the historical files to a new list item, creating a new history
  5. Write the current version of the merge document  to the new list item
  6. Write the current version of the master document to the new list item, including the properties

I did try to keep the properties to all the previous versions, but there was some resulting weirdness that went away when that part was removed. Since the metadata wasn’t a strict requirement, but a nice-to-have, I didn’t investigate that any further. YMMV. Here is the code for the algorithm:

/// <summary>
/// Merges the history of two SPListItems into a single SPListItem
/// </summary>
/// <param name="siteUrl">The URL of the SharePoint site</param>
/// <param name="listName">The Name of a list containing the documents to be merged</param>
/// <param name="keepDocName">The name of the document which is the "Master"</param>
/// <param name="mergeDocName">The name of the document which is merging it's history into the master.</param>
/// <param name="newName">The name of a third document which is the destination of the other two</param>
protected void MergeDocuments(string siteUrl, string listName, string keepDocName, string mergeDocName, string newName){     //Attach to SharePoint, get the list and documents     var site = new SPSite(siteUrl);     var web = site.OpenWeb();
     var list = web.Lists[listName];
     var keepUrl = string.Format("{0}/{1}", list.RootFolder.ServerRelativeUrl, keepDocName);
     var discardUrl = string.Format("{0}/{1}", list.RootFolder.ServerRelativeUrl, mergeDocName);
     var keep = web.GetListItem(keepUrl);
     var merge = web.GetListItem(discardUrl);
     //Push the versions from each document into a list that can be sorted by date     var allVersions = keep.Versions.Cast<SPListItemVersion>().ToList();     allVersions.AddRange(merge.Versions.Cast<SPListItemVersion>());     allVersions.Sort(new SortVersionsByDate()); //SortVersionsByDate is a simple IComparer for the created date
     //Create the upload url for the new document being merged     var newUrl = string.Format("{0}/{1}", list.RootFolder.ServerRelativeUrl, newName);
     //Write each old version as the new file to create a merged history     foreach (var version in allVersions)     {          if (version.IsCurrentVersion)                continue; //Skip the current versions of each, we need for them to be the last two docs
          var oldFile = version.ListItem.File.Versions.GetVersionFromID(version.VersionId);
          var oldestFile = list.RootFolder.Files.Add(newUrl, oldFile.OpenBinaryStream(),                                                     null, version.CreatedBy.User,                                                     version.CreatedBy.User, version.Created, version.Created,                                                     oldFile.CheckInComment, true);
          //Even though the dates were set in the call above, it doesn't work          // when setting them in the past, so call this fixes the issue          UpdateListItem(oldestFile.Item, version.Created, version.Created);
          list.Update();
      }
      //Add the last version of the merged document      WriteFileToSharePoint(list, merge, newUrl, false);
      //Add the Final version of the document      WriteFileToSharePoint(list, keep, newUrl, true);
}
/// <summary>/// Helper function to set the created and modified dates on a list item./// The reason for this function is to allow the dates to be set in the past./// </summary>/// <param name="item">a SPListItem</param>/// <param name="created">Date created</param>/// <param name="modified">Date modified</param>protected void UpdateListItem(SPListItem item, DateTime created, DateTime modified){      //Update the modification/creation dates.      item[SPBuiltInFieldId.Modified] = modified.ToLocalTime();
      item[SPBuiltInFieldId.Created] = created.ToLocalTime();
      item.UpdateOverwriteVersion(); //Keep the changes to the date/time from making a new version of the item}
/// <summary>/// Upload a file to a list based on an existing SPListItem/// </summary>/// <param name="list">The target list for the upload</param>/// <param name="doc">The existing SPListItem</param>/// <param name="newUrl">The url to upload the file to</param>/// <param name="final"></param>protected void WriteFileToSharePoint(SPList list, SPListItem doc, string newUrl, bool final){     Hashtable props = null;
     if (final)        props = doc.Properties;
     var lastMergedFile = list.RootFolder.Files.Add(newUrl, doc.File.OpenBinaryStream(), props, doc.File.Author,                          doc.File.Author, doc.File.TimeCreated, doc.File.TimeCreated,                          doc.File.CheckInComment, true);
     UpdateListItem(lastMergedFile.Item, doc.File.TimeCreated, doc.File.TimeLastModified);     list.Update();}

I deployed this as a PowerShell cmdlet, which is explained here and here. Essentially that route was chosen because the merging was to be performed on request by an administrator. It would be easy enough to wire this up to a ribbon command in the UI though.

Posted on:
Posted in SharePoint | Comments Off

“Keyset does not exist” Error while Installing SharePoint 2010

In my continuing battle with SharePoint, I needed to set up a new development environment. This time I am constrained to using Windows 7. Clearly, this has been done before and good instructions exist. But, as is frequently the case with me and SharePoint, it just doesn’t work as advertised. I was performing an install with a local account instead of a domain account (a constraint I have no control over), which I have had issues with before. This time I got a new error when trying to create the configuration database using the new-SPCofigurationDatabase cmdlet:

Keyset does not exist

Turns out this was happening whether I tried to do a complete install with the SharePoint version of SQL Express or with a full version of SQL Server. I found one post which purported to have the solution, but it wasn’t the case for me. I think Sasha was trying to do a standalone install, which is not what I wanted. I have SQL 2008 R2 installed, and I wanted to use that instead of getting another SQL Express instance installed.

This post pushed me in the right direction. Unfortunately, I did not have the directory pointed out in the post, possibly because I was on Windows 7. For me the path was:

C:\Users\All Users\Microsoft\Crypto\RSA

The service account I was using during the install did not have permission to that directory. So I gave it Read/Write access, and was able to create the configuration databases and using the SharePoint Products Configuration Wizard to complete the setup and configuration of SharePoint.

Executing PowerShell in a Post-Build Event

This is another one of those tasks where I thought it should be simple. That should be a red flag right there. I ended up spending way too much time on this, and as it turns out it is really only a matter of syntax. I ran across a lot of incorrect information out there, so I figured I should post this and help make the links to the right content easier to find.

I was actually building my own cmdLet for PowerShell in C#, and decided I should deploy it using PowerShell, which seemed appropriate. For me, the basic stumbling block for getting this working was quotes. I had multiple paths in my script, all of which had spaces in them, which necessitated the use of nested quotes. This was quite hard to figure out, but Philippe had the right information. He also pointed to this article, which had a thorough explanation of how to call PowerShell from the command line, which is essentially what you are doing inside a post-build event.

Since my cmdLet was really for SharePoint, I later figured out how to add it using the SharePoint 2010 project type in Visual Studio and some declarative XML, making all the previous pain a moot point.

Shrinking SQL Log Files During SharePoint Development

I have been developing for SharePoint lately, working on timer jobs. This resulted in tons of deployments and job runs, and before I knew it my SharePoint_Config database was huge! I was working in a virtual machine with disk partitions, and my data disk ran out of space. At least it was on a partition and I didn’t hose my OS….

So it seems to be a simple problem to solve. Backup the database, shrink the log file. Not so fast partner, this is SharePoint. The database is not in Simple recovery mode, it’s in Full recovery mode (for a reason I am sure, I just don’t know what it is). You can truncate the log file and remove the data, but the physical file won’t shrink. My colleague J Wolfgang Goerlich pointed out one of his old blog posts that was just the ticket. Essentially you are changing the mode, shrinking the file and changing the mode back all in one operation, which won’t upset SharePoint. The log file went from about 9 gigs to 600k. Nice.

As noted in the blog post, this is not a good thing to do to a production system, there are consequences. But for a dev system I wouldn’t worry about it.

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