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

ViewModel INotifyPropertyChanged Code Generation

| Tuesday, April 26, 2011
This blog post describes a novel method of generating boiler-plate MVVM code using codesnippet automation. You simply add attributes to your view model classes and the code is generated for you!

Model-View-ViewModel (MVVM) has become the de facto pattern for Silverlight, WPF and WP7 applications, providing code that is easily tested and couples cleanly to the view via databinding. However, one small problem with MVVM is that it relies on the INotifyPropertyChanged (INPC) interface and the boiler-plate code which this entails.

This blog post describes a technique for implementing INPC and adding properties to your view model as easily as this:

[SnippetINotifyPropertyChanged]
[SnippetPropertyINPC(field = "_surname", type = "string", property = "Surname")]
[SnippetPropertyINPC(field = "_forename", type = "string", property = "Forename")]
public partial class PersonViewModel : INotifyPropertyChanged
{
}

There are hundreds of blog posts that describe solutions to the problem of implementing INPC including simple options like a base-class that implements the INPC interface, the popular approach of using lambda expressions and more complex solutions involving Intermediate Language Weaving (AOP), or dynamic proxies. However, for the sake of simplicity, most of the projects I have worked on have opted for a manual approach – with individual developers using codesnippets if they so wish.

There are a couple of problems with codesnippets, firstly they are not refactor friendly, secondly they do not reduce boiler-plate code, they simply provide a method for adding this code more quickly!

Yesterday I published an article on codeproject which describes a technique for ‘automating’ code snippets, where you indicate the use of a codesnippet declaratively via an attribute, with the resultant code being generated in a partial class. Here I am going to show how it can be used to streamline the creation of ViewModels and results in the removal of boiler-plate code.

Read more: ScottLogic

Posted via email from Jasper-net

.NET Character Classifications

|
CharControl DigitLetterLetter Or Digit LowerNumber PunctuationSeparatorSymbol UpperWhite Space
0 �True FalseFalseFalse FalseFalseFalse FalseFalseFalse False
TrueFalseFalse FalseFalseFalse FalseFalseFalse FalseFalse
TrueFalse FalseFalseFalse FalseFalseFalse FalseFalseFalse
TrueFalse FalseFalse FalseFalseFalse FalseFalseFalse False
True FalseFalse FalseFalseFalse FalseFalseFalse FalseFalse
TrueFalseFalse FalseFalseFalse FalseFalseFalse FalseFalse
(more...)

Read more: Black Belt coder

Posted via email from Jasper-net

Android: Как работать с mp3-файлами

|
В данной статье описан процесс получения всей основной информации о аудиотреках в устройстве с Android, основы работы с плейлистами и проигрывания аудиофайлов.

Общие принципы работы с провайдерами данных

Источники данных ( Content Providers, Провайдеры данных ) в Android предоставляют интерфейс общего доступа к любому источнику данных путем отделения уровня доступа к данным от уровня приложения. Источники данных предлагают стандартный API, с помощью которого приложения могут обмениваться своими данными между собой, и использовать различные системные базы данных.

Типичный запрос к провайдеру данных выглядит следующим образом. Сначала запрашивается системный объект класса ContentResolver, который позволяет подключаться к провайдерам данных. Затем необходимо настроить параметры запроса и вызвать метод ContentResolver.query, в который передаются параметры запроса и который в случае успешного выполнения возвращает объект класса Cursor, предоставляющий интерфейс для работы с данными, возвращаемые в результате запроса к базе данных.

String[] projection = new String[] {
People._ID,
People.NAME,
People.NUMBER,
};

Uri mContactsUri = People.CONTENT_URI;
ContentResolver resolver = appContext.getContentResolver();

Cursor managedCursor = resolver.query( mContactsUri,
          projection,.
          null, 
          null,
          People.NAME + " ASC"); 

for( int i=0;i<managedCursor.getCount();i++)
{
      managedCursor.moveToPosition(i);
      String nameOfContact =  managedCursor.getString(1);
      ….    
}

Подробнее о работе с провайдерами данных можно посмотреть на сайте разработчиков - http://developer.android.com/guide/topics/providers/content-providers.html.

