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

10 red flags that shout 'Stay away from this project!'

| Tuesday, September 21, 2010
Like most consultants, you’ve probably gotten stuck on a doomed project at one time or another. But if you know what to watch out for, you can avoid getting mired in a project mess.

Over time, I have been involved in some of the worst projects ever as a freelancer, consultant, or some other “non-employee” relationship. When you are a direct hire to a company, you do not have the freedom to pick and choose what you work on. But as an outside person being paid to work specifically on one project, you do have the choice. I have been burned so many times it isn’t funny, but I have learned a lot from my mistakes. Here are 10 of the biggest red flags I’ve encountered. I am sure you have more to share in the discussion thread.

Note: This article is also available as a PDF download.

1: No clear spec or goals

All too often, I’ve been approached to work on a project, but the person trying to arrange the deal can’t tell me what they really need done. It’s not that they are under some strange code of silence. They really have no clue what they want. They have a general idea of what the finished product should look like and a really good understanding of its differentiating factors or killer features, but outside of that they have not thought it through. This is one of the most common and most significant danger signs! How many hours’ worth of work do you want to throw away on a regular basis because the client realized after you built it that what they asked for wasn’t what they needed? At the very least, these kinds of projects should be contracted only at a per-hour rate.

2: Funding problems
3: Product pre-sold to a client
4: Spending money in the wrong places
5: A long string of previous consultants
6: The wrong workers

Read more: TechRepublic

Posted via email from .NET Info

How is the CommandLineToArgvW function intended to be used ?

|
The CommandLineToArgvW function does some basic command line parsing. A customer reported that it was producing strange results when you passed an empty string as the first parameter:

LPWSTR argv = CommandLineToArgvW(L"", &argc);
Well, okay, yeah, but huh?

The first parameter to CommandLineToArgvW is supposed to be the value returned by GetCommandLineW. That's the command line, and that's what CommandLineToArgvW was designed to parse. If you pass something else, then CommandLineToArgvW will try to cope, but it's not really doing what it was designed for.

It turns out that the customer was mistakenly passing the lpCmdLine parameter that was passed to the wWinMain function:

int WINAPI wWinMain(
   HINSTANCE hInstance,
   HINSTANCE hPrevInstance,
   LPWSTR lpCmdLine,
   int nCmdShow)
{
   int argc;
   LPWSTR argv = CommandLineToArgvW(lpCmdLine, &argc);
   ...
}

Read more: The old new thing

Posted via email from .NET Info

Определяем время простоя пользователя

|
Многие программные продукты должны уметь определять, когда пользователь не работает с компьютером. Это нужно для совершенно разных задач. Например, утилита, делающая резервную копию данных, отнимает много ресурсов. Лучше если она будет делать это тогда, когда пользователю эти ресурсы не нужны. Т.е. во время простоя системы. Skype ставит статус пользователя в «Away», если в течение длительного времени он не пользуется мышкой или клавиатурой. Это очень удобно, так как сами пользователи часто забывают сделать это. Таких примеров, на самом деле, можно привести великое множество. Очевидно здесь одно – определение простоя системы важная штука. И в любой момент может понадобиться программисту. Поэтому в этой статье мы попробуем разобраться, как определять «неактивность» пользователя в C#-приложении.
Логика нашего WinForms-приложения проста. У нас будет форма, в центре которой мы расположим Label с текстом «Unknown». Затем с помощью таймера через класс InactiveTimeRetriever мы будем узнавать, как долго пользователь не работает с системой. В случае если нам не удастся это узнать, мы будем выводить в Label значение «Unknown» и делать цвет формы желтым. Если пользователь не работал с системой более 5 секунд, мы будем менять текст в Label на «Inactive for [кол-во секунд]». Ну и текст формы сделаем в таком случае красным. Наконец, в том случае если система активна, надпись в Label станет «Active», а цвет формы зеленым.

[StructLayout(LayoutKind.Sequential)]
public struct LASTINPUTINFO
{

public uint cbSize;
public uint dwTime;
}

Данная структура будет использована нами далее в функции GetLastInputInfo, которая будет получать время, когда пользователь последний раз работал с системой. В нашем классе далее объявим следующее:

[DllImport("user32.dll")]
static extern bool GetLastInputInfo(ref LASTINPUTINFO plii);

Read more: Microsoft Geeks

Posted via email from .NET Info

64bit version of Adobe Flash for Linux available

|
In a recent announcement on the Flash Player Team Blog, Paul Betlem announced that Adobe has re-released a 64bit version of their popular flash player. Adobe pulled the plug on 64bit support for Linux in June of this year out of the blue and enraged a huge number of Linux users for their rash decision making. Needless to say, it’s good to see they have rethought this action and refreshed the 64bit version of their popular player.

We strongly recommend all Linux users who are running a 32bit version of the flash player make the switch today by installing 64bit flash player for Linux.

Read more: Linux Critic

Posted via email from .NET Info

Learning Performance Counters : Memory/Available Mbytes and Pages/Sec.

|
Introduction

I firmly believe  a DBA is only as good as how well he/she knows Performance Counters. I have been wanting to blog/learn on them for a long time and thought would start with the list of important counters as listed in Grant Fritchey/Sagal Dam’s great book - 'SQL Server  2008 Performance Tuning  Distilled'. This book is a bible for troubleshooting query heavy SQL Servers and has a section devoted to baselining using perfmon counters. There are two counters listed as important for monitoring Memory – Available Mbytes and Pages/Sec.

Available Mbytes

Definition: Available Mbytes stands for free unallocated RAM and displays the amount of physical memory, in MB, available to processes running on the computer.

Interpretation

  1. This counter only displays the last value and is not an average.
  2. If the value is less than 20/25 percent of installed RAM it is an indication of insufficient memory.
  3. Less than 100 MB is an indication that the system is very starved for memory and paging out.
  4. Fluctuations of 100 MB or more can indicate that someone is logged in remotely into the server.
Pages/Sec

Definition:  Pages/sec is the number of pages read from the disk or written to the disk to resolve memory references to pages that were not in memory at the time of the reference.

Interpretation

  1. This is the sum of two counters - Pages Input/sec and Pages Output/sec.
  2. The threshold is normally 20 pages/sec, although one has to investigate activity on the server before concluding paging is the problem.
  3. Spikes in pages/sec are normal and possible due to backups, big files/data being written to disk and after reboot.

Reads more: Beyond Relational

Posted via email from .NET Info

Passing WCF Exception to Silverlight

|
Since it is not possible to catch regular exception from a WCF service in a silverlight application, there is another way to do it by using BehaviorExtensionElement.

1. On Server-side First create a behavior like this:

