This is a mirror of official site: http://jasper-net.blogspot.com/

Encrypting File System in Windows XP and Windows Server 2003

| Wednesday, April 20, 2011
Abstract

Microsoft® Windows® XP and Windows Server 2003 provide many enhancements in the area of data protection— especially Encrypting File System (EFS). This article provides a technical walkthrough that illustrates how to use important data recovery and protection features in various Windows platforms. Also included are best practices and the steps needed to build an effective data recovery and protection strategy.

On This Page

Introduction

Microsoft® Windows® XP and Windows Server 2003 provide significant advancements in data recovery and protection and private key recovery. Microsoft Windows 2000 introduced the capability for data protection and protected data recovery with the implementation of Encrypting File System (EFS), and this capability has been enhanced in Windows XP and Windows Server 2003.

EFS—in Windows 2000, Windows XP and Windows Server 2003—supports the use of data recovery agents (DRA) to decrypt files that have been encrypted by other users.

This article is intended to assist system architects and administrators in developing best practices for creating data recovery and data protection strategies using Windows XP and Windows Server 2003.

In addition to explaining strategies for data recovery and data protection in Windows XP, this article includes many step-by-step examples that illustrate how to set up the data recovery and data protection features you'll want to use when deploying a Windows XP data recovery and protection solution.

The main topics discussed include:

EFS Enhancements in Windows XP and Windows Server 2003

Data Recovery Overview

Data Recovery Using EFS

Data Recovery—Best Practices

Data Protection—Best Practices

Data Recovery Versus Key Recovery

Troubleshooting

Note EFS is not available in Windows XP Home Edition.

Read more: Technet

Posted via email from Jasper-net

MSBuild Extension Pack April 2011 Release - “If you MSBuild it, they will…”

| Tuesday, April 19, 2011
“The April 2011 release of the MSBuild Extension Pack is now available for download.

The April 2011 release contains

version 3.5.9.0 for those using .Net 3.5
version 4.0.3.0 for those using .Net 4.0
This release consolidates 40+ change sets and contains the following high level changes

Around 20 new Tasks / TaskActions
Around 19 improvements covering Documentation, new attributes and behaviour
Around 5 bug fixes
32-bit and 64-bit installers
Zero backwards compatibility breaks 

Posted via email from Jasper-net

MIX'11: более сотни видео докладов доступны для загрузки

| Monday, April 18, 2011
8fe1ef71d15225f6e5d72e0e1c769ed7.png

Состоялась конференция MIX’11, которая принесла массу анонсов и новостей по мобильным и веб-технологиям. Подробнее об анонсах можно прочитать тут: первый день и второй день.  В ходе MIX’11 было прочитано более ста двадцати технических докладов на десятки тем разработки, дизайна, технологий. Ознакомиться с темами докладов с группировкой по технологиям можно в этой записи.

Очень приятно, что организаторы конференции не замедлили с обработкой материалов. Уже сейчас через несколько дней опубликовано более сотни видео докладов в HD-качестве и с удобным представлением докладчика и его доклада одновременно:

Read more: microGeek

Posted via email from Jasper-net

Glimpse - серверный "firebug" для проектов ASP.NET

|
Разработчики ASP.NET получили уникальный инструмент, который может облегчить их жизнь. Проект с открытыми исходными кодами Glimpse созданный энтузиастом веб-разработки предлагает то, что можно назвать серверным вариантом популярного средства отладки firebug (расширение для Firefox).

Glimpse – это расширение, которое можно добавить в проект на базе ASP.NET и получить богатую отладочную серверную информацию во время работы веб-приложения.

0f0e0516977ab57ae9208e661547ffcb.png

Панель представленная на рисунке устанавливается с помощью букмарклета для любого браузера. Она предлагает массу важной информации о работе приложения на серверной стороне. В том числе:

конфигурация веб-приложения;
значение переменных окружения и информация о .NET-сборках;
информация о этапах выполнения жизненного цикла приложения в ответ на запрос;
информация о используемых маршрутах ASP.NET при работе приложения;
параметры HTTP-запросов;
параметры сессий ASP.NET  и значения сохраненные в них;
параметры и жизненный цикл представлений ASP.NET;
отслеживание и работа с Ajax-запросами.

Read more: microGeek

Posted via email from Jasper-net

C++0x - the next ISO C++ standard (c) Bjarne Stroustrup

|
This document is written by and maintained by Bjarne Stroustrup. Constructive comments, correction, references, and suggestions are of course most welcome. Currently, I'm working to improve completeness and clean up the references.

C++0x is the next ISO C++ standard. Currently a draft is available for comments. The previous (and current) standard is often referred to as C++98 or C++03; the differences between C++98 and C++03 are so few and so technical that they ought not concern users.

The final committee draft standard is currently (March 2010) being voted on by the national standards bodies. After that there will be more work before all comments have been addressed and the ISO bureaucracy satisfied. At the current stage of the proceedings, no features (even very minor ones) are expected to be added or removed. The name "C++0x" is a relict of the days where I and others, hoped for a C++08 or C++09. However, to minimize confusion, I'll keep referring to the upcoming C++ standard with the feature set defined here as C++0x. Think of 'x' as hexadecimal (most likely 'B', i.e. C++11).

If you have comments on C++0x, please find some member of your national standards body -- or a member of any standards body -- to send your comments to. That's now the only way and will ensure that the committee doesn't have to deal with many very similar comment. Remember, the committee consists of volunteers with limited time and resources.

All official documents relating to C++0x can be found at the ISO C++ committee's website. The official name of the committee is SC22 WG21.

Caveat: This FAQ will be under construction for quite a while. Comments, questions, references, corrections, and suggestions welcome.

Purpose

The purpose of this C++0x FAQ is
To give an overview of the new facilities (language features and standard libraries) offered by C++0x in addition to what is provided by the previous version of the ISO C++ standard.
To give an idea of the aims of the ISO C++ standards effort.
To present a user's view of the new facilities
To provide references to allow for a more in depth study of features.
To name many of the individuals who contributed (mostly as authors of the reports they wrote for the committee). The standard is not written by a faceless organization.
Please note that the purpose of this FAQ is not to provide comprehensive discussion of individual features or a detailed explanation of how to use them. The aim is to give simple examples to demonstrate what C++0x has to offer (plus references). My ideal is "max one page per feature" independently of how complex a feature is. Details can often be found in the references.

Posted via email from Jasper-net

Live Stereoscopic 3D

|
Project Description
Watch live stereoscopic 3D in Silverlight using 2 webcams and the MMP Player Framework (formerly known as the Silverlight Media Framework). This project includes a new plugin that can be easily combined with the new S3D feature relesed in version 2.5 of the MMP Player Framework.

Run the Live S3D web app

Note: there are no binary downloads for this project, either open the web app above or download the source

Read more: Codeplex

Posted via email from Jasper-net

WCF Support for xs:date

|
Introduction

Despite the fact that WCF technology is powerful and flexible, there are some areas requiring improvement. In this article, I'll show issues related to webservice date format interoperability and how it can be solved.

Background

My company is a financial institution which has many different applications exchanging data. Most of these applications are implemented in Java while mine exposes webservice implemented in WCF .NET.