Провайдер данных MediaStore.Audio

Провайдер данных MediaStore представляет собой централизованную базу данных мультимедиа, размещенных в памяти устройства или на сменном носителе ( SD карте ), включая аудио-, видеофайлы и изображения. Данные в MediaStore записываются автоматически при сканировании системой внутренней или сменной памяти, при этом рассылаются сообщения ACTION_MEDIA_SCANNER_STARTED и ACTION_MEDIA_SCANNER_FINISHED. Любая программа может уведомить сканер о наличии нового файла вызовом
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, newFilePath));
Примечание: чтобы запретить сканеру обрабатывать определенный каталог на диске, поместите туда пустой файл с именем .nomedia.

При сканировании анализируются ID теги и другая информация, которая становится доступна в пользовательских приложениях. Доступ к данным аудиофайлов осуществляется через провайдер MediaStore.Audio, который также дает возможность работать с плейлистами ( списками воспроизведения ). 

В примерах этой статьи будет использоваться вызов myquery, который утилизирует получение курсора по URI провайдера данных и других параметров запроса.

Read more: PlainCodeSource

Posted via email from Jasper-net

SSL Verification for Android Applications

|
Introduction
When we try to access a Web Service hosted on HTTPS and is secured over SSL, Host Verification and/or Peer Verification are to be handled in our application.

Background
Android supports the java.net and org.apache packages to access Web Services. I use Apache packages as I find them more useful and easier than using Java packages.

To Start

Host and Peer Verification are shown here. Each Android application has its own trusted store called KeyStore. In the KeyStore, we can store our self-signed SSL certificates that will be used for the verification purposes of our Web Service. Android trusts a couple of Trust Certificates, but if our signed certificate is not signed among those, then we need to add our certificate to the trusted store of the application.

Assuming you already have a self-signed certificate (if not, kindly use the key tool of Java to create one), let's add the certificate to a keystore using Bouncy Castle that we can access in our application. Like keytool is used in Java to create certificates, Bouncy Castle is the only way to add certificates to the Android keystore.

1. Creating the KeyStore

Download and unzip Bouncy Castle in a proper location and add the .jar file to the class path. Open cmd, go to the application folder, and type the following command:

 Collapse
keytool -import -v -trustcacerts -alias 0 -file mycertificate.crt 
  -keystore res/raw/mystore.bks -storetype BKS -provider 
  org.bouncycastle.jce.provider.BouncyCastleProvider -storepass mypassword
file parameter points to your certificate file that you want to add
keystore => gives the store name that you want to give
storepass => password to access the keystore
On successful execution of the command, the mystore.bks file will be generated successfully.

2. Create a class to use our store for HTTPS connections

To use the store that we created above, we have to create a custom Apache DefaultHttpClient that knows to use the store for HTTPS requests.

public class MyHttpClient extends DefaultHttpClient {

    final Context context;
    public MyHttpClient(Context context) {
        this.context = context;
    }

    @Override
    protected ClientConnectionManager createClientConnectionManager {
        SchemeRegistry registry = new SchemeRegistry();
        registry.register("http", PlainSocketFactory.getSocketFactory(), 80));
        registry.register("https", newSslSocketFactory(), 443));
        return new SingleClientConnManager(getParams(), registry);
    }

    private SSLSocketFactory newSslSocketFactory() {
        try {
             KeyStore trusted = KeyStore.getInstance("BKS");
             InputStream in = context.getResources().openRawResource(R.raw.mystore);
             try {
                 trusted.load(in, "mypassword".toCharArray());
             }
             finally {
                  in.close();
             }

             SSLSocketFactory mySslFact = new SslFactory(trusted);
             //mySslFact.setHostNameVerifier(new MyHstNameVerifier());
             return mySslFact;
         } catch(Exception e) {
         throw new AssertionError(e);
        }
    }
}

This code helps us to accept a server certificate and sets the certificate for verification. You can see how we are using our -storename parameter "BKS" to get the instance of the KeyStore, loading the certificate file mystore from R.raw, and setting its password that was used while adding it to the store.

