Continuous Integration Book Review

Filed Under (Development, Personal) by Emad Alashi on 21-05-2011

Tagged Under : ,

ContinuousIntegration-coverTo be frank I hesitated a bit to review a “a Martin Fowlers signature book”, but I have to share this review with others; to set expectations.

The book “Continuous Integration” is ok, but it’s too general, that’s it! 
I have read several articles about Continuous Integration and posts here and there until I thought to myself “that’s it, it’s time to get the book, it’s time to delve deep into this”, to my surprise the content of the book was too general and it didn’t add much to the articles I read.

The book itself is nice, but if you have been reading about CI in the past and want to delve deeper, this is NOT the book you want to get.

Reflections on Jordev Web Camp

Filed Under (Development, Personal) by Emad Alashi on 17-05-2011

Tagged Under : , , , , , , ,

webcampsLast Saturday 14th of May 2011 we had the first web camp in Jordan among Jordev’s activities, and it was great!
check my presentation slides at the end of this post.

The event was like the following:

  1. 8:30 AM – 9:00 AM: Registration
  2. 9:00 AM – 1:00 PM: Four 50 minutes sessions with 10 minutes between each for breaks, there was a few attendees at the beginning so we delayed the first session for couple of minutes (yes we have a morning problem here). Sessions were “Entity Framework 4.1”, “ASP.NET MVC One Step Deeper”, “Dynamic Data”, and “jQuery
  3. 1:00 PM – 2:15 PM: lunch break, where people went to the near market and had their lunch there.
  4. 2:15 PM – 4:30 PM: free coding session.

Things went great:

  1. Enough people attended. The attendees were about 25 people spread all over a hall that takes at least 100, this gave us a great freedom in moving around and hocking cables freely on available slots.
  2. The attendees were great. It’s awesome that the attendees were really serious about the event; everyone brought his/her laptop charged and ready, every one was kind enough to pay the right attention, and everyone stayed to the last minute; it’s this passion and dedication that makes a successful event a successful event.
  3. Very good speakers. We were lucky enough to host one of the smartest and most active community members in Jordan: Omar Qadan, Mahmoud Manasrah, and Omar Muwahed did a great job and delivered such a rich value, I was humbled to be among such intelligent speakers and share the stage with them.
  4. Topics were diverse. It’s true all web, but we covered four important parts that summed the basics of a web app: Entity Framework, ASP.NET MVC, Dynamic Data, and jQuery.
  5. There was no lunch arrangement hassle. Interestingly enough, we decided to skip the arrangement for lunch; we still had a lunch break and we provided fast coffee, but we revolted on the pattern of supplying sponsored food and snacks on the lunch break, this gave us the opportunity to concentrate more on delivering technical value, and less managerial things. Of course the near market made our decision a lot easier, in addition to our good luck of having such sufficient number of attendees.
  6. Two and half hours of Free coding. Actually this was pretty good; the free nature of the session allowed the attendees to contribute, and to ask their questions freely.
    We first gave the attendees the opportunity to try things on their own, then we suggested to have walkthroughs; started playing with some of the latest technologies NuGet and Glimpse, then a walkthrough on ASP.NET MVC, then finally a brief general talk about OData.

    Though I see a big space for improvement here; the down side is that there was a dominant stream because the presenter used the main desk and the presentation screen to talk to the majority in the walkthroughs, which was a distraction to the individuals who wanted to try things on their own, anyway I didn’t hear any complaints.
    We had an option to distribute people among groups depending on the technology they want to learn, but it appeared that it was little bit hard to organize, and the attendees in majority agreed to the way we concluded.

  7. The DVD accumulated for the event. We accumulated a DVD that contains Visual Studio 2010 Express, SQL 2008 Express, VS2010 SP1, NerdDinner sample, and MVCMusicStore sample. This helped others to boot up fast with the event, and a nice thing for the attendees to go home with.

Things went wrong:

  1. Marketing the event. We thought that we should limit the number of the attendees to 80 so we don’t end up in crowded auditorium, so we did, and 80 people registered on EventBrite in less than 48 hours of declaring the event on Facebook and Twitter. To our sad happy surprise only 25 people showed up! I know that not all event registrars attend the events they register for online, but the percent is strikingly high! 75% not attending?! what was wrong?
    I think we didn’t do enough reminders, apparently people are lazy about keeping their calendars
  2. SQL Express installation file was 64 bit. 32 bit OS is still the most common OS here, so we missed that up.

Things we did for preparations:

  1. Distributed tasks among us (four people) so everyone had a clear task, this way we made sure we don’t miss anything due to ambiguity in responsibilities
  2. One of us made sure the hall was booked (more tedious than you think!)
  3. Created an event on EventBrite and shared the link over a mailing list, Facebook, and Twitter
  4. Brought enough 3-in-1 packs of Nescafe, one electronic kettle for hot water, and many small bottles of water
  5. Burned out DVD’s with free content (check above)
  6. Brought 3 multi-slot plugs to support the many laptops with electricity
  7. Rehearsed enough for the presentations Smile

