Skip to content

Instantly share code, notes, and snippets.

View petitviolet's full-sized avatar
🕶️
😃

petitviolet petitviolet

🕶️
😃
View GitHub Profile
@kantoku009
kantoku009 / RegressionAnalysis.py
Last active August 29, 2015 14:02
Numpyを利用して重回帰分析を行うpythonプログラム
#! /usr/bin/python
# -*- coding: utf-8 -*-
#(注意) このファイルは, Tab=4で見ると見易い.
######################################################################################################
# @file RegressionAnalysis.py
# @brief Numpyを利用して重回帰分析を行う.
# @note
# ■重回帰分析について
import scalaz._
import Free.FreeC
class DDD[Entity, ID] {
// repositoryへの操作を代数的データ型で定義し、それをFreeとCoyonedaの力によりモナドにして使う
sealed abstract class RepositoryDSL[A]
// 見つからないかもしれないので結果はOption型
final case class ResolveBy(id: ID) extends RepositoryDSL[Option[Entity]]
@lotz84
lotz84 / lens.lhs
Last active February 21, 2016 16:56
レンズは余状態余モナドの余代数だった
===================================
余余余〜!別名`関数的参照`とも呼ばれる[レンズ](https://hackage.haskell.org/package/lens)はJavaのGetter, Setterと同等と[言われる](https://twitter.com/plt_borat/status/228009057670291456)関数型プログラミングのデザインパターンの一つです。
レンズは余状態余モナドの余代数だと[聞いて](https://twitter.com/hiratara/status/317602743219003392)そうなのかーと思ってたのですが、ふと自分で実装してみたくなったので **余状態余モナドの余代数** として実装してみることにしました。
ちなみにこの文章は`literate Haskell`という形式で書かれているのでダウンロードしてghciでロードすればすぐにでも自分で試すことができます。
まず最初におまじない
> {-# LANGUAGE RankNTypes #-}
@hoshi7
hoshi7 / 1.OneCircleFrontOverlayView(カスタムビュー本体).java
Last active June 5, 2016 11:30
穴をひとつ開けられるカスタムビュー
package jp.hoge.app.androidcookpatern.View;
import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
@taisukeoe
taisukeoe / 201607.md
Last active July 20, 2016 13:03
多相な関数の定義から学ぶ、型クラスデザインパターン

#多相な関数の定義から学ぶ、型クラスデザインパターン

         twitter: @OE_uia github: taisukeoe

##多相な関数

  • 複数の異なる型に対して適用可能な関数
  • どの型に対して定義されているか、静的に決定できる(定義されてない型の値を渡すとコンパイルエラーになる)
@schmmd
schmmd / pre-commit
Created May 7, 2014 16:54
Scalariform Precommit
#!/bin/sh
exec scala -savecompiled "$0" $@
!#
//
// Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
// Modified 2014 AI2 <http://www.allenai.org>
//
// This script will check that the commit is correctly formatted. It only checks files that are to be committed.
// To be run this file should be at `.git/hooks/pre-commit`.
@kaiinui
kaiinui / eventbus.md
Last active March 3, 2017 03:54
Android開発いろいろ

EventBus

EventBus は必ず onStart()onStop() で呼ぶ。バックグラウンドで色々動かれて困る。 また、onStop() では super.onStop() よりも 先に 呼ぶ。

@Override
protected void onStart() {
 super.onStart();
@seratch
seratch / Bootstrap.scala
Last active October 8, 2017 09:45
Skinny Micro on GAE
import javax.servlet._
import skinny.micro._
class Bootstrap extends LifeCycle {
override def init(ctx: ServletContext) {
example.App.mount(ctx)
}
}
@takungsk
takungsk / readme_ja.md
Last active January 12, 2018 09:32
JSON4Sの日本語Readme 私訳

JSON4S Build Status

今現在 java json ライブラリを含めないで 少なくとも 6つの scala向け json ライブラリがあります。

@seratch
seratch / getting_started_ja.md
Last active June 5, 2018 02:56
Skinny Framework 1.0 Introduction in Japanese

NOTICE: This is just a draft of Skinny framework introduction (written in Japanese for now). English version will be published soon.

Skinny Framework とは

Logo

https://github.com/seratch/skinny-framework

Skinny Framework は Scala のフルスタックな Web アプリケーション開発フレームワークです。2014/03 を目処に最初の安定バージョン 1.0.0 をリリースするべく精力的に開発しています。(追記: 2014/03/28 に 1.0.0 がリリースされました)