This file contains 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 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 { |
This file contains 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
/************************************************************************ | |
M5StackFire I2C Scanner | |
The M5StackFire has a connector for I2C devices. | |
This program scans the addresses 1-127 continuosly and shows | |
the devices found on the TFT. | |
The M5Stack fire has two internal I2C devices at address 0x68 and 0x75. | |
This file contains 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
from pynq.overlays.base import BaseOverlay | |
base = BaseOverlay("base.bit", download=False) | |
# あとでグラフに書きたい場合はtrue | |
is_debug_capture = True | |
l_src_arr = [] | |
r_src_arr = [] | |
l_dst_arr = [] | |
r_dst_arr = [] |
This file contains 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
// select_line_in()呼び出し時にTX Buffから音声出力できるようにレジスタ設定を書き込んでおく | |
/****************************************************************************** | |
* Function to select LINE_IN as input. | |
* @param iic_index is the i2c index in /dev list. | |
* @return none. | |
*****************************************************************************/ | |
extern "C" void select_line_in(int iic_index) { | |
int iic_fd; | |
iic_fd = setI2C(iic_index, IIC_SLAVE_ADDR); |
This file contains 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
# %matplotlib inline | |
import matplotlib.pyplot as plt | |
from ipywidgets import * | |
plt.rcParams['figure.figsize'] = (15.0, 10.0) | |
from pynq.overlays.base import BaseOverlay | |
base = BaseOverlay("base.bit") | |
# 2の補数の扱い辛い | |
def twos_complement(hexstr,bits): |
This file contains 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
import scala.io.Source | |
object City { | |
private def randoms(m:Int) : Stream[Int] = Stream.cons(scala.util.Random.nextInt(m), randoms(m)) | |
def create(count:Int)(implicit max:Int) = randoms(max).zip(randoms(max)).take(count).zipWithIndex.map(x => x._2 -> x._1).toMap | |
} | |
implicit class CsvConverter(filepath: String) { | |
//Map[Int,(Int,Int)] : Index -> (X, Y) | |
def toCities = Source.fromFile(filepath).getLines.toSeq.map(x => x.split(",")).filter(_.size == 2).map(x => (x(0).toInt, x(1).toInt)).zipWithIndex.map(x => x._2 -> x._1).toMap | |
} |
This file contains 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
#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; |
This file contains 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
/* | |
* dmx_receiver.c | |
* | |
* Created: 2014/07/15 19:43:52 | |
* Author: kamiya | |
*/ | |
#include <avr/io.h> | |
#include <avr/interrupt.h> | |
#include "dmx_receiver.h" |
This file contains 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
apiVersion: "batch/v1beta1" | |
kind: CronJob | |
metadata: | |
name: "<workload-name>" | |
namespace: "default" | |
labels: | |
app: "app-label" | |
spec: | |
schedule: "0 */4 * * *" | |
startingDeadlineSeconds: 120 |
This file contains 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 System; | |
using System.Linq; | |
using System.IO; | |
using System.Text; | |
using System.Collections.Generic; | |
static class Extension { | |
public static IEnumerable<int> CreateSource(this string[] src) { | |
return src.SelectMany(x => x.Split(',')).Where(x => !string.IsNullOrWhiteSpace(x)).Select(x => int.Parse(x)); | |
} |
NewerOlder