RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

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

Artem's questions

Martin Hope
Artem
Asked: 2024-11-20 17:23:40 +0000 UTC

SQL 错误 (1396):“root”@“localhost”的操作 CREATE USER 失败

  • 5

我无法向 root 用户添加从本地主机(即从服务器本身)访问的权限。

/* SQL 错误 (1396): 'root'@'localhost' 操作 CREATE USER 失败 */

我不明白这是什么废话?

现在的权利是:

在此输入图像描述

MySQL v5.7

mysql
  • 1 个回答
  • 24 Views
Martin Hope
Artem
Asked: 2023-07-19 17:46:59 +0000 UTC

从 ~/.config 目录中删除设置以及 deb 包

  • 5

该程序使用该目录来存储设置~/.config/ProgramName。我希望该命令在完全卸载时sudo apt-get purge ProgramName也删除设置文件夹。写了这个postrm脚本:

#!/bin/sh -e

case "$1" in
    purge)
        rm -r ~/.config/ProgramName
    ;;

    *)
    ;;
esac

exit 0

删除时出错:

rm:无法删除“/root/.config/ProgramName”:没有这样的文件或目录

由于某种原因,它在超级用户文件夹中查找目录,而不是当前用户。使用命令时,rm -r $HOME/.config/AutoScreenshot一切都是一样的。

如何修复它?

debian
  • 2 个回答
  • 23 Views
Martin Hope
Artem
Asked: 2022-01-10 18:58:59 +0000 UTC

替换 GIT 中的提交日期

  • 2

我想将现有存储库添加到 GitHub。由于它显示来自 CommitDate 字段的提交日期,因此我想将所有提交的 CommitDate 设置为等于 AuthorDate。git rebase找到命令的选项--committer-date-is-author-date。对所有提交执行,从最古老的提交开始。但是初始提交的日期没有改变。事实上,为什么?

user@PC ~/myrepo
$ git rebase --committer-date-is-author-date e727c96
First, rewinding head to replay your work on top of it...
Применение: Return correct error code in error callback
Применение: Move files to root folder

user@PC ~/myrepo
$ git rebase --committer-date-is-author-date 9e61101
First, rewinding head to replay your work on top of it...
Применение: Move files to root folder

user@PC ~/myrepo
$ git rebase --committer-date-is-author-date a0c1b7a
First, rewinding head to replay your work on top of it...
Fast-forwarded master to a0c1b7a.

user@PC ~/myrepo
$ git log --pretty=fuller
commit a0c1b7a9d5c331a088555567d20631d94c107523 (HEAD -> master, origin/master)
Author:     XXXX <xxxx@xxxx>
AuthorDate: Sun Jan 10 13:25:15 2021 +0300
Commit:     XXXX <xxxx@xxxx>
CommitDate: Sun Jan 10 13:25:15 2021 +0300

    Move files to root folder

commit 9e611015ee95fbacf0ee267e0770c1eeda28b8aa
Author:     XXXX <xxxx@xxxx>
AuthorDate: Sun Jun 14 21:34:58 2020 +0300
Commit:     XXXX <xxxx@xxxx>
CommitDate: Sun Jun 14 21:34:58 2020 +0300

    Return correct error code in error callback

commit e727c9609b0787d8b93f0570cd36389a36cc79f0
Author:     XXXX <xxxx@xxxx>
AuthorDate: Tue Mar 31 19:32:50 2020 +0300
Commit:     XXXX <xxxx@xxxx>
CommitDate: Sun Jan 10 13:16:23 2021 +0300

    Initial commit
git
  • 1 个回答
  • 10 Views
Martin Hope
Artem
Asked: 2020-04-03 01:03:33 +0000 UTC

Blender:将线框修改器应用于非实体对象

  • 0

我需要为网格对象的边缘添加体积,并使边缘不可见。为此,我使用了修饰符Wireframe。当对象未关闭(即缺少某些边缘)时,问题就开始了。在这种情况下,“洞”出现在结果框架中缺少面的边界处。

源对象: 前

应用修饰符后查看Wireframe: 后

这可以解决吗?

3d
  • 1 个回答
  • 10 Views
Martin Hope
Artem
Asked: 2020-12-08 23:58:58 +0000 UTC

将提交从一个分支移动到另一个分支的中间

  • 1

如何将提交从一个分支推送到 master,但在其他提交之前而不是最后插入它们?

在此处输入图像描述

git
  • 1 个回答
  • 10 Views
Martin Hope
Artem
Asked: 2020-01-29 09:42:36 +0000 UTC

在 Delphi 中写入文件时如何禁用缓冲?

  • 2

如何让数据在写新行时立即刷新到磁盘?

var
  f: textfile;
  i: integer;
begin
  AssignFile(f, 'file.txt');
  ReWrite(f);
  for i := 0 to 200 do
  begin
    WriteLn(f, 'string number ' + IntToStr(i));
    Sleep(1000);
  end;
  CloseFile(f);
end.
delphi
  • 1 个回答
  • 10 Views
Martin Hope
Artem
Asked: 2020-01-27 20:45:34 +0000 UTC

