Thursday, July 30, 2009

Setting up Visual Studio Intellisense for jQuery

by Ralph Whitbeck

In September 2008, at the jQuery Conference, it was announced that Microsoft would be shipping its upcoming releases of Visual Studio with jQuery built in. They would not fork or change the jQuery code but ship it as is. Microsoft also announced that they would distribute IntelliSense-annotated documentation JavaScript files for Visual Studio 2008 that developers can reference in their files to enable IntelliSense for jQuery. The following instructions will help you get started using this tool to make writing jQuery scripts faster than ever.

Setting up Your Files for jQuery IntelliSense

First, set up jQuery on your page by downloading the latest version from the jQuery site.

Next, you will need to download the jQuery Documentation file from the jQuery site.

download documentation

Download the files and add them to your project.

IntelliSense in external JavaScript files

At the top of the JavaScript file in which you would like to have jQuery IntelliSense enabled, you will need to add a line to reference the documentation file:

/// <reference path="jquery-1.3.2-vsdoc2.js" />

IntelliSense inline on your ASPX page

There are a couple of scenarios that may affect if you include a reference to the VSDOC file or not. If in doubt, just add a reference to the documentation file.

If you are linking to jQuery by the Google Code AJAX Library or are linking to jQuery from anywhere outside of your project you will need to reference the documentation file.

From each ASPX page you want jQuery IntelliSense you’ll want to call the reference within a server-side conditional statement so that the documentation file will still load in Visual Studio but will not load at run-time. Add the following after your jQuery declaration:



   1:  <script src="" type="text/javascript"></script>
   3:  <% if (false) { %>
   5:    <script type="text/javascript" src="jquery-1.3.2-vsdoc2.js"></script>
   7:  <% } %>

If you downloaded jQuery and saved it to your project Visual Studio will look for the vsdoc.js file automatically if the following conditions are met.

You've downloaded and installed the hotfix for Visual Studio.

jQuery and the documentation file need to be named the same with the exception that the documentation file end with -vsdoc.js. So when you add jQuery to your project make sure to rename them similarly. For instance, jquery-1.3.2.js is your jQuery library, Visual Studio will look for the documentation file at jquery-1.3.2-vsdoc.js and load it.

(Note: the jQuery 1.3.2 documentation file is named jquery-1.3.2-vsdoc2.js on the Download page so make sure you take out the 2 so that the file will be found by Visual Studio)

If you can't meet these conditions you'll need to reference the documentation file as shown above.

