Paperclip themes for BlogEngine.Net 1.4, tweaked and widen

by mosessaur| 18 July 2008| 22 Comments

Last week I found Peperclip themes of BlogEngine.Net. It was adapted by Caio Proiete. But they wasn't totally supporting version 1.4 as well as they had few CSS issues. Beside I wished for more wider area.

Thanks to Caio Proiete for providing these themes. I worked with them and tweaked them to support BlogEngine 1.4 and to provide more wide area for blog posts. You can download first 2 themes now (Cactus and Fall). Hopefully by next week I'll be done with the other2 themes. It worth to mention that I just modified the CSS, MasterPage and CommentView control.

Main CSS modification was around to support Widget Zone including Out of The Box Widgets. Beside fix few incorrect displaying styles

MasterPage modification was basically to provide WidgetZone. I also removed the Navigation section on the left menu and provide it as a widget which you can fine in the same download packages

While CommentView control modified to provide better comment adding form and better comment display with Avatars.

As Caio Proiete mentioned feel free to modify but don't forget to keep his credits.

Downloads:

kick it on DotNetKicks.com

jQuery.UI Messenger\Outlook like message notification Widget

by mosessaur| 16 July 2008| 23 Comments

Today, Matt posted a cool progressbar widget using jQuery.UI. He gave a good introduction and explanation about how to build a widget using jQuery.UI.

Here, I'm following his sample to build my own one, which is Messenger\Outlook like message notification [view demo]. So for reference and how to build one please return to jQuery.UI ProgressBar Widget by Matt Berseth.

Messenger like message notification widget is something I wished to do long time ago, and was lazy to think and code it, because I thought it would take to much coding. And I read Bilal's article How to Show Messenger-Like Popups Using AJAX but it wasn't a reusable component. So I just used his styles for demonstration.

After going through Matt's post, I decided to build it up right away. So Let's dive into the code. Below is the init method for the widget, I just initialize some local variables with to store current bottom position and height of the popup message element.More...

How I got started in software development?!

by mosessaur| 12 July 2008| 0 Comments

Yesterday, Janco tagged me in Michael Eaton's software development meme that's been flying around recently. I read most of the stories around, specially Dave, Matt and Janco stories. So below is my simple story.

How old were you when you started programming?

I was 19 or 20 I don't remember exactly, but it was in 1999. That was when I joined the college, Faculty of Computers and Information Sciences. Before that I never worked on a PC or even had one. So I wasn't a video game player either.

How did you get started in programming?

I joined Computers and Information Sciences because I wished to be a software engineer. So, my early steps were very academic; Lectures, classes and labs where we practice basic of programming.

What was your first language?

C++, that was my first language when I do not use currently!! Shame on me! More...

Building Custom Paging with LINQ, ListView, DataPager and ObjectDataSource, Different Paging Method

by mosessaur| 08 July 2008| 10 Comments

Yesterday, I was reading Efficient Paging in SQL Server 2005 post by Justin Etheredge, then in the comments I found Kevin Hazzard pointing to his Efficient LINQ to SQL custom paging approach. I liked his way, which reflects Justin's method which I already seen before but never apply it. I think it is more efficient than my method I provided in an earlier post. And if you googled about custom paging with LINQ to SQL you'll find few more implementation.

Today, I'm updating my method and provide the same sample I made last month with Kevin's method. I made an extension method to IQueryable Interface and called it KavinPage. You can view a demo here

Here is the code for the Extension Method:

   1: public static IQueryable<T> KevinPage<T, TResult>(this IQueryable<T> obj, int page, int pageSize, System.Linq.Expressions.Expression<Func<T, TResult>> keySelector, bool asc, out int rowsCount)
   2: {
   3:     rowsCount = obj.Count();
   4:     if (asc)
   5:     {
   6:         return obj.OrderBy(keySelector).Skip(page * pageSize).Take(pageSize);
   7:     }
   8:     else
   9:     {
  10:         return obj.OrderByDescending(keySelector).Skip(page * pageSize).Take(pageSize);
  11:     }        
  12: }

