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

技术相干订阅~
另外有 throws 闲杂频道 @dsuset
转载频道 @dsusep
极小可能会有批评zf的消息 如有不适可退出
suse小站(面向运气编程): https://WOJS.org/#/
Download Telegram
#blog 大佬,都上四川大学了
老李是个有故事的人...
对事故表示同情,很少见到会出现这样的事故
This media is not supported in your browser
VIEW IN TELEGRAM
http://bbs.covariant.cn/

还有那个一直无人问津的论坛...
计算机社嘛,还有整个计算机工程这一群人
尤其是还在义务教育阶段以及上高中的
水平自然难以变得怎么样 无奈吧...
那为什么说我是“逆流而上“呢?

很明显,在大家都疯了一般在学校里参加各种模拟测试时,我回家自学;在大家都去网吧,打游戏,谈恋爱,追电视剧时,我在写程序;大家都在参加各种比赛拿证的时候,我在社团泡着写程序;大家都在使用成熟框架写程序时,我不厌烦的去尝试自己实现基础功能。我看起来是最傻,最Low的那个臭屌丝,整天沉迷于好像没什么用的程序里,最后却比大多数嘲笑我的人跳的更高。

那为什么逆流的人很少能攀的更高呢?

逆流是一个非常危险的行为,如果把控不好方向很容易走歪。都听说过“博观而约取,厚积而薄发“,却很少有人懂得其本质。现在的人都太浮躁,被大量的毒鸡汤洗脑,希望能一夜成名。尤其是我们的同龄人和后辈,被现在一些不良之风带坏,梦想通过当网红打电竞一夜暴富,过上衣食无忧的生活;或者希望几年,几个月,甚至几周就精通一门专业技术,快速实现自己不切实际的梦想。无论是什么事,没有厚积,哪来的薄发!如果怀揣梦想,一定要脚踏实地的一步一个脚印去实现它,戒骄戒躁,才能有机会去实现它。

最后,任何一个人的成长道路都不是完全相同的,一定要结合自己的实际情况,选择适合自己的道路,并坚定的走下去。我相信任何人都能够逆流而上,活出自己的精彩。
#life #recommended #blog

"谨以此文,纪念我18年的成长历程,送给我的学生,我的学弟学妹,我的后辈以及我自己,希望能够给更多的人启发而走出自己的道路。"

来源请求?
另外 duangsuse 之前默写了一些语言名称 #PL #life

Lua C C++ C# Objective-C F# VisualC VisualBasic Basic JavaScript ActionScript Ruby Python Matlab Wolfram Octave Julia Java Kotlin Scala Clojure VHDL Prolog Algor96 Fortran Go
Perl Rust Swift Ada SmallTalk Logo Turtle Crystal Elvish EmacsLisp CommonLisp ChezScheme Racket Haskell Erlang Elixir Idris Dart COBOL Red
Tcl TypeScript RubyMotion Agda PHP REBOL Pascal Coq D OCaml ML Vala Squirrel GDScript
在期待什么 Lua 5.3 特性呢?
Forwarded from 羽毛的小白板
哪天 LuaJIT 能支持 Lua 5.3 呢
Forwarded from duangsuse Throws
; MoudleID = 'autumn.ll' 中秋节快乐!
source_filename = "autumn.ll"

@autumn = private constant [10 x i8] c"中秋节\00"
@happy = private constant [11 x i8] c"快乐!\0a\00"

; Function Attrs: noinline nounwind optnone
define i32 @main(i32 %argc, i8** %argv) #0 {
call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @autumn, i32 0, i32 0))
call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @happy, i32 0, i32 0))

call void @exit(i32 0)
unreachable
}

attributes #0 = { noinline nounwind optnone uwtable }
attributes #1 = { noreturn }

declare i32 @printf(i8*, ...)

; Function Attrs: noreturn
declare void @exit(i32) #1


🙈 假装把这个当成自己的中秋节祝福
中秋节快乐哦,阖家团圆,幸福美满 🌕🍰
#bash #recommended 233333 #haha #tech
https://github.com/benrady/shinatra/blob/master/shinatra.sh

