我有一个 Visual Studio 2015 项目,它使用 afxcmn 标头,并且有很多“未定义”错误。
我在文档中读到这些数据类型包含在 commctrl.h 中,它已作为外部依赖项包含在 Visual Studio 项目中。
// Adds a group to the control.
AFX_ANSI_DEPRECATED int InsertGroup(_In_ int index, _In_ PLVGROUP pgrp);
// Sets information about the specified group (by ID) in the control.
AFX_ANSI_DEPRECATED int SetGroupInfo(_In_ int iGroupId, _In_ PLVGROUP pGroup);
// Retrieves information for the specified group in the control.
AFX_ANSI_DEPRECATED int GetGroupInfo(_In_ int iGroupId, _Out_ PLVGROUP pgrp) const;
Run Code Online (Sandbox Code Playgroud)
这是 afxcmn.h 的一些代码示例,它给出了这些错误。
我不知道是否必须在项目中配置其他内容以包含 commctrl 标头
我有以下 vimrc 配置,该配置对于 Python 文件运行良好:
execute pathogen#infect()
syntax on
filetype plugin indent on
set tabstop=4
Run Code Online (Sandbox Code Playgroud)
所以当我按 Tab 时,它是 4 个空格的别名。
但它似乎不适用于 JavaScript 文件。
当我按 Tab 时,它总是为每个缩进添加一个 Tab 加 2 个空格。我可以接受两个空格,但如何用 4 个空格替换该制表符?
所有代码都用空格缩进我不想开始添加制表符/空格混合
我知道您可以为特定文件指定制表符/空格,但我无法使其工作
autocmd FileType javascript setlocal shiftwidth=1 tabstop=4
Run Code Online (Sandbox Code Playgroud) 假设我正在测试属于Utils模块的函数
defmodule Test do
alias Module.Utils
test "test 1" do
Utils.some_function?(...)
end
test "test 2" do
Utils.some_function?(...)
end
end
Run Code Online (Sandbox Code Playgroud)
我可以将该函数重构或简化为:
import Utils.some_function as test_func()
Run Code Online (Sandbox Code Playgroud)
所以我不必编写模块名称并简化函数名称
为什么这个守卫不工作?
def method(stuff, %{}), do: stuff
Run Code Online (Sandbox Code Playgroud)
我必须检查地图大小才能使其正常工作?
def method(stuff, data) when map_size(data) == 0, do: stuff
Run Code Online (Sandbox Code Playgroud)
第一个守卫不应该匹配一张空地图吗?
像这样,在文档中有一个字段并对它进行散列(例如 md5)以生成_id:
PUT index/doc/1?pretty
{
"name": "foo",
"_id": "hash(doc['name'])"
}
Run Code Online (Sandbox Code Playgroud) 合并了一个分支后,我遇到了一些合并冲突。
我修复了它们,对于我修复的每个文件,我将其添加git add到合并提交中。
git add如果我后来通过运行代码意识到合并是错误的,我怎么能撤消其中一个文件?这一切之前commiting什么,该文件仍然添加和修改和未提交。
我正在尝试像这样初始化模块属性
response = HTTPoison.get! url
{:ok, response} = Poison.decode(response.body)
@attr response
Run Code Online (Sandbox Code Playgroud)
我以前用一个文件来做,就像这样:
@external_resource file = Path.join([__DIR__, "file.txt"])
Module.register_attribute __MODULE__, :attr, accumulate: true
for line <- File.stream!(file, [], :line) do
@attr line
...
Run Code Online (Sandbox Code Playgroud)
使用HTTPoison并获取API的响应是否一样?我收到此错误:
== Compilation error in file lib/module.ex ==
** (ArgumentError) argument error
(stdlib) :ets.lookup_element(:hackney_config, :mod_metrics, 2)
/project/deps/hackney/src/hackney_metrics.erl:27: :hackney_metrics.get_engine/0
/project/deps/hackney/src/hackney_connect.erl:69: :hackney_connect.create_connection/5
/project/deps/hackney/src/hackney_connect.erl:37: :hackney_connect.connect/5
/project/deps/hackney/src/hackney.erl:316: :hackney.request/5
lib/httpoison/base.ex:630: HTTPoison.Base.request/9
lib/httpoison.ex:66: HTTPoison.request!/5
lib/module.ex:4: (module)
Run Code Online (Sandbox Code Playgroud) 你怎么读:mnesia.info?
例如,我只有一张表,some_table,并:mnesia.info返回给我这个。
---> Processes holding locks <---
---> Processes waiting for locks <---
---> Participant transactions <---
---> Coordinator transactions <---
---> Uncertain transactions <---
---> Active tables <---
some_table: with 16020 records occupying 433455 words of mem
schema : with 2 records occupying 536 words of mem
===> System info in version "4.15.5", debug level = none <===
opt_disc. Directory "/home/ubuntu/project/Mnesia.nonode@nohost" is NOT used.
use fallback at restart = false
running db nodes = [nonode@nohost] …Run Code Online (Sandbox Code Playgroud) 例如,当一个非常大的地图上出现KeyError时,它不会显示所有地图并保持被截断的状态,因此它不会显示出现回溯的行,是否有某种方法可以启动phoenix.server允许进行更多的操作?
Server: localhost:4000 (http)
Request: GET someurl
** (exit) an exception was raised
** (KeyError) key :response not found in: %{conn_map}... (truncated)
Run Code Online (Sandbox Code Playgroud) 我正在使用bootstrap并遵循以下文档:
<div class="custom-file">
<input type="file" class="custom-file-input" id="customFileLang" lang="es">
<label class="custom-file-label" for="customFileLang">Seleccionar Archivo</label>
</div>
$custom-file-text: (
en: "Browse",
es: "Elegir"
);
Run Code Online (Sandbox Code Playgroud)
即使lang="es"添加了属性,输入文本也不会被翻译。
这里有一个Codepen,我想念什么?