To exchange dates, I’ve proposed an xs:dateTime format. This is because then I was not aware about the peculiarities of this type.

First issue: UTC format. When I was testing webservice with soapUI, I entered manually 1969-03-17T00:00:00.000+01:00 as an input argument for 1969-03-17 date of birth. Everything was fine. However when the actual webservice client sent 1969-03-16T23:00:00.000Z (equivalent datetime in UTC format), then it appeared that .NET treated this as 1969-03-16 date (one day shift).

One more explanation: I’m working in Poland, so the winter time is GMT+1 and summer time is GMT+2 CET zone with daylight savings time.

So it looks like UTC time is not correctly handled. Fortunately, a simple workaround exists:

if (date.Kind == DateTimeKind.Utc) 
   date = date.ToLocalTime()    

Read more: Codeproject

Posted via email from Jasper-net

Cinux

|
Cinux is a Linux based Operating System currently running a TUI. A GUI is being planned (GNOME) compiled, built and packaged at the moment. 

Cinux has a "Lite" version, it's only 135MB and is under version 0.1 Alpha. It won't be released to public since the first public alpha version will be 0.3 Alpha

Cinux was created and built by Constantine Apostolou and is released under GNU GP Licence

Read more: Codeplex

Posted via email from Jasper-net

Closures in CSharp

|
Closures are an interesting feature for a language. I have heard a lot of questions around how we can declare closures in C# and hence I thought to start a blog on it. Over the internet, there are lots of examples on closures available which are taking help of functional languages like F#, yes it is very important in perspective of these languages as those are easy to declare and also inherently supported yet other languages like C# or VB.NET can also take help of these feature. Lets take a look how C# can take help of closures in this post.

What is a Closure? 

Closures may be defined as a set of behaviour or instructions that are encapsulated as an object such that it could be sent to other object yet can hold the context of the caller.  In other words, a closures are special object that are encapsulated into an object but can hold the context of the caller.

In C# we define closures using delegates. In C# 3.0 we have language support to easily declare a delegate in a program. This widely increases the use of delegates in the program using lamda expressions. Lets put the closures in terms of some examples.

static void Main(string[] args)
{

    int i = 20;
    Action myAction = () => Console.WriteLine("value of i = {0}", i);

    Program.RunMe(myAction);
    Console.ReadLine();

}

public static void RunMe(Action myaction)
{
    if(myaction != null)
        myaction();
}

When you run the above code, you will find that the 20 will be printed on the screen which is run from the method RunMe. Yes, the lamda expression ensures that the instruction set which it specifies is encapsulated within a closure so that the object could be sent on any other objects. As you can see, I am using the contextual variable i from within the RunMe method, hence you can say that myAction forms a closure in C#.

Read more: DOT NET TRICKS

Posted via email from Jasper-net

Silverlight 3D: Using Plane Projection

|
In this article, we will see how to use 3D Plane Projection in Silverlight. For this demonstration I am using the following controls – 1) Border 2) DataGrid 3) Chart control from Silverlight toolkit and 4) Hyperlink button.
I am also using two story boards for creating a ‘Double Animation’.

So the first step is to create a Silverlight project. I am fond of Microsoft Expression Blend, although I am not a good designer :) Anyways, once you create a Silverlight project, add a class with the name ‘CustomerSales’ and add few properties to the same class as shown below –

image%5B4%5D.png?imgmax=800

In this demonstration I am showing some sales records for different cities. Once you click the row, the total sales for Q1, Q2, Q3 and Q4 is shown in a chart format with some nice animation using Silverlight Plane Projection.

Now let’s import two namespaces in our sample as shown below – 

image%5B10%5D.png?imgmax=800

Now go to your MainPage.xaml and replace <Grid></Grid> with the code shown below – 

<UserControl.Resources> 
<Storyboard x:Name="salesDGRowSelected"> 
    <DoubleAnimation Duration="0:0:3" To="-50" 
        Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" 
        Storyboard.TargetName="dgAllSales" d:IsOptimized="True"/> 
    <DoubleAnimation Duration="0:0:3" To="0" 
        Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" 
         Storyboard.TargetName="border" d:IsOptimized="True"/> 
    <DoubleAnimation Duration="0:0:3" To="1" 
        Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border" 
        d:IsOptimized="True"/> 
    <DoubleAnimation Duration="0:0:3" To="-30" 
        Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" 
        Storyboard.TargetName="border" d:IsOptimized="True"/> 

Read more: DevCurry

Posted via email from Jasper-net

Android Proxy Configuration for Emulator[Solved]

|
Introduction