#!/usr/bin/env bash
RESPONSE="HTTP/1.1 200 OK\r\nConnection: keep-alive\r\n\r\n${2:-"OK"}\r\n"
while { echo -en "$RESPONSE"; } | nc -l "${1:-8080}"; do
echo "================================================"
done
Forwarded from 神奇的笔记 (EdenChen)
对不起,gpu,你限制了我99%的游戏体验。
duangsuse 买的 《Lua 设计与实现》还是 5.1 时代,之前也没听说过,大概是和 ES6 的修改一样吧,同样位长现在允许 number 和 double 同时使用
不用怕损失精度、溢出什么的了 #lua #PL
Androlua+ 虽然 port 了个 Lua5.3 的过去,但是实际上很多特性没有专门介绍(反正讲了很多人也懒得学),包括 number 细化区分

https://www.lua.org/manual/5.3/manual.html#2

There are eight basic types in Lua: nil, boolean, number, string, function, userdata, thread, and table.

The type nil has one single value, nil, whose main property is to be different from any other value; it usually represents the absence of a useful value.
The type boolean has two values, false and true. Both nil and false make a condition false; any other value makes it true.
The type number represents both integer numbers and real (floating-point) numbers.
The type string represents immutable sequences of bytes. Lua is 8-bit clean: strings can contain any 8-bit value, including embedded zeros ('\0'). Lua is also encoding-agnostic; it makes no assumptions about the contents of a string.

The type number uses two internal representations, or two subtypes, one called integer and the other called float.

Lua has explicit rules about when each representation is used, but it also converts between them automatically as needed (see §3.4.3).
Therefore, the programmer may choose to mostly ignore the difference between integers and floats or to assume complete control over the representation of each number.

Standard Lua uses 64-bit integers and double-precision (64-bit) floats, but you can also compile Lua so that it uses 32-bit integers and/or single-precision (32-bit) floats. The option with 32 bits for both integers and floats is particularly attractive for small machines and embedded systems. (See macro LUA_32BITS in file luaconf.h.)
Forwarded from 羽毛的小白板
像 integer 这样的
此外,Lua 5.3 还加入了位运算特性,也是一个值得注意的部分(貌似 5.2 就有)

Lua 作为嵌入式辅助语言是非常缺少高性能实现啊... 😶
This media is not supported in your browser
VIEW IN TELEGRAM
DHTML 美好生活 #web #dev
(TODO List

1. chinese.h
2. 整理 GitApk.popf.rip
3. Gekyll
4. 写一些科普什么的
5. RebaseServer
#javascript #blog (虽然很简单)算法整理

https://blog.lwl12.com/read/ife-s-task01.html "IFE 2015 Summer Game Qihang TASK01"

Math.ceil(Math.random() * 3)

虽然只是很简单的表达式,我推敲了一会,主要是考虑概率平不平均,实际上很平均(主要是我数学不好 233

Math.random 会返回一个小数,介于 0 到 1 之间
三倍之后,0.1 0.2 0.3 (下的)会舍为 1 ( 0.9 最高
0.4 0.5 0.6 会舍为 2 ( 1.8 最高
0.7 0.8 0.9 会舍为 3 ( 2.7 最高

然后就是

function randomPos() {
return Math.ceil(Math.random() * 3);
}

function judge(userPos, botPos) {
if (userPos == botPos) return 0;

// 1: 石头 2: 剪刀 3: 布
if (userPos == 3 && botPos == 1) return -1;
if (botPos == 1 && userPos == 3) return 1;

if (userPos > botPos) return -1;

return 1; // bot wins
}


btw: JavaScript 没 goto 语法啊...
不知道能不能再搞个什么特别的加速啥的(billion 级的数据 23333 XD
JavaScript Number 数值一大就要溢出(划掉)损失精度,气死

还有我的 NodeJS v8 上居然没有 Integer 类,这是为何,而且 "use strict" 了尾递归优化也不能生效...