将 json 解析为从突触接收到的 dbxjson

  • 0

我通过 Synapse 以 UTF8 编码接收数据。然后它必须通过 StripNonJson 函数运行并将其“推”到 TJsonObject 类型的变量中。

function StripNonJson(s: string): string; // Убирает лишние пробелы из json-строки
var
  ch: char;
  inString: boolean;
begin
  Result := '';
  inString := false;
  for ch in s do
  begin
    if ch = '"' then
      inString := not inString;
    if TCharacter.IsWhiteSpace(ch) and not inString then
      continue;
    Result := Result + ch;
  end;
end;

function MemoryStreamToString(M: TMemoryStream): string;
begin
  SetString(Result, PChar(M.Memory), M.Size div SizeOf(Char));
end;


var
  json: TJSONObject;
  // ...

begin
  // ...

  with THTTPSend.Create do
  begin
    try
      MimeType := 'application/x-www-form-urlencoded';
      Document.LoadFromStream(data);
      if HTTPMethod('POST', 'http://httpbin.org/post') then
      begin
        WriteLn('res=' + MemoryStreamToString(Document));
        json := TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(StripNonJson(MemoryStreamToString(Document))), 0) as TJSONObject;

        if Assigned(Json) then
        begin
          WriteLn('Json parsed!');
        end
        else
        begin
          WriteLn('Error parsing JSON!');
        end;
      end
      else
      begin
        WriteLn('Request error: ' + IntToStr(ResultCode) + ' ' + ResultString);
      end;
    finally
      Free;
    end;
  end;

end.

Kryakozyabras 出现在屏幕上,json 变量自然为空。

据我了解,您需要将 Document 从 utf8 转换为 Delphi 2010 本机 unicode,但我不知道该怎么做。

delphi
  • 1 个回答
  • 10 Views
Martin Hope
Artem
Asked: 2020-11-30 09:03:02 +0000 UTC

如何在 Flexlider 中为单个幻灯片设置不同的暂停?

  • 0

我使用Flexslider插件来创建幻灯片。对于标准行为,所有幻灯片的暂停都是相同的,由参数设置slideshowSpeed。对这个问题感兴趣,如何确保每张幻灯片都有自己的暂停时间?我没有在文档中找到这个问题的答案。

javascript
  • 1 个回答
  • 10 Views
Martin Hope
Artem
Asked: 2020-11-17 07:06:07 +0000 UTC

将文件从 Unicode 转换为 Perl

  • 0

我有一个这样的 Unicode 文件(十六进制):

0000000 bbef 00bf 0041 0030 0030 0030 0020 0020
0000010 0020 0020 0020 0030 0030 0030 0030 0030
0000020 0030 0030 0030 0030 0030 0030 0031 0032
0000030 0036 0031 0035 0032 0030 0030 0034 0034
0000040 0032 0031 0035 0032 0030 0031 0036 0031
0000050 0031 0030 0032 0030 0030 0030 0030 0030
0000060 0030 0031 0026 004f 0046 0031 002e 0033
.....

需要转换成ISO-8859-8和CP862编码。我是这样转换的encode('ISO-8859-8', NFC(encode('UTF-8', $line))),但是对于这两种编码中的任何一种,文件都转换不正确。

在 ISO-8859-8 中:

0000000 bb3f 003f 0041 0030 0030 0030 0020 0020
0000010 0020 0020 0020 0030 0030 0030 0030 0030
0000020 0030 0030 0030 0030 0030 0030 0031 0032
0000030 0036 0031 0035 0032 0030 0030 0034 0034

在 CP862 中:

0000000 5c3f 7b78 3030 6661 5c7d 7b78 3030 3861
0000010 007d 0041 0030 0030 0030 0020 0020 0020
0000020 0020 0020 0030 0030 0030 0030 0030 0030
0000030 0030 0030 0030 0030 0030 0031 0032 0036

脚本:

#!/usr/bin/perl
no warnings;

use utf8;
#use open ':std', ':encoding(UTF-8)'; 
use Text::Iconv;
use Unicode::Normalize qw(NFC);
use Encode qw(encode decode from_to);
use feature 'say';

for $filename (glob('*.TXT')) {
    say "Where you want to save $filename in ISO-8859-8?";
    $newfilename1 = <>;
    chomp($newfilename1);

    say "Where you want to save $filename in CP862?";
    $newfilename2 = <>;
    chomp($newfilename2);

    open (FILE_IN, '<:encoding(utf8)', "$filename");
    open (FILE_OUT1, '>:encoding(ISO-8859-8)', "$newfilename1");
    open (FILE_OUT2, '>:encoding(CP862)', "$newfilename2");
    while ($line = <FILE_IN>) {
        $line = NFC(encode('UTF-8', $line));
        print FILE_OUT1 encode('ISO-8859-8', $line);
        print FILE_OUT2 encode('CP862', $line);
    }
    close (FILE_IN);
    close (FILE_OUT1);
    close (FILE_OUT2);
}

进行此转换的正确方法是什么?

perl
  • 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