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

Open-Source NVIDIA Driver Goes Stable On Linux

| Saturday, April 14, 2012
The open source Nouveau driver, a reverse-engineered incarnation of NVIDIA's official proprietary driver for Linux, has reached its biggest milestone. The Nouveau driver is now being considered stable within the Linux kernel and leaving the staging area, with the pledge of a stable ABI. Phoronix has summarized the state of the Nouveau driver, which works fine if you don't care about performance or are fine with running hardware that's a few generations old

Read more: Slashdot

Posted via email from Jasper-net

API reference for Metro style apps

| Friday, April 13, 2012

[This documentation is preliminary and is subject to change.]

For Metro style apps in JavaScript

For Metro style apps in C# and Visual Basic

For Metro style apps in C++

Read more: MSDN
QR: Inline image 1

Posted via email from Jasper-net

Managed vs Native Linkers

| Sunday, April 8, 2012
MonoTouch 5.3.2 is now available (in the alpha channel) and if you look at your application size you’ll notice an executable that’s a bit smaller than before. It must be the linker right ? sort of.

The managed linker (the one I often write about) is unchanged in this new alpha release – but it’s not the only linker being used when building MonoTouch applications. The native linker, part of gcc and coming with Apple iOS SDK, also plays a role in removing unused code. Has this linker changed ? no, but the Mono[Touch] runtime has.

The Mono runtime has internal calls (icalls), i.e. native functions that are called from managed code. E.g. to get the sinus of an angle you call the System.Math.Sin(double) method, which is defined like this:

[MethodImplAttribute (MethodImplOptions.InternalCall)]
public extern static double Sin (double a);

and, because of the [MethodImp(MethodImplOptions.InternalCall)] attribute, the call ends up inside the following function of the Mono runtime:

gdouble
ves_icall_System_Math_Sin (gdouble x)
{
    MONO_ARCH_SAVE_REGS;
    return sin (x);
}

In many ways it’s similar to p/invokes but, until this release, it was not possible for the native linker to remove the unused icalls (native code) from your applications, i.e. you always got every icall MonoTouch was built with.

QR: Inline image 1

Posted via email from Jasper-net

How To Create Android Live Wallpaper

|
Introduction

Starting with Android 2.1. (API Level 7), developers can create live wallpapers - richer, animated, interactive backgrounds - on their home screens. A live wallpaper is very similar to a normal Android application: you can create menu with settings, use SGL and OpenGL for drawing, accelerometer, etc.

In this article, I want to demonstrate how to create live wallpaper from scratch. Step-by-step, we will create live wallpaper that would output TV test pattern on out home screen. Just like on real TV during night hours!
This article will highlight the following aspects of Live Wallpaper development:

Drawing on graphic primitives (circles, rectangles) using android.graphics.Canvas class
Developing of applications for screens with different resolution and orientation
Creation of settings dialog for live wallpaper
Reading of variables values for resource XML file
Actual creation of live wallpaper for Android
Background

In this article, I show how to create a very simple live wallpaper.

On the internet, you can find much more profound and cooler apps, but I want you to check the following examples:

CubeLiveWallpaper - Android SDK sample
Mario Live Wallpaper - Awesome!!!
AndEngine Live Wallpaper - Creating live wallpapers using AndEngine
Using the Code

1. Making Android Virtual Device

As I mentioned earlier, we have to create an appropriate Android Virtual Device (AVD) to run our application.

Read more: Codeproject
QR: Inline image 1

Posted via email from Jasper-net

CALL AN MSBUILD TARGET LIKE A FUNCTION

|
I'm working on building a bunch of projects that all follow a specific convention for naming, NuGet packaging, and so on. As part of that, I want to run the build for each component – from clean to package – all at once rather than clean everything, then build everything, then package everything. (For the sake of the article, let's ignore whether that's a good idea or not and just stick with me.)

MSBuild has batching, which sort of works like "for-each," but in examples you see you can really only "batch" on tasks. Targets (groups of tasks) allow you to specify inputs and outputs, but the "outputs" list is assumed to be files, so if it finds the outputs are up to date, it won't run that input.

Anyway, I found this article that explains how to sort of abuse the inputs and outputs on targets so you can effectively do for-each over a target.

First, create an item list with your inputs and metadata. It doesn't have to be files. For your inputs, pass the list of parameters. For the outputs, put a dummy value that always evaluates to empty/null – that way it's never seen as up to date and will always run.

