Monday, July 30, 2012

RubyKaigi restarts - RubyKaigi 2013 -

In yesterday, dates and venue of RubyKaigi 2013 has been announced. Let's check this page.

Friday, July 27, 2012

Rekonq - the konqueror alternative -

Today, KDE project has announced they start the sub project "Reconq" - the konqueror alternative. This new browser is based on Webkit and featured for HTML5. And it requires Qt 4.8.x or after.

Tuesday, July 24, 2012

FreeBSD Study #9

In last Frieday, FreeBSD Study #9 was held in KDDI Web Commnications' Office.

大きな地図で見る

Today's session is "Managing storage on FreeBSD (vol.1)".
  • What haappens between physical devices and /dev/* file on FreeBSD
    • GEOM is the framework to give abstract tiers between these
  • GEOM class
  • GEOM provider
  • GEOM consumer
  • sysctl kern.geom.*
  • Sample for mirroring on GEOM
  • File system of UNIX
    • Provide approches to file content via the file name
    • Tree structure with a single root
  • Kernel does not necessarily need file systems
  • Userland needs file systems
  • UFS
    • default file system of FreeBSD
  • Structure of UFS
    • inode
    • super block
    • how to approch the block content with inode
  • fsck
    • Check where the inode is collapsed at
  • SoftUpdates
    • Improve performance of fsck
    • Do I/O in async with strict order to add/delete block
  • SoftUpdates + Jornal (SUJ)
    • Since FreeBSD 9.0, SoftUpdates support Journaling
    • Improve the performance more

In this day, Dr Hiroki Sato has explained about Filesystem, GEOM and UFS. I have understood what is UFS+SUJ. On next month, FreeBSD Study #10 will be held and this session will continue with the theme about ZFS.

Saturday, July 21, 2012

Both FreeBSD 9.1 beta1 and PC-BSD 9.1 beta1 have been released

5 days ago, FreeBSD 9.1 beta 1 has been released. Ant then, 2 days ago, PC-BSD 9.1 beta 1 has also been released. Now I'm trying PC-BSD 9.1 beta.

Thursday, July 19, 2012

Protect mass assignment for ASP.NET MVC

In Ruby on Rails, we should protect mass assignment with defining attr_protected (black list) or attr_accessible (white list) on Model like this (via Ruby on Rails Guides).

(black list)
class SomeModel
  attr_protected :admin
  ...
end
(white list)
class SomeModel
  attr_accessible :name
  ...
end

I learned from the book Programming Microsoft® ASP.NET MVC, Second Edition that we should protect mass assignment with defining attribute on argument of Action method, not on Model directly.

(black list)
[HttpPost]
public ActionResult Create([Bind(Exclude="admin")]SomeModel model)
{
    ...
}
(white list)
[HttpPost]
public ActionResult Create([Bind(Include="name")]SomeModel model)
{
    ...
}

The best advantage of this approach is to be able to define black lists or white lists in each actions.

Monday, July 16, 2012

routes.MapRoute

In Ruby on Rails, we define request route on config/route.rb as DSL like this:
match ':controller(/:action(/:id))(.:format)'

I learned from the book Programming Microsoft® ASP.NET MVC, Second Edition that we define request route (1) on Global.asax as RegisterRoutes method or (2) on XXXXAreaRegistration.cs as RegisterArea method, in ASP.NEt MVC. This is the sample:
public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    routes.MapRoute(
        "Default", // Route name
        "{controller}/{action}/{id}" // URL with parameters
    );
}

If we want to set default value for route, add anonymous object as 3rd parameter:
public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    routes.MapRoute(
        "Default", // Route name
        "{controller}/{action}/{id}", // URL with parameters
        new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Default value for parameters
    );
}
In this sample, UrlParameter.Optional means the rest of parameters.

And then, if we want to set constraint for route, add anonymous object as 4th parameter:
public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    routes.MapRoute(
        "Default", // Route name
        "{controller}/{action}/{id}", // URL with parameters
        new { controller = "Home", action = "Index", id = UrlParameter.Optional }, // Default value for parameters
        new { id = @"\d{8}" } // Constraint for parameters
    );
}

Friday, July 13, 2012

F# add-in for MonoDevelop 3.0

A few days ago, F# add-in for MonoDevelop 3.0 has been in beta.

This is easy to install, because we just install via add-in feature.


Monday, July 2, 2012

Summer short vacation 2012

I take a summer short vacation, so I suspend posts and comments to this blog for a moment. Resume will be July 13, 2012.