Quantcast
Channel: CleanCode NZ
Browsing all 28 articles
Browse latest View live

Regex multiple occurrence search

Here is a task we have very often, multiple occurrence or recurring match, this is made easy by understanding zero width assertion and greedy –lazy matching. 1. Zero width assertion You can place...

View Article



A Complete Example of WCF,Ajax, SSL and None SSL

Here is a complete example of using wcf and ajax via JQuery, the configuration for wcf under ssl is also included. Client : javascript code <script type="text/javascript">...

View Article

Lifetime of parts created by MEF container

You might be confused that when lifetime of parts that are created by MEF container.GetExportedValues appeared to be NOT controlled by their container. the confusion comes from that fact that most of...

View Article

More than one export was found that matches the constraint

When using MEF, you might one day find a class that is marked as export is not exported. Having a look at the trace window in VS, there is a line as: More than one export was found that matches the...

View Article

MVC DropDownList IEnumerable binding error

When you try to bind a model field with a dropdownlist in view, you need to create a SelectList in controller then pass that SelectList to view from ViewBag or ViewData, normally there will be a...

View Article


Share MVC PartialView between server and client

In MVC you can divide a big view into smaller partial views, while with ajax these partial views can also be used by ajax to do partial update of an already rendered page. In the partial view you can...

View Article

Image may be NSFW.
Clik here to view.

Multiple files upload using managed_file in drupal

There is already a multiple file management module in drupal: plupload, but no luck when I tried to use it following their instructions. <?php $form['my_element'] = array( '#type' => 'plupload',...

View Article

Image may be NSFW.
Clik here to view.

javascript in Depth

In javascript, have you ever been confused by prototype and __proto__, what is best way to do inheritance? what the type of object it actually is? where are those apply or call methods from? and what...

View Article


How to modify static javascript data in Drupal

We can add javascript or javascript settings in drupal by calling drupal_add_js(), in some cases you may want to remove some javascript you add earlier. There is no built in function like...

View Article


Image may be NSFW.
Clik here to view.

Expression Tree and Merge of Expressions

The Expression class in C# allows you to build computational expressions in run time. Most of examples you can find are showing you how to build a simple scenario of a binary expression, as a tree it...

View Article

Image may be NSFW.
Clik here to view.

Multi values field development drupal

Field api is a very useful feature in drupal in terms of extension of entity, reuse of code and modularization of software development. To me the Field is the way to establish the references between...

View Article

Image may be NSFW.
Clik here to view.

Run Nant script on TFS Build server

I believe that all the tasks that nant does can be done by TFS build server as well, but TFS build tasks can only be performed on a TFS server, due to this reason we might end up defining the automated...

View Article

OpenLayers Primer

There are many benefits using OpenLayers for map functionalities compared with using map apis directly. here is a list of lessons I learned when I started out to use OpenLayers, they are basic...

View Article


Create an ajax control in drupal 7

We know that in drupal you can attach #ajax property to an existing ajax ready control to have ajax functionality, such controls like ‘button’,’textarea’,’select’,’radio’ etc, to find the whole list...

View Article

Differences of Isolation levels

Here I am trying to explain the difference of isolation levels in plain English together with the scenarios in real situation which we can relate with those concepts . There are two main concepts that...

View Article


WCF in MVC

Many years ago I have written an article about demystifying WCF in Asp.Net, today I am going to show you how to create and host WCF services in a MVC environment, in the article mentioned earlier, it...

View Article

Magic @Html.DropDownList

This is observed in MVC5 When one of properties of model is associated with another list, it is normal practice that  list is saved in the ViewData as a SelectList , then in the View, the same list is...

View Article


Wpf DataBinding And INotifyPropertyChanged

In WPF, data binding between a binding target which is normally a ui control property (DepdencyProperty) and  a binding source which is normally the view model property can be two way.  There is hardly...

View Article

Client Certificate Authentication – Error 403.7

When you implement client certificate authentication in IIS(7.5), you might get Error 403.7, and in the client side the error message looks like The HTTP request was forbidden with client...

View Article

Image may be NSFW.
Clik here to view.

Service certificate: Keyset does not exist

When you try to use a service certificate in WCF namely message security, you might have an error : Keyset does not exist Or in a detailed manner the message could be: It is likely that certificate...

View Article
Browsing all 28 articles
Browse latest View live




Latest Images