counter

CSS counter on hidden submenu

家住魔仙堡 提交于 2019-12-01 22:47:26
I'm trying to make a dropdown menu using nested <ul> , every <li> displaying a number generated with CSS Counters. Sub-menus are hidden with display:none when not hovered. My problem is that counters are not incremented when an element has display set to none . Do you know a CSS property to prevent this? If I replace display: none by visibility: hidden , it's working but I'm not sure if it's nice to use this for my menu, are there any traps? Harry You can mimick the display: none (hidden) behavior by setting the font-size to 0px and this would make the element be counted by the counter

How to count the same values in a dict? [duplicate]

谁说我不能喝 提交于 2019-12-01 21:21:47
问题 This question already has answers here : count the number of occurrences of a certain value in a dictionary in python? (3 answers) How many items in a dictionary share the same value in Python (5 answers) Python counting occurrence of values in dictionary (3 answers) Counting values in dictionary (3 answers) Python 2.7 Counting number of dictionary items with given value (2 answers) Closed last year . I have a dict that looks like this: "votes": { "user1": "yes", "user2": "no", "user3": "yes"

Decrementing a loop counter as loop is executing

僤鯓⒐⒋嵵緔 提交于 2019-12-01 21:18:16
问题 I'm trying to decrement the counter of a for loop as the loop is running. Unfortunately, Lua doesn't seem to allow that. This piece of code should run forever: for i = 1, 100 do print (i) i = i - 1 end but it does, in fact, simply print the series 1-100. Is that by design? If so, how do I decrement the counter of a running loop (for example because the current cycle was disqualified and should run again)? 回答1: It's by design. From Lua reference manual: 3.3.5 – For Statement All three control

Count the frequency of a recurring list — inside a list of lists

牧云@^-^@ 提交于 2019-12-01 19:10:30
问题 I have a list of lists in python and I need to find how many times each sub-list has occurred. Here is a sample, from collections import Counter list1 = [[ 1., 4., 2.5], [ 1., 2.66666667, 1.33333333], [ 1., 2., 2.], [ 1., 2.66666667, 1.33333333], [ 1., 4., 2.5], [ 1., 2.66666667, 1.33333333]] c = Counter(x for x in iter(list1)) print c I above code will work, if the elements of the list were hashable (say int), but in this case they are lists and I get an error TypeError: unhashable type:

Decrementing a loop counter as loop is executing

柔情痞子 提交于 2019-12-01 18:53:24
I'm trying to decrement the counter of a for loop as the loop is running. Unfortunately, Lua doesn't seem to allow that. This piece of code should run forever: for i = 1, 100 do print (i) i = i - 1 end but it does, in fact, simply print the series 1-100. Is that by design? If so, how do I decrement the counter of a running loop (for example because the current cycle was disqualified and should run again)? It's by design. From Lua reference manual : 3.3.5 – For Statement All three control expressions are evaluated only once, before the loop starts. They must all result in numbers. So modifying

Count the frequency of a recurring list — inside a list of lists

女生的网名这么多〃 提交于 2019-12-01 18:32:23
I have a list of lists in python and I need to find how many times each sub-list has occurred. Here is a sample, from collections import Counter list1 = [[ 1., 4., 2.5], [ 1., 2.66666667, 1.33333333], [ 1., 2., 2.], [ 1., 2.66666667, 1.33333333], [ 1., 4., 2.5], [ 1., 2.66666667, 1.33333333]] c = Counter(x for x in iter(list1)) print c I above code will work, if the elements of the list were hashable (say int), but in this case they are lists and I get an error TypeError: unhashable type: 'list' How can I count these lists so I get something like [ 1., 2.66666667, 1.33333333], 3 [ 1., 4., 2.5]

Get cumulative count per 2d array

血红的双手。 提交于 2019-12-01 16:56:49
I have general data, e.g. strings: np.random.seed(343) arr = np.sort(np.random.randint(5, size=(10, 10)), axis=1).astype(str) print (arr) [['0' '1' '1' '2' '2' '3' '3' '4' '4' '4'] ['1' '2' '2' '2' '3' '3' '3' '4' '4' '4'] ['0' '2' '2' '2' '2' '3' '3' '4' '4' '4'] ['0' '1' '2' '2' '3' '3' '3' '4' '4' '4'] ['0' '1' '1' '1' '2' '2' '2' '2' '4' '4'] ['0' '0' '1' '1' '2' '3' '3' '3' '4' '4'] ['0' '0' '2' '2' '2' '2' '2' '2' '3' '4'] ['0' '0' '1' '1' '1' '2' '2' '2' '3' '3'] ['0' '1' '1' '2' '2' '2' '3' '4' '4' '4'] ['0' '1' '1' '2' '2' '2' '2' '2' '4' '4']] I need count with reset if difference

Get cumulative count per 2d array

*爱你&永不变心* 提交于 2019-12-01 15:48:43
问题 I have general data, e.g. strings: np.random.seed(343) arr = np.sort(np.random.randint(5, size=(10, 10)), axis=1).astype(str) print (arr) [['0' '1' '1' '2' '2' '3' '3' '4' '4' '4'] ['1' '2' '2' '2' '3' '3' '3' '4' '4' '4'] ['0' '2' '2' '2' '2' '3' '3' '4' '4' '4'] ['0' '1' '2' '2' '3' '3' '3' '4' '4' '4'] ['0' '1' '1' '1' '2' '2' '2' '2' '4' '4'] ['0' '0' '1' '1' '2' '3' '3' '3' '4' '4'] ['0' '0' '2' '2' '2' '2' '2' '2' '3' '4'] ['0' '0' '1' '1' '1' '2' '2' '2' '3' '3'] ['0' '1' '1' '2' '2'

jQuery or Javascript continuous counter (countup)

北慕城南 提交于 2019-12-01 14:41:36
Looking for a script that I can ideally enter a starting number and a start date, which then continues to increment based on a rate I set e.g. 1 per second . The script would ideally calculate what number it should be on based on the difference between the current time and start time. It's meant to look like it's showing a live count. Ideally, something like the counter on http://sendgrid.com/ Has anyone got a link or plugin or solution they can share? If the numbers can be replaced with images of numbers even better, but a starting point would be much appreciated. Thanks If you want a

how can I make visitor counter in php? [closed]

纵然是瞬间 提交于 2019-12-01 12:01:51
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . How I can count visitors ?? I want to insert when open the page and when close or leave the page but not onunload And I don't want to insert when refresh