Skip to content

Instantly share code, notes, and snippets.

View loliGothicK's full-sized avatar
:octocat:
may the --force-with-lease be with you!

Mitama loliGothicK

:octocat:
may the --force-with-lease be with you!
View GitHub Profile
public class Generator {
public static void main(String[] args){
for ( String str : new String[] { "いなむのみたま" }) {
java.util.List<String> array = java.util.Arrays.<String>asList(str.split(""));
java.util.Collections.shuffle(array);
array.stream().forEach(e->java.lang.System.out.printf(e));
}
}
}
public class Generator {
public static void main(String[] args){
for ( String str : new String[] { "いなむのみたま" }) {
java.util.stream.Stream.<java.util.List<String>>of(
java.util.Arrays.<String>asList(str.split(""))
).peek(
e -> java.util.Collections.shuffle(e)
).forEach(
e -> e.stream().forEach(t -> java.lang.System.out.printf(t))
);
public class Test {
public static <T> T do_something(java.util.function.Consumer<T> cons, T a){
cons.andThen(/*ここをモック化したい*/).accept(a);
return a;
}
}
@loliGothicK
loliGothicK / Interval.java
Last active March 24, 2017 14:35
雰囲気で書いたJava
import java.util.function.Function;
class Interval<T extends Number> implements IntervalExtended
{
private Class<? extends Number> type;
private T lower;
private T upper;
public Interval() {}
@loliGothicK
loliGothicK / decl_def.hpp
Last active April 19, 2017 21:45
宣言と定義
// 宣言
/*
[Note : 宣言は何回でも書ける
- end note]
*/
class Hoge;
class Hoge;
class Hoge;
void f();
int main(){
int i;
int *p = &i; // セーフ
int a = i; // アウトー
}
struct S{
constexpr int x = 1;
};
int main(){
int i = S::x + 1; // セーフ
}
class X; // 不完全型
void f(X &x){
&x; // セーフ
reinterpret_cast<X*>(&x); // セーフ
static_cast<X>(x); // アウトー
}
struct S{
constexpr int x = 1;
};
int main(){
S::x; // discarded-valueなのでセーフ
}