Skip to content

Instantly share code, notes, and snippets.

View Collonville's full-sized avatar
🍻
Happy beer!!!! Wow!!!!!!

Collonville Collonville

🍻
Happy beer!!!! Wow!!!!!!
View GitHub Profile
static void Main(string[] args)
{
List<int> foo = new List<int> { 6, 1, 4, 9, 2 }; //list
var cnt = foo.Select(x => x * 2).Where(x => x <= 14).Count();
Console.WriteLine(cnt); // show count
}
using UnityEngine;
[System.Serializable]
public class ItemData : MonoBehaviour {
public int id;
public int power;
}
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public class ClientData : MonoBehaviour {
public int id;
public List<ItemData> itemList;
}
using System.Collections.Generic;
using UnityEngine;
public class ServerManager : MonoBehaviour {
private Dictionary<int, ClientData> clientList;
[SerializeField]
private GameObject clientPrefab;
// Use this for initialization
//Revised ver
[System.Serializable]
public class ItemData{
public int id;
public int power;
}
import colour
from colour.plotting import *
from colour.models import *
CIE_1931_chromaticity_diagram_plot(
bounding_box=(-0.1, 0.9, -0.1, 0.9),
standalone=True)
import itertools
import numpy as np
import matplotlib.pyplot as plt
import colour
from colour.plotting import *
#RGBを0.0~0.1の間隔で分割し、組み合わせを列挙
line = np.linspace(0.0, 1.0, 15, endpoint=True)
rgb = np.array(list(itertools.product(line,line,line)), dtype=np.float)
using FireSharp;
using FireSharp.Config;
using FireSharp.Interfaces;
using FireSharp.Response;
using System;
namespace FireBaseChat
{
class Program
{
@Collonville
Collonville / resize_padding.py
Created September 27, 2019 03:20
Resize and 0 padding using tensorflow
tf_image = tf.io.decode_image(image, channels=3)
tf_image = tf.compat.v1.image.resize_image_with_pad(tf_image, 256, 512)
out = tf.cast(tf_image, tf.uint8)
out = tf.image.encode_jpeg(out, format="rgb", quality=100)
# out = tf.io.write_file("test.jpeg", out)
with tf.Session() as sess:
jpeg_byte = sess.run(out)
from tensorflow import keras
# 本来はこう(学習時)
x = keras.layers.Concatenate()([image, table])
# サーバーではこうしていた(推論時)
x = keras.layers.Concatenate()([table, image])