Friday, June 29, 2012

How to create two-dimensional array of Date class for each months (2)

(continued from phosphorescence: How to create two-dimensional array of Date class for each months (1))

If we want to create two-dimensional array for each "year and month", there are 2 ways.

gourp_by with explicit block

require 'date'
begin_day = Date.new(2011, 12, 1)
end_day = Date.new(2012, 2, -1)
hash_each_month = (begin_day..end_day).group_by{|d| [d.year, d.month]} # hash
days_each_month = (begin_day..end_day).group_by{|d| [d.year, d.month]}.values # two-dimensional array

Add method to Data class by open-class

require 'date'

class Date
  def year_month
    [self.year, self.month]
  end
end

begin_day = Date.new(2011, 12, 1)
end_day = Date.new(2012, 2, -1)
hash_each_month = (begin_day..end_day).group_by(&:year_month) # hash
days_each_month = (begin_day..end_day).group_by(&:year_month).values # two-dimensional array

Tuesday, June 26, 2012

How to create two-dimensional array of Date class for each months (1)

How to create two-dimensional array of Date class for each months:
require 'date'
begin_day = Date.new(2012, 4, 1)
end_day = Date.new(2012, 6, -1)
hash_each_month = (begin_day..end_day).group_by(&:month) # hash
days_each_month = (begin_day..end_day).group_by(&:month).values # two-dimensional array

(continue to phosphorescence: How to create two-dimensional array of Date class for each months (2))

Saturday, June 23, 2012

RubyWorld Conference 2012 starts to call for speakers

The site of RubyWorld Conference 2012 has been opened. This conference will be held in November 8 to 9 at Matsue City.

And, They the Committees start to call for speakers.

Wednesday, June 20, 2012

Installing F# 2.0 on FreeBSD

(continued from phosphorescence: Installing Mono on FreeBSD)

FreeBSD ports also have F#, but, this is not version 2.0, so that we should install F# 2.0 from source via Github.
$ git clone http://github.com/fsharp/fsharp.git
$ cd fsharp
$ autoreconf
$ ./configure
$ gmake
$ sudo gmake install
Let's check F# REPL.
$ fsharpi

Microsoft (R) F# 2.0 Interactive build (private)
Copyright (c) 2002-2011 Microsoft Corporation. All Rights Reserved.

For help type #help;;

> 

Monday, June 18, 2012

Installing Mono on FreeBSD

At this time(writing this article), FreeBSD ports provides Mono 2.11. Let's install
# cd /usr/ports/lang/mono
# make install clean
It takes long time. Then let's check C# REPL.
$ csharp
Mono C# Shell, type "help;" for help

Enter statements below.
csharp> 
That's all. But, unfortunatelly, Mono for POSIX does not contain F#...

Friday, June 15, 2012

Windows 8 release preview and ASP.NET MVC4

2 weeks ago, Windows 8 release preview and Visual Studio 2012 RC had been released. As you see, "Visual Studio 11" has been renamed to "Visual Studio 2012", and Express SKUs are ready. So I try "Visual Studio Express 2012 for Web" to develop ASP.NET MVC4.


Tuesday, June 12, 2012

If you fail upgrading KDE with FreeBSD ports from 4.7 to 4.8

If you fail upgrading KDE from 4.7 to 4.8 on FreeBSD ports, let's try these two operations.

Rebuild all ports referencing PNG

# cd /usr/ports
# portupgrade -fr graphics/png
# portupgrade
It takes long long hours.

Rebuild kalgebra

# cd /usr/ports
# pkg_deinstall kalgebra-4.7.X kde-baseapps-4.7.X
# pkgdb -F
It takes long hours. And check more details in /usr/ports/UPDATING.

Saturday, June 9, 2012

VS F# Express still does not come at this time.

A week ago, Microsoft had announced the plan for VisualStudio 2012 SKUs. In that plan, there had been three "Express" SKUs in addition to paid SKUs.
  • VisualStudio Express 2012 for Windows 8
  • VisualStudio Express 2012 for Web
  • VisualStudio Express 2012 for Windows Phone
The SKU "for Windows 8" supports only Metro-style application, so that many people guessed that there were no Express SKUs for C#, F#, VB and C++.

But, at today, Microsoft changes their plan. This Express SKU has been added.
This SKU supports C#, VB and C++. Unfortunately, as you can see, there are no support for F#. VisualStudio F# Express still does not come at this time. When the one will come?

Thursday, June 7, 2012

Debriefing of ruby standardization

In this week, Debriefing of Ruby standardization has been held. I try to write some summaries.
  • Ruby has been standarized as ISO/IEC 30170 in April, 2012.
  • When Matz started creating Ruby as "hobby program" 20 years ago, he had never thought "Ruby becomes any kind of standards" and "Ruby does not fit any kind of standards".
  • ISO advantages
    • Public purchase projects need programming language is standardized.
    • Projects about embedded system want programming language is standardized.
    • Sales talk at business : "Ruby is ISO-standarized!" :-)
  • Ruby is the first "ISO-standardized" programming language born in Japan.
  • Ruby is also the first "ISO-standardized" programming language worked by Japanese standardization team.
  • At first, JIS-standardized in Japanese (March, 2011), at second, JIS-standardized in English (July, 2011), at last, ISO standardized, so that Ruby is also the first programming language from JIS-standardization.
  • Ruby standardization is based on Ruby 1.8.7.
  • Ruby standardization contains common parts between Ruby 1.8.7 and Ruby 1.9.x.
  • Ruby standardization does not contain any parts not-compatible with Ruby 1.9.x.
  • So that current Ruby standardization is not "full set", that is just "fast track procedure".
  • mruby is almost based on Ruby standardization, without Regexp, MatchData, File and IO.
  • Notably, Ruby is still community-based programming language while Ruby is standardized.
  • Tasks after ISO-standardized
    • Refine standards as "full set"
    • Refine standards compatible with Ruby 1.9.x/2.0
    • Backport standards from ISO to JIS
And related information:
  • mruby is for embedded domain - excepting any real time systems.
  • Ruby 2.0 will be released on February, 2013.

Monday, June 4, 2012

How much level Skydrive supports ODF?

Since April 2012, SkyDrive supports Open Document Format (ODF). But, how much level?
How much level Skydrive supports toView in Desktop BrowserEdit in Desktop BrowserView in Mobile BrowserEdit in Mobile Browser
Office DocumentOKOKOKAlmost NG
Open Document FormatOKAlmost NGAlmost NGNG

Friday, June 1, 2012

MariaDB 5.5.24 has been released

In yesterday, MariaDB 5.5.24 has been released. This is the first release after Oracle had been lost by Google in the court:-)