Skip to content

Instantly share code, notes, and snippets.

View PreSoichiSumi's full-sized avatar

PreSoichiSumi PreSoichiSumi

  • A web application engineer in Japan.
  • Tokyo, Japan
View GitHub Profile
package jp.univ.graftability;
import java.net.URI;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.atlassian.jira.rest.client.api.JiraRestClient;
import com.atlassian.jira.rest.client.api.domain.Issue;
@PreSoichiSumi
PreSoichiSumi / template.cpp
Created February 14, 2016 14:31
Atcoder用C++テンプレート
#include <bits/stdc++.h>
#include <X11/Intrinsic.h>
#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
/* このすば面白い
=+=-++=-+-+-
2 =+-- -++=++==+= -+
- - -- =-- = -
- - -= +-++--++- =++-=+--+ +7 +=-=----7
- = = - 7 =++==++=--+++=++- =- 27 - - --=-
3 -- += =+++=-+= = - -++--+-==+ ++++ - + - = - -+2+
+2-= - + = 7 8+++8= ++=3+7- -+ -= +- == = = = = 7 2 3
=+- -- + -- --- + + - + =+- - -
+77 877 3 3 -3 -+ +- -7+= 7 -787= -=-73 3+ = == --=- - - -7-8=3
#include <bits/stdc++.h>
using namespace std;
#define all(c) ((c).begin()), ((c).end())
#define dump(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define REP(i, a, b) for (int i = a; i < (int)(b); i++)
#define rep(i, n) REP(i, 0, n)
/*二値化
Mat img2;
threshold(gray_img, img2, 0, 255, CV_THRESH_BINARY | CV_THRESH_OTSU );
*/
/*輪郭抽出
vector< vector<cv::Point> > contours;
cv::findContours(img2, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);
@PreSoichiSumi
PreSoichiSumi / jna test
Last active March 22, 2016 12:47
JNAの使用例. JNAはjavaから簡単にnativeライブラリを呼び出すためのツール. 内部でJNIを使っている
this is title
<!--大体は WebJarAssets.at(webJarAssets.locate("jquery.min.js")) などで通る.
たまにあるjsが既に保存済みでかつバージョン違いのjsをライブラリとして読み込んでいるときがあり,
その場合にMultipleMatchesExceptionがWebJarAssetsLocatorから投げられる.その場合は
<version>/xxx.js などとする.バージョンとファイル名の間にディレクトリ名が入るかどうかは
<project-root>/target/web/web-modules/main/webjars/lib/<library-name> 以下を見て決める-->
<!-- 例 -->
<link rel="stylesheet" href='@routes.WebJarAssets.at(webJarAssets.locate("3.3.6/css/bootstrap.min.css"))'>
<link rel="stylesheet" href='@routes.Assets.versioned("stylesheets/narrow-jumbotron.css")'>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ace.js"></script>
package util;
import java.awt.*;
public class Main {
public static void main(String[] args){
Font f=new Font("monospaced",Font.PLAIN,9);
System.out.println(f.getName());
System.out.println(f.getFontName());
f=new Font("Monospaced",Font.PLAIN,9);
import java.awt.Font;
import java.awt.GraphicsEnvironment;
public class MainClass {
public static void main(String[] a) {
GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
Font[] fonts = e.getAllFonts(); // Get the fonts
for (Font f : fonts) {
System.out.println(f.getFontName());
}
}
@PreSoichiSumi
PreSoichiSumi / nginx load-balancing example
Last active April 11, 2016 07:24
nginx load-balancing
title