RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

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

全部问题

Martin Hope
hedgehogues
Asked: 2022-01-25 22:31:54 +0000 UTC

jetbrains 重置。将试用版的设置重置最多 30 天

  • 16

如何将 JetBrains 产品的设置重置为试用版?

免责声明

请注意,此问题和答案仅用于教育目的,不构成任何行动呼吁。

必须购买任何付费软件

关于该问题的适当性的元讨论

ide
  • 2 个回答
  • 10 Views
Martin Hope
Егор Филатов
Asked: 2020-08-27 19:47:30 +0000 UTC

函数参数中`int()`和`int(*)()`的区别

  • 16

有什么区别:

int fun(int ()) {
    return 1;
}

和

int fun(int (*)()) {
    return 1;
}
c++
  • 3 个回答
  • 10 Views
Martin Hope
Дмитрий Полянин
Asked: 2020-02-14 15:53:16 +0000 UTC

带有卫星轨道的动画太阳

  • 16

我的任务是为太阳设置动画。
必须有闪光和小射线。光线应该像火焰一样燃烧并缓慢旋转。技术可以是任何东西:SVG、SMIL、JavaScript、CSS、Canvas、WebGl 或其他。

还需要使一颗行星围绕太阳旋转。这颗行星必须在这样的轨道上旋转,以使其在太阳后面的一部分飞行。

在此处输入图像描述

请告诉我如何做到这一点?

也接受部分解决方案的答案。例如:没有行星或没有射线。

总共应该有3个动画元素。

  1. 闪烁。
  2. 灯火如火。应该 a) 燃烧 b) 绕一圈旋转。
  3. 一个旋转的行星,其中一部分轨道跟随太阳。

PS:如果可以的话,我会尝试准备我的解决方案。

javascript
  • 7 个回答
  • 10 Views
Martin Hope
Sirop4ik
Asked: 2020-06-17 15:22:31 +0000 UTC

c++ 中的 foreach 和 std::for_each 有什么区别?

  • 16

我是 C++ 新手

我正在阅读一个示例,偶然发现了这样的结构std::for_each,但不明白为什么在有标准 for(val v : array) 时需要它?

运行时测试

#include <array>
#include <iostream>


#include <chrono>
#include <android/log.h>
#include <thread>
#include <fstream>
#include <utility>

using namespace std;
using namespace std::chrono;

void testDeleteIt() {
    std::vector<int> workers;

    for (int i = 0; i < 1000000; ++i) {
        workers.push_back(i);
    }

    int count = 0;

    high_resolution_clock::time_point t1 = high_resolution_clock::now();

    for (int &i : workers) {
        count += i;
    }

    __android_log_print(ANDROID_LOG_ERROR, "HERE", "HERE ::: %s", std::to_string(count).c_str());
    count = 0;

    long long int duration = duration_cast<microseconds>(high_resolution_clock::now() - t1).count();
    __android_log_print(ANDROID_LOG_ERROR, "TIME1", "TIME 1::: %s", std::to_string(duration).c_str());

    high_resolution_clock::time_point t2 = high_resolution_clock::now();


    std::for_each(workers.begin(), workers.end(), [&count](int &i) -> void {
        count += i;
    });

    count = 0;
    __android_log_print(ANDROID_LOG_ERROR, "HERE", "HERE ::: %s", std::to_string(count).c_str());

    duration = duration_cast<microseconds>(high_resolution_clock::now() - t2).count();
    __android_log_print(ANDROID_LOG_ERROR, "TIME2", "TIME 2 ::: %s", std::to_string(duration).c_str());
}

事实证明,标准循环的执行速度快了近 2 倍

TIME 1::: 10102
TIME 2 ::: 18459

再加std::for_each上 lambda 的麻烦

那么它的优势在哪里呢?

c++
  • 2 个回答
  • 10 Views
Martin Hope
Alexandr_TT
Asked: 2020-12-11 04:14:05 +0000 UTC

太阳系行星动画

  • 16

我有一张太阳系中行星的照片。

在此处输入图像描述

<circle>事实证明,这是在轨道和行星本身的命令的帮助下完成的。
使用线性和径向渐变来增加音量。
我发现了一个实现一个行星绕太阳旋转的 话题

.solar-system {
  background-color: #002;
  width: 50%;
  height: 50%;
}

.sun {
  fill: yellow;
  filter: url(#dropShadow);
}

.mercury-orbit {
  stroke: rgba(255, 255, 255, .4);
  stroke-width: 1;
  fill: none;
}

.mercury {
  fill: crimson;
  filter: url(#dropShadow2);
}
<div class="solar-system">
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 400"> 
  
  <defs>
    <filter 
      id="dropShadow"	
      x="-20%" y="-20%" 
      width="150%" height="150%">
      <feGaussianBlur stdDeviation="5" />
    </filter>
    <filter 
      id="dropShadow2" 
      x="-20%" y="-20%" 
      width="120%" height="120%">
      <feGaussianBlur stdDeviation="2" />
    </filter>
  </defs>
  
  <circle class="sun" cx="250" cy="175" r="25" /> 
  <g>
    <animateTransform 
      attributeName="transform" 
      type="rotate" 
      values="0 250 175;360 250 175" 
      dur="12s"
      repeatCount="indefinite" />
    <circle class="mercury-orbit" cx="250" cy="175" r="65" />
    <circle class="mercury" cx="185" cy="175" r="6" />
  </g>
  
</div>

但是,当您尝试为几个行星制作动画时,一切都会中断。只有最后添加的行星是可见的。如何为多个行星制作动画?

css
  • 1 个回答
  • 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