有人可以向我解释MIX中的划分(来自Knuth的TAOCP)是如何在字节到字节的基础上工作的?
rA = |-| . . . .0|
rX = |+|1235|0|3|1|
Run Code Online (Sandbox Code Playgroud)
存储位置1000包含|-|0|0|0|2|0|.
执行操作时
DIV 1000
Run Code Online (Sandbox Code Playgroud)
寄存器变成了
rA = |+|0|617|?|?|
rX = |-|0|0|0|?|1|
Run Code Online (Sandbox Code Playgroud)
现在我明白上的标志rA和rX,但以什么顺序的字节rAX填充和部门完成?
如果DIV 1000导致每一位除以2,那么我会期待
rAX = |+|617|0|1|0|-|0|1|0|1|1|
Run Code Online (Sandbox Code Playgroud)
其中rA包含除法结果和rX余数(从右侧填充).
我可能在这里遗漏了一些东西,而Knuth似乎认为我应该能够自己解决这个问题(因此关于它的10级问题,我也没有得到),但有人可以帮助我吗?
嗨我的第一个问题......我开始阅读'计算机程序设计的艺术'.我知道这很难.首先,我决定使用书的语言 - 我从MIX开始.我做了一些练习,我想我可以管理书中的程序.但问题是我写的每个地方,MIX是旧的,学习MMIX等等.好的,但为什么 - 这是我的问题?我正在学习1个Moth MIX,我开始理解书中的问题,现在又停止工作并再次开始学习新的ASM,为什么?说,MIX已经老了,但如果我花时间学习MMIX,那么本书中的所有代码都是MIX我必须再次重写问题,我认为这对我来说非常困难.MIX是否太老了,我真的必须学习新版本?有一些对TAOCP有更多经验的人可以给我一个建议:继续书 - 例子,问题等在MIX或Stop中学习MMIX.当然,如果我做第一个或第二个选择,我会赢得什么?
Elixir&Mix都希望将服务器作为守护进程.一直未能找到正确的方法.
另外,我想使用erlang reltool.
在Phoenix Framework项目中包含外部存储库时,可以传递Github选项:
{:example, "~> 0.9.9", github: "somewhere/example"}
Run Code Online (Sandbox Code Playgroud)
是否有包含本地存储库的选项,类似于Gemfile中的Rails约定?
gem 'somewhere', '0.0.2', :path => 'some/local/directory'
Run Code Online (Sandbox Code Playgroud) 我有一个在heroku上运行的elixir(混合)应用程序
我在将远程iex shell附加到此应用程序时遇到问题
该应用程序通过以下命令启动:
web: MIX_ENV=prod elixir --sname server -S mix run --no-halt
Run Code Online (Sandbox Code Playgroud)
我在本地附加shell没有问题
MIX_ENV=prod elixir --sname server -S mix run --no-halt
iex --sname console --remsh server@mru2
Run Code Online (Sandbox Code Playgroud)
但是,在heroku上尝试时,我遇到了以下问题:
heroku run "iex --sname console --remsh server@41959264-bef2-4d2e-b5de-6dcf618efa44"
Running `iex --sname console --remsh server@41959264-bef2-4d2e-b5de-6dcf618efa44` attached to terminal... up, run.4421
Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
Could not contact remote node server@41959264-bef2-4d2e-b5de-6dcf618efa44, reason: :nodedown. Aborting...
Run Code Online (Sandbox Code Playgroud)
似乎启动的实例heroku run无法连接到运行服务器的实例.我试过强制执行一个常见的cookie,但无济于事.
我错过了什么?
我想在Ubuntu安装灵药......我曾跟随这个指令。
一切似乎都很好,但是当我尝试执行混合命令时,系统向我显示以下内容:
bash: /usr/bin/mix: No such file or directory
Run Code Online (Sandbox Code Playgroud)
谢谢。
我成功地实例化了两个Heroku应用程序:my-app-prod和my-app-test.我在Heroku应用程序设置中配置了特定的环境变量.我在Phoenix使用标准配置文件:config.exs,test.exs,prod.exs,dev.exs.
在Heroku中使用app变量MIX_ENV = test配置my-app-test后,它仍然从prod.exs加载变量.
我还缺少任何额外的步骤,以便我的应用程序使用test.exs吗?
我按照这里的所有说明操作:https: //hexdocs.pm/phoenix/heroku.html
当我运行git push时,我可以根据以下输出验证它是否正在使用prod.exs.
remote: Generated my_phoenix_app_name app
remote: -----> Creating .profile.d with env vars
remote: -----> Writing export for multi-buildpack support
remote: -----> Executing post compile: pwd
remote: /tmp/build_f5b9e6e5890fcb58b9689f433c554c6a
remote: -----> Phoenix app detected
remote:
remote: -----> Loading configuration and environment
remote: Loading config...
remote: Detecting assets directory
remote: * package.json found in custom directory
remote: Will use phoenix configuration:
remote: * assets path .
remote: * mix tasks namespace phoenix
remote: …Run Code Online (Sandbox Code Playgroud)我在Windows上,正在尝试安装bcrypt_elixir模块。
我收到以下错误:
$ mix phx.server
==> bcrypt_elixir
could not compile dependency :bcrypt_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile bcrypt_elixir", update it with "mix deps.update bcrypt_elixir" or clean it with "mix deps.clean bcrypt_elixir"
** (Mix) "nmake" not found in the path. If you have set the MAKE environment variable,
please make sure it is correct.
Run Code Online (Sandbox Code Playgroud)
这是错误的终端屏幕截图:
这是我的deps功能mix.exs:
defp deps do
[
{:phoenix, "~> 1.3.0"},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_ecto, "~> 3.2"},
{:postgrex, ">= …Run Code Online (Sandbox Code Playgroud) 我的 Elixir 应用程序中有一些文件,我想从测试覆盖率报告中排除它们。我现在没有使用任何花哨的覆盖工具;(尽管我并不排除使用此类工具的可能性)我mix test --cover现在只是在使用。
如何告诉覆盖率分析工具给定的文件不应包含在覆盖率分析中?
I'm not sure when to use mix and when to use phoenix for creating umbrella applications.
I have read a lot of articles online but they are not clear of the reasoning for using mix over phoenix and vis versa.
mix gives:
- apps/
- config/
Run Code Online (Sandbox Code Playgroud)
phoenix gives:
- build/dev/(consolidated/lib)
- apps/(app_name/app_name_web)
- config/(configs for different envs)
- deps/(stuffffff)
Run Code Online (Sandbox Code Playgroud)
mix new [UMBRELLA NAME] --umbrella VS mix phx.new [UMBRELLA NAME] --umbrella
If I want to generate an umbrella that has an …