infinite

css3动画-加载中...

删除回忆录丶 提交于 2020-01-05 02:29:51
写几个简单的加载中动画吧。 像前面三种都是相当于几个不同的点轮流来播放同一动画:变大变小。css3里面有一个用于尺度变换的方法: scale( x , y ) : 定义 2D 缩放转换,改变元素的宽度和高度 。 第四种就是一个小球从上往下跌落,再弹回去,在上面的时候速度最小,下面的时候速度最大。由于该小球只进行了上下的移动,所以我们可以运用: translateY( n ):定义 2D 转换,沿着 Y 轴移动元素, 从而实现小球沿Y方向来回移动。 废话不多说了,上代码。 首先,第一个加载中的动画: 1 <div id="loading1"> 2 <div class="demo1"></div> 3 <div class="demo1"></div> 4 <div class="demo1"></div> 5 <div class="demo1"></div> 6 <div class="demo1"></div> 7 </div> html Code 1 .demo1 { 2 width: 4px; 3 height: 4px; 4 border-radius: 2px; 5 background: #68b2ce; 6 float: left; 7 margin: 0 3px; 8 animation: demo1 linear 1s infinite; 9 -webkit

Infinite yields from an iterator

天涯浪子 提交于 2020-01-01 12:13:32
问题 I'm trying to learn some ruby. Imagine I'm looping and doing a long running process, and in this process I want to get a spinner for as long as necessary. So I could do: a=['|','/','-','\\'] aNow=0 # ... skip setup a big loop print a[aNow] aNow += 1 aNow = 0 if aNow == a.length # ... do next step of process print "\b" But I thought it'd be cleaner to do: def spinChar a=['|','/','-','\\'] a.cycle{|x| yield x} end # ... skip setup a big loop print spinChar # ... do next step of process print "

How to create an infinite iterator to generate an incrementing alphabet pattern?

不羁岁月 提交于 2019-12-30 09:42:14
问题 I've created a function that generates a list of alphabets incrementing continuously. A, B, C ..., Z. After Z, it goes to AA, AB, AC ...AZ. This pattern repeats. This is similar to MS Excel's column names. At the moment, this function generates a finite list of alphabets. _column_name_generator() = ['A', 'B', ..., 'AA', 'AB', ..., 'BA', 'BB', ..., 'CV'] I can then iterate over it in conjunction with some finite list, e.g. 0-10. See my code below. What I'd like is to create a generator that

Haskell infinite recursion in list comprehension

删除回忆录丶 提交于 2019-12-29 01:28:09
问题 I am trying to define a function that accepts a point (x,y) as input, and returns an infinite list corresponding to recursively calling P = (u^2 − v^2 + x, 2uv + y) The initial values of u and v are both 0. The first call would be P = (0^2 - 0^2 + 1, 2(0)(0) + 2) = (1,2) Then that resulting tuple (1,2) would be the next values for u and v, so then it would be P = (1^2 - 2^2 + 1, 2(1)(2) + 2) = (-2,6) and so on. I'm trying to figure out how to code this in Haskell. This is what I have so far:

C- number checking function gives infinite loop [closed]

主宰稳场 提交于 2019-12-26 14:04:15
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I'm trying to write a small function that will get a number. The function should be idiot-proof so it would give warnings if ie. someone entered a character instead. I wrote a function like the one below, but if I enter a non-int the program gives me an infinite loop, constantly repeating the printf "Not a valid

C- number checking function gives infinite loop [closed]

柔情痞子 提交于 2019-12-26 14:01:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I'm trying to write a small function that will get a number. The function should be idiot-proof so it would give warnings if ie. someone entered a character instead. I wrote a function like the one below, but if I enter a non-int the program gives me an infinite loop, constantly repeating the printf "Not a valid

MLE error in R: non-finite finite-difference value/ value in 'vmmin' is not finite

醉酒当歌 提交于 2019-12-25 07:59:16
问题 I am working on a loss aversion model in R (beginner) and want to estimate some parameters, from a dataset with 3 columns (loss/gain values (both continous and a column with decisions coded as 0 or 1 (binary)) dropbox.com/s/fpw3obrqcx8ld1q/GrandAverage.RData?dl=0 The part of the code if have to use for this I am using is given below: set <- GrandAverage[, 5:7]; Beh.Parameters <- function (lambda, alpha, temp) { u = 0.5 * set$Gain^alpha + 0.5 * lambda * set$Loss^alpha GambleProbability <- 1 /

css3动画-加载中...

我们两清 提交于 2019-12-24 12:27:43
像前面三种都是相当于几个不同的点轮流来播放同一动画:变大变小。css3里面有一个用于尺度变换的方法: scale( x , y ) : 定义 2D 缩放转换,改变元素的宽度和高度 。 第四种就是一个小球从上往下跌落,再弹回去,在上面的时候速度最小,下面的时候速度最大。由于该小球只进行了上下的移动,所以我们可以运用: translateY( n ):定义 2D 转换,沿着 Y 轴移动元素, 从而实现小球沿Y方向来回移动。 首先,第一个加载中的动画: <div id="loading1"> <div class="demo1"></div> <div class="demo1"></div> <div class="demo1"></div> <div class="demo1"></div> <div class="demo1"></div> </div> html Code .demo1 { width: 4px; height: 4px; border-radius: 2px; background: #68b2ce; float: left; margin: 0 3px; animation: demo1 linear 1s infinite; -webkit-animation: demo1 linear 1s infinite; } .demo1:nth-child(1){

infinite lists, lazy evaluation and length

烂漫一生 提交于 2019-12-24 12:09:55
问题 Haskell noob here: I'm still trying to understand the mechanics of the language, so if my question is plain stupid, forgive me and point me to some link which I can learn from (I've searched awhile in similar topics here on stackoverflow, but still I can't get this). I came out with this function: chunks :: Int -> [a] -> [[a]] chunks n xs | length xs <= n = [xs] | otherwise = let (ch, rest) = splitAt n xs in ch:chunks n rest so that ghci> chunks 4 "abracadabra" ["abra","cada","bra"] ghci>

每日css

依然范特西╮ 提交于 2019-12-23 21:53:15
<!DOCTYPE html> < html lang = " en " > < head > < meta charset = " UTF-8 " > < title > 地球动画 </ title > < link rel = " stylesheet " href = " css/my.css " /> </ head > < body > < div class = " earth " > < div class = " mapWrapper " > < img src = " svg/worldMapSimplified.svg " /> </ div > < div class = " faceWrapper " > < div class = " eye left " > < div class = " whiteLeft " > </ div > < div class = " whiteRight " > </ div > </ div > < div class = " eye right " > < div class = " whiteLeft " > </ div > < div class = " whiteRight " > </ div > </ div > < div class = " blush left " > </ div > < div