public class MyFaultBehavior : BehaviorExtensionElement, IEndpointBehavior
   {
       public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
       {
           SilverlightFaultMessageInspector inspector = new SilverlightFaultMessageInspector();
           endpointDispatcher.DispatchRuntime.MessageInspectors.Add(inspector);
       }
       public class SilverlightFaultMessageInspector : IDispatchMessageInspector
       {
           public void BeforeSendReply(ref Message reply, object correlationState)
           {
               if (reply.IsFault)
               {
                   HttpResponseMessageProperty property = new HttpResponseMessageProperty();

                   // Here the response code is changed to 200.
                   property.StatusCode = System.Net.HttpStatusCode.OK;
                   reply.Properties[HttpResponseMessageProperty.Name] = property;
               }
           }
           public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
           {
               // Do nothing to the incoming message.
               return null;
           }
       }
       // The following methods are stubs and not relevant.
       public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
       {
       }
       public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
       {
       }
       public void Validate(ServiceEndpoint endpoint)
       {
       }


Read more: Vincent Leung .NET Tech Clips

Posted via email from .NET Info

CodeBox - Syntax Highlighting In Silverlight For Any Programming Language

|
SilverLaw created a Silverlight 4 UserControl called CodeBox that enables you to highlight source code in Silverlight for your web page.

Read more: Silverlight Show

Posted via email from .NET Info

MYSQL: Get the Auto-Increment Values after Insert Statement

|
Until sometime back, I was unaware of how I could get the value of an auto-incremented field after an Insert Statement. But recently I needed it for two of my projects simultaneously, so I explored the possibilities. As one of my project is in Java and other is in PHP, we will go through both of them.

So, here is the problem. In general, the PRIMARY KEY field is the AUTO_INCREMENT field. Now wen you insert a row, a new key is generated and you can’t get it through usual way as this row can be accessed only using the primary key.

So here is how it can be done:

In JAVA:
/*Insert a row into the desired table that generates
an auto increment field*/

stmt.executeUpdate("Insert into tableName (col1, col2) values (val1, val2)", Statement.RETURN_GENERATED_KEYS);

ResultSet rs = stmt.getGeneratedKeys();

int autoIncValue = -1;

if(rs.next())
{
      autoIncValue = rs.getInt(1);
      /*You can get more generated keys if they are generated in your code*/
}

Read more: Public Mind

Posted via email from .NET Info

Fantom

|
Hello World

We start our whirlwind tour of Fantom's features, with the quintessential hello world:

class HelloWorld
{
 static Void main()
 {
   echo("hello world")
 }
}

Minor differences from Java or C# include:

  • all type names are capitalized including Void (Fantom doesn't have primitives nor primitive keywords).
  • Class and method protection scope default to public.
  • Fantom sports the echo method for writing to the console or you can use Env.cur.out.
  • Statements can be terminated with a newline (you can use a semicolon too)
  • You can declare Str[] args or access them from Env.args

Overview

Do we really need another programming language? Well obviously we thought so, or we wouldn't have built Fantom! Fantom is designed as a practical programming language to make it easy and fun to get real work done. It is not an academic language to explore bleeding edge theories, but based on solid real world experience. During its design we set out to solve what we perceived were some real problems with Java and C#. Our background is heavily Java, but many of Java's problems are shared by C# and .NET also.

Portability

The primary reason we created Fantom is to write software that can seamlessly run on both the Java VM and the .NET CLR. The reality is that many software organizations are committed to one or the other of these platforms. Even dynamic languages like Python and Ruby are getting hosted on one of these VMs. Whether your business is in-house software or building software components to sell to other companies, you tend to pick one camp or the other.

We built Fantom from the ground up to tackle portability between these VMs. Fantom's source language compiles into fcode - a bytecode representation that can be translated into both Java bytecode and IL easily. This translation is typically done at runtime, which enables you to deploy Fantom modules as a single file and have them run on either VM.

But getting a language to run on both Java and .NET is the easy part - in fact there are many solutions to this problem. The hard part is getting portable APIs. Fantom provides a set of APIs which abstract away the Java and .NET APIs. We actually consider this one of Fantom's primary benefits, because it gives us a chance to develop a suite of system APIs that are elegant and easy to use compared to the Java and .NET counter parts.

But portability means much more than just Java or .NET. We also support compiling Fantom to JavaScript for use in browsers, including support for many of the standard libraries.

Because Fantom is designed from the ground up to be portable, targeting new platforms is reasonably easy. Future targets might include Objective-C for the iPhone, the LLVM, or Parrot.

Read more: Fantom

Posted via email from .NET Info

Kloudo.com – A Fantom Success story

|
Well, You don’t know me. I am sure. So, Hey! I am kaushik.  Programmer. I usually freelance.   And this is my first blog.

Yesterday I launched kloudo.com – A Integrated business organizer. Obviously I think it’s pretty awesome. That’s not the point of this post, however.

What better way to start to blog than by thanking the open source projects that has helped you to get your things done.  I’ve my share of list to thank. Including Mysql, redis, ngnix  and fantom. Yeah Fantom.

Kloudo.com was built mostly-completely written on the Fantom programming language. Ofcourse since its pretty easy to use Java libraries from inside fantom, I’ve done that too.

Why Fantom?  fantom.org has a page on that.  And one more point they missed over there. The developers(Brian and Andy) are pretty damn amazing.  So is the community.  The language is beautiful. APIs are elegant.  Has Actors. Ruby like closures . Runs on JVM. And very attractive to a Java Programmers.

So the point of this post, mostly, is to let you know, if you din’t know already, that Fantom is mature and usable right now. I made an entire product on it and loved every second programming with it. So will you. So go give it a try.

Read more: Kaushik Sathupadi

Posted via email from .NET Info

How to show recruiters that you're a creative problem solver

|
I've noticed a trend over the last months: hiring managers are seeking "creative thinking" or "creative problem solving" as the top abstract skill among job candidates. Of course, hiring managers still need technical talent who are adept communicators, but - beyond that - creative problem solving is the skill for which everyone is searching.

We can all agree that creative problems solving skills sound important, but, on deeper examination, many candidates are unsure of how to actually define the term. So, what exactly is “creative problem solving?”

Creative problem solving is also known as lateral thinking, creative thinking, out-of-the-box thinking, imaginative thinking or a dozen other synonymous names.

Bottom line: it is the ability to understand that a solution does not always come from a "logical" lock-step advance from point A to point B. Creative problem solving recognizes that the solution might require an entire shift in thinking or process or materials before the outcome will be achieved. Creative problem solvers do not see dead ends as a failure, but view them as a need to adjust their course and keep utilizing a  "…but, what if we…" attitude until a solution is discovered.

This skill is key to the innovative thinking that will solve the technical challenges of the future. It is the foundation of imagineering and "blue sky" thinking that will drive innovations that keep our company relevant in 5, 10 and 20 years. OK, now that we have a sense of what creative problem solving is, how do you showcase your creative problem solving skills in a resume?

Few recruiters are going to use "creative problem solver" as key words when searching through resumes since most candidates don't think to list it. We are limited to reading between the lines and using our gut instinct to tell us who might have this skill set. For example, if I read a resume that mentions the person sailed the Pacific for two years and worked as a freelance programmer while abroad, I will guess that he might have this skill. Or if a program manager mentions organizing events for a charity gala, I will assume she has this skill. If a person has been given an innovation award or holds patents it will also peak my interest.

Read more: The JobsBlog

Posted via email from .NET Info

.NET and the CAdES standard

|
Hi all,

You may want to sign data and verify those signatures by following the CAdES standard in your .NET application.

The issue is that, by default, we have no specific MS API or MS .NET security library to create or verify CAdES signatures.

As you may know already, .NET security libraries are a wrapper around the Microsoft native CryptoAPI. Unfortunately, low level CryptoAPI doesn’t understand CAdEs signatures.

So you may try to use e.g. SignedCms.CheckSignature to verify a CAdES signature (which is the usual way to check a CMS digital signature by using the approach detailed at Understanding of SignedCms.CheckSignature(True)) and it may return “true”. But .NET won’t be verifying the CAdES piece so it won’t satisfy your requirements.

Read more: Decrypt my World

Posted via email from .NET Info

New Manifest Manager Utility Available on CodePlex

|
A long time ago I wrote the Manifest Manager Utility to make it easier to edit ClickOnce manifests for composite application scenarios where the application DLLs are not all directly referenced by the shell application. That code was updated for the release of SCSF 2010, but unfortunately a late breaking change in the framework caused that version to stop working with .NET 4.0 RTM.

The Prism team has taken ownership of that utility from SCSF, and we updated it to work with .NET 4.0. The new version is now available on CodePlex here. Thanks much to Robin Shahan (@robindotnet) for pointing out the fix.

The utility makes it easy to open both the deployment manifest and application manifest of a ClickOnce app at the same time in a single editor to do things like update the publish version, add and remove files, change the application name or the deployment location (provider). Saving saves and signs both manifests in one action, saving the hassle of trying to do everything in the right order across two manifests. You can see the UI here.

Read more: Brian Noyes Blog

Posted via email from .NET Info

Tracking Ad Clicks with the Microsoft Silverlight Analytics Framework on the Windows Phone

|
Along with the release of the Windows Phone Developer Tools and the Microsoft Silverlight Analytics Framework 1.46 today, Microsoft also released the Mobile Advertising SDK for Windows Phone.  The SDK consists of a custom control AdControl that you add to your Silverlight application on the phone.  Because the AdControl exposes an AdEngaged event whenever the user clicks on an ad, it is very easy to make the Analytics Framework work with the control.  I plan on adding another assembly to the next build of the Analytics Framework to support this.  Here is the code that is necessary for it if you don’t want to wait.

To use this code:

Add the AdControl to your application as described in the SDK
Add the HandleadControl.cs code to your project
Add a TrackAction behavior to the AdControl and select the AdEngaged event
Now the AdControl.AdUnitId will be tracked in the AnalyticsEvent.ActionValue

HandleAdControl.cs

namespace Microsoft.WebAnalytics.Advertising
{
   using System;
   using System.ComponentModel.Composition;
   using Microsoft.Advertising.Mobile.UI;
   using Microsoft.WebAnalytics;
   using Microsoft.WebAnalytics.Contracts;

Read more: Synergist

Posted via email from .NET Info

Microsoft Silverlight Analytics Framework 1.4.6 Released

|
We have just released on CodePlex the latest version of the Microsoft Silverlight Analytics Framework to support the final release of the Windows Phone Developer Tools.  You can read the release notes here.

New Features for Windows Phone 7
  Since the last release, we also added some more new Windows Phone features and we have started working with a number of companies who are creating Analytics-enabled Windows Phone Applications.  Their early feedback helped us create a more robust framework for the phone (and fix a few bugs).

Tracking of the Panorama and Pivot controls that now come with the Windows Phone Developer Tools
Tracking of the DatePicker and TimePicker controls that come with the Windows Phone Toolkit
We are in the process of adding support for the new Mobile Ad control.  Vote here if you want it added.

Web-Analysis.Net
  We’ve added another Analytics Service partner for Silverlight 3, Silverlight 4, WPF, and Windows Phone, Web-Analysis.Net

Read more: Synergist

Posted via email from .NET Info

Hosting HTML in Silverlight (not Out of Browser)

|
Some Silverlight projects may require that you render HTML content - perhaps a non-Silverlight control or web page. Unfortunately unless the project runs Out of Browser (OOB) the WebBrowser control isn't an option. What can you do?
While there is no easy solution to truly embed HTML inside of the Silverlight rendering engine, it is possible to render the HTML using the browser into a DIV element that is overlaid on your Silverlight application. In fact, because the rendering engine is powerful enough to provide you with all of the sizing events and triggers you need, you can create a very convincing experience displaying HTML in your application - even from the browser.
To illustrate this in action, we'll build a sort of "Silverlight browser" that allows you to navigate to any web page. In reality, we'll load the URL into an IFRAME that lives inside a DIV. What will be important to note is that the DIV automatically moves and resizes when you resize the application, as if it were a part the application itself!

Read more: C#er: IMage

Posted via email from .NET Info

Windows Phone 7 emulator – capturing traffic with Fiddler. Or WireShark.

|
While working on a Windows Phone 7 application today I noticed that some web requests are skipped by the application. In fact, the callback for the receiving method was never called, so I decided to track the outbound traffic via a local proxy tool. I actually tried two of them, and here is what I got.

Fiddler
  Fiddler was the first choice when I decided that I need to keep track of what’s being requested by the application. I launched it, launched the emulator through Visual Studio (I simply built a WP7 solution) and… nothing happened. Well, in fact something happened – my application crashed with a WebException – NotFound,

Read more: Den by default

Posted via email from .NET Info

Top 10 Lessons on How to Make a Living on the Internet

|
“Don’t ask what the world needs. Ask what makes you come alive, and go do it. Because what the world needs is people who have come alive.” — Howard Thurman

I have to say, this is truly one of the most amazing posts I’ve read on how to make a living on the Web.  I’m blown away.  Rather than a step-by-step approach, it’s a set of timeless principles and patterns.  Pat has distilled an incredible set of insights that he’s learned from actually making money online and walking his talk.  Without further ado, here’s Pat on how to make a living on the Internet …

This post is not intended to be a step-by-step guide on how to make a living on the Internet. Think of it as a compendium of the lessons I’ve learned since starting a number of online businesses – lessons that I hope will be far more useful to you than any “system” I could possibly teach. The fact is that there are thousands of different business models one could choose from if you do want to make a living online, but it’s the core principles and motivations behind them that determine whether or not it will be successful and long-lasting, or just a waste of your time.

Lesson 1: Internet Business is Not For Everyone
Lesson 2: Strive to Make the Internet a Better Place
Lesson 3: The Passive Income Business Model
Lesson 4: Take Action


Read more: Source of Insight

Posted via email from .NET Info

Obtain the plain text session key using CryptoAPI

|
Introduction

Generally it's very important to obtain the value of session keys. However, the Microsoft Cryptographic Providers (Base and Enhanced) does not support this feature. CryptExportKey() and CryptImportKey() require a valid key handle to encrypt and decrypt the session key, respectively. MSDN shows a way to do this using a exponent-of-one private key. This article shows a better way to perform the same process. This way is faster and more comprehensive.

It's ready to run, but you must set the following parameters at Project -> Settings (Visual Studio 6.0 ) :

Add in C++/Preprocessor definitions: _WIN32_WINNT=0x0500, _CRYPT32_(WIN2K) or _WIN32_WINNT=0x0400, _CRYPT32_(NT4)
And Link this library crypt32.lib

Code Listing

#include <windows.h>
#include <wincrypt.h>

#define KEY_PAIR_SIZE     dwSize - 12
#define SESSION_KEY_SIZE  dwKeyMaterial

void main()
{

   HCRYPTPROV hProv = 0;
   HCRYPTKEY hExchangeKeyPair = 0;
   HCRYPTKEY hSessionKey = 0;
   BYTE *pbKeyMaterial  = NULL;
   DWORD dwKeyMaterial ;  
   BYTE *pbExportedKeyBlob = NULL;
   BYTE *pbEncryptedKey    = NULL;
   DWORD dwSize;
   unsigned int c;

   __try
   {

       if (!CryptAcquireContext( &hProv, "Container Name",
           MS_ENHANCED_PROV , PROV_RSA_FULL, CRYPT_MACHINE_KEYSET ))
       {
           __leave;
       }


Read more: Codeproject

Posted via email from .NET Info

Massively Multiplayer Online Client Engine

|
Project Description
MMOCE(Massively Multiplayer Online Client Engine) is MMORPG Client Engine. It is based on the .NET Framework Silverlight 4.0, and is multi-threaded.

**Delete the following note before publishing **

This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.

There are three requirements before you publish:

- Edit this page to provide information about your project
- Upload the initial source code for your project
- Add your project license

Read more: Codeplex

Posted via email from .NET Info

Microsoft Advertising SDK for Windows Phone 7 Available for Download

|
Introducing Microsoft Advertising Exchange for Mobile, the industry’s first real-time, bidded ad exchange in mobile – leverage superior ad targeting, multiple purchase models and leading resellers including Microsoft’s sales force and large-scale adCenter marketplace.  Microsoft’s simple Ad Control, self-serve developer sign-up, reporting and automated payout ensures a seamless ad monetization experience for developers. Actionable reporting helps developers optimize for best user experience and advertising yield

Download the Microsoft Advertising SDK for Windows Phone 7 and get started in 3 easy steps:

Download the SDK. Download the Ad SDK. Build your app and run ads in test mode that requires no on-boarding to pubCenter to try out the Microsoft Advertising SDK.

Sign Up for pubCenter Mobile. Sign up and register your mobile application on pubCenter, define your ad unit and select your user targeting categories. Live starting September 29, 2010.

Implement and Submit. Set the Application Id and Ad Unit Id properties in the Ad Control and submit your ad-enabled app to the Windows Phone 7 marketplace.

Read more: ISV Developer Community

Posted via email from .NET Info

Generic approach to access WCF Data Services

|
WCF Data Services allows to publish your data very fast and easy. If you use Visual Studio to create the client which consumes the services, you just can have to click "add service reference" and you have the classes you need to work with the service are generated (a sample for WCF Data Service you will find in my previous post). But what if you have a bunch of services which all follows the same convention and you want to access them in a generic way? This is also as simple as accessing the service with the generated stub. As a sample service we use one which returns all the startup date and time of the service (uses EF CT4 which can be downloaded here)

public class ServerInfo
{
   public int ID { get; set; }
   public DateTime Startup { get; set; }
}

public class ServerContext : DbContext
{
   public DbSet ServerInfos { get; set; }
}

[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
public class ServerInfoService : DataService<ServerContext>
{
   public static void InitializeService(DataServiceConfiguration config)
   {
       ServerContext conn = new ServerContext();
       conn.ServerInfos.Add(new ServerInfo() { Startup = DateTime.Now });
       conn.SaveChanges();

       config.SetEntitySetAccessRule("*", EntitySetRights.All);
   }
}

Read more: Mattia Baldingers Blog

Posted via email from .NET Info

Are multicore-capable garbage collectors hard to write ?

|
In this era of multicore computing, garbage collectors need to allow user threads (aka mutators) to run in parallel on separate cores simultaneously in order to facilitate efficient shared memory parallel programming.

There are two relevant phrases from garbage collection terminology here:

Parallel GC means the garbage collector itself has been parallelised in order to speed up garbage collections. For example, a stop-the-world collector might traverse the heap in parallel when marking in an attempt to reduce pause times.

Concurrent GC means the garbage collector runs at the same time as the user threads (aka mutators). For example, Dijkstra's algorithm and derivatives like Doligez-Leroy use fine-grained synchronization to keep a concurrently-running collector apprised of the constantly-changing heap topology.

However, we are talking about neither parallel GC nor concurrent GC but, rather, the simpler challenge of just allowing mutators to run in parallel. In the absence of any established terminology, we call any GC that allows mutator threads to run in parallel with each other a multicore-friendly garbage collector.

Frustratingly, many people are perpetuating the myth that it is difficult to write parallel or concurrent or even just multicore-friendly garbage collectors. In particular, this is happening around the OCaml language as a result of Xavier Leroy's (in)famous "standard lecture on threads" from 2002 where he explained that they were not creating a multicore-friendly garbage collector for OCaml because multicores would never become popular and he described Intel's hyperthreading as "the last convulsive movement of SMP's corpse".

Read more: The Flying Frog Blog

Posted via email from .NET Info

5 Fundamental differences between GIT & SVN

|
If you are reading this article, you obviously care about GIT like lot of developers do and if you haven’t had a chance to get some taste of GIT, I think it’s time to wake up.

GIT is much more than a version control system, it can be used as CMS, workspace manager etc. It will take a mind shift for anyone coming from SVN background to get used to some of the concepts & features that GIT offers. So, the main purpose of this article is to help them by giving ideas on what to expect from GIT and how it’s different from SVN from high-level.

Alright, here it goes…

  1. GIT is distributed, SVN is not:
This is by far the *core* difference between GIT and other non-distributed version control systems like SVN, CVS etc. If you can catch this concept well, then you have crossed half the bridge. To add a disclaimer, GIT is not the first or only distributed VCS(version control system) currently available. There are other tools like Bitkeeper, Mercurial etc. which also work on distributed mode. But, GIT does it better and comes with much more powerful features.
GIT like SVN do have centralized repository or server. But, GIT is more intended to be used in distributed mode which means, every developers checking out code from central repository/server will have their own cloned repository installed on their machine. Let’s say if you are stuck somewhere where you don’t have network connectivity, like inside the flight,

Read more: BoxySystems Inc.

Posted via email from .NET Info

Как создать DLL-файл со значками

|
Icon6.2.gif

  Вероятно вам приходилось видеть, что некоторые DLL-файлы содержат множество значков. Например, shell32.dll, imageres.dll и другие. Мы также можем создать такую библиотеку значков, которая будет храниться в DLL-файле. Также я покажу, как можно извлечь значки и вывести их на форме.

Шаг первый. Запустите Visual Studio 2010 и создайте новый проект Class Library. Для удобства я присвоил проекту имя IconLibrary.

Далее выбираем в меню File | New | File и в диалоговом окне выбираем пункт Native Resource Template и щелкаем на кнопке Open.

Read more: developer.alexanderklimov.ru

Posted via email from .NET Info

Implementing a ‘Money’ type in an ASP.NET MVC and NHibernate application.

|
Years ago I read Kent Beck’s seminal Test Driven Development. The first third of the book is a complete worked example of building a Currency type using TDD and I remember thinking at the time that this was an incredibly powerful technique. Rather than using basic data types -  int, string, DateTime - we could define what we actually meant. Rather than having a property Age of type int, we would define an Age type. Rather than two string properties we could define a Name type. One of the factors in moving Suteki Shop from Linq-to-SQL to NHibernate was NHibernate’s support for more complex finer-grained mapping.

When I first hacked together Suteki Shop, I used the decimal type everywhere I needed to represent money. This has mostly worked well for the simple scenario where a shop only has a single currency and that currency is sterling (£). But anyone wanting to sell in US dollars had to find every one of the many instances of “£” and replace them with “$”, and if you wanted to do something fancy with multiple currencies, you would have been out of luck. What I needed was a Money type. It’s not a trivial refactoring. Here are the steps I needed to take:

Create a Money type that behaved as far as possible like a .NET numeric type.
Create an ASP.NET MVC IModelBinder that knew how to bind the Money type.
Create an NHibernate IUserType that knew how to persist the Money type.
Change every point in the code that was using decimal to represent money to use the Money type instead.


Create a Money type

I wanted to create a Money type that would behave nicely when I did arithmetic with it. So I wanted to be able to write expression like this:

var x = new Money(43.5M);
var result = x * 3 + x/2 - 4;
result.Amount.ShouldEqual(148.25M);

To achieve this you have to write a lot of operator overloads for all combinations of operator, Money <-> Money, Money <-> decimal and decimal <-> Money. I won’t bore you, if you want to see the gory details, you can view the code here.

Read more: CODE RANT

Posted via email from .NET Info

Best Practices for Themes in Modular Silverlight Applications

|
When building large Silverlight applications, it makes sense to build sets of styles that can be shared across the application. Many examples on the web illustrate placing these in the App.xaml file and then you are off to the races. Unfortunately, when you are building modular applications, it's not that simple. The dependent modules still require design-time friendly views, and to make that happen requires a few steps.

The Central Theme
  The first step is to take your theme for the application and place it in a separate project. These are themes that only have dependencies on the core Silverlight controls. What you want is a simple project that any application or module can reference to pull in the theme.

Create a new Silverlight class library, then add a ResourceDictionary to house your themes.

Read more: C#er: IMage

Posted via email from .NET Info

Microsoft Web Application Configuration Analyzer v1.0

|
Overview
  Web Application Configuration Analyzer (WACA) is a tool that scans a server against a set of best practices recommended for pre-production servers. It can also be used by developers to ensure that their codebase works within a secure / hardened environment (although many of the checks are not as applicable for developers). The list of best practices is derived from the Microsoft Information Security & Risk Management Deployment Review Standards used internally at Microsoft to harden production and pre-production environments for line of business applications. The Deployment Review standards themselves were derived from content released by Microsoft Patterns & Practices, in particular: Improving Web Application Security: Threats and Countermeasures available at: http://msdn.microsoft.com/en-us/library/ms994921.aspx.

Here are some features of the tool:

  • Scan a server using more than 140 rules
  • Generate HTML based reports
  • Compare multiple scan results
  • Export results to Excel
  • Export results to Team Foundation Server

Read more: MS Download

Posted via email from .NET Info

Showcase of Games Developed Using HTML5 Canvas

| Sunday, September 19, 2010
The canvas element is part of HTML5 and allows for dynamic, scriptable rendering of 2D shapes and bitmap images. It is a low level, procedural model that updates a bit map and does not have a built in scene graph.

Canvas consists of a drawable region defined in HTML code with height and width attributes. JavaScript code may access the area through a full set of drawing functions similar to other common 2D APIs, thus allowing for dynamically generated graphics. Some anticipated uses of the canvas include building graphs, animations, games, and image composition.

In this post I will showcasing games developed using HTML5 canvas element.

canvas-4.jpg
Sinuous
  The goal is simple: avoid the red dots! Built using the HTML5 canvas element. Works on iOS & Android devices.

Super Mario Kart
  A small but fun racing game built in html5 canvas and javascript.

Pacman
  This is most of the Pacman game everyone knows and loves. It isnt a complete implementation yet and I do plan on working some more on it, however it should mostly be playable.


Read more: Insidesigns

Posted via email from .NET Info

How to Uninstall Internet Explorer 9 Beta

|
If you want to remove Internet Explorer 9 beta from your computer and go back to your older version of IE, you can do so by simply following these steps.

Read more: EricLaw's IEInternals

Posted via email from .NET Info

Creating a Visual Studio Add-In in 1 Minute

|
This article introduces the basics of Visual Studio Add-In (aka "Plug-In" in Java terminology) creation.

Note: This information is valid for every version of Microsoft Visual Studio. Examples will be given over Visual Studio 2008 and .NET version 3.5.

First, choose File --> Create --> Project. After that choose "Extensibility Project" type and "Visual Studio Add-In".

addin1.PNG

Read more: CodeBalance

Posted via email from .NET Info

VS2010 Performance and Bad Video Drivers/Hardware - Redux

|
Since we shipped Visual Studio 2010 we've continued to have a small but notable series of complaints about performance that we've been able to attribute to bugs in video drivers and GPUs.

The issue first came up back during VS 2010 beta in October of 2009.  Since then we've learned that while old, buggy drivers are the usual cause, some newer drivers and GPUs aren't as good at supporting VS's UI as we'd like.

Fortunately, the software rendering inside WPF is pretty good, so the easy fix here is to force WPF to ignore the GPU and use software rendering (I've tested this on my own system, and I found that WPF's software rendering was actually slightly faster than GPU based rendering on my high end CPU with a mid-range graphics card - your mileage may vary).

But first, if you're seeing slow / broken screen updates you should verify you have the latest display drivers for your system.  (See "Guidelines for troubleshooting graphics issues in WPF applications" for more information.)

If that doesn't fix it, then there are three ways to force WPF to use software rendering.

First and preferred, the final RTM version of VS2010 includes a UI for forcing hardware rendering off - for just VS.  With VS2010 open, go to Tools | Options, then select Environment | General (as shown below).  Then uncheck "Automatically adjust visual experience..." and "Use hardware graphics acceleration..."

0513.Turn-off-HW-acceleration.png

Posted via email from .NET Info

Securing your .Net Assembly code

|
I want to present some ideas for how you can secure your coded .net application.

.net assemblies /executable contain instruction codes and some data about data that is contained in them that is relatively easy to de-compile with tools available in market like Dot Net reflector.

Tools like Dot net Reflector can de-compile the assembly and it shows the code that is nearly the same as the original code of the .net assembly. If our Application contains some critical code/secret code that we don't want the user to see then we can do that using tools like reflector.

So what we can do to protect our .net code?

Read more: C# Corner

Posted via email from .NET Info

Build your own development server with Apache, Subversion and Trac

|
This is one of the most appreciated articles coming from my blog; the original title is: Install Tutorial: Ubuntu 9.04, Apache with SSL, Subversion over HTTP / HTTPs, and Trac. Despite the fact that it's 1 year old now, I still receive appreciation comments; so I am pretty sure that following the instructions you'll have no big issues with the latests version available.

Trac is not very easy to install, as well as setting up Apache web server with https and integrating that with Subversion, and all together.
You may want to try to install this on a virtual machine, to make a "dry run", before releasing your development server in production. One thing that is missing for a developement server worthy of the name, is a continuous integration server. Of course, my choice would go to Hudson, which is also very easy to install and integrate with your favourite scm. Integrating Hudson with apache and trac would be a good extension of this tutorial, that I will probably write in a second time. And I would like also to write down how to set up a good environment to work with git and gitosis. It's in my todo list; in the meantime, this is a very good tutorial to start with gitosis: Hosting Git repositories, The Easy (and Secure) Way.

If you are looking for a Linux hosting, I suggest the one I am using, slicehost. An alternative to trac, could be Redmine, I used it a little bit for some experiments, and was very nice.

The good thing about this "installation tutorial" is that is modular: you can follow just the installation of the components you are interested about, and leave the things that you don't need, or replace them with something else. Hope you'll find it useful.

Introduction
This tutorial will guide you through installation of Apache, HTTPS, Subversion and Trac, in order to have an (almost) complete development environment for your team.

This article is divided in following steps

1. Installing Subversion
2. Installing Apache
3. Configuring Apache with SSL
4. Configuring Subversion with Apache (and SSL)
5. Installing Trac

You may choose for example to see how to install Apache and SSL, or having Apache plus subversion without Trac.
Steps are voluntary isolated, and will require more operations than, for instance, issuing an "apt-get install trac" that will download and install all the packages in one step; but this will hopefully allow the readers to choose picking one section and forget about unneeded components.

Read more: JavaLobby

Posted via email from .NET Info

How To : Load Multiple XAP files in Silverlight Application

|
Currently i am working on a project where i had a requirement to load multiple xap files in a silverlight application, or let me keep this way i need to load xap files OnDemand.
I was going through this article on msdn where it explains about "how to load assemblies on demand", before reading this article i really had no idea of how to load multiple xap files, but now i have done that yipee... :)
I just want to blog a bit about how to load multiple xap files in silvelright application, and also share some sample application which demonstrates this. As usual you can find the source code the end of this blog post.

To get started with this sample i've created a silverlight project and added two silverlight class libraries, now my solution looks as shown below

First let us check out how to load a single xap file, the below code shows how to read a xap file and read the dll file for the perticular class for which we want to create the instance and returns that perticular instance.
The Things to check out in the below code snippet are the two private variables:
applicationName - The name of the xap file with out extension.
control - The class in the above mentioned application for which you want to create instance.

public partial class MainPage : UserControl
{
       string applicationName = "SilverlightApplication1";
       string control = "Control";

       public MainPage()
       {
           InitializeComponent();
           WebClient wc = new WebClient();
           wc.OpenReadCompleted += new OpenReadCompletedEventHandler(wc_OpenReadCompleted);
           wc.OpenReadAsync(new Uri("SilverlightApplication1.xap", UriKind.Relative));
       }

       void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
       {
           StreamResourceInfo resourceInfoDLL = Application.GetResourceStream(new StreamResourceInfo(e.Result, null), new Uri(string.Format("{0}.dll", applicationName), UriKind.Relative));
           AssemblyPart assemblyPart = new AssemblyPart();
           Assembly assembly = assemblyPart.Load(resourceInfoDLL.Stream);
           UIElement element = assembly.CreateInstance(string.Format("{0}.{1}", applicationName, control)) as UIElement;
           LayoutRoot.Children.Add(element);
       }
}


Read more: Dot + Net <=> Digging .Net

Posted via email from .NET Info

Process & Processor

|
Performance Monitor a.k.a perfmon is used to monitor different counters for different purposes. However, some counters are bit confusing. Process and Processor two misleading counters so thought of putting this note.

Processor

When adding processor object, you have _Total object and 0, 1 .. which are the processor number. Following the graph for _Total (Red) , 0 (Blue), 1 (Pink) objects for % Processor Time counters. ( Colors given in the graph for relevant counter)

In the above graph, you will see _Total is NOT the total of processer 0 and 1. But it is the average of them. For example, let us say you have four processors of % Processor time of 20, 30, 50, and 80 and _Total count will be 45.  i.e.  (( 20 + 30 + 50 + 80 ) /4)

Process

While processor is the counter for your processors and Process is counter for each process you are executing right at the moment. For example: if you wish to measure % processor for sqlserver, this is the measure you have to select. in this also, you have the _Total counters. Unlike the Processor counter this counter is sum of all the processes INCLUDING idle processor.

Read more: Beyond Relational

Posted via email from .NET Info

Google Relaunches Instantiations Developer Tools - Now Available for Free

|
Picture+3+10-39-12.png

In early August, Google acquired Instantiations, a company known for its focus on Eclipse Java developer tools, including GWT Designer. We're happy to announce today that we're relaunching the following former Instantiations products under the Google name and making them available to all developers at no charge:

GWT Designer
Powerful Eclipse-based development tools that enable Java developers to quickly create Ajax user interfaces using Google Web Toolkit (GWT)

CodePro AnalytiX
Comprehensive automated software code quality and security analysis tools to improve software quality, reliability, and maintainability

WindowBuilder Pro
Java graphical user interface designer for Swing, SWT, GWT, RCP, and XWT UI frameworks

WindowTester Pro
Test GUI interactions within Java client rich applications for the SWT and Swing UI frameworks

Read more: Google Web Toolkit

Posted via email from .NET Info

CUPP – Common User Passwords Profiler – Automated Password Profiling Tool

|
A while back we had Wyd – Automated Password Profiling Tool but the guys at remote-exploit seem to have superseded this with CUPP.

There are other similar options too – The Associative Word List Generator (AWLG) and also RSMangler – Keyword Based Wordlist Generator For Bruteforcing.

People spend a lot of time preparing for effective dictionary attack. Common User Passwords Profiler (CUPP) is made to simplify this attack method that is often used as last resort in penetration testing and forensic crime investigations. A weak password might be very short or only use alphanumeric characters, making decryption simple. A weak password can also be one that is easily guessed by someone profiling the user, such as a birthday, nickname, address, name of a pet or relative, or a common word such as God, love, money or password.

Read more: Darknet.org.uk

Posted via email from .NET Info

Oracle Database and Instant Client 11.2.0.2 are available on Linux

|
The Oracle 11.2.0.2 Instant Client libraries are now available on Linux x86 and x86_64 platforms from the Instant Client home page. And they'll soon be uploaded on ULN for customers with Oracle Linux support to install via the update server.

If you are one of the (not so?) few users of command line PHP then you might want to grab the new client because it has Oracle bug 9891199 fixed. You'll also need OCI8 1.4.3 from PECL. This combination together resolve a process shutdown delay that irked some command line users. You will still be able to connect back to older versions of the DB, as is normal in the Oracle world.

Read more: PHP and Oracle: Christopher Jones

Posted via email from .NET Info

Exposing additional service metadata with WS-Discovery in WCF 4.0

|
WS-Discovery is not only a mechanism for discovering service endpoint addresses at runtime, but also a way to query for specific service information and metadata. If you look at it from another standpoint, WS-Discovery provides access to a decentralized short-lived service catalog that is available as long as the services are running. It is decentralized because every service expose their own metadata, unless you use a WS-Discovery managed proxy, which act as an intermediary and central location for service discovery. It is short-lived because it is only available when the service is running, and it is not something that clients could use at any time.

With all this, I am not saying that WS-Discovery is a good replacement for a service repository, which actually provides opposite capabilities, a centralized storage for service metadata at design time that supports full rich querying.

However, they both complement very well each, the service can configure itself from the service repository, and expose metadata and runtime information to clients through WS-Discovery.

There are two types of metadata attributes or extensions that you can configure in the “endpoint” discovery behavior,

<endpointDiscovery enabled="true">
   <scopes>
     <add scope="urn:CRM"/>
   </scopes>
   <extensions>
     <Owner>Pablo Cibraro</Owner>
     <Metadata>http://locahost:8080/?wsdl</Metadata>
   </extensions>
</endpointDiscovery>

Scopes, which represents “URI”s and can be used by clients to filter the discovery results when sending the discovery probes. For example, in the configuration above, a client could only be interested in a service that provides a “urn:CRM” scope, so this service will match that probe.

On the client side, the WCF client can specify the “scopes” as part of the “FindCriteria” argument passed to the DiscoveryClient,

var discovery = new DiscoveryClient(new UdpDiscoveryEndpoint());

var criteria = new FindCriteria(typeof(IHelloWorld));
criteria.Scopes.Add(new Uri("urn:CRM"));
var discoveryResponse = discovery.Find(criteria);

Read more: Pablo M. Cibraro (aka Cibrax)

Posted via email from .NET Info

50 Great Web Alternatives to Desktop Software

|
Even without the help of the ground breaking features in HTML5, web apps have come of age. While not all web apps rival their desktop counterparts, some clearly do. One solid example being online To-do apps with invoicing and project management apps also competent enough for a neck to neck fight.
We’ve compiled a list of 50 worthy web app alternatives to standalone desktop apps. Let’s take a look!

Panda Cloud Protection
Panda Cloud Protection is a cloud based security solution, delivered in a SaaS model that provides complete protection services for the major threat vectors: endpoint, email and web.
Replaces: Conventional AV suites like McAfee, Norton, Kaspersky etc.
Requirements: An Internet Connection
Developer: Panda Security

LastPass
LastPass is an online password manager which, with the help of your master password, remembers and stores all your passwords when you login to websites and facilitates — one click login after first use.
Replaces: KeePass, 1Password (Mac), Roboform etc.
Requirements: A modern web browser.

Google Docs
Google Docs is an online office suite made available for free by Google and is capable of word processing, spreadsheets, presentations & more.
Replaces: Microsoft Office & Open Office
Requirements: A modern web browser & a Google account.
Developer: List developer if you can find him/her

Splashup
Splashup is a cloud based image editing tool with a great set of tools for image manipulation.
Replaces: Adobe Photosop, Gimp etc.
Requirements: Adobe Flash Player
Developer: Faux Labs, Inc.

Read more: App Storm

Posted via email from .NET Info

Silverlight Performance Tip: Understanding the impact of Effects on performance

|
We recently received a request from a developer to help analyze performance for a basic Silverlight application.
This particular app was used as one of the Silverlight SDK samples (See image below). The application had a simple set of controls on a form, but its CPU usage was very high.
I wanted to share our findings and explain how we fixed the issue.

The first thing we did was to turn on EnableRedrawRegions.  This lets you see which rectangles are being redrawn by the graphics engine within your application. Once enabled, all repainted regions’ colors will change in blue/yellow/pink order.  This can be enabled by passing the parameter shown here in the application .aspx page:


   

The issue:
  Once we enabled redraw regions we could see that when we switched to a tab that contained an animation, the entire form was constantly being updated.  
Looking carefully at the form and also through the template sources we could see that the outer border (as well as one of the inner borders) was using a DropShadowEffect.
This means that any redraw of any child element inside of that border’s visual tree will trigger a redraw of everything within the effect (in this case, the entire area of the border).
So even with a small animation, the entire application was being redrawn every frame!
Note that not only an animation will trigger a redraw, but any redraw such as cursor blink in a text box, or any redraw resulting from mouse movements over a control.

The solution:

We could  have simply removed the DropShadowEffect,  but we wanted to preserve the original design, so we did the following:
1.  Add a new sibling element the same size of the border that has the DropShadowEffect, but contains no child elements.
2.  Removed the Effect from the original border.

Below simple changes provided huge performance improvements.

Read more: Silverlight Performance Blog

Posted via email from .NET Info

Windows Phone 7 development: Some ideas to get you inspired.

|
I've collected a few examples of what people are doing on Windows Phone 7 and would like to share them with you:

Game: Ilomilo, simply beautiful game.

App: OpenTable, restaurants  reservation app.

App: Shazam

App: Netflix

App: Feed Reader, read more about it here.

App: Foursquare, a location-aware, social networking app.

App: Flixster

App: WP7 MousePad

Game: Flight Control game

Game: Samarium Wars, a very well done little game, classic.

(more...)

Read more: Mat Velloso's Blog

Posted via email from .NET Info

How to Convert a Slick PSD Design to XHTML/CSS

|
Converting a Adobe PSD to a static HTML/CSS page can be quite the hassle, so today I will demostrate how to go about the process. We are going to take the PSD template below and convert it to a fully xHTML/CSS layout that works in all major browsers (IE6+). The page is essentailly broken down to five major sections, each one having its own container wrapping custom content. We will approch this conversion by first writing valid XHTML code then add CSS to make the page resemble the PSD. Lets begin by looking at the PSD and what we want to take from it.

Read more: tutoaster

Posted via email from .NET Info

Integrate the 3D Engine Balder into Your Silverlight Applications Part 1

|
  In this series of articles, you will learn how to integrate the famous 3D Engine - Balder into your Silverlight applications. Since there are few documents, especially tutorials, with Balder, you will first learn the elementary stuffs associated with Balder through small pieces of sample applications. At last, you can accumulate all your strength to develop a real 3D Silverlight game application mainly based the 3D engine Balder, which is named SpaceAdventuring.

Introduction
  In this series of articles, you will learn how to integrate the famous 3D Engine - Balder into your Silverlight applications. Since there are few documents, especially tutorials, with Balder, you will first learn the elementary stuffs associated with Balder through small pieces of sample applications. At last, you can accumulate all your strength to develop a real 3D Silverlight game application mainly based the 3D engine Balder, which is named SpaceAdventuring.

One more word is to finish our last complete sample game application you'd better also familiarize yourself with another Silverlight open sourced 2D engine - Farseer. To obtain introductory materials about the 2D engine Farseer, you can surf the web to find related documents or refer to my previous article published in dotnetslackers from here.

Read more: dot Net Slackers

Posted via email from .NET Info

Creating a IE9-like UI

|
If you haven’t been living under a rock you might have noticed that IE9 Beta has been released! One of the things I like about IE9 is its new UI… Lets try and re-create it!

Glass chrome window

Frist things first, IE9 uses a glass chrome window… Microsoft has released the WPF Shell Integration Library which allows us to customize our window chrome

“The custom chrome feature allows applications control over the outer frame of the window so that WPF content can be drawn over the title bar. This allows applications to integrate with Aero glass to emulate the Office 2007/2010 look and feel, or to completely replace the frame with its own content without having to manage all the system behaviors that get lost when using WindowStyle.None"

Here is my glass chrome window style

<Style TargetType="{x:Type local:MainWindow}">
   <Setter Property="shell:WindowChrome.WindowChrome">
       <Setter.Value>
           <shell:WindowChrome GlassFrameThickness="-1" />
       </Setter.Value>
   </Setter>
   <Setter Property="Template">
       <Setter.Value>
           <ControlTemplate TargetType="{x:Type local:MainWindow}">
               <Grid>
                   <ContentPresenter
                       Margin="{Binding Source={x:Static shell:SystemParameters2.Current}, Path=WindowNonClientFrameThickness}"
                       Content="{TemplateBinding Content}"/>
               </Grid>
           </ControlTemplate>
       </Setter.Value>
   </Setter>
</Style>

Read more:  Rudi Grobler in the Cloud

Posted via email from .NET Info

Silverlight, Out-Of-Browser and Multiple Windows

|
I was talking to a developer the other day about Silverlight out-of-browser applications and how there’s not really any support for opening multiple windows so that (e.g.) you might have a master window in the application and the ability to open sub-windows.

It’s a feature that’s often requested and I think it’s referred to from this request here although that actually asks for MDI which I think you could achieve a form of with Silverlight’s ChildWindow class.

I was wondering how this might be done and got thinking about how it might be possible to have a scheme whereby;

Your main Silverlight application runs.
The user wants to open a new window in the application.
You run a second instance of the application.
The second instance of the application is told to navigate to some content that makes it the second window rather than the primary window.
This is mostly an experimentation rather than something I’d advise, I just wanted to see how it might work.

In The Browser

In the browser, I don’t think this is too difficult and there’s no doubt a number of ways you can do it but you can use HtmlPage.PopupWindow in order to open that second window in step (2) above and you can then navigate that second window to a page within your application.

To experiment with this I put together this little test UI;

Read more: Mike Taulty's Blog

Posted via email from .NET Info

An IIS Crash Analysis Story

|
Last week I attempted to update a high-traffic production ASP.NET application to ASP.NET 4.  In the course of doing so, I was surprised, despite having tested everything thoroughly in a staging environment, to find that under production loads, the system was erratic and slow to respond to requests.  Further inspection revealed that IIS was actually crashing under load, leaving a cryptic message in the event log but no other clues.  This is basically an account of what I did, and how I ultimately resolved the issue, for my own future reference and to assist others who may face similar situations.

In The Beginning

The application in question is a fairly high traffic site, with several servers in a Network Load Balanced / Web Farm environment, and each server getting 50-100 ASP.NET requests per second, typically.  The application makes heavy use of ASP.NET caching, and you can see some charts showing the behavior prior to moving to .NET 4 in my post about monitoring and tuning asp.net caching.  Note in particular the Windows Task Manager behavior, with a steadily climbing memory footprint eventually followed by a “cliff” when Cache Trims occur and memory is freed.  This, while not ideal, represented the status quo for the application and was what I expected to see after upgrading the application to .NET 4, with little significant variation.

Preparing for the Upgrade

The application has few individual ASP.NET pages, and in any event the upgrade from ASP.NET 3.5 to ASP.NET 4.0 was fairly painless.  The biggest issue was replacing instances of my own Tuple class with the new Tuple that is now part of the .NET framework.  With that done, I was able to test the application locally and all appeared well.  Tests passed.  Pages loaded.  I checked everything in and the build server confirmed everything looked good.  I deployed to stage, updated IIS there to set the appdomain to .NET 4, and tested again.  Still good – no worries.  This was starting to look like a walk in the park.

Performing Updates to a Web Farm using Windows NLB

I have another post detailing how to perform a rolling upgrade of a web farm using Windows Network Load Balancer.  These are pretty much the steps I followed to test the move to .NET 4.  I pulled one server out of the cluster, copied the stage site to the production site, flipped the appdomain to .NET 4 in IIS, and tested on localhost.  Everything looked great (as it should, since it was now configured exactly like the stage site which had also tested OK).  I did a Resume and Start on the node I’d pulled out using NLB Manager, and watched Perfmon and Task Manager to see how it fared.

Surprise!  Finding the Problem

Read more: Steve Smith

Posted via email from .NET Info

Alternative way for window services to interact with desktop where operating > XP

|
Problem:-
When we migrate the solution to windows 7 operating sytem it runs in session 0 .So you get an message blocked by Interactive Service Dialog Detection

This article Can be one solution, for the above problem.

Question:-

1) Why I want the windows service to interact with Desktop ,its not they are made for?

Ans: Yes, Exactly! the windows services are not make to interact with Desktop.But after introducing wcf services which can be hosted in windows services we may have the requirement to run the exe file from the wcf services.

But Before going through this article please read this: http://www.microsoft.com/whdc/system/sysinternals/Session0Changes.mspx

Note:-
   Before Implementing this solution please aware of your requirements and handle all the security problems.

Introduction:

Windows Services:-
Microsoft Windows services, formerly known as NT services, enable you to create long-running executable applications that run in their own Windows sessions. These services can be automatically started when the computer boots, can be paused and restarted, and do not show any user interface. These features make services ideal for use on a server or whenever you need long-running functionality that does not interfere with other users who are working on the same computer. You can also run services in the security context of a specific user account that is different from the logged-on user or the default computer account. For more information about services and Windows sessions.

Read more: Codeproject

Posted via email from .NET Info

Best Practices for ASP.NET MVC

|
[This post is based on a document authored by Ben Grover (a senior developer at Microsoft). It is our intention to integrate this information into the MVC 3 documentation on MSDN. We hope to hear from you and welcome any suggestions you might have.]

This document presents a set of coding guidelines aimed at helping the ASP.NET MVC developer create solid applications. Of course, it's up to you as the developer to decide which of these guidelines are appropriate for your application.

Model Recommendations
The model is where the domain-specific objects are defined. These definitions should include business logic (how objects behave and relate), validation logic (what is a valid value for a given object), data logic (how data objects are persisted) and session logic (tracking user state for the application).

DO separate the model its own project with a distinct assembly.
For applications with a large complex model, it's a good idea to create a separate assembly for the model to avoid accidently mixing concerns. You can then reference the model assembly in your ASP.NET MVC project.

DO put all business login in the model.
If you put all business logic in the model, you shield the view and controller from making business decisions concerning data. You also reap the following benefits:

Less duplicated business logic.
The view is easier to read when there is no business logic present.
Testing business rules is isolated to the model.
For example, if you have a business requirement to display a user's name with the last name first, you could put the logic in the view as follows:

<% if (String.Compare((string)TempData["displayLastNameFirst"], "on") == 0)
      { %>
       Welcome, <%= Model.lastName%>, <%= Model.firstName%>
   <% }
      else
      { %>
       Welcome, <%= Model.firstName%> <%= Model.lastName%>
   <% } %>

However, you would have to duplicate this logic in every place this business requirement was needed.

Read more: ASP.NET and Web Tools Developer Content Team

Posted via email from .NET Info

Can’t remember the .Net String Formats? Always seem to have to search for them? Here’s a cheatsheet just for you…

|
image%5B8%5D.png?imgmax=800

This morning I saw this tweet from @jhollingworth …

which linked to this excellent guide to .NET string formats by Steve Tibbett

Sometimes, something is just so incredibly useful that even bookmarking it isn’t convenient enough – so I’ve hacked Steve’s guide and examples into a one-page A4 cheat sheet and stuck it on the wall next to my desk.

This is so going on my workspace wall too…

Read more: Greg's Cool [Insert Clever Name] of the Day

Posted via email from .NET Info

XNA Storyboard

|
Project Description
XNA Storyboard provides a Storyboard system for XNA similar to Silverlight's, using DependencyObjects and DependencyProperties developed in C#.

The purpose of this project is to provide an easy to use, yet robust mechanism for animating virtually any kind of value over time.
TargetAction usage
This method is the quickest to implement and will likely integrate the easiest into an existing code base since it does not require you to use DependencyObject/DependencyProperty.
The drawback to this method is that it requires consumption of the updated values on the developer's part, instead of updating a property directly

Basic Example

1. Create an instance of the Storyboard object

Storyboard sb = new Storyboard( yourGameInstance );

Note: Storyboard automatically adds itself to your game instance's Components collection, so it will receive Update messages automatically and simply do it's work after you call Begin

2. Create one or more animations you would like your Storyboard to perform

Storyboard sb = new Storyboard( yourGameInstance );

FloatAnimation fa = new FloatAnimation()
{
   Duration = TimeSpan.FromSeconds( 1.0 ),
   From = 0.0f,
   To = 1.0f
};

sb.Children.Add( fa );

Read more: Codeplex

Posted via email from .NET Info

89. File Drag-And-Drop Support In Silverlight

|
In this entry, I will talk about drop support that came with Silverlight 4. It is actually very simple to use and you can take the advantage of it if you happen to create a simple Silverlight Image Editor. This is a simple introduction to an editor currently I am working to customize images and in future apply adobe effects. However, in this entry, I will talk about only image(s) drag and drop from external place to your Silverlight application.

You can see the live example here [live demo]  

The SOURCE CODE(.zip) is at the end of the page for download.

First I will start coding drag feature. An image at the moment can easily be dragged using the default MouseDragElementBehavior. So just add that to your image and it will become draggable as shown in the code below.

MainPage.xaml

   <Grid x:Name=”LayoutRoot” Background=”Black”>
       <Image x:Name=”DropImage” Width=”400″ Cursor=”Hand”>
           <i:Interaction.Behaviors>
               <ei:MouseDragElementBehavior ConstrainToParentBounds=”True”/>
           </i:Interaction.Behaviors>
       </Image>
   </Grid>

Silverlight is too fun, when coding gets this simple  . So the image can now be dragged around. Now lets add the drop feature.

Read more: Sharker Khaleed Mahmud Silverlight Tips & Tricks

Posted via email from .NET Info

Lynis

|
Description
Security and system auditing tool
Project information
Lynis is an auditing tool for Unix (specialists). It scans the system and available software, to detect security issues. Beside security related information it will also scan for general system information, installed packages and configuration mistakes.

This software aims in assisting automated auditing, software patch management, vulnerability and malware scanning of Unix based systems. It can be run without prior installation, so inclusion on read only storage is no problem (USB stick, cd/dvd).

Lynis assists auditors in performing Basel II, GLBA, HIPAA, PCI DSS and SOX (Sarbanes-Oxley) compliance audits.

Intended audience:
Security specialists, penetration testers, system auditors, system/network managers.

Examples of audit tests:
- Available authentication methods
- Expired SSL certificates
- Outdated software
- User accounts without password
- Incorrect file permissions
- Firewall auditing

Current state:
Stable releases are available, development is active.

Read more: Lynis

Posted via email from .NET Info

Die-hard bug bytes Linux kernel for second time

|
The Linux kernel has been purged of a bug that gave root access to untrusted users – again.

The vulnerability in a component of the operating system that translates values from 64 bits to 32 bits (and vice versa) was fixed once before – in 2007 with the release of version 2.6.22.7. But several months later, developers inadvertently rolled back the change, once again leaving the OS open to attacks that allow unprivileged users to gain full root access.

The bug was originally discovered by the late hacker Wojciech "cliph" Purczynski. But Ben Hawkes, the researcher who discovered the kernel regression bug, said here that he grew suspicious when he recently began tinkering under the hood of the open-source OS and saw signs the flaw was still active.

“I showed this to my friend Robert Swiecki who had written an exploit for the original bug in 2007, and he immediately said something along the lines of 'well this is interesting,'” Hawkes wrote. “We pulled up his old exploit from 2007, and with a few minor modifications to the privilege escalation code, we had a root shell.”

Read more: The Register

Posted via email from .NET Info

Tunneling SSH over HTTP(S)

|
This document explains how to set up an Apache server and SSH client to allow tunneling SSH over HTTP(S). This can be useful on restricted networks that either firewall everything except HTTP traffic (tcp/80,tcp/443) or require users to use a local (HTTP) proxy.

A lot of people asked why doing it like this if you can just make sshd listen on port 443. Well, that might work if your environment is not hardened like I have seen at several companies, but this setup has a few advantages.

You can proxy to anywhere (see the Proxy directive in Apache) based on names
You can proxy to any port you like (see the AllowCONNECT directive in Apache)
It works even when there is a layer-7 protocol firewall
If you enable proxytunnel ssl support, it is indistinguishable from real SSL traffic
You can come up with nice hostnames like 'downloads.yourdomain.com' and 'pictures.yourdomain.com' and for normal users these will look like normal websites when visited.
There are many possibilities for doing authentication further along the path
You can do proxy-bouncing to the n-th degree to mask where you're coming from or going to (however this requires more changes to proxytunnel, currently I only added support for one remote proxy)
You do not have to dedicate an IP-address for sshd, you can still run an HTTPS site

Read more: DAG

Posted via email from .NET Info

Tunneling SSH over HTTP(S)

|
This document explains how to set up an Apache server and SSH client to allow tunneling SSH over HTTP(S). This can be useful on restricted networks that either firewall everything except HTTP traffic (tcp/80,tcp/443) or require users to use a local (HTTP) proxy.

A lot of people asked why doing it like this if you can just make sshd listen on port 443. Well, that might work if your environment is not hardened like I have seen at several companies, but this setup has a few advantages.

You can proxy to anywhere (see the Proxy directive in Apache) based on names
You can proxy to any port you like (see the AllowCONNECT directive in Apache)
It works even when there is a layer-7 protocol firewall
If you enable proxytunnel ssl support, it is indistinguishable from real SSL traffic
You can come up with nice hostnames like 'downloads.yourdomain.com' and 'pictures.yourdomain.com' and for normal users these will look like normal websites when visited.
There are many possibilities for doing authentication further along the path
You can do proxy-bouncing to the n-th degree to mask where you're coming from or going to (however this requires more changes to proxytunnel, currently I only added support for one remote proxy)
You do not have to dedicate an IP-address for sshd, you can still run an HTTPS site

Read more: DAG

Posted via email from .NET Info