Here's a sample script:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Start"
  ToolsVersion="4.0">
  <ItemGroup>
    <SomeValues Include="First">
      <Meta>true</Meta>
    </SomeValues>
    <SomeValues Include="Second">
      <Meta>false</Meta>
    </SomeValues>
  </ItemGroup>
  <Target Name="Start">
    <CallTarget Targets="Parameterized" />
  </Target>
  <Target Name="Parameterized" Inputs="@(SomeValues)" Outputs="%(Identity).Dummy">
    <Message Text="Item = %(SomeValues.Identity)" />
    <Message Text="Meta = %(SomeValues.Meta)" />
    <Message Text="---" />
  </Target>
</Project>

Read more: Paraesthesia
QR: Inline image 1

Posted via email from Jasper-net

Using T4 templates with the NHibernate Designer

|
The NHibernate Designer is a great way to design data models for use with the NHibernate object-relational mapper. But once you’ve captured your data model, you may be interested in generating other code from it — anything from data transfer objects (DTOs) right through to scaffolding for a simple admin site. In some cases you can do this by editing the designer’s NVelocity templates, but sometimes you want to generate content that doesn’t fit in a C# or VB file, or maybe you just don’t like NVelocity. (I can sympathise with that.) Fortunately, you can use Visual Studio’s standard T4 templating system to do your own code generation off a NHibernate model. Let’s dive in!

Creating the template

To create a T4 template, add a new item to your project and choose Text Template. This gives you an empty starter T4 file.

Next, you need to hook the template up to the NHibernate Designer DLLs. You do this in two parts. First, you add the following incantation to the template directive:

<#@ template inherits="Microsoft.VisualStudio.TextTemplating.VSHost.ModelingTextTransformation" ... #>

Don’t worry about what this means — it’s just a bit of plumbing to bring in the same Visual Studio subsystem that the NHibernate Designer sits over. Next, you add a couple of assembly references:

<#@ assembly name="Mindscape.NHibernateModelDesigner.DataModel.dll" #>
<#@ assembly name="Mindscape.NHibernateModelDesigner.Dsl.Mapping.dll" #>

Also, by default the T4 template generates an output file with a .txt extension. I’m going to stick with this to keep the example simple, but more usually, you’ll want something more meaningful such as .cs or .aspx. If so, change the output directive:

<#@ output extension=".cs" #>

Finally, you need to hook your template up to your NHibernate model, using a NHibernateModel directive. I’m going to assume we have a file called StoreModel.nhmodel, so my directive looks like this:

<#@ NHibernateModel processor="NHibernateModelDirectiveProcessor"
                    requires="fileName='StoreModel.nhmodel'" #>

Now everything is ready, we can start to generate some code.

Read more: Mindscape blog
QR: Inline image 1

Posted via email from Jasper-net

JIGSOAR ICONS

|
Inline image 1

A free, creative commons licensed custom designed icon set with 60 vector shapes, perfect for the web.

Read more: JIGSOAR 
QR: Inline image 2

Posted via email from Jasper-net

NUnit 2.6.0 has been released.

|
NUnit 2.6.0 has been released at http://www.nunit.org/index.php?p=download

Read more: Tatworth
QR: Inline image 1

Posted via email from Jasper-net

Using the Visual C/C++ Compiler (2)

|
Introduction

This time I will have a look at function level linking. Again I show a bit what is going on in the background and how enabling or disabling this functionality will affect the generated code

Background

I assume the reader to be familiar with the basics of the Visual C/C++ compiler. Also the reader should not be affraid of using the compiler from the command line.

Function Level Linking

Looking at the small code sample below we would expect the linker to throw away the sub function as it is not used by the code at all.

// sample.cpp

int add(int a, int b) {
   return a + b;
}

int sub(int a, int b) {
   return a - b;
}

int main() {
   int c;
   c = add(2, 4);
}

Unfortunately this will not happen. Because the main task of a linker is to combine sections of same type (e.g. code sections) and thereby resolve externals.

The compiler cannot help in this situation either. It compiles each unit of source code one by one. Once it has compiled a file of source code to an object file it completely forgets about it. Thus it cannot throw away a function just because it is not used in the source code file being compiled. The function might be used (later) by another translation unit which declares it extern.

So when calling the Visual C/C++ compiler this way

   cl /FAs sample.cpp /link /entry:main /nodefaultlib /map

we see it generate code for the sub function.

0001:00000000   ?add@@YAHHH@Z   0000000140001000 f   sample.obj
0001:00000020   ?sub@@YAHHH@Z   0000000140001020 f   sample.obj
0001:00000040   main            0000000140001040 f   sample.obj

Read more: Codeproject
QR: Inline image 1

Posted via email from Jasper-net