• Follow sebaube on Twitter
  • Subscribe to sebaube.com

Twitter and Social Networks for Software Developers

It’s clear, online social networking is here to stay and will be for a long long time. If you haven’t created your online persona on Twitter, Facebook etc.. then you might be missing opportunities to meet and interact with some great people. Developers tend to be a perfect fit for social networking.

Why should you care?

The quality of your career is directly linked to the quality of your network. This is true for your non-virtual social network as well as your virtual one (Twitter, Facebook, Linked In etc…).

Where will your next job, contract or consulting opportunity come from? Most of my new projects come from repeat business or referrals from my social network.

I’m way too busy and don’t have time

You’re convinced. You know you need to be social but you can’t find the time to commit to Twitter and Facebook. You don’t need to watch your feed like a hawk.
Here are a few techniques that can help you manage your online social interactions.

  • Check your direct messages and mentions at least twice a day.
  • Select a list of folks that you want to follow and interact with.
  • Create a twitter list that you check regularly.
  • Decide on a schedule that you’ll stick to. This will help your followers know when to expect you to be responsive

I don’t really have anything to share

We’ll that’s not true, even for the introverted. The beauty of the web is that there’s an audience for just about every subject you can think of. If you’re interested in something peculiar you can bet that someone out there shares the same interest and is looking for someone to share it with.

You can

  • Share insights as well as links to articles you find interesting.
  • You can ask a coding question.
  • Share a cool snippet of code you just wrote by using tools such as Paste Bin
  • Promote you blog.

Be the same person online and offline

Consider this very probable scenario. You’ve signed up to an online dating site and you’ve been chatting with an interesting person for over a week. It’s going very well and you’ve connected at many levels. You finally decide to meet them in person only to be surprised that he/she is not at all as he/she described.

You online persona is more and more linked to who you are in person. Don’t be fake. Be you.

Show genuine interest

Most successful people I know are great at making people around them feel important. When you show genuine interest in others you elevate them. There are many ways of doing this online such as Facebook “likes” and Twitter “retweets”. Those are fine but instead you might want to try to interact with the person and show interest.

Engage with them with Facebook “Comments” and Twitter “Replies”. Offer you congratulations for success and your support for failures. Failures are just as important as successes in my book.

Meet them in person

Like the dating analogy above at some point you’ll probably want to meet in person (In Real Life). This might happen by serendipity, through a friend or over a coffee at a local shop. Either way take advantage of the opportunity.

In closing:

Interacting with your social network doesn’t have to take all of you time. Create some structure and make it work for you. Make sure you are the same person online as you are in person and show genuine interest is what people do. You never know where the next opportunity will present itself.

This article may also apply to non developers.

I look forward to sharing with you. Let me know if you find this helpful.
http://twitter.com/sebaube

Sebastien Aube is the President of Cognitive X Systems, a software consulting company.

TwitterFacebookTechnorati FavoritesYahoo BuzzDiggStumbleUponRedditGoogle ReaderShare

A small gotcha when calling a WCF service using $.ajax

I just spent a couple of hours debugging a Jquery call to a WCF Service and luckily stumbled on a solution. I though I’d share it with the universe.

Here is the basic setup that was causing issues.

The WCF Service

	public class JsonResponse {

		public bool Success { get; set; }

		public string ErrorMessage { get; set; }
	}

	[ServiceContract(Namespace="FooBar.Services")]
	public interface IServices
	{

		[OperationContract]
		[WebInvoke(Method = "POST",
			UriTemplate = "/FooBar",
			BodyStyle = WebMessageBodyStyle.Wrapped,
			RequestFormat=WebMessageFormat.Json,
			ResponseFormat=WebMessageFormat.Json)]
		JsonResponse FooBar(string foo, string bar);
	}

Calling the Service with the following Ajax call

var data = {
		"foo" : "bar",
		"bar" : "foo"
};

$.ajax({
	type : "POST",
	url : "/Services/Services.svc/FooBar",
	contentType: "application/json",
	data : data,
	success : function(data){
				if(data.success){
                                  alert('BAM');
                     }
	},
	dataType : "json"
});

Returns this error

The server encountered an error processing the request. The exception message is ‘OperationFormatter encountered an invalid Message body. Expected to find an attribute with name ‘type’ and value ‘object’. Found value ‘boolean’.’. See server logs for more details. The exception stack trace is:

….

The solution.

Luckily it’s pointing to the Json Serializer not being able to deserialize the request. After looking closely at multiple examples on the web something jumped at me. Examples seem to pass and textual representation of the object and not the Json object itself. What the ajax call does for you here is depending on the “type” option, “POST”, “GET” etc…, it will convert the data (json format) option to a foo=bar&bar=foo format and add it to the appropriate output. If you use POST it will put it the the body of the request. If you use GET it will put it in the querystring.

In order to fix this I need to pass the data as a stringified version of the json object. At that point the ajax call will not convert when adding to the body of the request.

This is the new javascript that works