To test to make sure the documentation file loaded correctly, you can type $( and you should be presented with some documentation.

test IntelliSense

Additionally, you can type in $(document).r and you will be presented with a drop down of available options to choose from, one being "ready."

test with document ready

Now as you write your jQuery code, you'll be helped along by seeing what methods and properties are available to you.

Related Links


I've updated the post to reflect the hotfix for Visual Studio which enables Visual Studio to automatically load the documentation file for inline jQuery on ASPX pages if it's named similarly to the jQuery file. Thanks to Dave Ward for pointing this out in the comments.

Scripts Used on This Site


Original post can be found here...

Wednesday, July 29, 2009

Web Content Accessibility Guidelines (WCAG) 2.0


Web Content Accessibility Guidelines (WCAG) 2.0 covers a wide range of recommendations for making Web content more accessible. Following these guidelines will make content accessible to a wider range of people with disabilities, including blindness and low vision, deafness and hearing loss, learning disabilities, cognitive limitations, limited movement, speech disabilities, photosensitivity and combinations of these. Following these guidelines will also often make your Web content more usable to users in general.

WCAG 2.0 success criteria are written as testable statements that are not technology-specific. Guidance about satisfying the success criteria in specific technologies, as well as general information about interpreting the success criteria, is provided in separate documents. See Web Content Accessibility Guidelines (WCAG) Overview for an introduction and links to WCAG technical and educational material.

WCAG 2.0 succeeds Web Content Accessibility Guidelines 1.0 [WCAG10], which was published as a W3C Recommendation May 1999. Although it is possible to conform either to WCAG 1.0 or to WCAG 2.0 (or both), the W3C recommends that new and updated content use WCAG 2.0. The W3C also recommends that Web accessibility policies reference WCAG 2.0.



Tuesday, July 28, 2009

What is CSLA .NET?

CSLA .NET is a software development framework that helps you build a powerful, maintainable business logic layer for Windows, Web, service-oriented and workflow applications.

There are many frameworks in the world. Most of them focus on the common issues of getting data into and out of the database or creating a flexible UI. What is typically missing is a focus on managing or implementing business logic. This puzzles me, because business logic is the centerpiece of a business application.

Helping to manage and implement this business logic is the purpose of my CSLA .NET framework and is the focus of my Expert Business Objects books.

CSLA .NET enables you to create an object-oriented business layer that abstracts and encapsulates your business logic and data. The framework ensures your business objects fully support data binding in WPF, Silverlight, ASP.NET Web Forms and Windows Forms. It also supports ASP.NET MVC, Windows Workflow Foundation, WCF and web services interfaces.

CSLA .NET simplifies and standarizes implementation of business logic, validation and authorization logic within your objects. The goal is to provide an easy and consistent coding pattern by which you can encapsulate all your business logic within your object-oriented business layer. The result is a business layer that can support all the interface types listed above, while remaining decoupled from any specific interface technology.

CSLA .NET includes a technology-neutral client/server abstraction, allowing you to build your application and then decide at deployment whether to use 2-tier or 3-tier client/server (and 4-tier with Silverlight). If you opt for 3-tier deployment, you can choose between WCF, .NET Remoting, Web Services or Enterprise Services as a network protocol. The key point here is that you can switch between 2-tier and any of these 3-tier networking options without changing your UI, business logic or data access code; all that changes is a configuration file (and of course deployment to both client and server).

Finally, CSLA .NET provides a clearly defined location in your architecture where you get data from or put data into the database. This is not the focus of CSLA .NET, and so the framework’s goal is to put you in charge. To give you optimum flexibility in how that data is managed and to enable decoupling of the data access from the business object and user interface or presentation layers.

CSLA stands for Component-based, Scalable Logical Architecture, and is the result of over 12 years worth of research and development. The .NET implementation of CSLA was started in 1999, and development continues today, with the addition of CSLA .NET for Silverlight and upcoming support for Silverlight 3.0 and Microsoft .NET 4.0.

(Updated 5/20/2009)

Original article can be found here

Monday, July 27, 2009

What makes a good Linux distribution?


By Jack Wallen, Special to ZDNet Asia
Monday, July 27, 2009 12:38 PM

Take the proprietary driver system and installation tools of Ubuntu, add the desktop of Elive+Compiz, add the foundation of Debian, and the security of Bastille Linux and you would have one killer distribution.

Lately, I have written various articles that have stirred the pot regarding the various Linux distributions available. I have heard quite a bit of dislike for Ubuntu, GNOME, and KDE 4. In fact I have heard opinions from people that make me wonder why they even use Linux.

I have come across plenty of distributions that I will never use again. I have played with desktops that will only have ever graced my screen once or twice. But to say I hate them? No matter how much I dislike these tools, they are still a part of the Linux community and that at least gives them some credibility.

But this train of thought started my brain whirring around the idea of "what makes a good Linux distribution?" I thought, what better place to ask this question than here at Techrepublic! Naturally I can't just ask the question without offering up my own opinion on the subject as well.

I would have liked to think by now all Linux distributions would be following some semblance of standards. I don't find this to be the truth. And why? There';s an organization built around creating standards for Linux. The Linux Standards Base was created to try to set standards for which all distributions could follow. So far this has not paid off. I can understand the struggle, but how hard could it be to set smart guidelines and, if a distribution follows those guidelines, give them some seal of approval.

The Linux community has to understand if standards are set and followed, developement (and acceptance) for the operating system will be that much easier.

In order for a distribution to be successful it has to include drivers for hardware to work. Yes this might mean that non-free drivers must be included. But that is a small price to pay for a Linux installation to work. The less distributions work out of the box, the less acceptance and use they will see. This is where the Ubuntu distribution shines. Adding proprietary drivers so that NVidia card will use the correct resolution, or that wireless card will work is simple. More distributions should follow this example.

It is clear there are camps for every desktop available to the Linux operating system. And these camps are very vocal in their dislike of the other. GNOME hates KDE hates GNOME hates Enlightenment hates Fluxbox, etc. And it only makes sense that a distribution make a choice for a default. But that doesn't mean the distribution can not offer the other desktops to the user. This should be the case during installation--even with Live CDs.

The installation should ask the user if they want extra desktops installed, or a different desktop installed. Or if that's not the answer - then the installation of said desktops should be made simple with the help of tools like Synaptic. There should be a single check box to install the whole of KDE or GNOME or Enlightenment. Make it easy people! Give the users choice.

Remember the old days of Linux installation where you were asked which desktop you wanted to install? Bring that back. And standards should be followed. A KDE desktop should fundamentally look and feel like any other KDE desktop so users have a better chance of getting used to the Linux desktop.

Help system
For many users that are familiar with Linux, this really isn't an issue. But for new users a good help system is critical. Most help systems included with a distribution generally focus only on the desktop. Add to this some fundamental Linux help and you have a winner.

Make it all work
One of the reasons why the average user doesn't really think twice about their operating system is because when they fire up that PC for the first time everything just works. They don';t have to install a flash plugin or Java or a library so their iPod will connect or they can listen to MP3s. These should all be automatic on every distribution. Period. And the MP3 licensing issue - that needs to seriously go away. People use MP3s. How many times have you had to help someone roll MP3 support into Rhythmbox, Banshee, or XMMS?

Most distributions have this inherent in their systems and subsystems. This could easily fall in line with standards. You have some distributions using SELinux and some not. You have some distributions adding a GUI firewall tool by default and some not. I am not the biggest fan of SELinux only because when it works its best, it can get in the way of applications running (have you had SELinux stop acroread from starting up?). I think the desktop standard should simply be iptables with policies set so that nothing can get in and normal services can get out.

Eye Candy
Let's face it--if you';ve got it, flaunt it. With the help of Compiz, Linux can have the most amazing desktop among all of the operating systems. But in most Compiz-enabled distribution installations I have seen, they have visual effects set to Normal. This leaves out the Compiz Cube, wobbly windows, and a number of other mind-blowing features.

If a machine's hardware can handle it, the default needs to be Extra or Custom. Out of the box (again, if the hardware supports it), all of the Compiz goodness should work. And the key combinations need to be standardized (there it is again!).

Final thoughts
Where do you stand? In your opinion, what makes a good Linux distribution? If you could roll in various aspects of any distro together what would your final results look like? Here';s what I would do:

Take the proprietary driver system and installation tools of Ubuntu, add the desktop of Elive+Compiz, add the foundation of Debian, and the security of Bastille Linux and you would have one killer distribution! Your turn.

Jack Wallen was a key player in the introduction of Linux to the original Techrepublic. Beginning with Red Hat 4.2 and a mighty soap box, Jack had found his escape from Windows. It was around Red Hat 6.0 that Jack landed in the hallowed halls of Techrepublic.


Original post can be found here

Wednesday, July 22, 2009

Simplify calling ASP.NET AJAX services from jQuery

AJAX, ASP.NET, JavaScript, jQuery By Dave Ward on July 21st, 2009

As jQuery’s popularity in the .NET community has risen over the past year, one recurring theme I’ve seen is the desire to refactor away the details of using it to call ASP.NET AJAX services. Whether through helper function or specialized jQuery plugin, I’ve seen numerous methods proposed and/or in use.

Personally, the syntax never bothered me. The contentType parameter is ugly, but I have a Visual Studio code snippet for the $.ajax call and rarely think about it.

That came to an end earlier this year, when I started using dataFilter. I needed to isolate my code from the “.d” issue, and wanted to take advantage of browser-native JSON parsing in Firefox 3.5 and IE8, which required a bulky dataFilter.

Repeating that entire callback function in every $.ajax call was not acceptable. So, I was happy to learn that jQuery provides an excellent solution for consolidating settings to be used in multiple instances of $.ajax.

In this post, I’ll show you how to use that consolidation feature, and exactly how I am now using that to more simply call ASP.NET AJAX services with jQuery.

Configuring $.ajax’s default settings

Rather than wrapping the $.ajax call in a plugin or helper function, jQuery provides a built-in solution that I think is a better alternative:  $.ajaxSetup.

$.ajaxSetup accepts an array of settings that allows you to supply defaults for any of the parameters that you would set in an $.ajax call. Settings like contentType, type, and dataFilter are all fair game, for example.

Using this function, it’s easy to set jQuery’s $.ajax defaults to match the refined settings that we worked out together last year:

   1:  $.ajaxSetup({
   2:    type: "POST",
   3:    contentType: "application/json; charset=utf-8",
   4:    data: "{}"
   5:  });

Because parameters to $.ajax override these defaults, presetting “data” to an empty JSON string is safe. Any $.ajax call that does specify a data parameter will function as expected, since the default will be ignored.

The particular issue caused by forgetting the empty data parameter can be difficult to track down, and only shows up after you’ve deployed your application to IIS. So, having the default as a safety net is recommended.

Adding JSON parsing improvements

Because $.ajaxSetup also supports setting a dataFilter, adding the “.d” isolation and browser-native JSON parsing from my last two posts is easy:

   1:  $.ajaxSetup({
   2:    type: "POST",
   3:    contentType: "application/json; charset=utf-8",
   4:    data: "{}",
   5:    dataFilter: function(data) {
   6:      var msg;   if (typeof (JSON) !== 'undefined' && 
   7:          typeof (JSON.parse) === 'function')
   8:        msg = JSON.parse(data);
   9:      else
  10:        msg = eval('(' + data + ')');   if (msg.hasOwnProperty('d'))
  11:        return msg.d;
  12:      else
  13:        return msg;
  14:    }
  15:  });

This dataFilter processing is actually what pushed me to start using $.ajaxSetup in all of my own projects. It was one thing to accept multiple contentType and method declarations, but repeating the dataFilter for every $.ajax call was more than I could handle.

Putting it to work

With the ASP.NET AJAX defaults set in $.ajaxSetup, all that’s required to call a “ScriptService” or page method is the URL and a success callback:

   1:  $.ajax({
   2:    url: "HelloWorld.asmx/Hello",
   3:    success: function(msg) {
   4:      console.log(msg);
   5:    }
   6:  });

In fact, even the success callback is optional. For example, if you were periodically pinging a “heartbeat” service to keep the user’s session alive, $.ajax would only need the service’s URI.

This more concise syntax makes your service calls far more readable, especially for developers who aren’t familiar with the content-type required by ASP.NET AJAX.

Caution: Sometimes it works too well

While this is a handy way to simplify calls to ASP.NET AJAX services, do understand that $.ajaxSetup applies to all of jQuery’s AJAX derivatives. Setting the default HTTP method and content-type may also impact code and plugins that use jQuery’s built-in communication functionality (e.g. $.getJSON, $.post, etc).

For example, I often use jTemplates as a client-side templating solution. Because its processTemplateURL routine relies on $.ajax to retrieve remote template files, setting the ASP.NET AJAX content-type and POST method in $.ajaxSetup breaks that functionality of jTemplates.

Fixing that problem wasn’t difficult, but it also wasn’t immediately obvious what had caused the issue in the first place. In my experience using this technique, the undesirable side effects are rare enough that it’s not a serious concern, but do be aware of the potential.


I’ve been using this in production for several months now, with great results. Users have noticed the increased speed that came with browser-native JSON parsing, the “.d” isolation has reduced regression errors due to some code we run on both 2.0 and 3.5 servers, and it requires less effort on my part to do all that.

What do you think? Is this helpful?

Would a Visual Studio template with this rolled in be something you would use?


Original post can be found here

Tuesday, July 21, 2009

Nested LEFT JOINs to link three or more tables

Posted on Monday 2005.08.15 at 7:38 pm in Everything, Technology

By Ryan McElroy

Note: This post is over 3 years old. It may contain outdated information and broken links. Please temper your expectations accordingly.

I ran into another dilemma in SQL-land today. Working on a money-management application, I had three tables that I wanted to gather information from. This normally leads to some relatively straightforward SQL:

SELECT,, date, amount, type
FROM transactions, accounts, contacts
WHERE account_id =
AND contact_id =;

However, this returned results only for transactions that had both matching accounts and matching contacts, while what I wanted was a single record for each transaction, regardless of matching accounts or contacts. For two tables, this would be straightforward with a LEFT JOIN:

SELECT, date, amount, type
FROM transactions LEFT JOIN accounts
ON account_id =;

Which would return a row for every entry in the transactions table even if no matching account was found. I tried extrapolating that two three tables, like this:

SELECT,, date, amount, type
FROM FROM transactions LEFT JOIN accounts, contacts
WHERE account_id =
AND contact_id =;

However, this didn’t do what I wanted, and I was getting multiple entries for each transaction. So I googled for help, and Google delivered: Left Joins to link three or more tables. From the information in this article, I was able to develop the SQL code that did exactly what I wanted:

SELECT `accounts`.`name` AS account_name,
`contacts`.`name` AS contact_name,
`date`, `amount`, `type`, `detail`, `memo`, `cleared`
FROM (`transactions` LEFT JOIN `accounts` ON `accounts`.`id` = `account_id`)
LEFT JOIN `contacts` ON `contacts`.`id` = `contact_id`
WHERE `parent_id` = 0

This returns a single row for each entry in transactions, even if matching accounts and contacts are not found. Esentially, it is a nested LEFT JOIN. First, MySQL left joins transactions and accounts, then it takes this result and similarly left joins contacts. This way, every row in the leftmost table (transactions) is preserved. I might have simply linked to the site, but I didn’t like the naming scheme in the examples on that site (crypic names like bdg and dom don’t earn accolades from me), and I came up with a better article title, “Nested”.

Thursday, July 16, 2009

How To Create WordPress Themes From Scratch Part 1

July 14th, 2008 by kailoon under Tips

I’m going to show you how to create a wordpress theme from scratch in these 3 parts of tutorial series. I will cover from Structuring, designing in Photoshop, slicing, coding into fully css based html, and finally wordpress implementation.

Table Of Content

Below is the index of the topics that we will go through:

  1. Structuring, Designing in Photoshop.
  2. Slicing and Coding.
  3. WordPress Implementation.
    1. header.php
    2. sidebar.php
    3. about.php – a custom file for the about section in the sidebar.
    4. footer.php
    5. index.php
    6. featured-post.php – a custom file for the featured posts.
    7. page.php
    8. single.php
    9. comments.php
    10. archives.php, links.php
    11. search.php, searchform.php
    12. function.php
    13. image.php

This is a very important part in designing a web layout. We need to structure our layout before open Photoshop. The first thing is the purpose of the layout. In our case, this will be a blog layout for WordPress. So, below is what we have in a blog:

  1. Header
  2. Posting area
  3. Sidebar
  4. Single page
  5. Comment
  6. Feedback
  7. Searching field
  8. Page menu
  9. RSS
  10. Archives, Links and About Page

Something we need to keep in mind. We can’t put all things into one basket. So, we CANNOT:

  1. Display too many things in one single page.
  2. Use too many colors and font type.

In this sample, I also try to make is as simple as possible because the purpose of this series of tutorial is to give an example on how to create a wordpress theme. I am going to have a featured post section on the main page. Below is the Final image that we will create.

Final Result

wordpress themes tutorial

Step 1

Create a new document with 1024px X 768px as we are going to create a layout which suit for 1024px resolution. Fill it the background layer with #eae8c6. Now, CTRL + R to bring out the ruler. Draw some guide line for the divine proportion we need. Before this, make sure it is snap. Go to View > snap (selected).
wordpress themes tutorial

Step 2

Grab the rectangle tool and draw a header for it. The height, you have to estimate how much you want. Balance is the main thing you need to concern. Then, apply the blending option as shown below. A black to white gradient with soft light blend mode. Create another rectangle, apply gradient overlay with setting as shown below. Put it 1px below the green bar. It will make it more details. Then, draw a 1 pixel line and put it right above the gap between the two bars you created before. Give it a darker color.
wordpress themes tutorial

Step 3

I use Myriad Pro. So, you guys can edit it by yourself later. Apply drop shadow with the setting shown below. Then, also apply Gradient Overlay with 12% opacity, black to white. For the white outline stroke. Simply hold the CTRL tab and click on the text layer to get the selection. Go to Select > Modify > Contract > 1px. After that, create a new layer. Go to Edit > Stroke > 1px, white, inside.
wordpress themes tutorial

Step 4

Draw a rectangle, remember, the maximum width you can use is 600px. Ok, make its white color. Apply 1px inside white stroke. And, Gradient Overlay with the setting as shown below.
wordpress themes tutorial

Step 5

The read more button is actually using the same technique where we used for the logo. This time, we apply Inner Glow with 8px size and 75% Opacity in Soft Light Blend Mode. Gradient Overlay with 70% opacity also in Soft Light Blend Mode. Finally, A 1px outside stroke with color #47670b. Then, for the 1px inside white stroke. It is same with what we did in step 3.
wordpress themes tutorial

Step 6

Place in some dummy text and photo. You will have something like this. You can use a text generator for this.
wordpress themes tutorial

Step 7

Put in some Dummy Text again. Try to use none anti-alias font for testing. Don’t forget what a wordpress theme needed. Post title, tags, post date, comments number. This time, I add in author photo part to be shown in every post.
wordpress themes tutorial

Step 8

Place a RSS icon. I forgot where I downloaded it already…sorry about that… Then, For the search area, create a rounded rectangle with a maximum width of 330px. Fill it with black color and set it blend mode to soft light. Create another rounded rectangle inside. This will be our input field. Fill it with white color. Apply 1px inside stroke with color – #d0ceae. Then, apply inner Glow, with setting shown below. After that, place the searching icon.
wordpress themes tutorial

Step 9

Draw a rounded rectangle and use the pen tool to draw a dialog box as shown below. You can refer to my previous tutorial in LoonDesign on how to create a custom shape in photoshop. Then, apply drop shadow on it. Use the rectangle tool to create the categories and links content box. The maximum width will be 160px. We need a 10px space in between them.
wordpress themes tutorial

Step 10

We are almost there. Now, we will use the same technique we used to create the header part.
wordpress themes tutorial


You may found that I do not mention about the page navigation part. I think it is too simple for you. Try it out yourself. If really can’t, I am also providing the source file for you here. Overall, there is several things we need to consider when creating a wordpress theme. In this example, we are creating for blogging purpose. So, the major section will be, categories, tagging, author photo, comments and also the RSS feed. I prefer to make things more organizes. So, you can found that all the layers in my psd file are well renamed and each section is well separated. This is for future modification purpose and also for my dear reader to modify it easily.

Single Page

As we are creating theme for wordpress, there must be a single page to display a post and comment section. Here is the final output.
wordpress themes tutorial

Download and continue

Download Continue read on How To Create WordPress Themes From Scratch Part 2 – Slicing and CSS/XHTML Coding.


Original post can be found here

Related Posts:

Thursday, July 9, 2009

A Simple Guide to .Net Remoting

By jamiemoffat

Remoting is .Net’s way to create and uses object instances on a remote machine, without any of the hassle of DCOM.
This guide provides a (very) quick guide to getting you up and running and calling across your network. Most of the examples that Microsoft provide use a console application to host your remote object, which wouldn’t be the way most of us will use the technology.
This tutorial will cover the most common hosting method, which is within IIS.
I haven’t gone too deep into all the settings that are available with .Net Remoting, I will cover those in a future article.
1) Create a C# class that inherits MarshalByRefObject: E.g.