That was about it, I hope this reading benefits you and good luck with YOUR web camps.

Jordev-Webcamp-Speakers

My presentation slides embedded:

First Jordev Web Camp

Filed Under (Development) by Emad Alashi on 07-05-2011

Tagged Under : , , , , , , ,

For too long and all Jordev’s activities have been in the form of sessions with fast code demo’s, and for 1637932099-3the first time we are going to break this rule and do our first web camp in which attendees will have the chance to have hands-on experience with some of Jordan’s active experts, it will be on the 15th of May 2011.

There are two things in web camps that make them more interesting: REAL CODING and COLLABORATION; coding is a practice science, best way to learn it is by practice, and this practice will be much more fruitful and enjoyable if done with bunch of enthusiasts who share same passion with you. Speakers will have their share, but the biggest share will go for the hidden experts who have been hiding under excessive working hours, and who avoid boring talkative sessions, this gathering will be a chance for us to dig these gems out and have the most geeky fun and benefit we seek in such communities.

The schedule will be as the following:

Session

Time

Duration

Speaker

Registration

08:30 – 09:00

00:30

-

Entity Framework

09:00 – 9:50

00:50

Omar Qadan

MVC one step deeper

10:00 – 10:50

00:50

Emad Alashi

Data Dynamics

11:00 – 11:50

00:50

Mahmoud Manasrah

jQuery

12:00 – 12:50

00:50

Omar Muwahed

Break

1:00 – 2:00

1:00

-

Hands on Labs

2:00 – 4:30

2:30

Speakers and attendees

For more details you can follow it on EventBrite here, see you there.

Brilliantly Simple Code Sharing

Filed Under (Development, software management) by Emad Alashi on 27-04-2011

Tagged Under : , , , , , ,

Today I was looking for a fast way to find the index of a nth occurrence of a string in a string, so I found this very simple and intuitive site on which you can find and share .net extension methods, the website is http://www.extensionmethod.net Dah! Smile

I couldn’t find what I looked for, so I shared my solution here; the website made it crazy easy to share this! Something I definitely would add to my log on how to create wonderful websites, simple and effective.

Code Sample Should Be Clean

Filed Under (Development, software management) by Emad Alashi on 02-04-2011

Tagged Under : , ,

big_Telerik01The other day I needed an ASP.NET MVC grid control, and I have always heard about Telerik’s ASP.NET MVC Extensions and the great tools they provide, so I decided to give them a try.

So I followed the installation guide step by step, and prepared my code to use the extensions; I added a reference to the DLL, added the scripts, etc… and I thought I was ready to test-drive it.
I opened Telerik’s sample website which showed the control and below it the code sample that made it work, innocently enough I did what any other developer would do to try out the sample code: copy and paste it in your page and then build. To my surprise there was an error in the View; it didn’t recognize an Extension method called “Configurator”!

It was so strange, why wouldn’t it work? I made sure that I added the correct reference dll, that I added the namespaces in the web.config as advised by the guide, and that I used the “using” at the top of my page, but yet it didn’t work.
Ok now that is really strange, I downloaded Reflector ILSpy and disassembled Teleriks dll to make sure that this method exists, and it wasn’t there! where does this Configurator method come from?!

I opened the sample project to make sure of their code, and guess what…the Configurator method was a method that only exists in their sample project; it wasn’t part of the DLL! I wasted considerable time trying to figure this out, and my conclusion was: never use auxiliary code when you are presenting a sample for another code unless you make it clear.

Introduction to ASP.NET MVC session at Jordev

Filed Under (Development) by Emad Alashi on 27-11-2010

Tagged Under : , , ,

It was great to get back to presentations after this while; ASP.NET MVC was the topic for the latest session I delivered through Jordev. The audience was great, I hope they enjoyed it as much as I did preparing for it.

you can find the slides on Slideshare, embedded here as well:

I will upload the photos of the session and possibly a recorded video to youtube in the nearest chance enshallah.

Attend Tech-Ed Middle East 2011 for free!

Filed Under (Development) by Emad Alashi on 30-10-2010

Tagged Under : , , ,

logoHere is your chance (with little effort) to win a fully-paid trip to Tech-Ed Middle East 2011. Simple tasks are required from your part and you will find yourself with the ultimate geeks in Dubai next year.

For the details check the competitions website on http://compete.jordanruns.net/

Use Powershell To Follow Your Followers On Twitter

Filed Under (Development, DotNetArabi) by Emad Alashi on 26-08-2010

Tagged Under : , ,

Update: Twitter “statuses/followers” API documentation had a small note at the bottom that says that it returns only 100 followers if no paging is used, I have updated the script accordingly. Thanks to @RamyMahrous for notifying me on this in his comment below. <End of Update>

