This file contains 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
WITH all_waves AS ( | |
SELECT | |
CONCAT( | |
CAST(job_id AS VARCHAR), | |
'-', | |
CAST(details.quota_num AS VARCHAR) | |
) AS wave_id, | |
job_id, | |
details.quota_num, | |
details.event_type.name AS event, |
This file contains 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
CREATE EXTERNAL TABLE IF NOT EXISTS {your_table_name_here} ( | |
job_score int, | |
job_result struct<failure_wave: int, | |
failure_reason: string, | |
is_clear: boolean | |
>, | |
wave_details array<struct<golden_ikura_pop_num: int, | |
ikura_num: int, | |
golden_ikura_num: int, | |
quota_num: int, |
This file contains 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
package com.sugaishun.sample; | |
import java.io.InputStream; | |
import java.net.URL; | |
import java.util.List; | |
import java.util.Locale; | |
import org.joda.time.DateTime; | |
import android.content.Context; |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<!-- ベースのグラデーション --> | |
<item android:state_pressed="true"> | |
<shape android:shape="rectangle"> | |
<gradinent | |
android:angle="270" | |
android:endColor="#009FD9" | |
android:startColor="#55CBF6" /> | |
</shape> |
This file contains 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
z,d=a=%W|ズン ドコ|;s="";until s[z*4+d] do puts c=a.sample;s+=c end;puts "キ・ヨ・シ!" |
This file contains 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
def zundoko(history = []) | |
return puts 'キ・ヨ・シ!' if history == ['ズン', 'ズン', 'ズン', 'ズン', 'ドコ'] | |
zundoko(history.last(4) << ['ズン', 'ドコ'].sample.tap { |x| puts x }) | |
end | |
zundoko |
This file contains 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
history = [] | |
while history != [0, 0, 0, 0, 1] do | |
n = rand(2) | |
history.push(n) | |
history.shift if history.size > 5 | |
puts n == 0 ? 'ズン' : 'ドコ' | |
end | |
puts 'キ・ヨ・シ!' |
This file contains 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
# Benchmark of Enumerable#lazy. | |
# 'production.log' is a log of Rails application that size is 43.6MB. | |
require 'benchmark' | |
Benchmark.bm do |x| | |
x.report('normal') do | |
100.times do | |
File.open("./production.log") do |f| | |
f.each_line.select { |line| line =~ /RoutingError/ }.first(10) |
This file contains 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
require 'pp' | |
data = [ | |
{:code => 001, :item => {:name => 'jan'}}, | |
{:code => 001, :item => {:name => 'jan'}}, | |
{:code => 001, :item => {:name => 'aaa'}}, | |
{:code => 002, :item => {:name => 'feb'}}, | |
{:code => 002, :item => {:name => 'aab'}}, | |
{:code => 003, :item => {:name => 'mar'}}, | |
{:code => 003, :item => {:name => 'abb'}}, |
This file contains 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
#かなり雑だけどこんな書き方もできる | |
class Bar | |
def initialize(options={}) | |
@options = options | |
end | |
def method_missing(name, *args) | |
if name =~ /=$/ | |
@options[name.to_s.chop.to_sym] = args.first | |
else |
NewerOlder