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 'google/cloud/pubsub' | |
require 'json' | |
pubsub = Google::Cloud::Pubsub.new(project_id: ENV['GCP_PROJECT_ID']) | |
count = {} | |
data = [] | |
sub = pubsub.subscription ENV['PUBSUB_SUBSCRIPTION'] | |
retry_count = 0 |
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 'google/cloud/pubsub' | |
pubsub = Google::Cloud::Pubsub.new(project_id: ENV['GCP_PROJECT_ID']) | |
topic = pubsub.topic ENV['PUBSUB_TOPIC'] | |
# Publish 100,000 messages | |
100000.times { |i| topic.publish "test#{i}" } |
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
#include <iostream> | |
#include <vector> | |
using namespace std; | |
int n, W; | |
vector<int> w, v; | |
// 残り重さjまで入れることが可能な状態で, | |
// i番目の品物を入れるか入れないか |
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 chainer | |
import chainer.functions as F | |
import chainer.links as L | |
import chainerrl | |
import gym | |
import numpy as np | |
import argparse | |
from datetime import datetime as dt | |
parser = argparse.ArgumentParser() |
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
using UnityEngine; | |
using System.Collections; | |
public class ScreenToVector3 : MonoBehaviour { | |
// 射程距離 | |
public float raycastMax = 100.0f; | |
void Update () { | |
// 左クリック時 | |
if(Input.GetMouseButtonDown(0)){ |
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
using UnityEngine; | |
using System.Collections; | |
public class ThrowSphere : MonoBehaviour { | |
public GameObject ballPrefab; | |
public GameObject target; | |
public float initialSpeed; | |
private int count = 0; | |
private GameManager gm; | |
// Use this for initialization |