Archive

Author Archive

Synology DS212j review (part 3)

April 12, 2013 2 comments

Synology provided me the opportunity to test a NAS device: the DS212j. In the next couple of weeks, I will write a review of this device split over a number of blog posts. It will be a rather untraditional NAS review, because I will also spend time looking at its features for running .NET and PHP code, how easily it can run developer tools and finally I will have a look at the SDK.

  1. The Synology DS212j
  2. Setting up a Development environment on the NAS
  3. Running custom .NET/PHP/… code (this article)
  4. A look at the DSM4.1 SDK

Introduction

In this third part of the review of the Synology DS212j, we will have a look at the device its capabilities to host custom written software. The DSM operating system is in essence a Linux based operating system powered by the well-known Apache web server. This means that most of your software should run without glitches. The only differences between the DS212j and traditional servers are the different CPU architecture (ARM vs. x86) and the fact that the device is using an embedded (and thus slower) processor.

Please note: the high-end devices of Synology are equipped with more powerful Intel processors.

I will mainly concentrate on the hosting of web based applications, although nothing prevents you from running custom console applications on the device as well.

DNS Server

One of the optional packages that can be installed on the DSM OS is a DNS server. End users should never be confronted with IP addresses of computers. They should use human readable domain names. If you do not already have a DNS server on your local network, I highly recommend setting this up on the DS212j. This way, you can give nice domain names to all your applications hosted on the DS212j.

I choose to create a master zone called “intranet”. In this master zone, I created all the necessary resource records for my hosting needs.

dns_server dns_a_record

Please note: once you have set up the DS212j as the DNS server for your network, you are not restricted to using it solely for assigning domain names to the NAS itself. You can use it to assign domain names to any device in your network.

Apache webserver

Out of the box the DSM OS comes equipped with the Apache web server and support for PHP. By using the package center, support for various other programming languages (Python, Perl and Mono) can easily be added.

Furthermore support for MySQL databases is available and the phpMyAdmin management can be installed for easy database management. No other databases are available in package center.

Uploading web applications

Uploading a web application to the NAS is easy. It is sufficient to copy the web application to a subdirectory of the special “web” share on the NAS by FTP, Windows networking or WebDAV.

Optionally, virtual directories can be created using the configuration panel of the DSM OS.

virtual_host

.NET (with Mono)

Thanks to the Mono project, the DS212j has the ability to run .NET software. Unfortunately, the version of Mono available in the package center is still version 2.11. This version does not yet include support for ASP.NET MVC 4.0.

From Mono 3.0 onwards, the Mono developers bundled the open source ASP.NET MVC framework of Microsoft. So .NET developers are currently restricted to using ASP.NET 3.5 Webforms features. Let’s all hope Synology will update the Mono package in the near future :-)

hello_world_mono

I created a couple of test ASP.NET applications and most basic features seem to work without real issues as long as you stick to ASP.NET 3.5. I was not able to easily deploy ASP.NET 4.0 applications (Mono complained about various issues with my web.config).

mono_error

Publishing from Visual Studio 2010/2012

Visual Studio provides the possibility to publish web applications straight from the IDE to a web server. In order to publish to the DSM OS you must ensure that FTP is activated on the NAS. Once this is the case, you can configure Visual Studio by right clicking on the project node and selecting the “Publish…” option.

In the Publish screen you can create a new publish profile for the NAS as shown on the screenshots below.

publish_web

You can also use the web.config transformation mechanism to modify the web.config for the release build if other settings are required on the DSM OS. You could also whish create a dedicated build configuration for publishing to the NAS.

For more information, please see the following MSDN links:

PHP

The DSM OS offers out of the box a fully functioning PHP 5.3.21 environment. Unlike the limited .NET hosting support offered through Mono, the PHP support is 100% the same as on any other Linux server. This means that most of your applications can run on the DS212j with no or minor modifications.

phpVersionInfo

I am by no means a PHP expert, but during this part of the review I used the opportunity to develop a simple mobile web application in jQuery Mobile and PHP. I encountered no issue at all to migrate the app from my Windows machine to the DSM. The entire application continued to function correctly.

