Skip to content

Instantly share code, notes, and snippets.

View katsyoshi's full-sized avatar
🐢
hello world!

MATSUMOTO Katsuyoshi katsyoshi

🐢
hello world!
View GitHub Profile
@katsyoshi
katsyoshi / float_compair.rs
Created January 27, 2018 11:25
Couldn't compare float number in Rust Lang
fn main() {
let val = vec![1.3, 1.2, 3.0];
val.sort();
for v in val { println!("{}", v); }
}
/*
Compiling sort v0.1.0 (file:///ome/katsu/Prohgram/Rust/zatsu/rust/nlp100/sort)
error[E0277]: the trait bound `{float}: std::cmp::Ord` is not satisfied
--> main.rs:4:10
-[4671]% curl -X GET \
-H 'Authorization: Token 6f916ae6-8472-463a-9808-6af19e459541' \
-d "haute_couture[query]=WITH comments AS (SELECT comments.id, content, users.name AS user_name, comments.created_at FROM comments JOIN users ON comments.user_id = users.id), likes AS (SELECT COALESCE(users.name, '匿名') AS user_name, likes.created_at, comment_id FROM likes LEFT OUTER JOIN users ON likes.user_id = users.id) SELECT comments.id, content, comments.user_name, JSON_AGG(likes ORDER BY likes.created_at DESC) AS liked_by FROM comments JOIN likes ON likes.comment_id = comments.id GROUP BY 1, 2, 3" \
http://sqlql-demo.herokuapp.com/haute_couture | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2340 0 1833 100 507 1833 507 0:00:01 --:--:-- 0:00:01 3798
[
{
-[2667]% cat test.rb
require 'irb'
binding.irb
-(katsu@localhost)-(0)-<2017/06/05 11:25>--------------------------------------------------------------------------------------------------------------------------------------------------------[/home/katsu/Program/Itamae/itamae-recipes]-
-[2668]% itamae local test.rb -l debug
INFO : Starting Itamae...
DEBUG : Executing `mkdir -p /tmp/itamae_tmp`...
DEBUG : exited with 0
DEBUG : Executing `chmod 777 /tmp/itamae_tmp`...
DEBUG : exited with 0
Performing C++ SOURCE FILE Test CXX_SUPPORTS_ALTIVEC failed with the following output:
Change Dir: /home/katsu/Program/GitHub/arrow/cpp/release/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTC_5e2ef/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_5e2ef.dir/build.make CMakeFiles/cmTC_5e2ef.dir/build
gmake[1]: Entering directory '/home/katsu/Program/GitHub/arrow/cpp/release/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_5e2ef.dir/src.cxx.o
/usr/bin/c++ -DCXX_SUPPORTS_ALTIVEC -maltivec -o CMakeFiles/cmTC_5e2ef.dir/src.cxx.o -c /home/katsu/Program/GitHub/arrow/cpp/release/CMakeFiles/CMakeTmp/src.cxx
c++: error: unrecognized command line option '-maltivec'
gmake[1]: *** [CMakeFiles/cmTC_5e2ef.dir/build.make:66: CMakeFiles/cmTC_5e2ef.dir/src.cxx.o] Error 1
-- C level backtrace information -------------------------------------------
/home/katsu/.rbenv/versions/2.3.3/bin/ruby(rb_vm_bugreport+0x535) [0x56415207cba5] vm_dump.c:692
/home/katsu/.rbenv/versions/2.3.3/bin/ruby(rb_bug_context+0xd1) [0x564152059661] error.c:435
/home/katsu/.rbenv/versions/2.3.3/bin/ruby(sigsegv+0x3e) [0x564151f51e0e] signal.c:890
/lib64/libpthread.so.0 [0x7f99fd660e20]
/usr/lib64/libgobject-2.0.so.0 [0x7f99f36549c8]
/usr/lib64/libgobject-2.0.so.0(g_signal_emit_valist+0x1009) [0x7f99f365de49]
/usr/lib64/libgobject-2.0.so.0(g_signal_emit+0x97) [0x7f99f365e0b7]
/usr/lib64/libgtk-x11-2.0.so.0 [0x7f99e52be4c0]
/usr/lib64/libgobject-2.0.so.0(g_object_unref+0x125) [0x7f99f3647f05]
@katsyoshi
katsyoshi / ng.conf
Last active May 31, 2016 07:38
failed upgrade fluentd-0.12 to 0.14
<match td.*.*>
@type tdlog
apikey YOUR_API_KEY
auto_create_table
buffer_type file
buffer_path /var/log/td-agent/buffer/td
<secondary>
@type file
require 'thread'
kurara = false
haiji = 'クララカタタナイ゙'
thread = Thread.new do
loop do |t|
if 10 == rand(11)
kurara = true
haiji = 'クララガタッタ'
raise 'ジシィガシンダ゙'
From: /home/katsu/Program/Mikutter/mikutter/core/mui/gtk_userlist.rb @ line 17 Gtk::UserList#initialize:
12: def initialize
13: super
14: @listview = Gtk::InnerUserList.new(self)
15: scrollbar = ::Gtk::VScrollbar.new(@listview.vadjustment)
16: require 'pry'
=> 17: binding.pry
18: add Gtk::HBox.new(false, 0).add(@listview).closeup(scrollbar)
19: end
require 'jubatus/anomaly/client'
require './jubatus_data'
keys = ('a'..'t').to_a
data = JubatusData.read_data('./baseball.csv',keys,'b')
jubatus = Jubatus::Anomaly::Client::Anomaly.new('localhost', 9199, '')
r = []
data.each do |datum|
if ARGV[0] =~ /update/
p jubatus.overwrite(datum[0], datum[1])