public class myObj : MarshalByRefObject
// ...

Add some classes, properties etc.
2) Compile it to produce myObj.dll
3) Now, the object needs to be hosted somewhere. The easiest way to do this is to host the object within IIS.
First of all though, we need to describe our object so it can be accessed. To this end, create a web.config file with the following text:

wellknown mode="SingleCall" type="myNamespace.myObj, myObj"
objectUri="myObj.soap" />
In this XML: 
type ="myNamespace.myObj, myObj" is the full type name, followed by the assembly name.
On the Remote Server:
1) Create a directory called “myRemoteObject”. Create a Bin directory beneath it.
2) Create a new IIS virtual Directory called myIISObj that points to the myRemoteObject directory.
3) Place your compiled versions of myObj.dll in the myRemoteObject \Bin directory
4) Place the Web.Config file in the myRemoteObject directory.
On the Client:
In your application set a reference to the local object on your client machine. This allows he CLR to pick up the meta data of the object so that we can create the object remotely (There is another way to generate the meta data without needing the actual object on the client, a utility called SoapSuds.exe, but I leave that for you to read about )
Now we need a client.config file analogous to the web.config file, which tells the CLR how to access (ie. where to access) the remote object.

application name="Client">
client url="http://andy2k/myIISObj">
wellknown type="myNamespace.myObj, myObj"
channel ref="http" />

