New IDN domain: スティーブ.みんな

Google has started offering the .みんな domain. The extension means “everyone” and so it can be used by everyone. :)

http://www.youtube.com/watch?v=5FmLnNDw23Y

More information can be found at http://はじめよう.みんな/index.html

This current blog is now also available as http://スティーブ.みんな which would translate to steve.everyone

やった!ワンピースのすべてを見ました!

見ての3月間後、私は、現在のすべてのワンピースエピソードを見ました。

ワンピースは海賊についてアニメです。ルフィはむぎわら海賊のせんちょうです。

Luffy_by_BBXL

ルフィはいつも元気でおもしろいです。そして、かれは一人ではありません。たくさんなかまいます。

12956584253521

9人はいます。フランキーさんとチョッパーさんとウソップさんとゾロさんとルフィさんとナミさんとサンジさんとロビンさんとブルックさんはいます。

Vidyano 4.0.7103

We’ve updated our Vidyano extension on the Visual Studio Gallery and on GitHub (Commit  2838609)

On the client side we have some nice improvements:

  • We’ve added multi-select on the query grid allowing you to use Shift to just select the first and last item of your selection.
  • You can now update the parameters that are going to be send in the execute hook of an action, allowing you to easily add extra parameters.
  • Added an easy to use control for editing user rights.
  • Fixed some rounding issue when re-sizing a master detail screen, when using bulk edit on a flags enum, when trying to load a filter if the action wasn’t available, etc

You can check the complete commit log for the Client on GitHub: https://github.com/2sky/Vidyano/commit/2838609

 

On the service side we have also made some changes:

  • Added the Default TimeZone setting allowing you to choose the default time zone that will be used when new Date/DateTime/DateTimeOffset attributes are used. This change is really useful when deployed to Windows Azure so that DateTime.Now will return a value in the chosen Time Zone.
  • Force attribute with no edit rights to stay read-only even when a developer accidentally changes them.
  • Added the ability to send a uniqueId to the Vidyano Service so that the tokens will be validated against that value instead of the user’s ip address.
  • Added extra information when getting the Program Unit information (Name, PersistentObject Type, …)
  • You can now use coded expression trees when overriding the GetTextSearchExpressionForColumn method without having to build a complete expression tree in code.
  • Fixed an issue with the cache not being correctly updated when searching for relative dates (now, next week, …)

You can get the latest service version of Vidyano by installing the extension from inside Visual Studio (Tools -> Extensions and Updates) or by going to the Gallery: http://visualstudiogallery.msdn.microsoft.com/93793ad7-6fa2-4a90-992e-cb703f72b644

 

The User Right editor will really help new developers when working with rights because it will tell you which actions, schema’s, etc are available.

The first dropdown will show all the available actions, including custom actions, and the combinations (e.g.: QueryRead). The second dropdown allows you to choose an optional schema (Vidyano or your target schema). The third dropdown allows you to choose an optional Persistent Object.

For some actions (Query, Read, Edit, New) you can also choose a fourth option, the attribute.

For easy copy/pasting we also added a toggle option to switch between the editor and a normal text box.

 

The new way of writing code for the GetTextSearchExpressionForColumn allows you to write normal C# code when adding custom filter logic.

protected override Expression<Func<Product, bool>> GetTextSearchExpressionForColumn(QueryColumn column, ParameterExpression entityExpr, MemberExpression propertyExpr, string value, bool isEfQuery)
{
if (column.Name == "Name")
return p => p.Name != null && p.Name.Contains(value, StringComparison.OrdinalIgnoreCase);

return base.GetTextSearchExpressionForColumn(column, entityExpr, propertyExpr, value, isEfQuery);
}

You can write a normal where statement and Vidyano will automatically fix the generated code to match as needed.

There are some things you’ll have to consider, when working directly with LINQ to Entities you can’t use the Contains method with the StringComparison and you don’t really need to check for null.

 

As always, you can post feedback/questions on our website http://www.vidyano.com/#!/Questions which is also written with Vidyano or subscribe to our twitter https://twitter.com/Vidyano to get all the latest information

SignalR and Vidyano

After the announcement of David Fowler about the new release of SignalR, I had to try it out on my Learning Japanese web app (latest commit). I’ve started with basic chat app and added some Vidyano related calls to it (it will automatically translate between English <-> Japanese).