It is all about Extension Methods and how to use them to build SQL Queries. You can return for Kevin's post for detailed explanation. Also you can return to my previous post about this subject for more details about how to put it all together to build Paging ASP.NET ListView using LINQ to SQL and ObjectDataSource.

Download the updated sample.

kick it on DotNetKicks.com

Happy July, BlogEngine 1.4 Released

by mosessaur| 02 July 2008| 0 Comments

Well its 2nd of July, but day before yesterday was a good day. BlogEngine.Net 1.4 released, and today I performed my blog upgrade. But I didn't apply widgets yet but, I'm ready to do so once I got some time to be online to do so.

The upgrade didn't take too much time from me, actually no time at all but the uploading time. I performed kind of local upgrade test first to make sure that everything will work fine then I performed the live upgrade, and that is why actually I performed my upgrade so fast.

You can refer to this upgrade post by Al Nyveldt. I wish to share my upgrade experience, but these days I'm preparing for a business trip so I don't have much time to be online. Hopefully soon I'll be able to blog about it.

But one thing I can say, BlogEngine.Net 1.4 is 100% backward compatible with BlogEngine.Net 1.3, that means you will not lose anything or fall into trouble if you just do first stage upgrade like I did. My first stage doesn't include widgets, because I need to set them up and arrange them. So I preferred to write this post over continue my upgrade process :) . You can image how second stage will be easy :)

Have fun with BlogEngine.Net 1.4.

Passed Exam 70-504 TS: Microsoft .NET Framework 3.5 - Windows Workflow Foundation Application Development

by mosessaur| 30 June 2008| 5 Comments

Few days I decided to take exam 70-504 TS: Microsoft .NET Framework 3.5 – Windows Workflow Foundation Application Development so I decided to register the exam for today. And today I attended to the exam and passed with score 800. I worth to mention that I used a promotion code submitted to my by Microsoft because I registered on Microsoft Visual Studio 2008 Learning Portal to be the first to know and save 40 percent on select Visual Studio 2008 exams.

I prepared for exam during the last month (June). I basically studied the from Microsoft Learning products, course Course 6462: Visual Studio 2008: Windows Workflow Foundation and Clinic 6262: Introducing Windows Workflow Foundation using .Net Framework 3.5 & Visual Studio 2008. And really, about 45% to 50% and maybe more of the exam question are totally covered by Course 6462 

The exam consist of 53 questions. You'll not find any exam simulator for this exam now, so if you wish to prepare for it just attend Course 6462 and use some external resources such Microsoft Windows Workflow Foundation Step by Step book.

Below is my score card for this exam.

Building Custom Paging with LINQ, ListView, DataPager and ObjectDataSource

by mosessaur| 22 June 2008| 23 Comments

Last week I posted about building custom paging with LINQ to SQL. And I wrapped the functionality with Extension Method to IQueryable<T> Interface.

Today I'm going to put the custom paging in a practical sample using ASP.NET ListView, DataPager and ObjectDataSource Control. Click here to download the sample. View demo here.

The sample is using Northwind Database. So first I created a Northwind LINQ to SQL class ".dbml"

NorthwindDataContext

More...

Review Clinic 6264 Introducing Windows Communication Foundation using .Net Framework 3.5 and Visual Studio 2008

by mosessaur| 12 June 2008| 3 Comments

I wanted to have good short start overview on WCF. My first pick was from Microsoft E-Learning, Clinic 6264: Introducing Windows Communication Foundation using .Net Framework 3.5 & Visual Studio 2008. For me, it was a great choice, exactly what I need to start my learning steps on WCF.

Here I'm going to write my review about this Free E-Learning Course which is part of a Free E-Learning Collection, Collection 6261: Developing Rich Experiences using Microsoft .NET Framework 3.5 & Visual Studio 2008.

Course Objectives:

  • Describe WCF and provide scenarios for building WCF applications.
  • Describe WCF features for developers of service-oriented applications.
  • Describe how to create a WCF service.
  • Describe how to create and invoke a WCF client.
  • Describe how to customize WCF with behaviors.
  • Describe bindings in WCF.
  • Explain the main features of WCF security.
  • Describe reliability in WCF applications.