Mobile_Notes

Summary

Depending on the requirements, the DS212j can be a great hosting environment for running your own (web) applications. It comes with support for most of the programming languages you expect to have on a Linux server. Just keep in mind that the NAS is powered with an ARM CPU optimized for low power consumption. Do not expect to see the same performance as offered by modern computers or servers.

Categories: Review

Google OAuth 2.0 on Windows Phone

Introduction

OAuth is a protocol for authorization. It allows desktop, mobile and web applications to access web resources (mostly REST services) on behalf of a user. The protocol permits this without the user having to share its credentials (typically, a username and password pair) with the application. OAuth is a widely implemented protocol. Various companies (like Facebook, Twitter, Google, Microsoft, Dropbox …) use it to protect their APIs.

In this article, I will explain how we can implement support for Google OAuth in a Windows Phone application.

How does OAuth work

In a nutshell when developing a mobile application, a developer must register its application to the vendor of the service (in our case Google) who will assign a clientId and a clientSecret to the application.

The login flow starts with the application opening an embedded web browser control. This web control must load a specific Google login page. In the query string, the clientId of the application and the requested scopes are sent to the login page. Scopes are the actions the application wants to perform on behalf of the user. Google will handle the user authentication and consent, but at the end an authorization code is sent to the web browser control (using the “title” of the final HTML page).

OAuth Windows Phone authorization flow

After having received the authorization code, the application can exchange this for an access token and a refresh token. The access token can be used by the application to perform the necessary operations on behalf of the user. The refresh token must be stored for future use; it allows to request a new access token when the previous one expired.

Implementing Google OAuth on Windows Phone

You will have to register your application at https://code.google.com/apis/console#access. This will provide you a clientId and clientSecret that you can use to identity your application to the user when performing the OAuth flow.

My implementation consists of 2 big components, a class called “OAuthAuthorization” and a Windows Phone Page called “LogingPage”.

When the developer calls the method “Authorize” of the OAuthAuthorization class, the login page is opened on the screen. This page will show the embedded web browser control full screen (an important detail is that scripting support for this embedded must be activated; by default it is disabled). The Google login page is opened and navigated event handler is attached to the browser control. When the web browser control is redirected to the success page of the login flow, the authorization code is extracted and the login page is closed.


public partial class LoginPage : PhoneApplicationPage
{
    public LoginPage()
    {
        InitializeComponent();
    }

    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        base.OnNavigatedTo(e);

        IDictionary parameters = this.NavigationContext.QueryString;

        string authEndpoint = parameters["authEndpoint"];
        string clientId = parameters["clientId"];
        string scope = parameters["scope"];

        string uri = string.Format("{0}?response_type=code&client_id={1}&redirect_uri={2}&scope={3}",
            authEndpoint,
            clientId,
            "urn:ietf:wg:oauth:2.0:oob",
            scope);

        webBrowser.Navigate(new Uri(uri, UriKind.Absolute));
    }

    private void webBrowser_Navigated(object sender, NavigationEventArgs e)
    {
        string title = (string)webBrowser.InvokeScript("eval", "document.title.toString()");

        if (title.StartsWith("Success"))
        {
            string authorizationCode = title.Substring(title.IndexOf('=') + 1);
            PhoneApplicationService.Current.State["MobileOauth.AuthorizationCode"] = authorizationCode;

            NavigationService.GoBack();
        }
    }
}

Using the client id and the client secret, the OAuthAuthorization class will call a Google REST API to exchange the authorization code for an access token and a refresh token.

public class OAuthAuthorization
{
    private readonly string authEndpoint;
    private readonly string tokenEndpoint;
    private readonly PhoneApplicationFrame frame;

    public OAuthAuthorization(string authEndpoint, string tokenEndpoint)
    {
        this.authEndpoint = authEndpoint;
        this.tokenEndpoint = tokenEndpoint;
        this.frame = (PhoneApplicationFrame)(Application.Current.RootVisual);
    }

