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

Google Android tutorial

| Tuesday, June 8, 2010
Android tutorial part 1 - Conway's Game of Life

Content

Day One - Why build Conway's Game of Life for Google Android?
Day Two - Starting to build the application
Day Three - First run
Day Four - Wiring the initial UI together
This tutorial has a second part: Android tutorial part 2 - Conway's Game of Life.

Day One - Why build Conway's Game of Life for Google Android?

Basically, my initial motivation to write this tutorial was one of self-interest, that is, when you are forced to document something that you are in the process of learning, it helps to reinforce said learning experience.

As a developer, I am always looking out for new and interesting technologies and it takes no real leap of faith to see that mobile computing (in all its forms) is going to outright dominate the field of software development for the foreseeable future - mobile is going to be big... really, really BIG!

Furthermore, in my opinion, the writing is on the wall, that is, Google's Android platform will be established as a major player if not the player within the mobile market within the next couple of years, eventually overtaking both Apple and RIM within the smartphone market. We're not there yet (and perhaps we shouldn't ever 'get there' completely - competition is good), but I do see it happening sooner or later.

Hence, this tutorial is aimed at developers that know how to download and install SDKs, have a reasonable level of experience with Eclipse and specifically Java (the language) but at the same time do not have any real experience (like me) at building applications targeting Google Android.

Why Conway's Game of Life? Well, Conway's Game of Life is a very simple cellular automaton (for a more in-depth overview of the game, check out the article at Wikipedia for Conway's Game of Life) - the problem space is small enough to allow me to only focus on Google Android while still including sufficient elements to make for both an interesting and valid learning experience. For example, the application includes:

a 'game' loop (in its own thread):
update state
update input
update calculations
update animations
GUI components with binding
a custom GUI component

Read more: Quesucede.com

Posted via email from jasper22's posterous

Common Open Research Emulator (CORE)

|
core-logo-275x75.gif

The Common Open Research Emulator (CORE) is a tool that allows you to emulate entire networks on one or more machines. You can connect these emulated networks to live networks or to additional emulated networks. CORE consists of a GUI for easily drawing topologies that drives lightweight virtual machines, and various utilities. CORE uses virtualized network stacks in a patched FreeBSD kernel, or Linux virtual machines.

Read more: CORE

Posted via email from jasper22's posterous

ContainerOne - C# application server

|
An OSGi like application server completely written in c# (.net 4.0) which enables easy designing of a component oriented architecture - for developers and architects...

Please refer to the documentation for further information

Read more: Codeplex

Posted via email from jasper22's posterous

Aquaria Goes Open Source

|
A post on the Wolfire blog yesterday announced that the source code for Aquaria has now been released. Aquaria, an action-adventure, underwater sidescroller from Bit Blot, was part of the Humble Indie Bundle, which was so successful that the developers of four games pledged to release them as open source. This marks the final release, following Lugaru, Gish, and Penumbra: Overture. The source code is available from a Mercurial repository.

Read more: Slashdot
Read more: Aquaria

Posted via email from jasper22's posterous

RESTful WCF Architecture – Hosting RESTful WCF Services in IIS

|
Hosting in IIS [managed hosting] offers the following advantages:

Process setup and shutdown.
Process pooling and recycling.
Application restart [recycle] when configuration changed.
Enhanced security model.
Management tools.
Caching management.
Proven hosting platform written, debugged by A-team @MS.
Officially supported MS product/technology.
Hosting WCF in IIS – Quick & Dirty

Following are quick steps to expose WCF service via IIS and svc file using Visual Studio.

Create ASP.NET Empty Web Application. The application will provide a container for RESTful WCF services – files with svc extension. When IIS receives a request to resource with svc extension it routes to WCF handler. Look for *.svc extension as a path and its corresponding handler which is System.ServiceModel.Activation.HttpModule in IIS manager under Handler Mappings.
Add WCF Service. Visual Studio creates three files. For example, if you create RESTfulWCF service these files are created:
RESTfulWCF.svc – the file that glues the request routed by IIS and the service implementation. This is a simple text file that should look similar to this:

<%@ ServiceHost Language="C#"
               Debug="true"
               Service="RESTfulWCFHostedInIIS.RESTfulWCF"
               CodeBehind="RESTfulWCF.svc.cs" %>

IRESTfulWCF.cs – service’s interface with contract attributes decoration. It’s a common WCF practice to separate the interface and the implementation when building WCF services.
RESTfulWCF.svc.cs – the code behind file that implements the service based on the IRESTfulWCF.cs.
Configure web.config.
Hosting WCF in IIS – Componentaized Approach

Another approach is to componentize the service into separate assembly. The main benefit of the approach is complete separationg or componentization of the service and how it’s exposed to the external world. Another huge benefit is this approach eliminates the need of messing with web.config.

Following are the steps needed to expose the WCF component that implements RESTful WCF service via svc file hosted in IIS:

Summary of steps:

Step 1 - Create class library project.
Step 2 - Implement RESTful resource.
Step 3 - Define RESTful WCF service interface.
Step 4 - Implement RESTful WCF service based on the interface.
Step 5 - Create empty web project.
Step 6 - Create new svc file.
Step 7 - Edit web.config file.
Step 8 - Test RESTful WCF service hosted in IIS.
Rest of the post is the detailed walkthrough of the above steps.

Read more: Alik Levin's

Posted via email from jasper22's posterous

Lord of the Rings Online To Go Free-To-Play

|
bmf sends word of Turbine's announcement that Lord of the Rings Online will become a free-to-play game this fall. 'The move is another validation of the free-to-play business model, where gamers can play for free and pay real money for virtual goods such as better weapons or decorative gear for their game characters. The business model has been popular in Asia but only recently took off in the US. This move shows the pressure is building on game publishers to shift to the new business model or face declining audiences.' According to a post on the official website, LotRO's micro-transaction system will be "very similar" to how Turbine's DDO store works, and current subscribers will maintain all of their privileges.

Read more: Slashdot
Read more: Lord of the Rings Online

Posted via email from jasper22's posterous

Project “Hilo”, A Complete C++ / Windows 7 Sample Application

|
7635.image_5F00_thumb_5F00_7479B026.png

The C++ team has introduced a new sample series designed to demonstrate building a rich Windows 7 application for working with pictures, from scratch.  Each step will add new features including touch, animation, etc.  You can read more about the sample series and download full source code from the main site.

The first version builds a carousel control for displaying pictures and includes browsing support

Read more: Jason Zanders Weblog

Posted via email from jasper22's posterous

Hyper-V for Developers – Part 1 – Internal Networks

|
Over the last year, we’ve been working with Microsoft to build training and demo content for the next version of Office Communications Server – code-named Microsoft Communications Server “14”.

This involved building multi-server demo environments in Hyper-V, getting them running on demo servers which we took to TechEd, PDC, and other training events, and sometimes connecting the demo servers to the show networks at those events.  ITPro stuff that should scare the hell out of a developer!

It can get ugly when I occasionally have to venture into ITPro land.  Let’s leave it at that.

Having gone through this process about 10 to 15 times in the last year, I finally have it down.  This blog series is my attempt to put all that knowledge in one place – if anything, so I can find it somewhere when I need it again.

I’ll start with the most simple scenario and then build on top of it in future blog posts.

If you’re an ITPro, please resist the urge to laugh at how trivial this is.

Internal Hyper-V Networks

Let’s start simple.  An internal network is one that intended only for the virtual machines that are going to be on that network – it enables them to communicate with each other.

Create an Internal Network

On your host machine, fire up the Hyper-V Manager and click the Virtual Network Manager in the Actions panel.

Read more: Clarity Consulting

Posted via email from jasper22's posterous

Android Rootkit Is Just a Phone Call Away

|
Hoping to understand what a new generation of mobile malware could resemble, security researchers will demonstrate a malicious 'rootkit' program they've written for Google's Android phone next month at the Defcon hacking conference in Las Vegas. Once it's installed on the Android phone, the rootkit can be activated via a phone call or SMS message, giving attackers a stealthy and hard-to-detect tool for siphoning data from the phone or misdirecting the user. 'You call the phone, the phone doesn't ring, and when the phone realizes that it's being called by an attacker's phone number, it sends him back a shell [program],' said Christian Papathanasiou, a security consultant with Chicago's Trustwave, the company that did the research.

Read more: Slashdot

Posted via email from jasper22's posterous

Microsoft Visual C++ Static and Dynamic Libraries

|
This article is intended to be a basic introduction to the Microsoft Visual C++ Static and Dynamic Libraries. This article assumes that you have a basic understanding of the C language and are familiar with the Microsoft Visual C++ IDE. I will show you how to compile and reference dynamic and static libraries so that you can share and distributed your own libraries. You will need to have a version of Microsoft Visual C++. If you do not own a copy you can download the express edition here.

This tutorial will cover step-by-step how to compile and reference your libraries with plenty of visuals. This article is intended to be repetitive to help beginners grasp and develop their own libraries with Microsoft Visual C++. I strongly recommend you read my previous article about compiling libraries with MinGW. The article provides a comparison between static and dynamic libraries. In general I find GCC compiler easier to comprehend and easier to develop libraries, this will assist beginners in developing their own libraries.

The Static Library  

The code for a static library is identical to my previous post on compiling libraries for MinGW, found here. This is a over simplistic library to emphasis the process  of creation not the concept of a library. The library is pretty standard, in that the function is declared in the header and defined within the 'c/cpp' file.

Read more: Codeproject

Posted via email from jasper22's posterous

Google's Chrome OS To Launch In Fall

|
chrome-os-screenshot-1-500x375.jpg

On Wednesday Google's vice president of product management said that this fall Google will launch Chrome OS to compete with Microsoft Windows. More than 70 million users already use the Chrome Browser, and Google expects at least 1 million users of the OS by day one of release.

Read more: Slashdot

Posted via email from jasper22's posterous

test

|
test message - please delete

Posted via email from jasper22's posterous

Using FormatMessage

| Sunday, June 6, 2010
The FormatMessage API call is very powerful, and particularly useful for issuing all kinds of messages. This is not intended to be a full tutorial on using FormatMessage, but simply an example of one of the most effective uses of the the call. There is nothing more offensive than being presented with a message like the one below:

This is incomprehensible. The file cannot be opened. Why? For that matter, what file? The name the user types in is only part of the filename context; the rest relies on the current directory, which may not be what the user thinks it is. Errors like this generate unnecessary support calls to tech support departments, and consume a lot of time of the technical support people trying to determine what has gone wrong. A muchbetter example of an error message is the next one. It tells what the application-level error is, what file was being considered, and the description of the error code.

In this case, I had created a read-only file junk.txt to induce the error on a Save command.

CString ErrorString(DWORD err)
   {
    CString Error;
    LPTSTR s;
    if(::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
           FORMAT_MESSAGE_FROM_SYSTEM,
           NULL,
           err,
           0,
           (LPTSTR)&s,
           0,
           NULL) == 0)
   { /* failed */
    // Unknown error code %08x (%d)

    CString fmt;
    CString t;
    fmt.LoadString(IDS_UNKNOWN_ERROR);
    t.Format(fmt, err, LOWORD(err));
    Error = t;
   } /* failed */
    else
   { /* success */
    LPTSTR p = _tcschr(s, _T('\r'));
    if(p != NULL)
       { /* lose CRLF */
        *p = _T('\0');
       } /* lose CRLF */
    Error = s;
    ::LocalFree(s);
   } /* success */
    return Error;
   } // ErrorString

Read more: Codeproject

Posted via email from jasper22's posterous

FLV Video conversion library for .Net 3.5

|
This is a component created to call the ffmpeg tool to convert various video formats to the Adobe Flash FLV output format. The component also takes care of server resources usage, by lowering the priority of the process, so the machine can perform as other tasks as possible.

Read more: Codeplex

Posted via email from jasper22's posterous

15 Great Content Management Systems for Designers

|
One of the first questions a client will ask you when you are tasked to develop a website is “how can I maintain it myself”.  It used to be a very daunting prospect to build in functionality allowing a novice to update their own website.  Today, the only difficult part is deciding which CMS you want to use.  When it comes to content management systems (CMS) and publishing platforms, there are more than enough to choose from and it all depends on what exactly you are looking to do.   While many CMS’s are overly complicated and require a certain level of technical expertise you may not have, there are a growing number of light, scalable and intuitive content management systems that will help you develop a dynamic website your client can update themselves.
Today, lets take a look at 15 (now 16) great content management systems that are rich in features, flexible enough for designers, highly customizable and won’t break your budget.

Expression Engine

Probably one of the most popular CMS’s among web designers, and for good reason. It’s extremely powerful but easy to use, adapting to your design process whilst still being easy for your end user. It’s also modular so you can add and remove features with ease.

Read more: designtutorials4u

Posted via email from jasper22's posterous

Debugging kernel objects using windbg & kd

|
One of the most common issues I deal with are related to blocking. Some of this are pretty straight forward to identify, Others not that easy, especially if you have a process with many threads. When I have to troubleshoot blocking on WaitHandles (e.g Mutex) I usually find the need to use both user mode and kernel mode debugging to identify the guilty thread.
For demonstration purposes I’ve built a simple sample where a process appears hung.

The first thing to do is to attach the debugger to the process. My sample was built with CLR 4.0 so no more mscorwks (now it´s called clr.dll). Let’s start by loading the SOS extension.

0:007> .loadby sos clr

After looking at the threads stack with !clrstack we can see a thread blocked on WaitOne.

(managed stack)
0:007> !clrstack
OS Thread Id: 0x1b18 (7)
Child SP IP       Call Site
04fbf4f4 76fc00fd [HelperMethodFrame_1OBJ: 04fbf4f4] System.Threading.WaitHandle.WaitOneNative(System.Runtime.InteropServices.SafeHandle, UInt32, Boolean, Boolean)
04fbf59c 6a4b6eff System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle, Int64, Boolean, Boolean)
04fbf5b8 6a4b6ebd System.Threading.WaitHandle.WaitOne(Int32, Boolean)
04fbf5d0 6a4b6e80 System.Threading.WaitHandle.WaitOne()
04fbf5d8 002006c6 BlockingQueueWithManualResetEvents`1[[System.__Canon, mscorlib]].Enqueue(System.__Canon)
04fbf610 00200666 ThreadsManaged.Program+<>c__DisplayClass4.<Main>b__3()
04fbf61c 6a4d0bea System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
04fbf628 6a500b6c System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

Read more: Deviations

Posted via email from jasper22's posterous

6 important uses of Delegates and Events

|
Introduction
Abstraction problems of methods and functions
How to declare a delegate?
Solving the abstract pointer problem using delegates
Multicast delegates
Simple demonstration of multicast delegates
Problem with multicast delegates – naked exposure
Events – Encapsulation on delegates
Implementing events
Difference between delegates and events
Delegates for Asynchronous method calls
Summarizing Use of delegates
Difference between delegates and C++ pointer
Source code
In case you do not want to read my complete article , you can watch the below video for the same.


Introduction

In this article we will first try to understand what problem delegate solves, we will then create a simple delegate and try to solve the problem. Next we will try to understand the concept of multicast delegates and how events help to encapsulate delegates. Finally we understand the difference between events and delegates and also understand how to do invoke delegates asynchronously.

Once we are done with all fundamentals we will summarize the six important uses of delegates.

This is a small Ebook for all my .NET friends which covers topics like WCF,WPF,WWF,Ajax,Core .NET,SQL etc you can download the same from here
or else you can catch me on my daily free training @  from here  

Abstraction problems of methods and functions

Before we move ahead and we talk about delegates let’s try to understand what problem does delegate solve. Below is a simple class named ‘ClsMaths’ which has a simple ‘Add’ function. This class ‘ClsMaths’ is consumed by a simple UI client. Now let’s say over a period of time you add subtraction functionality to the ‘ClsMaths’ class, your client need to change accordingly to accommodate the new functionality.

Read more: Codeproject

Posted via email from jasper22's posterous

Data Url for image in IE8

|
נראה בפוסט הנוכחי איך אפשר לתת לתמונה את המידע שמתאר את התמונה.

בהמשך לפוסטים שלי על IE8 נראה הפעם את האפשרות להציג תמונות כ - Embedded

אני לא ממש יודע להגיד למה צריך את זה אבל זה נחמד, שימו לב לקוד הבא, (קצת ארוך - ולכן עשיתי כתב קטן)

<img src="data:image/png;base64,/9j/4AAQSkZJRgABAQEAtAC0AAD/4SFyRXhpZgAATU0AKgAAAAgADQEPAAIAAAAGAAAItgEQAAIAAAAU
AAAIvAESAAMAAAABAAEAAAEaAAUAAAABAAAI0AEbAAUAAAABAAAI2AEoAAMAAAABAAIAAAExAAIAAAAu
AAAI4AEyAAIAAAAUAAAJDgITAAMAAAABAAEAABABAAMAAAABBkAAABACAAMAAAABBLAAAIdpAAQAAAAB
...
...
kD+XYdqKKzqdEbLcr+JZTBpFxIoG5Y2Ir+WTx/4nvPGfjDWNa1CTztQ1i8n1C6k6eZNNI0jt+LMT+NFF
dmVfFL5fqefmz92Pz/QzANjYBPzY5qY/KSMDg0UV68jx1sj/2Q==">
   </div>

Read more: שלמה גולדברג

Posted via email from jasper22's posterous

Common Service Host

|
Quick fact

Common Service Host is a generic Windows Communication Foundation Service Host and factory that uses the Common Service Locator to enable service object creation with any Dependency Inversion framework, like Unity, Spring.Net or StructureMap. This enables WCF services to utilize the strength of Inversion of Control and Life Time Management by a centralized factory.

Why use a Common Service Host for WCF?

There are several advantages in allowing a DI-Framework hook into the creation of service objects. The common denominator being that it will be easier to follow sound Software Craftmanship principles when setting up and maintaining your services. Advantages include:
Coordination of shared dependencies and their life time with a well thought through dependency framework. E.g, built in session / connection-management for PerCall / PerSession WCF instance modes in StructureMap / Unity
Simplify unit-testing of the Service class with the ability to Mock all dependencies.
Easily change or extend dependencies without having to touch the services that rely on them. E.g change a dependency on a repository to use the cached version instead of the DB-Only one, in one single place without the need to touch every service.

Since the Common Service Host (CSH) only have a dependency on the Common Service Locator it allows you as a developer to choose the DI-Framework you like to handle the service resolution. CSH comes with providers for the most popular frameworks but is extreamly easy to extend with others.

Read more: Codeplex

Posted via email from jasper22's posterous

Creating and Consuming Resource Dictionaries in WPF and Silverlight

|
Resource Dictionaries are a powerful feature in WPF and Silverlight that enable developers to organize and consume reusable resources.

After completing this walk through you'll understand how to create and merge resource dictionaries in WPF and Silverlight; how to add, consume and modify resources in the dictionary using the tools provided by the WPF and Silverlight Designer in Visual Studio 2010.

Table of Contents
What is a Resource?
Where Can I Locate Resources?
How Do I Create Resources Similar To The Example?
Resources are Declared at Different Scopes
Show me how a ResourceDictionary Used
Where to Go From Here
Links
Comments

What is a Resource?

Before diving into resource dictionaries let's first understand what the term "resource" means when used in the context of a resource dictionary or in a resources section of an object in XAML.

A resource is an object declared in XAML. In the below XAML we see examples of typical resources; my: is an alias for the System namespace in mscorlib.

<UserControl.Resources>
   <LinearGradientBrush x:Key="formBackground" EndPoint="0.5,1" StartPoint="0.5,0">
       <GradientStop Color="Blue" Offset="0" />
       <GradientStop Color="#460000FF" Offset="1" />
   </LinearGradientBrush>
   <my:String x:Key="applicationTitle">Resource Dictionary Demo</my:String>
   <my:Double x:Key="applicationTitleFontSize">18</my:Double>
   <SolidColorBrush x:Key="applicationTitleForeground">Yellow</SolidColorBrush>
</UserControl.Resources>
One reason to use resources in your applications is to promote object reuse across your application. Object reuse provides consistency across the application. Object reuse also makes it very easy to change the application; since you only need to change the resources and all consumers will pick up the change.

The below XAML consumes the above resources.

<Grid x:Name="LayoutRoot" Background="{StaticResource formBackground}">
   <TextBlock
       Text="{StaticResource applicationTitle}"
       Foreground="{StaticResource applicationTitleForeground}"
       FontSize="{StaticResource applicationTitleFontSize}"
       VerticalAlignment="Top"/>
</Grid>

Where Can I Locate Resources?

Resources are located in resource dictionaries.


Read more: WPF & Silverlight Designer

Posted via email from jasper22's posterous