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:10 (UTC +09:00)
  • X @Distr_to_Yonder
View GitHub Profile
@halka9000stg
halka9000stg / main.dart
Last active September 25, 2022 04:34
ゼロ幅スペース
void main() {
String li =
"LoremIpsumDolorSitAmetConsecteturAdipiscingElitSedDoEiusmodTemporIncididuntUtLaboreEtDoloreMagnaAliquaUtEnimAdMinimVeniamQuisNostrudExercitationUllamcoLaborisNisiUtAliquipExEaCommodoConsequatDuisAuteIrureDolorInReprehenderitInVoluptateVelitEsseCillumDoloreEuFugiatNullaPariaturExcepteurSintOccaecatCupidatatNonProidentSuntInCulpaQuiOfficiaDeseruntMollitAnimIdEstLaborum";
String li2 = resistTheActOfSearching(li);
print("$li\nlen: ${li.length}\n");
print("$li2\nlen: ${li2.length}\n");
List<String> s1 = search(li,"ipsum", ignore: true).map<String>((Span s) => s(li)).toList();
List<String> s2 = search(li2,"ipsum", ignore: true).map<String>((Span s) => s(li2)).toList();
@halka9000stg
halka9000stg / readme.md
Last active September 25, 2022 04:06
簡易巡回暗号
@halka9000stg
halka9000stg / main.dart
Created August 28, 2022 04:52
Wallpaper Record
import "dart:math";
void main() {
print(tpx());
}
Type Function() tpx = (() => (WPR));
typedef WPR = WallpaperRecord;
@halka9000stg
halka9000stg / main.dart
Last active August 26, 2022 05:27
Massage-Passing, char. of Dart as Pure OOP Lang
void main() {
Sample nr = Sample(5, "u");
String gtr = "slot2";
try {
final res = nr.getInvoker(gtr);
print(res);
} catch (e, s) {
print("\$Error: ${e.runtimeType}");
print(":: $s");
}
@halka9000stg
halka9000stg / main.dart
Last active August 8, 2022 07:15
ANSIエスケープシーケンス処理
void main() {
print(ansi.bold.bgMagenta.fgColor255(33)("bold magenta 33 test", true) +
ansi.fgColorRGB(244, 192, 14)("#f4c2400e"));
print("DartPadのコンソールは基本7色しか対応していないらしい。");
print("255段階のシーケンス中に含まれる5がblinkと解釈されてしまう。");
print("また255段階の指定コードがたまたま33だったためこれが黄色文字と解釈されてしまう。");
print("因みに少なくともWin10のCmdでは想定通りの挙動をする。");
}
class AnsiStyles {
@halka9000stg
halka9000stg / main.dart
Last active August 8, 2022 08:16
行別テキスト処理(インデント etc.)
typedef StringProcess = String Function(String);
void main() {
print("some\r\nlinee\rgoes\n".indent(3).show({" ": "[sp]"}));
}
extension Lines on String {
String eachLines([StringProcess? process]) {
final String res = r"([^\r\n]*)(\r\n|\r(?!\n)|(?<!\r)\n)";
final re = RegExp(res, dotAll: true);
final List<String> rems =
@halka9000stg
halka9000stg / main.dart
Last active August 2, 2022 13:35
The Fooling
void main() {
final fool = Fooler(on3: sayOn3, onElse: sayOnElse);
fool(100);
}
void sayOn3(int n)=>print("$n!"*n);
void sayOnElse(int n)=>print("更新: $n");
class Fooler{
int _nr = 0;
void Function(int) _on3;
void Function(int) _onElse;
@halka9000stg
halka9000stg / main.dart
Last active August 2, 2022 13:02
love_injection
import "dart:math";
void main() {
final rd = Random.secure();
final List<bool> comp = [true, false, false, false] * 3;
List<bool> list = [];
bool temp = false;
bool fin = false;
while (!fin) {
list.next(rd);
@halka9000stg
halka9000stg / main.dart
Last active October 24, 2022 08:25
繰上下数組計算システム
void main() {
TemporalTest tt = TemporalTest();
tt.show();
int count = 7;
int countI = 1000;
final int countI1 = 1200; // to rad 1000
final int countI2 = 90; // to rad 60
final int countI3 = 1000; // to rad 24
for (int i = 1; count >= i; i++) {
if (i >= 1 && i <= 3) {
@halka9000stg
halka9000stg / main.dart
Last active August 2, 2022 04:01
書式指定文字列処理方式
///書式指定文字列処理方式
///Processing Method of Format Specified String
void main() {
//no-arg
final fe1 = FormatException();
//only-msg
final fe2 = FormatException("ThisIsMassage");
//msg-and-nn-src
final fe3 = FormatException("ThisIsMassage", "Source");
//msg-and-null-src-and-nn-ofs