    public async Task Authorize(string clientId, string clientSecret, IEnumerable scopes)
    {
        string uri = string.Format("/MobileOauth;component/LoginPage.xaml?authEndpoint={0}&clientId={1}&scope={2}",
                                    authEndpoint,
                                    clientId,
                                    string.Join(" ", scopes));

        SemaphoreSlim semaphore = new SemaphoreSlim(0, 1);

        Observable.FromEvent(
            h => new NavigatingCancelEventHandler(h),
            h => this.frame.Navigating += h,
            h => this.frame.Navigating -= h)
                    .SkipWhile(h => h.EventArgs.NavigationMode != NavigationMode.Back)
                    .Take(1)
                    .Subscribe(e => semaphore.Release());

        frame.Navigate(new Uri(uri, UriKind.Relative));

        await semaphore.WaitAsync();

        string authorizationCode = (string)PhoneApplicationService.Current.State["MobileOauth.AuthorizationCode"];

        return await RequestAccessToken(authorizationCode, clientId, clientSecret);
    }

    public async Task RefreshAccessToken(string clientId, string clientSecret, string refreshToken)
    {
        HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(tokenEndpoint);
        httpRequest.Method = "POST";
        httpRequest.ContentType = "application/x-www-form-urlencoded";

        using (Stream stream = await httpRequest.GetRequestStreamAsync())
        {
            using (StreamWriter writer = new StreamWriter(stream))
            {
                writer.Write("refresh_token=" + Uri.EscapeDataString(refreshToken) + "&");
                writer.Write("client_id=" + Uri.EscapeDataString(clientId) + "&");
                writer.Write("client_secret=" + Uri.EscapeDataString(clientSecret) + "&");
                writer.Write("grant_type=refresh_token");
            }
        }

        using (WebResponse response = await httpRequest.GetResponseAsync())
        {
            using (StreamReader streamReader = new StreamReader(response.GetResponseStream()))
            {
                string result = streamReader.ReadToEnd();
                TokenPair tokenPair = JsonConvert.DeserializeObject(result);
                tokenPair.RefreshToken = refreshToken;

                return tokenPair;
            }
        }
    }

    private async Task RequestAccessToken(string authorizationCode, string clientId,
                                            string clientSecret)
    {
        HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(tokenEndpoint);
        httpRequest.Method = "POST";
        httpRequest.ContentType = "application/x-www-form-urlencoded";

        using (Stream stream = await httpRequest.GetRequestStreamAsync())
        {
            using (StreamWriter writer = new StreamWriter(stream))
            {
                writer.Write("code=" + Uri.EscapeDataString(authorizationCode) + "&");
                writer.Write("client_id=" + Uri.EscapeDataString(clientId) + "&");
                writer.Write("client_secret=" + Uri.EscapeDataString(clientSecret) + "&");
                writer.Write("redirect_uri=" + Uri.EscapeDataString("urn:ietf:wg:oauth:2.0:oob") + "&");
                writer.Write("grant_type=authorization_code");
            }
        }

        using (WebResponse response = await httpRequest.GetResponseAsync())
        {
            using (StreamReader streamReader = new StreamReader(response.GetResponseStream()))
            {
                string result = streamReader.ReadToEnd();
                return JsonConvert.DeserializeObject(result);
            }
        }
    }
}

Using the OAuth implementation

The implemented framework is simple in usage. The following example shows how to use it:

// Request an access token
OAuthAuthorization authorization = new OAuthAuthorization(
    "https://accounts.google.com/o/oauth2/auth", 
    "https://accounts.google.com/o/oauth2/token");
TokenPair tokenPair = await authorization.Authorize(
    ClientId,
    ClientSecret,
    new string[] {GoogleScopes.CloudPrint, GoogleScopes.Gmail});

// Request a new access token using the refresh token (when the access token was expired)
TokenPair refreshTokenPair = await authorization.RefreshAccessToken(
    ClientId,
    ClientSecret,
    tokenPair.RefreshToken);

The access token must be sent using the Authorization: Bearer HTTP header when calling a Google API.

Conclusion