var data = {
		"foo" : "bar",
		"bar" : "foo"
};
$.ajax({
	type : "POST",
	url : "/Services/Services.svc/FooBar",
	contentType: "application/json",
	data : JSON.stringify(data),
	success : function(data){
				if(data.success){
                                  alert('BAM');
                     }
	},
	dataType : "json"
});

I used the JSON library found here
Hopefully this will save someone out there some time when debugging this issue. I’m quite certain it’s happened to someone out there.

S.

TwitterFacebookTechnorati FavoritesYahoo BuzzDiggStumbleUponRedditGoogle ReaderShare

JQuery Robot Animation

I ran into this recently and I though I would share it with you. This animation is made possible by the use of JQuery and CSS. I’m quite impressed at what they were able to do. It is relatively easy if you compare to earlier Javascript techniques.

JQuery Robot

S.

TwitterFacebookTechnorati FavoritesYahoo BuzzDiggStumbleUponRedditGoogle ReaderShare

Creating a twitter like flash message

Here’s a quick step by step tutorial to create a Twitter style Flash message using css and javascript.

The CSS
I’m using the blueprint css which can be found here

.notification
{
    text-align: center;
    display: none;
    width: 100%;
    position: fixed;
    padding-top: 8px;
    padding-bottom: 8px;
    margin: 0;
    font-weight: bold;
    font-size: 1.2em;
    overflow: visible;
}

Add the following html somewhere before the Body closing tag.

<div id="notification" class="notification">
	<span id="notification-text"></span>
</div>

And the javascript:
As you can probably tell we are using the JQuery library. We wanted the flash message to show up for a decent amount of time after witch it would go away. Luckily JQuery has the fadeIn and fadeOut animation methods. To make it more JQuery like we added a callback function. This callback will be invoked once the Flashmessage has completed it’s fadeOut.

//Provide a variable to hold the callback function
var notifyCallBack;

function showNotification(message, type, callback) {

    notifyCallBack = callback;

    var notification = $("#notification");
    notification.removeClass("success notice error");
    notification.addClass(type);

    //Make sure it's visible even when top of the page not visible
    notification.css("top", $(window).scrollTop());
    notification.css("width", $(document).width());

    $("#notification-text").html(message);

    //show the notification
    notification.slideDown("slow", function() {
        setTimeout(hideNotification,
            4000 // 4 seconds
            )
    });
}

function hideNotification() {
    $("#notification").slideUp("slow", function() {
        if (null != notifyCallBack && (typeof notifyCallBack == "function")) {
            notifyCallBack();
        }
        //reset the callback variable
        notifyCallBack = null
    });
}

Here’s a typical scenario where the showNotification would be usefull

$(form).ajaxSubmit({
		success: function(data) {
			if (true == data.isSuccessful){
				showNotification(data.FlashMessage, "success", function(){
					//do something
				});
			}
			else{
				showNotification(data.ErrorMessage, "error", function(){
					//display errors
				});
			}
		},
		dataType: "json"
	});
TwitterFacebookTechnorati FavoritesYahoo BuzzDiggStumbleUponRedditGoogle ReaderShare

The data access layer might disappear one day

Some history,

As developers we’ve all built data-driven applications. Using any flavor of MSSql, MySQL, Oracle, Postgress etc… we’ve written queries and stored procedures. Spent many hours trying to come up with the right database schema. We’ve written countless data access layers and mapping code.

Does this line of code ring a bell.

person.FirstName = dr.GetString(dr.GetOrdinal("FIRST_NAME"));

We’d often have to revise the schema for new requirements and as a result rewrite our DAL.

It was a cycle.

We wrote some useful utility classes that we could use repeatedly and enhance them by using a configuration based data-mapping approach. In the last 5 years we’ve seen the development of ORMs (Object-Relational Mapping) reduce some of the time we took to impedance match our objects and logic to the database schema.

Early ORM’s:

  • Strongly Typed Dataset – Microsoft
  • The highly touted Hybernate – ported to .Net
  • Rob Conery’s Subsonic

Plus a few commercial ones that haven’t really caught traction (IMO)

The cycle got shorter.

More recently, with the advent of LINQ, we’ve seen new versions of these ORM’s come to life. Subsonic 3 includes LINQ querying as well as Microsoft’s dying LINQ to SQL and the new favorite kid on the block the Entity Framework.

The cycle just got shorter again.

Now comes NoSQL!

From wikipedia:

NoSQL is an umbrella term for a loosely defined class of non-relational data stores that break with a long history of relational databases and ACID guarantees. Data stores that fall under this term may not require fixed table schemas, and usually avoid join operations. The term was first popularised in early 2009.

Early 2009 seems close but for a programmer it can seem like an eternity (almost a quote). Within a few months the NoSQL movement has gathered lots of momentum. A quick search on twitter for #mongodb,  #couchdb or #db4o will turn up some discussions about the newish trend.

The NoSQL movement is still quite young but I believe we’ll see a big shift within the next five years. I have only skimmed the surface.

In future posts I’ll try and dive deeper in the world of NoSQL and provide some sample code and findings.

TwitterFacebookTechnorati FavoritesYahoo BuzzDiggStumbleUponRedditGoogle ReaderShare

Products

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