Skip to content

Instantly share code, notes, and snippets.

# coding: utf-8
# In[1]:
import os
import tensorflow as tf
import glob
import random
from numpy.random import randint
# coding: utf-8
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
int x = 0;
int n = 100;
pthread_t tid[100];
pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
int x = 0;
int n = 100;
pthread_t tid[100];
@kotaroito
kotaroito / array_to_hash.rb
Created May 26, 2015 14:26
Ruby: Array to Hash
array = %w(a b c)
hash = Hash[array.collect.zip(array.map{|c| c.upcase})]
p hash
# {"a"=>"A", "b"=>"B", "c"=>"C"}
var MyImmutableArray = (function() {
var flyweight = {};
return function(from, to) {
var k = from + ':' + to;
if (!flyweight[k]) {
var array = [];
for (var i = from; i <= to; i++) {
array.push(i);
var Crepe = function() {
this.cost = function() { return 200; };
this.toppings = function() { return []; };
};
var Topping = function(crepe) {};
Topping.prototype = {
cost: function () {
return this.crepe.cost() + this.settings.cost;
},
var abstractBallFactory = (function() {
var types = {};
return {
getBall: function(type, customizations) {
var constractor = types[type];
return ( constractor ? new constractor(customizations) : null );
},
registerBall: function(type, constractor) {
types[type] = constractor;
return abstractBallFactory;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div>
<form id="print-form">
<p>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
</body>
</html>