Wednesday, December 19, 2012

[Sample Of Dec 14th] A Private Messages Module in ASP.NET Site

[Sample Of Dec 14th] A Private Messages Module in ASP.NET Site:

Homepage image
RSS Feed
Sample Download :
CS Version: http://code.msdn.microsoft.com/CSASPNETPrivateMessagesModu-31b69f48
VB Version: http://code.msdn.microsoft.com/VBASPNETPrivateMessagesModu-59a72af5 
This sample shows how to create a private messaging module in an ASP.NET site. This module can base on the ASP.NET Membership or other member systems. And it can be easily added to an existing ASP.NET Site.
 
imageYou can find more code samples that demonstrate the most typical programming scenarios by using Microsoft All-In-One Code Framework Sample Browser or Sample Browser Visual Studio extension. They give you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about sample updates. If it is the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on Microsoft Showcase, or read the introduction on our homepage http://1code.codeplex.com/.

[Sample Of Dec 18th] Get online users in ASP.NET

[Sample Of Dec 18th] Get online users in ASP.NET:

Homepage image
RSS Feed
Sample Download :
CS Version: http://code.msdn.microsoft.com/CSASPNETCurrentOnlineUserLi-0483a7f3
VB Version: http://code.msdn.microsoft.com/VBASPNETCurrentOnlineUserLi-23108d31

This project shows how to display a list of current online users' information without using membership provider.
image
You can find more code samples that demonstrate the most typical programming scenarios by using Microsoft All-In-One Code Framework Sample Browser or Sample Browser Visual Studio extension. They give you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about sample updates. If it is the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on Microsoft Showcase, or read the introduction on our homepage http://1code.codeplex.com/.

Extend Your Classes Without Changing Code

So I'm at a client's site and we're discussing adding a new method to an existing class. One of the client's programmers said, "We should put the method in the base class and let all the derived classes inherit it from it" Another programmer said, "I think it would be better to create a new class that inherits from our base class and add the new method to it."
And I said, "Let's not change anything. Let's just create the new method."
I had a couple of reasons for disliking the first two suggestions. First, of course they weren't my suggestions. But beyond that, I didn't want to change the base class because the base class had this neat feature: it worked. I hate making changes to working code—it's just asking for something new to fail. Adding a new derived class would avoid that problem, but creates a new one: developers would have to be told to use the new class in order to get access to the new method. Developers were already using the existing classes and I didn't see any value in making them change.
So I suggested we create an extension method and avoid all those problems. An extension method sits in a separate file from the base class, so the base class is unchanged (though the method would be in the same Class Library project and be distributed as part of the same DLL). An extension method also appears automatically in the IntelliSense dropdown lists for the existing classes, so developers would have it presented to them as part of the classes they were already using.
Creating an extension method is easy. In C#, you add a static class with a static method, with both the class and method declared as public. The method's first parameter specifies the class the method will attach itself to (the parameter has to be flagged with the this keyword).
When the extension method is used from an object, that object is automatically passed to the extension method in that parameter. This ToggleCustomerStatus method, for instance, will appear in the IntelliSense list of any Customer object (or any object that inherits from Customer), toggle the value of the Status property on the Customer object the method is used on, and return the new value:
public static class CustomerCSExtensions
{
  public static bool ToggleCustomerStatus(this Customer cust)
  {
    cust.Status = !cust.Status;
    return cust.Status;
  }
}
To create an extension method in Visual Basic, add a Module, declare it Public, write your function or subroutine, and decorate the method with the extension method. The first method parameter specifies the class to which the method will be added. When the extension method is used from an object, that object is automatically passed to the extension method in that parameter.
This ToggleCustomerStatus method, for instance, will appear in the IntelliSense list of any Customer object (or any object that inherits from Customer) and, unlike my previous example, doesn't return a value:
Public Module CustomerExtensions
  
  Public Sub ToggleCustomerStatus(ByVal cust As Customer)
    cust.Status = Not cust.Status
  End Sub
