duangsuse::Echo
583 subscribers
4.12K photos
118 videos
579 files
6.13K links
import this:
美而不丑、明而不暗、短而不凡、长而不乱,扁平不宽,读而后码,行之天下,勿托地上天国。
异常勿吞,难过勿过,叹一真理。效率是很重要,盲目最是低效。
简明是可靠的先验,不是可靠的祭品。
知其变,守其恒,为天下式;穷其变,知不穷,得地上势。知变守恒却穷变知新,我认真理,我不认真。

技术相干订阅~
另外有 throws 闲杂频道 @dsuset
转载频道 @dsusep
极小可能会有批评zf的消息 如有不适可退出
suse小站(面向运气编程): https://WOJS.org/#/
Download Telegram
#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.js
#linux #Learn #Java #math #build #bash fix for Desoms (Kt, Java:Algebra)
1. Java Desmos 求解后端
git clone https://github.com/galbar07/Desmos.git DesmosJ &&cd DesmosJ
sed 's/import org.junit.jupiter.api.BeforeEach;//;s/@BeforeEach//;' -i tests/Functions_GUITest.java
javac -cp `ls JAR/gson-*.jar`:`ls ~/.m2/repository/junit/junit/4.0/junit-*.jar` ex1/*.java tests/Functions_GUITest.java
java -cp . ex1.StdDraw
#java -cp ".:`ls JAR -m|sed 's/, /:/g'`" tests.Functions_GUITest
java -cp `find JAR -type f -printf '%p:'`. tests.Functions_GUITest
因为 mvng 没有写完不能用脚本生成 POM 修复了 emm ,当然有 IDE 就能直接用(不过这年头 只会用 IDE 建项目 对细节一无所知的人真的有创造力吗 😑

2. Kotlin Desmos 简单重写
手动复制粘贴 https://paste.ubuntu.com/p/Q4DnzrZ37Z/ 或(源地址)到 Window.kt ,因为 国内 #China 许多地方不仅 #GitHub raw 连 pastebin 都连不上 🌚🌝 #freedom
mvn archetype:help
#mkdir DesmosKt &&cd DesmosKt
#mvn archetype:generate -DgroupId=com.example - DartifactId=desmos -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

mvn archetype:generate -DgroupId=me.nanjingchj -DartifactId=DesmosKt -DarchetypeArtifactId=kotlin-archetype-jvm -DarchetypeGroupId=org.jetbrains.kotlin -DarchetypeVersion=1.4.21 -DinteractiveMode=false
cd DesmosKt
mkdir -p src/main/kotlin/me/nanjingchj/desmos/
cat>`find -type d -name desmos`/Window.kt
mvnDeps=`python -c 'from lxml import etree,builder; s="org.mariuszgromada.math:MathParser.org-mXparser:4.4.2";E=builder.E;e=E("dependency", *(E(k, v) for v,k in zip(s.split(":"), "groupId artifactId version".split(" ")))); print(etree.tostring(e).decode())'`
sed "38i\ ${mvnDeps}" -i pom.xml
echo 'object Main{@JvmStatic fun main(vararg a:String){System.setProperty("sun.java2d.opengl","True"); me.nanjingchj.desmos.Window()} }'>`find -type d -name kotlin|head -n1`/Main.kt


然后 mvn package exec:java -Dexec.mainClass=Main 即可
感觉 maven 依赖这么多插件 archetype, install, exec 完成日常任务,有点不平衡吧……
此外还看到了生成本地文件依赖的 Maven #doc https://stackoverflow.com/questions/6704813/maven-generating-pom-file mvn install:install-file

#parser https://github.com/mariuszgromada/MathParser.org-mXparser 我草这玩意又不支持逆向计算,有啥好吹的
还夸张地弄了那么多图,太那啥了
http://scalarmath.org/wp-content/uploads/2019/01/scalar-promo-screens.png 弄个心型函数还要用户自己推导正向公式, 就凭这? 一个 evaluator 和 Python, JS eval 之类的东西有什么区别
不愧是 Java EE 搞出来的混乱怪物,就喜欢一些毫无意义的老套封装