September 25, 2009 Comments Off
Anyone who has been around us long enough knows that we are huge fans of companies like HashRocket and 37Signals. Not because they’re making tons of money, although that’s an admirable trait, but because of their approach to software development as a whole. These companies above all else, pride themselves on excellence, and in our line of work, that’s something to strive for.
Obie recently wrote an article that caught our attention, 10 Reasons Pair Programming Is Not For the Masses and I wanted to comment on a few of the points that he makes. We’ve considered this approach here at Black Ninja and we’ve even gone as far as trying it out for specific projects, but we haven’t committed ourselves the way HashRocket has (its probably safe to say that not many companies have). It definitely has its advantages for development, more specifically by increasing productivity and reducing the output of poor quality code and we can see the value in it.
10. Most software managers don’t want to invest in the necessary hardware
This is a good point with a great ‘gentle rebuttal’ by Brian Guthrie that you can check out here. I think a balance needs to be had, between getting the best tool for the job and not spending $5000 on a developer workstation. There are many contributing factors, but the bottom line is this: most software development shops don’t really take the time to understand the toolset that’s needed by a developer to really be efficient at what they do. That’s the core of what Obie is getting at. Here at Black Ninja we recognize that performance, space and comfort are important to us and we do our best to keep on top of that. While we still have some work to do to get where we’d like to be in terms of hardware and infrastructure, our current setup looks like this:
We all have 24″ iMacs, Razer DeathAdder gaming mice, Wrath of the Lich King mouse pads, (made by SteelSeries – their mouse pad product line is the best out there!), mac keyboards, comfortable desks, mesh chairs and a 4 shelf Red bookshelf for our geeky computer books. Each workstation is also equipped with a whiteboard for jotting ideas down, and we encourage our employees to decorate their space with whatever motivates them most.
I’m in total agreement with Obie, nothing is more frustrating for a developer than working in an environment where decent hardware is difficult to justify. It it makes sense for our business and helps improve our productivity, then it becomes a part of our work life. This also extends into the toolsets we use to get the work done. This ranges from things like Pivotal Tracker to Freshbooks, you can read the entire list here.