Implementing OAuth support on Windows Phone is quite simple to do. The authentication and user consent logic is handled by Google and integrated into an app by embedding the web browser control. Once a token is obtained, the application can perform the requested actions on behalf of the user until the user revokes the access for the application.

I have put the source code on GitHub as a reusable framework. The OAuth framework should also be usable with the various other OAuth providers.

You can find it at: https://github.com/pieterderycke/MobileOAuth.

Categories: REST, Windows Phone 8

Jace.NET 0.8 released

February 27, 2013 1 comment

Jace.NET 0.8 has been released for .NET, WP7, WP8 and WinRT. This is a major update to the calculation engine. The following features have been added or fixed:

  • Rewrite of function handling
  • Support for custom functions
  • Support for multiple new mathematical functions
  • Fixed a parsing bug occurring with negative numbers

The new version is uploaded to the official NuGet repository: https://www.nuget.org/packages/Jace. The source can be found on GitHub: https://github.com/pieterderycke/Jace.

The documentation will be updated the coming days to cover the new features: https://github.com/pieterderycke/Jace/wiki.

Categories: Jace.NET

HTC 8X Review

February 16, 2013 Leave a comment

What’s inside the box

When you see a packaged HTX 8X you immediately notice how “green” its packaging is. All is mainly made of paper and cardboard. It’s good no notice that HTC is doing a serious effort to help saving the environment.

DSC01661 DSC01663

Inside the packaging, you will find the device itself, a pair of ears and a Micro-USB cable and power adapter. There is also a quick guide included to help you getting started with the device.

Device

I own a Nokia Lumia 800 and although the HTC 8X is with its 4.3 inch slightly bigger, it is a lot lighter and more pleasant to hold in your hands. The curved polycarbonate back feels really superb.

 DSC01665 DSC01669 DSC01664

The screen is bright and crisp and has a good viewing angle. It is a 4.3 inch 16:9 screen running with a 1280×720 resolution (a noticeable improvement compared to the 800×480 resolution of previous generation WP7.5 devices).

DSC01666

Performance of the device is good with the Qualcomm S4 1.5 GHz Dual-core CPU combined with 1 GB of RAM. All applications I daily run on the Nokia Lumia 800, run remarkably faster on the HTC 8X. Most applications and games start almost immediately.

The device has 16 GB of free storage, but there is no support to extend the internal storage with an SD card. Although, this should be sufficient for most users, audio freaks who want their entire music collection in their pocket could be disappointed. I would prefer different models with different internal storage sizes, similar to the iPhones.

Battery life is very good and the device charges quickly. My mobile phone usage is above average and I can easily come through the day without a recharge. Furthermore, it contains all the necessary features you expect from a (high-end) smartphone: Wifi, GPS, a gyroscope, a front and back camera … FM radio is unfortunately not supported.

Operating System

The HTC 8X is running on Windows Phone 8, the latest mobile phone operating system of Microsoft. Under the hood this OS underwent major changes compared to the previous version. It is now running on a NT kernel similar to Windows 8. Thanks to this new kernel, Microsoft now supports dual core CPUs and NFC on phones.

The user interface underwent minor changes. The look and feel of Windows Phone 8 is still pretty much the same as it was on Windows Phone 7, but this is not a negative point. It makes WP8 a beautiful and simple to use OS. The responsiveness of the OS is remarkable good; although this could also be thanks to the hardware of the HTC 8X.

wp_ss_20130207_0001 wp_ss_20130207_0002 wp_ss_20130207_0003

Internet Explorer Mobile has been upgraded to version 10. A version similar to the desktop version available for Windows 8 and soon for Windows 7. Version 10 offers better HTML5 support as well as support for touch interaction. Bookmarks and history can be automatically back-upped to the cloud.

Microsoft made it possible to install updates over the air. Gone are the days you had to install Zune and connect your phone to your PC. A small but pleasant addition :-)

wp_ss_20130207_0005 wp_ss_20130207_0014 wp_ss_20130212_0001

WP8 integrates into Microsoft its Intune device management platform, allowing easy administration of devices for enterprise clients. This makes WP8 (and thus also the HTC 8X) an attractive choice for mid and large enterprises. The only (small) showstopper is the lack of VPN support, although according to rumors on the internet this is planned for a future release of the OS.