This is a post for all those working on Android and wanting to access the internet over Android.
Just follow these simple steps:

  • First of all, open cmd.
  • Move to tools directory of your Android folder. For example, in my case:
  • :cd E:/Downloads/software/android-sdk-windows/tools/
  • Run the Android (Do so by eclipse or using Android.bat).
  • Now when you have reached the menu screen of Android, then type adb shell in cmd.
  • Your prompt should change like #
  • Now type:
    sqlite3 /data/data/com.android.providers.settings/ databases/settings.db
    • Now your command prompt will look like sqlite>
    • Enter this command where Proxy IP is the IP of your Proxy server and port is its port value.
    INSERT INTO system VALUES(99,’http_proxy’,'Proxy IP:port’);
    • Check your entry by typing:
    select * from system;
    • If you found your entry, then move over to your Android mobile.
    • Click the home button.
    • Click on menu button.
    • Click on settings.
    • Click on wireless control.
    • Click on mobile networks.
    • Click on access point name.

    Read more: Codeproject

    Posted via email from Jasper-net

    /Platform:AnyCPU, /Platform:x64, /Platform:x86, what do they mean

    |
    When we build a .net solution, we often see the Platform choice in the configuration manager:

    image_1B2789E4.png

    Besides AnyCPU, other choices are x86 ,x64, and Itanium. What do they mean? According to MSDN, “Anycpu” compiles the assembly to run on any platform while the other 3 choices compiles the assembly for 32 bit, 64 bit x64 and 64bit Itanium respectively.

    On a 64-bit Windows operating system:

    Assemblies compiled with /platform:x86 will execute on the 32 bit CLR running under WOW64.

    Executables compiled with the /platform:anycpu will execute on the 64 bit CLR.

    DLLs compiled with the /platform:anycpu will execute on the same CLR as the process into which it is being loaded.

    If a .net application uses any 32 bit ActiveX component, it will not be able to load the component in-process. We have two choices:

    Host the 32 bit component in an external process, such as COM+ Server Application, or Run the .NET application as a 32 bit application.
    The VBScriptTest project in ASP Classic Compiler contains an unmanaged test. It hosts the msscript.ocx so that I can compare my .net implementation of VBScript against the original VBScript engine from Microsoft. In order to use the 32 bit msscript.ocx, I need to run my unit test in a 32 bit process. NUnit has a 32 bit version of the test runner call NUnit-x86.exe. To use the 32 bit runner, I registered new shell extension as shown below so that I can use the “Run 32 bit NUnit” context menu to invoke the 32 bit NUnit test:

    image_3991CACD.png

    Lastly, how to run ASP.NET in 32 bit? It turned out that this is controlled by the Application Pool. If I set the “Enabled 32 bit Application” to true in the Advance Property Setting of the application pool, the ASP.NET application will run in 32 bit.

    Read more: Li Chen's Blog

    Posted via email from Jasper-net

    The BackgroundWorker Class in C#

    |
    This class assists us with running separated threads in our code. The following video clip explains and shows that.

    Read more: Life Michael

    Posted via email from Jasper-net

    Moonlight on Android

    | Sunday, April 17, 2011
    For the past week, the Moonlight team has been busy porting Moonlight to Android devices and today, showed it off at Mix 11. The video shows Moonlight running on both a Motorola Xoom tablet and a Nexus S phone. Keep in mind that we're still in the early phases of porting and there's still a lot of work left to do before we can ship a product, but it's still exciting! 
    Update: For those of you reading my blog from Planet GNOME (or some other planet that doesn't show the video above), you can find it here, on YouTube.

    Read more: A Moment of Zen

    Posted via email from Jasper-net

    Vagrant

    |
    Vagrant is a tool for building and distributing virtualized development environments.

    By providing automated creation and provisioning of virtual machines using Oracle’s VirtualBox, Vagrant provides the tools to create and configure lightweight, reproducible, and portable virtual environments. For more information, see the part of the getting started guide on ”Why Vagrant?”

    Are you ready to revolutionize the way you work? Check out the getting started guide, the getting started video.

    Your First Vagrant Virtual Environment

    $ gem install vagrant
    $ vagrant init
    $ vagrant up

    These four commands alone will automatically download and create a bare bones Ubuntu-based server running in the background. Sure, that on its own isn’t that amazing, but imagine running a single vagrant up and having a fully featured web development environment running! This is all possible with Vagrant.

    Feature List
    This is a compact feature list of Vagrant. For more information on any of the specific features, read the getting started guide.
    • Automated virtual machine creation using Oracle’s VirtualBox
    • Automated provisioning of virtual environments using Chef or Puppet.
    • Full SSH access to created environments
    • Assign a static IP to your VM, accessible from your machine
    • Forward ports to the host machine
    • Shared folders allows you to continue using your own editor
    • Package environments into distributable boxes
    • Completely tear down environment when you’re done
    • Easily rebuild a complete environment with a single command

    Read more: Vagrant

    Posted via email from Jasper-net

    Code Contract Performance Analysis

    |
    Introduction

    I found the article about code contracts in this month's MSDN very exciting. I was unaware of this feature of .Net 4.0 before reading the article, and as the manager of a team of developers who maintain a very large, complex application I am always interested in techniques that improve code quality and correctness. I won't rehash the interesting details about code contracts in this article. Go read the MSDN article first or this Code Project introduction. The basics are all there. Then go here to the Microsoft DevLabs page with the download you'll need to run the code below.

    My first thought when reading the MSDN article was that the benefits must come at some price, and my initial concern was an impact on performance. Contracts are enforced at run-time by inserting custom code at compile time, and whenever some other process is adding code to mine I worry about hidden performance costs.

    I wrote the small app below to get some metrics and assess how expensive contracts are compared to the other techniques that can be used to validate pre and post execution conditions.

    Using the code

    The author of the MSDN article used a trivial calculator function to highlight the benefits of contracts. I'll use the same basic function here:

    private static Int32 Add(Int32 x, Int32 y) {
       if (x == y)
          return x * 2;

       return x + y;
    }

    The extra if statement in there is just to reinforce the difficulty of adding post-condition checking everywhere in your code where you have premature exits. I'm going to leave it here for the analysis.
    "If-Then-Throw"

    One way to check pre and post conditions is to use explicit if statements to validate your input parameters and output results. All of the pre and post conditions we're adding here are perfectly arbitrary, but will naturally be consistent in all the examples.

    private static Int32 IfCheckedAdd(Int32 x, Int32 y) {
       if (x < 0) // Arbitrary pre-condition
          throw new InvalidOperationException("X must be greater than 0");

       if (x == y) {
          if (x * 2 < 0) // Arbitrary post-condition
             throw new InvalidOperationException("Result must be positive");

          return x * 2;
       }

       if (x + y < 0) // Same arbitrary post-condition
          throw new InvalidOperationException("Result must be positive");
                
       return x + y;
    }
    Debug.Assert

    Another way is using Debug.Assert()

    private static Int32 AssertCheckedAdd(Int32 x, Int32 y) {
       System.Diagnostics.Debug.Assert(x >= 0);

       if (x == y) {
          System.Diagnostics.Debug.Assert(x * 2 >= 0);

          return x * 2;
       }

       System.Diagnostics.Debug.Assert(x + y >= 0);
       return x + y;
    }
    Contracts

    And the last method to examine is the interesting new one, code contracts:

    private static Int32 ContractCheckedAdd(Int32 x, Int32 y) {
       Contract.Requires(x >= 0, "X must be greater than 0");
       Contract.Ensures(Contract.Result<Int32>() >= 0, "Result must be positive");

       if (x == y)
          return x * 2;

       return x + y;
    }

    One of the benefits to contracts being that you don't have to worry about where you exit. All of your post checking conditions are centralized at the top of the method.

    Read more: Codeproject

    Posted via email from Jasper-net

    Windows 8 to feature USB-runnable Portable Workspaces, sales of 16GB thumb drives set to soar

    |
    win8-2011-04-15-600.jpg

    There are endless flavors of "Linux on a stick," tasty downloadable versions of that OS which run from removable storage and let you take Linus' progeny for a spin without dedicating any of your partitions to the cause. There have been ways of making this work with Windows, too, but now Microsoft is getting into the game properly. That leaked version of Windows 8 we looked at recently contains a feature called Portable Workspaces, which enables you to take a 16GB (or greater) external storage device and dump a bootable, runnable copy of Win 8 on there. It remains to be seen just how many copies one could create, and whether they ever expire or, indeed, whether they can themselves be copied onto an HDD like a ghost image, but it's easy to see this as a boon for support personnel. Well, support personnel of the future, anyway.

    Read more: Engadget

    Posted via email from Jasper-net

    Create a Windows Service in .NET That Can Also Run as Console Application

    |
    I’m creating a simple windows service using Visual Studio 2010 and .NET 4.  I want to be able to easily test it by simply running the resulting exe without the need to install the service.  I did some research on this topic and found three helpful articles:
    • HybridService: Easily Switch between Console Application and Service (on CodeProject)
    • Run Windows Service as a console program
    • Creating a windows service in visual studio 2010 (in VB)
    I found that the first article was a bit more work than the second.  In the end, I pretty much combined the latter two articles’ approaches and created a simple template (in C#) that can be used as a starting point for any long-running windows service.  It’s still a work in progress, but I figure this will probably give some folks a head start and also is an opportunity for folks to tell me what I’m doing wrong.

    To start, create a new Windows Service Project:

    SNAGHTML14f68ce_1.png

    Read more: Steve Smith

    Posted via email from Jasper-net

    VimeoDotNet

    |
    Project Description
    VimeoDotNet is a wrapper for Vimeo Advanced API. It supports almost all of Advanced API's methods and provides them in a .net friendly way. 
    VimeoDotNet is the engine behind the "Vimeo for Windows" project.

    This project is based on Rob Green's Vimeo Advanced API C# Wrapper (http://www.robgreen.me/post/Getting-Started-With-The-Vimeo-API-in-C.aspx)

    Read more: Codeplex

    Posted via email from Jasper-net

    VMware Unveils Open Source PaaS Cloud Foundry

    |
    VMware has today announced the launch of an open source "Platform as a Service" (PaaS), Cloud Foundry.

    "The shift to cloud computing is fundamentally transforming what businesses and consumers expect from applications, profoundly challenging traditional application development and infrastructure," said Tod Nielsen, Co-President, Application Platform at VMware, quoted in the company's press release. "Cloud Foundry delivers a dramatically simplified approach that embraces the diversity and speed of modern development that is at the heart of today's most successful applications while exploiting key trends in mobile, social and cloud computing."

    VMware says the distinguishing features of the Cloud Foundry platform include the fact that it is built to be “multi-cloud”, to work between private and public environments, and the fact that it is built to work with a wide variety of application frameworks and development tools.

    The platform lets you build applications with Java and other JVM-based frameworks such as Grails and Roo, Rails and Sinatra for Ruby (supported Ruby versions are 1.8.7 and 1.9.2) and Node.js. The platform plugs into application services such as RabbitMQ and GemFire, both now owned by VMware. RabbitMQ is an open source messaging platform, while GemFire provides distributed data management. Cloud Foundry also supports MySQL, MongoDB and Redis, with plans to add support for VMware's own vFabric application services.

    Jerry Chen, Senior Director of Cloud and Application Services at VMware, told us that from a Java point of view any application that can be packaged as a WAR file and deployed to a servlet container should run on Cloud Foundry. The product does not support Java EE applications however.

    The code is available on GitHub under an Apache 2 license, and VMware has launched a beta service based on the code at cloudfoundry.com.

    During the webcast VMware also demonstrated a single-developer instance of Cloud Foundry on a virtual machine. Referred to as Micro Cloud, the product will be available Q2 2011. Chen confirmed to InfoQ that a version of this product would also be offered as open source.

    Read more: InfoQ

    Posted via email from Jasper-net

    RtAudioNet

    |
    Project Description
    RtAudio .Net is a managed C++ wrapper around the unmanaged RtAudio C++ Library. 

    It's tested and used mainly in C#.

    Original RtAudio:

    About
    This is a Managed C++ DLL that wraps RtAudio. Since it's my first .Net wrapper (and I'm not that clever with C++ in general), it's more a half port, rather than just a simple wrapper. My goal is to keep the syntax as close to RtAudio as possible, but I intend to break away from that in any instances that would greatly ease use in .Net.

    It should also be noted that since I'm a C# developer and find VB.Net to be syntactically obtuse and unusable, this wrapper really is only tested in C#. I may include an IronPython sample at some point later. As for Mono support, that's 'planned'. I'm an avid Linux user, however, this is mostly developed in conjunction with my work, sadly. I haven't had time to sort through getting this to compile in mono. Since I'm using VS2010 for all my development, and I can use .Net 4.0 everywhere, this wrapper is written in .Net 4.0. I may, at some point, provide 3.5 bindings, but I doubt I'll go lower than that. And, really, by the time I get around to it, most people shouldn't be stuck on 3.5 anymore.

    Read more: Codeplex

    Posted via email from Jasper-net

    New Silverlight 5 Video Tutorial: How to Create Implicit DataTemplates

    |
    Hello All!

    Silverlight 5 Beta just came out yesterday and I am jumping on it with my first video tutorial. 

    In this  short 12 minute video I show you how to:

    1. Create a custom DataType called Developer. 

    2. How to create an ObservableCollection of Developers and then turn that into a DataSource. 

    3.  How to bind that DataSource to a ListBox and define a DataTemplate that describes how to show the data (namely a TextBlock for the name and an Image for a picture of the developer). 

    4. How to remove that DataTemplate and add it to App.xaml and define a new property called a DataType. 

    You will then see how Silverlight 5 will automatically find that DataTemplate anytime you are displaying that custom DataType.

    Posted via email from Jasper-net

    Chrome Password Recovery Tool

    |
    Project Description
    An open source tool for recovering passwords from Google Chrome, for use when migrating to a new PC, etc.

    This is a command line tool for now.

    The initial blog post about this project can be found here: http://www.driis.dk/2008/12/Introducing-The-Google-Chrome-Password-Recovery-Tool. The download links on that page are no longer active, please download from CodePlex.

    Read more: Codeplex

    Posted via email from Jasper-net

    The Big Split: Mono 2.10 Debian Packaging

    |
    Most probably haven't noticed yet but I finished the Mono 2.10.1 debian packaging effort of the past 3 months and uploaded it to Debian/Experimental.

    With Mono 2.10 I had to make the biggest changes in Mono packaging since the big Mono 2.0 upload. The runtime no longer supports the 1.0 and 2.0 runtime profile, instead it now supports the 2.0 and 4.0 runtime profile. This meant I had to drop all libmono*1.0-cil packages and add libmono*4.0-cil packages. This sounds like a lot of s/1.0/4.0/ work but it actually wasn't. Mono 2.10 ships a lot of new libraries over 2.6 and I had again to decide where they should go. "Where should this $library go?" I have been playing this game for the past 7 years maintaining Mono and I finally gave up on it... What, where, when, why? I could give now a 2 hours talk of the issues behind the current packaging approach (keeping the number of library packages low) but instead I will do something else. Please, just take a look at this picture for a second:

    Read more: Hacking is Art

    Posted via email from Jasper-net

    Every entrepreneur’s looming problem: Which platform?

    |
    So we had a great idea, we developed the core system for 4 months, raised money and even gathered our core R&D Ninjas. Like every startup our focus kept shifting both before we launched and before starting our   Lean circle. I don’t know if the more experienced founders face this problem (I’m quite sure they do) but we are now facing the biggest problem a startup in 2011 has -‐ on which platform should we build our service?

    This question may sound a bit funny to some of you but trust me it isn’t. Ages ago (3‐4 years) it was very clear which platform to use for your startup – and for the majority of us the answer would have been “yourGreatIdea.com”. In 2011 all the different platforms are evolving at an exponential rate and you can’t ignore them. Just think about it: web, iPhone apps, Facebook apps, Android apps, Twitter apps, tablets and probably a few more I’ve left out. (BTW there is a really interesting video with Mark Zuckerberg talking about this,forward to 4:30).

    So we are in the office brainstorming (playing Wi , but don’t tell our investors) and suddenly my co‐founder, Omri, is saying how great our product would be on mobile devices and starts talking about the advantages. Suddenly we find ourselves in a 2 hour debate discussing Yotpo’s Android app, the tablet version and so on. So we realized we can’t ignore all the platforms but on the other hand we are just 5 people and like many smart people have said: “Do one thing but do it good”.

    Read more: TNW Entrepreneur

    Posted via email from Jasper-net

    Using Async for Multi-Threading (Alan Berman)

    |
    Asynchronous programming has been around for awhile in Visual Studio.  The new Async CTP feature, with the Await statement, provides a simpler, more organized code pattern than existing alternatives for asynchronous programming.  A big side-benefit that falls out is that the same code pattern can be used to implement some types of multi-threading.
     
    Asynchronous processing allows the program to continue executing during a long wait, such as during data requests over the internet.  Multi-threaded processing helps to optimize code execution for a large number of very short waits, such as data requests from a local hard drive.  Multithreading also gives Windows the discretion to assign each thread to a different processor core. The differences are also discussed in the Async Feature Control Flow blog.

    Doing multi-threading with the Await statement can simplify your code, and result in a code base that uses a single pattern for asynchronous and multi-threaded code.  Someone looking at your code later on won't need to refresh their memory on the nuances of thread synchronization.
     
    Caveat:  If you have a large-scale application, or one that needs to be highly optimized, it may be better to continue to multi-thread using System.Threading types.  The Await statement has additional overhead to store and retrieve a state machine.  You can create metrics to compare two techniques.
     
    This is an example of conventional processing with threads.  It uses an AutoResetEvent for thread synchronization.

    Imports System.Threading
     
    Module Module1
     
        Sub Main()
            ' Process using threads.
            ProcessWithThreads()
     
            Console.WriteLine("done")
            Console.ReadKey()
     
            ' Output:
            '  starting worker thread
            '  main thread processing
            '  worker thread processing
            '  sending signal in worker thread
            '  received signal in main thread
            '  done
        End Sub
     
        Private autoEvent As New AutoResetEvent(False)
     
        <MTAThread()> _
        Private Sub ProcessWithThreads()
            Console.WriteLine("starting worker thread")
     
            ThreadPool.QueueUserWorkItem(AddressOf ThreadWorker, autoEvent)
     
            Console.WriteLine("main thread processing")
     
            ' Wait for work method to signal.
            autoEvent.WaitOne()
            Console.WriteLine("received signal in main thread")
        End Sub
     
        Private Sub ThreadWorker(ByVal stateInfo As Object)
            Console.WriteLine("worker thread processing")
     
            ' Do some work.
            Thread.Sleep(1500)
     
            ' Signal that work is finished.
            Console.WriteLine("sending signal in worker thread")
            CType(stateInfo, AutoResetEvent).Set()
        End Sub
    End Module
     

    The following example is the Async equivalent.  It uses TaskEx.Run to start the worker thread.  The Await statement waits for the worker method to complete.  The fact that the AsyncWorker method is complete signals that the worker thread is complete.

    Imports System.Threading.Tasks

    Posted via email from Jasper-net

    WebSockets in 5 minutes

    |
     HTTP is by design an asymmetric protocol: clients can contact the server whenever they want (without the user having to issue a command, thanks to Ajax requests). The server instead cannot normally send updates at the client at the time of its choosing.

    Connections are made as HTTP requests, GET or POST in nearly all web browsers, from the client to the server, and never the opposite. This mechanism simplifies the protocol in many ways, but raises issues whenever a real-time interaction is desiderable. How to implement a chat in a browser?

    There are some work arounds but...
    The simplest solution is polling the server continuously: every 5 seconds we send a request, and the server tells us which messages are arrived in the chat room. However this raises the load on the server, which must manage a huge number of new connections at the same time.

    A slightly better model is long polling (and other similar techniques which collectively go under the name of Comet), where each connection made by the client is kept open until there are some data to return to the client. The connection may also have a timeout, but it's very simple to just restart one after a 60-second timeout has expired.

    The problem with both styles is that they are not really scalable with the current HTTP servers. Apache dedicates one process to each connection - if you have to keep open a process for every user in a chat, the server will quickly halt. There are however different HTTP servers, like CouchDB and Node.js, which do not allocate multiple processes and are capable of handling this large number of simultaneous open connections.

    WebSockets 
    Since we already have to change some server-side infrastructure to support the server pushing to the client on certain events, let's do it with a standard protocol. HTML 5 WebSockets promise a bidirectional full-duplex connection, which is not closed after the first data returned by the server along with headers, but remains open like any TCP connection.

    Technically speaking in fact, WebSockets are a mechanism for tunneling a TCP connection over HTTP: you can send whatever you want in the communication channel, but the communication is wrapped into a text stream with HTTP headers such as Host and Origin.

    Read more: WebBuilder home

    Posted via email from Jasper-net

    The Case of the Mysterious Law Manager Startup Error

    |
    Getting Law Manager v2.4 to run on Windows 7

    Overview
    Several of my customers run old versions (circa 2003) of a legal case management application called Law Manager, since acquired by Bridgeway. These customers reported that their old versions of Law Manager “don’t work” on Windows 7 and that the vendor did not support running them on Windows 7. Normally, if the vendor of an incompatible app has a newer version that is compatible with Windows 7, we recommend upgrading to the new version. Sometimes, though, customers will choose for various reasons to try to continue using the version they have at least temporarily, even if it means that they will do so without vendor support. This article describes the troubleshooting and remediation steps I performed to get Law Manager working for one of those customers. The incompatibility turned out to be due to a very subtle change in a single registry value. Two different solutions to the problem are provided.

    This case describes troubleshooting and remediation for a specific version of Law Manager. The results may be the same for other legacy versions of Law Manager, but they would each need to be verified separately. Sysinternals SigCheck with the -a command line option reports the following version information for this customer’s copy:

    C:\Program Files\Law Manager, Inc\LawManager.Pro\lm2000.exe: 
        Verified: Unsigned 
        File date: 4:50 PM 10/6/2003 
        Publisher: Law Manager, Inc. 
        Description: LawManager.Pro 
        Product: LawManager.Pro 
        Version: 2.4 Service Pack 1 (204) 
        File version: 2.4 Service Pack 1 (204) 
        Strong Name: Unsigned 
        Original Name: lm2000.exe 
        Internal Name: lm2000.exe 
        Copyright: Copyright ⌐ Law Manager, Inc 1985-2002 
        Comments: leader in premier practice management software for large corporate legal departments, government agencies and multi-office law firms

    The Diagnosis
    After installing Law Manager (with administrative rights), I ran Law Manager from the Start menu as a standard user. It displayed a terse error message and then exited when the dialog was dismissed:

    It turns out that this kind of error message is typical of runtime failures from Borland Delphi applications. As far as I can tell, when a Delphi app triggers an otherwise-unhandled exception, the outermost Delphi runtime code captures the exception, displays an error message like the one shown with an error code and a memory address, then exits. In Pascal and Delphi, error code 204 means “invalid pointer operation”. In addition to the Borland-style UI elements in a working version of Law Manager, I confirmed my suspicion that Law Manager is a Delphi application with the Sysinternals Strings utility:

    strings -q lm2000.exe | findstr /i delp 

    SOFTWARE\Borland\Delphi\RTL 
    Software\Borland\Delphi\Locales 
    Delphi Picture 
    Delphi Component 
    Delphi%.8X 
    Software\Developer Express\Delphi\Design Forms\ 
    Software\Developer Express\Delphi\Design Forms\ 
       | Compilation Flags: Win32, Production, TimerView, Delphi 6.0

    To figure out what the app could be doing that would lead to failure, I turned to Sysinternals Process Monitor, a.k.a. Procmon, the best troubleshooting tool in the universe (well, at least for that part of the universe that runs Microsoft Windows).

    Here is a troubleshooting pattern I use all the time. I started Procmon, which began capturing details about all file system and registry events as well as many types of process and network events. When the error message appeared, I stopped the Procmon trace and dragged the crosshairs “Include Process From Window” icon from the Procmon toolbar to the error message. This feature applies a filter to the results so that Procmon displays only those events associated with the process that owns the window; in this case lm2000.exe, process ID 3600. The events of interest are then usually near the end of the trace, so I went to the end of the trace and worked back. One thing to note is that displaying an error dialog usually involves a number of registry accesses. If the Procmon trace has clues, they usually show up right before the events involved in the error message display.

    It took some digging, but the evidence turned up and can be seen in the following screenshot. The first event shown in the screenshot is a registry value read that appears to be related to COM component invocation. The retrieved value is a REG_EXPAND_SZ – a text string that can contain environment variables that need to be expanded before use: “%SystemRoot%\System32\hhctrl.ocx”. Two events later is an attempt to open a file system folder with the name “C:\Program Files\Law Manager, Inc\LawManager.Pro\%SystemRoot%\System32\”, which of course fails with “PATH NOT FOUND”. Evidently the program failed to expand the environment variable before calling a file system API with the returned data. The program probably also expected the API to succeed because the error and exit followed very quickly.

    7701.ProcmonMainScreen_5F00_thumb.png

    Posted via email from Jasper-net

    Notes on creating a cert for signing code

    |
    Today I spent quite a bit of time fighting with a TFS build server attempting to make it sign a Silverlight xap file.

    Here are some of the things that make it difficult:

    My machine is not on the domain the build server is on
    The build service runs under a service account
    I want to use a self signed cert right now for dev purposes
    Silverlight application in Out of Browser and needs Elevated Trust
    Here are some notes on what I learned while trying to figure this out:

    Regarding #1:  Since my computer is not on the same domain, it didn’t take long to learn that the certificate that Visual Studio creates for you under the ‘Create Test Certificate’ wouldn’t be easy to configure on the build server … or at least I couldn’t figure it out in a hour or so (though now that I’ve got a better understanding, I might be able to). 

    Regarding #2:  All the information I initially found on the internet regarding this situation said to login as the account the build service runs under and register the cert by double clicking it or running the build which would then prompt for the key’s password … this was a no go for me since it runs under ‘Network Service’

    Regarding #3: After doing research, I was starting to think I would need to buy a cert that was from an already registered CA … but did not want to do that due the the cost and time involved.  Plus I knew the VS cert worked locally … there had to be a way to do it on the server too.

    Regarding #4: This is really more the point to the whole story, since the application is an OOB Silverlight application that needs to be signed to upgrade itself successfully (so I’ve read … still need to find that out).

    Tonight I found some good news via these links:

    http://www.digicert.com/ssl-support/pfx-import-export-iis-7.htm (information on the Certificate MMC snapin)

    http://www.inventec.ch/chdh/notes/14.htm (great command line to create a cert using MakeCert)

    I also did a little digging into the Microsoft.VisualStudio.Silverlight.dll with Reflector to see what the VS ‘Create Test Certificate’ button actually does.  Turns out there is an extended property (or maybe just property) of a certificate that says it can be used to sign code (I didn’t know that – I thought a cert was a cert).  You can see that below: (taken from the MMC certificate snapin)

    Read more: Jason Haley

    Posted via email from Jasper-net

    Debug Monitor string

    |
    Introduction

    Code Project is not only distributing millions of programming ideas but it also is reducing coding time. There are a number of classes ready in sample applications which can be used directly in your new application with or without modification, thus it is reducing the time in coding.

    So, I thought let me contribute my code also. Even though it is simple and nothing new, may be it will be useful for others.

    How to hook into debug shared memory

    Trace statement writes in DBWIN_BUFFER shared file. It also uses DBWIN_DATA_READY and DBWIN_BUFFER_READY events to sync read and write operations in shared memory. To read from this shared memory file and signal event, followings function are required.

    SetEvent
    ResetEvent
    CreateEvent
    CloseHandle
    CreateFileMapping
    MapViewOfFile
    UnmapViewOfFile
    WaitForSingleObject

    These functions are in kernel32.dll. There are two options to use this function in managed code.

    COM wrapper - around 20 machine instructions overhead.
    P/Invoke - around 5 machine instructions overhead.
    I chose P/Invoke because it is faster compared to COM wrapper.

    DLLImports

    Here are all the import signatures.

    //SET EVENT

    [DllImport("Kernel32.dll",CharSet=CharSet.Auto)]
    private static extern Boolean SetEvent(IntPtr hEvent);

    //RESET EVENT

    [DllImport("Kernel32.dll",CharSet=CharSet.Auto)]
    private static extern Boolean ResetEvent(IntPtr hEvent);

    //OPEN EVENT

    [DllImport("Kernel32.dll",CharSet=CharSet.Auto)]
    private static extern IntPtr OpenEvent(UInt32 
    dwDesiredAccess,Boolean bInheritHandle,String lpName);

    //GET LAST ERROR

    [DllImport("Kernel32.dll",CharSet=CharSet.Auto)]
    private static extern UInt32 GetLastError();

    //CREATE EVENT

    [DllImport("Kernel32.dll",CharSet=CharSet.Auto)]
    private static extern IntPtr CreateEvent(IntPtr 
    lpEventAttributes,Boolean bManualReset,Boolean bInitialState,String lpName);

    //CLOSE HANDLE

    [DllImport("Kernel32.dll",CharSet=CharSet.Auto)]
    private static extern Boolean CloseHandle(IntPtr hObject);

    //CREATE FILE MAPPING

    [DllImport("Kernel32")]
    private static extern IntPtr CreateFileMapping(IntPtr hFile, 
      IntPtr pAttributes, UInt32 flProtect,UInt32 dwMaximumSizeHigh, 
      UInt32 dwMaximumSizeLow, String pName);

    //MAP VIEW FILE

    [DllImport("Kernel32.dll",CharSet=CharSet.Auto)]
    private static extern IntPtr 
      MapViewOfFile(IntPtr hFileMappingObject, 
      UInt32 dwDesiredAccess,UInt32 dwFileOffsetHigh, 
      UInt32 dwFileOffsetLow,UInt32 dwNumberOfBytesToMap);

    //UNMAP VIEW FILE

    [DllImport("Kernel32.dll",CharSet=CharSet.Auto)]
    private static extern Boolean UnmapViewOfFile(IntPtr lpBaseAddress);

    //WAIT FOR SINGLE OBJECT

    [DllImport("Kernel32.dll",CharSet=CharSet.Auto)]
    private static extern UInt32 WaitForSingleObject(IntPtr hHandle, Int32 dwMilliseconds);

    Hook

    Here is the code to create sync events and to map memory file:

    public bool Initialize(out String szError){
        bool bResult = false;
        szError = "";
         
        //create ready event

        m_hReady = m_oNative.win32CreateEvent(IntPtr.Zero,
                        false,false,"DBWIN_DATA_READY");
        if(m_hReady != IntPtr.Zero)
        {

    Read more: Codeproject

    Posted via email from Jasper-net

    Working with User Names and Roles in Silverlight Applications

    |
    Security is a key component of applications and something that developers often struggle with to get right. How do you authenticate a user? How do you integrate roles and use them to show or hide different parts of a screen? These and other questions commonly come up as I talk with developers working on ASP.NET and Silverlight applications.

    I was recently presenting a workshop on Silverlight at the DevConnections conference in Orlando and had a question from the audience on how I handle security roles in Silverlight applications. Since I had just implemented a security mechanism for a customer I gave a brief response but didn’t have a sample application available to share to point people in the right direction. After the workshop was over I put together a sample application to demonstrate one potential approach for accessing user names and roles. I’ll walk through the sample application in this post and highlight the key components.

    The goal of the post isn’t to dictate how to authenticate users since every application has unique requirements. However, I will discuss general techniques for accessing user names and working with roles to block access to views and show or hide controls.

     

    Security Techniques
    Silverlight applications can take advantage of Windows and Forms authentication techniques and can integrate user roles into the mix as well. However, unless you use WCF RIA Services on the backend you’ll need to write the plumbing code to authenticate a user if you need to do it directly within the application. WCF RIA Services projects provide login and registration screens out of the box that leverage Forms authentication by default. You can view a walk-through of the WCF RIA Services authentication process here http://msdn.microsoft.com/en-us/library/ee942449(VS.91).aspx.

    WCF RIA Services also provides a means for accessing an authenticated user’s user name and roles by using a WebContext object (see http://msdn.microsoft.com/en-us/library/ee707361(VS.91).aspx). This isn’t possible out-of-the-box in a standard Silverlight application unless you write custom code to handle it. If WCF RIA Services is appropriate for your project then it’s a great way to go for data exchange and security tasks. If you won’t be using WCF RIA Services then this post will provide insight into other techniques that can be used.

    Most of the Silverlight Line of Business (LOB) applications I’ve worked on authenticate the user at the page level using Windows authentication. If the user can’t authenticate into the page then the Silverlight application is never displayed. With out-of-browser applications the Windows user account can be passed through and accessed as calls to a service are made. The sample application available with this post assumes that authentication occurs at the page level as opposed to within the Silverlight application itself. 

    Accessing a User’s Identity
    To access an authenticated user’s user name within a Silverlight application you can either pass the user name into the object tag’s initialization parameter (called “initParams”) or call a service that returns the user name. An example of passing in the user name using the initParams option within an ASP.NET page that is hosting the object tag is shown next: 

    <param name="initParams" value="UserName=<%=User.Identity.Name%>" />
     

    Within App.xaml.cs you can access the initParams parameters and store them. The code below shows how to do this and add initParams values into the application resources so that they can be accessed throughout the application.

     

    private void Application_Startup(object sender, StartupEventArgs e)
    {
        ProcessInitParams(e.InitParams);
        this.RootVisual = new MainPage();
    }

    private void ProcessInitParams(IDictionary<string, string> initParams)
    {
        if (initParams != null)
        {
            foreach (var item in initParams)
            {
                this.Resources.Add(item.Key, item.Value);
            }
        }
    }

    Posted via email from Jasper-net

    PUT vs POST

    |
    HTTP has four standard-usage verbs: POST, GET, PUT, and DELETE. They do not correspond to CRUD (Create, Read, Update, Delete). Forget about the distinction between create and update; it won't help you here. Both POST and PUT can be used for create and update operations in different situations. So what exactly is the difference between PUT and POST?
    In a nutshell: use PUT if and only if you know both the URL where the resource will live, and the entirety of the contents of the resource. Otherwise, use POST.

    POST is an incredibly general verb. Because it promises neither safety nor idempotence, and it has a relatively loosely-worded description in the RFC, you can use it for pretty much anything. In fact, you could make all of your requests POST requests because POST makes very few promises; it can behave like a GET, a PUT, or a DELETE if it wants to. It also can do some things that no other verb can do - it can create a new resource at a URL different from the URL in the HTTP request; and it can modify part of a resource without changing the whole thing (although the proposed but not widely-accepted PATCH method can do something similar).

    PUT is a much more restrictive verb. It takes a complete resource and stores it at the given URL. If there was a resource there previously, it is replaced; if not, a new one is created. These properties support idempotence, which a naive create or update operation might not. I suspect this may be why PUT is defined the way it is; it's an idempotent operation which allows the client to send information to the server.

    Read more: rhebus's posterous

    Posted via email from Jasper-net

    Mix11: Good news for Israeli WP7 developers

    |
    I didn’t get a chance to post this earlier, because I was waiting for someone to send me the picture of the slide proving my news. Since he didn’t send it as of today, I decided to take a screenshot from the session video. This is good news to Israeli Windows Phone developers out there, coming to you (almost) live from Mix11. In fact, I was about to miss this session, but I’m happy that I didn’t. 
    It seems like in the next Mango update Israeli developers will be able to join the AppHub directly, without the need to use a partner publishers such as YallaApps. I doubled checked this with the speaker as well as other Microsoft people who participated in this session. The time frame for this change should be around July 2011.

    Posted via email from Jasper-net

    SQL SERVER – Making Database to Read Only – Changing Database to Read/Write

    |
    I recently received following comments on my earlier blog:

    “Today i was trying to attach the (MDF,NDF,LDF ) sql server 2008 database which i have received from my client. After attachment the database status is showing (Read-Only) (Eg.database name (Read-Only). How do i make to normal mode for the data updation. is there any query available to resolve this problem. Your help will be highly helpful.”

    Here is the answer:

    Make Database Read Only
    USE [master]
    GO
    ALTER DATABASE [TESTDB] SET READ_ONLY WITH NO_WAIT
    GO

    Make Database Read/Write
    USE [master]
    GO
    ALTER DATABASE [TESTDB] SET READ_WRITE WITH NO_WAIT
    GO

    If you face error that if database is already in use, you can resolve the same by making database in single user mode – here is the guideline SQL SERVER – ALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE.

    Posted via email from Jasper-net

    How to Use the INNER JOIN Keyword in SQL Server

    |
    In this tutorial you will learn how to use the INNER JOIN keyword. The INNER JOIN keyword returns rows when there is at least one match in two tables. This is especially important when working with multiple tables because it can join them and provide data that is linked to each one. For this tutorial we will create two tables, Employee and Department. Department will have a primary key and Employee will have a foreign key that connects to the primary key, thus connecting the tables. 

    Setting Up

    Before we start getting to the detailed work, we need to set up the tables.  Let’s create the Department table first since it will include the primary key. Open SQL Server and open a new query. Use the ‘CREATE TABLE’ statement to create a table and name it “Department”. In it, we will have two columns, “DepartmentId” and “DepartmentName”. DepartmentId will be of ‘int’ data type and be a primary key while DepartmentName will be of ‘nvarchar’ data type. Execute the query and make sure it completes successfully.

    CREATE TABLE Department
    (
    DepartmentId int PRIMARY KEY NOT NULL,
    DepartmentName nvarchar(30) NOT NULL
    );

    Next we will create the Employee table. The Employee table will have two columns, “LastName” and “DepartmentId”. LastName will be of ‘nvarchar’ data type and DepartmentId will be of ‘int’ data type. We will also mark DepartmentId as the foreign key and reference it to the DepartmentId column in the Department table. Execute the query and make sure it completes successfully.

    CREATE TABLE Employee
    (
    LastName nvarchar(30) NOT NULL,
    DepartmentId int,
    FOREIGN KEY (DepartmentId) REFERENCES Department(DepartmentId)
    );

    We used over 10 web hosting companies before we found Server Intellect. They offer dedicated servers, and they now offer cloud hosting!

    Step One

    Now that we have our two tables created, we can start adding data into them. First we will add data into the Department table. By making use of the INSERT INTO, SELECT, and UNION ALL statements we are able to add multiple entries into the table in a single query.

    INSERT INTO Department(DepartmentId, DepartmentName)
    SELECT 31, 'Sales'
    UNION ALL
    SELECT 33, 'Engineering'
    UNION ALL
    SELECT 34, 'Clerical'
    UNION ALL
    SELECT 35, 'Marketing'

    Read more: SqlAtoms.com

    Posted via email from Jasper-net

    Create REST service with WCF and Consume using jQuery

    |
    What is REST ? 

    Rest=Representational state transfer which is an architecture design to represent the resources. Rest provide the uniform interface through additional constraints around how to identify resources, how to manipulate resources through representations, and how to include metadata that make messages self-describing. Rest is not tied with any platform and technology but WEB is only platform which satisfy the all constrain. So any thing you build using Rest constrain, you do it on Web using HTTP. Following are the HTTP methods which are use full when creating Rest Services. 

    HTTP Mehtods

    GET - Requests a specific representation of a resource
    PUT - Create or update a ersoure with the supplied representation
    DELETE - Deletes the specified resource
    POST - Submits data to be processed by the identified resource
    HEAD - Similar to GET but only retrieves headers and not the body
    OPTIONS - Returns the methods supported by the identified resource
    In this article I am going discuss how to design and consume REST web service using WCF framework of .net service. As Example I am going to create  REST service which create, update and select Employee. Now start following the steps given below. 

    Designing of the URI 

    To designing Rest services you need to design URI, so for that you need to list out the resources that going to be exposed by the service.  As I am going to design Employee Create,updae and select service, so resource is

    Employee
    Now to be more specific towards the operation
    List of Employees
    A Employee by Id
    Create Employee
    Update Employee
    Delete Employee 
    For example service is hosted on on local IIS server  and URL to locate it is     

    In below discussion I am going to design the URL presentation for each operation

    List  Employees   
    URL is to get list of all employee                

    But there are no. of Employee in system and to apply filter on Employees   

    Note : In above url get list of employee of the type specified {type} of url.         

    To Get single Emplyee by using uniqid of Employee.    

    Note : In above URL {EmployeesID} is get replaced by ID of Employee.          

    Extension to above scenario, If want to get employee by using id with the type 

    Create Employee 
              URL is to create employee is             

    Read more: Codeproject

    Posted via email from Jasper-net

    Script#: Compiling C# to JavaScript using Visual Studio

    |
    Script#, a C# to JavaScript compiler, brings the power of Visual Studio and .NET Tools to build a productive development model for creating, testing and managing applications using HTML, CSS and JavaScript along with popular frameworks such as jQuery. This session provides a hands-on look at using Script#, shares success stories and experiences from real-world use, along with a project road-map.

    Read more: Channel9

    Posted via email from Jasper-net

    SPARSH (स्पर्श)

    |
    SPARSH (स्पर्श) lets you conceptually transfer media from one digital device to your body and pass it to the other digital device by simple touch gestures.

    Our digital world – laptop, TV, smart phone, e-book reader and all are now relying upon the cloud, the cloud of information. SPARSH explores a novel interaction method to seamlessly transfer something between these devices in a real fun way using the underlying cloud. Here it goes. Touch whatever you want to copy. Now it is saved conceptually in you. Next, touch the device you want to paste/pass the saved content. 

    sparsh_diagram01.jpg

    Read more: SPARSH

    Posted via email from Jasper-net

    NetworkView - A cool WPF control for diagraming network, graphs, flowcharts, etc

    |
    networkview1.jpg

    Introduction

    This article examines the use and implementation of a WPF custom controlthat is used to display and edit networks, graphs and flow-charts. NetworkView, as I have called it, was inspired by and has many similarities to standard WPF controls such as ItemsControl and TreeView. The article and the sample code show how to use the control from XAML and from C# code.

    This article is arranged in two main parts.

    Part 1 examines NetworkView usage with walkthroughs of the two sample projects. This part and the reference section are enough if you just want to use NetworkView.

    Part 2 goes into detail on the implementation. This will be useful if you want to make your own modifications to NetworkView or if you want to understand my approach to developing a complex WPF custom control.

    At the end of the article is a reference section that describes the public properties, methods and commands exposed by NetworkView.

    In previous articles I have covered a number of WPF techniques: use of adorners, zooming and panning,binding to UI element positions and most recently drag-selection of multiple items. NetworkView and the sample applications make use of all these techniques. I won't be covering these techniques in detail here. Instead, where appropriate, I'll refer back to previous articles.

    NetworkView is intended to be backed with an application-specific view-model. It is possible, though I don't recommend it, to use NetworkView programmatically or in XAML without a view-model. This is similar to other WPF controls such as TreeView where you can also get by without a view-model. Using a view-model is the way it is intended to be used, so this is what we will be looking at. The simple sample uses a simple view-model while the advanced sample extends the view-model and adds new features. Josh Smith has a great article that shows how a view-model can improve your experience with the WPF TreeView.

    Posted via email from Jasper-net

    Programming Interview Questions Code

    |
    Project Description
    This project is a collection of programming interview question's codes.

    Read more: Codeplex

    Posted via email from Jasper-net

    How to turn off your monitor

    |
    namespace TurnoffMonitor
    {
        /// 

        /// Interaction logic for MainWindow.xaml
        /// 

        public partial class MainWindow : Window
        {
            [DllImport("user32.dll")]
            static extern IntPtr SendMessage(IntPtr hWnd, uint Msg,
                          IntPtr wParam, IntPtr lParam);

            const int SC_MONITORPOWER = 0xF170;
            const uint WM_SYSCOMMAND = 0x0112;
            
            const int MONITOR_ON = -1;
            const int MONITOR_OFF = 2;
            const int MONITOR_STANBY = 1;
            
            public MainWindow()
            {
                InitializeComponent();
            }

            private void ExecuteButton_Click(object sender, RoutedEventArgs e)
            {
                WindowInteropHelper helper = new WindowInteropHelper(this);
                var handle = helper.Handle;

                
                SendMessage(handle, WM_SYSCOMMAND, new IntPtr(SC_MONITORPOWER), new IntPtr(MONITOR_OFF));
            }

    Read more: Peretz.Net

    Posted via email from Jasper-net