(Note: replace “andy2k” with the name of your remote server)
Now in the client code, simply create the object as usual but, first of all, load the config file.

//Load the Http Channel from the config file

//instantiate the remote object on the server
//(this is really just a proxy object here)
myNamespace.myObj anObj = new myNamespace.myObj();
The .Net runtime picks up the fact that this is not a local object (because of the config file read in the previous line) and creates the object on the remote machine. You now access the object as if it was created locally, and .Net does the rest. 
(if you’re not convinced, create a method in the class that simply returns a string representing the name of the local machine
Something like:

public string getCompName()
return System.Environment.MachineName;

that should convince you that the object has been created on the remote machine)
And there you have it – you’ve just created a remote object!


Original post can be found here

Wednesday, July 8, 2009

Joining Multiple Tables with SQL Inner Join Statements

You can use SQL JOIN statements to combine data from three or more tables. In an earlier article, we took a look at using inner joins and outer joins to combine data from two different tables. In many cases, you’ll want to take this a step further and combine data from three or more tables. Let's take a look at the SQL statements that allow you to accomplish this goal for an inner join.
You may recall from our basic inner join example that the SQL statement below combines data from the Drivers and Vehicles tables in cases where the driver and vehicle are located in the same city:

   1:  SELECT lastname, firstname, tag
   2:  FROM drivers, vehicles
   3:  WHERE drivers.location = vehicles.location

