h*h 发帖数: 27852 | 1 绝大多数人不懂他的语言scheme
发信人: hci (海螺子), 信区: Programming
标 题: 王垠的40行代码是干嘛的
发信站: BBS 未名空间站 (Thu May 19 15:26:35 2016, 美东)
https://github.com/yinwang0/lightsabers/blob/
6a66c294d4c4217efebfdeae18ee4697d802f79e/cps.ss
他那段代码的功能,是自动把正常风格的代码转换成CPS风格(Continuation-passing
style)的代码,所以叫CPS transformer。
CPS是啥? 就是一种编程风格,每个函数结尾,不是直接返回结果,而是调用并把结果
传给一个“下一步”函数。当然这个“下一步”函数,也是从外面传进来的,所以CPS
风格的函数要比正常风格的要多一个参数。
CPS有啥用?很多编译器需要。代码转成CPS之后,很多事机器更容易干。
比如说,你想发明一个高大上的能自动作贝叶斯推理的编程语言,就是现在前沿的所谓
叫probablistic programming language的... 阅读全帖 |
|
c*********e 发帖数: 16335 | 2 这要定义什么是牛,是写multi-threading的高手,还是写node.js async的高手,还是
写javascript的高手,还是写jquery的高手,还是写angularjs的高手,还是写java se
的高手,还是写j2ee的高手,还是c#的高手,还是php高手,还是python高手。 |
|
|
Z**********g 发帖数: 14173 | 4 【 以下文字转载自 Returnee 讨论区 】
发信人: aben (小奔), 信区: Returnee
标 题: 我共警察痛殴侏儒残疾人 (转载)
发信站: BBS 未名空间站 (Tue Mar 21 22:36:04 2017, 美东)
发信人: aben (小奔), 信区: Military
标 题: 我共警察痛殴侏儒残疾人
发信站: BBS 未名空间站 (Tue Mar 21 22:31:32 2017, 美东)
把街头讨生活的侏儒打的满地打滚嗷嗷叫
https://twitter.com/zhakunchi1984/status/844059161449000960
|
|
|
|
B*D 发帖数: 5016 | 7 音质从acquisition format的角度来说,基本可以按照下述来排名
15 ips Tape (模拟)
DXD( basically 384/24 PCM)
DSD 128fs or 176.4/24bit PCM (release as HRx by RR)
or 192/24 PCM (release on bluray)
DSD 64fs(released on SACD) or 96/24 PCM (release on DVD-A)
44/16bit PCM (release on CD)
NAND/PC+USB-SPDIF是播放方案的一种,CD/SACD/Bluray是发行格式
如果你是比较PC+USB-SPDIF+DAC和CD+DAC这两个不同的方案在播放同一种
acquisition format的情况下的音质优劣,在DAC相同的情况下
我认为PC+Async USB作为讯号源没有劣于CD转盘的理论基础
主观上来说,从业界的趋势来看。也不支持转盘作为讯号源
Merging作为顶尖的专业录音软件设备提供商,他们也在开发PC平台+他们可以播放DXD
母带的声卡作... 阅读全帖 |
|
|
m***s 发帖数: 215 | 9 I stumble at Oppo site, it seems that the upcoming 105 will have Async USB
input and two Sabre 32bit DACs according to review. If the price is right,
this may be an alternate if listen to speakers mainly. |
|
y**i 发帖数: 357 | 10 - 比如new king of DAC chip是ESS公司的Sabre 9018 (基于前几年从Canada买来的一个startup作的东西), 32bit,内部sampling rate380kHz
用它的新DAC很多,Weiss, Wyred4Sound, Anedio, Resonessence Labs Invicta DAC
- 还有就是NAD的Direct Digital技术,时钟108MHz,sampling rate of 844kHz,35-bit architecture。
- 还有就是 Async USB,大大降低jitter。 比光纤,同轴的jitter要低。
- Digital preamp。 绕过preamp,用DAC直接驱动Power amp。让声音更transparent, low colorization.
里? |
|
y**i 发帖数: 357 | 11
well,不能ignore the fact很多公司用ESS Sabre 9018做DAC,得到的review很好。
sacd和cd是不同的format。要还原好CD很难。
http://thewelltemperedcomputer.com/Intro/SQ/USB_SPDIF.htm
Async USB: In asynchronous mode the DAC tells the PC how many data to send.
This allows for using a fixed clock at the DAC. allows for a
implementation with a very low intrinsic jitter.
SPDIF: SPDIF is real time, any fluctuation in the clock of the sender
translates into input jitter.
我觉得前级的作用是:1.present correct output impedance 2. present low input
... 阅读全帖 |
|
p*********k 发帖数: 13 | 12 多谢各位回复。看了一下,好的dac确实不需要额外的async usb。
最近又看中了nad c356dac, 不知道各位觉得如何?如果能给推荐个音箱就更感谢了。
还有一个胆机,neuhaus laboratories T1。各方面指标都很好,就是输出只有18wpc。
推落地音箱好像不够啊? |
|
f*******u 发帖数: 76 | 13 我的意思是驱动程序支持哪些系统。好像Async USB Audio的驱动还需要芯片开发商的
支持。当然如果只是标准同步USB Audio什么系统都应该可以支持的。 |
|
|
T******T 发帖数: 3066 | 15 Interviewed in marvel on-site, loved the cafeteria, free and good food.
ASIC/Emulation related position, most of the questions are pretty industry
standard and could include some of the following topics:
ASIC design process, rtl/gate sim topics, STA, timing violation mitigation,
Async/Sync FIFO design basics, Time domain crossing techniques, Divide by
circuits, DSP Matlab modeling, low power design techniques, FPGA emulation
process & limitations. Physical design knowledge, Power integrity, ESD |
|
f*********r 发帖数: 674 | 16 Asic engineer. front end. 本人做低端做得多, 对前端没啥经验. 问了什么是FIFO,
async FIFO和 sync FIFO的区别. 然后又问了verilog, formal verification还有
prime time的问题. tool问得非常具体, 如果没有用过那些option的话很难回答. 马上
就觉得那人不感兴趣了. move on了. |
|
s*******e 发帖数: 27 | 17 Thank you for pointing it out.
Before I made the my previous post, I actually looked up in the Advenced
Programming ... book ( i am self learning Linux now) and I looked at it
again,
it says on page 402,
'If a function is reentrant with respect to multiple threads, we say that it
is thread safe. This doesn't tell us, however, whether the function is
reentrant with repsect to signal handlers, we say that a function that is
safe to be reentered from an asynchronous singal handler is async-signal
s |
|
a****n 发帖数: 1887 | 18 在这个版上混了1年多了,属于典型的骑驴找马型,年初找到的是个很小的trading相关
的公司,薪水不高,但是把H1B办了,今天刚拿到BOA的书面offer,high frequency
trading dev 相关的职位,薪水比较满意,准备跳了
电话面试:1个小时
4个面试官, 主要问工作经验, 多线程,socket,程序优化相关
然后第一次onsite:3个小时
2个VP, 4个AVP
项目相关的问得很多,基本上差不多整个项目实现的细节都问了, 包括多线程模型,
memory pool实现, socket 模型(select和async socket实现), 异步文件读写,
内部使用的数据结构, 和IPC 实现, 跨平台的实现方法(thread, socket, timer,
TLS, fast mutex实现)
coding: 比较简单, 就是c的字符串操作
第二次onsite: 1个小时
1个VP, 1个AVP
C++/template, JAVA, C#,
估算某个building 每个月的电费。。。这个很晕
2个coding: C字符串操作
电话面试 : 半个小时
VP, 就... 阅读全帖 |
|
a****n 发帖数: 1887 | 19 那我搞错了,不过asio 貌似没有封装跨平台的async file io |
|
j*****g 发帖数: 223 | 20 总结一下面试的准备活动,希望有帮助.
==================== AREAS/TOPICS to study/prep/review ====================
复习的东西还挺多的。比不过刚毕业的呀 :), 脑子不好使了,东西也差不多忘光了...
嘿嘿....
• Sorting
o Bubble/select/insertion/counting/qsort/heap/merge/bst
o Time/space complexity analysis
• Caching design
o Replacement policy (LRU, LFU, NRU, etc…)
o Efficiency/complexity/performance
o Distributed cache
o Hashing
• Multi-thread
o Locking/mutex/semaphore/critical sec... 阅读全帖 |
|
j*****g 发帖数: 223 | 21 总结一下面试的准备活动,希望有帮助.
==================== AREAS/TOPICS to study/prep/review ====================
复习的东西还挺多的。比不过刚毕业的呀 :), 脑子不好使了,东西也差不多忘光了...
嘿嘿....
• Sorting
o Bubble/select/insertion/counting/qsort/heap/merge/bst
o Time/space complexity analysis
• Caching design
o Replacement policy (LRU, LFU, NRU, etc…)
o Efficiency/complexity/performance
o Distributed cache
o Hashing
• Multi-thread
o Locking/mutex/semaphore/critical sec... 阅读全帖 |
|
s*****n 发帖数: 5488 | 22 估计C#要看C#专门的,async同步什么的
,够喝一壶的。
java 要看java 专门的。
c++:windows/linux各自一套。
加上operting system concepts上的有关章节看原理。 |
|
j*****u 发帖数: 1133 | 23 可以先看看threading的一些basic的东西,比如
Concepts:process,thread,scheduling, etc
Thread synchronization: locks, events, nonblocking(lock-free) sync, etc
Threading pool, Async programming model
How multi-threading works in server/client, web model?
如果你这些都比较熟就差不多了
网上找找相关内容看一般比看书快 |
|
w**z 发帖数: 8232 | 24 http://www.javaworld.com/community/?q=node/8300&source=IFWNLE_j
As discriminatory as this is going to sound, this one is for the old-timers.
If you started programming after the turn of the milennium, I don’t know
if you’re going to be able to follow the trend of this post—not out of any
serious deficiency on your part, hardly that. But I think this is something
only the old-timers are going to identify with. (And thus, do I alienate
probably 80% of my readership, but so be it.)
Is it me, or is ... 阅读全帖 |
|
f*l 发帖数: 161 | 25 来自主题: JobHunting版 - F的面试经 networking背景,申请的也是相关职位,通过recruiter联系的
两个电面
1) 一个字符串数组,有些字串是Anagrams,输出要求group Anagrams。后来看了下,
发现是leetcode的题。基本就是hash+sort。不过实现hash时图简单没有写collision,
被面试的MM一通扁,立刻重改数据结构定义,好在完成了。估计因为这个原因要求第二
次电面
2) 实现两个长的数字串相乘。较为基本,但是还是有些bug
onsite一共四个
1)编程。给定一个函数,可从文件中读取固定大小;实现函数,根据指定的大小读取
文件。当时忘了一个基本隐含的定义,每次调用读函数,文件buffer指针会移到新的位
置。结果写完后被一通狂扁,赶紧打补丁,于是一堆bug
2)设计。一位经理加上一个旁听。主要问switch infrastructure相关的东西,算是泛
泛而谈。终于回到熟悉的领域,于是长舒一口气,滔滔不绝,不过我的发音他可能只听
懂了一半。总体,在一种轻松的气氛中度过
3)behavior。主要是为什么要离开,为什么要来,旧的有什么好,新的有什么好等等
。闲聊中发现对... 阅读全帖 |
|
r****s 发帖数: 1025 | 26 我老在本版发帖的主要目的就是指点一下找工作的生物wsn和phd dropout们,高深的知
识是没有滴,主要给大家普及一下常识,以免大家在基本的概念问题上像没头苍蝇似的
到处乱转,刚出校门的学生懂个屁,被CS界的装神弄鬼骗子们(比如Thoughtworks,
design pattern之类)哄得团团转,面试的时候一听就是糊涂蛋一个。结果居然有生手
开口就是几十万台服务器,真尼玛涨姿势了。
好吧,我再给你普及一下,async io从来不是什么创新。java nio的performance一直
是讨论的焦点之一。Trusting Lee的guideline是1000个thread以下netty无法和
blocking thread pool比较,1000个thread以上netty才有优势。
话又说回来,这玩意就尼玛做io,有屁用。你用2000个thread去query MySQL,以为能
提高速度?MySQL立马当机给你看。我没见过哪个web server(除了static content
server)有超过1000个thread, 如果超过1000,你该考虑的是你的load bal... 阅读全帖 |
|
g*****g 发帖数: 34805 | 27 到也不是什么应用都要写RDBMS,比如我老以前写过一个应用要扒大量网页,读写数据
库量
小。用基于Netty的Ning Async Httpclient throughtput就比Apache httpclient好得
多。 |
|
l*****t 发帖数: 2019 | 28 读了这个thread很长见识。
老的东西不说了,async io不是很懂。哪个大牛给个普及贴吧。能不能吧Tornado 也评
评。 |
|
g*****g 发帖数: 34805 | 29 Since most apps are IO bound and not computation intensive, the time is
spent on low level async IO calls and these calls can happen concurrently.
Combined with multiple processes you can utility CPU resource well. You may
check an explanation here.
http://bijoor.me/2013/06/09/java-ee-threads-vs-node-js-which-is
events
on |
|
p*****2 发帖数: 21240 | 30
JS这种语言,即使有了CS,跟Java这种大型语言还是根本没有可比性。很难做大,不过
倒是挺好玩的。编程这东西我一直感觉就是打游戏。不同的游戏路数也是不一样的。这
一年学了一个FP,又学了一个Async,对于思路的开阔很有帮助。对于做项目来说,很
难说哪个语言最好,不同的项目可以选用不同的语言,框架来实现。当然总体来说Java
的地位不用大牛你宣传,也是在那里的。我目前来说需要快速开发,所以Node很适合我
。感觉做异步的话,node确实要比其他语言方便很多。当然这一块我Java也没用过,
Ruby的EM用了一下,问题挺多。做异步的话也就不需要考虑多线程了,当然写code就要
很小心,注意了,不能block。 |
|
b***e 发帖数: 1419 | 31 你们用不用async之类的lib来减少nested callback function到层数, 还是直接生写
callback passing? |
|
j********x 发帖数: 2330 | 32 node就凭他纯正的async架构就值得起今天的地位
当然,除了这个也就没别的了;没必要大惊小怪,他能到的了ror python之类脚本语言
的程度完全实至名归 |
|
A*****i 发帖数: 3587 | 33 UI就算了吧,这种东西都不是内功,不如研究一下node的async来的有用
大部分的jquery说白了就是non-block的回调 |
|
s*w 发帖数: 729 | 34 lock_guard 就是 lock 自动释放
lock free 是指 async |
|
i**e 发帖数: 604 | 35 这样啊!那要把async好好看看。。。能请你例举一下C++ multithreading应用里最重
要的几部分么?我看的时候,tutorial总是循序渐进的,推翻前面简单幼稚的思路,很
希望提前知道一下最先进的有哪些~ :)谢谢! |
|
l*n 发帖数: 529 | 36 async一般是指IO non blocking,跟lock free不沾边。
lock free是指通过多用immutable或者atomic compare and swap等来避开lock的使用。 |
|
s*w 发帖数: 729 | 37 我前一阵子刚使劲看过 C++11 里面的 multithreading
对 thread, mutex, lock_guard, condition_variable 比较熟悉, C++11 没
semaphore, 最高深的使用 promise/future, async 来做,还不大会 |
|
p*****2 发帖数: 21240 | 38 从技术上来讲,mobile的火必定会带起node的火热。mobile backend,node有着无与伦
比的巨大优势
而big data则加剧了JVM的统治地位,Java, Scala, Clojure都各显神通。data
scientist 则更加偏爱Clojure。
编程模式则往reactive programming的方向发展。看看coursera的reactive
programming的course,看看storm,看看node,也就是往async, event-driven的方向
发展。Scala和Clojure在这两个方面就会显示出比Java更加强大的优势了。 |
|
g*****g 发帖数: 34805 | 39 Node is single thread, and it's more convenient to write call back in JS.
Java has many libraries that have synchronize or threadlocal structure and
it's hard to be pure async.
In short, it's not the language, but the libraries. |
|
w**z 发帖数: 8232 | 40 我们用mq, 完全是 async, non mission ctitical, latency 不是 issue,只要
reliable 就行。 |
|
A*****i 发帖数: 3587 | 41 callback async chaining closure oop
http https json xml |
|
c******3 发帖数: 296 | 42 S3和oracle差了4小时,不象replica,更象是给第3方用的?
写个service-c吧。service-a把数据写入oracle之后立即(async)call service-c把同
样的数据写入S3。如果service-c fail,service-c就把同样数据从oracle中再读出来
写入S3。
service-b可以退休了。
换成MySQL也一样,如果MySQL to MySQL replica 太慢。service-c写入MySQL。 |
|
l***4 发帖数: 1788 | 43 关于submit后check
应该是async提交到一个queue
计) |
|
f*******t 发帖数: 7549 | 44 fb的php主要是各种business logic。真正解决1b用户scaling问题的核心技术都不在
php里。php有些async callback, generator之类的小trick,写久了什么都学不到。在
独特的语法和后端framework API上的经验无法带去别的公司,从这个意义上讲确实非
常不推荐纯写PHP的组。 |
|
y****y 发帖数: 2 | 45 我们组的老板还蛮有意思的,推荐我们每半年就出去面试一次,见一下世面。的确啊,
面了才知道LeetCode 的重要性,面试之前只做了二十几道,当然啦,找第一份工作那
会儿CC150 还是完完整整写代码写过一轮,C++ Premier的。
个人的背景是工程好学校一般工程专业(不喜欢用牛这个词),两年工作经验。半年前
尝试过Wealthfront 和 braintree,都没有怎么搭理我,通过论坛认识一位热心的朋友
,大概看我背景相符,直接内推到了HM,很是感激,然后就面试了。
初面一小时,是team lead,聊聊背景,兴趣爱好半小时,剩下半小时写程序。早已经
准备好了VS,就写呗。题目很简单,输入三个小数,判断三角形类型。在最好的IDE 的
帮助下,和最好的IM Lync in Web 的帮助下,很快写好了。第三天就安排了下周五
onsite。
onsite四轮,第一轮讨论设计题,设计car pooling,前端没细说,中间件是Web API,
然后Car Pool 要用动态规划等优化方法来设定最短距离,最佳资源搭配,没有写代码
,但写了方程。代码写了简单的class 是怎么设计,其中我... 阅读全帖 |
|
e***i 发帖数: 231 | 46 1. OP是面imbedded职位吗?
2. async dispatch?你提到多CPU多core,难道真的是embedded职位? |
|
e***i 发帖数: 231 | 47 2的话,一边stream那个大文件,一边multithread去async下载
除非你也可以同时multi random access那个远程文件 |
|
L***s 发帖数: 1148 | 48 object models, metaclass, decorators, enhanced generators / coroutines
threading models, GIL, asyncio & alternative async libs like gevent/twisted
writing C/C++ extensions
writing 2/3 compatible Python code
(for web developers) familiar with django, flask, twisted or tornado
implementation of dict, OrderedDict, deque, etc. in CPython & implications
memory management & fragmentation prevention in CPython
PVM internals and optimization, opcodes and AST hacking
alternative implementations like PyPy... 阅读全帖 |
|
b**********5 发帖数: 7881 | 49 那你说怎么让IO不block? 问async http client? thread pool? 多个machine去下
载不同的URL? |
|
x*****0 发帖数: 452 | 50 下面是一道pure storage常出现的面试题:
我面过,电面就是一个api,每次register的时候需要call一个callback,但是在event
被触发之前call的callback都不能成功被call,在event被
触发之后call的都可以,同时之前delay的call也要成功call,让写具体的function如
何实现,之后还实现单线程多线程来着。
第一轮问的是一个api,每次register的时候需要call一个callback,但是在event被触
发之前call的callback都不能成功被call,在event被触发之后call的都可以,同时之
前delay的call也要成功call,让写具体的function如何work。还问了multithreading
的问题。
网友的简单答案:
是even设成一个全局变量每次没触发就入waitqueue么。。。多线程就给加个锁?
exactly, 我就是这么做的,async的queue,加一个全局flag,多线程就是mutex,lock
unlock,期间多线程的时候有些错,他提示改过来了,我多线程比较弱,后来挂了。... 阅读全帖 |
|