Skip to content

Instantly share code, notes, and snippets.

View exoego's full-sized avatar
🏠
Working from home

TATSUNO “Taz” Yasuhiro exoego

🏠
Working from home
View GitHub Profile
@exoego
exoego / gist:cdd753c44c07b27b5b0cae809b610d7f
Created December 7, 2016 08:42
Jupyter-Scala: Unexpected error message
In [6]: case class State[S](run: S => S)
Out[6]: defined class State
In [7]: case class Gen[A](sample: State[A])
Out[7]: defined class Gen
In [8]: Gen(State[Int](a => a))
Something unexpected went wrong =(scala.reflect.internal.Types$TypeError: value <none> is not a member of Object{implicit lazy val derive$macro$71(): pprint.PPrint[$sess.cmd7.wrapper.cmd6.wrapper.Gen[Int]]; implicit lazy val derive$macro$74(): pprint.PPrint[cmd6Wrapper.this.cmd5.wrapper.State[Int]]; def derive$macro$84(): pprint.PPrint[$sess.cmd7.wrapper.cmd6.wrapper.Gen[Int]]}
scala.tools.nsc.typechecker.Contexts$ThrowingReporter.handleError(Contexts.scala:1402)
scala.tools.nsc.typechecker.Contexts$ContextReporter.issue(Contexts.scala:1254)
@Controller
public class SearchController {
@Autowired
private SearchService searchService;
@RequestMapping("/search")
public String search(
@ModelAttribute("searchForm")
SearchForm searchForm,
Model model) {
@exoego
exoego / redmine-view-customize-gannt-starting-month.js
Last active December 2, 2015 01:06
Redmine - View Customize - Shows gannt view starting 2 monthes ago
// ガントチャートを2ヶ月前開始で表示
// Shows gannt view starting 2 months ago
$(document).ready(function(){
// configurable
var monthsAgo = 2;
var monthsRange = 6;
// -----
var now = new Date();
var thisMonth = now.getMonth() + 1;
var thisYear = now.getFullYear();
@exoego
exoego / Stream.xml
Created March 9, 2015 13:29
Intellij IDEA Live Templates for Java8 Stream#collect
<templateSet group="Stream">
<template name=".toList" value=".collect(java.util.stream.Collectors.toList())" description="Stream#collect(toList())" toReformat="true" toShortenFQNames="true" useStaticImport="true">
<context>
<option name="JAVA_CODE" value="true" />
<option name="JAVA_STATEMENT" value="false" />
<option name="JAVA_EXPRESSION" value="false" />
<option name="JAVA_DECLARATION" value="false" />
<option name="JAVA_COMMENT" value="false" />
<option name="JAVA_STRING" value="false" />
<option name="COMPLETION" value="false" />
@exoego
exoego / fp_kowai_list.txt
Created October 20, 2014 04:52
函数プログラミングの集い2011/2012、関数型なんたら2014に3回とも「参加(発表含む)」で登録されてるコワイ18名
dico_leque
gab_km
giantneco
golden_lucky
halcat0x15a
mzp
NaOHaq
notogawa
nsyee
omanuke
@exoego
exoego / functional_oojah.html
Created October 20, 2014 04:32
函数プログラミングのつどい2011/2012、函数型なんたらのつどい2014の人数遷移
<html>
<head>
<title>函数プログラミングのつどい2011/2012、函数型なんたらのつどい2014の人数遷移</title>
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['sankey']}]}"></script>
<script type="text/javascript">
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'From');
data.addColumn('string', 'To');
@exoego
exoego / gist:e0967936955ab931c5ea
Created August 9, 2014 23:36
findFirstなどStreamの途中で終了する末端処理が実行されると、中間処理(filter、mapなど)も途中で終了する。
import java.util.OptionalInt;
import java.util.stream.IntStream;
public class FilterDoesNotConsumeWholeStream {
public static void main(String... args) {
final OptionalInt first = IntStream.range(1, 10).map(i -> {
if (i > 5) {
throw new IllegalStateException();
}
@exoego
exoego / 転職先に訊きたいチェックリスト.md
Last active May 25, 2024 15:30
転職活動してて訊きたいことのメモ

制度

  • 有休…
  • 病休…
  • 育休…
  • 年収(月給、賞与など)…
  • 残業代…
  • 早朝/深夜手当…
  • 休出手当…
  • 住宅補助…
@exoego
exoego / SendMoreMoney.java
Last active December 19, 2015 02:39
Using Queen to solve the math puzzle "SEND + MORE = MONEY"
final int m = 1;
List<Integer> answer = range(9, 0).except(m).permutations(7).first(new Predicate<List<Integer>>() {
@Override
public boolean evaluate(final List<Integer> perm) {
int s = perm.get(0);
int e = perm.get(1);
int n = perm.get(2);
int d = perm.get(3);
int o = perm.get(4);
int r = perm.get(5);
@exoego
exoego / DQ7BaroqueTowerPuzzle.java
Created February 22, 2013 02:40
自家製ライブラリでドラクエVIIのバロックタワーのパズルを解いてみました。 元ネタ http://d.hatena.ne.jp/torazuka/20130221/ddd
package net.exoego;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import net.exoego.queen.Sequence;
import net.exoego.util.function.Func1;
import net.exoego.util.function.Func2;
import net.exoego.util.function.Funcs;