This query produced the following results:

lastname firstname tag
-------- --------- ---
Baker Roland H122JM
Smythe Michael D824HA
Smythe Michael P091YF
Jacobs Abraham J291QR
Jacobs Abraham L990MT

Ads by Nielsen Field

Now, let’s extend this example to include a third table. Imagine that you wanted to include only drivers and vehicles present at locations that are open on the weekend. You could bring a third table into your query by extending the JOIN statement as follows:

   1:  SELECT lastname, firstname, tag, open_weekends
   2:  FROM drivers, vehicles, locations
   3:  WHERE drivers.location = vehicles.location
   4:  AND vehicles.location = locations.location
   5:  AND locations.open_weekends = 'Yes'


lastname firstname tag open_weekends
-------- --------- --- -------------
Baker Roland H122JM yes
Jacobs Abraham J291QR yes
Jacobs Abraham L990MT yes


This powerful extension to the basic SQL JOIN statement allows you to combine data in a complex manner. In addition to combining tables with an inner join, you can also use this technique to combine multiple tables using an outer join. As you may recall, outer joins include results that exist in one table but do not have a corresponding match in the joined table.

Suggested Reading

Introducing Joins

Inner Joins

Outer Joins


Original post can be found here

Tuesday, July 7, 2009

nopCommerce Open Source E-Commerce Solution

