RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / 问题

全部问题

Martin Hope
AleksBak
Asked: 2020-02-21 18:44:37 +0000 UTC

为什么要声明一个具有相同类型的 typedef

  • 15

可能是一些 C 技巧。喜欢他们的课。看起来广告已经在那里了。也许这就是为什么?例如,这是一行(来自 OpenCV):

typedef struct CvFileStorage    CvFileStorage;

为什么要这样写?我没有立即找到任何方法来解决这个问题。曾经(几年前),我记得读过它。当时纯 C 可能很流行,但现在已经忘记了。我在 Windows CE6 和其他人的代码中也看到了类似的东西。我记得它:),但我不记得为什么我需要它。如果有任何额外的 应该带段代码,然后告诉我。此行位于在其字段中某处使用来自此 typedef 的类型的结构之前。但为什么要这样写而不只是声明呢?谢谢你。

c
  • 3 个回答
  • 10 Views
Martin Hope
Alexandr_TT
Asked: 2020-01-22 02:02:46 +0000 UTC

单击“停止”按钮时如何停止动画并冻结图像

  • 15

行星机构的动画。

当您按下按钮时,Stop齿轮旋转的动画应该停止并且图像“冻结”。但实际上,图像恢复到原来的状态。这可以从齿轮上的黄色标记看出。如何实现当您单击按钮Stop时,图像冻结在当前状态,而当您下次单击按钮GO时,动画不是从头开始,而是从固定状态开始。

答案 - 你需要删除黄色标记是不被接受的:-)

