在我的TODO中获得了新项目,无法选择F#或Nemerle.
我目前正在学习F#并在Nemerle上有一些项目.
我喜欢F#方式,我喜欢默认缩进(我也希望默认缩进为nemerle2),我喜欢F#的许多功能和魔力,但是没有宏.
F#的目标是VS2010,也许(可能)更大的开发团队,它看起来像Haskell(可以用它创建轻松的Linux程序,它很有趣).
Nemerle的目标是宏,我想我更喜欢Nemerle的一些语法.
而且大多数人都喜欢C#......
就像我喜欢(Nemerle)
match(STT)
| 1 with st= "Summ"
| 2 with st= "AVG" =>
$"$st : $(summbycol(counter,STT))"
Run Code Online (Sandbox Code Playgroud)
更多(F#)
let (|Let|) v e = (v, e)
match stt with
| Let "Summ" (st, 1)
| Let "AVG" (st, 2) -> srintf "%s ..." st
Run Code Online (Sandbox Code Playgroud)
F# :
["A"; "B"] |> List.iter (fun s -> printfn "%d" s.Length)
Run Code Online (Sandbox Code Playgroud)
Nemerle:
["A", "B"].Iter(x => printf("%d", x.Length))
Run Code Online (Sandbox Code Playgroud)
F#(希望不要误会):
let type X =
let mytable a = …Run Code Online (Sandbox Code Playgroud) 用于ARM目标系统的cmake(在Windows上)的编译选项,但是当我运行configure时,它开始编译器测试:
CMake Error at D:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "D:/Program Files/yagarto/bin/arm-none-eabi-gcc.exe" is not
able to compile a simple test program.
It fails with the following output:
Change Dir: D:/merge/complex/build/CMakeFiles/CMakeTmp
Run Build Command:D:/PROGRA~1/YAGART~1/bin/make.exe "cmTryCompileExec/fast"
D:/PROGRA~1/YAGART~1/bin/make.exe -f
CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
make.exe[1]: Entering directory
`D:/merge/complex/build/CMakeFiles/CMakeTmp'
"D:/Program Files/CMake 2.8/bin/cmake.exe" -E cmake_progress_report
D:/merge/complex/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o
"D:/Program Files/yagarto/bin/arm-none-eabi-gcc.exe" -o
CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c
D:/merge/complex/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTryCompileExec
"D:/Program Files/yagarto/bin/arm-none-eabi-gcc.exe"
"CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o" -o cmTryCompileExec
-rdynamic
arm-none-eabi-gcc.exe: error: unrecognized option '-rdynamic'
make.exe[1]: *** [cmTryCompileExec] Error 1 …Run Code Online (Sandbox Code Playgroud) 我不知道Ruby,但想运行一个脚本,其中:
D:/Hather /Ruby/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:在`require':无法加载这样的文件 - iconv(LoadError)
如果我评论iconv代码它会以某种方式工作,但如果我可以重新编码这部分它将会好得多:
return Iconv.iconv('UTF-8//IGNORE', 'UTF-8', (s + ' ') ).first[0..-2]
Run Code Online (Sandbox Code Playgroud)
没有iconv.也许我可以String#encode在这里用某种方式?
我需要改变格式
this.TextBox3.Text = DateTime.Now.ToShortDateString();
Run Code Online (Sandbox Code Playgroud)
所以它返回(例如)25.02.2012,但我需要02.25.2012
如何才能做到这一点?
这里的代码在g ++ 4.7和vs2012(cl17)中产生不同的输出.
#include <iostream>
using namespace std;
class A
{
public:
A() { cout << "1" << endl; }
~A() { cout << "2" << endl; }
};
class B : public A
{
public:
B() { cout << "3" << endl; }
~B() { cout << "4" << endl; }
};
void func(A a) {}
int main()
{
B b;
func(b);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
GCC输出是13242,而cl输出132242.
为什么cl编译器A在堆栈上复制时会产生第二个对象,出于什么目的?
VS 2010 C++ CLR Library项目,添加comutil.h库时出错
> Error 20 error LNK2001: unresolved
> external symbol "extern "C" long
> __stdcall VariantCopy(struct tagVARIANT *,struct tagVARIANT const
> *)" (?VariantCopy@@$$J18YGJPAUtagVARIANT@@PBU1@@Z) D:\Projects\AL\Service\ncFlow\ncOPClient.NET\Stdafx.obj ncOPClient.NET
> Error 18 error LNK2001: unresolved
> external symbol "extern "C" void
> __stdcall VariantInit(struct tagVARIANT *)"
> (?VariantInit@@$$J14YGXPAUtagVARIANT@@@Z) D:\Projects\AL\Service\ncFlow\ncOPClient.NET\Stdafx.obj ncOPClient.NET
> Error 13 error LNK2001: unresolved
> external symbol "void __stdcall
> _com_issue_error(long)" (?_com_issue_error@@$$FYGXJ@Z) D:\Projects\AL\Service\ncFlow\ncOPClient.NET\Stdafx.obj ncOPClient.NET
> Error 10 error LNK2028: unresolved
> token (0A000376) "void __stdcall
> _com_issue_error(long)" (?_com_issue_error@@$$FYGXJ@Z) …Run Code Online (Sandbox Code Playgroud) 我喜欢F#,但有时候我需要一些轻量级和跨平台的东西,而且没有.NET.我试过多次使用OCamL,但似乎我无法启动它.
所以,现在,我正在从命令shell和不同的光编辑器使用ocamlc -o"main.exe""main.ml".我不使用Vim或Emacs,我使用的是nano,我习惯使用全功能的IDE.
我找到了各种文档(这对我来说是最好的启动http://caml.inria.fr/pub/docs/oreilly-book/html/index.html)但是在寻找一些特定的东西时仍然会让人感到困惑相似的sqlite访问.发现这个:http://neugierig.org/software/ocaml/sqlite/有奇怪的api注释,没有例子.我发现的有关IDE使用的所有文档都已过时或无效.
添加子问题:有些人告诉我"不要使用OCamL,对于拥有低库支持的学生来说,这是一种死语言,似乎就像死了一样,使用python或ruby代替".但我喜欢OCamL的美丽.我想尝试一下.告诉我今天使用OCamL生产代码是否正常?
谢谢.
在F#我不能没有管道(<|和|>)
let console(dashboard : Dashboard ref) =
let rec eat (command : string) =
command.Split(' ','(',')')
|> Seq.filter(fun s -> s.Length <> 0)
|> fun C ->
(Seq.head C).ToUpper() |> fun head ->
Run Code Online (Sandbox Code Playgroud)
我可以使用<|和|>OCaml中?
我试图让它与促进它的方式相同:
find_package(Boost COMPONENTS system filesystem REQUIRED)
find_package(ProtocolBuffers)
## Compiler flags
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-O2")
set(CMAKE_EXE_LINKER_FLAGS "-lsqlite3 -lrt -lpthread")
endif()
target_link_libraries(complex
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${PROTOBUF_LIBRARY}
)
Run Code Online (Sandbox Code Playgroud)
(谷歌搜索它)但输出不好:
CMake Warning at complex/CMakeLists.txt:18 (find_package):
Could not find module FindProtocolBuffers.cmake or a configuration file for
package ProtocolBuffers.
Adjust CMAKE_MODULE_PATH to find FindProtocolBuffers.cmake or set
ProtocolBuffers_DIR to the directory containing a CMake configuration file
for ProtocolBuffers. The file will have one of the following names:
ProtocolBuffersConfig.cmake
protocolbuffers-config.cmake
Run Code Online (Sandbox Code Playgroud)
如何将其与cmake链接?或者我甚至可以使用cmake编译.proto文件?
我无法找到proto中是否有char/byte类型.
我可以在这里看到各种类型:
但我找不到字节类型甚至int16类型.