nopCommerce is an open source e-commerce solution that contains both a catalog frontend and an administration tool backend. nopCommerce is a fully customizable shopping cart. It's stable and highly usable. From downloads to documentation, offers a comprehensive base of information, resources, and support to the nopCommerce community.

nopCommerce is new but very popular open source e-commerce solution. nopCommerce is available for free. A solution with comprehensive features that is easy to use for new online businesses, yet powerful enough for the most demanding e-commerce expert. It’s a secure, scalable and extendable e-commerce platform.

Create and manage a professional online store with nopCommerce 1.20. Built-in shopping cart, catalog management, credit card processing, shipping calculation, template customization and other powerful tools come standard.

So join the community and see what you can learn and what you can share!

O'Reilly Webcast: Ten Things Every Software Architect Should Know

This is the slide deck used in Richard Monson-Haefe more

Monday, July 6, 2009

What is ASP.NET Dynamic Data?

ASP.NET Dynamic Data is a technology from Microsoft that expands the toolset of ASP.NET starting with ASP.NET 3.5 SP1. Use it to build data entry web forms that interact with a database or classes that resemble a database.


Wednesday, July 1, 2009

s3Slider jQuery plugin


The s3Slider jQuery plugin is made by example of jd`s smooth slide show script. I needed something like that for jQuery (for my web site Since i didnt find it after a small research i decided to build it by my self.


It is very easy. First include the jQuery library then include the s3Slider javascript in the head of the page(s) where you want to use s3Slider.

jQuery can be download from jQuery`s homepage.

