Skip to content

Instantly share code, notes, and snippets.

😀
Working

Kamiya kamiyaowl

😀
Working
Block or report user

Report or block kamiyaowl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View brainfxxk.cpp
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <stdint.h>
using namespace std;
int main() {
vector<uint8_t> mem(30000,0);
stack<int> branchStack;
View gke-cronjob.yml
apiVersion: "batch/v1beta1"
kind: CronJob
metadata:
name: "<workload-name>"
namespace: "default"
labels:
app: "app-label"
spec:
schedule: "0 */4 * * *"
startingDeadlineSeconds: 120
@kamiyaowl
kamiyaowl / color_table.scala
Last active Aug 29, 2015
たまにこういうの欲しくなる
View color_table.scala
def loopSeq = ((0 to 0xff) ++ (0x0 to 0xff).reverse)
val arr = {loopSeq map{x => s"{ $x, 0, 0,}, "}} ++
{loopSeq map{x => s"{ 0, $x, 0,}, "}} ++
{loopSeq map{x => s"{ 0, 0, $x,}, "}} ++
{loopSeq map{x => s"{ $x, $x, 0,}, "}} ++
{loopSeq map{x => s"{ 0, $x, $x,}, "}} ++
{loopSeq map{x => s"{ $x, 0, $x,}, "}} ++
{loopSeq map{x => s"{ $x, $x, $x,}, "}}
@kamiyaowl
kamiyaowl / main.c
Created Jun 21, 2015
Number -> Hex for Embedded
View main.c
#include <stdio.h>
typedef unsigned short uint16;
typedef unsigned char uint8;
const char numberTable[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
void itoa(uint16 src, char* buf){
uint8 i;
buf[0] = '0';
buf[1] = 'x';
@kamiyaowl
kamiyaowl / main.c
Created Jun 17, 2015
ガウスの消去法
View main.c
#include <stdio.h>
// 未知数の数/方程式の数
#define N 2
int main(void){
// x + 2y = 5
//2x + 3y = 8
double matrix[N][N + 1] = {
{ 1, 2, 5 },
@kamiyaowl
kamiyaowl / ImageData.h
Last active Aug 29, 2015
ATMEGA328p LS027B4DH01
View ImageData.h
#ifndef IMAGEDATA_H_
#define IMAGEDATA_H_
#include <avr/pgmspace.h>
PROGMEM const uint8_t img_src[240][50] = {
{ 0x7, 0xf8, 0xff, 0xff, 0x3, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x31, 0xfe, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, },
{ 0xc0, 0xff, 0xff, 0xff, 0xff, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x19, 0xff, 0xff, 0x8f, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, },
{ 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x99, 0xff, 0xff, 0xc7, 0xff, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe1, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff,
@kamiyaowl
kamiyaowl / Program.cs
Last active Jun 28, 2016
C# + Sprache Lambda-Expr
View Program.cs
using Sprache;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace lambda_calc
{
abstract class Statement { }
abstract class Expr : Statement
@kamiyaowl
kamiyaowl / Program.cs
Last active Apr 28, 2019
C# + OpenTK.Audio.OpenAL sample
View Program.cs
using OpenTK;
using OpenTK.Audio.OpenAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication4 {
class Program {
@kamiyaowl
kamiyaowl / Main.scala
Created Mar 12, 2015
多角形衝突判定
View Main.scala
object Main {
implicit class Point[T <% Double](val self:(T,T)) {
lazy val abs = math.sqrt(self._1 * self._1 + self._2 * self._2)
def -[U <% Double](p:(U,U)) = (self._1 - p._1, self._2 - p._2)
def cross[U <% Double](p:(U,U)) = self._1 * p._2 - self._2 * p._1
}
def crossProduct[T <% Double](polygon:List[(T,T)],points:List[(T,T)]) : List[List[Double]] =
points.map { p => polygon zip(polygon.tail :+ polygon.head) map{ case(a,b) => (a - p) cross (b - p)} }
def isCrossVector(xs:List[Double]) : Boolean = xs.forall(_ > 0) || xs.forall(_ < 0)
def isCross[T <% Double](poly1:List[(T,T)],poly2:List[(T,T)]) : Boolean =
@kamiyaowl
kamiyaowl / Main.scala
Last active Aug 29, 2015
reversepolish calculator(Do not use parsercombinator)
View Main.scala
import scala.collection.immutable.Stack
object Main {
def binOp(q:Stack[Double])(f:(Double,Double) => Double) : Stack[Double] = {
val (b,q2) = q.pop2
val (a,q3) = q2.pop2
q3.push(f(a,b))
}
def unaryOp(q:Stack[Double])(f:(Double) => Double) : Stack[Double] = {
val (a,q2) = q.pop2
You can’t perform that action at this time.