Skip to content

Instantly share code, notes, and snippets.

View chokkoyamada's full-sized avatar
🐳
✨ 😂

Naoyuki Yamada chokkoyamada

🐳
✨ 😂
View GitHub Profile
@chokkoyamada
chokkoyamada / gist:e0a7032744dbe8ff3a4e
Created January 24, 2016 21:30
スリープ状態で電話をとろうとすると落ちる @2016/1/24
01-25 06:26:52.513 540-961/? E/Sensors: HAL:write fd 227 returned 'Invalid argument' (22)
01-25 06:26:52.513 540-961/? E/Sensors: HAL:ACCEL update delay error
01-25 06:28:57.423 540-598/? E/InputDispatcher: channel '220a3490 jp.fukushima.namie.town.tsunagappe/jp.fukushima.namie.town.tsunagappe.TopActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-25 06:29:10.653 540-552/? E/Sensors: HAL:ERR Full data packet was not read
01-25 06:29:10.663 540-540/? E/MPL-storeload: calData from inv_save_mpl_states, size=2
01-25 06:29:17.643 30730-30730/jp.fukushima.namie.town.tsunagappe E/CrashReporting: ParseCrashReporting caught a IllegalStateException exception for jp.fukushima.namie.town.tsunagappe. Building report.
01-25 06:29:17.653 30730-30730/jp.fukushima.namie.town.tsunagappe E/CrashReporting: Handling exception for crash
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
@chokkoyamada
chokkoyamada / gist:c55570a92e4642b6ace6
Created January 24, 2016 21:27
トップで「最初へ」を押すと落ちる @2016/1/24
01-25 06:26:38.693 29658-29658/jp.fukushima.namie.town.tsunagappe E/CrashReporting: ParseCrashReporting caught a NullPointerException exception for jp.fukushima.namie.town.tsunagappe. Building report.
01-25 06:26:38.703 29658-29658/jp.fukushima.namie.town.tsunagappe E/CrashReporting: Handling exception for crash
java.lang.NullPointerException
at jp.fukushima.namie.town.tsunagappe.TopActivity.tabBackBtnPressed(TopActivity.java:178)
at jp.fukushima.namie.town.tsunagappe.BaseActivity$1.onClick(BaseActivity.java:69)
at android.view.View.performClick(View.java:4487)
at android.view.View
@chokkoyamada
chokkoyamada / gist:53dd4e369a902d4c0ddc
Last active September 10, 2015 05:50
Shift_JIS, CRLFなcsvをUTF8, LFに変換する
include Kconv
File.open(converted_csv_file, 'w').write(File.open(csv_file, 'r').read.toutf8.encode(:universal_newline => true))
@chokkoyamada
chokkoyamada / gist:8097638
Created December 23, 2013 14:07
init scala spec2 project
apply plugin: 'idea-scala'
buildscript {
repositories{
maven{
url "https://raw.github.com/rodionmoiseev/maven-repo/master/repo/releases"
}
}
dependencies {
classpath group: 'org.rodion.gradle', name: 'idea-scala-plugin', version: '0.2'
@chokkoyamada
chokkoyamada / gist:7509896
Created November 17, 2013 06:04
BackLog API - findIssue
[
{
"summary":"htmlコーディング",
"status":{
"id":2,
"name":"処理中"
},
"created_user":{
"id":1073896564,
"name":"oogushi"
@chokkoyamada
chokkoyamada / monte.rb
Created November 10, 2013 16:08
モンテカルロ法で円周率を求めるRubyスクリプト
ans0 = 0
sampling_num = 1000000
(1..sampling_num).each do
list = [Random.rand(1.0), Random.rand(1.0)]
range = Math.sqrt(list[0]**2 + list[1]**2)
if range < 1.0
ans0 += 1
end
end
@chokkoyamada
chokkoyamada / Vagrantfile
Last active December 26, 2015 15:59
simple vagrant config ~/Documents/vagrant ᐅ vagrant --version Vagrant version 1.2.7 ~/Documents/vagrant ᐅ ruby -v ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::configure("2") do |config|
config.vm.define :server do |server|
server.vm.box = "centos63"
server.vm.network :private_network, ip:"192.168.33.11"
end
@chokkoyamada
chokkoyamada / vagrant file
Created June 17, 2013 23:09
simple vagrant file with berksfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.berkshelf.enabled = true
config.berkshelf.berksfile_path = "Berksfile"
config.vm.box = "centos63chef"
def fizzBuzz(n:Int):String=n match {
case n if n % 15 == 0 => "fizzbuzz"
case n if n % 3 == 0 => "fizz"
case n if n % 5 == 0 => "buzz"
case _ => n.toString()
}
assert(fizzBuzz(3) == "fizz")
assert(fizzBuzz(4) == "4")
assert(fizzBuzz(15) == "fizzbuzz")
@chokkoyamada
chokkoyamada / gist:5492816
Last active December 16, 2015 20:29
count tomcat busy threads by groovy JMX
import javax.management.ObjectName
import javax.management.remote.JMXConnectorFactory as JmxFactory
import javax.management.remote.JMXServiceURL as JmxUrl
serverUrl = 'service:jmx:rmi:///jndi/rmi://localhost:9013/jmxrmi'
conn = JmxFactory.connect(new JmxUrl(serverUrl)).MBeanServerConnection
def query = new ObjectName('Catalina:*')
String[] allNames = conn.queryNames(query, null)