Skip to content

Instantly share code, notes, and snippets.

View DoodleBears's full-sized avatar
🎯
Focusing

DoodleBear DoodleBears

🎯
Focusing
View GitHub Profile
from typing import List
from langdetect import detect
import fast_langdetect
from wtpsplit import WtP
wtp = WtP("wtp-bert-mini")
def detect_lang(text: str) -> str:
result = str(detect(text))
/** 全局设置 -----------------------------------------------------------------------------------------------*/
/** 背景设置 */
/* div#fakebody {
background-color:#fff;
}
*/
#example-container {
width:800px;
@DoodleBears
DoodleBears / main.dart
Last active September 16, 2021 15:54
ScrollMetrics (Notification)
import 'package:flutter/material.dart';
void main() => runApp(const ScrollMetricsDemo());
class ScrollMetricsDemo extends StatefulWidget {
const ScrollMetricsDemo({Key? key}) : super(key: key);
@override
State<ScrollMetricsDemo> createState() => ScrollMetricsDemoState();
}
@DoodleBears
DoodleBears / main.dart
Last active September 16, 2021 15:07
Dart Mixin
// Dart 会先 Extend 继承
// 之后才会以线性 linear 的方式去 Mixin
// linear 意味着最后一个 with 的 mixins 的 functions 会覆盖前面的
class A {
void a() {
print(runtimeType.toString() + ": a");