tag:blogger.com,1999:blog-78318209185655156942024-03-10T11:45:35.634+09:00phosphorescencein Japanese : 燐光Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.comBlogger538125tag:blogger.com,1999:blog-7831820918565515694.post-60617380955444573062013-08-02T23:59:00.000+09:002013-08-03T05:48:41.132+09:00Summer vacation 2012, and more...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.Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-62139486418999513912013-07-29T18:06:00.000+09:002013-07-29T18:06:00.754+09:00PC-BSD starts to distribute rolling release based on FreeBSD 9.2PC-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.Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-58552123742330511912013-07-26T18:54:00.000+09:002013-07-26T18:54:00.702+09:00A 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.shtmlYouhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-16634528906034541372013-07-23T20:34:00.000+09:002013-07-23T20:34:46.571+09:00Regular 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
Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-59328433824695712592013-07-19T20:52:00.000+09:002013-07-19T20:52:11.337+09:00ISOs and images for PC-BSD's rolling release have been re-deployedISOs and images for PC-BSD's rolling release have been re-deployed in here.Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-32415964334464069492013-07-16T21:16:00.002+09:002013-07-16T21:21:51.189+09:00"Strong parameters" is for controlling mass assignment, not for validation.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 Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-90011433485992596292013-07-12T19:27:00.000+09:002013-07-12T19:27:00.029+09:00Calculate the firefox year with using Seq.unfold #2(continued from phosphorescence: Calculate the firefox year with using Seq.unfold)
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(2011Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-748390842142697852013-07-08T19:37:00.002+09:002013-07-19T20:53:19.410+09:00ISOs and images for PC-BSD's rolling release have been erased.All packages and binaries for PC-BSD have been switched from mirrors sites to Contents Delivery Network (e.g. BitTorrent).
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:Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-16199200291505561222013-07-04T21:23:00.000+09:002013-07-04T21:23:11.897+09:00Qt 5.1 and QtCreator 2.7.2 have been releasedToday, 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.Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-43652148008652288162013-07-01T18:47:00.000+09:002013-07-19T20:50:34.299+09:00Calculate the firefox year with using Seq.unfold(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.
open System
let firefoxRollingReleaseDate n =
let firefox5ReleaseDate = new DateTime(2011, 6, 21)
let firefox6ReleaseDate = firefox5ReleaseDate.AddDays(7.0 * 8.0)
Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-16241749483296672372013-06-27T19:52:00.000+09:002013-06-27T19:52:00.501+09:00Rails 4 final has been released.In yeasterday, Ruby on Rails 4.0 final has been released. And agile web development with Rails(a.k.a. AWDwR) also becomes ready for Rails 4.0.Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-8211390260925174022013-06-24T19:39:00.000+09:002013-06-24T19:39:00.083+09:00Npgsql's status for supporting EntityFrameworkIn 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).Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-52843937882990201102013-06-20T18:30:00.000+09:002013-06-20T19:44:40.081+09:00Tips while freebsd-update1. Before freebsd-update fetchIf there is no /boot/GENERIC file,
# cd /boot
# ln -s /usr/src/sys/amd64/conf/GENERIC .2. Before freebsd-update installDo mergemaster command.Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-8813221613879401352013-06-17T20:25:00.000+09:002013-06-17T20:25:13.480+09:00I'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.
Introduce Class Annotation
Replace Type Code with State/Strategy
Introduce Expression Builder
Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-83725100666801275002013-06-13T21:20:00.002+09:002013-06-13T21:20:41.136+09:00QtProject provides out-of-the-box MinGW sources and binariesQtProject provides out-of-the-box MinGW sources and binaries in here.
It contains also OpenSSL binaries and ICU binaries.Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-18887171075747310592013-06-10T11:07:00.000+09:002013-06-10T11:07:00.445+09:00How to upgrade msysGit fullIf 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
Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-42887838691557156802013-06-06T19:57:00.000+09:002013-06-06T19:57:00.523+09:00Opera changes its rendering engine to Blink, but bookmark goes awayOpera 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.
Sound off! What are the top 3 missing things from the new Opera?Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-21623703402152367802013-06-03T19:41:00.002+09:002013-06-04T00:07:49.697+09:00Install Opscode Chef with Ruby 2.0 on FreeBSD Ports CollectionOpscode 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
So that we must be some operations for install chef
cd /usr/ports/devel/rubygem-json
Install and do ports-mgmt/portdowngrade to downgrade to 1.7.7(or edit Makefile Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-60459406889913220412013-05-30T18:13:00.000+09:002013-06-05T20:01:35.350+09:00The way to install sqlite3 gem on Ruby 2.0 on WindowsUntil 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.
How do I install sqlite3 for Ruby on Windows?
Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-33937228472273269502013-05-27T19:29:00.000+09:002013-05-27T19:29:00.793+09:00F# Sequence for Collatz ProblemF# 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
 Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-14587893582300071952013-05-24T23:37:00.000+09:002013-05-24T23:37:00.444+09:00FreeBSD Study #18(Write it later)Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-31667910635839838192013-05-21T19:39:00.000+09:002013-05-26T09:04:23.025+09:00Harmonic number on F#Harmonic number in F#:
let harmonicNumber n =
let harmonicSeed (current, next) =
Some(current, (next, 1.0m / (1.0m + (1.0m / next))))
match n > 0 with
| true -> Seq.reduce (+) (Seq.take n <| Seq.unfold harmonicSeed (1.0m, 1.0m / 2.0m))
| _ -> failwith "The argument should be a natural number."> harmonicNumber 1Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-39586484521197029052013-05-18T18:33:00.000+09:002013-05-18T18:33:00.352+09:00Ruby 1.9.3-p429, Ruby 2.0.0-p195, JRuby 1.7.4 had been releasedIn this week, Ruby 1.9.3-p429, Ruby 2.0.0-p195 and JRuby 1.7.4 had been released. Ruby 2.0.0-p195 is the first release that is stable 2.0.x release on Windows (from here), and JRuby 1.7.4 us the first release that bundles "2.0 mode".
>%JRUBY_HOME%\bin\jruby --2.0 --version
jruby 1.7.4 (2.0.0) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_21-b11 [Windows 7-amd64]
Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-36542081159236102342013-05-16T20:48:00.001+09:002013-05-20T19:36:53.846+09:00Java Day Tokyo 2013大きな地図で見る
Java Day Tokyo 2013 was held in Akihabara UDX.
KeynoteJava SE strategyThe most improvement : lambda expressionCollection becomes more useful
Advantage for parallel execution of JVM
Other improvementsVirtual Extension Methods : Extending existing Interface
Project Nashron : Brand-new JavaScript engine
Java9 development is going on
Java8 : 2014/02 (Delayed from 2013 4Q)
Java9 : 2 year Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0tag:blogger.com,1999:blog-7831820918565515694.post-37475932167838297922013-05-13T19:18:00.000+09:002013-05-13T19:18:00.416+09:00Get prime numbers on F# (infinite)(continued from phosphorescence: Get prime numbers on F# (finite))
Rewrite to get prime numbers on F# using Sieve of Eratosthenes algorithm with infinite sequence.
module Prime =
let primeTable = ref (Seq.empty<int64>)
let takeSmallerThanSquare n sequence =
Seq.takeWhile (fun elem -> elem * elem <= n) sequence
let Youhei Kondouhttp://www.blogger.com/profile/09153449658738399626noreply@blogger.com0