糖粟与秋泊

文章 评论 浏览 27

糖粟与秋泊 2025-02-11 08:52:17

如果您使用 brew ,也许您应该使用 brew卸载binutils ...

If you use brew, maybe you should use brew uninstall binutils...

链接库时的错误:Macos-Arm64构建,但试图与为MacOS-ARM构建的文件链接

糖粟与秋泊 2025-02-10 23:27:29

如果负载平衡器将请求发送到容器,则最好让 src 成为加载平衡器的IP。

在您的容器中,要获取启动此请求的客户端的IP地址,请查找标题 x-forwarded-for (在您的情况下,这将是IP 192.xxxx )。

If the load balancer is sending the request to the container, it is best to let the src be the IP of the load balancer.

In your container, to get the IP address of the client who initiated this request, look for the header X-Forwarded-For (in your case, this will be the IP 192.x.x.x).

如何在Nginx UDP LoadBalancer中添加Proxy_pass_header参数到Preserver目标IP

糖粟与秋泊 2025-02-10 20:13:30

,但我遇到了

**(退出)过程试图自称

意思:

defmodule GenServer1 do
  use GenServer
  
  @impl true
  def init(_) do
    server_pid1 = self() 
    server_pid2 = GenServer2.start()
    {:ok, [server_pid1, server_pid2] }
  end

  @impl true
  def handle_call(:update, _from, all_servers) do
    update(all_servers)
    {:reply, :hello, all_servers}
  end
  def handle_call(:do_stuff, _from, all_servers) do
    {:reply, :goodbye, all_servers}
  end

  def update(all_servers) do
    Enum.each(all_servers, fn server -> GenServer.call(server, :do_stuff) end)
  end

  ## Public api:

  def start do
    GenServer.start_link(GenServer1, 0)
  end

  def initiate_update(pid) do
    GenServer.call(pid, :update)
  end

end

defmodule GenServer2 do
  use GenServer

  @impl true
  def init(state) do
    {:ok, state}
  end

  @impl true
  def handle_call(:do_stuff, _from, state) do
    {:reply, state}
  end

  #Public api:
  
  def start() do
    GenServer.start_link(GenServer2, 0)
  end
end

在iex中:

