duangsuse::Echo
[Supress(unchecked)] fun <K> createBaseViewHolder(view: View): K var temp = getClass(), z = null : Class; while z.isNull and temp.isNull z = getGenericKotlinClass(temp).instance temp = temp.superClass var k: K if z.isNull k = BaseViewHolder(view)…
首先声明:我也?不知道啥是 ViewHolder 模型,我只是想知道这代码大概是做什么的
K 这个 parametric polymorphism (迫真)(其实就是 Java 的泛型实现)参数 大概是 View 的子类?(假)
我只看中间那个循环...
temp 是当前 JavaClass
z 是当前 JavaClass 的 KotlinGenericClass <K>
循环
大概的意思就是 因为我们知道 Java OO 类型系统里顶部的类型就是
而它的超类
所以 temp 不可能为 null(因为在循环开始时它是 thisClass,而循环体里我们只 assign 了它的超类到它,这是遍历超类链)
那么我们问 && 右边的 z 是不是 null 即可判断 while 条件是否成立
也就是说 只要方法局部符号 z 为 null,就不断循环超类链条 ,直到 z(temp.genericKlassInstance)不为空
不过有可能死循环呢... 因为 Object::class 的超类是 Object::class?
#algor btw. 我花了一点时间来讲这个完全没有用的东西... 是很简单的算法,只是因为在准备些什么?(
是学习如何分析代码(迫真)(删除)
K 这个 parametric polymorphism (迫真)(其实就是 Java 的泛型实现)参数 大概是 View 的子类?(假)
我只看中间那个循环...
temp 是当前 JavaClass
z 是当前 JavaClass 的 KotlinGenericClass <K>
循环
temp = thisClass, z = null
while (both z and temp is null)
z = temp.genericKlassInstance
temp >= superClass
大概的意思就是 因为我们知道 Java OO 类型系统里顶部的类型就是
java.lang.Object
而它的超类
Object.getClass().getSuperclass()
是它本身(Object)所以 temp 不可能为 null(因为在循环开始时它是 thisClass,而循环体里我们只 assign 了它的超类到它,这是遍历超类链)
那么我们问 && 右边的 z 是不是 null 即可判断 while 条件是否成立
也就是说 只要方法局部符号 z 为 null,就不断循环超类链条 ,直到 z(temp.genericKlassInstance)不为空
不过有可能死循环呢... 因为 Object::class 的超类是 Object::class?
#algor btw. 我花了一点时间来讲这个完全没有用的东西... 是很简单的算法,只是因为在准备些什么?(
是学习如何分析代码(迫真)(删除)
duangsuse::Echo
... 说实话,看看公开课的 timeline tags 我觉得里面的内容 《算法图解》 这本如此简单的书里几乎都覆盖了... 这就是大学生们的课程...
#cs #algorithm #algor #share #scarper
还是有问题... 算了,上静态下载好的
(Nokogiri 貌似的一个 bug ? 导致使用本地文件时编码指定参数无效)
[DuangSUSE@duangsuse]~% nokogiri -EGBK https://open.163.com/movie/2010/12/7/S/M6UTT5U0I_M6V2TTJ7S.html
Your document is stored in @doc...
... 人家是动态 JS 生成的,好吧... 不对啊,Nokogiri 有问题...还是有问题... 算了,上静态下载好的
kate ~/下载/scarper/麻省理工学院公开课:算法导论_跳跃表_网易公开课.html
(这里有 encconv 工具可以转换编码,但是上次使用导致了不知缘由的死机,现用 Kate 转换到 UTF-8)(Nokogiri 貌似的一个 bug ? 导致使用本地文件时编码指定参数无效)
nokogiri 下载/scarper/麻省理工学院公开课:算法导论_跳跃表_网易公开课.html
list = @doc.at_xpath("/html/body/div[6]/div/div[3]/div")
videos = list.children[1..45]
lessons = videos.find_all { |it| it.is_a? Nokogiri::XML::Element }
class Lesson
def initialize(element)
@label = parseLabel(element)
@name = parseName(element)
@desc = parseDesc(element)
end
def self.parseLine(tag, second)
tag.children.find { |it| it.name == 'p' }.children.find { |it| it.name == second }.children.first
end
def parseLabel(tag)
self.class.parseLine(tag, 'span')
end
def parseName(tag)
self.class.parseLine(tag, 'a')
end
def parseDesc(tag)
tag.children.find_all { |it| it.name == 'p' }.last.children.first
end
def to_s
"#{@label} #{@name}\n\t#{@desc}"
end
attr_accessor :name, :label, :desc
end
#py https://www.hillelwayne.com/post/python-abc/ 3.10 利用 isinstance hook 新增 match case: 🌚👍
#cpp #algor https://www.zhihu.com/question/365763395/answer/971009059 大整数str 和各种风格元编程 ,最后才是 (1~20)去叠「*」 的函数式
#fp GitHub 的 The ReadME Project 从大众角度来看函数式编程了
https://github.com/readme/featured/functional-programming
https://www.peterkrautzberger.org/0217/
#web mathjax 用 HTML/CSS 实现《算法》伪代码排印版式🤔
https://wiredjs.com/ 罚抄字体滤镜
#cpp #algor https://www.zhihu.com/question/365763395/answer/971009059 大整数str 和各种风格元编程 ,最后才是 (1~20)去叠「*」 的函数式
#fp GitHub 的 The ReadME Project 从大众角度来看函数式编程了
https://github.com/readme/featured/functional-programming
https://www.peterkrautzberger.org/0217/
#web mathjax 用 HTML/CSS 实现《算法》伪代码排印版式🤔
https://wiredjs.com/ 罚抄字体滤镜
Hillel Wayne
Crimes with Python's Pattern Matching
Let's make the CPython team regret adding pattern matching to Python!
#web #tool 笔记本 https://xwmx.github.io/nb/
https://ia.net/presenter .md=>.ppt
#js https://tttttt.me/swiminthedream/1256 无界面的社交网络🌚🌝
#dontknow css 可以在浏览器里即时编辑🌚: style[ContentEditable]{display:block}
所以H5是未来的技术(
#algor #py #dalao http://whatbeg.com/2016/11/16/godtianpinyin.html 自己写谷歌拼音?
#hard #sql #rust https://zhuanlan.zhihu.com/p/596119553 图论优化器
https://ia.net/presenter .md=>.ppt
#js https://tttttt.me/swiminthedream/1256 无界面的社交网络🌚🌝
#dontknow css 可以在浏览器里即时编辑🌚: style[ContentEditable]{display:block}
所以H5是未来的技术(
#algor #py #dalao http://whatbeg.com/2016/11/16/godtianpinyin.html 自己写谷歌拼音?
#hard #sql #rust https://zhuanlan.zhihu.com/p/596119553 图论优化器
duangsuse::Echo
#ai #bing 已经能帮助我准确实现有趣的算法: 👍 这是对int[] u 进行ascii85解码到s的代码: i=5,K=85,s=[]; a=0; u.forEach(di=>a=a*K+di); for(;i-->0;a=a>>8)s.unshift(a&0xFF) 用我发给你的代码 展示这些步骤 请帮我检查你的代码是否有错误。
感谢 #Bing 同学的帮助, base{64,32,85,16} 的编解码支持 #algor 达成
b85 的编码无法靠二进制移位、无需'='pads 解码需填'u';b32 的pads 需要小数计算
z85 和 base85 在 ZeroMQ,PDF,git-diff 里有用
base16就是 hex editor
base58用于btc和区块链IPFS
base32很冷门但不做不好..
base256 用于emoji
https://github.com/multiformats/multibase#multibase-table
比旧版 https://tttttt.me/dsuse/18158
支持了85和尾随'='
b85 的编码无法靠二进制移位、无需'='pads 解码需填'u';b32 的pads 需要小数计算
z85 和 base85 在 ZeroMQ,PDF,git-diff 里有用
base16就是 hex editor
base58用于btc和区块链IPFS
base32很冷门但不做不好..
base256 用于emoji
https://github.com/multiformats/multibase#multibase-table
比旧版 https://tttttt.me/dsuse/18158
支持了85和尾随'='
https://tttttt.me/rynif/30026 #science vs. #tech 🌚🤔
按这个来说, 我也是离开 #cs #plt 计算机科学 加入了 #algor #sp #ce #cg #web 等具体应用,用 #py #js 去解读许多概念
并且回看之前的知识术语,也没有感觉什么不同👌 。主要是以所见即所得为重 ,体系性可以另起炉灶 从实践中来
按这个来说, 我也是离开 #cs #plt 计算机科学 加入了 #algor #sp #ce #cg #web 等具体应用,用 #py #js 去解读许多概念
并且回看之前的知识术语,也没有感觉什么不同👌 。主要是以所见即所得为重 ,体系性可以另起炉灶 从实践中来
Telegram
&'a ::rynco::UntitledChannel
【Science:#AI竞赛学术界输了#】
AI领域,重心已从学术界转移到了产业界,并且失衡还在继续。
Science在最新一期正刊上发了一篇文章,整理了近几年AI领域的相关数据,结果也是一目了然:
AI竞赛,学术界输了。
Science统计了论文、AI最大模型以及SOTA模型在各个领域的占比。
从2016年开始,产业界在领先的人工智能会议上发论文的占比开启了野蛮生长的趋势。
4年时间,在论文数量上,产业界几乎从学术界“夺取”了20%。
AI领域的10大模型,2013年之前还都是学术界居于主导地位。…
AI领域,重心已从学术界转移到了产业界,并且失衡还在继续。
Science在最新一期正刊上发了一篇文章,整理了近几年AI领域的相关数据,结果也是一目了然:
AI竞赛,学术界输了。
Science统计了论文、AI最大模型以及SOTA模型在各个领域的占比。
从2016年开始,产业界在领先的人工智能会议上发论文的占比开启了野蛮生长的趋势。
4年时间,在论文数量上,产业界几乎从学术界“夺取”了20%。
AI领域的10大模型,2013年之前还都是学术界居于主导地位。…
#algor #rust #bin The Smallest Hash Table (Score: 150+ in 13 hours)
fn phf_shift(x: u32) -> u8
可用于HashMap
Link: https://readhacker.news/s/5zwK4
Comments: https://readhacker.news/c/5zwK4
fn phf_shift(x: u32) -> u8
可用于HashMap
Link: https://readhacker.news/s/5zwK4
Comments: https://readhacker.news/c/5zwK4