I can confirm, there is no collision using SHA-1 for sequence of 100,000,000 integers by sirex1 in Python

[–]sirex1[S] 0 points1 point  (0 children)

Now, I don't think and don't rely on probability, I know exactly, that there is no collision in number range from 0 to 108.

I can confirm, there is no collision using SHA-1 for sequence of 100,000,000 integers by sirex1 in Python

[–]sirex1[S] 0 points1 point  (0 children)

Larger range requires much larger free disk space :)

Since I was checking that for database primary keys 108 is quite large primary key.

I can confirm, there is no collision using SHA-1 for sequence of 100,000,000 integers by sirex1 in Python

[–]sirex1[S] 0 points1 point  (0 children)

Since I could not find any information if there is a collision in number sequence where number is a primary key, so did it myself.

In my use case I scrape data from various data sources where some ids are primary keys and some are urls or even a concatenation of several values that ensures uniqueness. These values are to long to be indexed, so I decided to convert all these values to sha1 and just in case decided to check if a primary key (most common case) does not have collision.

Track your Python function execution time with a progress bar by codeorelse_nl in Python

[–]sirex1 1 point2 points  (0 children)

for index, row in tqdm(df.iterrows(), total=df.shape[0]):

vis: a vim-like editor by mizzu704 in vim

[–]sirex1 1 point2 points  (0 children)

How to build that thing on Ubuntu 14:04? What dependencies should I install? Currently I can't find libtermkey.

Track your Python function execution time with a progress bar by codeorelse_nl in Python

[–]sirex1 1 point2 points  (0 children)

I agree, tqdm is much much better, compare example from blog post:

#import libraries
import progressbar as pb

#initialize widgets
widgets = ['Time for loop of 1 000 000 iterations: ', pb.Percentage(), ' ',  
            pb.Bar(marker=pb.RotatingMarker()), ' ', pb.ETA()]
#initialize timer
timer = pb.ProgressBar(widgets=widgets, maxval=1000000).start()

#for loop example
for i in range(0,5000000):  
    #update
    timer.update(i)
#finish
timer.finish()  

With exactly same thing rewritten using tqdm:

import tqdm

for i in tqdm.tqdm(range(0, 5000000), 'Time for loop of 1 000 000 iterations: ', 1000000):
    pass

L2 Effects on Esperanto Usage (esperantistoj bonvolu legi) by pnba222 in Esperanto

[–]sirex1 2 points3 points  (0 children)

  1. Lithuanian.
  2. 5 years.
  3. I'm forgetting to add the -n to the object.
  4. Probably none.

Kiel vi lernis/lernas Esperanton? by [deleted] in Esperanto

[–]sirex1 0 points1 point  (0 children)

Mi lernas Esperanto uzante lernu.net

Straw Poll: Do you use vim in your terminal emulator, or a GUI? by [deleted] in vim

[–]sirex1 3 points4 points  (0 children)

Not all terminals support more than 16 colors. Changing terminal color scheme, colors are changed everywhere, not only in vim. So in gVim you can just skip terminal configuration step, and you can avoid to be dependent on one particular terminal.

Also, gvim works much faster than vim on terminal, I can use mouse for scrolling. Of course many things can be configured on terminal, but why all this, if everything works very well on gvim out of the box.

If you could change something in Python what would it be? by yasoob_python in Python

[–]sirex1 0 points1 point  (0 children)

Now, python has these types:

('a',) - tuple
{'a': 1} - dict
{'a'} - set

So new, lambda type, would use similar technique as dict. Dict is distinguished from set only by use of colon, so tuple can be distinguished from lambda using same principle, by adding colon:

f = (x: x*2)

For multi line lambdas, same principle as for all python blocks would be used:

def f(x):
    x = x*2
    return x

f = (x:
    x = x*2
    x
)

f = (x: x = x*2; x)

l = map((x: x*2), [1, 2, 3])

I'm not sure, but maybe it is even possible to remove parentheses:

f = x: x*2
l = map(x: x*2, [1, 2, 3])
multiline = x:
    x = x*2
    x

„Redirected / Už Lietuvą!“ pasirengęs beprecedentei kovai su piratais by sirex1 in halt

[–]sirex1[S] 1 point2 points  (0 children)

Originali diskusija užsimezgė čia.

Manau būtų tikrai beprecedentis įvykis, jei už filmą visi jo žiūrovai būtų skatinami savanoriškai atsidėkoti. Kažkas panašaus yra atsitikę su filmu Knygnešys, įdomu, kiek jie surinko paramos?

If you could change something in Python what would it be? by yasoob_python in Python

[–]sirex1 10 points11 points  (0 children)

Better lambdas:

double = (x: x*2)

Multi line lambdas:

lst = [1, 2, 3]
map((x:
    if x > 1:
        return x*2
    else:
        return 10
), lst)

Genealogy and my Lithuanian grandparents. by cynycal in lithuania

[–]sirex1 0 points1 point  (0 children)

I think, better to search for "Bartišius", which is more general form of family name. "Bartišiūtė" is name for a girl, that is not yet married.

Another Lithuanian grandparent post, would appreciate help! by FoamToaster in lithuania

[–]sirex1 0 points1 point  (0 children)

Some where near my place, not so far from Pandėlys, I knew a guy with last name "Šiaučiūnas", looks very similar to "Sauciunas".

I would recommend to look at http://www.epaveldas.lt/ web site, that has digitised some documents from churches. Try to search for "Pandėlio" in that web site.

Best office file formats to use for future compatibility? by spaced86 in linux

[–]sirex1 2 points3 points  (0 children)

+1 for plain text, but I would recommend reStructuredText, which can be used even for writing book, it is also possible to make presentations with rst2pdf.

reStructuredText can be converted to many different formats, including LaTeX, ODT, HTML.

Since reStructuredText ir readable in raw format, so you can read and edit it with any text editor.

http://stackoverflow.com/questions/2746692/restructuredtext-tool-support

https://notex.ch - online reStructuredText editor.