Software

WP8 comes out of the box with a collection of high quality software from Microsoft: a mobile version of Microsoft Office with integrated support for Sharepoint and Skydrive, OneNote, a mail client compatible with Exchange, a PDF reader, a maps application …

Just like most Windows Phone manufactures, HTC provides also a number of free dedicated applications for owners of HTC devices. Unfortunately, compared to Nokia the offer is limited and the applications are pretty basic. Nokia bundles: Nokia Drive, Nokia Music, Nokia Reader, Nokia Volume Monitor, Nokia Transit … The number of applications and the quality of these applications is unmatched by any other WP8 manufacturer.

wp_ss_20130207_0007 wp_ss_20130207_0009

All existing WP7 software is compatible with WP8. The offer is more limited then on Android and IOS, but all major apps are there: Angry Birds, Facebook, Twitter, Spotify, Skype … But instead of 100 farting apps available, you will have to be happy with only ten ;-)

wp_ss_20130207_0012

With WP8, Microsoft opened the door for 3rd party application development using DirectX and C++, so I soon expect to see a lot ports of classic computer games similar to the releases on Android and IOS. Let’s all hope a Windows Phone version of GTA Vice City is released in the future :-)

Camera

The 8-megapixel camera of the HTC 8X is remarkable good. Shots are great even in low lighting.

WP_20130216_001 WP_20130216_002

Conclusion

The HTC 8X is a great Windows Phone 8 device. It is light, pleasant to hold in your hands and has a bright crisp screen. The HTC 8X is definitely more elegant then the Nokia Lumia 920, but Nokia bundled better applications. So if you want to buy a new high-end Windows Phone 8 device, you will have to decide between the Nokia apps or the elegancy of the HTC 8X.

Categories: Review

Synology DS212j review (part 2)

February 5, 2013 2 comments

Synology provided me the opportunity to test a NAS device: the DS212j. In the next couple of weeks, I will write a review of this device split over a number of blog posts. It will be a rather untraditional NAS review, because I will also spend time looking at its features for running .NET and PHP code, how easily it can run developer tools and finally I will have a look at the SDK.

    1. The Synology DS212j
    2. Setting up a Development environment on the NAS (this article)
    3. Running custom .NET/PHP/… code
    4. A look at the DSM4.1 SDK

Introduction

Writing this second part of the review was hard. Not that the subject was that hard to grasp, but I found it difficult to find the right angle. The DSM OS is built on top of the Linux kernel and tools. Although the web GUI of DSM does not offer a good support for developer tools (like versioning systems, bug trackers, project management applications …), the underlying Linux system does. And what is great, Synology does nothing to prevent users for accessing the power of this underlying system. All that is needed, is activating SSH support and connecting with the SSH client of your choice. When this is done, you have access to a full blown ARM-powered Linux system.

If you have no Linux or UNIX background it can sometimes be difficult to find your way. I personally am a Windows and .NET developer and although I am not scared from a command line or the PowerShell, it was sometimes quite difficult to find the location of configuration files and applications.

Not all users seem to have issues finding their way around on the DSM using SSH and numerous tutorials and forum posts are available explaining how to install various pieces of software like GIT, SVN, Trac, … The official Synology wiki also contains some valuable information to get you started.

But in a perfect world, setting up a GIT server should be possible with a few clicks in the DSM GUI and using some screens to configure users and create repositories. The same for packages like Trac, Bugzilla … I hope Synology is reading this or some brave developers who are willing to create the necessary 3rd party packages in their free time ;-)

MySQL

Let’s maybe start with looking to what is supported through the web based GUI. Activating MySQL support is a matter of selecting the necessary checkbox in the Web Services screen. The package center allows to additionally install phpMyAdmin. A web based tool for administrating MySQL databases. The only thing you have to know (but it is explained on the Synology website) is that the default username for phpMyAdmin is “root” with an empty password.

mySQL_activate phpMyAdmin