More...

Building Custom Paging and Sorting Queries with LINQ to SQL and wrap it in Extension Method

by mosessaur| 11 June 2008| 3 Comments

Introduction:
Since my early days with web application and I used to observe people writing different techniques for paging data coming from the database. Many articles where written, and different techniques for different databases. All that I am talking about paging data on the database before returning results to the application which will renders it to the client.

One Technique:
You might be familiar with queries like this one:

   1: SELECT TOP (10) [R1].[ProductID], [R1].[ProductName]
   2: FROM (
   3:     SELECT TOP (77) [R0].[ProductID], [R0].[ProductName]
   4:     FROM [dbo].[Products] AS [R0]
   5:     ORDER BY [R0].[ProductID] DESC
   6:     ) AS [R1]
   7: ORDER BY [R1].[ProductID]

The above query is one of the techniques used for paging data on the database side. When wrapping this query with a stored procedure it will look like this:

   1: CREATE PROCEDURE [dbo].[usp_Product_GETPAGE]
   2: (
   3:     @page int,
   4:     @pagelength int,
   5:     @sortfield varchar(100),
   6:     @descending bit,
   7:     @rowcount int output
   8: )
   9: AS
  10: BEGIN
  11:     SET NOCOUNT OFF
  12:     DECLARE @Err int    
  13:     SELECT @rowcount = COUNT(*) from [Products]    
  14:     declare @innerrows int
  15:     declare @sortdesc varchar(100)
  16:     declare @sortasc varchar(100)
  17:     declare @a varchar(6)
  18:     declare @b varchar(6)
  19:     IF @descending=0
  20:             BEGIN
  21:                 set @a = ' DESC '
  22:                 set @b = ' ASC '
  23:             END
  24:     ELSE
  25:             BEGIN
  26:                 set @a = ' ASC '
  27:                 set @b = ' DESC '
  28:             END    
  29:     IF charindex(@sortfield, ' [ProductID]') > 0
  30:         BEGIN
  31:             set @sortdesc = ''
  32:             set @sortasc = ''            
  33:         END
  34:     ELSE
  35:         BEGIN
  36:             set @sortdesc = ', [ProductID] ' + @a
  37:             set @sortasc = ', [ProductID] ' + @b
  38:         END   
  39:     set @innerrows = @rowcount - (@page * @pagelength)
  40:     DECLARE @sql nvarchar(1000)
  41:     SET @sql = 'SELECT TOP ' + STR(@pagelength) + ' [ProductID], [ProductName] FROM
  42:             (
  43:                 SELECT TOP ' + STR(@innerrows) + ' [ProductID],
  44:                 [ProductName]
  45:                 FROM
  46:                 [Products] 
  47:                 ORDER BY [Products].' + @sortfield + @a + @sortdesc + ' 
  48:             ) Alias
  49:             ORDER BY Alias.' + @sortfield + @b + @sortasc    
  50:     EXEC (@sql);
  51: END

The above procedure is somehow complex because it support paging and that is why it build the SQL statement and use EXEC function.

I'll not discuss its performance; my target is to discuss how to convert this query into LINQ query using extension methods then generalize it to be as an Extension Method for IQueryable Interface.

LINQ Equivalent:
The LINQ Equivalent is very simple using Extension Methods of the IQueryable and IOrderedQueryable interfaces. The following code shows that:More...



uCertify offering discount code for mosesofegypt.net readers!

by mosessaur| 10 June 2008| 5 Comments

Few days I wrote a review about uCertify product for Exam 070-553 C#. And today, I received an e-mail from uCertify, here is an excerpt from that e-mail:

"We are offering a discount to the readers of your Blog. (If there is certain suggestion in review) Your suggestions will definitaly help us to improve our products and ultimately benefit our users. Your readers can use our discount code given on your Blog and get 10% discount on the uCertify PrepKit of their choice"

So you can apply this Discount code "MMMOSA" and gain 10% discount on the uCertify PrepKit of your choice as mentioned above.

So 10% discount and money back guarantee if you didn't pass from the 1st attempt! Check uCertify.com for more details about money back guarantee.