Skip to content

Instantly share code, notes, and snippets.

View ArdWar's full-sized avatar
🐢
I may be slow to respond.

ArdWar ArdWar

🐢
I may be slow to respond.
View GitHub Profile
@ArdWar
ArdWar / main.c
Created December 7, 2022 12:42
I2C Slave
#include "main.h"
#define I2C_DEVICE_NODE DT_NODELABEL(i2c1)
#define UART_DEVICE_NODE DT_NODELABEL(usart1)
#define LED0_NODE DT_ALIAS(led0)
static const struct device *const i2c_dev = DEVICE_DT_GET(I2C_DEVICE_NODE);
static const struct device *const uart_dev = DEVICE_DT_GET(UART_DEVICE_NODE);
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
# Based on Goodjooy/AzurLane-PaintingExtract
# this assumes that the mesh transform is in sorted four line corner pairs
import unitypack, os, re
from unitypack.export import OBJMesh
from PIL import Image, ImageOps
VR = re.compile(r'v ')
TR = re.compile(r'vt ')
SR = re.compile(r' ')
@ArdWar
ArdWar / E5LDClear.json
Created May 16, 2017 05:24
KC E-5 LD Clear
{"diff":3,"world":38,"mapnum":5,"fleetnum":1,"combined":1,"fleet1":[{"mst_id":275,"level":80,"kyouka":[9,0,66,13,3],"morale":79,"equip":[105,8,36,59,0],"stars":[1,0,1,0,0],"ace":[-1,-1,-1,7,-1]},{"mst_id":148,"level":76,"kyouka":[47,0,39,27,0],"morale":79,"equip":[9,9,36,59,0],"stars":[0,0,1,0,0],"ace":[-1,-1,-1,7,-1]},{"mst_id":156,"level":95,"kyouka":[59,0,41,40,0],"morale":73,"equip":[94,111,52,212,0],"stars":[0,0,0,0,0],"ace":[7,7,2,7,-1]},{"mst_id":466,"level":98,"kyouka":[70,0,40,34,0],"morale":58,"equip":[200,100,52,22,0],"stars":[0,0,0,0,0],"ace":[2,6,-1,7,-1]},{"mst_id":438,"level":83,"kyouka":[53,0,41,35,0],"morale":62,"equip":[144,57,110,153,0],"stars":[0,0,10,10,0],"ace":[7,2,7,7,-1]},{"mst_id":462,"level":94,"kyouka":[56,0,36,34,0],"morale":63,"equip":[52,111,157,109,0],"stars":[0,0,10,10,0],"ace":[3,7,7,7,-1]}],"fleet2":[{"mst_id":464,"level":81,"kyouka":[47,59,23,36,0],"morale":85,"equip":[106,122,122,0,0],"stars":[0,3,1,0,0],"ace":[-1,-1,-1,-1,-1]},{"mst_id":152,"level":86,"kyouka":[26,0,52,22
@ArdWar
ArdWar / pen.m
Created October 12, 2016 13:23
WoWs Penetration calc
clear all; clc
% SHELL CONSTANTS %
C = 0.5561613; % PENETRATION
a = 9.81; % GRAVITY
T_0 = 288; % TEMPERATURE AT SEA LEVEL
L = 0.0065; % TEMPERATURE LAPSE RATE
p_0 = 101325; % PRESSURE AT SEA LEVEL
R = 8.31447; % UNIV GAS CONSTANT
M = 0.0289644; % MOLAR MASS OF AIR
@ArdWar
ArdWar / AdaptiveThreshold.cpp
Created October 5, 2015 07:15
[OpenCV] Adaptive threshold
#include "opencv/cv.h"
#include "opencv/highgui.h"
#include <stdio.h>
//void avrg(IplImage* buf2, int tresh[16]) {
// tresh = { };
// for (int a = 0;a < 4;a++) {
// for (int b = 0;b < 4;b++) {
// for (int x = 0;x < buf2->width / 4;x++) {
// for (int y = 0;y < buf2->height / 4;y++) {
@ArdWar
ArdWar / LineCounter.cpp
Created October 5, 2015 07:10
[OpenCV] Line counter using edge detection.
#include "opencv/cv.h"
#include "opencv/highgui.h"
#include <stdio.h>
void dy(IplImage* buf1, IplImage* out) {
for (int x=0;x<buf1->width;x++) {
for (int y=0;y<buf1->height;y++) {
out->imageData[out->widthStep*y+x]=abs((uchar)buf1->imageData[buf1->widthStep*(y+1)+x]-(uchar)buf1->imageData[buf1->widthStep*y+x]);
}
}
@ArdWar
ArdWar / C2V.xml
Last active August 29, 2015 14:22
<?xml version="1.0" encoding="utf-8"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by MBeach (Firaxis Games) -->
<!-- Sid Meier's Civilization 5 -->
<!-- Copyright Firaxis Games 2010 -->
<!-- -->
<!-- Civilization Infos -->
<GameData>
<!-- Table definition -->
<Table name="Civilizations">
<Column name="ID" type="integer" primarykey="true" autoincrement="true"/>
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to check recently uploaded files. This script checks if a file
description is present and if there are other problems in the image's
description.
This script will have to be configured for each language. Please submit
translations as addition to the pywikipediabot framework.