End Module
To use the extension method, you need to add an Imports or using statement for the namespace that the extension was declared in. If the extension method is in the same namespace as the object it's attaching itself to, developers using that object will probably already have that namespace in place. After that, using an extension method looks just like using any other method (and it doesn't matter if the class the extension method is being attached to is written in one language and the extension method itself is written in another language). Here's the C# ToggleCustomerStatus method in action in some VB code:
Dim cust As Customer
If cust.ToggleCustomerStatus Then …
And the VB version used from C# code:
Customer cust;
cust.ToggleCustomerStatus();
While my sample extension method accepts only the single parameter that specifies which class it should attach itself to, an extension method can accept multiple parameters, just like any other method. You can also specify an interface as the first parameter's datatype so that your extension method will attach itself to a variety of objects (provided they all implement that interface). And, most importantly, you don't change any working code.

Help Support Hurricane Sandy Relief

Help Support Hurricane Sandy Relief:
UPDATE: You did it! A huge ‘Thank You!’ to all of you, who used our special Sandy stickers: $10,000 for Hurricane Sandy relief efforts raised in record time!    

Hurricane Sandy left thousands of people in the United States’ east coast in serious trouble. Many victims were left without power, transportation and in some cases even without a home. Relief and rebuilding efforts have just begun and there’s a lot to do. We at Autodesk wanted to help. We created special l Hurricane Sandy Relief stickers for Pixlr Express.

Autodesk donated $10,000 to Architecture for Humanity. Architecture for Humanity is a nonprofit design services firm committed to building a more sustainable future through the power of professional design. This money will help their network of 50,000 professionals provide construction and development services to provide safe shelter and access to water, sanitation, power and essential services. 

Spot Heal / Touch-Up Update

Spot Heal / Touch-Up Update: After an intense period of mobile apps I happy to have some updates to our web apps. I just released new versions of the heal tool (Epic coding done by Will actually..), I'm pretty sure we are the only online tool that has this advanced type of healing and spot/object removal.

In Express you find it under Adjustments->Touch Up->Spot, the express version only works as a spot removal i.e a round area the size of the brush.

In Editor you find it in the toolbar to the right, the "patch" icon (Spot heal tool), in editor you can draw uneven shapes to select entire spots/objects. You can draw how big areas you like but you will get the best result if you select smaller portions.

Here are some images i touched up using only the patch tool in editor:


I don't have anything against freckles, but it's easy to see how powerful the tool is.


My beach is the one the right, no rocks and less cloud, just like I want it .. uuh sun ..


This old stiff heard some bad joked and was all cracked up, I fixed it for him.

Well, go play!

//Ola



Building Custom Controls for Windows 8 Store apps

Building Custom Controls for Windows 8 Store apps:
This article explains how to build custom controls for Windows Store apps, using XAML and C#. Custom controls are the most powerful controls in the XAML department. Once you know how to design and build these, you’ll have no problems with their alternatives: user controls, derived controls, and extended controls. Let’s start with a definition: a custom control is a reusable templatable control that comes with a generic.xaml file and some code behind. Generally a custom control is stored in its own assembly to make it reusable in multiple apps. As a developer, you decorate a custom control with properties, methods, events, and a default style. The users of the control –developers who use your custom control in their apps- should live with the code behind, but are free to completely restyle the XAML part.

Hello again, Simple Slider

Almost a year ago, I built a custom slider control in an earlier version of Visual Studio and the Windows Runtime. A lot has changed since then – fortunately for the better. For this article, I decided to redo that slider. I’ll stick to its original anatomy: a horizontal slider is just a draggable Thumb in a Border.  While dragging, a Rectangle is drawn to fill the space at the left side of the Thumb:

Getting Started

Recent versions of Visual Studio 2012 –including the free Express edition- come with a template to create a custom control. All you need to do to get started is adding a new item of the type ‘Templated Control’ to your project:

It will create the code behind file as well as the generic.xaml in the Templates folder.

Properties

