Skip to content

Instantly share code, notes, and snippets.

View nemupm's full-sized avatar

nemupm nemupm

View GitHub Profile
@nemupm
nemupm / main.cpp
Created April 26, 2022 09:44
Google Code Jam 2022 Round1B - ASeDatAb
#include <bits/stdc++.h>
#include <random>
using namespace std;
#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#define itrout(x) for(int i=0;i<x.size();i++) {cout << x[i] << (i==x.size()-1 ? "\n" : " ");}
#ifdef LOCAL
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
@nemupm
nemupm / hive-explain
Last active June 4, 2017 14:49
HiveCodeReading
hive> explain select count(*) cnt ,value from itemlist group by value order by cnt desc limit 10;
OK
STAGE DEPENDENCIES:
Stage-1 is a root stage
Stage-2 depends on stages: Stage-1
Stage-0 depends on stages: Stage-2
STAGE PLANS:
Stage: Stage-1
Map Reduce
(master)$ git diff
diff --git a/etc/hadoop/core-site.xml b/etc/hadoop/core-site.xml
index d2ddf89..bee4f4e 100644
--- a/etc/hadoop/core-site.xml
+++ b/etc/hadoop/core-site.xml
@@ -17,4 +17,8 @@
<!-- Put site-specific property overrides in this file. -->
<configuration>
+ <property>
@nemupm
nemupm / VR.md
Last active May 20, 2017 13:48
VRまとめ
@nemupm
nemupm / docomo-slack-dialog.Dockerfile
Created August 15, 2016 15:12
Docomoの雑談対話APIを使ってHubotとSlack上で雑談するためのDockerfile
FROM node:latest
MAINTAINER nemupm
RUN npm install -g hubot coffee-script
RUN npm install -g yo generator-hubot
RUN useradd hubot
WORKDIR /home/hubot/myslackbot
RUN chmod -R 777 /home/hubot
@nemupm
nemupm / docomo-dialog-api.coffee
Created July 24, 2016 05:21 — forked from FromAtom/docomo-dialog-api.coffee
DOCOMOの雑談対話APIを使ってHubotと雑談する。
# Description:
# DOCOMOの雑談APIを利用した雑談
#
# Author:
# FromAtom
getTimeDiffAsMinutes = (old_msec) ->
now = new Date()
old = new Date(old_msec)
diff_msec = now.getTime() - old.getTime()
javascript:(function()%7Bfunction%20t(t)%7Bconsole.log(t);t.date.match(e);var%20n=RegExp.$1;var%20r=RegExp.$2;if(r.length%3C=1)r=%220%22+r;var%20i=RegExp.$3;if(i.length%3C=1)i=%220%22+i;var%20s=%22%22+n+%22/%22+r+%22/%22+i;var%20o=%5Bs,t.name,t.author,t.url%5D;return%20o.join(%22%5Ct%22)+%22%5Cn%22%7Dfunction%20n(e)%7Bvar%20t=window.open(%22%22,%22name%22,%22height=250,width=700%22);t.document.write(%22%3Chtml%3E%3Chead%3E%3Ctitle%3EAmazon%20to%20TSV%3C/title%3E%22);t.document.write(%22%3C/head%3E%3Cbody%3E%22);t.document.write(%22%3Cpre%3E%22);t.document.write(e);t.document.write(%22%3C/pre%3E%22);t.document.write(%22%3C/body%3E%3C/html%3E%22);t.document.close();return%20t%7Dfunction%20u(e)%7Bif(typeof%20e!==%22number%22)%7Bvar%20e=0;$(%22%3Cdiv/%3E%22).css(%7Bposition:%22fixed%22,left:0,top:0,width:%22100%25%22,height:%22100%25%22,zIndex:1e3,backgroundColor:%22rgba(0,0,0,.7)%22,color:%22%23fff%22,fontSize:30,textAlign:%22center%22,paddingTop:%2215em%22%7D).attr(%22id%22,%22___overlay%22).text(%22Amazon%E3%8
@nemupm
nemupm / mongodb.repo
Created November 19, 2014 03:23
Dockerfile_MEANstack
[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1
@nemupm
nemupm / median_filter.py
Created October 20, 2014 11:47
Median Filter
# -*- coding:utf-8 -*-
from PIL import Image
from itertools import product
class Filter:
def __init__(self, input_image):
self.input_image = input_image
self.input_pix = self.input_image.load()
self.w, self.h = self.input_image.size
@nemupm
nemupm / insert_terms.vb
Last active August 29, 2015 14:07
insert_shapes_into_pptx_loading_txtfile
Sub insert_terms()
'make object
Dim txt As Object
Set txt = CreateObject("ADODB.Stream")
'set object parameter
txt.Type = adTypeText
txt.Charset = "UTF-8"
txt.LineSeparator = 10 'LF
'make instance
txt.Open