由买买提看人间百态

topics

全部话题 - 话题: def
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
l****p
发帖数: 397
1
来自主题: JobHunting版 - Twitter实习第二轮电面总结
面试官从口音可以听出来是个阿三哥。
一开始先问我的学历,然后问我熟悉哪些编程语言和技术。然后开始写程序。
面试官写了一小段程序:
class A
def foo
puts "hello"
end
end
class B < A
def foo
puts "world"
end
end
s = B.new
s.foo
然后问我这时打印出什么,我说是"world",然后问我说怎么让s打印出"hello",写代
码实现。我心想这问题也太白痴了吧:
s = A.new
s.foo
然后他说s必须是B的对象。我明白了他要让我调用父类方法,但我一时忘了Ruby怎么调
父类方法了,于是绕开,说Ruby允许重新打开了个类去重定义它的方法:
class B < A
def foo
puts "hello"
end
end
然后他又说如果不要重定义呢。这下没招了,于是把最早的B.foo的定义里写了个super
,说我忘了Ruby怎么调父类了,我可以查一下。他说不用了,这就是他所期望了。(面
试后查了一下,Rub... 阅读全帖
l****p
发帖数: 397
2
来自主题: JobHunting版 - Twitter实习第二轮电面总结
面试官从口音可以听出来是个阿三哥。
一开始先问我的学历,然后问我熟悉哪些编程语言和技术。然后开始写程序。
面试官写了一小段程序:
class A
def foo
puts "hello"
end
end
class B < A
def foo
puts "world"
end
end
s = B.new
s.foo
然后问我这时打印出什么,我说是"world",然后问我说怎么让s打印出"hello",写代
码实现。我心想这问题也太白痴了吧:
s = A.new
s.foo
然后他说s必须是B的对象。我明白了他要让我调用父类方法,但我一时忘了Ruby怎么调
父类方法了,于是绕开,说Ruby允许重新打开了个类去重定义它的方法:
class B < A
def foo
puts "hello"
end
end
然后他又说如果不要重定义呢。这下没招了,于是把最早的B.foo的定义里写了个super
,说我忘了Ruby怎么调父类了,我可以查一下。他说不用了,这就是他所期望了。(面
试后查了一下,Rub... 阅读全帖
p*****2
发帖数: 21240
3
来自主题: JobHunting版 - One interview question (A)
代码
size=100
class Element:
def __init__(self,obj,prev):
self.obj=obj
self.prev=prev
self.next=-1

class HashSet:
l=[None]*size
last=-1
def insert(self,obj):
h=hash(obj)%size
if self.l[h]==None:
self.l[h]=Element(obj,self.last)
if self.last!=-1:
self.l[self.last].next=h
self.last=h

def delete(self,obj):
h=hash(obj)%size
if self.l[h]!=None:
pv=self.l[se... 阅读全帖
p*****2
发帖数: 21240
4
写了一个deserialize的
class Element:
def __init__(self,str):
self.str=str
self.l=[]

def add(self,e):
self.l.append(e)

def ifstr(self):
return self.str!=None

input="[Apple,[Orange,Banana,[A,B,C]]"
i=0
def dfs():
global i
e=None
while input[i]==',' or input[i]==' ':
i+=1
if input[i]=='[':
e=Element(None)
i+=1
while input[i]!=']':
e.add(dfs())
else:
j=i+1
while inpu... 阅读全帖
t****a
发帖数: 1212
5
来自主题: JobHunting版 - G电面一题
; quick clojure solution: dp with memoize function.
(use 'clojure.string)
;; define the map
(def alphabet (map #(str (char %)) (range 97 123)))
(def number (map #(str (inc %)) (range 26)))
(def n2a (apply assoc {} (interleave number alphabet)))
;; implement dp with memoize function
(def number-translate (memoize (fn [long]
(cond (blank? long) [""]
(= (count long) 1) (if (contains? n2a long)
[(n2a long)]
[])
:else (let ... 阅读全帖
p*****2
发帖数: 21240
6
我写了一个,练了练。主要是输出的时候有几个小地方要注意。
def fullJustify(words:Array[String], L:Int)={
process(0)

def process(i:Int):Unit={
val j=getNext(i,0)
if(i {
printSlice(words.slice(i,j))
process(j)
}
}

def printSlice(words:Array[String]):Unit={
if(words.size==1) {println(words(0));return}

val total=words.map(_.length()).sum
val spaces=... 阅读全帖
t****a
发帖数: 1212
7
来自主题: JobHunting版 - 一道复杂的题,求解法
能帮我看看结果对不对好么?不好意思,我还是用clojure写的
(use 'clojure.set)
;; main function: O(n^3) time O(n^2) space

(defn best-cut [branch-string]
(do
(defn parse-branch [branch]
(vec (map #(- (int %) (dec (int \1))) branch)))
(def branch (parse-branch branch-string))
(def sum-stick
(memoize (fn [i k] ; k > 0
(let [j (dec (+ i k))
xj (get branch j)]
(if (== k 1)
xj
(+ xj (sum-stick i (dec k... 阅读全帖
p*****2
发帖数: 21240
8
require 'set'
class Node
attr_accessor :set, :hm
def initialize
@set=Set.new
@hm={}
end
end
class Trie
def add s, ss
node=@root
node.set << ss
s.length.times do |i|
node.hm[s[i]]=Node.new if not node.hm.has_key?(s[i])
node.hm[s[i]].set< node=node.hm[s[i]]
end
end

def dfs root, s
return if root.set.size<2
@ans=s if s.length>@ans.length
root.hm.each {|k,v| dfs(v, s+k)}
end

def lcs s1,s2
@root=Node.new
@ans=''
... 阅读全帖
p*****2
发帖数: 21240
9
来自主题: JobHunting版 - 今天面的太惨了....
def getLeftHeight(root:Option[TreeNode]):Int={
var h=0
var node=root
while(!node.isEmpty){
h+=1
node=node.get.left
}
h
}

def getRightHeight(root:Option[TreeNode]):Int={
var h=0
var node=root
while(!node.isEmpty){
h+=1
node=node.get.right
}
h
}

def getNodesNum(h:Int):Int={
return math.pow(2,h).toInt-1
}

def totalNodes(root:... 阅读全帖
b*****o
发帖数: 715
10
来自主题: JobHunting版 - 不知道发到哪个版,发这里试一下
那还是贴code吧,我算出来是140240。 code很没有效率,要算半分钟~
//////////////////////////////////
import fractions
import time
N = 3
M = 3
def notCollinear(i, j):
a, b = map(lambda x: (x / N, x % N), (i,j))
if abs(fractions.gcd(a[0] - b[0], a[1] - b[1])) > 1:
return False
return True
def adjoin(S):
return reduce(lambda x, y: x + y, S)
def nextRound(pw):
return adjoin(map(lambda x: [x + [i] for i in xrange(N * M)
if not i in x and notCollinear(i,x[-1])], pw))
def findAll():
pw = [[[i] for i in xrang... 阅读全帖
a******3
发帖数: 113
11
来自主题: JobHunting版 - Scala怎么通过index访问set或者array

def keyIterator: Iterator[Key] = new Iterator[Key] {
val newMap=getMapClone
var array=newMap.keySet().toArray
var pos = 0
def hasNext = pos < newMap.size()
def next: Key = { val z = array(pos) ; pos += 1 ; z }
}
[error] found : z.type (with underlying type Object)
[error] required: Key
[error] def next: Key = { val z = array(pos) ; pos += 1 ; z }
[error] one error found
然后变成获取的内容有问题了。。
l****i
发帖数: 230
12
来自主题: JobHunting版 - 一个面试challenge
python code (memoizing failed trials)
def findRecursive(s, b, e, failed):
if (b, e) in failed:
print "Skipping repeated test of '%s' [%s, %s]" % (s, b, e)
return -1
n = e - b
if n < 3: return -1
c = s[b]
d = int(round(n / 3.0))
if c == s[b+d] and c == s[b+d*2]: return int(c)
failed.add((b, e))
rv = findRecursive(s, b, e-1, failed)
if rv >= 0: return rv
return findRecursive(s, b+1, e, failed)
def find(s):
return findRecursive(s, 0, len(s... 阅读全帖
j********3
发帖数: 33
13
来自主题: JobHunting版 - Dropbox电话面经
我来个python 版本的。
精确度考量: 当前版本精度为一秒。 如果要提高精度可以提高memory或者用queue
log所有的hit timestamp,然后压缩timestamp来减少memory。 tradeoff memory O(N)
instead of constant.
scalability:缩小维度,增加memory 使用 distrubuted array in python:
distarray。
edge case: in real world,应该不用考虑一秒内的request超出max integer,面试官
真的要问的话, 超出的话,可以溢出到下一个bucket
concurrency: 基本for loop in reset() 和 count++的地方都需要加锁了...
import time
N = 300
class Counter:
def __init__(self,lock):
self.last_index = 0
self.last_hit_time = 0
self.total... 阅读全帖
c*****m
发帖数: 271
14
来自主题: JobHunting版 - 小弟求问LinkedIn那道Deep Iterator的题
试着写一个python的
import unittest
class DeepIterator():
def __init__(self, deep_list):
if deep_list == None:
self.iterator_stack = []
else:
self.iterator_stack = [[deep_list, 0]]
self.cur_value = None
def hasNext(self):
#the iterator stack is empty, False
if len(self.iterator_stack) == 0:
return False

#ensure hasNext() can be called many times before next()
if self.cur_value != None:
... 阅读全帖
b***p
发帖数: 700
15
来自主题: JobHunting版 - 请教一道google的数组遍历题
这个是python solution, worst case 是O(n^2). 比普通的Greedy Solution, 有两个
改进
1. 计算bit map of word, and AND operation to check if there is common char
2. 遍历是从最长的word开始
还有一个可以改进的地方是,利用元音字母,用word_len+vowel 作key,减少不必要
的compare
class DiffWordsMaxLenProduct:
def __init__(self):
# dict: word -> word char bit map
self.dict_word_bit = {}
# dict: word_len -> [word1, word2, word3...]
self.dict_word_len = {}
#
# compute the bit map of word char
#
def bit_word(self... 阅读全帖
p**o
发帖数: 3409
16
来自主题: JobHunting版 - 请教iterative merge sort list的代码
def mergesort_topdown (aList):
""" Top-down merge sort.
A total of logn splits;
in each split we merge n items.
So the complexity is O(n logn).
"""
_splitmerge (aList, 0, len(aList))
def _splitmerge (aList, i, j):
""" Recursively split runs into two halves
until run size == 1 (considered sorted), then
merge two halves and return back up the call chain.
"""
if j - i > 1:
m = (i + j) // 2
_splitmerge (aList, i, m)
... 阅读全帖
l******9
发帖数: 579
17
【 以下文字转载自 Statistics 讨论区 】
发信人: light009 (light009), 信区: Statistics
标 题: solve equations of integrals in python
发信站: BBS 未名空间站 (Fri Mar 21 12:21:31 2014, 美东)
I need to solve system equations of integrals in python 3.2.
from sympy import S, Eq, solve, integrals
import sympy as sym
import scipy.integrate as integ
x, b, c, m, v, L, u = S('x, b, c, m, v, L, u'.split())
equations = [Eq(m, integ.quad(xf(x, b, c), L, u))]
def xf(x, b,c):
return x*f(x,b,c)
def f(x, b, c):
return g(x, ... 阅读全帖
k***s
发帖数: 6
18
来自主题: JobHunting版 - walmart Lab question
抛砖
class MyClass(object):
def __count_jumps_1(self, remaining_steps, memory):
if memory[remaining_steps] is None:
count = 0
for jump in (1, 2, 3):
if remaining_steps >= jump:
count += self.__count_jumps_1(remaining_steps - jump,
memory)
else:
break
memory[remaining_steps] = count
return memory[remaining_steps]

def count_jumps_1(self):
memory = [None] * 6... 阅读全帖
e****t
发帖数: 1
19
来自主题: JobHunting版 - Pure Storage面经
第一题,画的图没怎么看懂,不知道一个原来为1的节点置0,它的子节点怎么处理,是
所有子节点都置0?感觉不需要,下面的python实现中仅把该节点下所有左孩子置0:
def setbit_down(A, x, n):
if x>=n:
return
if 2*x+1<=n and A[2*x+1]==0:
A[2*x+1]=1
setbit_down(A,2*x+1,n)
if 2*x+2<=n and A[2*x+2]==0:
A[2*x+2]=1
setbit_down(A,2*x+2,n)

def set_bit(A, pos, length):
if not A or pos<0 or length<=0:
return
n = len(A)-1 #last index of A
# pos+length和2*pos+1取较小的即可,避免重复操作,如果较小值仍然大于len(
A),则到len(A)为止
for x i... 阅读全帖
L***s
发帖数: 1148
20
来自主题: JobHunting版 - 类似LRU Cache的题应该怎么练习?

我觉得可以直接用。当然你要知道LinkedHashMap怎么实现的。
我面某司的时候,就直接用python的OrderedDict做的,事后整理如下。
然后被问及OrderedDict的实现,就说了句环形双链表加哈希,就pass到下一题了。
from collections import OrderedDict
class LRUCache (object):
def __init__(self, capacity):
self._cache = OrderedDict()
self.capacity = capacity
def __setitem__(self, key, value):
if key in self._cache:
self._cache.pop(key)
self._cache[key] = value
else:
self._cache[key] = value
if len(self... 阅读全帖
u***l
发帖数: 51
21
用 python 做的,如果用O(n^2) 的方法做,发现下面 a)的code可以过,但是 b)会超时
https://oj.leetcode.com/problems/longest-palindromic-substring/
a 和 b 中只有 function f 不一样,请问这两个到底是哪里产生的不同?谢谢。
OJ 显示超时的例子是 "aaaa...(很长) b(在靠中间的位置) aaaa(很长)"
###########################
a)
class Solution:
# @return a string
def longestPalindrome(self, s):
def f(s, p, q): # find longest palindrome centered at p and q
while p >= 0 and q < len(s) and s[p] == s[q]:
p -= 1; q += 1
return s[p + 1 :... 阅读全帖
C****t
发帖数: 53
22
from random import randint
class randomMap:
def __init__(self):
self.map = {}
self.pool = []

def add(self, x):
if x not in self.map:
self.pool.append(x)
self.map[x] = len(self.pool) - 1
def rm(self, x):
if x in self.map:
idx = self.map[x]
self.map[self.pool[-1]] = idx
self.pool[idx] = self.pool[-1]
self.map.pop(x)
self.pool.pop()

def randGet(self... 阅读全帖
C****t
发帖数: 53
23
class Node:
def __init__(key, val)
self.key = key
self.val = val
maps[node.key] = node
class LinkedList:
# if node.key comes in again, then increase node.val by 1, delete the old
node
def remove(self, node)
# insert the updated node
def add(self,node)
# return Top K:

def topK():
r**h
发帖数: 1288
24
来自主题: JobHunting版 - g phone interv--有没有o(n) 解法
直接swap就可以了呀
随机generate了500个test case,没有问题
import random
def ShouldSwap(test_case, i):
if i % 2 == 0 and test_case[i] > test_case[i+1]:
return True
elif i % 2 == 1 and test_case[i] < test_case[i+1]:
return True
else:
return False
def Validate(test_case):
i = 0
while i < len(test_case) - 1:
if ShouldSwap(test_case, i):
return False
i = i + 1
return True
def FuzzySort(test_case):
i = 0
while i < len(test_case) - 1:
... 阅读全帖
x*******9
发帖数: 138
25
来自主题: JobHunting版 - 下面这道uber电面,怎么做?
在list上被坑了一次。这题用Python可以秒。
import json
class Solution(object):
def __init__(self):
self.map_list = []
def flatten_json(self, json_str):
d = json.loads(json_str)
self.do_flatten_json(d)
return '\n'.join(map(str, self.map_list))
def do_flatten_json(self, d):
if isinstance(d, list):
map(self.do_flatten_json, d)
return

if not isinstance(d, dict):
return
if 'uuid' in d and 'properties' i... 阅读全帖
b**w
发帖数: 78
26
来自主题: JobHunting版 - 讨论下lc最新的那道hard题吧
Python的,写的比较乱
class Solution(object):
def addOperators(self, num, target):
"""
:type num: str
:type target: int
:rtype: List[str]
"""
result = self.helper(num, 0, target)
return result

def helper(self, num, pos, target):
result = []
if pos>=len(num):
if target==0:
result.append("")
return result
if pos==len(num)-1:
if int(num[pos])==target:
... 阅读全帖
e***i
发帖数: 231
27
来自主题: JobHunting版 - FB这几个题怎么做
抛个砖
1. 可以用递归或者循环
#!/bin/python
def _rec_all_prod(primes):
if len(primes) == 1:
return primes
sub_prod = _rec_all_prod(primes[1:])
new_prod = sub_prod[:]
new_prod.append(primes[0])
for prod in sub_prod:
new_prod.append(prod*primes[0])
return new_prod
def get_prod_one(primes):
return set(_rec_all_prod(primes))
def _loop_all_prod(primes):
new_prod = []
for x in xrange(2**len(primes)):
mask = "{0:b}".format(x)[::-1]
total = 1
for b, v in zip(mask, primes):
... 阅读全帖
a*****e
发帖数: 1717
28
Here's python one I used before,
drawbacks:
1. data pacing violation, limit on size of each quote, interval etc.
2. futures symbols are less standardized
3. IB data sucks, but ok for median to long term backtest
4. the ibpy is out-dated, you have to update yourself to get new
features.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from ib.ext.Contract import Contract
from ib.opt import ibConnection, message
from time import sleep
from datetime import date
import pyodbc, os, sys
# print all mess... 阅读全帖
m********0
发帖数: 2717
29
IB没有返回options symbol list的函数,需要自己生成。
给你一个我以前用过的script,我自己从bloomberg下载的list,然后下载的options数
据,
基于IBPY, 另外IB数据很差,如果只是为了计算max pain,到处都有,没必要自己闭门造车。
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from ib.ext.Contract import Contract
from ib.opt import ibConnection, message
from time import sleep
from datetime import date
# print all messages from TWS
def watcher(msg):
print msg
# show Bid and Ask quotes
def my_BidAsk(msg):
if msg.field == 1:
print '%s:%s: bid: %s' % (contractTuple[0],
... 阅读全帖

发帖数: 1
30
Narrow range 7(NR7): 如果当天的high/low(高点和低点)的差, 是过去七天中最小
的, 那当天就是所谓的NR7. 当然, 如果不是用在日图, 也可以解释为当下candlestick
的high/low的差是之前七根candlestick中最小的. 所以NR7可以应用在不同时段的
candlestick线图中.
当NR7发生的时候, 他代表当下股票累积了一定的动能有很大的机率在不久的将来有大
幅度的价位变动, 但是请注意, NR7只告诉你股价很有机会有大变动,NR7并没有告诉你
方向, 这时候需要利用其他的技术图表或工具来预测方向
Script:
def range = high – low;
def na=double.nan;
def plotPoint=high+range*1;
def nr7Flag = (range <= range[1] and range <= range[2] and range <=
range[3] and range <= range[4] and range <= range[5] and range <=
range[... 阅读全帖
t***q
发帖数: 418
31
【 以下文字转载自 Programming 讨论区 】
发信人: treeq (treeq), 信区: Programming
标 题: 如何用python web.py web service 做 multiple parameters 的
发信站: BBS 未名空间站 (Sun Mar 22 23:14:33 2015, 美东)
大家好。我的那个web service 做成了。用了python 的 web.py.
install web.py
cd webpy
编辑python web service.
#!/usr/bin/env python
urls = ('/title_matching2','title_matching2')
app = web.application(urls,globals())
class title_matching2:
def __init__(self):
self.hello = "hello world"
def GET(self):
getInput = web.input(name="W... 阅读全帖
t***q
发帖数: 418
32
【 以下文字转载自 Programming 讨论区 】
发信人: treeq (treeq), 信区: Programming
标 题: 如何用python web.py web service 做 multiple parameters 的 call?
发信站: BBS 未名空间站 (Sun Mar 22 23:14:33 2015, 美东)
大家好。我的那个web service 做成了。用了python 的 web.py.
install web.py
cd webpy
编辑python web service.
#!/usr/bin/env python
import web
import csv
import difflib
import re
import operator
import Levenshtein
urls = ('/title_matching2','title_matching2')
app = web.application(urls,globals())
class title_matching2:
def __init__(self):
... 阅读全帖
t***q
发帖数: 418
33
【 以下文字转载自 Programming 讨论区 】
发信人: treeq (treeq), 信区: Programming
标 题: 如何用python web.py web service 做 multiple parameters 的
发信站: BBS 未名空间站 (Sun Mar 22 23:14:33 2015, 美东)
大家好。我的那个web service 做成了。用了python 的 web.py.
install web.py
cd webpy
编辑python web service.
#!/usr/bin/env python
urls = ('/title_matching2','title_matching2')
app = web.application(urls,globals())
class title_matching2:
def __init__(self):
self.hello = "hello world"
def GET(self):
getInput = web.input(name="W... 阅读全帖
s******g
发帖数: 755
34
【 以下文字转载自 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... 阅读全帖
t***q
发帖数: 418
35
【 以下文字转载自 Programming 讨论区 】
发信人: treeq (treeq), 信区: Programming
标 题: 如何用python web.py web service 做 multiple parameters 的query
发信站: BBS 未名空间站 (Sun Mar 22 23:14:33 2015, 美东)
大家好。我的那个web service 做成了。用了python 的 web.py.
install web.py
cd webpy
编辑python web service.
#!/usr/bin/env python
urls = ('/title_matching2','title_matching2')
app = web.application(urls,globals())
class title_matching2:
def __init__(self):
self.hello = "hello world"
def GET(self):
getInput = web.input(na... 阅读全帖
g**********y
发帖数: 14569
36
来自主题: Football版 - 【DFL】第12周waiver wire
Mike Tolbert (SD - RB) Add Waivers ($35) 戒烟客(gloomyturkey)
Chris Cooley (Was - TE) Add Waivers ($15) 戒烟客(gloomyturkey)
Joel Dreessen (Hou - TE) Add Waivers ($5) 戒烟客(gloomyturkey)
New York (NYG - DEF) Add Waivers ($5) 扫地僧(dango)
Christopher Ivory (NO - RB) Add Waivers ($3) 小玄子
Aaron Hernandez (NE - TE) Add Waivers ($3) 扫地僧(dango)
Cleveland (Cle - DEF) Add Waivers ($3) 虚竹子(bison)
Oakland (Oak - DEF) Add Waivers ($1) ... 阅读全帖
G**Y
发帖数: 33224
37
来自主题: Football版 - Fantasy 又输一场,太郁闷了。
当时实在不知道Waiver里谁牛呀。
琢磨着,反正烂RB也跑不了几分,不如搞个牢靠的DEF。我就把后面几场的DEF都搞来了
。哈哈哈
结果发现,烂RB也有爆发的时候。牛DEF,除了Bears, 也多拿不了几分。
Kicker就根本不可预测。我选的Texans的K,也不能算差,结果到我手里就miss了。
上周Bears的Kicker,到我手里就miss了。结果我一出手,他就15分了。
看来DEF和Kicker,尤其是Kicker,就不能predict,认准一个用到底就好了。
G**Y
发帖数: 33224
38
来自主题: Football版 - 人算不如天算呀,
我对家的DEF这周Bye,我一口气攒了3个DEF,Bengals, Rams, 和Falcons,以防对家拿
到NB的DEF。
结果对家从容的选了NE(我上周的DEF),。。。
G**Y
发帖数: 33224
39
来自主题: Football版 - [Fantasy]把D Williams drop了
听了大家的分析。把他drop了。
换了Cardinals的DEF,准备下周用。下周49客场对NO,49的DEF没啥意义。
结果有人把Coby Fleener又drop了,我正缺一个TE呀,没地方放了。
这周Titan的DEF打Jags,结果NFL预测他们得两分?Titan DEF这么不被看好?还是觉得
Titan半场就能打爆Jags然后放水?
G**Y
发帖数: 33224
40
来自主题: Football版 - [fantasy]冠了
小有遗憾。
昨天落后7分,今天CK+49的DEF。应该说是十拿九稳了。上半场没看着,在车里听了几
耳朵。DEF好像不给力,稍稍有点担心。后来CK跑了个TD,100%冠了。
回来一看果然DEF不给力,1个sack?只有两分?一看比分,大比分领先了。开始盼着
Atlanta翻盘。
onside都奇迹般的recover了。最后功亏一篑呀。49ers DEF没有意义的又给我整了12分
P*******e
发帖数: 39399
41
来自主题: Football版 - 球盲扯两句Zimmer to be Vikings HC
说实话今年市面上这些教练,我其实很看好Zimmer。弱队翻身靠防守,味精还是先老老
实实地把防守搞好吧。
从DC角度,能把不是很有talent的笨狗D带成现在这样常年前十,我觉得还是很有说服
力的。刚才看数据,Zimmer这六年笨狗一共就带出2个pro-bowlers: DT Geno Atkins
2012玩过,LB Vontaze Burfict今年混了一个(不过没有味精问题最大的二线位置球员
)。对于味精这么没有天赋的def (老迈的JAllen应该不会续约,目前还有点天赋的就
是12年摘的Harrison Smith,今年还伤了大半年)。去年的两个一轮,CB Rhodes现在
算刚进入角色,DT Floyd还处于一直找状态的阶段。。。能整合现有的人达到最佳效果
应该Zimmer最擅长做的事,希望他能在味精继续他的专长,这恐怕也是味精雇他的最
大原因。
说说潜在的问题,Zimmer作为热门准热门教练也很多年了,57的高龄竟然是第一次做HC
。倒不是说别人不愿请他就是他一定不好,但是至少侧面说明,其他队还是不很信任他
,味精的这个决定也多少有点赌博性质。而且DC究竟是否适合做HC也... 阅读全帖
qn
发帖数: 2116
42
来自主题: Football版 - 我空组成空前强大教练团
单昆这是整哪样? 19个人了,要用教练拍死对手吗?
Dan Quinn Head Coach
Richard Smith Defensive Coordinator
Raheem Morris Asst. Head Coach/Def. Passing Game Coord.
Bryan Cox Defensive Line Coach
Jeff Ulbrich Linebackers Coach
Chad Walker Def. Assistant/Defensive Backs
Doug Mallory Def. Assistant/Linebackers
Marquand Manuel Secondary/Senior Def. Assistant
Kyle Shanahan Offensive Coordinator
Bobby Turner Running Backs Coach
Chris Morgan Offensive Line
Matt LaFleur Quarterbacks
Wade ... 阅读全帖
b***n
发帖数: 13455
43
来自主题: NCAA版 - ESPN/COACH'S POLL
1. USC (37) 11-1 1,542 2
Last game: Def. Oregon State 52-28 (Dec. 6)
2. LSU (18) 12-1 1,516 3
Last game: Def. No. 5 Georgia 34-13 (Dec. 6)
3. Oklahoma (8) 12-1 1,449 1
Last game: Lost to No. 13 Kansas State 35-7 (Dec. 6)
4. Michigan 10-2 1,393 4
Last game: Def. No. 4 Ohio State 35-21 (Nov. 22)
5. Texas 10-2 1,272 6
Last game: Def. Texas A&M 46-15 (Nov. 28)
6. Ohio State 10-2 1,168 7
Last game: Lost to No. 5 Michigan 35-21 (Nov. 22)
7. Tennessee 10-2 1,145 8
Last game: De
B****2
发帖数: 8892
44
EAST Conference Overall
South Carolina 2-Jun 2-Oct
Florida 4-Apr 5-Jul
Georgia 5-Mar 6-Jun
Tennessee 6-Feb 6-Jun
Kentucky 6-Feb 7-May
Vanderbilt 7-Jan 8-Apr
WEST Conference Overall
Alabama Aug-00 Dec-00
LSU 2-Jun 2-Oct
Arkansas 2-Jun 3-Sep
Mississippi State 3-May 3-Sep
Auburn 4-Apr 4-Aug
Ole Miss 7-Jan 7-May
Conference Championship: Alabama def. South Caroli... 阅读全帖
f*****Q
发帖数: 1912
45
整了个类似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
... 阅读全帖
l********a
发帖数: 1154
46

把这个代码运行一下,好像有很多地址是一样的,用个dict去一下重复吧
#! /urs/bin/env python
# coding: utf-8
import re
import urllib2
url = r'http://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=0001304741&owner=exclude&count=40&hidefilings=0'
url_base = r'http://www.sec.gov/'
res_comp = r'Archives.*?htm'
res1 = r'mailer">(.*?)Address(.*?)
'
res2 = r'mailerAddress">(.*?)<'
def getSource(url):
''' get source of the page '''
page = urllib2.urlopen(url)
if page:
return page.read()
else:
... 阅读全帖
t***q
发帖数: 418
47
【 以下文字转载自 Programming 讨论区 】
发信人: treeq (treeq), 信区: Programming
标 题: 如何用python web.py web service 做 multiple parameters 的 call?
发信站: BBS 未名空间站 (Sun Mar 22 23:14:33 2015, 美东)
大家好。我的那个web service 做成了。用了python 的 web.py.
install web.py
cd webpy
编辑python web service.
#!/usr/bin/env python
import web
import csv
import difflib
import re
import operator
import Levenshtein
urls = ('/title_matching2','title_matching2')
app = web.application(urls,globals())
class title_matching2:
def __init__(self):
... 阅读全帖
c******n
发帖数: 4965
48
来自主题: Linux版 - python question
thanks,
but there is still a limitation: python does not have anonymous class,
so I wanted to print
"In BBB1"
"In BBB2" by the following code
import threading
class VV:
x="1"
def __init__(self, x ):
self.x = x
def blah(self,xx):
l = []
for a in [ 1 , 2 ]:
class BB:
def run(self):
print "IN BBB%d" % a
l.append(BB())
l[0].run();
l[1].run();
v = VV("2")
v.blah("A")
but in practice, it giv... 阅读全帖
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)