A custom control directly inherits from Control itself, the mother of all controls. It immediately comes with a couple of useful properties like Height, Width, and Visibility. Of course you would want to add your own properties. A slider control e.g. should have at least properties to represent its minimum, maximum and current value. Since we’re interested in data binding, we will implement these as DependencyProperty instances. Using the propdp code snippet, you can rapidly define a property and provide its name, type, default value, and the function that will be called when the value changes. In the case of our slider, we are definitely interested in knowing when the value changed: it’s the sign to redraw the control. Here’s how the definition of the Value property looks like:
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
    "Value", typeof(double), typeof(Slider), new PropertyMetadata(0.0, OnValueChanged));

public double Value
{
    get { return (double)GetValue(ValueProperty); }
    set { SetValue(ValueProperty, value); }
}

private static void OnValueChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
{
    // Recalculate part sizes.
    // ...
}

Styling

The generic.xaml file will contain the default style for the control. While typing in that code, you have intellisense but no designer support. Here’s how the basic slider style looks like in XAML.
<Style TargetType="local:Slider">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="local:Slider">
                <Grid>
                    <Border Height="40"
                            VerticalAlignment="Stretch"
                            Background="Gray"
                            Margin="0"
                            Padding="0"
                            BorderThickness="0" />
                    <Canvas Margin="0"
                            Height="40">
                        <Rectangle x:Name="PART_Rectangle"
                                    Height="38"
                                    Fill="SlateBlue"
                                    Margin="0 1" />
                        <Thumb x:Name="PART_Thumb"
                                Background="LightSteelBlue"
                                Width="40"
                                Height="40"
                                Margin="0" />
                    </Canvas>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
The default style is assigned to the control in its constructor:
public Slider()
{
    this.DefaultStyleKey = typeof(Slider);
}
This is a screenshot of the custom slider:

In the style definition, the Thumb and Rectangle controls were given an x:Name value. This is because we need to manipulate them when (re)drawing the slider from code behind. That puts some constraints on the ‘templatability’ of the custom control: no matter how the designer wants to make the control look like, he or she needs to make sure that the template contains a Thumb and a Rectangle with the expected name. Fortunately you have some ways to notify these constraints to the designer. First there is a naming convention that specifies that the element’s name should start with ‘PART_’. More important is the fact that you can decorate the class with TemplatePart attributes. These will be recognized by tools like Expression Blend. Here’s the definition in C#:
[TemplatePart(Name = ThumbPartName, Type = typeof(Thumb))]
[TemplatePart(Name = RectanglePartName, Type = typeof(Rectangle))]
public sealed class Slider : Control
{    
    private const string ThumbPartName = "PART_Thumb";
    private const string RectanglePartName = "PART_Rectangle";
        
    // ...
}
You find the named parts with the GetTemplateChild method. When using your control, a designer could have ignored the expected parts, so make sure you look them up defensively:
protected override void OnApplyTemplate()
{
    this.thumb = this.GetTemplateChild(ThumbPartName) as Thumb;
    if (this.thumb != null)
    {
        this.thumb.DragDelta += this.Thumb_DragDelta;
    }

    // ...

    base.OnApplyTemplate();
}
This code is typically written in an override of the OnApplyTemplate method. Don’t use the Loaded event. The visual tree of a templated control might be still incomplete at that stage.

Visual State Management

Depending on its state (enabled, disabled, focused, snapped, etc.) a control will look and feel slightly or drastically different. This is where the VisualStateManager comes in action. The visual state manager invokes transformations when the state of the control changes. E.g. if the control is disabled, it will recolor it in fifty shades of gray. The states and transformations can be described declaratively in XAML:
<VisualStateManager.VisualStateGroups>
    <VisualStateGroup x:Name="CommonStates">
        <VisualState x:Name="Normal">
            <Storyboard>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Thumb"
                                                Storyboard.TargetProperty="Background">
                    <DiscreteObjectKeyFrame KeyTime="0"
                                            Value="LightSteelBlue" />
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Rectangle"
                                                Storyboard.TargetProperty="Fill">
                    <DiscreteObjectKeyFrame KeyTime="0"
                                            Value="SlateBlue" />
                </ObjectAnimationUsingKeyFrames>
            </Storyboard>
        </VisualState>
        <VisualState x:Name="Disabled">
            <Storyboard>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Thumb"
                                                Storyboard.TargetProperty="Background">
                    <DiscreteObjectKeyFrame KeyTime="0"
                                            Value="LightGray" />
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Rectangle"
                                                Storyboard.TargetProperty="Fill">
                    <DiscreteObjectKeyFrame KeyTime="0"
                                            Value="DimGray" />
                </ObjectAnimationUsingKeyFrames>
            </Storyboard>
        </VisualState>
    </VisualStateGroup>
