Kamis, 07 April 2011

Silverlight: How to Communicate with Desktop Application via HTTP

IntroductionThis article is a free continuation of How to Receive Messages from a Desktop Application and How to Send Message to a Desktop Application where the Silverlight application communicates with the standalone .NET application via TCP. In this article, I would like to show how to implement the communication via HTTP. The example below implements a .NET application as a service and a

Android Fundamentals: Working With Content Providers

The TutList application that we’ve been working with has a pretty big flaw right now: the article data is not “live”, but static content. In this tutorial, you take several more steps towards a flexible and expandable solution by modifying the application to act as a data-backed content provider. The Android framework uses a concept called content providers to enable applications to share and use

WCF ExceptionHandling in Silverlight

I have recently done some LOB application development in Silveright in which we used a WCF service to communicate to the backend. There was an unexpected surprise that Exceptions throw in the WCF service were not transferred to the Silverlight Client! In Silverlight you always get a System.ServiceModel.CommunicationException: The remote server returned an error: NotFound.... error. We wanted to

Getting something better than “Server not found.” from WCF in Silverlight

When developing applications in Silverlight it is inevitable that you will need to perform a request back to the server for data or processing. The common practice is to use Windows Communication Foundation (WCF). I find that WCF usually handles all of my needs and it works well when everything is happy and just right. However, if anything is not in its correct place, we can have tons of problems

HttpContext.Current returning null when using NetTcpBinding in WCF4

When using NetTcpBinding, not all of the features of WCF are available, particularly those using HTTP. NetTcpBinding removes a dependency on HTTP (and IIS as a result, allowing the service to be hosted in WAS instead.) HttpContext.Current is one of the features in WCF that is not available when using NetTcpBinding.Read more: WF, WCF, and AppFabric notes Posted via email from Jasper-net

Memcached for Dummies

The other day I was chatting with a colleague about Memcached.  Eviction policy came up, and I casually mentioned that Memcache isn't strictly LRU.  But a quick Bing search said Memcache is LRU, like this Wikipedia entry.  Hmm, I was 99.9% sure Memcache is not LRU, something to do with how it manages memory, but maybe I was wrong all these years.  After reading through some Danga mailing lists

How to implement Template Binding in Silverlight Custom Control?

Continuing to our 2nd chapter of the series here on Silverlight Custom Control. In this chapter we will discuss on dynamically setting the Content and other properties to our Custom Control that we implemented earlier. After reading this article, you will be able to create properties and set content dynamically to your control.  So, lets start describing them and learn something again today.

10 Steps to Initiating an OpenStack Cloud Service

OpenStack currently consists of three main components: Nova (Compute), Swift (Object Storage), and Glance (Image Service). There are some other projects such as a dashboard and mobile apps as well. You can see the full list here. This is great start, but in order for OpenStack to compete long term, other infrastructure and platform services will need to be brought in. I’d like to talk about the

טיפ: איך לעבוד עם jQuery בתוך ויז’ואל סטודיו 2010