The MySQL database on the DS212j is both accessible for applications running on the NAS and for applications running on another computer. The simplest way to do this from .NET is using NuGet to get the ADO.NET driver for MySQL

MySQL_NuGet_Driver

I took the opportunity to develop some complex app, during this review to test out this feature ;-)

MySQL_connected

Performance varies based on the specs of the hardware, so do not expect to run the MySQL databases of your small enterprise on the DS212j. Nevertheless, if you are a computer geek it can be quite cool to have your own fat client apps connect to a centrally hosted database on your home network.

IPKG (Itsy Package Management System)

Linux distributions mostly rely on a package management system to ease the installation of additional software packages and components. IPKG is the package management system most frequently used on the DSM. In order to use it, you must download and install the correct version for the CPU available in the NAS (the DS212j is powered by a Marvel Kirkwood mv6281 ARM CPU). The following wiki pages on the Synology website explain how to determine the correct version:

1. http://forum.synology.com/wiki/index.php/Overview_on_modifying_the_Synology_Server,_bootstrap,_ipkg_etc

2. http://forum.synology.com/wiki/index.php/What_kind_of_CPU_does_my_NAS_have

ipkg

Subversion

Subversion support is not available out of the box or installable trough the package center, but the IPKG repository contains it. Installing and setting it up is quite simple if you follow this article on the Synology wiki (http://forum.synology.com/wiki/index.php/Step-by-step_guide_to_installing_Subversion). Although, I would prefer an integrated solution trough the package center.

I found it very convenient to host my own repositories on the local network :-)

svn_visual_studio_2012

Small recommendation: due to limited CPU and RAM resources on the DS212j I recommend to use the inetd method as explained on the Synology wiki. This method will only consume resources when required.

GIT