<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/s3Slider.js" type="text/javascript"></script> 

Important: For the script to work properly there is a set of rules that must be followed.


<div id="s3slider">
   <ul id="s3sliderContent">
      <li class="s3sliderImage">
          <img src="#" />
<span>Your text comes here</span>
      <li class="s3sliderImage">
          <img src="#" />
<span>Your text comes here</span>
      <div class="clear s3sliderImage"></div>

+ show all of the code


If you set that main div id is s3slider as we did here, that is the name that must be prefix for all other classes and id`s for that specific gallery (slide show). For example, if you set an id for main div as your_name, the inner id must be your_nameContent and the class .your_nameImage like in example above.

The second thing is that every .your_nameImage element in it self must have span. Also, the last div with class clear must also have an class of image holder in this case .your_nameImage. if you dont put that, the last image will NOT be shown in the slide show.


#s3slider { 
   width: 400px; /* important to be same as image width */ 
   height: 300px; /* important to be same as image height */
   position: relative; /* important */
   overflow: hidden; /* important */
#s3sliderContent {
   width: 400px; /* important to be same as image width or wider */
   position: absolute; /* important */
   top: 0; /* important */
   margin-left: 0; /* important */
.s3sliderImage {
   float: left; /* important */
   position: relative; /* important */
   display: none; /* important */
.s3sliderImage span {
   position: absolute; /* important */
   left: 0;
   font: 10px/15px Arial, Helvetica, sans-serif;
   padding: 10px 13px;
   width: 374px;
   background-color: #000;
   filter: alpha(opacity=70); /* here you can set the opacity of box with text */
   -moz-opacity: 0.7; /* here you can set the opacity of box with text */
   -khtml-opacity: 0.7; /* here you can set the opacity of box with text */
   opacity: 0.7; /* here you can set the opacity of box with text */
   color: #fff;
   display: none; /* important */
   top: 0;
       if you put
       top: 0; -> the box with text will be shown at the top of the image 
       if you put
       bottom: 0; -> the box with text will be shown at the bottom of the image
.clear {
   clear: both;

+ show all of the code

Then you need to initalize s3Slider and set the duration of how long will one picture be shown on the page (value is in miliseconds).


$(document).ready(function() { 
      timeOut: 4000 

Take a look at the live example.


This script is licensed under Creative Commons Attribution 2.5. So you can use it in all you projects even commercial ones.

More example: