Forwarded from See you at @fishing_daily ! | (Archived) YuutaW 的版聊频道 (台长)
CS 作业搞定了,一个 Java 图形计算器基本做好了(
🤔既然只支持一个 x(二维),为什么不把我之前的 https://duangsuse-valid-projects.github.io/Share/HTMLs/calc.html 拓展一下,加个 x-y UI 看函数图?
计划:
- 纯 canvas 直接绘制于 doc.body ,旧 UI 输入盘可选吸附位置,支持 resize 和 moving (Shift? roll) , (Ctrl roll/slider) scaling
- 表达式和编辑已经支持了,当然没有代码高亮
- 从 REDO 列表添加公式(老项目是一个纯状态🐔式计算器,支持逆波兰吧 还好性能问题有过优化 最初是直接操纵界面按钮自动 click 的)
- 状态和缩放slider 跟随界面盘
显示位置&象限、缩放比、当前区间和y值域(? 这个应该很难无预推导的高性能实现)
计划:
- 纯 canvas 直接绘制于 doc.body ,旧 UI 输入盘可选吸附位置,支持 resize 和 moving (Shift? roll) , (Ctrl roll/slider) scaling
- 表达式和编辑已经支持了,当然没有代码高亮
- 从 REDO 列表添加公式(老项目是一个纯状态🐔式计算器,支持逆波兰吧 还好性能问题有过优化 最初是直接操纵界面按钮自动 click 的)
- 状态和缩放slider 跟随界面盘
显示位置&象限、缩放比、当前区间和y值域(? 这个应该很难无预推导的高性能实现)
duangsuse::Echo
🤔既然只支持一个 x(二维),为什么不把我之前的 https://duangsuse-valid-projects.github.io/Share/HTMLs/calc.html 拓展一下,加个 x-y UI 看函数图? 计划: - 纯 canvas 直接绘制于 doc.body ,旧 UI 输入盘可选吸附位置,支持 resize 和 moving (Shift? roll) , (Ctrl roll/slider) scaling - 表达式和编辑已经支持了,当然没有代码高亮 - 从 REDO 列表添…
呃… 昨天晚上半天没睡着,想了一下,记得当时的优化是解决尾递归(当然是 js 层的啦)问题,避免用递归实现(REDO 的)循环,这算是必须的基础算法的优化了。
也就是说,计算器目前的性能应该还有问题,每执行一个操作都要操纵 DOM 两次(单击、读写...)。
本来还想 #TypeScript 重写,突然发觉好像已经是 TS 了……
我要写的绘图暂时还不打算支持自定义表达式或关系式(特指我亲自编写解析器的版本,本来是早有设计打算的),只能线性
如果现在要实现
如果要手工计算一批数据倒还无所谓,用来绘图显然是太草了
我觉得,大概可以把 (a,b)=>a+b 这些基础函数暴露出来,让 DOM 监听自己再去组织,然后通过这个的一部分(+-*/ 什么的) 制作一个 {} 和一个 [] , evaluator 里用 {} 去给指令编址,执行时只需一个 accumulator = 0 就够了,都是 acc = ops[opcode](acc, b) 的形式
如果出现不支持的指令,就同步 acc 到 DOM 再用 DOM 的方法去点击(协处理器)
—
关于 canvas 绘制的方法我觉得现在就可以探索
设计时大概需要这几个参数:
[x] axis [x] legend [ ] grid [ ] points
mutable: step, vp_xy, scale_xy
immutable: descPosneg, range, valueRange
真想用中文命名算了(草
也就是说,计算器目前的性能应该还有问题,每执行一个操作都要操纵 DOM 两次(单击、读写...)。
本来还想 #TypeScript 重写,突然发觉好像已经是 TS 了……
我要写的绘图暂时还不打算支持自定义表达式或关系式(特指我亲自编写解析器的版本,本来是早有设计打算的),只能线性
evaluate(x) 来求值如果现在要实现
evaluator(no) => (x) => ,显然是要把 x 放到 <input> 里,调用内部 redo(no) 函数... (否则就要用 DRedo,这个计算机本身有点像错误设计的虚拟机,寄存器不够,控制指令全是零地址)如果要手工计算一批数据倒还无所谓,用来绘图显然是太草了
我觉得,大概可以把 (a,b)=>a+b 这些基础函数暴露出来,让 DOM 监听自己再去组织,然后通过这个的一部分(+-*/ 什么的) 制作一个 {} 和一个 [] , evaluator 里用 {} 去给指令编址,执行时只需一个 accumulator = 0 就够了,都是 acc = ops[opcode](acc, b) 的形式
如果出现不支持的指令,就同步 acc 到 DOM 再用 DOM 的方法去点击(协处理器)
—
关于 canvas 绘制的方法我觉得现在就可以探索
设计时大概需要这几个参数:
[x] axis [x] legend [ ] grid [ ] points
mutable: step, vp_xy, scale_xy
immutable: descPosneg, range, valueRange
真想用中文命名算了(草
#js #lib #performance #gui https://editor.datatables.net/generator/
🤔 想起了 #Qt Model/View 的 delegate 和 createEditor 什么的... 但其实从 row 建立可搜索、可排序、可编辑的 table 并不需要那么多名词吧
https://github.com/fiduswriter/Simple-DataTables
嘛,虽说是 lightweight ,其实连 Date format 都支持...
http://fooplugins.github.io/FooTable/ 感觉还是这个最好看
https://github.com/frappe/datatable 这个也支持 inline editing
https://github.com/future-architect/cheetah-grid 有创意,内带比率可视化支持
https://github.com/mleibman/SlickGrid/wiki/Examples 感觉最糟糕的一个
https://github.com/bvaughn/react-virtualized 第二糟糕的
https://github.com/ratiw/vue-table 最像 Qt 的一个... 不对,这不像 Qt
https://github.com/jiren/StreamTable.js 支持 #stream 但只能用 templating 的一个
http://swimlane.github.io/ngx-datatable/#filter Angluar 的一个
https://github.com/daniel-nagy/md-data-table#demo Material #Design 的一个,作者眼力是不是不好... README.md 那么多示例 table 放着呢
https://clusterize.js.org/ #performance #web 🤔给 <tr> 甚至 <il> <div> tag 做 chunking 的简易 js 优化
🤔 想起了 #Qt Model/View 的 delegate 和 createEditor 什么的... 但其实从 row 建立可搜索、可排序、可编辑的 table 并不需要那么多名词吧
https://github.com/fiduswriter/Simple-DataTables
嘛,虽说是 lightweight ,其实连 Date format 都支持...
http://fooplugins.github.io/FooTable/ 感觉还是这个最好看
https://github.com/frappe/datatable 这个也支持 inline editing
https://github.com/future-architect/cheetah-grid 有创意,内带比率可视化支持
https://github.com/mleibman/SlickGrid/wiki/Examples 感觉最糟糕的一个
https://github.com/bvaughn/react-virtualized 第二糟糕的
https://github.com/ratiw/vue-table 最像 Qt 的一个... 不对,这不像 Qt
https://github.com/jiren/StreamTable.js 支持 #stream 但只能用 templating 的一个
http://swimlane.github.io/ngx-datatable/#filter Angluar 的一个
https://github.com/daniel-nagy/md-data-table#demo Material #Design 的一个,作者眼力是不是不好... README.md 那么多示例 table 放着呢
https://clusterize.js.org/ #performance #web 🤔给 <tr> 甚至 <il> <div> tag 做 chunking 的简易 js 优化
GitHub
GitHub - fiduswriter/simple-datatables: DataTables but in TypeScript transpiled to Vanilla JS
DataTables but in TypeScript transpiled to Vanilla JS - fiduswriter/simple-datatables
duangsuse::Echo
#js #lib #performance #gui https://editor.datatables.net/generator/ 🤔 想起了 #Qt Model/View 的 delegate 和 createEditor 什么的... 但其实从 row 建立可搜索、可排序、可编辑的 table 并不需要那么多名词吧 https://github.com/fiduswriter/Simple-DataTables 嘛,虽说是 lightweight ,其实连 Date format 都支持... …
Clusterize 那个真的不能再小了,才 300 行,大部分精力在做 interactive doc 上吧(这个 doc 也算是很有效了
当然 search, keep <thead> 什么的 还有固定大小 table-layout:fixed 要特殊处理
然后 #CSS counter (内部文本: 数数) 总结下咋支持的:
https://cdn.jsdelivr.net/npm/clusterize.js@0.18.1/clusterize.js
https://cdn.jsdelivr.net/npm/clusterize.js@0.18.1/clusterize.css 只有几条规则而已 魔改者最多只需覆盖1条
#js #ce 还支持 https://developers.google.com/closure/compiler 🤔 不知道这玩意会不会 inline constexpr (肯定不会
https://cdn.jsdelivr.net/npm/clusterize.js@0.18.1/externs.js 如果连 API 都要库作者手写的话,首先设计就有问题, Proguard 不需要
#DontKnow event delegation... scroller 覆盖了控件树,还是需要 delegate 才能听见吗
JQuery 也是比较成功, DOM 都封装好了而且支持 IE
当然 search, keep <thead> 什么的 还有固定大小 table-layout:fixed 要特殊处理
然后 #CSS counter (内部文本: 数数) 总结下咋支持的:
content_elem.style['counter-increment'] = 'clusterize-counter ' + (data.rows_above-1); 这么说 rows_above 始终不为 [] 了..? 应该 把索引0映射到&chunk[0]这样https://cdn.jsdelivr.net/npm/clusterize.js@0.18.1/clusterize.js
https://cdn.jsdelivr.net/npm/clusterize.js@0.18.1/clusterize.css 只有几条规则而已 魔改者最多只需覆盖1条
#js #ce 还支持 https://developers.google.com/closure/compiler 🤔 不知道这玩意会不会 inline constexpr (肯定不会
https://cdn.jsdelivr.net/npm/clusterize.js@0.18.1/externs.js 如果连 API 都要库作者手写的话,首先设计就有问题, Proguard 不需要
#DontKnow event delegation... scroller 覆盖了控件树,还是需要 delegate 才能听见吗
document.getElementById('contentElemId').onclick = function(e) {
e = e || event;
var target = e.target || e.srcElement;
if(target.nodeName != 'TR') return;
// do stuff with row
} $('#contentElemId').on('click', 'tr', function() {}) JQuery 也是比较成功, DOM 都封装好了而且支持 IE
GitHub
Added support of CSS counters. Relates to #126 · NeXTs/Clusterize.js@0db86da
Tiny vanilla JS plugin to display large data sets easily - NeXTs/Clusterize.js
duangsuse::Echo
呃… 昨天晚上半天没睡着,想了一下,记得当时的优化是解决尾递归(当然是 js 层的啦)问题,避免用递归实现(REDO 的)循环,这算是必须的基础算法的优化了。 也就是说,计算器目前的性能应该还有问题,每执行一个操作都要操纵 DOM 两次(单击、读写...)。 本来还想 #TypeScript 重写,突然发觉好像已经是 TS 了…… 我要写的绘图暂时还不打算支持自定义表达式或关系式(特指我亲自编写解析器的版本,本来是早有设计打算的),只能线性 evaluate(x) 来求值 如果现在要实现 evaluator(no)…
安静... 大概是弄错了,看来不需要 data table ,只用好好设计界面就行了 🌚
行吧,先写渲染
行吧,先写渲染
#build https://github.com/stevenjoezhang/fractal-tree/ #bash fix instruction
git clone https://github.com/stevenjoezhang/fractal-tree &&cd fractal-tree
npm install
sed 's/script src="js\/bundle.js"/\0 type="module"/' -i public/index.html
pushd src/js/ &&sed "s/'Three/'three/g" -i environment.js -i index.js -i tree.js
popd
npm start # 会自动 npm run build-dev 输出 public/js/bundle.jsForwarded from 羽毛的小白板
看了看生成的 asm 感觉是因为有两份累加操作使得 CPU 并行执行。归根到底还是目前 RyuJIT 缺 loop opt
https://twitter.com/badamczewski01/status/1357603334706909185
https://twitter.com/badamczewski01/status/1357603334706909185
Twitter
Bartosz Adamczewski
Loop Optimizations can be surprising: #csharp #dotnet #programming
#js #cg #tool #drawing http://paperjs.org/ #doc https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API 草 https://ptsjs.org/ 、 http://scrawl.rikweb.org.uk/ 、 https://zimjs.com/art.html ; https://www.createjs.com/demos/easeljs/filters #game #tools http://fabricjs.com/ 、 https://konvajs.org/
https://apvarun.github.io/graphize/
https://jsoncanvas.org/
https://apvarun.github.io/graphize/
https://jsoncanvas.org/
草 #art #tools #recommended #drawing #learn 这个 Zim 居然是包含一个大 UI 库,各种 CG 示例和控件工具巨多,而且是基于这个看起来独立的 https://createjs.com/ ... 贵圈真牛
NIO 什么的居然都是猫名,看着主页那么杂乱 Logo 有点糊我还以为不是资深弄的呢,没想到是真・大牛
https://zimjs.com/about.html, https://zimjs.com/examples.html
一个 canvas 整得想 ppt 一样,但非常吼玩 还有 https://createjs.com/tools
NIO 什么的居然都是猫名,看着主页那么杂乱 Logo 有点糊我还以为不是资深弄的呢,没想到是真・大牛
https://zimjs.com/about.html, https://zimjs.com/examples.html
一个 canvas 整得想 ppt 一样,但非常吼玩 还有 https://createjs.com/tools
Createjs
CreateJS | A suite of JavaScript libraries and tools designed for working with HTML5
A suite of modular libraries and tools which work together or independently to enable rich interactive content on open web technologies via HTML5.
duangsuse::Echo
补充几个给想吃瓜的链接: #opensource #security #censored https://github.com/net4people/bbs/issues/60 https://github.com/signalapp/Signal-TLS-Proxy/issues/3 频道主觉得,有问题就要改,不要低估伊朗政府的封锁能力吧。 PoC(理念验证) 是用 #golang 写的,送信流是 net.Dial("tcp",s) +二层 tls.Clent(c0,{serverName:server/sni…
后续 #freedom #opensource #github #low Signal 已经把提问的两个人 block 了🌚
https://t.me/anticensorship_epics/123
可以看看这个人的评论 🌝
Detecting MTProxy is no big deal, not “advanced” at all. Their bad design made it so easy to be detected. The difference is that Telegram doesn’t try to hide the facts by disabling issues or shutting people up.
https://github.com/TelegramMessenger/MTProxy/issues/200
They(censoring ISPs) haven’t blocked Signal only because it is new enough and/or they haven’t got the news, not because it is technically impossible.
—订户补充
block的主因是ducksoft往proxy的repo里发pr传自己的poc
signal把这个pr删了,他又传了一次,就被repo block了
https://community.signalusers.org/t/why-signal-blocked-me-from-their-github-orgs/27404/16
但是 Signal 还是没有回应
我觉得吧回复一句「现在正在做更重要的特性,安全性的提升可以到时候再弄」然后安慰一下觉得不安全的终端用户就可以了
https://t.me/anticensorship_epics/123
可以看看这个人的评论 🌝
Detecting MTProxy is no big deal, not “advanced” at all. Their bad design made it so easy to be detected. The difference is that Telegram doesn’t try to hide the facts by disabling issues or shutting people up.
https://github.com/TelegramMessenger/MTProxy/issues/200
They(censoring ISPs) haven’t blocked Signal only because it is new enough and/or they haven’t got the news, not because it is technically impossible.
—订户补充
block的主因是ducksoft往proxy的repo里发pr传自己的poc
signal把这个pr删了,他又传了一次,就被repo block了
https://community.signalusers.org/t/why-signal-blocked-me-from-their-github-orgs/27404/16
但是 Signal 还是没有回应
我觉得吧回复一句「现在正在做更重要的特性,安全性的提升可以到时候再弄」然后安慰一下觉得不安全的终端用户就可以了
Telegram
Epics of Anti-Censorship
更新:Signal 在 GitHub 上 block 了 DuckSoft 和 studentmain~
很荣幸以这种方式被 Signal block~
解决不了问题,就解决提出问题的人!牛逼!
—————
https://github.com/signalapp/Signal-TLS-Proxy/pull/15
欢迎墙下留言,今天大家一起享受 Signal 专属 block 套餐~
很荣幸以这种方式被 Signal block~
解决不了问题,就解决提出问题的人!牛逼!
—————
https://github.com/signalapp/Signal-TLS-Proxy/pull/15
欢迎墙下留言,今天大家一起享受 Signal 专属 block 套餐~