Skip to content

Instantly share code, notes, and snippets.

View varepsilon's full-sized avatar

Aleksandr Chuklin varepsilon

View GitHub Profile
<div style="margin-left:10px; margin-top:10px; margin-right:10px; margin-bottom: 10px;">
<h5 style="margin-bottom:0px; margin-top:0px" class="medium-text">Proceedings of the 37th international ACM SIGIR conference on Research &amp; development in information retrieval</h5>
<h5 class="medium-text" style="margin-bottom:10px; margin-top:10px;">Table of Contents</h5>
<div style="clear:both">
<div style="margin-top:5px; margin-bottom: 10px;" class="small-text"><a href="citation.cfm?id=2484028&amp;picked=prox&amp;CFID=461421606&amp;CFTOKEN=32764827" title="previous: SIGIR '13"><img hspace="5" align="absmiddle" border="0" src="img/prev.gif" width="19" height="11" alt="previous">previous proceeding</a> <span style="padding-left:5px;padding-right:5px;">|</span><span class="link-text">no next proceeding</span></div>
@varepsilon
varepsilon / gist:2621186
Created May 6, 2012 09:16
numpy.array scalar product
# 1
sum(x * y for x in a for y in b)
# 2
sum([x * y for x in a for y in b])
# 3
a * b
# 4
@varepsilon
varepsilon / gist:2326473
Last active October 2, 2015 21:38
Emulate dict comprehensions
# 1
dict([(x, x**2) for x in range(N)])
# 2
dict({(x, x**2) for x in range(N)})
# 3
dict((x, x**2) for x in range(N))
@varepsilon
varepsilon / gist:2326435
Created April 7, 2012 08:16
Alisa's range
def ARange(N):
if N < 1:
return
q = (N - 1) // 4
i = 0
while i < q:
yield i
i += 1
yield i
i += 1
@varepsilon
varepsilon / gist:1965236
Created March 3, 2012 09:31
Class example (wrong)
class NotSoClever:
def __init__(a):
field = a
def printField():
print(field)
if __name__ == '__main__':
r = NotSoClever()
r.printField()
@varepsilon
varepsilon / makelinks.p
Created February 14, 2012 13:01
Create directory with symlinks to other files translating directory structure to filenames.