<style>
.container {
width:35vw;
height:35vh;
}
</style>
<div class="container">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink='http://www.w3.org/1999/xlink'  viewBox="0 0 400 400" >
  <title>animation planetary mechanism</title>
  <defs>
    <marker id="MarkerArrow" viewBox="0 0 20 20" refX="2" refY="5" markerUnits="userSpaceOnUse" orient="auto" markerWidth="20" markerHeight="20">
      <rect width="14" height="10" rx="2" fill="#22211D" />
    </marker>
    <line id="line1" x1="150" y1="100" x2="60" y2="100" style=" fill:none;
                 marker-end: url(#MarkerArrow);
                 marker-start: url(#MarkerArrow);
               stroke:#22211D; stroke-width:6; ">
    </line>
    <marker id="MarkerArrow-s" viewBox="0 0 20 20" refX="3" refY="1.7" markerUnits="userSpaceOnUse" orient="auto" markerWidth="20" markerHeight="20">
      <rect width="7" height="3.5" rx="2" fill="#22211D" />
    </marker>
    <line id="line-s" x1="175" y1="100" x2="202" y2="100" style=" fill:none;
             marker-end: url(#MarkerArrow-s1);
             marker-start: url(#MarkerArrow-s);
           stroke:#22211D; stroke-width:2; ">

    </line>
    <linearGradient id="vertical" x2="0%" y2="100%" spreadMethod="pad">
      <stop offset="0%" stop-color="powderblue" />
      <stop offset="100%" stop-color="lightgreen" />
    </linearGradient>

  </defs>
  <rect width="100%" height="100%" fill="url(#vertical)" />
  <g transform="translate(90,50)">

    <g id="wheel">
      <g>
        <animateTransform attributeName="transform" type="rotate" from="0 100 100" to="360 100 100" begin="gO1.click" end="stop1.click" dur="14s" repeatCount="indefinite" />
        <use xlink:href="#line1" transform="rotate(0 100 100)" />
        <use xlink:href="#line1" transform="rotate(120 100 100)" />
        <use xlink:href="#line1" transform="rotate(240 100 100)" />


        <circle cx="100" cy="100" r="15" style="stroke: #22211D; fill:none;   stroke-width: 4px;" />
        <circle cx="100" cy="100" r="50" style="stroke: #22211D; fill:none;   stroke-width: 15px;" />
        <circle cx="100" cy="100" r="60" style="stroke: #22211D; fill:none; stroke-dasharray: 5 6;  stroke-width: 10px;" />
        <circle cx="150" cy="100" r="3" style="stroke: #22211D; fill:yellow; " />
      </g>
    </g>

    <g id="col-small">

      <g>
        <animateTransform attributeName="transform" type="rotate" from="0 188 100" to="-360 188 100" begin="gO1.click" end="stop1.click" dur="3.5s" repeatCount="indefinite" />
        <use xlink:href="#line-s" transform="rotate(0 188 100)" />
        <use xlink:href="#line-s" transform="rotate(120 188 100)" />
        <use xlink:href="#line-s" transform="rotate(240 188 100)" />

        <circle cx="188" cy="100" r="8" style="stroke: #22211D; fill:none;   stroke-width: 4px;" />
        <circle cx="188" cy="100" r="18" style="stroke: #22211D; fill:none;   stroke-width: 7px;" />
        <circle cx="188" cy="100" r="24" style="stroke: #22211D; fill:none; stroke-dasharray: 5 5;  stroke-width: 10px;" />
        <circle cx="206" cy="100" r="3" style="stroke: #22211D; fill:yellow; " />

      </g>
    </g>
    <desc>animation planetary mechanism https://svg-art.ru in pure svg</desc>
    <g id="planetar">
      <g>
        <animateTransform attributeName="transform" type="rotate" from="0 100 100" to="-360 100 100" begin="gO1.click" end="stop1.click" dur="28s" repeatCount="indefinite" />

        <circle cx="100" cy="100" r="116" style="stroke: #22211D; fill:none;   stroke-dasharray: 5 5;  stroke-width: 10px;" />
        <circle cx="100" cy="100" r="124" style="stroke: #22211D; fill:none;   stroke-width: 12px;" />
        <circle cx="224" cy="100" r="3" style="stroke: #22211D; fill:yellow; " />
      </g>
    </g>

    <g>
      <use xlink:href="#col-small" transform="rotate(240 100 100)" />
      <use xlink:href="#col-small" transform="rotate(120 100 100)" />
    </g>

    <g transform="translate(-10,180)">
      <g id="gO1">
        <rect x="45" y="85" height="22" width="60" rx="5" fill="#0080B8" stroke="dodgerblue" />
        <text x="62" y="102" font-size="16" fill="yellow">GO</text>
      </g>
      <g id="stop1">
        <rect x="110" y="85" height="22" width="60" rx="5" fill="crimson" stroke="red" />
        <text x="120" y="102" font-size="16" fill="yellow">STOP</text>
      </g>
    </g>

  </g>
</svg> 
</div>

javascript
  • 3 个回答
  • 10 Views
Martin Hope
MaximPro
Asked: 2020-01-03 04:36:47 +0000 UTC

装配说明 LEA

  • 15

我不知道为什么,但这个汇编程序指令困扰着我LEA。

C++

int f(int t)
{
  return t+1;
}

int f(int*t)
{ 
  return *t+1;
}

int f(int& t)
{
  return t+1;
}

汇编器

f(int):                                  # @f(int)
        lea     eax, [rdi + 1]
        ret

f(int*):                                 # @f(int*)
        mov     eax, dword ptr [rdi]
        inc     eax
        ret

f(int&):                                 # @f(int&)
        mov     eax, dword ptr [rdi]
        inc     eax
        ret

如果命令MOV很清楚,那么命令LEA就不清楚了!

我知道指令LEA计算第二个操作数的地址并将其写入第一个操作数(我只知道这些)

在通过引用的示例中,即: lea eax,[rdi + 1]这显然不是地址计算,也不是第一个操作数的条目,不会有条目,但很可能是其他内容。还是我误解了什么?请按照C++代码解释。

PS 我搜索过,但没有找到我问题的详尽答案,我什至在卡拉什尼科夫冲锋枪的书中搜索过,但我什至没有在那里找到这个命令......嗯。

c++
  • 3 个回答
  • 10 Views
Martin Hope
iKey
Asked: 2020-12-29 05:29:04 +0000 UTC

在文本中查找数据库中的单词

  • 15

你好。数据库中有一张表slovo,它的结构是:

id - auto_increment 
name - само слово( уникальный )

有一个变量:$text,其中包含一些文本。

该表slovo有一个条目: id = 1, name = Apple , id = 2, name = tree

$text = "В корзине лежит яблоко. В поле стоит дерево.";

问题:如何判断变量中是否有表中的词,如果有,则在中slovo选择这些词<span id="id_slovo">слово</span>,其中id_slovo是这个词从数据库中的id值。

PS鉴于可能有短语。

如果有任何有用的信息,我将不胜感激。

php
  • 7 个回答
  • 10 Views
Martin Hope
Sibkedr
Asked: 2020-12-26 23:12:19 +0000 UTC

为什么 x = x++ 不会导致 x 在循环中递增?

  • 15
int x = 0;
while (x < 3) {
    x = x++;
    System.out.print(x + " ");
}

我理解如果是这样写y = x++的,那么先y赋值х,然后х加1。为什么表达式不会发生这种情况х = х++?

java
  • 4 个回答
  • 10 Views
上一页
下一页

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5