Skip to content

Instantly share code, notes, and snippets.

View tuankiet65's full-sized avatar

Kiet Ho tuankiet65

View GitHub Profile
@tuankiet65
tuankiet65 / mutex.c
Created March 21, 2022 22:32
Untested mutex implementation on bare-metal Cortex M4 (and maybe other Cortexes with LDREX/STREX)
#include "mutex.h"
/**
* Simple mutex implemented using LDREX/STREX, as described in
* https://developer.arm.com/documentation/dht0008/a/arm-synchronization-primitives/practical-uses/implementing-a-mutex.
*/
#include "stm32l476xx.h"
static const mutex_t MUTEX_UNLOCKED = 0;
#!/usr/bin/env python3
import influxdb
import requests
import json
PROMETHEUS_SERVER = ""
BEGIN_TIMESTAMP = 0
END_TIMESTAMP = 0
{
0: {
"id": 0,
"name": "steak",
"category": "Proteins",
"calories": 300,
"totalFat": 5.73,
"saturatedFat": 2.183,
"transFat": 0.182,
"protein": 29.44,
E:\ccls\Release>E:\llvm-project\build\Release\bin\clang-cl.exe /nologo -TP -I..\src -I..\third_party -IE:\llvm-project\llvm\include -IE:\llvm-project\build\Release\include -IE:\llvm-project\clang\include -IE:\llvm-project\build\Release\tools\clang\include -I..\third_party\rapidjson\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG /nologo /EHsc /D_CRT_SECURE_NO_WARNINGS /W3 /wd4996 /wd4267 /wd4800 /wd4068 /std:c++17 /GR- -std:c++17 /showIncludes /FoCMakeFiles\ccls.dir\src\pipeline.cc.obj /FdCMakeFiles\ccls.dir\ -c ..\src\pipeline.cc -ftemplate-backtrace-limit=0
clang-cl: warning: unknown argument ignored in clang-cl: '-ftemplate-backtrace-limit=0' [-Wunknown-argument]
Note: including file: ..\src/pipeline.hh
Note: including file: ..\src/lsp.hh
Note: including file: ..\src/config.hh
Note: including file: ..\src/serializer.hh
Note: including file: ..\src/utils.hh
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\
steps = int(input())
a = [0] * max(steps, 2)
a[0] = 1
a[1] = 2
for i in range(2, steps):
a[i] = a[i-1] + a[i-2]
print(a[steps-1])
openapi: 3.0.1
info:
title: cms-rest-api
description: REST API for accessing/modifying CMS resources
contact:
name: Ho Tuan Kiet
url: 'https://tuankiet65.moe'
email: tuankiet65@gmail.com
license:
[2019-03-29 01:19:05,617][WARNING][syncer.py:37] Album missing cover art: None
[2019-03-29 01:19:05,619][WARNING][syncer.py:37] Album missing cover art: Mirrored Worlds
[2019-03-29 01:19:05,619][WARNING][syncer.py:37] Album missing cover art: 森羅万象 例大祭15おまけCD
[2019-03-29 01:19:05,621][WARNING][syncer.py:37] Album missing cover art: デジウィ SUNLiGHT
[2019-03-29 01:19:05,622][WARNING][syncer.py:37] Album missing cover art: W:/2016ALBUM/
[2019-03-29 01:19:05,622][WARNING][syncer.py:37] Album missing cover art: PANDORA VOXX Complete
[2019-03-29 01:19:05,624][WARNING][syncer.py:37] Album missing cover art: THE LEAP // EXTRA
[2019-03-29 01:19:05,627][WARNING][syncer.py:37] Album missing cover art: Double Key EXTRA
[2019-03-29 01:19:05,628][WARNING][syncer.py:37] Album missing cover art: 東方幻奏響UROBOROS業~eNDoFtHEuLTIMATEoVERdRIVE~
[2019-03-29 01:19:05,628][WARNING][syncer.py:37] Album missing cover art: 東方PARTYBOX Disc 1
from pathlib import Path
TASK_NAME = Path().absolute().name
i = 1
while True:
old_in = Path(f"{i}.in")
old_out = Path(f"{i}.out")
if (not old_in.exists()) and (not old_out.exists()):
action_pool_depth
Current value (from the default) = -1
From //build/toolchain/BUILD.gn:10
Pool for non goma tasks.
aec_untrusted_delay_for_testing
Current value (from the default) = false
From //third_party/webrtc/modules/audio_processing/BUILD.gn:18
#include <algorithm>
#include <iostream>
#include <vector>
int k;
std::vector<int> a;
int main() {
std::cin >> k;