Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing on wain project

Linda_pp rhysd

🎯
Focusing on wain project
View GitHub Profile
@rhysd
rhysd / openhash.rb
Created Jun 4, 2011
practice for Ruby.
View openhash.rb
#! /usr/local/bin/ruby
class OpenHash
def initialize elems,f = ->(ob){ return ob.hash}
@hashf = f
@val = { }
elems.each do |elem|
insert elem
end
@rhysd
rhysd / oulogin
Created Jun 11, 2011
Osaka-u Wireless LAN Login
View oulogin
#! /usr/local/bin/ruby
# -*- coding: utf-8 -*-
Profile = "/.oulogin_profile"
require 'mechanize'
require 'rubygems'
idx = ARGV.index "-help"
if idx != nil
@rhysd
rhysd / .vimrc
Created Oct 11, 2011
my vim setting
View .vimrc
let mapleader = ','
syntax on
"行番号表示
set number
"バックアップファイルいらない
set nobackup
"vi協調モードoff
set nocompatible
"自動インデント
View LINDA_PP_quine.rb
eval($q= "$q='eva l($q=% p.split *%p)'%[$q,'' ];$o= 0;(m=%q_efg!q !+b<b/tj{f/uj
nft|}j }u>b\\ j^<qsj ou)j& 3>>1@(!(+u;% r\\%p-u ^*<%p,>u!jg)j &3>>2*~<qvut<
foe_ ).si ze.tim es{| i|m[ i]-= 1};eval(m );p( 0,8, 14,8 ,4,6
,4,7 ,4,1 2,15,5, 36,1 3,6, 13); p(1, 6,16 ,6,6 ,6,4 ,5,6 ,12,
13,7 ,36, 13,6 ,13 );p( 2,4, 18,4 ,8,6 ,3,4 ,8,4,4,4,11, 9,36,4,5,4,6
,4,5 ,4); p(2, 4,18,4, 8,7, 2,4, 8,4,5,4,9,4,3,4 ,35,4,5,4,6 ,4,5,4);p(2
,4,1 8,4, 8,4, 1,3,1, 4,8, 4,5, 4,8,4,
@rhysd
rhysd / .vimrc
Created Dec 11, 2011
Emacs信者向け.vimrc
View make_array.hpp
template <
class... Args,
class Result = std::array<
typename std::decay<typename std::common_type<Args...>::type>::type,
sizeof...(Args)
>
>
inline Result make_array(Args &&... args)
{
return Result{{ std::forward<Args>(args)... }};
@rhysd
rhysd / hoge.cpp
Created May 3, 2012
Preprocess-time stdin
View hoge.cpp
#include <iostream>
int main()
{
char str[] = ""
#include "/dev/tty"
"";
std::cout << str << std::endl;
@rhysd
rhysd / examples.rb
Last active Oct 4, 2015
Examples for Yahoo Japanese Analysis Library
View examples.rb
require 'yahoo-japanese-analysis'
# use module's class methods directly
# configration
YahooJA.configure do |config|
config.app_key = 'your appid'
end
# "日本語形態素解析" API
View gist:2652259
#include <vector>
#include <algorithm>
template<class T>
class sorter_base{
public:
sorter_base(std::vector<T> const& values_) : values(values_){}
void set_values(std::vector<T> const& values_)
{
values = values_;
View euler1.rb
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
MAX = 1000-1
def f(i)
(1..(MAX/i)).map{|n| n*i }.inject 0,&:+
end
#
You can’t perform that action at this time.