3. Copy mystore file

Import the generated mystore.bks file to the res/raw folder. So our above class can access it from there.

With this, SSL Peer Verification is taken care of. We just have to create an instance of MyHttpClient in place of DefaultHttpClient and Peer Verification will be handled by itself.

Read more: Codeproject

Posted via email from Jasper-net

Управление сессиями NHibernate в приложениях ASP.NET MVC

|
Здравствуйте, уважаемые читатели!

В этой статье я хочу ответить на типичный вопрос разработчика, начинающего использовать NHibernate в web-приложениях, разрабатываемых на основе ASP.NET MVC - как управлять сессиями и конфигурацией NHibernate в рамках веб-приложения. Это первая проблема, которая встречается разработчику, и для того, чтобы не потерять производительность, и не получить странных трудновоспроизводимых ошибок необходимо корретно реализовать этот механизм. В сети я находил несколько разных версий, и в этой статье я приведу ту, которая показалась мне наиболее удобной.

Итак, сначала немного теории. Как говорит вся документация на NHibernate - создавать конфигурацию и фабрику сессий затратная по времени операция, в то время как создавать сессию операция относительно быстрая. Таким образом, необходимо, чтобы в нашем приложении, конфигурация создавалась как можно реже, и была одна фабрика сессий, а сессии создавались для каждого HTTP запроса. Создавать больше одной сессии для HTTP запроса не имеет особого смысла.

Таким образом, самое подходящее место для конфигурирования и создания фабрики сессий - это обработчик Application_Start. Я использую DI-контейнер LinFu, но он может быть с легкостью заменен любым другим. Я думаю семантика выполняемых действий будет ясна из приведенного кода.

protected void Application_Start()
{
 AreaRegistration.RegisterAllAreas();

 var serviceContainer = new ServiceContainer();
 serviceContainer.AddService(CreateNhSessionFactory());
 ServiceContainerProvider.Init(serviceContainer);
 
 RegisterGlobalFilters(GlobalFilters.Filters);
 RegisterRoutes(RouteTable.Routes);
}

protected ISessionFactory CreateNhSessionFactory()
{
 var sessionFactory = Fluently.Configure()
  .Database(
   MsSqlConfiguration.MsSql2008.ConnectionString(
    x => x.FromConnectionStringWithKey("ApplicationServices"))
  )
  .Mappings(x => x.FluentMappings.AddFromAssemblyOf<Issue>())
  .BuildSessionFactory();
 return sessionFactory;
}

Думаю из кода видно, что в Application_Start конфигурируется NHibernate, создается фабрика сессий и помещается в DI контейнер. По умолчанию LinFu использует поведение типа Singleton (единственный объект на все приложение), если при регистрации сервиса передается конкретный объект. Итак, я добился того, что у меня будет одна фабрика сессий для всего ASP.NET MVC приложения. Замечу, что приложение ASP.NET - это отдельная тема для обсуждения, но как минимум следует знать, что в одном приложении могут обрабатываться тысячи запросов, создает и уничтожает приложение IIS в соответствии с настройками. Теперь нужно сделать так, чтобы у нас на один запрос была только одна сессия, которая будет использоваться всеми классами слоя доступа к данным.

Read more: Brain IT!

Posted via email from Jasper-net

תהליך Svchost.exe – מהו, ולמה יש לי כמה עותקים ממנו?

|
שלום לכולם,

כאן דן ויזנפלד מצוות התמיכה של Microsoft.

בין אם פתחתם את מנהל המשימות ב-Windows XP, ב-Windows Vista או ב-Windows 7, ודאי הבחנתם בתהליך ששמו הוא Svchost.exe. למען האמת, סביר יותר להניח שנתקלתם במספר תהליכים ששמם הואSvchost.exe.

לפני שנתחיל בניתוח, בואו נראה עם מה יש לנו עסק:

במנהל המשימות, בלשונית Processes (תהליכים) תמצאו את תהליכי Svchost.exe*.

