#JS #web #drawing https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Transformations
MDN Web Docs
Transformations - Web APIs | MDN
Earlier in this tutorial we've learned about the canvas grid and the coordinate space. Until now, we only used the default grid and changed the size of the overall canvas for our needs. With transformations there are more powerful ways to translate the origin…
#Windows #tgtext
LcdDem:
wsript,cscript是啥
[In reply to LcdDem]
Win 内置的 JS + VBS 解释器
当然那个 JS 解释器非常残废
ES5 说不定都不全
LiangXiang Shen:
没有异步,没有xhr
那就是给 BAT 写扩展同样没什么用
六七年前贴吧整这些东西整的热火朝天,现在全冷了
你甚至可以把 HTML 和 Batch 混写
同一个文件 cmd.exe 和 mshta.exe 都能开
LcdDem:
wsript,cscript是啥
[In reply to LcdDem]
Win 内置的 JS + VBS 解释器
当然那个 JS 解释器非常残废
ES5 说不定都不全
LiangXiang Shen:
没有异步,没有xhr
那就是给 BAT 写扩展同样没什么用
六七年前贴吧整这些东西整的热火朝天,现在全冷了
你甚至可以把 HTML 和 Batch 混写
同一个文件 cmd.exe 和 mshta.exe 都能开
#Linux #cplusplus https://file.xecades.xyz/Linux/
这个写的有 ANSI escape, curses 和 tcasetattr, ioctl 在 Linux 下 nonblocking-getchar 和 get terminal size 的功能了
大佬也有过找这种接口的时候啊
这个写的有 ANSI escape, curses 和 tcasetattr, ioctl 在 Linux 下 nonblocking-getchar 和 get terminal size 的功能了
大佬也有过找这种接口的时候啊
duangsuse::Echo
#Linux #cplusplus https://file.xecades.xyz/Linux/ 这个写的有 ANSI escape, curses 和 tcasetattr, ioctl 在 Linux 下 nonblocking-getchar 和 get terminal size 的功能了 大佬也有过找这种接口的时候啊
#Python #crawler 爬虫全部文件的小脚本
extractinfo.py: #code
没有移除 .. 等特殊路径
mkdir -p craw/xecades_files/
wget -r -nH https://file.xecades.xyz/ python extractinfo.py `find -type d|xargs`实现(元素数据格式 table, 实际
tr=li; td[]=css(.row)):extractinfo.py: #code
from bs4 import BeautifulSoup
def scrapeTable(e, css_tr, css_td, transform=lambda e: e.text.strip()):
return [list(map(transform, row.select(css_td))) for row in e.select(css_tr)]
from sys import argv
from os import path, linesep; colsep = ": "
for dfp in argv[1:]:
with open(path.join(dfp,"index.html"), "r") as f:
eDir = BeautifulSoup(f.read(), features="lxml").select_one("#directory-listing")
items = scrapeTable(eDir, "li .row", "span")
with open(path.join(dfp, "index.txt"), "w") as fOut: fOut.write(linesep.join([colsep.join(row) for row in items])) 没有移除 .. 等特殊路径
duangsuse::Echo
#Python #crawler 爬虫全部文件的小脚本 mkdir -p craw/xecades_files/ wget -r -nH https://file.xecades.xyz/ python extractinfo.py `find -type d|xargs` 实现(元素数据格式 table, 实际 tr=li; td[]=css(.row)): extractinfo.py: #code from bs4 import BeautifulSoup def scrapeTable(e, css_tr…
cat `find -name index.txt`|awk -F: '{gsub("^\\s","",$2);if($2!="-")print($2.":", $1)}' #dalao 不得不说,真的很硬核: #math #statics #signal #web #js #drawing #linux #flash #game
元胞自动机 | 康威生命游戏(零玩家)..: LIFE.cpp
[停止更新] 它存在的意义就是方便我复制一些代码片段..: TextInputer.cpp
生命游戏(彩色): LIFE
并没有用(ANSI Terminal,ncurses): TextInputer
获取键值(termios.h): GetKeyDown.cpp
获取窗口大小(ioctl,TIOCWINSZ,struct winsz)..: GetWindowSize.cpp
打方块swf小游戏(2x ping-pong bar, with intro text/ball animation): Block
初二做的小游戏 | 当时火遍了全校: Block.swf (在线) - 这玩意声音有点大 所以先做好心理准备
模拟蓝屏(win7): BlueScreen
假装自己电脑蓝屏了 | 恶搞: BlueScreen.html (Pic.png)
神经网络 5%/100% 数据库: 5TestData.txt, 100TestData.txt
MNIST csv数据包: MNIST.7z
英语单词数据库: Database.txt
顾名思义: 天河二号申请表.docx
挺好(: 原子弹制作从入门到精通.pdf
更好(..: 有关苛性氢的危害的报告.pdf
#algorithm #cplusplus
AC自动机算法: AC Automaton.cpp
生成ASCII(sleep&print)动画: ASCII.cpp
数据测试器(<ctime> clock()函数) | 然而只能获得每次允许的耗时: DataTester.cpp
两种最大公倍数的求法: GCD.cpp
吉姆拉尔森计算公式(估计是位运算...) | 计算今天星期几: Kim Larsen.cpp
KMP算法: KMP Search.cpp
曼德勃罗集(Mandelbrot)的控制台写法: Mandelbrot.cpp
Manacher回文子串: Manacher Palindrome.cpp
手动开平方根(实现为部分函数): Manual Sqrt.cpp
线段树: Segment Tree.cpp
泰勒展开求 sinHome: Taylor Sin.cpp
模板(懒 (OIer意味上的): template.cpp
我是真羡慕那个初二flash游戏火遍全校的,反正以我的水平,那时候,是做不到吧。(哭晕的是目前也未必能做到,很多时候项目模块管理都能卡死了 别说算法和高端接口)
最令这个大佬自豪的是整个博客的框架是他学 HTML/JS/CSS 三天后写出来的,我觉得非常可以,博客就是要像坟墓一样简洁,因为最终才能意识到的真理往往是简单的,真
草我什么时候才能把自己的 LiteratePy 博客搞出来
最令这个大佬自豪的是整个博客的框架是他学 HTML/JS/CSS 三天后写出来的,我觉得非常可以,博客就是要像坟墓一样简洁,因为最终才能意识到的真理往往是简单的,真
草我什么时候才能把自己的 LiteratePy 博客搞出来
duangsuse::Echo
#Python #crawler 爬虫全部文件的小脚本 mkdir -p craw/xecades_files/ wget -r -nH https://file.xecades.xyz/ python extractinfo.py `find -type d|xargs` 实现(元素数据格式 table, 实际 tr=li; td[]=css(.row)): extractinfo.py: #code from bs4 import BeautifulSoup def scrapeTable(e, css_tr…
https://t.me/dsuses/4501 ,继续 spider 提取代码
regress.py 是出于娱乐目的编写,
find -type f -name '*.html' -! -name index.html -print0|xargs -0 python replacecode.py这个脚本看看就好,连自动扩展名都不支持(网站是 Ace 编辑器的带高亮啊)
regress.py 是出于娱乐目的编写,
def _reg(d, sv, scs, vcs, ics, x,y):这个我看着都想笑(Python 自己又不支持反向计算,更不支持函数回归……)
if scs[ics-1].strip() == "+": d[sv] = y-vcs[ics-2]
Telegram
duangsues.is_a? SaltedFish
补充提取代码的 #Python #code :
replacecode.py:
@regress("len(it)","+","a")
def headerSize(fp): pass
from sys import argv; fps = argv[1:]
with open(argv[0], "r") as f: headerSize(f.read(), argv[0])
for fp in argv[1:]:
with open(fp, "r") as f: s = f.read();…
replacecode.py:
@regress("len(it)","+","a")
def headerSize(fp): pass
from sys import argv; fps = argv[1:]
with open(argv[0], "r") as f: headerSize(f.read(), argv[0])
for fp in argv[1:]:
with open(fp, "r") as f: s = f.read();…
#cplusplus #dev #oi #algorithm
摘要:支持 iostream(cin/cout) 的语法糖
支持
题外话 C++ 什么时候支持
此外有 random 生成 int/longlong(
(当然,基于 escape code 可以与 std::cout 配套
[fg/bg]_color(red) 定义前背景色
(no_) underline/blink 选择风格
reset/error_color 便利 span
用
还有
最后是一个数据生成及校验的(这个目标比较有趣,但只做了类似离线OJ的使用目标)
感觉不错, Mivik 大佬的接口复用设计能力比以前强了好多啊(一个月前上传的,大概是现在才想起来发) 🤔
这用途都不止 OI 了,而且命名都很优雅
原来现在 OI 才是 C++ cutting edge 语言特性的最大利用方啊
摘要:支持 iostream(cin/cout) 的语法糖
cout<1<endl;
取余操作(当然是OI应该叫模数了 但我不OI) 隐式 int mod 上下文的宏,以及 (57 / 233) % 10007 == (mint(57) / 233).v 的快速模意义(mint)运算支持
mic::graph::directed_weighted_graph<type> 这样命名的图对象,有 resize(n); link(a,b); edges(i) 甚至 is_tree() 等操作题外话 C++ 什么时候支持
for (auto [a,b] : iter) 这种语法了…… std::pair 可能有用吧此外有 random 生成 int/longlong(
rng.rand<t>())/tree 数据(无重生成)的e(1,2 +1) == 2 brackets(10) // [] seq还有 ANSI terminal (term.h) 的
binary_tree(10) // size 10, depth (log2 10-1)+1
e.shuffle(a.begin(), a.end());
(当然,基于 escape code 可以与 std::cout 配套
[fg/bg]_color(red) 定义前背景色
(no_) underline/blink 选择风格
reset/error_color 便利 span
用
reset_line() 删除上一行制作单行动画(如进度条)还有
cursor::right 及 hide/show 这样的光标API;整体可配合 std::cout.flush(); 使用最后是一个数据生成及校验的(这个目标比较有趣,但只做了类似离线OJ的使用目标)
mic::random_engine rng;检验:
ZEN_GEN/*to data/ folder*/("[name]", 20) {/*(id, out) ->*/
int limit; switch (id){
case 1 ... 5: limit = zen::map/*_range*/(1,5, 20,100);/*with step change*/; break;
default: limit = 5000000; break;
}
out << rng(0, limit) << ' ' << rng(0, limit) << std::endl;
}
ZEN_CHECK("a.cpp", "b.cpp") {
out << e(0, 20000) << ' ' << e(0, 20000) << std::endl;
}
对比逻辑是写死的,命令行 编译 clang 差异 diff感觉不错, Mivik 大佬的接口复用设计能力比以前强了好多啊(一个月前上传的,大概是现在才想起来发) 🤔
这用途都不止 OI 了,而且命名都很优雅
原来现在 OI 才是 C++ cutting edge 语言特性的最大利用方啊
GitHub
Mivik/mic
A set of helpful cpp headers, especially for competitive programmers. - Mivik/mic
Forwarded from mivik::channels::tech
一套有用的 C++ Headers,包括图论、快速 IO、模意义操作、随机函数、终端操作、数据生成等功能,实属 OI 必备利器(
Requires C++17
https://github.com/Mivik/mic
Requires C++17
https://github.com/Mivik/mic
GitHub
Mivik/mic
A set of helpful cpp headers, especially for competitive programmers. - Mivik/mic
#algorithm 我可能会做也可能不会做,但最近显然是没时间想了(
不过我可以总结下题面:
易不解在于翻转优化的插入-删除操作——
问题是,判断给你的 len(s) == 2*n 括号序列,为以上算法输出的可能性。
刚开始还写出了forall i. s[0:i].count('(')==s[0:i].count(')') 甚至 s[i-1] (len(s)>=1) 我是怎么想的…… 序列归纳啊
不过我可以总结下题面:
() 是合法的括号序列,生成这种序列可以先弄出随机 1:1 对开 shuffled 的 )( 序列然后遍历求和(测试匹配),显然 ())( 是不合法的,那么翻转后 2 char 即可易不解在于翻转优化的插入-删除操作——
)()( 翻= ()() ,我不熟悉逻辑学所以不知道为什么,反正序列项只有两可能呗(问题是,判断给你的 len(s) == 2*n 括号序列,为以上算法输出的可能性。
array<bool, 2*n> s;(突然发现怎么有 i++ 和 ACCEPT 两处重复逻辑)
int nOpen;
#define ACCEPT nOpen += s[i]? +1/*'('*/ : -1;
for (i=0; i<n;) { ACCEPT;
if (nOpen >= 0) { i++; continue; }
for (i1=i+1; i1<n; i1++) { ACCEPT; if (nOpen == 0) break; }
for (; i != i1; i++) { s[i] ^= 1; }
i = i +1;
}
刚开始还写出了
Forwarded from mivik::channels::tech
一道自认为出得还算有趣的题,不要求编程竞赛基础,有一定思维难度,可以来尝试一下():
https://www.luogu.com.cn/problem/P7263
https://www.luogu.com.cn/problem/P7263
bracket.cpp
3.3 KB
写不下去了,本来还想写一个某种意义的单指令多数据的(不过即便没修好,看起来位运算比数组块多了... 但 >nbit 的话需要额外写 class)
测试
((()))(())((()))()((())())()(((())()))()
(((()(()()(((()()))))()()))(()(())()))()
warm-up(original): 3284
original: 1722
rewrite: 1537
SIMD rewrite: 327
最开始的数据都是 original: 4232/rewrite: 3493 这种差 800 的,后来忽然就降低了(
测试
((()))(())((()))()((())())()(((())()))()
(((()(()()(((()()))))()()))(()(())()))()
warm-up(original): 3284
original: 1722
rewrite: 1537
SIMD rewrite: 327
最开始的数据都是 original: 4232/rewrite: 3493 这种差 800 的,后来忽然就降低了(
duangsuse::Echo
https://lab.xecades.xyz/Fourier/?img=5 感觉自己的智商严重需要重构了…… 看了下基本绘制结构我明白了,当时找 img= 参数引用的时候想当然查 (n + 1) 这个表达式,三次没找到后才在已发现 loadPageVar() 后明白编号到零基数组引数是 -1,明显没过脑子(或者记性不好/数性太差),就凭这?心理各种崩溃。 是用 setInterval (timer) 累积dt 更新的(缺点 dt 是常量) generate(t) 基于 getSvgInfo() (load…
This media is not supported in your browser
VIEW IN TELEGRAM