I take a summer vacation, and, I take a study for the IPA Examination in this October.
So I suspend posts to this blog until this October.
Friday, August 2, 2013
Monday, July 29, 2013
PC-BSD starts to distribute rolling release based on FreeBSD 9.2
PC-BSD starts to distribute rolling release "PC-BSD 9.2 beta".
Rolling-Release and 9.2-BETA1 Released
This is based on FreeBSD 9.2 beta. and its ISOs and images are available in here.
Rolling-Release and 9.2-BETA1 Released
This is based on FreeBSD 9.2 beta. and its ISOs and images are available in here.
Friday, July 26, 2013
A book for Qt Quick will be also published in Japan.
In last year, a book for Qt Quick had been published in China.
http://www.amazon.com/dp/7512407815/
And in this year, another one will be also published in Japan.
http://ascii.asciimw.jp/books/books/detail/978-4-04-891512-0.shtml
http://www.amazon.com/dp/7512407815/
And in this year, another one will be also published in Japan.
http://ascii.asciimw.jp/books/books/detail/978-4-04-891512-0.shtml
Tuesday, July 23, 2013
Regular Expression in F#
Regular Expression in F# is used with Active pattern, in most cases.
open System.Text.RegularExpressions
let (|Matcher|_|) pattern input =
let matcher = Regex.Match(input, pattern)
if matcher.Success then Some (List.tail [ for group in matcher.Groups -> group.Value ])
else None
let matchHttpUrl target =
match target with
| Matcher @"(https?:\/\/\S+)" result -> Some(result.Head)
| _ -> None
> matchHttpUrl "http://www.google.com";; val it : string option = Some "http://www.google.com" > matchHttpUrl "https://www.google.com";; val it : string option = Some "https://www.google.com" > matchHttpUrl "ftp://www.google.com";; val it : string option = None
Friday, July 19, 2013
ISOs and images for PC-BSD's rolling release have been re-deployed
Labels:
PC-BSD
ISOs and images for PC-BSD's rolling release have been re-deployed in here.
Tuesday, July 16, 2013
"Strong parameters" is for controlling mass assignment, not for validation.
Labels:
rails4
Since rails4, controller has new feature called "strong parameters".
rails/strong_parameters
"strong parameters" is an alternative for controlling mass assignment. The original ones are known as attr_accessible and attr_protected on ActiveRecord/ActiveModel until rails3. But, because of "Mass Assingment Vulnerability(CVE-2012-2055)" in last year, these features are considered they should be on controller, should not be on ActiveRecord/ActiveModel. So that "strong parameters" begins.
And, the most important thing is, -"strong parameters" is JUST for controlling mass assignment, not for validation-. ActiveRecord/ActiveModel still have their own (and well known) validation features. that's natural because ActiveRecord/ActiveModel is not only used from Web (controllers) but also from non-Web (batches).
rails/strong_parameters
"strong parameters" is an alternative for controlling mass assignment. The original ones are known as attr_accessible and attr_protected on ActiveRecord/ActiveModel until rails3. But, because of "Mass Assingment Vulnerability(CVE-2012-2055)" in last year, these features are considered they should be on controller, should not be on ActiveRecord/ActiveModel. So that "strong parameters" begins.
And, the most important thing is, -"strong parameters" is JUST for controlling mass assignment, not for validation-. ActiveRecord/ActiveModel still have their own (and well known) validation features. that's natural because ActiveRecord/ActiveModel is not only used from Web (controllers) but also from non-Web (batches).
Friday, July 12, 2013
Calculate the firefox year with using Seq.unfold #2
Labels:
F#
(continued from phosphorescence: Calculate the firefox year with using Seq.unfold)
To refine more readable, adapt Active Pattern.
To refine more readable, adapt Active Pattern.
open System
let (|IsBetweenDate|) (targetDate, currentDate, nextDate) =
(DateTime.Compare(targetDate, currentDate)>0, DateTime.Compare(targetDate, nextDate)>0)
let firefoxRollingReleaseDate n =
let firefox5ReleaseDate = new DateTime(2011, 6, 21)
let firefox6ReleaseDate = firefox5ReleaseDate.AddDays(7.0 * 8.0)
let firefoxRollingRelease (currentDate:DateTime, nextDate:DateTime) =
match (new DateTime(2012, 12, 25), nextDate, nextDate.AddDays(7.0 * 6.0)) with
| IsBetweenDate (true, false) -> Some(currentDate, (nextDate, nextDate.AddDays(7.0 * 7.0)))
| IsBetweenDate _ -> Some(currentDate, (nextDate, nextDate.AddDays(7.0 * 6.0)))
match n < 5 with
| true -> failwith "The version was not yet in rolling release."
| _ -> Seq.nth (n - 5) <| Seq.unfold firefoxRollingRelease (firefox5ReleaseDate, firefox6ReleaseDate)
Monday, July 8, 2013
ISOs and images for PC-BSD's rolling release have been erased.
Labels:
PC-BSD
PC-BSD Now Uses a CDN
But, ISOs and images for PC-BSD's rolling release have also been erased, so that the site http://mirrors.isc.org/pub/pcbsd/9.1-RELEASE/ is now "404 - Not Found".
The information above is now obsoleted. Please check current information:
phosphorescence: ISOs and images for PC-BSD's rolling release have been re-deployed
Thursday, July 4, 2013
Qt 5.1 and QtCreator 2.7.2 have been released
Labels:
Qt
Today, Qt 5.1 and QtCreator 2.7.2 have been released
As you can see in download page, there are many binaries, especially, for Windows.
As you can see in download page, there are many binaries, especially, for Windows.
Monday, July 1, 2013
Calculate the firefox year with using Seq.unfold
Labels:
F#
(Check also phosphorescence: Calculate the firefox year #2 and phosphorescence: Calculate the firefox year #2 (Fixed))
In this article, rewrite with using Seq.unfold . It becomes quite simple architecture.
In this article, rewrite with using Seq.unfold . It becomes quite simple architecture.
open System(continue to phosphorescence: Calculate the firefox year with using Seq.unfold #2)
let firefoxRollingReleaseDate n =
let firefox5ReleaseDate = new DateTime(2011, 6, 21)
let firefox6ReleaseDate = firefox5ReleaseDate.AddDays(7.0 * 8.0)
let isBetweenDate(targetDate:DateTime, currentDate:DateTime, nextDate:DateTime) =
match (DateTime.Compare(targetDate, currentDate)>0, DateTime.Compare(targetDate, nextDate)>0) with
| (true, false) -> true
| (_, _) -> false
let firefoxRollingRelease (currentDate:DateTime, nextDate:DateTime) =
match isBetweenDate(new DateTime(2012, 12, 25), nextDate, nextDate.AddDays(7.0 * 6.0)) with
| true -> Some(currentDate, (nextDate, nextDate.AddDays(7.0 * 7.0)))
| _ -> Some(currentDate, (nextDate, nextDate.AddDays(7.0 * 6.0)))
match n < 5 with
| true -> failwith "The version was not yet in rolling release."
| _ -> Seq.nth (n - 5) <| Seq.unfold firefoxRollingRelease (firefox5ReleaseDate, firefox6ReleaseDate)
Thursday, June 27, 2013
Monday, June 24, 2013
Npgsql's status for supporting EntityFramework
Labels:
ASP.NET MVC,
PostgreSQL
In this article (Npgsql Code First Entity Framework 4.3.1 Sample), I have learned that the current version of Npgsql - PostgreSQL's .NET Driver - only supports EntityFramework4, NOT supports EntityFramework5. And it the next article (Initial EF-6 support added to Npgsql), the next version of npgsql will support EntityFramework6 (may support EntityFramework5).
Thursday, June 20, 2013
Tips while freebsd-update
Labels:
FreeBSD
1. Before freebsd-update fetch
If there is no /boot/GENERIC file,# cd /boot # ln -s /usr/src/sys/amd64/conf/GENERIC .
2. Before freebsd-update install
Do mergemaster command.Monday, June 17, 2013
I've finished reading "Refactoring: Ruby Edition"
Since this post, it has taken 17 months because I read it slowly with doing another coding or reading another book.
Fortunately, I have already done most of refactoring examples. But these three examples are not, so that this book is useful for me.
Fortunately, I have already done most of refactoring examples. But these three examples are not, so that this book is useful for me.
- Introduce Class Annotation
- Replace Type Code with State/Strategy
- Introduce Expression Builder
Thursday, June 13, 2013
QtProject provides out-of-the-box MinGW sources and binaries
Labels:
mingw
Monday, June 10, 2013
How to upgrade msysGit full
If you use msysGit full installer and want to upgrade from old one, there are two points to be noted.
- rename or remove bin/git.exe
- rename or remove git/git.exe
Thursday, June 6, 2013
Opera changes its rendering engine to Blink, but bookmark goes away
Opera Next 15 and Opera for Android change these endering engine to Blink, but these bookmark go away. So here comes the site to survey features to be back.
Monday, June 3, 2013
Install Opscode Chef with Ruby 2.0 on FreeBSD Ports Collection
Opscode Chef version 10.x depends on JSON rubygem between 1.4.4 and 1.7.7. But, there are two points to solve:
- Ports collection's rubygem-json146 does not support Ruby 2.0
- The newest version of Ports collection's rubygem-json is 1.8.0
- cd /usr/ports/devel/rubygem-json
- Install and do ports-mgmt/portdowngrade to downgrade to 1.7.7
(or edit Makefile directly to write version 1.7.7) - make install
- cd /usr/ports/sysutils/rubygem-chef
- edit Makefile
rubygem-json>=1.4.4:${PORTSDIR}/devel/rubygem-json146 \ to rubygem-json>=1.4.4:${PORTSDIR}/devel/rubygem-json \ - make install
Thursday, May 30, 2013
The way to install sqlite3 gem on Ruby 2.0 on Windows
Until Ruby 1.9.3, the way to install sqlite3 gem on Windows is easy - just do gem install. But, since Ruby 2.0, it becomes a difficult way. The solution is written in this article, and this is the only one article at this moment.
Monday, May 27, 2013
F# Sequence for Collatz Problem
Labels:
F#
F# Sequence for Collatz Problem is:
let collatzSeq n =
let collatzFunction n =
match n % 2L with
| 0L -> n / 2L
| _ -> 3L * n + 1L
let rec collatzCalc n accum =
let accum'next = Seq.append accum <| Seq.singleton n
if n = 1L then
accum'next
else
collatzCalc <| collatzFunction n <| accum'next
match n > 0L with
| true -> collatzCalc n Seq.empty<int64>
| _ -> failwith "The argument should be a natural number."
> collatzSeq 1L;; val it : seq<int64> = seq [1L] > collatzSeq 2L;; val it : seq<int64> = seq [2L; 1L] > collatzSeq 3L |> Seq.toList;; val it : int64 list = [3L; 10L; 5L; 16L; 8L; 4L; 2L; 1L] > collatzSeq 4L |> Seq.toList;; val it : int64 list = [4L; 2L; 1L] > collatzSeq 5L |> Seq.toList;; val it : int64 list = [5L; 16L; 8L; 4L; 2L; 1L] > collatzSeq 6L |> Seq.toList;; val it : int64 list = [6L; 3L; 10L; 5L; 16L; 8L; 4L; 2L; 1L] > collatzSeq 7L |> Seq.toList;; val it : int64 list = [7L; 22L; 11L; 34L; 17L; 52L; 26L; 13L; 40L; 20L; 10L; 5L; 16L; 8L; 4L; 2L; 1L]
Subscribe to:
Posts (Atom)