Java8 Stream の使い方を覚えたら、Optional や Either もすぐ使えるようになるよ!編
This file contains hidden or 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; | |
[ExecuteInEditMode] | |
public class LightmapPrefab : MonoBehaviour { | |
[System.Serializable] | |
class LightmapParameter | |
{ | |
public int lightmapIndex = -1; |
This file contains hidden or 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 UnityEngine.UI; | |
using UnityEngine.EventSystems; | |
using System.Collections; | |
public class FixedScrollRect : ScrollRect | |
{ | |
private const float POWER = 10; | |
private InfiniteScroll _infinityScroll; |
This file contains hidden or 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
#!/bin/bash | |
# CHANGE THESE | |
auth_email="[email protected]" | |
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings | |
zone_name="example.com" | |
record_name="www.example.com" | |
# MAYBE CHANGE THESE | |
ip=$(curl -s http://ipv4.icanhazip.com) |
This file contains hidden or 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; | |
using UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
namespace UnityEngine.UI | |
{ |
This file contains hidden or 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
/// Set Sorting Layer | |
/// Copyright (c) 2014 Tatsuhiko Yamamura | |
/// Released under the MIT license | |
// / http://opensource.org/licenses/mit-license.php | |
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
#if UNITY_EDITOR |
こちらは、shibukawa さんのエントリ へのアンサー・ソング的な何かです。
Math.imul を使うと、C言語のコードを原型を維持したまま JavaScript に変換することができます。
これにより、派生版の実装がだんだんC言語版から取り残されていく(Box2D的な残念な)現象を最小限にできるのではないでしょうか。
高速なHash関数 xxhash.c を JavaScript に変換した WMXXHash.js を例に説明するとこのようになります。
若干のコーディングスタイルの変化(JSHint対策)や、UINT32 な変数を5個作り出すために new Uint32Array(5) を使うというアイデアが入っていますが、変数名などは基本的にC言語のコードのままにしてあります。
This file contains hidden or 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
int radio = 0; | |
bool node = false; | |
bool titleLeft = false; | |
bool titleMid = false; | |
bool titleRight = false; | |
void OnGUI() | |
{ |
This file contains hidden or 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 Perlin { | |
public int repeat; | |
public Perlin(int repeat = -1) { | |
this.repeat = repeat; | |
} | |
public double OctavePerlin(double x, double y, double z, int octaves, double persistence) { | |
double total = 0; |