Skip to content

Instantly share code, notes, and snippets.

View suzukimilanpaak's full-sized avatar

Tatsuya Suzuki suzukimilanpaak

  • Manchester, UK
  • 10:53 (UTC +01:00)
View GitHub Profile
@suzukimilanpaak
suzukimilanpaak / mistake.pde
Created January 4, 2014 17:14
mistake to draw strange ghoast
import java.util.*;
// Size of display
int DISPLAY_WIDTH = 500;
int DISPLAY_HEIGHT = 500;
// Colours
int BLACK = 0;
int WHITE = 255;
int CENTER_X = 0;
@suzukimilanpaak
suzukimilanpaak / 1.mutual_friends_2014_01_05.csv
Last active January 2, 2016 06:39
Social graph with Processing Language
Tatsuya Suzuki Emi Ito Bruno Barroso Mattew Day Maxim Dokhlov Mehmet Bagbekleyen Alex Yixnitsky Stuart Gardner Derrick May
Tatsuya Suzuki 0 50 19 10 9 11 15 2 0
Emi Ito 0 0 2 3 3 2 1 2 1
Bruno Barroso 0 0 0 4 3 17 1 2 1
Mattew Day 0 0 0 0 4 5 1 2 1
Maxim Dokhlov 0 0 0 0 0 4 1 2 1
Mehmet Bagbekleyen 0 0 0 0 0 0 1 2 1
Alex Yixnitsky 0 0 0 0 0 0 0 1 1
Stuart Gardner 0 0 0 0 0 0 0 0 1
Derrick May 0 0 0 0 0 0 0 0 0
@suzukimilanpaak
suzukimilanpaak / blogger.html
Last active August 29, 2015 13:56
Javascript for Blog
<!--
* highlight.js
-->
<link rel="stylesheet" href="https://googledrive.com/host/0B-jdnZOJbr7XUkgybU1zYUs0dG8/tomorrow.css" />
<script src="http://yandex.st/highlightjs/8.0/highlight.min.js"></script>
<style type='text/css'>
/*
pre {
@suzukimilanpaak
suzukimilanpaak / RubberBallShape.js
Last active August 29, 2015 14:02
diff RubberBallShape
function RubberBallShape(radius, world) {
b2CircleShape.call(this, radius);
this.RADIUS = radius;
this.DIFF_THRESHOLD_TO_ROUND = this.RADIUS * 0.02;
this.IMPULSE_THRESHOLD_TO_STOP_UPDATING = 20;
}
RubberBallShape.prototype = Object.create(b2CircleShape.prototype);
function RubberBallShape(radius, world) {
b2CircleShape.call(this, radius);
this.RADIUS = radius;
this.DIFF_THRESHOLD_TO_ROUND = this.RADIUS * 0.02;
this.IMPULSE_THRESHOLD_TO_STOP_UPDATING = 20;
}
RubberBallShape.prototype = Object.create(b2CircleShape.prototype);
@suzukimilanpaak
suzukimilanpaak / permission denied when backing-up.log
Last active August 29, 2015 14:06
Warning on the top page of Sbulimerecords.net
$ cp -r web web.bak
cp: cannot open `web1/wp-content/img.php' for reading: Permission denied
cp: cannot open `web1/wp-content/plugins/mos.php' for reading: Permission denied
cp: cannot open `web1/wp-content/plugins/csv.php' for reading: Permission denied
cp: cannot open `web1/wp-content/plugins/wp-multibyte-patch/languages/wp-multibyte-patch-ja.php' for reading: Permission denied
cp: cannot open `web1/wp-content/plugins/wp-multibyte-patch/js/jquery.Jcrop.php' for reading: Permission denied
cp: cannot open `web1/wp-content/ws1.php' for reading: Permission denied
cp: cannot open `web1/wp-content/modul.php' for reading: Permission denied
cp: cannot open `web1/wp-content/themes/source/wp-rss.php' for reading: Permission denied
cp: cannot access `web1/wp-content/themes/source/img/cache': Permission denied
@suzukimilanpaak
suzukimilanpaak / cell.js
Last active November 15, 2015 03:19
Animation of a cell
var type = /(canvas|webgl)/.test(url.type) ? url.type : 'svg';
var two = new Two({
type: Two.Types[type],
fullscreen: true
}).appendTo(document.body);
var mass = 100;
var radius = two.height / 5;
var strength = 0.0625;
var drag = 0.0;

Question: Given a sequence of positive integers A and an integer T, return whether there is a continuous sequence of A that sums up to exactly T Example [23, 5, 4, 7, 2, 11], 20. Return True because 7 + 2 + 11 = 20 [1, 3, 5, 23, 2], 8. Return True because 3 + 5 = 8 [1, 3, 5, 23, 2], 7 Return False because no sequence in this array adds up to 7

Note: We are looking for an O(N) solution. There is an obvious O(N^2) solution which is a good starting point but is not the final solution we are looking for.

@suzukimilanpaak
suzukimilanpaak / example.js
Created February 12, 2016 06:47
bindの動作
var classExample = {
binded: function(){ console.info(this) }.bind(this),
unBinded: function(){ console.info(this) }
}
classExample.binded();
// => Window {external: Object, chrome: Object, document: document, React: Object, ReactDOM: Object…}
classExample.unBinded();
// => Object { binded: function(){ console.info(this) }.bind(this), unBinded: function(){ console.info(this) }}
@suzukimilanpaak
suzukimilanpaak / problem.md
Last active March 12, 2018 16:41
PARKING LOT PROBLEM

####################################################################################

PARKING LOT PROBLEM

Rules of the Game

  1. You have two full days to implement a solution
  2. You can use any (fairly) mainstream object oriented language of your choice, so long as your solution builds and runs on linux. You should be fine if you favour, say, Java, Ruby, Python or Javascript.
  3. Please ensure that you follow the syntax and formatting of both the