This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Title:縦書き俳句プログラミング in Semicolonless Java. | |
* Description:初めてのSemicolonless Java。 | |
* Author:ゆいき @_yuiki | |
*/ | |
public class Main { | |
public static void main(String[] args) { | |
for (String haiku : new String[]{"古池や 蛙飛び込む 水の音"}) { | |
for (String[] splitHaiku : new String[][]{haiku.split(" ")}) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
private static class ArithmeticProgression { | |
private final int a, n, d; | |
ArithmeticProgression(int a, int n, int d) { | |
this.a = a; | |
this.n = n; | |
this.d = d; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
private final int quantity = 1000000; | |
// frequencyの値を増やすほど精度が増す。 | |
private final int frequency = 10; | |
// コンストラクタで要素数指定。 | |
private final List<Integer> list = new ArrayList<>(quantity); | |
private final int[] array = new int[quantity]; | |
public static void main(String[] args) { | |
Main main = new Main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "twitter" | |
client = Twitter::REST::Client.new do |config| | |
config.consumer_key = "hoge" | |
config.consumer_secret = "fuga" | |
config.access_token = "piyo" | |
config.access_token_secret = "moge" | |
end | |
File.open("website.txt", "w") do |file| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import tweepy | |
import ConfigParser | |
import random | |
import locale | |
import datetime | |
import pytz | |
import urllib2 | |
import re | |
from xml.etree import ElementTree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
require 'date' | |
if ARGV.size < 2 | |
STDERR.print "Usage: ruby #{$0} <path> <name>\n" | |
exit(1) | |
end | |
PATH = ARGV[0].gsub(File::ALT_SEPARATOR) {File::SEPARATOR} | |
NAME = ARGV[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Timer { | |
private long startNanoTime, endNanoTime = 0L; | |
void start() { | |
this.startNanoTime = System.nanoTime(); | |
} | |
void stop() { | |
if (startNanoTime != 0L) { | |
this.endNanoTime = System.nanoTime(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.math.BigInteger; | |
import java.util.ArrayList; | |
import java.util.List; | |
class PrimeFactorization { | |
private final String dividend; | |
PrimeFactorization(String dividend) { | |
this.dividend = dividend; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
class JavaClass: | |
def __init__(self, name): | |
self.name = name | |
self.fields = dict() | |
def add_field(self, java_type, name): | |
self.fields[name] = java_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
# ここらへん入れてね | |
auth = tweepy.OAuthHandler('', '') | |
auth.set_access_token('', '') | |
api = tweepy.API(auth) | |
tag = '#コンテンツ応用論2017' | |
class SearchStreamListener(tweepy.StreamListener): | |
def on_status(self, status): |
OlderNewer