* משתמשי Windows Vista/7 יצטרכו קודם לכן ללחוץ על Show Processes from all users (הצג תהליכים מכל המשתמשים) על מנת לצפות בתהליכים.

1_thumb_128159ED.png

"אז מה זה בעצם?"

תהליכי Svchost.exe, ראשי תיבות של Service Host, הינם חלק אינטגרלי וחשוב מאין כמוהו במערכת ההפעלה. התהליכים ממוקמים בתיקיית %SystemDrive%\Windows\System32, והם שמאפשרים את ההפעלה של שירותי מערכת ההפעלה המאוחסנים כקבצי DLL**.

Posted via email from Jasper-net

Free CryEngine 3 to be released in August

|
Crytek takes on Unity and Epic Games with new SDK policy; No costs for non-commercial use
A free edition of CryEngine 3 will be available in August, vendor Crytek has announced.
The Frankfurt-based studio said the new SDK will be free to download for non-commercial purposes.
CryEngine 3 is the high–end multi-platform game engine that powered the FPS blockbuster Crysis 2. In making it free to play with, Crytek is following the path of rival engine firms Unity and Epic Games.
Company CEO Cevat Yerli said the new SDK would reignite the modding community. In an open letter to his fans, he admitted that Crytek recently had few resources to support this area of its business. 
“In recent times our focus has been heavily on the development of Crysis 2, however our modding community has been, and remains, very important to us,” Yerli said.

Read more: Develop

Posted via email from Jasper-net

Play AVI files in Silverlight 4 using MediaElement and MediaStreamSource

|
Introduction

This article tries demostrate the power of the MediaElement and the MediaStreamSource class that is available to Developers. In this article we shall try to write some code to play an avi video located locally on your computer.

Background

With the new features introduced into Silverlight 4, I had wanted to try and write a simple Application to play an AVI video file. To do this I had to sacrifice quite some time to do research on the subject. Initially I played around with the WriteableBitmap but later discovered the powerful capabilities and features provided by the MediaStreamSource Class.

This article barely touches the surface of those capabilities provided by the MediaStreamSource Class to developers. This article therefore does not delve into decoding video files, it only demonstrates how to buffer samples and provide them to MediaElement control using a custom class derived from MediaStreamSource class. The decoding is handled by a dll (AVIDll.dll) which is also included in the sample which we shall use to return video samples as byte array. The source of this dll is not included in this article. It is only a simple wrapper for the methods using P/Invoke and was written in VB6 as an ActiveX dll. There are a good number of articles out there including some from codeproject that deal with opening avi files (using avifil32.dll and other dlls) such as http://www.codeproject.com/KB/audio-video/avifilewrapper.aspx and a very old yet still very useful website http://www.shrinkwrapvb.com/avihelp/avihelp.htm

In our sample code, we need to first derive our custom class from System.Windows.Media.MediaStreamSource. This will require us to override a number of methods. Without going into too much detail the methods are OpenMediaAsync, GetSampleAsync, CloseMedia, SeekAsync, GetDiagnosticsAsync and SwitchMediaStreamAsync. I will not dig deep into defining these methods but the ones we shall use in our example code are:

OpenMediaAsync: We override this method and an in it we initialize and report some metadata about the media by calling ReportOpenMediaCompleted() method.

GetSampleAsync: We override this method and retrieve the next requested Sample by the MediaElement. MediaElement will call this method every time it needs a Sample. To report back to MediaElement that the Sample is ready, we call ReportGetSampleCompleted() method.

Some good books to read on the subject include 'Silverlight 4 in Action' and 'Silverlight Recipes - A problem Solution Approach'.

Our main objective in this article is to write a simple Silverlight Application that plays back an avi video. Well, for the video (.avi) to play you must have the relevant codec on your machine first.

Read more: Codeproject

Posted via email from Jasper-net

Stored Procedure in WCF Data Service

|
In this article we will explore, how could we use Stored Procedure with WCF Data Service?

You can read Introduction to WCF Data service and ODATA here

To use Stored Procedure, at time of creation of Data Model, select Stored Procedure as part of Data Model.

