This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from email import message | |
from math import log | |
from wcferry import Wcf, WxMsg | |
from queue import Empty | |
import os | |
import json | |
import logging | |
import time | |
from front.context import Context | |
from engine.route import ai_engine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nicegui import ui | |
from typing import Callable | |
import sys | |
import uuid | |
refreshable_func_key = '_refreshable_func' | |
def use_state(default): | |
for i in range(10): | |
frame = sys._getframe(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Peano Natural Numbers ( https://en.wikipedia.org/wiki/Peano_axioms ) | |
''' | |
class Nat(object): | |
def __init__(self, prev=None): | |
self.prev = prev | |
def __eq__(self, other) -> bool: | |
if self.prev is None and other.prev is None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _encode = (value: RedisValue): Uint8Array | Uint8Array[] => { | |
switch (value.tag) { | |
case "RedisNumber": | |
const v = `:${value.value}\r\n`; | |
return stringToBuffer(v); | |
case "RedisError": | |
return packRedisString(value.value, "-"); | |
case "RedisString": | |
return packRedisString(value.value, "+"); | |
case "RedisBulkString": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface RedisString { | |
tag: "RedisString"; | |
value: Uint8Array; | |
} // binary safe byte string | |
export interface RedisBulkString { | |
tag: "RedisBulkString"; | |
value: Uint8Array; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug, Clone)] | |
pub enum RValue { | |
RStr(String), | |
// RBulkString(ByteString), | |
RNumber(f64), | |
Error(String), | |
RList(Vec<RValue>), | |
Nil, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type RedisString = string; | |
type RedisBulkString = string; | |
type RedisNumber = number; | |
type RedisArray = RedisValue[]; | |
type RedisNil = 'nil'; | |
type RedisError = string; | |
type RedisValue = RedisString|RedisBulkString|RedisNumber|RedisArray|RedisNil|RedisError; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { encode, RedisValueOf, RedisParser, show } from "https://raw.githubusercontent.com/qingant/tiny-redis/master/mod.ts"; | |
import { parse as argParse } from "https://deno.land/std/flags/mod.ts"; | |
const { args } = Deno; | |
const config = argParse(args); | |
const opts = { | |
port: config.p || 6666, | |
hostname: config.h || "127.0.0.1" | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { * } from './test.ts'; | |
console.log('This is Test1'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const main = async () => { | |
console.log('Hello World'); | |
} | |
if (import.meta.main) { | |
main() | |
} |
NewerOlder