Search Results

Search found 7 results on 1 pages for 'targz'.

Page 1/1 | 1 

  • Combinatorics, probability, dice

    - by TarGz
    A friend of mine asked: if I have two dice and I throw both of them, what is the most frequent sum (of the two dice' numbers)? I wrote a small script: from random import randrange d = dict((i, 0) for i in range(2, 13)) for i in xrange(100000): d[randrange(1, 7) + randrange(1, 7)] += 1 print d Which prints: 2: 2770, 3: 5547, 4: 8379, 5: 10972, 6: 13911, 7: 16610, 8: 14010, 9: 11138, 10: 8372, 11: 5545, 12: 2746 The question I have, why is 11 more frequent than 12? In both cases there is only one way (or two, if you count reverse too) how to get such sum (5 + 6, 6 + 6), so I expected the same probability..?

    Read the article

  • Python: date, time formatting

    - by TarGz
    I need to generate a local timestamp in a form of YYYYMMDDHHmmSSOHH'mm'. That OHH'mm' is one of +, -, Z and then there are hourhs and minutes followed by '. Please, how do I get such a timestamp, denoting both local time zone and possible daylight saving?

    Read the article

  • Computer graphics: programatically create duotone (or separations)

    - by TarGz
    There are special kind of images called "duotone" which have just two channels. It is mostly used when you want to achive higher quality reproduction - have a printing press with two colors (black , gray). My question is, I have normal gray-scale image, how to convert it to duotone? I know I can tweak the curves in Photoshop - this is not what I'm asking, rather than how to do it programmatically? Perhaps there is a library which can do just that? What about "dot gain compensation"? "Total ink coverage"?

    Read the article

  • Python: concatenate generator and item

    - by TarGz
    I have a generator (numbers) and a value (number). I would like to iterate over these as if they were one sequence: i for i in tuple(my_generator) + (my_value,) The problem is, as far as I undestand, this creates 3 tuples only to immediately discard them and also copies items in "my_generator" once. Better approch would be: def con(seq, item): for i in seq: yield seq yield item i for i in con(my_generator, my_value) But I was wondering whether it is possible to do it without that function definition

    Read the article

  • 2 Nics - Same Subnet..Route backup traffic through one of them

    - by Matthewhall58
    I have a windows server and a centos linux server. I want the nightly backup file (targz) that copies to the windows machine to use a different nic so that the main nic is not burdenend with moving the large file. Each server has 2 Nics in it. the network is 10.173.10.0 mask 255.255.255.192 Centos Linux Box: Eth0 is configured with 10.173.10.80 mask 255.255.255.192 gw 10.173.10.65 Eth 1 is configured with 10.173.10.71 mask 255.255.255.192 gw 10.173.10.65 Windows Box Eth 0 is 10.173.10.72 mask 255.255.255.192 gw 10.173.10.65 Eth 1 is 10.173.10.70 mask 255.255.255.192 gw 10.173.10.65 I can ping each machine from each machine. On the linux machine I use the command route add -host 10.173.10.70 dev eth1 but then when i ping 10.173.10.70 it is unreachable..... WHY?

    Read the article

1