</VisualStateManager.VisualStateGroups>
When the control is used inside a LayoutAwarePage, then it will listen automagically to state changes. But we can’t make assumptions on how and where our control is going to be used. Fortunately, in code behind it is possible to trigger the visual state manager programmatically. Here’s an example where we disable the control from C#:
private void Slider_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
{
    if (this.IsEnabled)
    {
        VisualStateManager.GoToState(this, "Normal", true);
    }
    else
    {
        VisualStateManager.GoToState(this, "Disabled", true);
    };
}
Here's the result when the app is running:

Again, this puts some constraints on the templatability of the control: the designer has to make sure that the visual states that we invoke programmatically exist in the overridden style. Again we as developer can document these constraints by decorating the class with TemplateVisualState attributes:
[TemplateVisualState(Name = "Normal", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Disabled", GroupName = "CommonStates")]
public sealed class Slider : Control
{ 
   // ...
}

Templating

The style in the generic.xaml is just a default style. It can be completely overridden, as long as the TemplatePart and VisualState constraints are respected. Here’s an example of how to give the default slider a brand new jacket:
<cc:Slider>
    <cc:Slider.Template>
        <ControlTemplate TargetType="cc:Slider">
            <Grid>
                <Border Height="80"
                        VerticalAlignment="Stretch"
                        Background="Transparent" />
                <Line VerticalAlignment="Center"
                        X1="0"
                        Y1="0"
                        X2="3000"
                        Y2="0"
                        StrokeThickness="7"
                        Stroke="White"
                        StrokeDashArray="1" />
                <Canvas Margin="0"
                        Height="80">
                    <Rectangle x:Name="PART_Rectangle"
                                Height="12"
                                Canvas.Top="34"
                                Fill="DarkSlateBlue" />
                    <Thumb x:Name="PART_Thumb"
                            Width="80"
                            Height="80">
                        <Thumb.Template>
                            <ControlTemplate>
                                <Image Source="Assets/Pacman.png"
                                        Height="80" />
                            </ControlTemplate>
                        </Thumb.Template>
                    </Thumb>
                </Canvas>
            </Grid>
        </ControlTemplate>
    </cc:Slider.Template>
</cc:Slider>
Here’s how it looks like:

Events

To add an event to your control, just declare it and raise it at the appropriate time. I have decorated the slider with an event ‘BoundHit’ that is raised when the value hits minimum or maximum:
public event EventHandler BoundHit;

private void OnBoundHit(EventArgs e)
{
    if (this.BoundHit != null)
    {
        this.BoundHit(this, e);
    }
}

private void Thumb_DragDelta(object sender, DragDeltaEventArgs e)
{
    // ...
    this.OnBoundHit(EventArgs.Empty);
    // ...
}

The page that hosts the slider can now react to it:
<cc:Slider BoundHit="ccSlider_BoundHit" />

This is what it does in the attached sample project:
 
Admit it: you never saw a slider do this ;-)

From Slider to Gauge

This is basically all you need to know to roll your own custom controls. If you don’t believe me, feel free to dive into the attached source code of the following Radial Gauge control. It’s a new version of a control I built some months ago: you find its story here. Since then the .NET framework improved and so did my code. Now the radial gauge may be a bit more complex than the slider: there are some animations and converters involved. But apart from that, it only contains stuff we covered in this article: a default style in generic.xaml, an override of OnApplyTemplate, and a TemplatePart - no visual states. Functionally all that a radial gauge does is rotating a needle when its value changes. That basically makes it a templated … slider. Anyway if you’re looking for a basic radial gauge with a color scale, here you have one:

Alternatives

User Controls

Custom controls are the most powerful controls to build, although not always the most developer-friendly: you don’t have support from Visual Studio’s designer when defining the style. Fortunately this is not the case with User Controls. For more details, check my previous blog item.

Derived Controls

Another alternative is to create a Derived Control, by creating a subclass of an existing control. You can then add properties, methods, and events at will, or override some of its methods. You find examples of derived controls in the Callisto framework. Among other useful controls, that framework  contains the DynamicTextBlock control, a textblock that does trimming at word boundary. It inherits from ContentControl:
public class DynamicTextBlock : ContentControl
{
    // ...
}
Another example of a derived control can be found in the WinRT XAML Toolkit: the WatermarkTextBox inherits from the native TextBox, and adds a watermark.

Extended Controls

Using Attached Properties, you can add extra properties to existing instances, e.g. of controls. This allows you to create new controls without defining control subclasses. Again Callisto as well as WinRt XAML Toolkit have examples of such extensions. You’ll remember the TextBoxValidationExtensions from my blog post on input validation. These extensions allow you to add validation logic to a native textbox:
<TextBox ext:TextBoxValidationExtensions.Format="NonEmptyNumeric"
            ext:TextBoxValidationExtensions.InvalidBrush="Salmon" />
You can take the concept of attached properties one step further to create a Behavior, like the ‘select-all-on-focus’ from another previous blog post:
<TextBox Text="Eh~ Sexy lady. Op op op op oppan Gangnam Style.">
    <WinRtBehaviors:Interaction.Behaviors>
        <local:SelectAllOnFocusBehavior SelectAllOnFocus="True" />
    </WinRtBehaviors:Interaction.Behaviors>
</TextBox>
The attached solution contains the source code for all mentioned alternative controls. Here’s how the corresponding sample page looks like:

Code Code Code

Here’s the full source code of all the featured controls in this article (o, and a free forward-button style). It was written in Visual Studio 2012 Ultimate, without SP1: U2UConsult.CustomControls.Sample.zip (256.78 kb).
Enjoy!
Diederik

Visual Studio 2012 Update 1 is here

Visual Studio 2012 Update 1 is here:
Today, the Visual Studio 2012 Update 1 (Visual Studio 2012.1) is available for download. You can get it now via the Visual Studio 2012.1 download page (see "Visual Studio 2012 Update 1" under the "Additional software" section).
For an overview of the main updates included in Visual Studio 2012.1, please visit Soma’s blog. As he mentions in his post, “This [update] isn’t just about bug fixes, though it contains plenty of those (Visual Studio 2012.1 includes more than a 100 fixes to measurably address issues reported through Connect and Windows Error Reporting). This update delivers a wealth of new functionality into Visual Studio 2012, across all of our products.”
In particular, you can find a comprehensive outline of the new functionality available for Visual Studio 2012 Ultimate in the update on the Visual Studio ALM + TFS Blog.
If you encounter a bug or an issue, please report it through the Visual Studio, LightSwitch, and Blend Connect sites. As always, we want to hear your suggestions or feature ideas/improvements so please add your suggestions to UserVoice or vote on other user’s suggestions.
Thanks,
The Visual Studio Team

Visual Studio 2012 Update 1 is here

Visual Studio 2012 Update 1 is here:
Today, the Visual Studio 2012 Update 1 (Visual Studio 2012.1) is available for download. You can get it now via the Visual Studio 2012.1 download page (see "Visual Studio 2012 Update 1" under the "Additional software" section).
For an overview of the main updates included in Visual Studio 2012.1, please visit Soma’s blog. As he mentions in his post, “This [update] isn’t just about bug fixes, though it contains plenty of those (Visual Studio 2012.1 includes more than a 100 fixes to measurably address issues reported through Connect and Windows Error Reporting). This update delivers a wealth of new functionality into Visual Studio 2012, across all of our products.”
In particular, you can find a comprehensive outline of the new functionality available for Visual Studio 2012 Ultimate in the update on the Visual Studio ALM + TFS Blog.
If you encounter a bug or an issue, please report it through the Visual Studio, LightSwitch, and Blend Connect sites. As always, we want to hear your suggestions or feature ideas/improvements so please add your suggestions to UserVoice or vote on other user’s suggestions.
Thanks,
The Visual Studio Team

Windows 8 Apps Unleashed Now in Bookstores!

Windows 8 Apps Unleashed Now in Bookstores!:
My book Windows 8 Apps with HTML5 and JavaScript Unleashed is now in bookstores! Learn how to create Metro apps Windows 8 apps with JavaScript. And the book is in color! All of the code listings and illustrations are in color.
Windows8Unleashed
Why build Windows 8 apps? When you create a Windows 8 app, you can put your app in the Windows 8 Store. In other words, customers can buy your app directly from Windows. Think iPhone apps, but for a much larger market.
In my book, I explain how you can create both game apps and simple productivity apps by creating Windows 8 apps with JavaScript. The book is a short read and I include plenty of code samples that have been tested against the final release of Windows 8.
You can buy the book by going to your local Barnes & Noble bookstore or you can buy the book through Amazon by using the following link:

It looks like the book is also available for the Kindle:
Kindle: Windows 8 Apps with HTML5 and JavaScript Unleashed

jQuery UI 1.9.2

jQuery UI 1.9.2:
The second maintenance release for jQuery UI 1.9 is out. This update brings bug fixes for Accordion, Autocomplete, Button, Datepicker, Dialog, Menu, Tabs, Tooltip and Widget Factory. For the full list of changes, see the changelog. You can download it here:

Download

File Downloads

Git (contains source files, with @VERSION not yet replaced with 1.9.2, base theme only)

Google Ajax Libraries API (CDN)

Microsoft Ajax CDN (CDN)

Custom Download Builder

Changelog

See the 1.9 Upgrade Guide for a list of changes that may affect you when upgrading from 1.8.x. For full details on what’s included in this release see the 1.9.2 Changelog.

Thanks

Thanks to all who helped with this release, specifically: abacada, acouch, amasniko, Avinash R, AzaToth, BikingGlobetrotter, cgack, cmex, Corey Frang, Cory Gackenheimer, drew.waddell, dsargent, ezyang, fofanafi, forw, frediani.adrien, gigi81, gtr053, jdomnitz, Jörn Zaefferer, Mamen, Mike Sherov, Narretz, omuleanu, petersendidit, rmetayer, Scott González, StefanKern, TJ VanToll, wfsiew

Comments

Note: please do NOT use the comments section of this blog post for reporting bugs. Bug reports should be filed in the jQuery UI Bug Tracker and support questions should be posted on the jQuery Forum.
If you have feedback on us doing our second maintenance release for jQuery UI 1.9, feel free to leave a comment below. Thank you.

jQuery UI 1.10 Beta

jQuery UI 1.10 Beta:
The first beta release for jQuery UI 1.10 is out, barely more than two months after the 1.9 release. Naturally, we’ve focused on specific widgets for this release, along with a usual barrage of bug fixes.
The big changes:
  • Dialog API redesign and a ton of accessibility updates: This was our main goal for this release. Dialog is now easier to use (fewer (useless) options), avoids a ton of issues thanks for a new approach to stacking and a lot more accessible. When you press a button to open a dialog, then close that dialog, focus will move back to that opening button. Full keyboard control is therefore much easier. Focus handling inside the dialog also got better. Together this makes dialog much more usable in combination with screenreaders. And you get all that while the API stayed pretty much the same.
  • Progressbar API redesign: The one change here is to add support for indeterminate progress bars.
  • We’ve removed the backward compability layers in Accordion, Autocomplete, Effects, Position, Tabs and Widget, reducing the filesize of these components, quite significantly for Tabs. If you’ve upgraded from 1.8 to 1.9 and haven’t updated your usage yet, check out the 1.9 upgrade guide for necessary changes.
For a full list of changes, see the list of 1.10 fixed tickets. You can read more about the API redesigns in a previous blog post. We’re working on a full changelog and upgrade guide for the final release.
One new widget almost made it into this release: Selectmenu. We’re still working on the accessibility side of that and you can expect it in 1.11, which will come as quickly as 1.10.

Download

File Downloads

Git (contains source files, with @VERSION not yet replaced with 1.10.0-beta.1, base theme only)

Comments

Note: please do NOT use the comments section of this blog post for reporting bugs. Bug reports should be filed in the jQuery UI Bug Tracker and support questions should be posted on the jQuery Forum.
If you have feedback on us doing our first beta release for jQuery UI 1.10, feel free to leave a comment below. Thank you.

SQL Server Interview Question and answers: - How does index affect insert, updates and deletes?

SQL Server Interview Question and answers: - How does index affect insert, updates and deletes?:
First let me give a short answer so that you can please the interviewer and get your job. If you are inserting heavy data on table which have clustered indexes that will lead to page split. Due to heavy page splits the performance can degrade. So a proper balance of indexes should be maintained for tables which are heavy in transactions and have clustered indexes created.

Now let’s go for a big explanation of what exactly is a page split.

Indexes are organized in B-Tree structure divided in to root nodes, intermediate nodes and leaf nodes. The leaf node of the B-tree actually contains data. The leaf index node is of 8 KB size i.e. 8192 bytes. So if data exceed over 8 KB size it has to create new 8 KB pages to fit in data. This creation of new page for accommodating new data is termed as page split.

Let me explain you page split in more depth. Let’s consider you have a simple table with two fields “Id” and MyData” with data type as “int” and “char(2000)” respectively as shown in the below figure. “Id” column is clustered indexed.

That means each row is of size 2008 bytes (2000 bytes for “MyData” and 8 bytes for “Id”).




So if we have four records the total size will be 8032 bytes (2008 * 4) that leaves 160 bytes free.Do looat the above image for visual representation.

So if one more new record is added there is no place left to accommodate the new record and the index page is forced to go for an index page split.





















So the more we have page splits, the more the performance will be hit as the processor has to make extrefforts to make those page split’s, allocate space etc.

Here’s a awesome video on one more tough SQL Server interview question: -What are CTE (Common table expression) ? , you watch the same from by clicking on



Taken from the best selling SQL Server interview question book, you can see more about the book by clicking on  SQLServer interview questions book Dotnet interview questions and answers book  

See more stuffs on  SQL server interview questions

Regards,

Click here to view more SQL server interview questions and answers .




C# and ASP.NET MVC (Model view controller) interview questions and answers:- What are MVC partial views and how can we call the same in MVC pages?

C# and ASP.NET MVC (Model view controller) interview questions and answers:- What are MVC partial views and how can we call the same in MVC pages?:
ASP.NET MVC (Model view controller) partial view is a reusable view (like a user control)which can be embedded inside other view. For example let's say all your pages of your site have a standard structure with left menu,header and footer as shown in the image below.



For every page you would like to reuse the left menu, header and footer controls.So you can go and create partial views for each of these items and then you call that partial view in  the  main view.

When you add a view to your project you need to check the “Create partial view” check box.



Once the partial view is created you can then call the partial view in the main view using "Html.RenderPartial" method as shown in the below code snippet'










Below is an important SQL server interview question and answers video:-




Do visit us for c#  and ASP.NET MVC interview question and answers

See more stuffs on C#/ASP.NET interview questions 

Regards,

Click here to see more C# and ASP.NET interview questions and answers

Important SQL Server interview questions on data types: - How many bytes does “char” data type consume as compared to “nchar” data type?

Important SQL Server interview questions on data types: - How many bytes does “char” data type consume as compared to “nchar” data type?:

“char” data types consumes 1 byte while “nchar” consumes 2 bytes. The reason is because “char” stores only ASCII characters while “nchar” can store UNICODE contents as well.

In case you are new to ASCII and UNICODE. ASCII accommodates 256 characters i.e.english letters ,punctuations , numbers etc.But if we want to store a Chinese character  or some other language characters then  it was difficult to the same with ASCII  , that’s where UNICODE comes in to picture. An ASCII character needs only 1 byte   to represent a character while UNICODE needs to 2 bytes.

One of my SQL Server friends who had gone for a SQL interview was grilled , whether we can update SQL Server views , I have tried to answer this question here with a video


The above question I have extracted from near to heart book
SQL Server interview questions By Shivprasad koirala by BPB publication

Regards,
Click to view more from authors on SQL Server interview questions and answers



What is BI Semantic model (BISM) in SQL Server 2012?

What is BI Semantic model (BISM) in SQL Server 2012?:




Some days back I was installing SQL Server 2012 enterprise service pack 1. During installation when I was running through the setup, it gave me two options (multi-dimensional and tabular) of how I want to install SQL Server analysis service. Below is the image captured while doing installation



At the first glance these options are clearly meant to specify how we want the model design for our analysis service.

Now the first option i.e. “MultiDimensional” was pretty clear as I have been using them right from SQL Server 2005 till today i.e. (Star schema or Snow flake).

After some googling and hunting I came to know about the second option. Let me throw some light on the same and then we will conclude what is BISM.

Now overall we have two kinds of database systems , one is OLTP system where the database design thought process is in terms of tables and normalization rules ( 1st normal form , second normal form and third normal form  database design ) are followed.

The second kinds of systems are OLAP system’s where we mostly design is in terms of fact tables and dimension tables. Cube which is a multi-dimensional view of data is created properly if you design your database as OLAP system.

So in simple words we need to create a DB with OLAP design to ensure that proper cubes structure is created.



Now some times or I will say many times it’s really not feasible to create different structures and then create cubes from them. It would be great if SSAS gives us some options where we can do analysis straight from normalized simple tables.

For instance take simple end users who use “power pivot”. It’s very difficult for them to make understand OLAP models like dimension and fact tables. But yes they do understand tables with rows and columns.  If you see Microsoft excel the format is in terms of tables which have rows and columns and these end users are comfortable with a tabular structure.

 Below is a simple image of how simple end user visualize data in excel i.e. tabular – rows and columns.




That’s where exactly the second option i.e. the “Tabular” mode comes in to picture.

So if we put in simple words BISM (Business intelligence semantic model) is a model which tries to serve simple users / programmers who are comfortable with tabular structure and also maintains professional OLAP models for corporate.



So BISM is a unifying name for both Multi-dimension and tabular models.  So if you are personal BI person who loves ADHOC analysis, you can use power pivot or SSAS tabular IDE to do analysis. And if you are person who is working on a corporate project then Multi-dimension model is more scalable and worth looking in to.



Just a last quick note this is also a favorite SQL Server interview question which is making rounds now a days when SQL Server 2012 topic is discussed.

With all due respect to my publisher I have taken the above answer from my book SQL Server interview questions and answers.

You can also see my blog which has some important for SQL Server interview questions on Colaesce. 

You can also see my video on Can views be updated (SQL Server interview questions) ?



C# and .NET interview question: - What are symmetric and asymmetric algorithms?

C# and .NET interview question: - What are symmetric and asymmetric algorithms?:

Simple but important .NET / c# interview question.

Symmetric and Asymmetric are encryption algorithms. In Symmetric we have one key which encrypts messages and the same key helps to decrypt the message. In Asymmetric there are two keys public key and private key. Public key helps to encrypt message and private keys helps to decrypt the message. Everyone has the public key but the private key is held only by the authorized authority


         

Taken from the best selling interview question book .NET interview question by Shivprasad koirala.























.NET Framework 4.5 Multi-Threaded Globalization

.NET Framework 4.5 Multi-Threaded Globalization: Eric Vogel shows you how to use the CultureInfo API in .NET Framework 4.5 to simplify localization in a multi-threaded application.

.NET 4.5 TypeInfo Reflection

.NET 4.5 TypeInfo Reflection: The .NET 4.5 Framework includes some changes to the typical reflection use cases. Most importantly, the Type object has been split into two separate classes: Type and TypeInfo. Find out how and when to use each.

Could not find a part of the path ... bin\roslyn\csc.exe

I am trying to run an ASP.NET MVC (model-view-controller) project retrieved from TFS (Team Foundation Server) source control. I have added a...