6. Most software people don’t understand pair productivity
I think this is a fair statement and one that holds true for a great number of software shops. As Obie outlines, it’s easy to equate two people doing a single task as half the work done, but in realty, it’s a lot more productive and the quality of code is a lot better. The difficulty in our mind comes down to what Obie describes as wasted time:
To the average programmer, having to pair full-time means they won’t get to waste time during the day on Reddit or Hacker News.
I’m not sure if keeping up to date on current trends should be considered a waste of time, as long as it’s not taking up the majority of one’s day. There is real value in following a few blogs and reading up on what your twitter followers are talking about. My twitter account specifically contains no personal content but rather, a well thought out range of people that tweet about SharePoint including MVP’s and other consultants that are in the same line of work. The same holds true for everyone here at Black Ninja. I find it intriguing that HashRocket can keep their employees productive all day, every day, without interruption but I also recognize that their business model is slightly different than ours. I think as Black Ninja evolves this is definitely something we’d like to try. Our commitment to excellence will always be our bottom line and if pair programming helps us get there, then it’s definitely something to consider carefully.
A huge thanks to Obie for taking the time to outline how things work at HaskRocket!
June 4, 2009 Comments Off
Yes you can call and use your ASP.NET controls from jQuery! Shereen has already posted a blog on how you can access these controls JQuery Accessing the Client Generated ID of ASP.NET Controls so feel free to check it out there first.
Recently we’ve had to create a UI that has a datepicker, and the date that a user selects should determine what values get populated in an ASP.NET dropdown.
Here’s how we did it
We’ve listed below the two controls we’re using in this example: a calendar control and an asp.net drop down list.
1
2
| <input id="datepicker" type="text" />
<asp:DropDownList ID="ddlDates" runat="server" Width="100px"></asp:DropDownList> |
For the date picker, we used the DatePicker control from jQueryUI. Their demos and documentation are a great starting point, if you have any troubles with the calendar on your site, drop us a line.
Next, we had to add the following references:
1
2
| <script src="http://myserver/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="http://myserver/js/jquery-ui-1.7.1.custom.min.js" type="text/javascript"></script> |
Then we wired it up! Good ol’ jQuery!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| function PopulateDropDownDates(dateText, numDaysToAdd)
{
var selectedDate = new Date(dateText);
//clear the dropdown
$("#<%= ddlDates.ClientID %>>option").remove();
//add todays date
$("#<%= ddlDates.ClientID %>").append($('<option></option>').val(dateText).html(dateText));
//counter
for (var i = 0; i <= numDaysToAdd; i++)
{
var currentDate = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), selectedDate.getDate() + i);
currentDate = currentDate.getMonth() + 1 + "/" + currentDate.getDate() + "/" + currentDate.getFullYear();
$("#<%= ddlDates.ClientID %>").append($('<option></option>').val(currentDate).html(currentDate));
}
}
$(document).ready(function() {
$("#datepicker").datepicker({
onSelect: function(dateText, inst)
{
PopulateDropDownDates(dateText, 14);
}
}); |
Voila! That’s it. Works beautifully!
In case it’s not obvious, Black Ninja’s site uses WordPress. WordPress makes it super easy for us to keep an active profile on the web via quick and easy updates. But WordPress on it’s own is not enough. We wanted a site that was not only functional but also looked good.
During the early days of Black Ninja, we knew we wanted to get something up quickly but with little cost. We are a serious company, who prides itself on it’s professionalism, passion and dedication to the work we do and we wanted a site to reflect that. We’re also a fun bunch, so a bit of humor and playfulness was important too. We spent a fair bit of time trying to find a good theme to compliment our WordPress installation and content we’d already posted to our site. Most of what we’d found was reasonable, but the style and sleekness was not quite what we were looking for. Free doesn’t necessarily mean better so we were open to both.
Then we came across WooThemes, and I have to admit, we were hooked from minute one! First impressions are really important and WooThemes didn’t disappoint. They certainly had their stuff together regarding their website. It was clean, professional and full of activity. All very good signs. Their demo page was thorough, and what i mean by that is: the content was all there, the colors were available to pick between and the pages were presented in a way that made it easy to visualize YOUR content in place of theirs.
The price point was the next big plus for us. As a small business and a relatively new startup it wasn’t feasible to pay $500 dollars for a theme. WooThemes hit the spot with their $70 dollar single license theme or $150 for the developer license if you’re interested in using the theme on multiple client sites and require the image files. How can you even go wrong with a price like that we figured?
Doing a bit of reading also makes it quite obvious very quickly, that the team behind woothemes is not only passionate but very talented at what they do. The forums are very active and I’m usually able to point out quite quickly who the woothemes guys are. They visit their forums frequently and they take an active approach to helping users with their support/theme issues. Honestly, you don’t get that level of support from many places even if you are paying for it.
These guys actively twitter, they are constantly updating and getting user feedback and every once in a while they get us excited about some cool promotional offer they have going on. April Fools for example was the 4 for 1, buy 4 themes for the price of 1. And let’s not forget their generous new 2 for 1 permanent offer allowing you to buy 2 themes at the price of 1. And for those of you who haven’t already noticed, they offer some of their themes for FREE as a way of showcasing those themes. How cool is that? How many companies would do that when they clearly don’t have to!
We love these guys because they are constantly fresh, exciting to watch and a lot of fun to observe grow and expand their theme lineup. They genuinely care about their customers and you won’t have any troubles finding some help if that’s what you’re seeking. If you haven’t already checked out woothemes, I encourage you to do so and I guarantee you won’t be disappointed.
If you’re currently using WooThemes, post a comment, we’d love to hear your feedback.
BTW, both Shereen and Matthew use WooThemes on their personal blogs too!
It’s not often that we come across a tool that makes us go ‘WOW’. Balsamiq’s Mockups for Desktop flagship product did just that when I gave a demo of it yesterday to the internal team here at Black Ninja. I vaguely remember DHH tweeting about this tool and I made a mental note to take a look at it in more depth a bit later. Well, yesterday was that day for me and I have to say I am thoroughly impressed.
I was able to mockup a UI of a custom page I’m about to build in SharePoint and it took me a little over 1 hour to produce the png that I eventually sent to the client. As a pleasant side-effect, the client was quite impressed by my mockup. If you’re interested and want to learn more, check out their 3-minute demo video or their online examples, it’ll give you a good idea of how easy this tool is to use.
Here is my summary of this tool:
- Very easy to install, I was able to get it downloaded, installed and ready to use in about 2 minutes.
- Very easy to use, when you first install the app, the default page that loads is a UI mockup that gives you some guidance on how to use the tool. I thought that was very clever.
- I did not need to read a help file, access a kb or talk to a support person to start making mockups.
- I can save all mockups I create, and when I’m ready to present to my clients, I can save as png and email to them.
- My email inquiry was responded to in about 2 hours.
I encourage you to try their online demo! I think these guys are doing a great job and I look forward to seeing what comes next.
We ran into an issue today – one of our calculations that rely heavily on CAML queries stopped working. The CAML query we use – which we haven’t changed in forever and which used to work – now returns 0 results when run.
This is what our original query looked like:
1
2
3
4
5
| <Where>
<Eq>
<FieldRef Name='Project' LookupId='TRUE'/>
<Value Type='Lookup'>100</Value></Eq>
</Where> |
It’s not a complicated query, and this used to work. Used to. But for some reason, it doesn’t anymore.
And for some reason, if we change the Value from Type=’Lookup’ to Type=’Integer’ it magically works again:
1
2
3
4
5
| <Where>
<Eq>
<FieldRef Name='Project' LookupId='TRUE'/>
<Value Type='Integer'>100</Value></Eq>
</Where> |
Why will using Type=’Lookup’ suddenly fail, and using Type=’Integer’ work? Does this mean we need to change all of our CAML queries that use Lookup?
What changed? No new service packs. No recent patches.
We tried to retrace our steps, in the hope that we don’t have to rewrite all of our CAML queries and retest all our application pages:
1. No change
2. No change
3. Ah, one minor change, but all we did was create an index in the Project field because we have over 2000 items in this list.
Indexing the column should help optimize retrieving records from this list. But could indexing the Project field be the culprit? This seems to be about the only change we did on this list.
But I think to myself, it should not be the culprit. Right?
I am a database person, and I create indexes here, there and everywhere whenever I need performance gains on some of my reports (ok, let me qualify that, I index where it makes sense. Of course if it is a purely reporting read only database, then I will index the heck out of it. OLTP databases are a different story). So for me, I don’t think it should affect the way we retrieve our records using our CAML query.
We needed to test if this was the case, so we did a quick experiment:
1. Created a custom list with a field that uses a regular lookup to another list
2. Used CAML with Type=Lookup ——-> Works
3. Indexed the column
4. Re-tried the CAML with Type=Lookup ——-> Does not work
5. Tried CAML with Type=Integer ——-> Works
6. Removed index from column
7. Re-tried the CAML with Type=Lookup ——-> Magically works again
So, why would (or should) the implementation of our CAML query change when we decide to index, or drop an index, from one of our SharePoint lists?
We tried to look for an explanation, but we haven’t found any official documentation, or any definitive rationale.
Again, maybe I just don’t understand, but in my database world, creating indexes, or dropping indexes from my tables does not break my SQL queries.
So why should indexing break a query in the SharePoint world?
Anyone from Microsoft SharePoint team care to explain? I’m sure we’re not the only ones interested to know the answer.
April 9, 2009 Comments Off
Sometimes when creating SharePoint web or console applications, you may need to execute specific code blocks in another user’s context.
Impersonating users in SharePoint will require a couple of things:
- the account that the web or console app uses has privileges to impersonate other users (typically this would be the system account)
- specific users’ user tokens
Continue Reading
April 7, 2009 Comments Off
Sometimes you may need to integrate simple Javascript code blocks in your SharePoint custom application pages (or any ASP.NET page). In some cases, you may need to invoke this code block only when a specific condition is met. This can pose a challenge because the validation code will probably sit in your code behind (C#), but the client side script is in Javascript.
The first thing you may try is using the RegisterClientScriptBlock. For example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| <script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
try
{
SPWeb web = SPContext.Current.Web;
ClientScript.RegisterClientScriptBlock(this.GetType(),
"script",
"</script><script language='javascript'> alert('hello'); </script>");
}
catch (Exception ex)
{
Response.Write(ex.StackTrace.ToString());
}
}
} |
Continue Reading
What Makes a Good Programmer?
This is a very important question for any new company looking for potential new recruits in today’s competitive job market. I’ve been quite vocal in the past about what I consider to be a good programmer and my core checklist hasn’t changed much since joining this l33t group of ninjas.
How to recognize a good programmer, posted by Daniel on inter-sections.net offers some interesting positive and negative indicators for recognizing a good programmer. While we don’t agree with everything on this list (some of us didn’t discover programming until later in our careers as an example), we do believe in the spirit of this article: good developers are passionate people who are engaged, love what they do, have a desire to learn and are dedicated to this field.
I find that it’s often the non technical questions that reveal more about a potential recruit than anything else. That’s not to say that expertise is not important, but it’s ONE of the many things to consider.
Daniel summarizes it really well:
Positive indicators:
- Passionate about technology
- Will talk your ear off on a technical subject if encouraged
- Learns new technologies on his/her own
- Opinionated about which technologies are better for various usages
- Very uncomfortable about the idea of working with a technology he doesn’t believe to be right
- Knowledge of a large variety of unrelated technologies (may not be on CV)
Negative indicators:
- Programming is a day job
- Happy to work with whatever technology you’ve picked, all technologies are good
- All programming experience is on the CV
If you’re a developer yourself, or are someone trying to find the right balance between technical questions and business related questions, this is where I would start. We are a very close knit group of people and are actively looking for someone to join our team, if you’re interested in talking to one of us, we’d love to hear from you.
Feedback is always welcome, whether you agree with this list or not.
April 1, 2009 Comments Off
The SharePoint Readiness Checklist used to be posted on the MS site. This checklist is a handy Excel file that contained a wealth of resources, references, and tutorials, especially when SharePoint 2007 was first launched.
It contains 340+ links to tutorials/references/online courses such as:
- Customizing and Branding SharePoint Portal Server and Windows SharePoint Services
- Creating Content for the SharePoint Server End-User Training Kit
- Collaborating with SharePoint Server 2007 Overview
- Best Practices for Managing Content with SharePoint
- SharePoint Server 2007 Web Parts
- Developing SharePoint Workflows Using Visual Studio 2005
- Office SharePoint Server 2007 Training
- Planning for and Deploying Office SharePoint Server 2007 (Part 1 of 2)
- Planning for and Deploying Office SharePoint Server 2007 (Part 2 of 2)
- Installing and Configuring Search in MOSS 2007
- Installing and Configuring Basic Search with MOSS for Search 2007
- Enterprise Search in MOSS 2007
The list may be a little bit outdated, but still is very useful. We can’t seem to find the link, so we’re reposting it here. Enjoy.
March 19, 2009 Comments Off

As part of our commitment to developing outstanding solutions for our customers, Black Ninja Software has become a Microsoft Certified Partner.