I the past I was a big fan of SVN, but more recently I became fund of GIT. Just like with Subversion, it is not supported by DSM trough the package center, but the IPKG repository contains it. Ryan Helco (http://www.bluevariant.com/2012/05/comprehensive-guide-git-gitolite-synology-diskstation/) took the effort to write down the necessary steps to set it up.

Just like with SVN, I have the same remark: it is not super complicated to set up, but it could be done a lot more integrated and user friendly.

Trac

Installing Trac is similar to Subversion and GIT, the package is available in IPKG (search for “py26-trac”). The official Trac documentation contains all the further documentation necessary to further configure the NAS: http://trac.edgewall.org/wiki/TracInstall.

trac_dsm

But again, why not making this available either officially in the package center or by some brave 3rd party developer?

NuGet Package Repository

Nowadays, NuGet is big in the .NET world. It is a package management system developed by Microsoft for .NET assemblies that simplifies adding them to projects and that helps tracking down dependencies. An official repository feed exists, but it is also quite easy to setup your own feed.

I tested the default NuGet server, but unfortunately the Mono version currently bundled with DSM is 2.11.1 and this prevents the default NuGet server from running. I hope Synology will upgrade to a 3.x version of Mono in the near future.

Summary

Like I already expressed in the introduction of this review, I found it very hard to rate the developer experience of the DS212j. Yes, most developer package can run on the DS212j and a lot of people have already done this successfully. Combined with its low power consumption, this makes it a great device to have in your local network.

Unfortunately, installing and configuring the necessary packages and tools is not always that user friendly. Though, either Synology or the 3rd party ecosystem could change this quite easy in the near future by adding a number of these packages to the package center. The bundled MySQL database and phpMyAdmin are a good example. Both are officially available and setting them up is a piece of cake.

Categories: Review

Jace.NET 0.7.2 released

January 20, 2013 12 comments

Today, Jace.NET 0.7.2 was released. This is the second update release of version 0.7. The number of supported mathematical functions has been dramatically extended. No breaking changes were done to the API.

The documentation on GitHub has also been updated to help people getting started with Jace.NET. An overview is also provided of all the supported mathematical functions and operations.

https://github.com/pieterderycke/Jace/wiki

Jace.NET runs on .NET 4.0 and higher, WinRT, Windows Phone 7 and Windows Phone 8.

Categories: Jace.NET

Synology DS212j review (part 1)

January 20, 2013 4 comments

Synology provided me the opportunity to test a NAS device: the DS212j. In the next couple of weeks, I will write a review of this device split over a number of blog posts. It will be a rather untraditional NAS review, because I will also spend time looking at its features for running .NET and PHP code, how easily it can run developer tools and finally I will have a look at the SDK.

  1. The Synology DS212j (this article)
  2. Setting up a Development environment on the NAS
  3. Running custom .NET/PHP/… code
  4. A look at the DSM4.1 SDK

What’s inside the box

When you open the box you will find the DS212j unit itself, a power adapter, an UTP cable and some screws that can be used for installing the hard disks. In the box you will also find a CD-ROM containing the necessary software and a small printed manual explaining how to install the hard disks. If you have some experience with computer hardware, the installation of the hard drives is quite self-evident. I opted to plug in an older Western Digital hard disk I had lying around.

DSC01315 DSC01316

The NAS contains a Marvell Kirkwood ARM CPU running at 1.2Ghz combined with 256MB ram. When powered on, the DS212j works almost silently. The only noise sometimes hearable is that of the hard disk. Synology also claims that the DS212j consumes less than 18W when accessing the hard disks and around 5.5W when the hard disks are in hibernation. I unfortunately do not have the necessary electrical tools to verify this claim.

The DiskStationManager Operating System

In order to use the NAS device, I had to use the Synology Assistant software package. This tool automatically detected the DS212j on my internal network and allowed me to install the DSM (DiskStationManager) operating system. I downloaded the latest stable version available at the moment of writing (DSM 4.1-2668) and I will use this version during the rest of my review.

Assistant_1 install_progress

After the installation of the DSM operating system, all the further configuration can be done using a web based interface. I was quite impressed by this interface. It basically offers a complete multi window environment made possible by HTML5. In the past, I was used to have simple HTML pages available to configure a network device from my browser. The DSM OS offers a VNC like experience without requiring any browser plugins to be installed.

login first_connect multi_window_ui pilot_view

The DSM OS is built on top of the Linux kernel and other open source software such as for example Apache and Samba, but users do not need to know how to configure these software packages directly. DSM provides a control panel that allows changing settings like network shares, user management, regional options, USB devices, printer sharing … all with a user friendly GUI.

external_devicese file_stationresource_monitor storage_manager_creating_volume

Interoperability

The main functionality of a NAS is of course file sharing. The DS212j fulfills this role perfectly and supports Windows, Mac and Linux network sharing protocols. The DS212j can also be integrated in a Windows Active Domain. This is of course a feature mainly interesting for companies. Besides the basic network sharing protocols, FTP can also be activated on the device.

USB printers can be shared with the desktops on your internal network. Optionally, the DS212j can also make your printers AirPrint and Google Cloud Print compliant. This allows printing from your mobile phones or tablets.

Multimedia files can be shared with devices either supporting AirPlay or DNLA. So in theory with basically every modern device. And as previously mentioned, interoperability with your smartphone is supported if you install the necessary apps.

Apps

We currently live in an age of “apps” and the DSM OS is no exception, using the package manager a user can easily install additional official and 3rd party software packages. The official software packages are quite impressive. They all hook into the web based GUI. For example the Video Station and the Audio Station apps work completely web based and allow to play video and music files respectively on the NAS straight from the browser. More business oriented applications are also available such as a virus scan, a DHCP server, a DNS server, a LDAP Directory server …

audio_station package_centerpackage_center_3rd_party

Besides the DSM OS Apps, Synology also provides a number of apps for mobile devices. These allow to access certain functionalities of the NAS. I was quite surprised to discover that a number of these apps were also available on Windows Phone; a platform neglected by a lot of vendors. The DS Audio, DS Photo and DS Video apps allow to respectively stream audio, photo and video files from the NAS to your mobile phone. The apps are OK, although I personally prefer to have my files locally on the device. The apps only work if the mobile phone is in the same Wi-Fi network as the NAS and they require the user to enter the IP address of the NAS manually. They unfortunately do not contain an auto discover feature.

Initial Conclusion

When you look for a NAS, I definitely recommend the DS212j. It is a great device and thanks to its DiskStationManager operating system it is very extendible and pleasant to use. It supports a ton of features. Making it a great corner stone for a small network. The only showstopper might be that you must be able to buy the correct hard disks and install them yourself. There is no version available with the hard disks pre-installed.

Pro Contra
Almost silent operation Hard disks must be installed manually
Low power consumption
User friendly interface
Extremely extendible

In the next parts of the review, I will investigate if the DS212j can also be recommended for setting up a small development environment. How easily custom .NET and Python code can run on the device and how to develop apps interoperating with the DiskStationManager OS.

Categories: Review

Comparing the performance of Jace.NET and NCalc

December 14, 2012 2 comments

I started the development on Jace because I wanted to develop a high performing mathematical formula execution engine that worked on all the major Microsoft platforms (.NET, Windows RT, Windows Phone 7.5 and Windows Phone 8). Jace was not the first such framework, other calculation engines existed already; like for example NCalc. Unfortunately, to my knowledge no engine was available that also supported newer platforms like Windows RT or Windows Phone.

I decided to compare the performance of Jace with an important competitor: NCalc. I downloaded NCalc 1.3.8.0 and Jace 0.7 using NuGet. Both engines were used with the default settings and were given the same 10 random generated formulas with 3 variables. Each function was executed “n” times with random input.

The graph below clearly shows that Jace.NET greatly outperforms NCalc. The x-axis is showing the total number of formulas executed and the y-axis the total time in milliseconds.

Benchmark Jace.NET vs. NCalc (time in ms.)

As the developer behind Jace, I am very happy to notice that the time I have spent on the dynamic compiler of Jace is paying off. It is responsible for the high performance of execution. This dynamic compiler is available on all platforms Jace supports (.NET, Windows RT, Windows Phone 7.5 and Windows Phone 8) and it is the default setting.

The source of the application used for the benchmark can be found at:
https://skydrive.live.com/redir?resid=7A3CD9AFBD57E81E!761

Homepage NCalc:
http://ncalc.codeplex.com/

Homepage Jace.NET:
https://github.com/pieterderycke/Jace

Categories: Jace.NET

Jace.NET 0.6 released with WinRT support

November 22, 2012 Leave a comment

A new version of Jace.NET is released. Version 0.6 adds support for WinRT. The API remains fully backwards compatible with 0.5. Both the regular .NET build and the WinRT build offer the same API. You can find the latest version in the official NuGet repository:

https://www.nuget.org/packages/Jace

No user visible changes have been done for the 0.6 release. All changes are under the hood to add support for WinRT.

Because the WinRT lacks support for Reflection.Emit, the entire dynamic compiler had to be rewritten to take advantage of Expression Trees. The new dynamic compiler offers the same performance as the existing implementation. No special user actions are required, on WinRT Jace will automatically use the new dynamic compiler.

Future version of Jace.NET will add support for WP7 and WP8. Besides support for new platforms, additional mathematical formulas are planned to be added combined with improvements to the API. The goal is to keep the API backwards compatible with the current implementation.

More information about the architecture of Jace.NET can found at:

https://pieterderycke.wordpress.com/2012/11/04/jace-net-just-another-calculation-engine-for-net/

Categories: Jace.NET

Jace.NET published on NuGet

November 10, 2012 Leave a comment

A couple of days ago, I have released the first version of my mathematical calculation engine for the .NET framework: Jace.NET. This build includes support for all the standard mathematical operations and a number of mathematical functions like: sin, cos, loge, logn, …

https://www.nuget.org/packages/Jace

You can also download a demo application, that gives a visual insight into the parsing and execution steps of Jace.NET:

http://sdrv.ms/UfyWXj

image

More information about the architecture of Jace.NET can found at:

https://pieterderycke.wordpress.com/2012/11/04/jace-net-just-another-calculation-engine-for-net/

https://github.com/pieterderycke/Jace

Categories: C#, Jace.NET
Follow

Get every new post delivered to your Inbox.