Now open EDMX file and right click on that. Select Add and then select Function Import.

Popup window will be open.
  1. Give Function import name
  2. Choose Stored procedure from drop down
  3. Choose the Entity type Stored Procedure is returning.

Stored Procedure we are selecting is GetStudentGrades and it is returning one or more entities of StudentGrade.

After clicking OK you can see columns are mapped

You can see in model browser that GetStudentGrades has been listed in Function Imports section and it is having one input parameter StudentD.

We can see now that Stored Procedure has been mapped to Entity model and can be exposed as WCF Data Service.

Next step we need to create a function in DataService class. This function will return list of entities.Client will call this function to execute Stored Procedure.

[WebGet]
public List<StudentGrade> GetStudentGrade(string studentId)
{
    SchoolEntities entities = new SchoolEntities();
    return entities.GetStudentGrades(Convert.ToInt32(studentId)).ToList();
}

Posted via email from Jasper-net

More dump forensics, understanding !locks, in this case a filter driver problem

|
Written by Jeff Dailey: 
 
Hello NTDebuggers, one of the most important things to understand in kernel debugging hung servers is the output of !locks.  There can be a lot of data and it’s not always clear what is going on.  One of the things I like to do in order to better understand the output is to use a visual representation of the resources involved and the threads that are blocking on those resources.   Before we can do that we need to understand what to look for so we can document it in our diagram. 
 
It’s a good idea to understand ERESOURCEs in general l before jumping into !locks.  The following MSDN article goes into lots of great detail.  http://msdn2.microsoft.com/en-us/library/aa490224.aspx
 
Simply put, you will typically see threads either with access to or trying to gain access to resources.   If a thread has access to a resource it will be marked by <*>.   Threads that have access to a resource can block other threads from gaining access to said resource.
 
You will see threads waiting for shared access.  These threads do not have the <*> and listed above the threads that are Waiting on Exclusive Access.
 
You will also see threads that are Waiting on Exclusive Access.  These threads are typically blocked waiting for the threads that have access or ownership of the resource to release it.
 
Let’s take a look at one section of !locks output and annotate each thread section...
 
Resource @ 0x896d2a68    Shared 1 owning threads  << This info is the ERESOURCE in question.      Contention Count = 15292  << The amount of contention for the object.
    NumberOfSharedWaiters = 1  << This is self explanatory
    NumberOfExclusiveWaiters = 39 << Number of exclusive waiters in the Ex Waiter List
     Threads: 89bd1234-01<*> 896d2020-01   << We have two threads here.  The owner, or shared owner <*>89bd1234 and the shared Waiter 896d2020
     Threads Waiting On Exclusive Access:
              888ed020       87c036f8       885dc7a0       8bc538b0  << All of these threads are waiting on exclusive access.    
              88e8cda0       88796988       8905fda0       8974dc10      
 
 
Note the following output is completely fabricated, so alignment and variable names may not be valid.
 
The following is some sample output from !locks.  In this scenario I document any ERESOURCE that has any threads waiting on exclusive access.  I also document the ERESOURCES as nodes and show the relationship to the Threads.  The key point is to show the threads involved, the resources they own, and the resources they are blocked on or trying to get exclusive access to.  Ultimately you need to work your way toward the head of the blocking chain of events to figure out what is holding up the entire chain of execution from moving forward.

Read more: Ntdebugging

Posted via email from Jasper-net

Getting Fiddler to See you WCF Traffic

|
There are lots of articles on the internet if you search for WCF Fiddler however it’s not clear what the simplest path to follow is. For me, it turns out that just sprinkling a couple lines of code at the bottom of my windows forms app’s app.config file is all it took.  I got the tip from this post:  http://www.fiddler2.com/fiddler/help/hookup.asp
The magic lines are as follows:

    <defaultProxy> 
      <proxy bypassonlocal="false" usesystemdefault="true" /> 
    </defaultProxy> 
  </system.net
</configuration>

That’s it!  Now, Fiddler just sees the traffic.  I’m a happy camper.

image_thumb2.png

Read more: PeterKellner.net

Posted via email from Jasper-net

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