由买买提看人间百态

topics

全部话题 - 话题: nils
1 2 3 4 5 6 7 8 下页 末页 (共8页)
t*****g
发帖数: 5282
1
【 以下文字转载自 Military 讨论区 】
发信人: tracing (闷声发大财), 信区: Military
标 题: 【包子】这些缩写是哪几个城市 CHC EVG INS GOP CHB NIL
发信站: BBS 未名空间站 (Thu Jun 12 23:34:42 2014, 美东)
CHC EVG INS GOP CHB NIL ORD MEP
谢谢
K*****2
发帖数: 9308
2
CHC: Christchurch, NZ
EVG: Sveg, Sweden
INS: Creech Air Force Base, Indian Springs, Af Aux,Nevada
GOP: Gorakhpur, India
CNB: Chilas, Pakistan
NIL: Kitzebur Airport,Luxembourg? IATA code 没有 NIL
ORD: Chicago
MEP: Mersing, Malaysia
t*****g
发帖数: 5282
3
CHC EVG INS GOP CHB NIL ORD MEP
谢谢
c*****r
发帖数: 8227
4
来自主题: Stock版 - "Chance of QE3 is Nil"
Dallas Federal Reserve President Richard Fisher on Wednesday described the
potential for a new round of stimulus from the central bank a “Wall Street
fantasy,” adding the chances of it happening are almost nil.
There won’t be a new round of Fed stimulus “unless there is some extreme
crisis that none of us can presently foresee,” he said, speaking to
reporters after a speech to a manufacturing group here.
“In my view, it’s not going to happen,” he said. “It’s a fantasy. Wall
Street keeps dangling... 阅读全帖
m*********0
发帖数: 88
5
A University of Minnesota employee committed suicide in Nils Hasselmo Hall
on Monday morning, University police said.
University police Deputy Chief Chuck Miner said the 37-year-old man was a
part-time University employee. The man jumped from the building's upper
level and landed on the concrete floor of the building's atrium, Miner said.
University staffers and others on the scene unsuccessfully tried to help the
man, Miner said. Miner said counseling services were brought in for those
who wit... 阅读全帖
R*******e
发帖数: 25533
6
来自主题: _LoTaYu版 - Nils Holgersson
Générique Le merveilleux voyage de Nils Holgersson
http://www.youtube.com/watch?v=EGQ-8l-Fuug
t****a
发帖数: 1212
7
iterative solution:
函数is-symmetric-level评估每一层的value,检查是否是symmetric的。
函数bfs-step执行一步breath first search,返回下一层所有节点,包括nil在内
函数is-symmetric-iterative?迭代bfs-step直到某层所有节点为nil。之后从上到下检
查每一层。
(defn is-symmetric-level? [trees]
(let [values (map #(if (nil? %)
nil
(let [[l v r] %] v)) trees)]
(= values (reverse values))))
(defn bfs-step [trees]
(let [subtrees (mapcat #(if (nil? %)
[nil nil]
(let [[l... 阅读全帖
c******o
发帖数: 1277
8
来自主题: Programming版 - 这次Scala没有入选有点意外呀
我写的和它类似,不过是没 implement eq/Ord
sealed trait List[+A]
case object Nil extends List[Nothing]
case class Cons[+A] (head: A, tail: List[A]) extends List[A]
object List {
def apply[A](as: A*): List[A] =
if (as.isEmpty) Nil
else Cons(as.head, apply(as.tail: _*))
private def asString_internal[A](l: List[A]): String =
l match {
case Nil => ""
case Cons(head,tail) => head.toString + " " + asString_internal(tail)
}
def toString[A](l: List[A]): String =
"[ " + asString_... 阅读全帖
t****a
发帖数: 1212
9
这题为什么大家不用递归呢,会很漂亮的啊。
(defn is-symmetric?
([[lft value rgt]]
(is-symmetric? lft rgt))
([lft rgt]
(cond (and (nil? lft) (nil? rgt)) true
(or (nil? lft) (nil? rgt)) false
:else (let [[l1 v1 r1] lft
[l2 v2 r2] rgt]
(and (== v1 v2) (is-symmetric? l1 r2) (is-symmetric? l2
r1))))))
(is-symmetric? [[[nil 3 nil] 2 [nil 4 nil]] 1 [[nil 4 nil] 2 [nil 3 nil]]])
; true
(is-symmetric? [[nil 2 [nil 3 nil]] 1 [nil 2 [nil 3 nil]]]) ; f... 阅读全帖
d****n
发帖数: 1637
10
来自主题: Programming版 - go 的坑(转载)
献给gopher们,俺还没踩到,不过惊出一身冷汗。希望对其他gopher有用
http://studygolang.com/articles/5188
坑(s)
每种编程语言都有自己的专属坑(s),Go虽出身名门,但毕竟年轻,坑也不少,在error
处理这块也可以列出几个。
1、 Go FAQ:Why is my nil error value not equal to nil?
type MyError string
func (e *MyError) Error() string {
return string(*e)
}
var ErrBad = MyError("ErrBad")
func bad() bool {
return false
}
func returnsError() error {
var p *MyError = nil
if bad() {
p = &ErrBad
}
return p // Will always return a non-nil error.
}
func main() {... 阅读全帖
d**********o
发帖数: 1321
11
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
我与Emacs的不解情缘(9)
差不多去年暑假后回学期也学会了自己写macro,贴个前段时间做题时写过的写lc的模
板吧:M-x lc ENT :
(fset 'lc
[?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?i ?o ?s ?t ?r ?e ?a ?m ?> return ?# ?i ?n
?c ?l ?u ?d ?e ? ?< ?v ?e ?c ?t ?o ?r ?> return ?# ?i ?n ?c ?l ?u ?d ?e ?
?< ?a ?l ?g ?o ?r ?i ?t ?h ?m ?> return ?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?c ?s
?t ?r ?i ?n ?g ?> return ?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?c ?m ?a ?t ?h ?>
return ?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?s ?t ?a ?c ?k ?> return ?# ?i ?n ?c ?l
?u ?d ?e ? ?< ?q ?u ?e ?u ?e ?> retur... 阅读全帖
d**********o
发帖数: 1321
12
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
我与Emacs的不解情缘(9)
差不多去年暑假后回学期也学会了自己写macro,贴个前段时间做题时写过的写lc的模
板吧:M-x lc ENT :
(fset 'lc
[?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?i ?o ?s ?t ?r ?e ?a ?m ?> return ?# ?i ?n
?c ?l ?u ?d ?e ? ?< ?v ?e ?c ?t ?o ?r ?> return ?# ?i ?n ?c ?l ?u ?d ?e ?
?< ?a ?l ?g ?o ?r ?i ?t ?h ?m ?> return ?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?c ?s
?t ?r ?i ?n ?g ?> return ?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?c ?m ?a ?t ?h ?>
return ?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?s ?t ?a ?c ?k ?> return ?# ?i ?n ?c ?l
?u ?d ?e ? ?< ?q ?u ?e ?u ?e ?> retur... 阅读全帖
c*****t
发帖数: 1879
13
来自主题: Programming版 - 两个我永远都不想碰的语言
最近无聊,稍微研究了下两个语言,彻底被雷了。
第一是 R 。可以说是世界上最 fucked up 的语言之一(COBOL 是另外一个)。
你看一下这篇文章就明白了:
https://xianblog.wordpress.com/2010/09/13/simply-start-over-and-build-
something-better/
如果你非要写 R 代码。建议你把所有的 variable 都弄个 prefix 。免得你
不小心碰到这种麻烦事。
第二就是 Go 。整个一傻逼语言。
1) 如果该语言有 pointer,但是其速度比 Java 还慢点,谁 TMD 有病才用它。
再不用说,Go 里面需要知道很多很多 low level 的东西,但是搞了半天比 Java
还慢?!!
2) Stupid copies 。好吧,你有 pointer 不用,非得 pass by value (i.e.
struct copy),真是脑袋抽筋了。copy 大部分情况下比 reference 慢。
reference 是可以放在 register 里的,而 struct 一旦比 register... 阅读全帖
c*****t
发帖数: 1879
14
来自主题: Programming版 - 珍惜生命,远离 R 和 Go
最近无聊,稍微研究了下两个语言,彻底被惊呆了。
第一是 R 。可以说是世界上最 fucked up 的语言之一(COBOL 是另外一个)。
你看一下这篇文章就明白了:
https://xianblog.wordpress.com/2010/09/13/simply-start-over-and-build-
something-
better/
第二就是 Go 。整个一傻逼语言。
1) 如果该语言有 pointer,但是其速度比 Java 还慢点,谁 TMD 有毛病才用它。
再不用说,Go 里面需要知道很多很多 low level 的东西,但是搞了半天比 Java
还慢?!!
2) Stupid copies 。好吧,你有 pointer 不用,非得 pass by value (i.e.
struct copy),真是脑袋抽筋了。copy 大部分情况下比 reference 慢。
reference 是可以放在 register 里的,而 struct 一旦比 register 大,
就会占内存。然后 Go idiots 说 cache 很 precious,那你还搞那么多 copy... 阅读全帖
Z**********4
发帖数: 528
15
因为做leetcode上面isBalancedTree那题想到的。
本来就打算用Crackcode上面的解法去做
bool isBalancedTree(TreeNode* root){
if(!root) return true;
return (getMaxDepth(root) - getMinDepth(root)) < 2;
}
int getMaxDepth(TreeNode* root){
if(!root)return 0;
return std::max(getMaxDepth(root->left), getMaxDepth(root->right)) + 1;
}
int getMinDepth(TreeNode* root){
if(!root)return 0;
return std::min(getMinDepth(root->left), getMinDepth(root->right)) + 1;
}
可是发现有些case通不过。
比如
1
2 ... 阅读全帖
d******e
发帖数: 2265
16
来自主题: Programming版 - 感觉python的前途堪忧 (转载)
转帖:
克里斯可以说是天才少年和好学生的代名词,他在2000年本科毕业之后,继续攻读计算
机硕士和博士。但克里斯并不是宅男,学习之余他手捧「龙书」游历世界,成为德智体
美劳全面发展的好学生。之后就是一篇又一篇的发表论文,硕士毕业论文即提出了一套
完整的运行时编译思想,奠定了 LLVM 的发展基础,读博期间 LLVM 编译框架在他的领
导下得到了长足的发展,已经可以基于 GCC 前端编译器的语义分析结果进行编译优化
和代码生成,所以克里斯在2005年毕业的时候已经是业界知名的编译器专家了。
注:很多计算机专业的大学生经常问我在大学里学点什么好,看看克里斯就行了。以目
前的科技信息开放程度,如果你在自己感兴趣的领域里用心耕耘,再加上那么一点点天
分,毕业时成为某一个专有领域的专家应该不是问题。那时就不是你满世界去找工作了
,而是工作满世界来找你!
克里斯毕业的时候正是苹果为了编译器焦头烂额的时候,因为苹果之前的软件产品都依
赖于整条 GCC 编译链,而开源界的这帮大爷并不买苹果的帐,他们不愿意专门为了苹
果公司的要求优化和改进 GCC 代码,所以苹果一怒之下将编译器后端直接替换为 LLVM... 阅读全帖
k***t
发帖数: 769
17
Write a function increasing: int list -> bool that returns true if its
input is a list of integers in increasing order.
Define function addOneToAll(x, L) that takes a value
x and add it to all the elements in L, which is a list of lists.
For example, addOneToAll(1, [nil, [2], [3], [2,3]]) = [[1], [1,2], [1,3], [1
,2,3]].
才开始学编程,这两个怎么写啊?
第二个题,我写了这样的可是不工作:
-fun addOneToAll(a,nil)=nil
|fun addOneToAll(a,[x]::[y]::nil)=(a::[x])::addOneToAll(a,[y]::nil)::nil;
希望大家帮我。
i*****e
发帖数: 113
18
来自主题: JobHunting版 - 求救: 打印binary tree
enqueue root
enqueue '\n'
while queue is not empty
if current node is '\n'
enqueue '\n'
else
enqueue all children of current node
example:
a
b1 b2
c1 c2 nil c3
nil nil nil d1
nil
a \n
a \n b1 b2 \n
a \n b1 b2 \n c1 c 2 c3 \n
a \n b1 b2 \n c1 c 2 c3 \n d1 \n
s******g
发帖数: 755
19
【 以下文字转载自 Apple 讨论区 】
发信人: faucetQ (fq), 信区: Apple
标 题: [Mac Dev]整了个ObjectiveC的笔记,看看气氛对得上不
发信站: BBS 未名空间站 (Mon Feb 2 21:38:18 2009), 转信
整了个类似ObjectiveC学习笔记的东西,发上来大伙看看有兴趣不。
修改了一点,增加了NSAutoreleasePool的内容。
增加了NSString内容。
===========俺系分隔线==================
本文假设读者有基本的C编程能力,如果有C++或者Java的背景会更容易理解但是不是必须。
ObjectiveC基本语法
消息
在objectiveC中,向一个对象发送一个消息的语法为
[ obj method:parameter];
类似的功能在C++中写作
obj->method(parameter);
在java中写作
obj.method(parameter);
在smalltalk中写作
obj method:parameter
显而易见objectiveC和smalltalk... 阅读全帖
f*****Q
发帖数: 1912
20
整了个类似ObjectiveC学习笔记的东西,发上来大伙看看有兴趣不。
修改了一点,增加了NSAutoreleasePool的内容。
增加了NSString内容。
===========俺系分隔线==================
本文假设读者有基本的C编程能力,如果有C++或者Java的背景会更容易理解但是不是必须。
ObjectiveC基本语法
消息
在objectiveC中,向一个对象发送一个消息的语法为
[ obj method:parameter];
类似的功能在C++中写作
obj->method(parameter);
在java中写作
obj.method(parameter);
在smalltalk中写作
obj method:parameter
显而易见objectiveC和smalltalk的语法基本是相同的。
当有两个或者两个以上的参数时,通常试用以的语法
[ obj method:parameter1 WithSecondParameter:parameter2];
定义一个类的代码放在一个.h文件中,下面是一个例子。
//macdevexample1.h
... 阅读全帖
d****n
发帖数: 1637
21
来自主题: Programming版 - 怎样能把go写的稍微漂亮一点?
结尾没有return, at 9:17AM PCT
package main
import (
"encoding/csv"
"fmt"
"io"
"os"
)
func main() {
if err := readUserCSV("./test.csv", lambda); err != nil {
//do something
}
}
func readUserCSV(file string, lambda func(string, string) error) error {
csvfile, err := os.Open(file)
if err != nil {
return err
}
defer csvfile.Close()
reader := csv.NewReader(csvfile)
for {
record, err := reader.Read()
if err != nil {
... 阅读全帖
o******t
发帖数: 4384
22
☆─────────────────────────────────────☆
purplebasil (紫苏) 于 (Sat May 21 19:22:08 2011, 美东) 提到:
睡了也就睡了,本来不稀奇,问题是那女的跟母猪似的
下班喝酒聊天,男同事的一致看法是:美不美不重要,重要的是那女人available,能
抓来解渴
男同事们还有几句搞笑的评论,分享分享:
我根另一个女同事喋喋不休的说阿诺没有taste, 说他居然为这女人伤害了家人的
feelings。。。
26岁意大利未婚男:Taste? Feelings? He is a terminator! A robot! What taste?
What feelings?
32岁米国已婚男:You can't blame him. He's done his best. (然后他列举了阿诺以
前被若干女人指责性骚扰的事迹)... So he must have tried really hard. Life is
tough! You girls won't understand...
40岁中国已婚男:Men ... 阅读全帖
j***o
发帖数: 2842
23
来自主题: Linux版 - 在windows系统上安装emacs24
我用linux的主要原因是要用latex写文章和slides,emacs具有很多很多软件不具备的
优势,主要是lisp语言的支持,能做很多的智能选择,定义快捷键等,这里就不多说了
linux的主要问题是驱动和一些乱七八糟的问题,还有不能用office系列。如果能安装
emacs在windows上,可以说是一个完美的解决计划。
用下面的方法来安装,就能实现,不建议任何从源码编译的安装方法,太麻烦了。
第一步,安装miktex系统,这个就是latex所需要的所有软件包,很简单,只要等就可
以了,不过,建议你安装完整版本。
第二步,下载emacs系统的binary for windows,地址是
http://ftp.gnu.org/gnu/emacs/windows/
最好安装最新版本:emacs-24.3-bin-i386.zip 是最新版本。解压到c:\program files
\下面,创建一个文件夹emacs-24.3
然后到产生的bin文件夹下运行addpm.exe会在启动文件夹下面安装icon等
第三步,安装gsview和ghostscript,到相应的网站下载安装即可,默认安... 阅读全帖
p********8
发帖数: 2061
24
来自主题: Programming版 - GO 语言里的 defer 思路是什么?
很好用啊
如果不用defer,我们的代码可能需要这样写
res := Open(xxx)
if err := xxx; err != nil {
res.Close()
return
}
if err := yyy; err != nil {
res.Close()
return
}
// not error
res.Close()
不但繁琐,还很容易忘记res.Close()
用了defer,就不用操心res的释放了,如下:
res := Open(xxx)
defer res.Close()
if err := xxx; err != nil {
return
}
if err := yyy; err != nil {
return
}
// not error,no need to call res.Close()
d****n
发帖数: 1637
25
来自主题: Programming版 - 怎样能把go写的稍微漂亮一点?
抛砖引玉
func readUserCSV(file string, lambda func(string, string) error) err error {
csvfile, err := os.Open(file)
if err {
return err
}
defer csvfile.Close()
reader := csv.NewReader(csvfile)
reader.Read()

for {
if err != nil{
if err == io.EOF{
err = nil
}
break
}

record, err := reader.Read()
if err !=nil{
continue
}

... 阅读全帖
f*******t
发帖数: 7549
26
来自主题: Programming版 - go 的坑(转载)
我踩到了第一个坑的变种,实在恶心。
type A struct {}
func foo() *A {
return nil
}
AssertNil(interface{} o) {
if o != nil {
panic()
}
}
AssertNotNil(foo()) 会panic,因为o是(*A)(nil),跟无类型的nil不等
r******t
发帖数: 250
27
来自主题: Programming版 - go 的坑(转载)
其实就是试图写这样的程序
a := nil
如果 nil 可以 polymorphic 那么接下来就有一些困惑的事情
a = &A{...}
a = &B{...}
Go 通过 typed 'nil' 避免了这个问题 但是悄悄发生的
另外发现 Go 还可以避免 a := nil 的问题 很欣慰
j***o
发帖数: 2842
28
【 以下文字转载自 Linux 讨论区 】
发信人: jigao (左季高), 信区: Linux
标 题: 在windows系统上安装emacs24
发信站: BBS 未名空间站 (Sun Apr 21 13:20:33 2013, 美东)
我用linux的主要原因是要用latex写文章和slides,emacs具有很多很多软件不具备的
优势,主要是lisp语言的支持,能做很多的智能选择,定义快捷键等,这里就不多说了
linux的主要问题是驱动和一些乱七八糟的问题,还有不能用office系列。如果能安装
emacs在windows上,可以说是一个完美的解决计划。
用下面的方法来安装,就能实现,不建议任何从源码编译的安装方法,太麻烦了。
第一步,安装miktex系统,这个就是latex所需要的所有软件包,很简单,只要等就可
以了,不过,建议你安装完整版本。
第二步,下载emacs系统的binary for windows,地址是
http://ftp.gnu.org/gnu/emacs/windows/
最好安装最新版本:emacs-24.3-bin-i386.zip 是最新版本。解... 阅读全帖
c*9
发帖数: 3241
29
【 以下文字转载自 Programming 讨论区 】
发信人: peking2 (Lambda), 信区: Programming
标 题: 怎样能把go写的稍微漂亮一点?
发信站: BBS 未名空间站 (Thu Apr 30 11:23:18 2015, 美东)
比如下边这段代码,怎么能好看一点?有什么trick吗?
func readUserCSV(file string, lambda func(string, string) error) error {
csvfile, err := os.Open(file)
if err {
return err
}
defer csvfile.Close()
reader := csv.NewReader(csvfile)
reader.Read()
_for:
for {
record, err := reader.Read()
switch err {
case nil:
if err ... 阅读全帖
T*********s
发帖数: 20444
30
请老色狼挨个回复以下FOCUS的问题,提升用户满意度
发信人: bwzl001 (百尺竿头), 信区: Automobile
标 题: Re: civic VS focus 选哪个?
发信站: BBS 未名空间站 (Tue Oct 6 20:55:11 2015, 美东)
开过12年focus。近三年
别选focus, 越开越松
发信人: lavinder (lavinder), 信区: Automobile
标 题: Re: civic VS focus 选哪个?
发信站: BBS 未名空间站 (Wed Oct 7 09:34:29 2015, 美东)
11年focus owner
没出保险的时候还好,就是电池每年换
一出保险各种毛病
1.发电机坏了,高速上熄火
2.漏油,趴车场里开着就闻到汽油味,吓得我赶紧熄火
3.刹车刹不住,dealer那里花了100多刀的检查费也查不出原因,各种修车铺换各种零
件也不行
最后便宜卖了
发信人: qzcwx (NIL), 信区: Automobile
标 题: Re: 新focus的变速箱修好了吗?
发信站: BBS 未名空间站 ... 阅读全帖
T*********s
发帖数: 20444
31
请老色狼挨个回复以下FOCUS的问题,提升用户满意度
发信人: bwzl001 (百尺竿头), 信区: Automobile
标 题: Re: civic VS focus 选哪个?
发信站: BBS 未名空间站 (Tue Oct 6 20:55:11 2015, 美东)
开过12年focus。近三年
别选focus, 越开越松
发信人: lavinder (lavinder), 信区: Automobile
标 题: Re: civic VS focus 选哪个?
发信站: BBS 未名空间站 (Wed Oct 7 09:34:29 2015, 美东)
11年focus owner
没出保险的时候还好,就是电池每年换
一出保险各种毛病
1.发电机坏了,高速上熄火
2.漏油,趴车场里开着就闻到汽油味,吓得我赶紧熄火
3.刹车刹不住,dealer那里花了100多刀的检查费也查不出原因,各种修车铺换各种零
件也不行
最后便宜卖了
发信人: qzcwx (NIL), 信区: Automobile
标 题: Re: 新focus的变速箱修好了吗?
发信站: BBS 未名空间站 ... 阅读全帖
W*****t
发帖数: 4595
32
我想要的物品:
美联航United AIrlines (UA) GPU国际升舱券
单张面值:
Nil
可接受的价格(必须明码标价!):
$300 each, 1 or 2
物品新旧要求:
Nil
邮寄方式要求:
Nil
买卖双方谁承担邮寄损失(Required if not code only):
卖这个东西的人应该会确认我的行程可否升级 (我的fare class肯定是可以的)
付款方式说明:
Paypal
其他补充说明:
广告的有效期:
until got
物品来源:
希望是你自己的1K账号来的
我的联系方式:
pm
二手交易风险自负!请自行验证是否合法和一手卡!:
l****p
发帖数: 397
33
来自主题: JobHunting版 - G家onsite面经
确实想不出比mlg(N)更快的算法。这题要在30分钟内做完确实很难,我看了楼主的思路
后还用了近50分钟才写完的……
顺便贴上我的实现(Ruby):
def nearest_nodes root, m, key
node = find_insert root, key
prev = node.prev_node
nex = node.next_node
results = []
m.times do
nearest = nil
if prev and nex
if m-prev.value nearest = prev
prev = prev.next_node
else
nearest = nex
nex = nex.next_node
end
elsif prev
nearest = prev
prev = prev.prev_node
elsif nex
nearest ... 阅读全帖
t****a
发帖数: 1212
34
来自主题: JobHunting版 - 一道面试题:三等分数组
我把它当二维DP做了,clojure程序和结果如下
(def divide-3-sub
(memoize
(fn [s1 s2 [x & xs]]
(cond (and (zero? s1) (zero? s2)) ['() '() (cons x xs)]
(or (< s1 0) (< s2 0) (empty? xs)) nil
:else (if-let [d1 (divide-3-sub (- s1 x) s2 xs)]
(assoc d1 0 (cons x (first d1)))
(if-let [d2 (divide-3-sub s1 (- s2 x) xs)]
(assoc d2 1 (cons x (second d2)))
(if-let [d3 (divide-3-sub s1 s2 xs)]
... 阅读全帖
h*******o
发帖数: 8
35
来自主题: JobHunting版 - 小弟求问LinkedIn那道Deep Iterator的题
这题规定必须用stack做么?保存一个sub deepiterator递归也行吧。
小众的ObjC代码:
@interface DeepIterator ()
@property (nonatomic, strong) NSArray *array;
@property (nonatomic, strong) DeepIterator *subInterator;
@property (nonatomic, assign) NSInteger index;
@end
@implementation DeepIterator
- (instancetype)initWithArray:(NSArray *)array
{
self = [super init];
if (self) {
self.array = array;
}
return self;
}
- (BOOL)hasNext
{
if (self.index >= self.array.count) {
return NO;
}
if ... 阅读全帖
g*****t
发帖数: 86
36
hi flowerpie,能请问你一个问题吗, 我也刚刚做完TB-Gold的测试,拿到验血结果了,
是negative, 但是具体的数值有三个,分别是NIL,TB AG-NIL,MITOGEN-NIL, 三个的后边
都有一个 IU/ML的数值, 应该在I693上填哪个? 请问你lp的表上的数值是怎么填的?
谢啦!
w*l
发帖数: 35
37
极少使用,几乎全新,放着没用所以转让。型号EDE419M。300元可商量。Lavender MRT
附近自取。联系站内或手机9169 7506.
Colour: White
Drying Capacity (kg): 5
Placement: Free-standing
Timer Control: Mechanical
Reverse Tumbling Technology: Yes
Cool Tumbling and Low Temperature: Yes
Anti-Crease Function: Nil
Electronic Smart Sensor: Nil
Wall-Mounting Kit: Nil
Net Weight (kg): 28
Power Consumption (W): 2200
Dimension [W x D x H] (mm): 600 x 580 x 850
官网链接:http://www.electrolux.com.sg/node38.aspx?productid=9627
p******s
发帖数: 5200
38
来自主题: Football版 - Chargers hire Colts VP for GM
2-nil against us in Moss' rookie year
3-nil in 2005
2-nil in 2009
b*******s
发帖数: 470
39
呵呵,直接贴出来不太好吧。。
你搜索Nils就肯定能搜到。。。
我正在下一套60年代法国拍的动画片,好像有50多集,5个压缩文件
大概3G多。。。已经拖了两个了--非常慢。。。
还有一个英文名字的影视文件,600多M,不知道是不是英文版的。。
尼而斯骑鹅旅行记的英文名:the wonderful advantures of nils..
法文名:
Le Merveilleux voyage de Nils Holgersson à travers la Suède
b*****l
发帖数: 9499
40
来自主题: Linux版 - emacs gnus smtp 咋整?
gmail 很容易就搞成了,照搬着搞学校的就不成。。。
下面这个是成的:
;; Configure outbound mail (SMTP)
(setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
smtpmail-smtp-server "smtp.gmail.com"
smtpmail-default-smtp-server "smtp.gmail.com"
send-mail-function 'smtpmail-send-it
message-send-mail-function 'smtpmail-send-it
smtpmail-smtp-service 587
smtpmail-auth-credentials '(("smtp.gmail.com" 587 "m*****[email protected]"
nil))
;; smtpmail-debug-info t
;; smtpmail-debug-
d****i
发帖数: 4809
41
来自主题: Programming版 - 这次Scala没有入选有点意外呀
看到Scala的Nil,就想到了肯定来自于Lisp的nil, 说实话还是喜欢C/C++/Java的NULL(
null)。数学上面的术语都是用null的,比如null space, null set, null hypothesis
等等,scala用nil的大概是受了lisp的影响,C系的和其他主流语言都是用NULL。
j********x
发帖数: 2330
42
来自主题: Programming版 - express.js的作者弃node转投go
另外,ret 和 err 同时被定义,而每次只有其中一个不是 nil,这种“或”的关系并
不是靠编译器来保障,而是靠程序员的“约定俗成”。这样当 err 不是 nil 的时候,
ret 其实也可以不是 nil。这些组合带来了挺多的混淆,让你每次看到 return 的地方
都不确信它到底想返回一个错误还是一个有效值。如果你意识到这种“或”关系其实意
味着你只应该用一个返回值来表示它们,你就知道其实 Go 误用了多返回值来表示可能
的错误。
这小孩子一般强词夺理的狡辩实在是让我哭笑不得啊。。。
p*****2
发帖数: 21240
43
来自主题: Programming版 - 怎样能把go写的稍微漂亮一点?
比如下边这段代码,怎么能好看一点?有什么trick吗?
func readUserCSV(file string, lambda func(string, string) error) error {
csvfile, err := os.Open(file)
if err {
return err
}
defer csvfile.Close()
reader := csv.NewReader(csvfile)
reader.Read()
_for:
for {
record, err := reader.Read()
switch err {
case nil:
if err = lambda(record[0], record[1]); err != nil {
return err
}
case io.EOF:
break _for
... 阅读全帖
a***n
发帖数: 623
44
来自主题: Programming版 - 怎样能把go写的稍微漂亮一点?
1 package main
2
3 import (
4 "encoding/csv"
5 "io"
6 "os"
7 )
8
9 func readUserCSV(file string, lambda func(string, string) error) error {
10 csvfile, err := os.Open(file)
11 if err != nil {
12 return err
13 }
14 defer csvfile.Close()
15
16 reader := csv.NewReader(csvfile)
17 reader.Read()
18
19 for {
20 record, err := reader.Read()
21 if err != nil &... 阅读全帖
d****n
发帖数: 1637
45
来自主题: Programming版 - 怎样能把go写的稍微漂亮一点?
I would change lambda function signature to let less and clearer code in
readUserCSV logic; this will keep readUserCSV low maintain
for {
record, err := reader.Read()
if err != nil && err != io.EOF {
return err
}
if err = lambdaWrapper(record,Lambda); err != nil {
return err
}
}
}
func lambdaWrapper(record,Lambda){
if len(record)!=2{
return nil //not a big deal, pass it
}
//there is nothing else can crash before calling lambda
return lambda(record[0], re... 阅读全帖
p*****2
发帖数: 21240
46
来自主题: Programming版 - 为什么大家不喜欢golang的switch?
下边是docker的code。用的是switch,没有像版上几个go大牛说的用if呀。
func netAddrToIP4(a net.Addr) net.IP {
switch v := a.(type) {
case *net.UDPAddr:
if ip := v.IP.To4(); ip != nil {
return ip
}
case *net.IPAddr:
if ip := v.IP.To4(); ip != nil {
return ip
}
}
return nil
}
p*****2
发帖数: 21240
47
来自主题: Programming版 - 为什么大家不喜欢golang的switch?
同样docker的code, break, continue 都用到了。
func (z *Tokenizer) readRawOrRCDATA() {
if z.rawTag == "script" {
z.readScript()
z.textIsRaw = true
z.rawTag = ""
return
}
loop:
for {
c := z.readByte()
if z.err != nil {
break loop
}
if c != '<' {
continue loop
}
c = z.readByte()
if z.err != nil {
break loop
}
if c != '/' {
continue loop
}... 阅读全帖
d****n
发帖数: 1637
48
来自主题: Programming版 - Be $#%!ing explicit
Example
Consider fetching a user id from a cookie. How much language knowledge do
you need to answer the following questions given the implementation?
What happens if the cookie is not present?
What happens if the cookie value is not a well formatted number?
What happens if the cookie value is a negative number?
Scala
import play.api.mvc.RequestHeader
def getUserId()(implicit request: RequestHeader) = {
request.cookies.get("uid").map(_.value.toLong).filter(_ > 0)
}
Go
import (
"fmt"
"http"... 阅读全帖
n******7
发帖数: 12463
49
基本就是试了一堆方法,最后只能password
然后chdir /home/nowhere7/失败
ssh -vvvv [email protected]/* */
OpenSSH_6.7p1 Debian-5, OpenSSL 1.0.1t 3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to ftp.mitbbs.com [8.8.8.8] port 22.
debug1: Connection established.
debug1: identity file /home/nowhere7/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity f... 阅读全帖
1 2 3 4 5 6 7 8 下页 末页 (共8页)