For a long time I thought that @DotNetArabi shouldn’t follow it’s own followers due to various reasons I had, but lately I discovered that I was wrong. So I have decided to follow them back no matter how many they are, but that would be a tedious thing to do manually. Here comes Powershell to the rescue.

I wrote the following Powershell script in Powershell ISE (the Integrated Scripting Environment) which is already shipped with Win7, utilizing Twitter’s API’s and it did the trick:

———————–
 $wc = new-object System.Net.Webclient
 $wc.Credentials = new-object System.Net.NetworkCredential "dotnetarabi","UseYourOwnPWbuddy!"
 $cursorCount = "-1"
 
 do { 
 
 $rest = $wc.DownloadString("http://api.twitter.com/statuses/followers.xml?cursor=" + $cursorCount)
 $xml = [xml]$rest
 foreach( $user in $xml.Users_list.users.user ) 
 { 
    $wc.UploadString("http://api.twitter.com/1/friendships/create/" + $user.screen_name + ".xml", "")
 } 

 $cursorCount = $xml.users_list.next_cursor
}
while($xml.users_list.next_cursor -ne 0)

——————-

It’s simple and straight forward; I used “UploadString” method of the Webclient class because it produces a “POST” HTTP request required by Twitter API rather than “GET”.
Note that the response you get from the “Create” API will be either an XML representation of the followed-user entity, or a server error “Forbidden” for many of reasons Twitter may have. This is how you will know if each “follow” procedure succeeded or not

Thanks to Helge Klein I could highlight my Powershell script by his script here

Happy Life with Intuitive API in Smart Controls

Filed Under (Development) by Emad Alashi on 15-06-2010

Tagged Under : , , ,

In this post I will show you an example of how smartly built controls and API’s can make the developers programming life extremely enjoyable, hopefully this example will urge you in giving such a smart effort when you build your own control or API.

Lately I have been playing around with a very nice tree control based on jQuery called jsTree. One of the nice features is that it allows populating the tree through asynchronous calls with JSON data representation. In order to achieve that, you needed to provide the data by JSON special format suitable to the tree. This format, regrettably, is open to the JSON vulnerability Phil Haack talked about in his two posts here and here.
So to avoid this vulnerability I had to change this default data format of the tree, at least until the very end of the data flow just before the tree populates the data, only then I can change it back to the default format, like the following:

The format I need to send from server to avoid the vulnerability, but the tree wouldn’t understand:

 { "d" : [ { attributes : { id : "2", balance : "0.00000" },  data : "Child",  state : "closed" }  , { attributes : { id : "3", balance : "0.00000" },  data : "AnotherChild",  state : "closed" }  ] }

The format the tree accepts, to which I should change back before populating:

[ { attributes : { id : "2", balance : "0.00000" },  data : "Child",  state : "closed" }  , { attributes : { id : "3", balance : "0.00000" },  data : "AnotherChild",  state : "closed" }  ]

That would not have been possible if the tree control wasn’t smart enough to provide the developer with the “ondata” event (line 45) that happens exactly before the binding to the tree, in which you can manipulate the data; in my case I am eliciting the data out by returning the “content” of the wrapper object “d” rather than the whole thing.

   31 <script type="text/javascript">

   32     var initialData = <%= ViewData["InitialList"].ToString() %>

   33 $(function () {

   34     $("#MyTree").tree({

   35         data : {

   36             type : "json",

   37             async : true,

   38             opts : {

   39                 async : true,

   40                 method : "GET",

   41                 url : "GetNodesOfParent"

   42 

   43                 }

   44             },

   45           ondata: function (data, tree_obj) {

   51                     return data.d;

   52                 },…..

Such flexibility and clean structure in controls and API’s is one of the very important aspects a control-developer should keep in mind.

Stressful Situations Make You Stupid

Filed Under (Development, software management) by Emad Alashi on 12-05-2010

Tagged Under : , , ,

Today we came across an interesting issue at work: we have two teams A and B who interchange API calls. Team A needed an API from team B to process a business that is owned by team B of course. The signature was like the following:

public OutputEntity MyMethod(List listOfIds);

It appeared afterward that this method was very slow, and the client was already very upset about the low performance, which consequently caused big pressure on the teams by the superiors to enhance the performance.
After investigating the issue, it appeared that the list of ID’s sent as input consists of some ID’s that do not need to be processed, this criteria of “not need to be processed” is a business owned by team B, done by using properties of the entities these ID’s represent. So the  solution to this issue was one of the following:

  1. Moving the business out of the API to the client application to do the filtering, since the calling method already has the entities themselves (not so good to move business out of scope!)
  2. Let the API do the filtering, but this will worsen the performance because the API will have to retrieve these entities from the database in order to use its’ properties!

So is that a dead end? actually that was stupid! the situation was stressful enough and pressured by our superiors to enhance the performance that we missed a very simple fact: pass the list of entities themselves!

Stressful situations make us stupid, so make as less stress as possible on your team, help them to be smarter.