כדי לספק ממשק משתמש עשיר וחוויתי באפליקציות Web, קשה להמנע כיום משימוש בספריית JavaScript כלשהי. jQuery היא ספריית ה- JavaScript הפופולריות ביותר כיום, ואם עדיין לא יצא לכם להתנסות בה, כדאי שתציצו במדריך jQuery באתר וובמאסטר. פוסטים קשורים שכדאי לקרוא: NuGet – תשתית קוד פתוח לניהול ספריות ותוספות לאפליקציות Web jQuery בגירסה 1.5.1 כעת תומך באינטרנט אקספלורר 9מיקרוסופט תורמת קוד ל- jQuery (מנוע

Mono Android and iPhone Updates

Today we are happy to release Mono for Android 1.0 as well as MonoTouch 4.0.Both products allow you to use the C# language to write applications that run on Android and iOS devices. Both products are based on the latest Mono 2.10 core. The Parallel Frameworks can be used to write more elegant multi-threaded code across all devices, and automatically takes advantage of multiple cores available on

3 simple and effective tips to improve your classes in C#

The other day I was taking a look to a C# Web application develop by a co-worker. The application was fine and it delivered the functionality proposed. Nevertheless, I found some common errors (or things to improve) in the way the classes were written. Let’s go ahead with some simple and useful tips to write C# classes. Tip # 1: Define only one class per file.C# allow us to define more than one

MonoTouch 4.0

We just released MonoTouch 4.0, a product to build iOS applications using C# and .NET. We also released our new Mono for Android product.New in MonoTouch 4.0MonoTouch 4.0 is a major upgrade to our product as it upgrades the Mono runtime engine from the old, trusted and friendly Mono 2.6 to the latest and greatest Mono 2.10 core, these are some of the new features available as part of this upgrade

Microsoft clarifies HTML5 v Silverlight

Microsoft has learned its lesson and, not wanting to alienate or spook its Silverlight developers yet again, has posted a carefully crafted blog post that explains its position vis-a-vis Sliverlight and HTML5.  Only a short time ago Microsoft upset a lot of developers by claiming that HTML5 was the way of the future, a fine sentiment, and that Silverlight was only for Windows Phone 7 - not such

How to design a Custom Control by editing the Part Template?

This is a continuation to my previous post "How to create a Custom Control in Silverlight?" In this tutorial part, we will discuss on the template and modify our basic template to give a better look as per our need. In this chapter, we will learn about template Part and how to modify the existing template.  Read out more to learn in depth about Custom Control in Silverlight. This will benefit you

HTML vs. Silverlight vs. WPF

At Readify we focus on the Microsoft stack - WPF, Silverlight, and ASP.NET. The bulk of our projects are ASP.NET, some are Silverlight, and even less are WPF (though the WPF projects tend to be bigger in scope, so they're probably about even). Usually the customer has decided on a technology stack before we arrive, and they've engaged us to help plan/design/build/ship the application. Sometimes

Silverlight 5 Beta Here, HTML 5, Sterling Feedback and More

I have a few things to cover on this post. I want to start with Silverlight 5 but stay tuned for some information about how you can learn more and ask direct questions about the Sterling database.  Silverlight 5 Beta is Here The Silverlight Team just officially announced that the Silverlight 5 beta will be available next week at MIX 2011. This is an exciting milestone because the new version will

Developing Native Android Applications: Not as Hard As You Might Think

Two months ago, my boss asked me to try and build a native Android application based on the mobile website I had created for the university's annual Maryland Day festival. Both he and I are part of an IT initiative in our department tasked with figuring out how best to provide IT services to smartphone users on campus, and while we have in-house expertise in iPhone development, none of us were

April MSDN magazine out now

This month’s MSDN magazine is online and ready for reading. April’s hot topic is Windows Azure – here are the highlights: Windows Azure Development: CQRS on Windows Azure Learn how Command Query Responsibility Segregation represents a shift from more classic, three-tier application architecture toward a message-based, asynchronous pattern. We walk you through a reservation booking app to

Error Handling – The C++ Way

In my experience as software developer, I noticed that there are lots of people that write in C++, but do not use exceptions. They prefer to use return codes instead. I guess that this is caused by the late addition of exceptions in the C++ standard. Whatever the reason is, personally, I prefer to use exceptions as an error handling technique. Almost 10 years ago I started programing in Object

Tron legacy

How the Tron:Legacy movie was filmed. I spent a half year writing software art to generate special effects for Tron Legacy, working at Digital Domain with Bradley "GMUNK" Munkowitz, Jake Sargeant, and David "dlew" Lewandowski. This page has taken a long time to be published because I've had to await clearance. A lot of my team's work was done using Adobe software and Cinema 4D. The rest of it got

Getting the CLR Version

The .NET common language runtime (CLR) is the run-time environment that executes managed code developed in .NET languages such as C# and Visual Basic. The version of the CLR varies for different versions of the .NET framework. Common Language RuntimeThe common language runtime (CLR) is a core part of the .NET framework. It is responsible for executing managed code created using languages such as

Type conversions with implicit and explicit operators

Introduction In this article I'm going to describe about how to use type conversion operators (implicit & explicit) in user-defined classes. We commonly come across situations in which a same real-world entity is represented in two different classes. For ex. when integrating two sub-systems into one, we see an entity is represented as Author in one sub-system and as Writer in other.  Although, in

Why override ToString()? Use DebuggerDisplayAttribute instead

Debugging and Runtime InspectionThe Visual Studio 2010 debugger is an awesome tool, no doubt about it. It's likely the most powerful and capable debugger ever developed for Windows or any other platform. And yet, there are times when you wish it 'knew' or exposed more detail. When you're debugging a runtime instance of your application or inspecting a mini-dump to gain insight into the state of

Dapper - a simple object mapper for .Net

FeaturesDapper is a single file you can drop in to your project that will extend your IDbConnection interface. It provides 3 helpers:Execute a query and map the results to a strongly typed Listpublic static List ExecuteMapperQuery(this IDbConnection cnn, string sql, object param = null, SqlTransaction transaction = null) Example usage:public class Dog{    public int? Age { get; set; }    

Google Python Class Day 1

Welcome to Google's Python Class -- this is a free class for people with a little bit of programming experience who want to learn Python. The class includes written materials, lecture videos, and lots of code exercises to practice Python coding. These materials are used within Google to introduce Python to people who have just a little programming experience. The first exercises work on basic

My Experiences in Silverlight 4 : Writing re-usable Controls

These days I am working on Silverlight and creating Custom controls which would be re-usable in another projects. And when you set out to write re-usable Silverlight controls, Silverlight toolkit is the best code to look up to. When you download the Silverlight toolkit. The toolkit installer also copies source code of the toolkit at           “%Program Files%\Microsoft SDKs\Silverlight\v4.0\

Login / Registration Form: Ideas And Beautiful Examples

All throughout the modern web, we are seeing a growing amount of places for user input. These include shopping carts, interactive web games, and most certainly website registration forms. It seems that not only should designers be focusing on page design, but form aesthetics are also equally vital role. Consider how many forms you may have filled out over the course of your Internet history.

Video Tutorial: Android Application Development - BaseActivity

Class 5, Part 1. This video comes from Marakana's 5-Day Android Bootcamp Training Course which Marko Gargenta taught in San Jose, CA earlier this year. Now, that you've created the Timeline activity, you're going to give it an options menu that will allow users to toggle the service on/off. Instead of copying and pasting code that we've already written, we're going to again refactor the code.

Decompiler Design - Introduction

IntroductionDecompilation is a form of reverse engineering of computer programs. Its goal is to convert a compiled binary file into a source file. One may want to do this for several reasons, such as to understand how a program works, or to try to modify a program to enhance it or fix a bug. Decompilation has been around for many years, probably ever since people started to compile programs from

DBX vs. Visual Studio and WinDbg: Part 1, Calling Functions

I’ve recently had an enlightening experience teaching a C++ Debugging course to a group of developers who are transitioning from a Solaris environment to Windows and Visual Studio. This hasn’t been an easy transition for them, and the course wasn’t easy to teach—specifically, because one of the most discussed topics was feature parity between DBX (the debugger of choice for C++ applications on

C# Tutorial - Triple DES Encryption

The Data Encryption Standard (DES) has been around since the 70's, enjoyed wide-spread adoption, and has since been retired due to its small key length and ease of brute-force attacks. Triple DES, which is basically the same approach times three, aimed to remove the practicality of attacks while keeping the same basic algorithm. Although it's slowly being replaced by AES, triple DES is still a

Java: Ignore/Trust an invalid SSL cert for https communication

Very Once a while you will need your Java app to talk to a pre prod server (Web Service) over https, but you face the issue is that SSL is not a valid/expired/self signed cert...  You may get an error that looks likeorg.springframework.web.client.ResourceAccessException: I/O error: sun.security.validator.ValidatorException: PKIX path building failed:

RecoverableException for .NET Framework Solutions

Do you remember the good ol' days before the ApplicationException class in the .NET Framework became "persona non grata"? I sure do. If you were to look at .NET code that I wrote years ago, you'd probably see ApplicationException being used all over the place. After all, this seemed like a great way to differentiate between "expected" errors in your code (e.g. a violation of some business rule)

Text Encoding and WCF

For the most part setting the encoding (UTF-8, UTF-16, etc.) on a WCF service is pretty simple:  set textEncoding on basicHttpBinding/wsHttpBinding or encoding on a textMessageEncoding in a customBinding.  It works in almost all cases, but there’s a surprising number of ways of indicating the encoding of message: the content type of the messagean XML declaration at the start of the messagea BOM (

Selasa, 05 April 2011

Virtual Function in C#

Unlike Java, when developing in C# the functions we define aren't automatically virtual. Turning a function into a virtual one involves with several steps. The following video clip (hebrew) explains how to define a virtual function and explains its meaning.  Read more: Life Michael Posted via email from Jasper-net

30 Very Useful Add-ons That Works Great With Firefox 4

The totally redesigned Firefox 4 was launched on 23rd March, 2010 and some of you may be giving it a try. I hope you are liking the new version of Firefox that has come up with great speed enhancements, new and minimal looks, pin-up your favorite web apps like Windows 7, panaroma view of your tab pages to battle tab clutter, do not track features to block your browsing behaviors and much more.

Silverlight: Xaml Blend Namespace Error Not Resolved

XAML Namespace http://schemas.microsoft.com/expression/blend/2008 is not resolved. This error can occur when certain Xaml elements added by blend have not been properly ignored during non design/debug situations and Blend or Visual Studio reports such error. To resolve the error one must add the mc:Ignorable attribute to the namespace declarations to inform the Xaml compiler to ignore a specific

Dirty Dirty Silverlight Hack... - Silverlight 4 Hack: Use Native/Desktop CLR Without COM Registration

Here is a hack of the month. Jeremiah is probably my favoriate Silverlight Prodagy and he has done it again with this wonderful hack, 'Use Native/Desktop CLR Without COM Registration' I like the first line, "WARNING: Information and code here can easily be abused. Please do not use it as a crutch in application planning, but more for utter despair or experimentation. Thus I wrote this blog post

The principles of Microsoft Metro UI decoded

Issue presentedMetro in itself has its own design language attached, they cite a bunch of commandments that the overall experience is to respect and adhere that is to say, someone has actually sat down and thought the concept through (rare inside Microsoft UX). I like what the story is pitching and I agree in most parts with the laws of Metro that is to say, I am partially onboard but not

How to create a Custom Control in Silverlight?

I am working on Silverlight since 3 years and during the initial period I had a fear on creating Custom control. I was more confident creating UserControls during first one and half year of my job. But when I started working on custom controls, I came to know the power of custom control and all the fear gone out of my eyes.  It's around 2 years, I am working on it and every time I am exploring

First look at the future of application deployment on Windows 8: AppX

In an app-centric world, Windows 8 will be adopting the trend full-on with a Swiss Army Knife full of new tricks. One of which is a new universal application deployment system called AppX which I’ve been recently been able to take a first look at. Although Windows 8 will disrupt many components of applications, including how they are written (Immersive) and distributed (application store), AppX

How to sniff web traffic from Marketplace-based Android applications

There are cases when it is necessary to track the outgoing and incoming traffic related to Android applications. However, Android as a platform is not really friendly towards this kind of operations. The most common way I am analyzing the traffic that is targetting a mobile device is by setting an ad-hoc wireless network while my computer is connected to a wired connection. Both Windows Phone 7

So many interfaces!

Today, another question from StackOverflow, and again, presented as a dialogue as is my wont.The MSDN documentation for List says that the class is declared as public class List : IList, ICollection, IEnumerable,                        IList, ICollection, IEnumerableDoes List really implement all those interfaces? Yes.Why so many interfaces?Because when an interface like IList

Senin, 04 April 2011

SLAAC Attack – 0day Windows Network Interception Configuration Vulnerability

Windows machines compromised by default configuration flaw in IPv6As anyone who has watched the reimagined Battlestar Galactica will tell you, Sixes are trouble. They are undoubtedly alluring, but all the while they are working covertly, following The Plan, right under the noses of their targets. Nobody realizes the true nature of the threat until it’s too late. The Internet also has its own Six,

New Flex Touchscreen Interface Demonstrated Using Google Maps

At Interaction 2011, a research group including members from Osaka University demonstrated a new control interface for touchscreens that flexes when scrolled. In the demonstration, the flex interface was used with Google Maps. This method treats content on the screen as an elastic, flexible material. Parts of the content that are normally pushed outside the screen by scrolling are distorted to

Snow – A Slick And Modern Web UI Kit

Each individual element has been hand-crafted with attention to detail for a truly pixel perfect result, and all layers are grouped and organized for ease of use. This UI kit was designed for us by MediaLoot. Read more: Spyre studios Posted via email from Jasper-net

Efficient Paging In Silverlight 2.0

When it comes to ASP.NET, I am a huge fan of efficient code, and one of the most efficient ways to retrieve data from the server is to use paging. Paging has been around for a long time now, but it is not available out of the box in Silverlight 2.0. I thought this was a good time to demonstrate how to consume a WCF service in Silverlight, and to create efficient server side paging using LINQ.

ListBox Paging in Silverlight 4 using DataPager control

Prior to Silverlight 4, implementing paging in an application would require the developer to create controls, that would allow the user to move from one page to another. Check an old article by Malcolm Efficient Paging In Silverlight 2.0 which shows how to create and consume a WCF service in Silverlight 2.0 and use efficient server side paging using LINQ to page through event log data. With the

GPS spoofing the new game in town

There have been comments and minor warnings about GPS spoofing before, but now we have examples of it in action and it turns out to be very easy. GPS and location awareness in general is increasingly popular because it allows applications to deliver a local experience. The very nature of the sort of application that provides local information makes it difficult to see why anyone would bother to

Analyzing a Stuxnet Infection with the Sysinternals Tools, Part 1

Though I didn’t realize what I was seeing, Stuxnet first came to my attention on July 5 last summer when I received an email from a programmer that included a driver file, Mrxnet.sys, that they had identified as a rootkit. A driver that implements rootkit functionality is nothing particularly noteworthy, but what made this one extraordinary is that its version information identified it as a

Using Memory-Mapped Files

IntroductionMemoryMappedFile is an interesting new class in version 4.0 of the .NET Framework which resides in the System.IO.MemoryMappedFiles namespace. A memory-mapped file is a feature of the Windows operating system which allows memory to be shared between two or more processes running on the same machine. It requires much less overhead than other methods of inter- process communication such

10 tips on working fast in UNIX

Have you ever amazed to see someone working very fast in UNIX, firing commands and doing things in mille seconds? Yes I have seen and I have always inspired to learn from those gems of guys. This article or tutorial or whatever you call it I have dedicated to share UNIX command practices I follow to work fast, quick or efficiently in UNIX. I work for financial services industry and my work

Free Borland C++ 5.5 Compiler

Abstract: The free Borland C++ 5.5 Compiler official download pageThe new official page for the free Borland C++ Compiler download is http://www.embarcadero.com/products/cbuilder/free-compiler.  Visit the free C++Builder Compiler download page to:Download the free C++ compiler - the classic 5.5 version of the Borland C++ compiler Learn about C++Builder Starter - a low-priced entry-level edition

Anatomy of a .NET Assembly - The CLR Loader stub

In Windows XP and above, the OS loader knows natively what to do with .NET executable assemblies, and fires up an instance of the CLR. However, .NET also runs on Windows 98, ME, NT 4.0, and 2000. When you run a .NET assembly on the older operating systems, the CLR has to be loaded somehow. This is the job of the CLR loader stub; a section of native code within a .NET assembly. Executing a PE

Exploring Cocoa with MonoMac and C# – Chapter 1 – Getting Started – Part 1

Below, you will find the outline of what you will learn in this chapter:What you need.Getting Setup. Installing MonoMac add-inMonoMac from source.What you need:Readers will need several things to effectively use these tutorial articles: Apple Macintosh: You need an Apple Macintosh to build and deploy an application targeting the Apple Macintosh Desktop using Cocoa. If you do not want to layout

Create your first RESTful service with WCF 3.5

What is REST: read more about REST here  REST is a term coined by Roy Fielding in his Ph.D. dissertation to describe an architecture style of networked systems.  REST is an acronym standing for Representational State Transfer.Problem with SOAP: In particular web scenarios, it is necessary to have high interoperability and to use only XML messages for transmitting over HTTP without the advantage

NHDatabaseScopes

Project DescriptionNHDatabaseScopes is bunch of examples how to effectively do integration testing with NHibernate and embedded database (SQLite and MS SQL Server Compact Edition). It is not meant as production ready library. OverviewExamples in this project were created with two goals in mind: isolation and speed. There is one issue with keeping execution time low enough when doing integration

+1’s: the right recommendations right when you want them—in your search results

Our goal at Google is to get you the most relevant results as quickly as possible. But relevance is about relationships as well as words on webpages. That’s why we recently started to include more information from people you know—stuff they’ve shared on Twitter, Flickr and other sites—in Google search results. Today we’re taking that a step further, enabling you to share recommendations with the

NoSQL explained correctly (finally)

Now here is a definition of “NoSQL” that I can agree with:A very interesting write-up with one little oversight: you’re wrong. I am part of a large program to write a NoSQL database for military applications. It’s not a backlash against paying Oracle (the DoD has a blanket license for Oracle installations) or a philosophical stance by the hippies in the defense arena; it’s the fact that RDBMSs

Cross machine communication between .Net Application using WCF

When service and client both are of .Net and resides on different machines then we choose preconfigured netTcpBinding to publsih WCF Service to the client. netTcpBinding is best suited when both client and service are of .Net and communicating to each other either over Intranet or Internet. Since both the service and client are in .Net, so performance of this binding is very much optimized for

Compiler Internals - How Try/Catch/Throw are Interpreted by the Microsoft Compiler

IntroductionBefore I start with my article, I would like to mention some important things. The most important fact you should always keep in mind is that this article is not (and should not be) a detailed reference on x86 exception handling, but a first introduction on it. While some things probably are not exactly represented as they are done in the real world, the article sheds some light on

Examples of COM Automation in Silverlight 4

IntroductionIn the previous article we talked about COM automation support introduced in Silverlight 4 and we said that COM automation is available only for Silverlight OOB (Out-of-Browser) applications that have Elevated Trust, and that's one of the security restrictions imposed by Silverlight. Today, we're going to talk about COM automation in more details and give few Silverlight examples that

הלוח העברי בעזרת TSQL (2)

לפני כשנה מאיר דודאי ציטט קוד לפונקציה שמחשבת את התאריך של פסח, וגם שאל בקריצה אם טרם יצרתי פונקציה כזו בעצמי. למען האמת יש לי סקריפט פשוט שמחשב את התאריך המדוייק של פסח מיציאת מצרים ועד לביאת המשיח: וברצינות- הפונקציה הנ"ל (ניתן למצוא אותה כאן בצירוף פונקציות נוספות) מתבססת על נוסחה שפיתח גאוס - מתמטיקאי גרמני שהיה אולי גדול המתמטיקאים מאז ומעולם, ואם לא- אז בוודאי בחמישיה הפותחת; ואשר נועדה

Parse XML Documents by XMLDocument and XDocument

IntroductionThis article demonstrates how to parse XML documents using "XMLDocument" as well as "XDocument". Background"XML" and the parsing of XML documents are very old topics and it is not very common for us to directly work on XML documents. But once a while, you may find that you are given some raw XML documents and you need to parse them. This article is to demonstrate how to use the two

C# Convert Generic Type

I am posting this because I didn't see a simple solution on the first few hits when searching the net.If you have a generic class of type T and you want to using it with basic types such as int, long, etc. You can use the following method to do the casting: class myClass{   private int myVal;   public T Get()   {      return ((T)(Convert.ChangeType(myVal, typeof(T))));   } }enum SomeEnum { One

How to install Zimbra Desktop on Ubuntu 10.10 (Maverick)

Zimbra Desktop is the next-generation email and collaboration client.The free Zimbra Desktop client allows you to meld the online and offline worlds – storing and synching your email, calendar, contacts, files and documents in the cloud, yet having them locally accessible when on the road. Zimbra Desktop aggregates information across accounts (Zimbra, Yahoo! Mail, Gmail, Hotmail, etc.) and

How to find startup ideas that make money

I am glad that my previous blog post Sorry, your “cool” webapp is probably not going to make money received good response and generated a lot of debate. What I discussed in that blog post was that most of the so called startups or webapps which are based on “game-changing” or “cool” ideas never end up making any money. So, if your aim is to make money, pursuing such ideas can be risky. While

Symbian OS becomes OpenSource

Symbian OS , Nokia’s popular mobile OS is now opensourced .Nokia , in its blog post recently accounced that it is making its primary Mobile OS – Symbian available for its platform development partners . Th sourcecode of SYmbian is made available at https://collab.symbian.nokia.com/home , a site that is dedicated in providing tools & services to support development on the Symbian operating

Dynamically load embedded assemblies – because ILMerge appeared to be out.

At work, I started building a .net assembly that would probably find its way into a number of the server processes and applications around the shop. This particular assembly was going to end up containing quite a number of external open source references that I didn’t want to expose to the consumer of my library. I set out to solve several simple requirements.Easy to use. Should be nothing more

WCF streaming inside data contracts

In order to support transferring of large messages (e.g., uploading or downloading a large file), WCF added support (since its first version) to streaming message transfer – unlike the default behavior, which is to buffer the entire message prior to sending it to the wire (or delivering it to the application layer, in the receiving end). Buffering has lots of advantages – it is faster, it allows

Способы размещения служб WCF. Часть 3: размещение в среде Windows Process Activations Services

Windows Process Activation Service (WAS)  - это среда, которая управляет активацией и жизненным циклом рабочих процессов, в контексте которых выполняется служба WCF. Модель WAS, в отличии от IIS предоставляет возможность использовать не только протокол HTTP, но и такие протоколы как TCP, Pipes и др. WAS является дополнением к IIS и включена в Windows Server 2008. WAS имеет следующие преимущества:

How Can You Load Test WCF Services?

There are several techniques that have been created to load test WCF Services. These include commercial and open source tools like WCF Load Test available on CodePlex. I have seen several packages over the past few years to perform load testing on web pages and web services including the load testing tools built into Visual Studio. Some were easy to setup, others not so much. WCF Services are

Little-known gems: Atomic conditional removals from ConcurrentDictionary

ConcurrentDictionary, first introduced in .NET 4, is an efficient dictionary data structure that enables thread-safe reading and writing, meaning that multiple threads may all be accessing the dictionary at the same time without corrupting it.  It supports adding through its TryAdd method, conditional updates through its TryUpdate method, non-conditional adds or updates through its

NHibernate Id Generator With Suffix

I had recently the need for using an id generator with two requirements:Is DB-independentAllows data generated in different sites (DBs) to be merged into a centralized DB I already knew about HiLo generator, and it seemed fine, except that the generated ids, on different sites, would most probably clash, unless I would setup a particular configuration leaving lots of room, and would constantly

MySQL tools released by Google

Various tools for managing, maintaining, and improving the performance of MySQL databases, originally written by Google. Libraries:pylib/db.py: Easily execute queries in parallel on a sharded databaseDepends on MySQLdb. Most tools here depend on it.permissions_lib/: Manage MySQL permissions in a Python-based format parser_lib/: Parse SQL and apply rules based on the parsed outputDepends on

C# Threading free book

Free online book about C# multi-threading. Explains just everything from the very begging Why ? Where ? How? and continue to very granular of inter-thread safe locking technics  and multi-process communication.  Including latest classes/samples for .NET Framework 4 Introduction and ConceptsJoin and SleepHow Threading WorksThreads vs ProcessesThreading’s Uses and MisusesCreating and Starting

Minggu, 03 April 2011

How To Find Which Control Raised PostBack

There are times in asp.net when I really want to know which control in the page raised caused the page to post back. An easy way to find this is to register an event with the control that raises PostBack and cast the sender property to the appropriate control as shown below. As shown in the above code I am casting the sender property to the appropriate control to find out which control raised

Google Talk Guru

Google Talk now has a chat bot called Guru that will answer your questions - but don't get too excited for a guru it doesn't understand much and could do better.  Google Talk Guru is a simple bot that lets you ask questions using Google Talk. You can phrase your questions in a fairly natural sort of English and Google's search engine and other servers will attempt to find an answer for you . You

ClickOnce Licensing HTTPHandler

IntroductionI've recently been working on a small application I intended to sell publicly and I was faced with the dilemma of how to deploy it for an individual user. My initial approach was with an MSI but this seemed a bit clumsy, especially around updating, and required me to learn quite a bit about installers that I didn't really care for. ClickOnce seemed like a much simpler alternative so

Cracking Stuxnet - a beginner's guide

Ralph Langner is the German control system security engineer who discovered what the Stuxnet virus was supposed to attack - i.e. the Iranian nuclear program. In a TED Talk he explains how he worked out what the virus was doing and, if you are not a control security specialist, it's quite an eye opener. The Stuxnet Windows worm was discovered in July 2010 and at first it was a mystery. It was

Even more about CPUs: What is CPU Caching?

Well, the slowest steps in the fetch-execute cycle are those that require accessing memory (Englander, 2007). CPU caching is a technique developed to minimize the impact that accessing memory has on the overall processing performance of a CPU. The technique involves placing a small amount (or multiple amounts) of high-speed memory between the CPU and main memory. This memory is referred to as

Little-known gems: Atomic conditional removals from ConcurrentDictionary

ConcurrentDictionary, first introduced in .NET 4, is an efficient dictionary data structure that enables thread-safe reading and writing, meaning that multiple threads may all be accessing the dictionary at the same time without corrupting it.  It supports adding through its TryAdd method, conditional updates through its TryUpdate method, non-conditional adds or updates through its

ASP.NET: Obfuscating the Querystring

Some time ago I answered somebody's post on the MS C# newsgroup. This person was trying to "pass a connection" to another ASP.NET application from a redirect or a link and couldn't figure out how to do it. Of course, you wouldn't be able to pass the connection object itself (nor should you even try) but you could put the connection string to create it on the QueryString, grab it back out in the

More on Cores: Single Core? Dual Core? Quad Core? What's the Difference?

The core of a processor refers its components, along with system memory, that facilitate the fetch-execute cycle by which computers read (fetch) and process (execute) the instructions of programs. Although the physical implementation of a chip depends upon its architecture, all CPUs consist of two logical components: the arithmetic/logic unit (ALU) and the control unit (CU) (Englander, 2003).

Open Window, Dialog or Message Box from a ViewModel – part 2

In my previous post I have shown how to open a Window bound to a view-model triggered by the view, using a simple Action. In this post I'll show how to open a Window, triggered by the view-model. Opening a window directly by the view where the view decides when a Window should be opened, is an incorrect approach since the view shouldn't make that decision. This decision belongs to the Application

C# Adds Duck Typing, Latin keyword

It’s that time of year when I announce another new C# feature: robust duck typing.The C# language team chose a syntax that makes duck typing an opt-in feature, you specify it by using the new ‘duck’ keyword. Compare these two type definitions (note bold text): public class Foo{    public int Compare(Foo right) { ... }}public anatis Foo{    public int Compare(Foo right) { ... }} The first case is

SQL Server: TSQL Script to Get Hard Drives Detail

Recently, I need a script which can provide me detail (Driver Letter, Drive Label, Free Space, Used Space etc) of all installed hard drives. I found following script by G. Rayburn very helpful. Valid for versions: SQL Server 2005 and aboveNote: Before executing script, don't forget to enable Ole Automation Procedures from Surface Area Configuration or using sp_configure. /************************

Deciphering a SOAP fault with a 400 status code

Recently working with a partner I came across a solution for a limitation in WCF error handling.  The root of the issue is a difference between SOAP 1.1 and SOAP 1.2 in the allowed HTTP status codes when a SOAP fault is returned.  For SOAP 1.1, the status code must be 500 “Internal Server Error”.  For SOAP 1.2, it varies based on the type of the SOAP fault.  For env:Sender, the status code is 400

Jumat, 01 April 2011

Permutations in C# Using Recursion

IntroductionRecently, while searching for a method to descramble a string of characters, I came across an article by Alexander Bogomolny, entitled ‘Counting and Listing All Permutations’. The article, from Interactive Mathematics Miscellany and Puzzles, introduces three separate algorithms all capable of generating a list of permutations for a given set of elements. To rewrite a word descrambler

6 steps to implement DUAL security on WCF using User name + SSL

Introduction and Goal Basics Transport and Message level security Step 1:- Customize ‘WsHttp’ Bindings with security mode and credential type Step 2:- Create your custom validator class Step 3:- Define runtime behavior  Step 4:- Define SSL for your WCF service Step 5 :- Consume WCF Service Step 6: Run your WCF service Source codeMy other WCF articles Introduction and Goal In the article we will

Kamis, 31 Maret 2011

Add Facebook Like to your Silverlight Application

IntroductionIn this article you will find out what you need to do if you want to add a Facebook Like button to your Silverlight application. If you want to see a Live Example see my XAML blog.Using the codeThe strait forward approach is to add a button to your application and make it look the same as the one on Facebook. Then you need to Facebook authenticate the person that clicked the like

Silverlight, HttpWebRequest, HTTP Stacks and the UI Thread

This one comes from a customer who thought that they were seeing an issue in using the browser HTTP stack in Silverlight to make lots of HTTP requests. The issue seemed to be that the stack was blocking the UI thread and causing the UI to stutter. The suspicion was that the blocking was occurring while data was being read from the stream that is handed back to you when you’re reading an HTTP

MVVM Light - what's the Messenger?

MVVM Light offers a class specific to every ViewModel instance that is used in the context of an application - Messenger. One might ask - what exactly is it and why it is needed? The answer is simple - in a more complex application, ViewModel instances are not standalone entities. Chances are you would like to pass specific data from one model to another, and Messenger is facilitating this

convert Blend4 sketchflow to sl4 application (c#)

After making a nice project prototype you feel the need to use in a real deployment then follow the following steps.back up your project In the Projects panel, right-click the top project folder (e.g. SilverlightPrototype1), and then click Open Folder in Windows Explorer.In Windows Explorer, right-click the .csproj file (for example, SilverlightPrototype1.csproj), click Open With, and then click

BitLocker Drive Encryption Deployment Guide for Windows 7

This document describes the various aspects of deploying BitLocker™ Drive Encryption on computers running Windows® 7 Enterprise or Windows® 7 Ultimate in an organizational environment. This guide is intended for use by a deployment specialist or deployment team. It assumes that you have a good understanding of automated Windows deployment, Active Directory® Domain Services (AD DS) schema

Silverlight: Adding Google Streets View

While in drafting stage this post was originally called “ArcGIS Silverlight API: Adding Google Streets” but the only thing ArcGIS Silverlight API adds to the mix is the extraction of the coordinates from the map. For a regular Silverlight application just pass the coordinates from another source. My team leader asked me to try and add Google Street View to our map (that uses ArcGIS Silverlight

כלי הפיתוח שאתם פשוט חייבים

רגע לפני שאנחנו יוצאים לקרב המכריע רצוי מאוד לוודא שכולם עשו את ההכנות הרצויות, כדי שלא נגלה באמצע הדרך שהמימיות ריקות. גם בעולם פיתוח התוכנה צריך לבצע את ההכנות הללו. אמנם מדי פעם תמצאו חבורה מצומצמת של יוצאי ממר"ם או 8200 שמצליחים לעשות קפיצה קוואנטית ולשנות את התעשייה, אבל גם הם בד"כ הגיעו עם הרגלים ותשתיות מוכנות מהבית. אז מה צריך להכין?Source Control: המקום שבו ישמר הנכס החשוב ביותר שלכם

WPF 4: Using ObjectDataProvider for DataBinding

Windows Presentation Foundation (WPF) has provided many features for developing Data Driven applications. Using the DataBinding feature of WPF, effective data representation can easily be achieved. WPF allows developers to define an instance of the Data Access Object directly in XAML. ObjectDataProvider is one of the effective mechanisms for DataBinding in WPF. We use this provider if the

Skype Challenger Releases Viber 2.0: Free Text Messages And More

Viber Media, the Israeli startup behind the Viber service, which lets iPhone users make free calls to each other, has released version 2.0 of its application in the App Store. The company’s still gearing up for the launch of their Android application, but in the meantime the update to the iPhone app brings a couple of goodies, in particular the ability to text message other Viber users free of

Google tightening control of Android, insisting licensees abide by 'non-fragmentation clauses'?

A storm seems to be brewing over the realm of Android development. Bloomberg's Businessweek spies have received word from "a dozen executives working at key companies in the Android ecosystem" that Google is actively working to gain control and final say over customizations of its popular mobile OS. That might not sound unreasonable, and indeed Google's public position on the matter is that it's

How to send SMS in Windows Phone 7 using C# ?

The developers can make use of the SMSComposeTask launcher to send the SMS in Windows Phone 7 .To send the SMS in Windows Phone 7 using SMSComposeTask by including the namespace Microsoft.Phone.Tasks using Microsoft.Phone.Tasks; The Microsoft.Phone.Tasks namespace includes the classes necessary for all the Launcher and Chooser tasks .Now , create the instance of the SMSComposerTask and set its “

Itsy-OS Kernel: Premptive Switcher & Memory Manager

Itsy-OS v0.1 is a small 8086 operating system kernel providing two basic services: a simple preemptive task switcher and memory management. If necessary, simple IPC and task management can be added to provide the features of a traditional microkernel. Weighing in at about 380 bytes, Itsy should port well to tiny architectures.Memory Control BlocksEach block of memory is preceded by a memory

Why startups don't use .net

There have been several articles over the last couple of weeks about the usefulness of .net for startups. I will mention three: * Did the Microsoft stack kill MySpace?* Why we don't hire .net programmers* Why Microsoft could kill your startup careerEven though our company is now several years old, our HQ is still located in an office facility that is mainly for startups. Well over the time we

Android HTTP Camera Live Preview Tutorial

The Android SDK includes a Camera class that is used to set image capture settings, start/stop preview, snap pictures, and retrieve frames for encoding for video. It is a handy abstraction of the real hardware device. However, the SDK doesn't provide any camera emulation, something that makes testing camera enabled applications quite difficult. In this tutorial, I am going to show you how to use

How I store Enumerations in the Database

One of the things I come across in databases now and then is a collection of single tables with a name like "MessageType". You have a look in them and it turns out to have 6 or so rows with no foreign key relationships. Every single time it turns out to be someone had the idea to store an Enumeration (Enum) type in the database. Not a bad idea as it turns out since you can add sort options, soft

Use Python to write plug-ins for GIMP

This article is about using GIMP-Python, which is a set of Python modules that allow you to do programming in Python to automate commands in GNU Image Manipulation Program (GIMP). These Python modules are wrappers around the libgimp libraries. GIMP-Python is different from the Script-Fu extensions. In Script-Fu, a plug-in is used to execute scripts. In GIMP-Python, the Python script takes center

Building WPF and Silverlight Applications with a Single Code Base Using Prism

ContentsIntroduction Creating a Silverlight Version of Prism Creating Project Linker Test-Driven Development on Silverlight Architecting Your Application for Multi-Targeting Identifying What Can Easily be Multi-Targeted Separated Presentation Building Platform-Specific Services Avoid Inconsistencies and Try to Keep a Single Code Base Accommodate for Different Platform Capabilities Conditional

OpenSSH-LPK

The OpenSSH LDAP Public Key patch provides an easy way of centralizing strong user authentication by using an LDAP server for retrieving public keys instead of ~/.ssh/authorized_keys. Read more: Google code Posted via email from Jasper-net

Rabu, 30 Maret 2011

How can I debug WPF bindings?

Data Binding can be tricky to debug. In this post, I will share the techniques I use to debug WPF bindings, including the new debugging improvements we implemented in the latest 3.5 release. I will discuss the following four techniques: Scanning Visual Studio’s Output window for errors.Using Trace Sources for maximum control.Using the new property introduced in WPF 3.5

Thread safe observable collection

If you ever wrote something more, then standard UI input-output, you sure got into wide range of exceptions like “The calling thread cannot access this object because a different thread owns it” or “This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread”. What the problem? The problem is old like condom in my wallet

Why should I use ObjectDataProvider?

There are many ways to instantiate an object that will be used as the data source for bindings. I have seen many people create the object in code and set the DataContext of the Window to that instance, which is a good way to do this. You may have noticed that I have been adding the source object to the Window’s Resource Dictionary in most of my previous posts, which works well too. We have an

StaticResource, DynamicResource, x:Static – what’s all this about?

So, you know to write very complicated things in XAML code, but, really, do you know what’s the difference between static and dynamic resource? Do you know what’s really x:Static means? We’ll try today to understand differences and things we can do with this stuff. All those are markup extensions. Let’s start from the very beginning – MSDN A markup extension can be implemented to provide values

15 Must Know Java Interview Questions After 2 Years of Experience

Interview Questions that every developer should have the answerEnterprise Java Application development is growing every day and new features being introduced but the the beginners have always start from the basics. The questions listed below are what in general a Java developer should be able to answer after 2 years of experience. (Assuming no prior exposure to Java) Core Java1) What is the

Advanced Animation: Animating 15,000 Visuals in Silverlight

In my last post I showed a quick summary of a graphic-intensive dashboard that I helped out with.  I also mentioned that there are a lot of posts out there dogging SL and WPF rendering performance.  But if we get creative with some of the built-in controls SL has to offer we can get some pretty good drawing perf.  I wanted to elaborate on some of the techniques I used to eek-out every bit of perf

How to create your first SQL Server Integration Services (SSIS) package part-1

Table of Contents Introduction What is SSIS package?Features SSIS Import/Export Wizard Creating or maintaining SSIS packagesFeatures of the data flow taskHow to create a simple SSIS package ReferencesConclusionHistory Introduction SQL Server Integration Services (SSIS) is an excellent component with some great features of Microsoft SQL Server 2005 & 2008 edition as well. Today’s business are

Enabling dynamic compression (gzip, deflate) for WCF Data Feeds, OData and other custom services in IIS7

I'm working on a thing that uses an HttpWebRequest to talk to a backend WCF Data Service and it'd be ideal if the traffic was using HTTP Compression (gzip, deflate, etc). On the client side, it's easy to just add code like thisrequest.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate or more manuallyvar request = HttpWebRequest.Create("http://foofoo");

Fallout Mod Studio - A new mod manager for Fallout 3 and Fallout: New Vegas

Project DescriptionFOMS provides a simple, graphical, and highly useful approach to installing and managing modifications for Fallout 3 and Fallout New Vegas. It utilizes XML templates to quickly sort mods, and offer solutions to missing dependencies, conflicting mods, missing patches, and more.Read more: Codeplex Posted via email from Jasper-net

Protocol Buffers and WCF

WCF performance has many aspects. In the previous series I explored how using GZip/Deflate compression can increase performance in areas with low network latency. However, the penalty is that the CPU utilization is much higher. Therefore, it does not apply to many people's situations. Instead of compressing messages after they are built, it would be better if we could build smaller messages.

Walkthrough: Creating a Custom Installer for a ClickOnce Application

Visual Studio 2010Any ClickOnce application based on an .exe file can be silently installed and updated by a custom installer. A custom installer can implement custom user experience during installation, including custom dialog boxes for security and maintenance operations. To perform installation operations, the custom installer uses the InPlaceHostingManager class. This walkthrough demonstrates

Where do I put my data to keep it safe from ClickOnce updates?

Sometimes you want to include a file with your ClickOnce application and then update it using input from your customer. Or about your customer. Or about what your customer is doing with your application. (“You say you didn’t hit the delete button, but according to the log file, you hit it exactly 47 minutes ago.”) To include the file in your deployment, add it to your project, and set the

Senin, 28 Maret 2011

‫ביטול HTTPS במדינות רגישות

במהלך הימים האחרונים התרחשה סאגה לא פשוטה בכלל סביב סוגיית האבטחה של שירות הדואר של חברת מיקרוסופט, הוטמייל . מסתבר שלפני מספר ימים בוטלה האפשרות של משתמשים במדינות מסוימות, שבמקרה יש להן מספר מכנים משותפים, להשתמש בפרוטוקול HTTPS כאשר הם מתחברים לחשבון ה-HOTMAIL שלהם. לכאורה, זה נראה כמו מהלך מכוון של מיקרוסופט, במטרה לתמוך באותן מדינות או להקל על גופי הביון לרגל אחרי התושבים. האמת, כמו במקרים

Ubuntu Software Center to offer install-free application test drives

Sure, installing and removing applications in Ubuntu is a breeze -- tools like Synaptic, apt-get, and the Ubuntu Software Center are all very easy to use. Canonical thinks there's room for improvement, however, and it's delivering an interesting new feature to the Software Center: application test drives. Find a program you'd like to try out -- but don't necessarily want to install just yet --

How To Fix Battery Drain Issue On A Rooted Android Device

On several Android forums around the web, Android users have been regularly reporting rapidly draining batteries after flashing custom ROMs (such as Cyanogenmod 7) to their devices. In what follows, we will provide you with a step-by-step solution to said problem. The battery indicator in the status/notification bar is a reflection of the batterystats.bin file in the data/system/ directory. Every

Android SDK: Segmentation fault with dexdump / dexDecodeDebugInfo

Hi,the dexdump tool, bundled with Android SDK was identified toperform suspicious write accesses in the  dexDecodeDebugInfo function, as defined in dalvik/libdex/DexFile.c.The structural parser in dexdump failed to properly parse debug infosuch as code position info, with indications of code execution.  This could potentially be misused by remote attackers, tricking users intoopening apk/

How to work with the Silverlight BusyIndicator?

Silverlight BusyIndicator is not a new thing in Silverlight. It was first added in Silverlight 3 Toolkit in November 2009 release (if I am not wrong). In this post I will describe about this for those who wants to know about it. So, What is this Busy Indicator? Busy indicator is a tool which you can add in your Silverlight application to show a loading indication to your user while saving some

Visual C# 2010 Samples

Visual C# 2010 SamplesThe Visual Studio 2010 RTM Samples are now live!Samples and documents for C# 4.0 can be found on the Downloads page. The CSharpDynamic samples include several projects showing how to use Dynamic with Office, IronPython and other technologies. There is also a covariance and contravariance example, and an example show how to use the new IDynamicObject interface to create

Certificate Validation Callbacks in Indigo

A while back I hinted that there was another way to get solve the certificate problem when using the Https security mode in Indigo. It turns out that it's possible to register a System.Net.Security.RemoteCertificateValidationCallback event handler on the client to do custom validation of the certificate provided by the service. This gave me the hook I needed to check whether the provided

Writing Windows Shell Extension with .NET Framework 4 (C#, VB.NET) - Part 4: Context Menu Handler with Menu-item Bitmaps

In "Writing Windows Shell Extension with .NET Framework 4 (C#, VB.NET) - Part 1: Context Menu Handler", we introduced how to write Windows shell context menu handler using .NET 4: Lots of developers have this follow-up question: how can I add bitmap icons to those context menu items?  Here you are the directly working code samples from Microsoft All-In-One Code Framework!Sample download: C#,

How to create a Visual Studio add-in that launches from the Project window

IntroductionWithin Visual Studio 2010, there are two main ways to install add-ons that allow you to make modifications to a Visual Studio project. The first way is to use Visual Studio templates. Templates are a great way to duplicate work that you would commonly need to do such as add license information to the top of every class. Another way is to use add-ins. Add-ins typically run from the

HTTPS and Keep-Alive Connections

As we explore network performance on the “real-world web”, one bad pattern in particular keeps recurring, and it’s not something that our many IE9 Networking Performance Improvements alone will resolve. The bad pattern is the use of Connection: close semantics for HTTPS connections. In this bad pattern, a website allows only a single request and response on every HTTPS connection before closing

Microsoft Germany and Stereolize presents 234″ of interactive touch-screen goodness

Size doesn’t matter, unless you’re at a trade show. To prove this point, earlier this month at the annual CeBIT Germany technology fair, Microsoft Germany and long-time partner Stereolize, who specializes in elaborate interactive presentations, had an interactive screen that would even make Minority Report jealous. In what can only be described as an XXXXL-iPad, the “Microsoft Cinema” is not

Using BCrypt in a .NET Application – Why it’s better than SHA or MD5.

You guys know that I’m not a cryptography expert. In fact, I didn’t use hashing and salting well until my second year as a programmer during college. It’s recently come to my attention that using MD5 or SHA as your hashing methods is not good enough.While it does its job at hashing data, the problem is that it’s just too fast. A determined computer hacker with enough horsepower (machines) can

Hardware Accelerated Video Playback in Moonlight

David Reveman has just completed a series of optimizations in the Moonlight engine that allows Moonlight to take advantage of your GPU for the data intensive video rendering operations. This is in addition to the standard GPU hardware acceleration that we debuted a few weeks ago. This is what the video rendering loop looks like in Moonlight: Every one of those steps is an expensive process as it

Console Application to discover Effective Named Pipe Path of a WCF net.pipe Endpoint

As I have promised in my previous post, I am making available a C++ console application to troubleshoot named pipes endpoints in WCF. Below is a screenshot of the application: Application logic:It gets the endpoint from the command line and substitute the host name by +, * depending on the wildcard mode. It then add a “/” to the end if not present already and transform to up case all characters

WCF Extensibility - IServiceBehavior

This post is part of a series about WCF extensibility points. For a list of all previous posts and planned future ones, go to the index page. The first behavior covered in this series is the IServiceBehavior. It can be used to inspect or change the entire service description and runtime. For example, to collect information about all endpoints in the service, to apply some common behavior to all

WCF Extensibility – Behaviors

This post is part of a series about WCF extensibility points. For a list of all previous posts and planned future ones, go to the index page. The first part of this series will focus on the behaviors. There are four kinds of behaviors, depending on the scope to which they apply: service, endpoint, contract and operation behaviors. The behavior interfaces are the main entry points for almost all

My first Screencast Series covering Windows Touch in C++/Win32 is Live!

A few months ago, I worked on some very simple samples that demonstrate how to program Windows touch applications in Win32 using GDI for drawing and C++ as the underlying programming language.  C++ Source code accompanying the Windows Touch Screencasts is available on code gallery.  Appologies for the video not properly embedding, the embed code on the MSDN video player seems to have a bug in it.

Improving CLRProfiler 2: 19.7% in TryGetValue

Playing with Visual Studio 2010 profiler data Function Code View finds another easy target for improvement: 19.7% in calling TryGetValue on a Dictionary object: This piece of code is called in 'c' command process for logged method call information. There are just millions of method calls in the profile we're testing with. The code uses Dictionary::TryGetValue to see if a thread has unprocessed

Minggu, 27 Maret 2011

Memory-Mapped Files

A memory-mapped file contains the contents of a file in virtual memory. This mapping between a file and memory space enables an application, including multiple processes, to modify the file by reading and writing directly to the memory. Starting with the .NET Framework version 4, you can use managed code to access memory-mapped files in the same way that native Windows functions access

Open Window, Dialog or Message Box from a ViewModel – part 1

Saying that a view-model belongs to the Application layer, and the Application layer doesn't references upper layers, and must not create or use visual objects, how can I open a Window, Dialog or any kind of Message Box on-the-fly, based on some logic triggered by the view or view-model? Well, there are several options doing that, one is using kind of service which encapsulates that, providing an

Task Parallel Library Ported to Silverlight 4

Long time readers will recall that I’ve done some oddball parallel articles over the years.  I recently decided to challenge myself with porting the Task Parallel Library to Silverlight 4.  The port is complete and all unit tests pass.  I’m still profiling but I’m generally encouraged by the results. Why?A fair question.  Why do I need libraries for making it easier to write multithreaded code in

10 Tips to Secure Your Apache Web Server on UNIX / Linux

If you are a sysadmin, you should secure your Apache web server by following the 10 tips mentioned in this article.1. Disable unnecessary modules If you are planning to install apache from source, you should disable the following modules. If you do ./configure –help, you’ll see all available modules that you can disable/enable. userdir – Mapping of requests to user-specific directories. i.e ~

IIS Express Easy Launcher

Project DescriptionIIS express launcher looks at the directory where it is launched, for a iisexpress.config file, and start iis express with it. For easy access, can IIS Express Launcher be executed, from the context menu, when used on a directory.If the IIS Express Launcher cant find an config, it creates it from a standard config, found in iis express install directory. Read more: Codeplex

Jeff Wilcox’s “Metro” design guide for developers, v1.00

Let’s make our Windows Phone apps look great, ok?I am not a designer. I am not a developer-designer. I am a developer and spend my days coding. But I love the concept of “metro” design and believe that it has the potential to bring a beautiful story to Windows Phone, and potentially millions of people. This is Microsoft moving beyond battleship grey buttons for its developer base, and all we need

Sharing data in .Net 4 (Let’s make our life easier!)

Sharing large volumes of data between .Net processes running in a single machine has lacked true enterprise-level support from the core CLR and foundation classes for a long time. Since .Net 1.x there have been several solutions which fell short of perfect for different reasons. Using available .Net IPC features such as Remoting, IP sockets or Message Queues lacked the performance required to

WPF databinding trick (part 1)

The last week, one of my colleague was doing a WPF training session and she ended up having a very strange behavior with the WPF databinding engine. I’ll describe a not well-known behavior of the WPF databinding engine and I’ll try to explain how its works under the scene. Binding the Text property of a TextBlock to a collection of objectsThis is something you’re not supposed to do, but you’ll

Working with TypeDescriptor in C#

TypeDescriptor is a static sealed class which makes the starting point of the API. It exposes information of the object in terms of Properties, Attributes, Events etc in such a way that it could easily be managed and/or consumed. Even though the basic usage of TypeDescriptor is to get metadata of an object, yet it also exposes features to extend the object on the fly. Let us now discuss few

Getting Lazy with .NET 4.0

.NET 2010 comes with lots of new features. Some relates to Technology while other relates to language enhancements. The huge class library that is there with .NET framework is also enriched with new classes. In .NET 4.0 there is a new set of classes which introduces a new concept called Lazy initializes. In this article I am going to discuss how simply you can use Lazy initialize to defer the

31 Days of SSIS – The Introduction

Since I’ve been working on an SQL Server Integration Services (SSIS) project over the last six months, I thought I would blog a little about some of the tips and tricks and solutions that I’ve worked through with this project and other SSIS projects I’ve worked on.  This isn’t intended as training for learning how to use SSIS.  The intent is to help prevent some of the same difficulties that I’ve

PostgreSQL Row Storage Fundamentals

I answered a question a few days ago on Stack Overflow about PostgreSQL & SQL Server btree storage fundamentals. After I answered the question, I started thinking more and more about how PostgreSQL stores data on the row. Rather than be content to live in ignorance, I went digging through PostgreSQL’s source code and some hex dumps to find out what was going on inside a row. Getting StartedTo get

Android to unlock in-app purchase system

Google smartphone devs can soon thrive from free-to-playGoogle will next week introduce in-app purchasing on its Android operating system, the company has said. Android Market In-app Billing will allow developers to sell virtual items within games. Google smartphone users will be able to purchase the likes of custom avatar clothing, virtual weapons and extra levels. Crucially for developers, the

How to update "Run only specified windows applications" GPO programmatically (VBScript)

Hi all, A customer of mine had to add a list of thousands of applications to the "Run only specified windows applications" GPO on his Windows Server 2008. And obviously he wanted to automate this task to avoid adding them manually one at a time.  So I went the easy way and created the following VBscript that simulates a user entering the application names on the "List of allowed applications" in

Introducing the Kinect WPF Toolkit

Kinect is fun. Kinect is new. Kinect is awesome. However, doing anything in Kinect right now requires developer work – and even with the available building blocks to rely on, for a developer to get up to speed takes a long time. This means that interaction designers cannot do Kinect development without a top-notch developer, and developers are needed even to finetune gesture settings (tolerance,

Anatomy of a .NET Assembly - Methods

Any close look at the method definitions in a .NET assembly has to start off with the method's information in the metadata tables - the MethodDef. So lets do that. MethodDefThe MethodDef entry for the entrypoint method in my TinyAssembly example used in previous posts has the following bytes:D0 20 00 00 00 00 91 00 47 00 0A 00 01 00 According to the CLR spec, the row is interpreted as follows:D0

WCF How To’s Index

This is index of available How-To’s for Windows Communication Foundation (WCF) distilled from the WCF Documentation available on MSDN. Topics covered: Getting Started How to: Define a Windows Communication Foundation Service Contract How to: Implement a Windows Communication Foundation Service Contract How to: Host and Run a Basic Windows Communication Foundation Service How to: Create a Windows

How do I monitor, or even control, the lifetime of an Explorer window?

A customer wanted help with monitoring the lifetime of an Explorer window.We want to launch a copy of Explorer to open a specific folder, then wait until the user closes the folder before continuing. We tried launching a copy of Explorer with the folder on the command line, then doing a Wait­For­Single­Object on the process handle, but the wait sometimes completes immediately without waiting. How

Don't just give your disk images/ISO's drive letters, RAM disk'em too...

Many free disc mounting programs provide multitude of options for mounting and managing disc images. Many of these programs have quite similar features and it is not often that one comes across a software that can take the edge from its competitors by providing a unique feature. OSFMount is an application that allows mounting disc images on not just virtual drives but also into the RAM. This

Capturing HTTP traffic on SSL enabled sites

BackgroundOn number of occasions there arises a need to capture HTTP traffic. In dev environments, this is usually accomplished using tools like NetMon or Wireshark Issue arises when we have a need to capture HTTP traffic which is enabled with SSLWithout the ability to capture SSL traffic, one usually has to disable SSL, capture traffic and then enable SSL  RequirementCapture SSL HTTP traffic via

Kamis, 24 Maret 2011

Everything You Need To Know To Start Programming 64-Bit Windows Systems

One of the pleasures of working on the bleeding edge of Windows® is poking around in a new technology to see how it works. I don't really feel comfortable with an operating system until I have a little under-the-hood knowledge. So when the 64-bit editions of Windows XP and Windows Server™ 2003 appeared on the scene, I was all over them. The nice thing about Win64 and the x64 CPU architecture is

Silverlight Tip of the Day #15 – Communicating between JavaScript & Silverlight

Communicating between Javascript and Silverlight is, fortunately, relatively straight forward. The following sample demonstrates how to make the call both ways. Calling Silverlight From Java script:In the constructor of your Silverlight app, make a call to RegisterScriptableObject().This call essentially registers a managed object for scriptable access by JavaScript code. The first parameter is

How to run WPF - XBAP as Full Trust Application

Recently I work on WPF-XBAP application that will run from intranet website: This application must have unrestricted access to client's OS resources (that is unusual for XBAP projects): I publish it on local website by using "Click-Once" deployment mechanism: User can launch the application from deployment page (also can run application setup):I get security error ("User has refused to grant

Accessing Web Services in Silverlight

SilverlightSilverlight version 4 client applications run in the browser and often need to access data from a variety of external sources. A typical example involves accessing data from a database on a back-end server and displaying it in a Silverlight user interface. Another common scenario is to update data on a back-end service through a Silverlight user interface that posts to that service.

Accessing the ASP.NET Authentication, Profile and Role Service in Silverlight

In ASP.NET 2.0, we introduced a very powerful set of application services in ASP.NET (Membership, Roles and profile).  In 3.5 we created a client library for accessing them from Ajax and .NET Clients and exposed them via WCF web services.    For more information on the base level ASP.NET appservices that this walk through is based on, please see Stefan Schackow excellent book Professional ASP.NET

How to: Use the ASP.NET Authentication Service to Log In Through Silverlight Applications

SilverlightThis topic describes how to authenticate the end users of your Silverlight-based ASP.NET Web site when you want to create a rich user log-in experience by using the full graphical power of Silverlight, instead of relying on an HTML-based mechanism, such as the ASP.NET Login Control. You can do this by using the ASP.NET Authentication service. For information about using this service,

Rabu, 23 Maret 2011

Google Engineer Releases Open Source Bitcoin Client

   A Google engineer has released an open source Java client for the Bitcoin peer-to-peer currency system, simply called BitcoinJ. Bitcoin is an Internet currency that uses a P2P architecture for processing transactions, avoiding the need for a central bank or payment system. Cio.com.au also has an interview with Gavin Andresen, the technical lead of the Bitcoin virtual currency system. Read more

Augmenting your 3DS reality just got a little simpler thanks to an Android app

Before we proceed any further, you owe it to yourself to check out our 3DS review or the video after the break in order to fully comprehend what Nintendo's augmented reality cards mean for 3DS gaming. We'll wait right here, take your time. Now that everyone's fully up to speed, an enterprising dev has put together an app that includes all of Ninty's add-in cards for its soon-to-be-launched

YouTube Video Editor gets impressive stabilization and 3D Video Creator

Google has just updated its cloud-based YouTube video editor to include the fruits of its recent purchase, plus a bit of 3D thrown in for good measure. The in-browser editor can now dramatically reduce camera shake using technology acquired from Green Parrot Pictures. It works by charting the best camera path for you, as if you were using a dolly or tripod, using a 'unified optimization

Microsoft's working on WGX, the future of PC gaming

The video showcases the Windows Gaming Experience, or WGX for short, and touches upon four main areas, including Social, Identity, Search and Transaction, explaining how they work in a very Kinect kind of way. For those of you who are unfamiliar, WGX is an internal Microsoft team comprised of all gaming-related endeavors between all of Microsoft’s platforms. Though the video is from 2010, this is

Catel - WPF, Silverlight and WP7 MVVM library

Project DescriptionCatel is more than just an MVVM framework. It also includes user controls and lots of enterprise library classes. The MVVM framework differs itself from other frameworks of the simplicity and solves the "nested user control" problem with dynamic viewmodels for user controls. We are currently investigating support for Windows Phone 7. So far, it looks very promising. If you have

ideone

Briefly about ideoneideone.com is a... pastebin. But a pastebin like no other on the Internet. More accurate expression would be online mini IDE and debugging tool. Ideone is an Italian word for great ideas - because ideone.com is a place where your greatest ideas can spring to life.ideone.com is designed mostly for programmers (but, of course, common plain text can also be uploaded). You can use

The day made of glass - Future of communication

Can you imagine organizing your daily schedule with a few touches on your bathroom mirror? Chatting with far-away relatives through interactive video on your kitchen counter? Reading a classic novel on a whisper-thin piece of flexible glass? Corning is not only imagining those scenarios – the company is engaged in research that could bring them alive in the not-too-distant future. You can get a

Why is there the message '!Do not use this registry key' in the registry?

Under Software\Microsoft\Windows\Current­Version\Explorer\Shell Folders, there is a message to registry snoopers: The first value is called "!Do not use this registry key" and the associated data is the message "Use the SH­Get­Folder­Path or SH­Get­Known­Folder­Path function instead." I added that message.The long and sad story of the Shell Folders key explains that the registry key exists only

C++Ox: The Dawning of a New Standard

It's been 10 years since the first ISO C++ standard, and 2009 will bring us the second. The new standard will support multithreading, with a new thread library. Find out how this will improve porting code, and reduce the number of APIs and syntaxes you use. In this special report, Internet.com delves into the new features being discussed by the standards team. Learn how these new features will

A simple way to run C# code from bat file

I read an interested article demonstrated how to run a bat file with embedded C# code. I repost this example here, because the original post is written in Russian. Despite the fact that there are other more powerful solutions and frameworks to achieve the same goal (e.g. Powershell) – I think the way presented by the author, is very useful for different scenarios. /*@echo off && clsset WinDirNet=

IIS7 Native API (C++) Starter Kit

OverviewTo extend the server, IIS7 provides a new (C++) native core server API, which replaces the ISAPI filter and extension API from previous IIS releases. The new API features object-oriented development with an intuitive object model, provides more control over request processing, and uses simpler design patterns to help you write robust code. NOTE: The IIS7 native (C++) server API is

"Cool" button creation in Expression Blend Tutorial

In this article we will look at some of the ways to create “cool” or gel buttons in Expression Blend. If you look at the default look and feel of a WPF button in Expression Blend or Visual Studio, you will notice that it doesn’t look “cool”. It’s still that dinosaur chrome looking button control, whereas Expression Blend and Windows Presentation Foundation (WPF) are not just about functionality

Named Pipes in WCF are named but not by you (and how to find the actual windows object name)

If Windows Communication Foundation (WCF) implementation has its own idiosyncrasies, named pipes provider is the champion. First, let’s start with the name of the provider. Named Pipes in Windows can be used to communicate between process on the same machine or between different machines across a network. WCF only implements the on-machine part of it. Named Pipes name has the format \\ServeName\

Loading Assemblies off Network Drives

.NET 4.0 introduces some nice changes that makes it easier to run .NET EXE type applications directly off network drives. Specifically the default behavior – that has caused immense amount of pain – in previous versions that refused to load assemblies from remote network shares unless CAS policy was adjusted, has been dropped and .NET EXE’s now behave more like standard Win32 applications that

Debugging WPF and Silverlight Binding Errors In Visual Studio

Recently I was working with a Microsoft Silverlight project, debugging a XAML binding error. After a few hours of searching, I found a blog describing how to alter the WPF Trace Settings to enable a more verbose output while debugging. After changing the trace level, you will see a more detailed output in the Debugger Output Window. Below is is a screenshot of the how to enable the proper

Detecting Certificate Authority compromises and web browser collusion

The Tor Project has long understood that the certification authority (CA) model of trust on the internet is susceptible to various methods of compromise. Without strong anonymity, the ability to perform targeted attacks with the blessing of a CA key is serious. In the past, I’ve worked on attacks relating to SSL/TLS trust models and for quite some time, I’ve hunted for evidence of non-academic CA

Revocation doesn't work (18 Mar 2011)

When an HTTPS certificate is issued, it's typically valid for a year or two. But what if something bad happens? What if the site loses control of its key? In that case you would really need a way to invalidate a certificate before it expires and that's what revocation does. Certificates contain instructions for how to find out whether they are revoked and clients should check this before

Hacker Spies Hit Security Firm RSA

Top security firm RSA Security revealed on Thursday that it’s been the victim of an “extremely sophisticated” hack. The company said in a note posted on its website that the intruders succeeded in stealing information related to the company’s SecurID two-factor authentication products. SecurID adds an extra layer of protection to a login process by requiring users to enter a secret code number

The architecture of VLC media framework

VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVD, Audio CD, VCD, and various streaming protocols. Technically it is a software package that handles media on a computer and through a network. It offers an intuitive API and a modular architecture to easily add support for new codecs, container formats and transmission

Synchronization Contexts in WCF

One of the more useful features of the Windows® Communication Foundation (WCF) is its reliance on the Microsoft® .NET Framework synchronization context to marshal calls to the service instance (or to a callback object). This mechanism provides for both productivity-oriented development and for powerful extensibility. In this column, I describe briefly what synchronization contexts are and how WCF

WCF Service InstanceContextMode and ConcurrencyMode combinations

What does the InstanceContextMode and ConcurrencyMode attributes in a wcf service do?A short MSDN description of this describes it as follows: “A session is a correlation of all messages sent between two endpoints. Instancing refers to controlling the lifetime of user-defined service objects and their related InstanceContext objects. Concurrency is the term given to the control of the number of

IKVM.Reflection Update

Missing MembersTo support mcs I previously added some limited support for missing members. This has now been extended substantially to allow full fidelity reading/writing of assemblies. Normally IKVM.Reflection behaves like System.Reflection in how it tries to resolve member and assembly references, but now it is possible to customize this to enable reading a module without resolving any

Selasa, 22 Maret 2011

Stored Procedure Definitions and Permissions

I wrote a post a while back that showed how you can grant execute permission ‘carte blanche’ for a database role in SQL Server. You can read that post here. This post is going to build on that concept of using database roles for groups of users and allocation permissions to the role. I recently had a situation where a tester wanted permission, for themselves and the rest of the testing team, to

Daily Chrome OS Builds for VMWare and VirtualBox Now Available

Hexxeh has now made available for everyone daily Chrome OS builds that can be used in VM. He has created both VMWare and VirtualBox versions of his Chrome OS Vanilla, which are snapshot builds of Chromium OS that the Chromium Team works on developing every day. If you’ve been frustrated because you did not get a Cr-48 or you could not get Chrome OS Vanilla to work on your own PC for hardware

Understanding the Role of Commanding in Silverlight 4 Applications

I’ve had the opportunity to give a lot of presentations on the Model-View-ViewModel (MVVM) lately both publicly and internally for companies and wanted to put together a post that covers some of the frequent questions I get on commanding.  MVVM relies on 4 main pillars of technology including Silverlight data binding, ViewModel classes, messaging and commanding. Although Silverlight 4 provides

A Silverlight Resizable TextBlock (and other resizable things)

In this blog post I present a simple attached behaviour that uses a Thumb control within a Popup to adorn any UI element so that the user can re-size it. A simple feature that has become quite popular on the web is to attache a small handle to text areas so that the user can resize them, this is useful if a user wants to add a large piece of text to a small comment form for example. Interestingly

New XML Standard for Super-Fast, Lightweight Applications Announced by W3C

From embedded sensors to high-frequency stock trading to everyday mobile Web applications, the race is on for technologists to build the most efficient systems for quickly streaming large sets of data from one device to another. Sometimes the language that data is communicated in can come with high costs in terms of efficiency. Today the Web's most venerable standards body, the Word Wide Web

6 Tips for Turbocharging Your Unit Testing

Who doesn't love making software run even better? Turbocharging, if you will. Here are Typemock developer's six tips for turbocharging Isolator. Need to simulate a fault? Just use Isolate.WhenCalled(...).WillThrow(new Exception()) with any method!Isolate.WhenCalled(...) uses Behavior Sequencing - use multiple expectations in sequence Isolate.Swap.AllInstances() affects both existing and future

Silverlight TV 65: 3D Graphics

Do 3D and graphics get you going? The folks at Archetype created an amazing 3D application that we first showed in the keynote at the Silverlight Firestarter in December, 2010. In this episode, Danny Riddell, CEO of Archetype, joins John to discuss their recent work with Silverlight 5, 3D, and graphics. Watch as Danny dives into how they built the 3D medical application and takes John through a

Using Query Classes With NHibernate

Even when using an ORM, such as NHibernate, the developer still has to decide how to perform queries. The simplest strategy is to get access to an ISession and directly perform a query whenever you need data. The problem is that doing so spreads query logic throughout the entire application – a clear violation of the Single Responsibility Principle. A more advanced strategy is to use Eric Evan’s

Consume a Web Service in an Android application with C# MonoAnDroid application

Description:In this application I will describe how to consume a web service in your MonoDroid application using VS 2010. (MonoDroid will not work in VS 2010 Express edition). To install MonoDroid navigate to http://mono-android.net/Installation. Follow the instructions and download all the necessary files. In the Figure 1. I have created a new MonoDroid application named

Wrapping a not thread safe object

Introduction    A colleague came to me with a question the answer for seemed very straight forward, yet an implementation took us more than a few minutes. The question was: I have a legacy object which is not thread safe, and all its methods, by its nature, synchronous. It was originally written to run on GUI thread in client application. Later on, this object had to be moved to server where it

Handling WP7 orientation changes via Visual States

It is pretty well known that an app can be notified of the phone’s orientation changes via the PhoneApplicationFrame.OrientationChanged event. However, if you are as serious about sharing the work between the designer and the developer as I am, you will not be happy with this – the changing of the layout should be the responsibility of the designer, not the developer. Of course, the best way to

Crytek to release UDK alternative

Co-founder Yerli ponders releasing engine for free; talks up mobile futureCryEngine 3 vendor Crytek is planning the release of an indie-friendly SDK, the firm has told Develop. Crytek co-founder Anvi Yerli said his firm already “has a business model in mind” for the CryEngine software development kit.“It will be extremely user-friendly,” he said. “The barriers for entry will be very low, and

Compressing messages in WCF part two - Expanding the GZipMessageEncoder and fixing another bug

The GZipMessageEncoder is a great sample for learning about MessageEncoders in general. In this post, I will expand the GZipMessageEncoder to do both GZip and Deflate compression. This will accomplish two things: (1) explain various pieces of a MessageEncoder and (2) set a groundwork for future posts. Since the MessageEncoder will now support both GZip and Deflate, it would be a good idea to

Figuring out why my SVCHOST.EXE is at 100% CPU without complicated tools in Windows 7

The SvcHost.exe process hosts services that run in the background on Windows. It's literally "Service Host." You may have a dozen services or more running inside that process. More complex is that you'll sometimes see multiple SvcHost.exe's in your TaskManager.  Let me tell you now, Task Manager will not save you. You can see the PIDs for a running Service for the Services tab, but when a service

IE 9 Bug Not All Links are Right Clickable

Since yesterday I've been using IE 9 most of the time so I can find out if there are any issues in mojoPortal skins and functionality related to using the new version. I use the right click on the mouse all the time for opening links in a new tab, and I began to notice that some links do not show me options for opening the link when I right click it. It seems as if it has no context as being a

Delay Binding Updates within a certain Context

This came up on Twitter today and since I have a solution that's been working well for me I opted to share. When making a series of data changes that will update Bindings, How can you keep a WPF/Silverlight UI from reflecting any of these changes until you're all done?  In other words, we need the ability to treat a series of Property changes as a single unit of work. While this works better with

Beginner’s Guide for Programming in C# - Hebrew

I've recently published a series of posts in Hebrew on the great site www.webmaster.org.il. The posts can be used as a beginner's guide for programming in C#. Following are the links for the different posts: C# Guide - Part 01 – Installation  C# Guide - Part 02 - First Program C# Guide - Part 03 - Input Output  C# Guide - Part 04 - Basic Variables C# Guide - Part 05 - Arithmetic Operators  C#

New version of StyleCop released

4.5 Preview was released today. The download is at http://stylecop.codeplex.com/releases/view/62209 I recommend the use of Style Cop to all C# developers.I quote the download page:This release currently contains 89 bug fixes since the 4.4 RTW release and includes 4 new rules. SA1125 - UseShorthandForNullableTypesSA1411 - AttributeConstructorMustNotUseUnnecessaryParenthesisSA1517 -

NHibernate and default constructors

One of the first things you learn about NHibernate is that in order for it to be able construct your instances and take advantage of lazy loading every persistent class must have  the default, parameterless constructor. This leads to having entities looking like this (standard blog with posts and comments example). public class Post{    private readonly IList comments = new List

How does the C runtime know whether to use the static-linking or dynamic-linking version of the header file?

In response to a description of what happens when you get dll­import wrong, nksingh asks, "This seems like a problem for the CRT. As far as I know, VC gives you the option of statically or dynamically linking the CRT. But it seems like the headers will have to make a choice to support one thing better than the other. Conditional compilation would work, but then people would have to remember to

WP7, iOS & Android: Is .NET the platform to rule them all?

The following blog post is an article originally published in the most current issue of "The Developer", a magazine distributed to Norwegian developers. The article discusses the exciting possibility to use C# and .NET across the three major smart phone platforms WP7, iOS and Android. Since the magazine is only distributed in Norway I decided to post it on my blog as well. You can either read it

Implementing the virtual method pattern in C#, Part Two

So far we've gotten rid of instance methods; they're just static methods that take a hidden "this" parameter. But virtual methods are a bit harder. We're going to implement virtual methods as fields of delegate type containing delegates to static methods. abstract class Animal{  public Func Complain;  public Func MakeNoise;  public static string MakeNoise(Animal _

Using AdMob for Windows Phone 7

A few days ago, Google has released a first beta version of an AdMob SDK for Windows Phone 7. People seem to be interested in that especially outside the U.S., because at the moment, Microsoft's own Advertising program is only available to developers based in the United States. Here is a short walk-through of how to use the AdMob SDK in your app and what you can expect from it at the moment.

Embarcadero AppWave Store: The World’s First True App Store for PCs

Embarcadero is going to unveil a new tool from their quite successful tool-chest:  AppWave in conjunction with the AppWave Store portal,  “The World’s First True App Store for PCs” . Based on their advanced virtualization Embarcadero products (ToolCloud and All-Access) the new AppWave tools (Studio, SDK..) and portal seams to be dedicated to ease the building, publishing, updating, licensing and

Amazon Appstore for Android goes live, welcomes newcomers with free Angry Birds Rio

In spite of Apple's grumbling, Amazon's proceeding full steam ahead with the rollout of its Appstore for Android. The switch has just been flipped and early adopters will be welcomed with a free copy of Angry Birds Rio, whose Android launch Amazon scooped all to itself. Beyond day one, Rio will be a $0.99 app, but others will take its place as the online retailer is aiming to serve one

Expression Web SuperPreview

OverviewExpression Web SuperPreview speeds the essential task of debugging your web sites for cross-browser compatibility. With Expression Web SuperPreview, you don’t need a web service to debug your pages on the same machine that you use for development.  Expression Web SuperPreview is a standalone visual debugging tool for cross-browser testing. With Expression Web SuperPreview, you can ensure

sharp2word

C#-to-Word Generator: Creates Microsoft Word Documents from C# code without using any component or library Read more: Google code Posted via email from Jasper-net

Windows 7 Service Pack 1 installation trouble

My computer is set to use automatic updates from Windows Update. So when SP1 for Windows 7 came out, I didn't even think about installing it… Windows Update will take care of it for me. But sadly I was mistaking. After two months I realized that the service pack had not been installed. So I downloaded the service pack from Microsoft Download Center, and tried to install it. But I got an error: "

Indexes in MS SQL Server

IntroductionI bought a book from Crossword; he packed the book and added two bookmarks into my pack. A thought came to my mind. Why do we need this bookmark? I can easily memorize the page number and next time resume from the same page when I resume reading, or read them all over to reach to the point where I stopped reading. But not all have a blessed memory; moreover, there are better things to

Senin, 21 Maret 2011

Implement pagination with NHibernate ICriteria

I want to share my experience about implementing a pageable and sortable grids using NHibernate ICriteria. Many web applications use grids as a common representation of search results or list of data required by some business rules. We can extract data from database and paginate or order the records on the server side, but this creates a list of limitations in ordering the records and a big

Simple paging with ASP.NET MVC and NHibernate

This post demonstrates how you can do efficient paging using ASP.NET MVC and NHibernate.To make paging efficient we need to pass the start index and the number of records to return to the database. So that we can display page links we also need to pass some information to our view such as the number of pages available and the current page index. I found the cleanest way of doing this was to

Make Your Caps Lock Key into a Cr-48-Style Search Key

If you want to search more than just the web, install Google Desktop and set your preferences for Integration. If you're just looking for quick access to a web search dialog, skip this step. Open your Start Menu folder in Windows Explorer—the easiest way is to click the Start button, right-click the All Programs near the bottom, and select open. Then:Open the Programs folder in that location.

What Is ClockworkMod Recovery And How To Use It On Android [Complete Guide]

ClockworkMod – also known as Clockwork and CWM – is a custom recovery for Android phones and tablets that allows you to perform several advanced recovery, restoration, installation and maintenance operations on your Android device that aren’t possible with the stock recovery. In what follows, we will cover all that this recovery is capable of doing, and how to do it. Here is what we shall be

Motorola's Sholes Bootloader Unlocked

Motorola's locked bootloader for their Sholes-family devices (Droid OG, Milestone, DroidX, Droid 2 etc, not Atrix 4G) has finally been cracked. @nenolod explains on his website: The Motorola Sholes platform uses a trusted bootloader environment. Signatures are stored as part of the CDT stored on the NAND flash. mbmloader verifies the signature on mbm before passing control. mbm verifies all other

GNU Project begins work on totally free Skype alternative

The GNU Project has begun laying the groundwork for another piece of "Free as in Freedom" software. This time, the group has its sights set on developing a Skype alternative which rivals the original in ease of use and functionality. Dubbed GNU Free Call, the program will rely on a "self-aware, meshed calling network" to deliver secure, anonymous VoIP. The GNU SIP Witch server will provide the

GO Contacts For Android Is Ideal Alternative To Stock Dialer & Contacts

The acclaimed GO Dev Team, after receiving satisfied nods from Android users all around for GO Launcher, GO SMS and GO Weather, has added another peach of an application to the Android Market. Go Contacts is a a free contacts manager and dialer that is, as claimed by the developers themselves, good enough to replace the stock Contacts and Dialer applications and perhaps even better in some

10 Revenue Models for Startups You Should Know

One of the toughest decisions for a startup is how to price their product or service. The alternatives range from giving it away for free (like Twitter), to pricing based on costs, to charging what the market will bear (premium pricing). The implications of the decision you make are huge, defining your brand image, your funding requirements, and your long-term business viability. The revenue

Silverlight & WCF RIA Services: Strategies for handling your Domain Context - Part 1

This is the first in a two-part article series on the WCF RIA Services Domain Context.Part 1: Introduction, instance strategies & first strategy Part 2: Other instance strategies, pointers & conclusion  This article series is accompanied by source code, which can be downloaded here.IntroductionA lot of business applications that are being developed in Silverlight today are built with the help of

Kinect for PS3

Ever. Awesome. Move over Move… Shantanu Goel has upped the ante in the motion controller game by taking Kinect, a collection of open source Kinect libraries and the DIY PS3 Controller, and mashed ‘em all together to create one righteous hack. Read more: PS3-hacks.com Posted via email from Jasper-net

Enabling IIS Express support in VS 2010 Sp1

With the Sp1 release of Visual Studio 2010 now available for download, you now have the option to use IIS Express as the development server for your web projects instead of the built-in Visual Studio Development server (aka. Cassini). Here are some previous blog posts explaining the IIS Express integration features in VS 2010 Sp1 Beta, which are also available with this new release of Sp1: VS

Getting started with GWT

GWT short for Google Web Development Kit lets programmers to develop Ajax web applications with java. Java codes are converted in to JavaScript and html codes by the GWT compiler. GWT applications are called modules and modules are described using a xml file, assuming the module name as "mymodule" name of the xml file would be "mymodule.gwt.xml". There is atleast one entry point for a module and

לפתח פייתון בויז’ואל סטודיו כבר ניסיתם? מהיום אתם יכולים…

מיקרוסופט ופייתון עד היוםפייתון היא שפה דינאמית שהפופולריות שלה עושה בשנים האחרונות אך סובלת מסביבות פיתוח וכלי פיתוח מיושנים ביותר. כבר לפני מספר שנים נולד פרוייקט IronPython – מימוש של השפה הדימאנית .NET Framework ו- Silverlight, הכוללים חלון כתיבה והרצאה אינטראקטיבי התומך בהידור דינאמי, ואפשרות להפעיל את כל רכיבי ה- .NET Framework כפקודות טבעיות בתוך השפה. הפרוייקט כתוב מעל ה- DLR ב- .NET

ASP.NET AppDomain–What it is and why it’s important–Part 12 of 52 part series

AppDomains are a silent mysterious part of ASP.NET and IIS.  It’s important for the web administrator to be aware of this building block of ASP.NET so that we can be aware of how changes to the system can affect production sites. While this series is targeted at the IIS and web administrator, this topic is useful for the ASP.NET programmer too.This is week 12 of a 52 week series on various web

DebuggerDisplay attribute best practices

The DebuggerDisplayAttribute is a powerful way to customize the way values are displayed at debug time.  Instead of getting a simple type name display, interesting fields, properties or even custom strings can be surfaced to the user in useful combinations [DebuggerDisplay("Student: {FirstName} {LastName}")]public sealed class Student {    public string FirstName { get; set; }    public string

Minggu, 20 Maret 2011

SQL Server: Identify Memory and Performance Issues in T-SQL Queries and Fix them

Sometimes you may notice that some T-SQL queries are taking too much time to execute and thus slowing down the performance of SQL Server and other applications. You can find and rectify these queries using the following methods: Method 1 : Use Dynamic Management ViewSELECTtxt.text, total_elapsed_timeFROMsys.dm_exec_query_stats statCROSS APPLY sys.dm_exec_sql_text (stat.sql_handle) txt ORDER

MFC Delagates

IntroductionThe arrival of .NET brought some very nice approaches and techniques. Of course, one main reason of .NET code efficiency (I mean from a developer's scope) is that .NET languages are fully and exclusively object oriented. One very nice attribute of .NET (and especially of C#) is delegates. Delegates are defined as member variables, and can hold references to functions.Can C++ (and I

Fun with Ubuntu

Ubuntu is like an empty box. You install packages according to your requirements, try out various options available and witness the changes that take place within your box. In other words, you are customizing the box according to your needs and interests. So, in this post, I will be presenting you with four useful options that you can try out to customize your Ubuntu box.Download Youtube videos

Using RSA Public Key Encryption in a Shared Web Hosting Environment

IntroductionIf you are thinking of using RSA encryption on a Web server maintained by a shared hosting company (as many small websites are), you might find yourself out of luck. The RSA encryption class (RSACryptoServiceProvider) supplied by .NET is not usable in such an environment because it would compromise the security of the server's own private keys. This article provides an alternative

Silverlight 4: Introduction to Behaviors

In this article, I will introduce you to Behaviors in Silverlight. We will also create a small demo of the ‘MouseDragElementBehavior’ behavior using Expression Blend 4. So let’s get started. We will first create a Silverlight project using ‘Microsoft Expression Blend 4.0’. Click on Start > Microsoft Expression > Microsoft Expression Blend 4 as shown below:Create a new project and give it a name ‘

Google makes web pages faster with a simple tweak

Google has manged to speed up the way that it serve AdSense content to web pages by a simple change to the JavaScript that does the loading. The ungrateful among us might be asking - why has it taken so long to fix? Google has been rolling out the new version of show_ads.js which it reckons is used by more than two million websites which show AdSense ads. The new version is supposed to be faster

Binding Media Resource Streams to XAML Controls

I came across an interesting problem as I was working on the Windows Phone 7 client code for my next installment of the WCF Data Services blog post series on streaming. In this series, I have been using a property on my PhotoInfo entity named StreamUri to hold the URI of the image used for binding in the client UI. However, because we are dealing with a Media Link Entry (MLE), I was reminded that

Jumat, 18 Maret 2011

Social media explained

Read more: Vanished-omen Posted via email from Jasper-net

What's new in Linux 2.6.38

A quite minor change in the process scheduler makes systems with 2.6.38 feel much faster, and more far-reaching changes to the VFS (virtual file system) make some tasks much faster. Some of the changes to driver code that deserve mention include Wireless LAN (WLAN) drivers and expanded support for current graphics chips from AMD and Nvidia. Ten weeks – that's all the time that Linus Torvalds and

Running Hadoop On Ubuntu Linux (Multi-Node Cluster)

Table of Contents: What we want to do Tutorial approach and structure Prerequisites Configuring single-node clusters first Done? Let’s continue then! Networking SSH access Hadoop Cluster Overview (aka the goal) Masters vs. Slaves Configuration conf/masters (master only) conf/slaves (master only) conf/*-site.xml (all machines) Starting the multi-node cluster HDFS daemons MapReduce

android patterns

This is androidpatterns.com, a set of interaction patterns that can help you design Android apps. An interaction pattern is a short hand summary of a design solution that has proven to work more than once. Please be inspired: use them as a guide, not as a law. Read more: android patterns Posted via email from Jasper-net

iLBC.NET

Project DescriptionA port of the iLBC (internet Low Bitrate Codec) speech codec for .NET platform.Details This is a port of iLBC (http://www.ilbcfreeware.org/) speech codec to C#, converted from the Java port by Jitsi (SIP Communicator) http://jitsi.org/. The project targets .NET 4.0 and can be ported to Silverlight too.LicenseThe source code is available under LGPL license http://www.gnu.org/

.Net Perf - timing profiler for .Net

Introducing .Net Perf Timing. A FREE timing profiler for .NetWhat is a timing profiler?A timing profiler provides you with the ability to determine exactly how much time is being spent inside each method, relative to the total execution time of the application. How does it work?The application works by pre-instrumenting your assemblies with calls to our application. This allows us to keep track

Web Platform Installer bundles for Visual Studio 2010 SP1 - and how you can build your own WebPI bundles

Visual Studio SP1 is  now available via the Web Platform Installer, which means you've got three options:Download the 1.5 GB ISO image Run the 750KB Web Installer (which figures out what you need to download)Install via Web PINote: I covered some tips for installing VS2010 SP1 last week - including some that apply to all of these, such as removing options you don't use prior to installing the

Android 3.0 Hardware Acceleration

One of the biggest changes we made to Android in this release is the addition of a new rendering pipeline so that applications can benefit from hardware accelerated 2D graphics. Hardware accelerated graphics is nothing new to the Android platform, it has always been used for windows composition or OpenGL games for instance, but with this new rendering pipeline applications can benefit from an

Threads Local Storage in C#

Calling the GetData and the SetData methods the Thread class provides we can keep isolated data separately for each threads. The following video clip shows and explains that. Read more: Life Michael Posted via email from Jasper-net

Task Parallel Library: 4 of n

IntroductionThis is the 4th part of my proposed series of articles on TPL. Last time I introduced Parallel For and Foreach, and covered this ground: Parallel For/ForeachCreating A Simple Parallel For/ForeachBreaking And Stopping A Parallel LoopHandling ExceptionsCancelling A Parallel LoopPartioning For Better Perfomance Using Thread Local StorageThis time we are going to be looking at how to use

How to find out where the IsolatedStorage is in a Windows Phone 7 app?

Experienced Windows Phone 7 developers already know that there is an actual file system on the device that is similiar structure-wise to that of the actual Windows OS. A lot of the content managed by the device is stored in local spots scattered across the system that are not publicly disclosed (although since the OS image was already disassembled, most of them are known). One of these locations

How to deal with CPU usage in WPF application ?

If you are building a WPF application with lots of animation inside it, may be some of which runs forever, you must have been a problem of eating up your entire CPU or a mammoth portion of CPU while the program is running. The problem is because by default, the framerate for WPF application is set to 60 per second. Thus for every second if your application has slight change, WPF environment draws

Implementing the virtual method pattern in C#, Part One

I was asked recently how virtual methods work "behind the scenes": how does the CLR know at runtime which derived class method to call when a virtual method is invoked on a variable typed as the base class? Clearly it must have something upon which to make a decision, but how does it do so efficiently? I thought I might explore that question by considering how you might implement the "virtual and

Kamis, 17 Maret 2011

Code Contracts

Code contracts provide a way to specify preconditions, postconditions, and object invariants in your code. Preconditions are requirements that must be met when entering a method or property. Postconditions describe expectations at the time the method or property code exits. Object invariants describe the expected state for a class that is in a good state. Code contracts include classes for

ClickOnce Deployment using IIS / Apache Server for VSTO

We can use Clickonce deployment almost on any Http Web Server. Clickonce deployment makes it very easy for the endusers to install the required application. I found ClickOnce deployment particularly useful when you want to distribute addins and document level customized projects for Excel / Word to the enduser in an internet/intranet scenario. Below are the steps to configure Apache Server for

Kaxaml

Welcome to Kaxaml!Kaxaml is a lightweight XAML editor that gives you a "split view" so you can see both your XAML and your rendered content (kind of like XamlPad but without the gigabyte of SDK). Kaxaml is a hobby and was created to be shared, so it's free! Feel free to download and try it out. If you don't like it, it cleans up nicely. Kaxaml is designed to be "notepad for XAML." It's supposed

Exception handling in T-SQL/TRY…CATCH – Underappreciated features of Microsoft SQL Server

As we continue our journey through the “Underappreciated features of SQL Server”, this week are are looking at a few of the T-SQL enhancements that the community felt did not get the deserved attention. This was in response to Andy Warren’s editorial of the same name on SQLServerCentral.com. Today, we will look at exception handling in T-SQL using the TRY…CATCH statements introduced since SQL

Debug Android UI

When debugging an Android application it’s important to look at the structure of the UI. There are tools that help you visualize the UI. Inside this article I will be explaining two tools: Hierarchy ViewerLayoutoptHierarchy ViewerThe Hierarchy Viewer application provides a visual representation of the layout’s View hierarchy (the Layout View) and a magnified inspector of the display (the Pixel

Microsoft Visual Studio 2010 Service Pack 1 (Installer)

Brief DescriptionThis web installer downloads and installs Visual Studio 2010 Service Pack 1. An Internet connection is required during installation. See the ‘Additional Information’ section below for alternative (ISO) download options. Please Note: This installer is for all editions of Visual Studio 2010 (Express, Professional, Premium, Ultimate, Test Professional). Read more: MS Download