This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Iterator; | |
import java.util.List; | |
import java.util.NoSuchElementException; | |
import java.util.Set; | |
import lombok.AllArgsConstructor; | |
import lombok.Data; | |
import com.google.common.collect.Lists; | |
import com.google.common.collect.Sets; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ArgsPicker { | |
private int i = 0; | |
private final String[] args; | |
public ArgsPicker(String[] args) { | |
this.args = args; | |
} | |
public String nextArg(String defaultValue) { | |
String result = defaultValue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Iterator; | |
/** | |
* Created by orekyuuPC on 14/04/26. | |
*/ | |
public class Vortex { | |
private enum Dir { | |
CENTER(0, 0), // | |
UP(0, -1), // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET SESSION group_concat_max_len = 1000000; | |
SET @columns_query_1 = 'SELECT GROUP_CONCAT(CONCAT(\''; | |
SET @columns_query_2 = '.\',COLUMN_NAME) SEPARATOR \', \') into @out FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ? AND TABLE_SCHEMA = ? AND COLUMN_NAME not in ('; | |
SET @columns_query_3 = ')'; | |
SET @create_view_query_1 = 'CREATE ALGORITHM=MERGE DEFINER='; | |
SET @create_view_query_2 = ' SQL SECURITY DEFINER VIEW '; | |
SET @schema = 'スキーマ名'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Iterator; | |
import lombok.Value; | |
public class PairCollectionSupport { | |
@Value | |
public static class Pair<A, B> { | |
private A a; | |
private B b; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @schema = '<schema>'; | |
SET @table_name = '<table>'; | |
SET @exclude_columns = CONCAT_WS('\',\'','id','hoge'); | |
SET @exclude_columns = CONCAT('\'',@exclude_columns,'\''); | |
SET @sql = CONCAT('SELECT GROUP_CONCAT(COLUMN_NAME) into @out FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ? AND TABLE_SCHEMA = ? AND COLUMN_NAME not in (',@exclude_columns,')'); | |
PREPARE stmt1 FROM @sql; | |
EXECUTE stmt1 using @table_name, @schema; | |
SET @columns = @out; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.annotation.Annotation; | |
import java.util.EnumSet; | |
import com.google.common.collect.Lists; | |
public class AnnotationRecursiveDigger { | |
public interface Function<A extends Annotation> { | |
void work(Class<?> cls, Class<?> superCls, A anno); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Random; | |
import java.util.Set; | |
import lombok.AllArgsConstructor; | |
import lombok.Delegate; | |
import lombok.Getter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f = function(x){ | |
if(-7 < x && x < 7){ | |
p = Math.ceil(Math.abs(x) * 10) % 4 | |
d = 10; | |
ds = 1; | |
if(p % 2 == 0){ | |
if(-5 < x && x < 5){ | |
if(p == 0){ | |
d = 5; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected Slot addSlotToContainer(Slot par1Slot) | |
{ | |
par1Slot.slotNumber = this.inventorySlots.size(); | |
this.inventorySlots.add(par1Slot); // !? | |
this.inventoryItemStacks.add((Object)null); | |
return par1Slot; | |
} | |
public Slot getSlot(int par1) | |
{ |