Skip to content

Instantly share code, notes, and snippets.

View halka9000stg's full-sized avatar
🧑‍💻
Needed Co-Researcher/Co-Developer

佐藤陽花 halka9000stg

🧑‍💻
Needed Co-Researcher/Co-Developer
  • was Dev. of CE, CST, Nihon Univ.
  • Tokyo & Soma, Japan
  • 17:05 (UTC +09:00)
  • X @Distr_to_Yonder
View GitHub Profile
@halka9000stg
halka9000stg / main.dart
Last active March 23, 2024 18:28
CelebrationElection Math
import "dart:math";
void main(){
final int voterCount = 30;
final int maxVote = 100;
final int sampleCount = 7;
@halka9000stg
halka9000stg / main.dart
Last active February 25, 2024 18:20
Magic Code for Cotec Binary
import "dart:convert";
import "dart:typed_data";
void main(){
final List<int> mg = CotecBinMagic(0, 18, 3, true).asBinary;
print("len: ${mg.length}");
print("mgc: ${mg.map<String>((int e) => e.toRadixString(16)).join(" ")}");
print("chr: «${utf8.decode(mg.skip(4).toList())}»");
print("ch2: «${utf8.decode(mg)}»");
}
@halka9000stg
halka9000stg / main.dart
Created February 4, 2024 15:58
Demo for LCM Simple Implementation
void main(){
print((5).lcm(2));
print((4).lcm(3));
}
extension LCM on int {
int lcm(int other) => (this * other) ~/ this.gcd(other);
}
@halka9000stg
halka9000stg / main.dart
Created August 23, 2023 14:10
T Material Stones
import "dart:convert";
import "dart:math" as math;
void main() {
run("YMO","TMS");
}
void run(String a, String b){
print(a.asLIB);
print(b.asLIB);
print(a.asLI - b.asLI);
@halka9000stg
halka9000stg / main.dart
Last active November 14, 2022 21:09
Sibac impl
import "dart:math";
void main() {}
bool isEfficientToShorten(int len, int count, [int margin = 0]){
if(len<0||count<0||margin<0){
throw Error();
}
int repPadLen = log10(len).ceil()+log10(count).ceil()+3;
return repPadLen<len*(count-1)+margin;
}
double log10(num x)=>log(x)/log(10);
@halka9000stg
halka9000stg / main.dart
Created October 26, 2022 23:10
SubDomain Suppling System
void main() {
final dp = Domain("dev-pack.org");
print(dp.supply("sorakim"));
print(dp.supply("made.in.apple"));
print(dp.supply("sorakim.made.in.apple"));
}
int maxIntegerOnHex(final int hexLen)=>int.parse("f" * hexLen, radix: 16);
extension on int{
int foldInTo(final int hexLen){
final int max = maxIntegerOnHex(hexLen);
@halka9000stg
halka9000stg / main.dart
Last active October 27, 2022 09:17
仮想処理装置 (尺寸符号化データ&微細指令)
import "dart:typed_data";
import "dart:math";
//仮想処理装置 (尺寸符号化データ&微細指令)
//Virtual Processor (Aligned Binary Data & Microcode)
typedef TrailOperandFmt = List<OperandUnitFmt>;
void main() {
}
class VProcessor{
@halka9000stg
halka9000stg / main.dart
Last active October 24, 2022 10:14
Radial Number System
import "dart:collection";
void main() {
final RadialNumber rn = RadialNumber.basic([17, 3, 10], isCyclic: true);
rn.of(13592);
print(rn.toString());
print(rn());
rn.next();
print(rn.toString());
print(rn());
@halka9000stg
halka9000stg / index.html
Created October 23, 2022 09:08
Sortable Table
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sortable Table</title>
<link rel="stylesheet" href="styles.css">
<script type="application/dart" src="main.dart"></script>
</head>
@halka9000stg
halka9000stg / index.html
Created October 23, 2022 09:07
World Time in Offsets Table
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>World Time in Offsets Table</title>
<link rel="stylesheet" href="styles.css">
<script type="application/dart" src="main.dart"></script>
</head>