Skip to content

Instantly share code, notes, and snippets.

View tokoro10g's full-sized avatar
😼

Tokoro tokoro10g

😼
View GitHub Profile
@tokoro10g
tokoro10g / serial_driver_tester.cpp
Last active May 5, 2020 00:01
ptyを使用したシリアルデバイスドライバの単体テスト例
#include <fcntl.h>
#include <termios.h>
#include <unistd.h>
#include <atomic>
#include <cerrno>
#include <chrono>
#include <cstdlib>
#include <cstring>
#include <functional>
@tokoro10g
tokoro10g / .travis.yml
Created March 14, 2020 16:49 — forked from yuqlid/.travis.yml
Travis CI script for arm-gcc
notifications:
email: false
sudo: false
language: c
matrix:
fast_finish: true
include:
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
(when no-ssl
(warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
[Trace - 06:10:12 PM] Sending request 'initialize - (1)'.
Params: {
"processId": 78866,
"rootPath": "/opt/test",
"clientInfo": {
"name": "vscode",
"version": "1.41.1"
},
"rootUri": "file:///opt/test",
"capabilities": {

IQが1なので書き忘れた上に書こうと思っていた内容を完全に忘れてしまいました

@tokoro10g
tokoro10g / stalinsort.m
Created August 5, 2019 06:04
スターリンソートMATLABバージョン
clear
data = [1 2 2 1 1 4 3 9];
data(data<cummax(data))=[]
% -> [1 2 2 4 9]
@tokoro10g
tokoro10g / saizeriyacp.m
Last active June 17, 2019 04:02
サイゼリヤ1000円以内でカロリー最大化 MATLABバージョン
clear
load saizeriyadb.mat
maxtotalprice = 1000;
selection = optimvar('selection', saizeriyadb.name, 'Type', 'integer', 'LowerBound', 0, 'UpperBound', 1);
problem = optimproblem('ObjectiveSense', 'maximize', 'Objective', dot(selection, saizeriyadb.calorie));
problem.Constraints.constr = dot(selection, saizeriyadb.price) / maxtotalprice <= 1;
@tokoro10g
tokoro10g / img2maze.m
Last active May 15, 2019 08:12
NTFウェブサイトの迷路シートの画像から迷路データを抽出するMATLABスクリプト
clear
close all
filename = 'MM2017HX_pre.png';
url = ['http://www.ntf.or.jp/mouse/micromouse2017/' filename];
if ~exist(filename, 'file')
websave(filename,url);
end
IM = imread(filename);
@tokoro10g
tokoro10g / PKGBUILD
Last active April 10, 2017 09:49
PKGBUILD_gcc-arm-none-eabi-bin-4.8_2014_q3-1
# Original Maintainer: James Duley <jagduley gmail>
pkgname=gcc-arm-none-eabi-bin
pkgver=4.8_2014_q3
_pkgname=gcc-arm-none-eabi
_pkgver=${pkgver//_/-}-update
_pkgvershort=${_pkgver%-*}
_pkgvershort=${_pkgvershort/-q/q}
_pkgdate=20140805
pkgrel=1
pkgdesc="GNU Tools ARM Embedded Processors (binary distribution, includes GDB and newlib)"
@tokoro10g
tokoro10g / file0.txt
Created March 8, 2015 09:26
mikutterコンソールから特定のユーザのフォロワーを一括ブロック ref: http://qiita.com/tokoro10g/items/b2c2f8c8375a460d608c
Service.primary.followers(screen_name: "ユーザ名").next { |users|
users.each { |user|
(Service.primary.twitter/:blocks/:create).json(screen_name: user.idname)
# puts "blocked: " + user.idname
}
}