So first I had to add the correct NuGet package to the Web site, instead of the App_Start code I’ve changed the Vidyano code to map the WebAPI routes in the Global.asax.cs because I already had the file.

protected void Application_Start(object sender, EventArgs e)
{
    RouteTable.Routes.MapHubs(); 
    Vidyano.Service.WebControllerFactory.RegisterRoutes();
}

With SignalR they have added a MapHubs extension method, in Vidyano we can use the WebControllerFactory’s RegisterRoutes to do the same. SignalR comes first because it’ll handle the /signalr paths, and Vidyano handles the rest.

My hub is mostly the basic chat hub which can be found in the Chat.cs file:

    public class Chat : Hub
    {
        public void Send(string userName, string message)
        {
            if (string.IsNullOrEmpty(userName))
                userName = "<anonymous>";

            if (string.IsNullOrEmpty(message))
                message = "<empty>";

            string[] translations;
            if (JapaneseKanaClassifier.ContainsJapaneseScript(message))
                translations = Manager.Current.GetTranslations(new[] { message }, "ja", "en");
            else
                translations = Manager.Current.GetTranslations(new[] { message }, "en", "ja");

            var clientMessage = Manager.Current.GetTranslatedMessage("UserSays", userName, message, translations.Length > 0 ? translations[0] : "<unknown>");
            Clients.All.addMessage(clientMessage);
        }
    }

My JapaneseKanaClassifier class is used to see if the message contains any Japanese characters (Kanji, Hiragana or Katakana) and if so it will be translated to English, otherwise it will assume that it is in English and it will be translated to Japanese.

That was all that was needed for the service side part, but I’ve also used the Vidyano Web class to add the needed JavaScripts for the Client part by adding the jquery.signalR-1.0.0-alpha1.min.js embedded with my other scripts, and adding the necessary <script src=”/signalr/hubs” to my html.

As for the client, I’ve used a virtual persistent object Chat to view it in my application and the Chat template is using the following:

<script type="text/javascript">
$(function () {
var chat = $.connection.chat;
chat.client.addMessage = function (message) {
$('#messages').append('<li>' + message.replace('\n', '<br>') + '</li>');
};

function send(){
chat.server.send(app.friendlyUserName, $('#msg').val());
$('#msg').val('');
};

$("#broadcast").on("click", send);
$("#msg").on("keypress", function (e) {
if ((e.keyCode || e.which) == 13)
send();
});

$.connection.hub.start();

$("#msg").focus();
});
</script>

<div>
<ul id="messages"></ul>
<input type="text" id="msg" />
<input type="button" id="broadcast" value="<%= app.getTranslatedMessage('Say') %>" />
</div>

Again nothing special, when clicking on the Say button, or pressing Return it will send the message and the current friendlyUserName to the service.

You can check it all out on http://vidyano.apphb.com/#!/Chat

DefinitelyTyped

Boris Yankov has started collecting TypeScript type defintions for popular JavaScript libraries. These files (ending in .d.ts) describe the public api of an existing library, just like .h files do for C code. This allows you to write TypeScript code against JavaScript libraries without them having to change anything.

Currently available:

You can find all the definition files on his GitHub project: https://github.com/borisyankov/DefinitelyTyped

Let’s talk in Japanese in Belgium

For other people in the Antwerp area, next week (17th of November) we have the next Nihongo Hanasoukai (日本語を話そう会). It’s organised each month and it’s for both native Japanese speakers and people learning Japanese. It’s just 2 hours and costs you € 1 but gives you the opportunity to test and practice speaking Japanese.

I went last month for the first time and it was really fun. They showed us first the different names for the moon (new moon, etc). We were then placed in groups of 3-4 and then we have to make sentences with adjectives. Each group had to read out the sentences they created and afterwards we had a few minutes to just talk about random stuff.

VS Extension of the Week: Web Essentials 2012

This is another must have extension for any Web developer using Visual Studio 2012. It is updated regularly (a lot, like weekly) and they keep adding support for all the latest Web related technologies (TypeScript was added within a week).

Once you have the extension installed it will add native support for LESS, TypeScript, CoffeeScript and it also contains a minifier for generated JavaScript/CSS.

TypeScript

LESS

Web Essentials 2012