Skip to content

Instantly share code, notes, and snippets.

@betaEncoder
betaEncoder / STM32_programming_tips.md
Last active September 22, 2020 15:03
Tips for STM32 self programming

STM32のFlashメモリを書き換える時のメモ

アプリケーションによっては,製品出荷時にユニークなIDを記憶させたり,キャリブレーション値を保持する時にMCU内蔵のEEPROMへデータを書き込む事があります.
しかしながら,STM32シリーズのチップにはEEPROMがありません.どうやらFlashメモリをEEPROMのように書き換えて使う想定のようです.

Flash特有の懸念

FLASHメモリと言えば書き換え可能な回数が限られており,頻繁な書き換えは信頼性の低下が懸念されます.
そこでデータシートを参照してみると,最低でも1万回の書き換えが保証されているようでした.   これならループを回して書き換えたりしない限り,メモリの劣化は考えなくても良さそうです.
懸念はそれだけではありません.Flashメモリは1バイトづつ書き込む事はできるものの,消去はセクタ単位での一括消去となります.故に,書き換える場合には以下の手順が必要です.

@CarlosGS
CarlosGS / raspberry_fast_capture.py
Last active February 26, 2024 04:16
Fast reading from the raspberry camera with Python, Numpy, and OpenCV. See the comments for more details.
# Fast reading from the raspberry camera with Python, Numpy, and OpenCV
# Allows to process grayscale video up to 124 FPS (tested in Raspberry Zero Wifi with V2.1 camera)
#
# Made by @CarlosGS in May 2017
# Club de Robotica - Universidad Autonoma de Madrid
# http://crm.ii.uam.es/
# License: Public Domain, attribution appreciated
import cv2
import numpy as np

思いつつままに書いてみたが、自分でもなんかしっくりこないので、WIP。同期縛りだからReduxのReducerがダメ、という自分の主張のコアの部分に自信がない。それを差し置いて呼んでほしい。

(1) https://togetter.com/li/911228 (2) http://qiita.com/mizchi/items/8cf4e0c868f5c49ebcbf

redux

いろいろあって仕方なく覚えることにした。今度こそ好きになれるかと思って勉強したが、無理そうな気配を感じている。これで3度目ぐらいの挫折。挫折、というか理解はしたと思う。理解をした上で好きになれない。まだ真の理解に至ってないという可能性はあるが…

昔勉強した際の、生JSの癖に関数合成を多用して見づらい、というのは FlowやTypeScriptの表現力でカバーできるようになったことで、ある程度解決したと思う。というかボイラープレートを超えると、それらはさして問題ではなかった。そこから先。

@chsh
chsh / Flat UI Colors.clr
Last active December 19, 2023 15:22
Some color pallets with Apple Color List (.clr) format
@ksasao
ksasao / Program.cs
Created November 22, 2016 13:49
コマンドプロンプトで UWP の音声認識APIを利用するサンプル。NuGet で UWPDesktop を追加してください。https://blogs.msdn.microsoft.com/lucian/2015/10/23/how-to-call-uwp-apis-from-a-desktop-vbc-app/
// コマンドプロンプトで UWP の音声認識APIを利用するサンプル
// NuGet で UWPDesktop を追加してください。
// https://blogs.msdn.microsoft.com/lucian/2015/10/23/how-to-call-uwp-apis-from-a-desktop-vbc-app/
using System;
using Windows.Media.SpeechRecognition;
namespace UWPCommandLine
{
class Program
{
@shimizu
shimizu / .block
Last active July 24, 2023 16:55
バイナリベクトルファイル(pbf)の作り方
license: mit
height: 1200
@vxgmichel
vxgmichel / aioudp.py
Last active February 15, 2024 00:12
High-level UDP endpoints for asyncio
"""Provide high-level UDP endpoints for asyncio.
Example:
async def main():
# Create a local UDP enpoint
local = await open_local_endpoint('localhost', 8888)
# Create a remote UDP enpoint, pointing to the first one
@328
328 / 0sim_get_use_month.rb
Last active September 30, 2016 13:52
0simの今月の使用量を取ってくるrubyスクリプト
require 'nokogiri'
require 'mechanize'
loginid = ''
password = ''
agent = Mechanize.new
agent.user_agent_alias = 'Mac Safari 4'
agent.get('https://www.so-net.ne.jp/retail/u/userMenu/') do |page|
login = page.form_with(:name => 'Login') do |form|
# coding: utf-8
# Imports
import os
import cPickle
import numpy as np
import theano
import theano.tensor as T
@rbnpi
rbnpi / OSC_API_KeyboardInput.rb
Last active September 30, 2021 06:09
Experimental code to play with the new OSC-API in Sonic Pi2.11dev. Note this is highly experimental and will probably change. The two programs allow input from a Mac keyboard to Sonic Pi. You may need to change some of the keyboard mapping on other keyboards. You can here a recording of the system at https://soundcloud.com/scrbn/sonicpiexperimen…
#This program polls the keyboard and then maps the code for detected keys to midi note values
#which are tranmsitted to the new OSC-API in Sonic Pi
#Warning THIS API IS EXTREMEMLY EXPERIMENTAL AND MAY CHANGE (current version 2.11 dev 2d13e)
#This script runs in a terminal window. Once the SP script is running, type in the terminal window to send key presses.
require 'io/wait'
require 'socket'
require 'rubygems'
require 'osc-ruby'
client ||= OSC::Client.new('localhost', 4559) #set up OSC channel to port 4559