iex(1)> {:ok, gen_server1} = GenServer1.start   
{:ok, #PID<0.152.0>}
iex(2)> GenServer1.initiate_update(gen_server1) 

01:06:24.113 [error] GenServer #PID<0.152.0> terminating
** (stop) exited in: GenServer.call(#PID<0.152.0>, :do_stuff, 5000)
    ** (EXIT) process attempted to call itself  <------
          ^   ^    ^     ^    ^
          |   |    |     |    |

    (elixir 1.13.4) lib/gen_server.ex:1023: GenServer.call/3 
    (elixir 1.13.4) lib/enum.ex:937: Enum."-each/2-lists^foreach/1-0-"/2
    (gen_server1 0.1.0) lib/gen_server1.ex:13: GenServer1.handle_call/3
    (stdlib 3.17.2) gen_server.erl:721: :gen_server.try_handle_call/4
    (stdlib 3.17.2) gen_server.erl:750: :gen_server.handle_msg/6
    (stdlib 3.17.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message (from #PID<0.150.0>): :update
State: [#PID<0.152.0>, {:ok, #PID<0.153.0>}]
Client #PID<0.150.0> is alive

    (stdlib 3.17.2) gen.erl:233: :gen.do_call/4
    (elixir 1.13.4) lib/gen_server.ex:1027: GenServer.call/3
    (stdlib 3.17.2) erl_eval.erl:685: :erl_eval.do_apply/6
    (elixir 1.13.4) src/elixir.erl:296: :elixir.recur_eval/3
    (elixir 1.13.4) src/elixir.erl:274: :elixir.eval_forms/3
    (iex 1.13.4) lib/iex/evaluator.ex:310: IEx.Evaluator.handle_eval/3
    (iex 1.13.4) lib/iex/evaluator.ex:285: IEx.Evaluator.do_eval/3
    (iex 1.13.4) lib/iex/evaluator.ex:274: IEx.Evaluator.eval/3
** (EXIT from #PID<0.150.0>) shell process exited with reason: exited in: GenServer.call(#PID<0.152.0>, :do_stuff, 5000)
    ** (EXIT) process attempted to call itself

Interactive Elixir (1.13.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 

不要从 handle> handle> handle_call 中调用 handle_call - 创建一个永远不会返回的僵局。 Elixir友善地发现了僵局和错误。我认为发生僵局是因为第一个句柄调用直到第二个句柄返回后才能返回,但是第二个句柄_call无法返回,因为一个过程一次只能处理一条消息,而当它处理第一个handle_call的消息时,它不允许处理第二个handle_call的消息。因此,第二个handle_call必须等待处理第一个handle_call的消息,但是当处理程序返回时,消息的处理结束。

我必须召集一个处理它的全新过程吗?

您可能可以在笔记本电脑上同时运行4亿次Erlang流程,如果您必须启动另一个流程,您是否在乎什么?

But I run into

** (EXIT) process attempted to call itself

You mean like this:

defmodule GenServer1 do
  use GenServer
  
  @impl true
  def init(_) do
    server_pid1 = self() 
    server_pid2 = GenServer2.start()
    {:ok, [server_pid1, server_pid2] }
  end

  @impl true
  def handle_call(:update, _from, all_servers) do
    update(all_servers)
    {:reply, :hello, all_servers}
  end
  def handle_call(:do_stuff, _from, all_servers) do
    {:reply, :goodbye, all_servers}
  end

  def update(all_servers) do
    Enum.each(all_servers, fn server -> GenServer.call(server, :do_stuff) end)
  end

  ## Public api:

  def start do
    GenServer.start_link(GenServer1, 0)
  end

  def initiate_update(pid) do
    GenServer.call(pid, :update)
  end

end

defmodule GenServer2 do
  use GenServer

  @impl true
  def init(state) do
    {:ok, state}
  end

  @impl true
  def handle_call(:do_stuff, _from, state) do
    {:reply, state}
  end

  #Public api:
  
  def start() do
    GenServer.start_link(GenServer2, 0)
  end
end

In iex:

iex(1)> {:ok, gen_server1} = GenServer1.start   
{:ok, #PID<0.152.0>}
iex(2)> GenServer1.initiate_update(gen_server1) 

01:06:24.113 [error] GenServer #PID<0.152.0> terminating
** (stop) exited in: GenServer.call(#PID<0.152.0>, :do_stuff, 5000)
    ** (EXIT) process attempted to call itself  <------
          ^   ^    ^     ^    ^
          |   |    |     |    |

    (elixir 1.13.4) lib/gen_server.ex:1023: GenServer.call/3 
    (elixir 1.13.4) lib/enum.ex:937: Enum."-each/2-lists^foreach/1-0-"/2
    (gen_server1 0.1.0) lib/gen_server1.ex:13: GenServer1.handle_call/3
    (stdlib 3.17.2) gen_server.erl:721: :gen_server.try_handle_call/4
    (stdlib 3.17.2) gen_server.erl:750: :gen_server.handle_msg/6
    (stdlib 3.17.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message (from #PID<0.150.0>): :update
State: [#PID<0.152.0>, {:ok, #PID<0.153.0>}]
Client #PID<0.150.0> is alive

    (stdlib 3.17.2) gen.erl:233: :gen.do_call/4
    (elixir 1.13.4) lib/gen_server.ex:1027: GenServer.call/3
    (stdlib 3.17.2) erl_eval.erl:685: :erl_eval.do_apply/6
    (elixir 1.13.4) src/elixir.erl:296: :elixir.recur_eval/3
    (elixir 1.13.4) src/elixir.erl:274: :elixir.eval_forms/3
    (iex 1.13.4) lib/iex/evaluator.ex:310: IEx.Evaluator.handle_eval/3
    (iex 1.13.4) lib/iex/evaluator.ex:285: IEx.Evaluator.do_eval/3
    (iex 1.13.4) lib/iex/evaluator.ex:274: IEx.Evaluator.eval/3
** (EXIT from #PID<0.150.0>) shell process exited with reason: exited in: GenServer.call(#PID<0.152.0>, :do_stuff, 5000)
    ** (EXIT) process attempted to call itself

Interactive Elixir (1.13.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 

Don't call handle_call from within a handle_call--that creates a deadlock that will never return. Elixir kindly detects that deadlock and errors out. I think the deadlock happens because the first handle call can't return until the second handle_call returns, but the second handle_call can't return because a process can only deal with one message at a time, and while it's dealing with the first handle_call's message, it does not allow the second handle_call's message to be processed. So, the second handle_call has to wait for the first handle_call's message to be processed, but processing of a message ends when the handler returns.

Do I have to call out to an entirely new process which handles it?

You can probably run 400 million erlang processes at the same time on your laptop, what do you care if you have to start another process?

**(退出)过程试图自行调用,当我有孩子迭代时

糖粟与秋泊 2025-02-10 14:26:05

我会尝试这样的事情:

a = [[1,2,3],[2,3,4],[5,6,7],[7,8,9]]
b = [1,2]

result = [lst for lst in a if any(x in lst for x in b)]

I would try something like this:

a = [[1,2,3],[2,3,4],[5,6,7],[7,8,9]]
b = [1,2]

result = [lst for lst in a if any(x in lst for x in b)]

基于Python中的其他列表,列表理解的过滤嵌套列表

糖粟与秋泊 2025-02-10 07:39:43

对于任何在运行迁移中挣扎但您的数据库在您的Laravel应用程序之前都没有启动的任何人,只想提及我使用了wation-in-in-in-in-in-in-it-it-it-it脚本,并更改​​了我的Dockerfile中的最后一行代码:

CMD ["/var/www/docker/wait-for-it.sh", "db:3306", "--", "/var/www/docker/run.sh"]

所以现在我的迁移将会首先等待数据库启动并运行。
只需将Wait-tor-it.sh放在Docker文件夹中,或直接从Github使用它即可。

for anyone struggling with running migrations but your database isn't up before your Laravel application, just want to mention that I've used wait-for-it script and changed last line of code in my Dockerfile like this:

CMD ["/var/www/docker/wait-for-it.sh", "db:3306", "--", "/var/www/docker/run.sh"]

So now my migrations will first wait for database to be up and running.
Just put wait-for-it.sh inside of your docker folder or use it from github directly.

Laravel容器启动时如何运行DB迁移?

糖粟与秋泊 2025-02-09 03:21:43

您的应用程序包裹在电子中还是类似? Github讨论一个可能有帮助或至少给您一些线索的问题存在问题。 React Dev工具4.25使用的Chrome清单V2,而最新版本使用清单V3-依靠它且尚未解决此更改的技术变化 https://github.com/facebook/react/issues/25843

Is your app wrapped in Electron or similar? There is an issue on GitHub discussing a problem that may be of some help or at least give you some clues. React Dev Tools 4.25 used chrome manifest V2, and more recent versions use manifest V3 - a breaking change for technologies that rely on it and haven't yet addressed this change https://github.com/facebook/react/issues/25843 .

如何降级React DevTools Chromium扩展版本?

糖粟与秋泊 2025-02-09 02:52:34

如果($ this-&gt; router--&gt; fetch_class (

)=='您的类名称'){'您的脚本}

You do with a particular class like you can check your current class and match it like this

if ($this->router->fetch_class() == 'YOUR CLASS NAME'){'Your script}

如何在CodeIgniter的特定页面中运行自定义JavaScript代码?

糖粟与秋泊 2025-02-09 00:02:49

答案在

这是相关段落:

单键更新是原子。例如,如果您从一个线程中向现有密钥提出请求,并同时从第二个线程上执行同一密钥上的GET请求,则您将获取旧数据或新数据,但绝不会部分或损坏数据。

这清楚地表明,您 get 的数据不会像标准文件那样被覆盖。您也不知道它是旧实例还是新实例(除非您定义某些元数据或文件中有日期或序列号)。

但是,在处理大文件时,api 这意味着您最终可能会复制旧文件和新文件的一部分的一部分。为了避免问题,您必须确保在不使用多个副本的情况下进行副本。

The answer is in the Amazon S3 User Guide in the Consistency Model.

Here is the pertinent paragraph:

Updates to a single key are atomic. For example, if you make a PUT request to an existing key from one thread and perform a GET request on the same key from a second thread concurrently, you will get either the old data or the new data, but never partial or corrupt data.

This clearly says that the data you GET will not be overwritten as in the case of a standard file. You also won't know whether it is the old or new instance (unless you define some metadata or have a date or serial number in the file).

However, when dealing with large files, the API automatically switches to multi-part uploads and that means you may end up copying part of the old file and parts of the new file. To avoid the issue, you must make sure to do a copy without using multiparts.

在已经加载副本时更新时,S3文件会发生什么?

糖粟与秋泊 2025-02-08 20:28:20

这是因为您的最终IF statement在Enter上被击中。

if (
      val.length > 1 &&
      val[1].length == 2 &&
      event.target.selectionStart > index &&
      event.code != 'Delete' &&
      event.code != 'Backspace' &&
      event.code != 'Tab'
    ) {
      event.preventDefault();
      return false;
    }

只需将其添加到它:
&amp;&amp; event.code!='enter'

解决方案

This is because your final if-statement is being hit on enter.

if (
      val.length > 1 &&
      val[1].length == 2 &&
      event.target.selectionStart > index &&
      event.code != 'Delete' &&
      event.code != 'Backspace' &&
      event.code != 'Tab'
    ) {
      event.preventDefault();
      return false;
    }

Just add this to it:
&& event.code != 'Enter'

solution

如何使用Angular13进行输入密钥按下保存

糖粟与秋泊 2025-02-07 23:26:33

也许这样的东西:

f <- function(v1,v2,s) {
  s[cumsum(abs(v1)+abs(v2))==0] <- "END"
  s
}

setDT(data1)[order(-Period), State1:=f(Values_1, Values_2, State), by=ID]

输出:

    ID Period Values_1 Values_2 State State1
 1:  1      1        5        5    X0     X0
 2:  1      2        0        2    X1     X1
 3:  1      3        0        0    X2     X2
 4:  1      4        0       12    X1     X1
 5:  2      1        1        2    X0     X0
 6:  2      2       -1        0    X2     X2
 7:  2      3        0        1    X0     X0
 8:  2      4        0        0    X0    END
 9:  3      1        0        0    X2     X2
10:  3      2        0        0    X1     X1
11:  3      3        0        0    X9     X9
12:  3      4        0        2    X3     X3
13:  4      1        1        4    X2     X2
14:  4      2        2        5    X1     X1
15:  4      3        3        6    X9     X9
16:  4      4        0        0    X3    END

Perhaps something like this:

f <- function(v1,v2,s) {
  s[cumsum(abs(v1)+abs(v2))==0] <- "END"
  s
}

setDT(data1)[order(-Period), State1:=f(Values_1, Values_2, State), by=ID]

Output:

    ID Period Values_1 Values_2 State State1
 1:  1      1        5        5    X0     X0
 2:  1      2        0        2    X1     X1
 3:  1      3        0        0    X2     X2
 4:  1      4        0       12    X1     X1
 5:  2      1        1        2    X0     X0
 6:  2      2       -1        0    X2     X2
 7:  2      3        0        1    X0     X0
 8:  2      4        0        0    X0    END
 9:  3      1        0        0    X2     X2
10:  3      2        0        0    X1     X1
11:  3      3        0        0    X9     X9
12:  3      4        0        2    X3     X3
13:  4      1        1        4    X2     X2
14:  4      2        2        5    X1     X1
15:  4      3        3        6    X9     X9
16:  4      4        0        0    X3    END

如何将一个和操作员嵌入数据中。表函数?

糖粟与秋泊 2025-02-07 14:49:05

如果您有Windows环境&amp; Office 365您可以使用以下内容:

=LET(split,FILTERXML("<a><b>"&SUBSTITUTE(SUBSTITUTE(FORMULATEXT(A1),"=",""),"*","</b><b>")&"</b></a>","//b"),
        char,LOWER(LEFT(split,1)),
        row,MID(split,FIND("!A",split)+2,LEN(split))-1,
"="&TEXTJOIN("*",1,char&row))

FilterXml()用于在每个*上将文本分开。
拆分的结果用于获取第一个字符(并将其更改为较低的情况),并在!a 后面找到字符串,这是行号(并从中提取1)。
然后textjoin()加入计算的字符和行号,并在每个字符之间放置*

ps如果 a1 是实际公式,而不是替换 a1 form> formulatext(a1)

(有关FilterXml的更多信息可以在JVDV的这篇文章中找到: https://stackoverflow.com/a/61837697

)这仅提供了现在问题的部分答案。答案是基于:

If you have a Windows environment & Office 365 you could use the following:

=LET(split,FILTERXML("<a><b>"&SUBSTITUTE(SUBSTITUTE(FORMULATEXT(A1),"=",""),"*","</b><b>")&"</b></a>","//b"),
        char,LOWER(LEFT(split,1)),
        row,MID(split,FIND("!A",split)+2,LEN(split))-1,
"="&TEXTJOIN("*",1,char&row))

FILTERXML() is used to split the text at each *.
Thee result of the split is used to get the first Character (and change it to lower case) and to find the string behind !A, which is the row number (and substract 1 from it).
Then TEXTJOIN() joins the calculated character and row number and places a * between each.

enter image description here

PS if A1 is an actual formula than replace A1 with FORMULATEXT(A1)

(More info on FILTERXML can be found in this post by JvdV: https://stackoverflow.com/a/61837697)

EDIT: I see the question was updated and this only provides an answer to part of the question now. Answer was based on :
enter image description here

如何根据表名称和具有IDS的ID替换公式文本,以固定的列名称

糖粟与秋泊 2025-02-06 19:19:58

尝试将Laravel脚本移至网络托管根目录(通常是www,htdocs或public_html)中,然后重试。
通常,Livewire需要Laravel从Web托管的根部加载而不是子目录。
检查附件的图像,如果您在浏览器控制台中看到类似的错误,您知道这是修复它的方法。

Try moving your laravel scripts into your web hosting root directory, (usually www, htdocs or public_html) and then retry.
Oftentimes, livewire needs laravel to load from the root of the web hosting instead of a subdirectory.
Check the attached image, if you see a similar error in your browser console you know this is the way to fix it.

未接收参考:未使用Laravel 8定义Livewire

糖粟与秋泊 2025-02-06 09:54:51

打开 :
your_ip_or_domain/phpmyadmin/prefs_forms.php?form =功能,

然后将选项值(发送错误报告)放在选项上(切勿发送错误报告)。

open :
your_ip_or_domain/phpmyadmin/prefs_forms.php?form=Features

Then put the value of the option (Send error reports) on the option (Never send error reports).

phpmyadmin折旧通知通知PHP 8

糖粟与秋泊 2025-02-06 02:49:40

通过网络发送或写入磁盘或持续存在的所有数据都应与火花DAG一起序列化。因此,Kryo序列化缓冲区必须大于您尝试序列化的任何对象,并且必须小于2048m。

https://spark.apache.org/docs.org/docs/latest/tuning。 html#数据序列化

All data that is sent over the network or written to the disk or persisted in the memory should be serialized along with the spark dag. Hence, Kryo serialization buffer must be larger than any object you attempt to serialize and must be less than 2048m.

https://spark.apache.org/docs/latest/tuning.html#data-serialization

如何调查Spark中发生的Kryo缓冲区溢出?

糖粟与秋泊 2025-02-06 01:30:43

在Java中,您不能分配一个非初始化的数组。

您可以使用Unsafe.AlocateMory方法分配非初始化的内存,该方法将返回指针,但这是一个私有API ,它可能在任何时候都无法使用,并且已经部分不可用 jep 403

In Java you cannot allocate an uninitialized array.

You can allocate uninitialized memory with the Unsafe.allocateMemory method, which will return a pointer, but this is a private API that may become unavailable at any time and it is already partially unavailable JEP 403.

在O(1)时间初始化Java的阵列

更多

推荐作者

佚名

文章 0 评论 0

今天

文章 0 评论 0

゛时过境迁

文章 0 评论 0

达拉崩吧

文章 0 评论 0

呆萌少年

文章 0 评论 0

孤者何惧

文章 0 评论 0

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文