<html>
<head>
<title>Animation</title>
<style type="text/css">
.container
{
background-color: blue;
height: 200px;
width: 200px;
position: relative;
-webkit-animation-name:animate;
-webkit-animation-duration:1s;
}
@-webkit-keyframes animate
{
0%
{
-webkit-transform: translate(0, 0);
}
100%
{
-webkit-transform: translate(100px, 100px);
}
}
</style>
</head>
<body>
<div class="container">
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
上面的代码对一个对象进行了动画处理,但动画结束后它返回到原始位置。如何将其保留在新位置?这意味着正方形不能返回到 (0,0)
如果输入是模式,则模式识别程序必须打印包含模式的所有行.如果输入是find -x pattern,则程序必须打印除包含pattern的行以外的所有行.
// .....
switch(c)
{
case 'x':
except=1;
break;
// ......
}
// ......
while(getline(line,MAXLINE)>0)
{
line_num++;
if( (strstr(line,*argv)!=NULL) != except)
{
if(number)
printf("%ld:",linenum);
printf("%s",line);
found++;
}
}
// ......
Run Code Online (Sandbox Code Playgroud)
在上面的代码来自K&R,除了可以是1或0. if(strstr...)
块函数如何有效地处理-x?
在Dennis Ritchie的"C编程语言"一书中,在getopop函数中,他声明s [1] ='\ 0'为什么他会在索引1上结束数组?有什么意义和需要?
在后面的部分,他确实使用了数组的其他部分..
int getch(void);
void ungetch(int);
/* getop: get next character or numeric operand */
int getop(char s[])
{
int i, c;
while ((s[0] = c = getch()) == ' ' || c == '\t')
;
s[1] = '\0';
if (!isdigit(c) && c != '.')
return c; /* not a number */
i = 0;
if (isdigit(c)) /* collect integer part */
while (isdigit(s[++i] = c = getch()))
;
if (c == '.') /* collect fraction …
Run Code Online (Sandbox Code Playgroud) esrsank@PG04954:~$ sudo apt-get install libc6-i386
Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies: build-essential :
Depends: libc6-dev but it is not going to be installed or
libc-dev
libc6-i386 : Depends: libc6 (= 2.15-0ubuntu10.6) but 2.15-0ubuntu10.10 is to be installed
libstdc++6-4.6-dev : Depends: libc6-dev (>= 2.13-0ubuntu6) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' …
Run Code Online (Sandbox Code Playgroud)