正确的语法是这样的:
#+PROPERTY: header-args :tangle "~/.config/emacs/init.el"
Run Code Online (Sandbox Code Playgroud)
但有一次,我有,而不是header-args,header-aegs。注意e代替r. 我遇到了可怕的tangled 0 code blocks事情。花了很多时间才找到错误。我的问题是:
flycheck?也许有组织模式 LSP 实现?为什么该语言没有语言服务器协议emacs-lisp?例如,lsp-modeEmacs 包包含对多种语言及其相关语言服务器的支持。但不是emacs-lisp。
为什么会这样?
包裹也是如此eglot。
pub struct ForesterViewModel {
m_tree_lines: Arc<Mutex<Vec<TreeLine>>>,
}
impl ForesterViewModel {
pub fn new() -> ForesterViewModel {
ForesterViewModel {
m_tree_lines: Arc::new(Mutex::new(vec![])),
}
}
pub fn get_the_forest(&mut self) -> &mut Vec<TreeLine> {
???????????????????????????????
}
}
Run Code Online (Sandbox Code Playgroud)
我需要帮助编写该get_the_forest函数。我尝试了很多不同的方法,但它们都返回编译错误。我需要返回一个可变引用,Vec<TreeLine>该引用被包装在self.m_tree_lines.
这是我的项目结构:
.git
src/
exe/
Main.hs
lib/
ModuleA/
ModuleB/
UnitTests/
UnitTests.hs
MainLib.hs
giter.cabal
Run Code Online (Sandbox Code Playgroud)
我有一个可执行文件,它唯一做的就是调用main库中的函数。以下是 的内容src/exe/Main.hs:
.git
src/
exe/
Main.hs
lib/
ModuleA/
ModuleB/
UnitTests/
UnitTests.hs
MainLib.hs
giter.cabal
Run Code Online (Sandbox Code Playgroud)
以下是giter.cabal文件的相关部分:
library
import: shared-properties
exposed-modules: MainLib
other-modules:
ModuleA
ModuleB
build-depends:
, brick
, directory
, fsnotify
hs-source-dirs: src/lib
executable giter
import: shared-properties
main-is: Main.hs
other-modules:
build-depends:
, giter
, base
, brick
hs-source-dirs: src/exe
test-suite giter-test
type: exitcode-stdio-1.0
hs-source-dirs: src/lib
main-is: UnitTests/UnitTests.hs
default-language: Haskell2010
other-modules:
ModuleA
ModuleB
build-depends:
, base
, …Run Code Online (Sandbox Code Playgroud) 我正在使用 Wix 创建我的安装程序。根据官方文档,如果我想更改添加/删除程序中的图标,我需要添加以下内容:
<Icon Id="icon.ico" SourceFile="MySourceFiles\icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
Run Code Online (Sandbox Code Playgroud)
但它不起作用,图标没有改变,我也收到以下警告:
C:\Users\rsheink\home\repos\tenlira\10Lira\TestWiXProject\Product.wxs(137,0):警告 LGHT1076:ICE36:图标膨胀。Icon icon.ico 不用于 Class、Shortcut 或 ProgID 表,也不用于 ARPPRODUCTICON 属性。
请问我错过了什么?
谢谢。雷法尔。
编辑: 按照@harper 的优秀建议,这里是MCVE:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:difx="http://schemas.microsoft.com/wix/DifxAppExtension">
<Product Id="*" Codepage="1252" Language="1033" Manufacturer="Intel Corporation"
Name="TenLira" UpgradeCode="PUT-GUID-HERE" Version="31.00.0000">
<Package Comments="Contact: Your local administrator" Description="TenLira" InstallerVersion="500"
Compressed="yes"
InstallScope="perMachine"
Keywords="Installer,MSI,Database" Languages="1033" Manufacturer="Intel Corporation" Platform="x64" />
<Media Id="1" Cabinet="my_application.cab" EmbedCab="yes" />
<MajorUpgrade AllowDowngrades="no"
AllowSameVersionUpgrades="no"
Disallow="no"
IgnoreRemoveFailure="no"
MigrateFeatures="yes"
Schedule="afterInstallInitialize"
DowngradeErrorMessage="A later version of [ProductName] is already installed" …Run Code Online (Sandbox Code Playgroud) 我有以下结构:
struct MyNewShinyStruct
{
int index;
std::string name;
};
Run Code Online (Sandbox Code Playgroud)
在calloc进入上面的结构然后将值赋给name:
char letters[128]{"ABCDEFG"};
auto temp = static_cast<MyNewShinyStruct*>(calloc(2, sizeof(MyNewShinyStruct)));
temp[0].name = letters;
Run Code Online (Sandbox Code Playgroud)
我应该在上面遇到麻烦:-)(我应该使用new运算符).'calloc`将已分配的内存清零,并且不调用struct/std :: sting的构造函数.但是,由于某些未知原因,上述代码在VS2010/2013/2015中的工作仅在VS2017中失败.应该总是失败!我错过了什么?
PS上面的代码已经生产(使用VS2010编译)多年,甚至没有报告过与此代码有关的错误,甚至没有一次.它总是奏效.
c++ memory-management undefined-behavior visual-studio visual-studio-2017
请看下面这段代码:
draw :: (Ord n, Show n) => StagedListVM n -> Widget n
draw state =
vLimit
(StagedListVM.rowsAmount state)
( renderList
( \_isSelected pairs ->
hBox $ map (someFunction _isSelected) pairs
)
(StagedListVM.isFocused state)
(StagedListVM.bricksList state)
)
where
someFunction _isSelected pair = StagedListVM.something
Run Code Online (Sandbox Code Playgroud)
我还有两段类似的代码:
draw :: (Ord n, Show n) => UnstagedListVM n -> Widget n
draw state =
vLimit
(UnstagedListVM.rowsAmount state)
( renderList
( \_isSelected pairs ->
hBox $ map (someFunction _isSelected) pairs
)
(UnstagedListVM.isFocused state)
(UnstagedListVM.bricksList state)
) …Run Code Online (Sandbox Code Playgroud) 该文件规定如下:
如果 ViewModel 需要 Application 上下文,例如查找系统服务,它可以扩展 AndroidViewModel 类并在构造函数中有一个接收 Application 的构造函数,因为 Application 类扩展了 Context。
代码示例:
class MainViewModel(application: Application) : AndroidViewModel(application) {
...
}
Run Code Online (Sandbox Code Playgroud)
两个问题:
Application给 ViewModel 的 ctor ,AndroidViewModel 如何帮助我?Application,为什么我需要 AndroidViewModel?我可以只使用 ViewModel 并传递它Application。操作系统:NixOS,通道不稳定。
\nNeovim:0.7.2。
\n哈斯克尔 LSP:haskell-language-server.
xmonad --recompile在终端中运行是有效的。
请帮忙 :-)
\n正如@ArtemPelenitsyn 在下面的评论中所询问的,这是我的init.lua:https: //pastebin.com/70jMHm02。\n我认为相关的部分:
require\'lspconfig\'.hls.setup{}\nRun Code Online (Sandbox Code Playgroud)\n我认为它与 NixOS 更相关,而不是 Neovim。
\n正如@Ben 在下面的评论中所询问的,以下是所需的信息:
\n\xce\xbb ghci\nGHCi, version 9.0.2: https://www.haskell.org/ghc/ :? for help\nghci> import XMonad\n\n<no location info>: error:\n Could not find module \xe2\x80\x98XMonad\xe2\x80\x99\n It is not a module in the current program, or in any known package.\nghci> \nRun Code Online (Sandbox Code Playgroud)\n这是我的configuration.nix中与Haskell和XMonad相关的所有内容:
\n\xce\xbb ghci\nGHCi, version 9.0.2: https://www.haskell.org/ghc/ …Run Code Online (Sandbox Code Playgroud) class ImageFormat format => Readable img format where
decode :: format -> B.ByteString -> Either String img
Run Code Online (Sandbox Code Playgroud)
我不明白第一个参数应该是什么?例子会有所帮助。