本文将分享如何在Clojure中创建原始的双精度二维的详细内容,并且还将对2d数组?进行详尽解释,此外,我们还将为大家带来关于C#中的双精度数组?、clojure–如何共享不在Clojars中的依赖项
本文将分享如何在Clojure中创建原始的双精度二维的详细内容,并且还将对2d数组?进行详尽解释,此外,我们还将为大家带来关于C# 中的双精度数组?、clojure – 如何共享不在Clojars中的依赖项、clojure – 如何在Compojure / Hiccup中输出HTML注释?、Clojure学习笔记(2)安装Clojure构建工具 leiningen的相关知识,希望对你有所帮助。
本文目录一览:- 如何在Clojure中创建原始的双精度二维(2d)数组?
- C# 中的双精度数组?
- clojure – 如何共享不在Clojars中的依赖项
- clojure – 如何在Compojure / Hiccup中输出HTML注释?
- Clojure学习笔记(2)安装Clojure构建工具 leiningen
如何在Clojure中创建原始的双精度二维(2d)数组?
我正在与Clojure互操作的Java API要求我将2d的双精度数组传递给它;双[][]。如何在Clojure中创建 原始
的double二维数组?我正在寻找这样的东西
(double-array-2d [[1 2] [3 4]])
该函数的Java返回类型为double [] []。
答案1
小编典典试试这个:
(into-array (map double-array [[1 2] [3 4]]))
C# 中的双精度数组?
C# 中的数组数组称为锯齿数组。要声明交错数组,请使用双精度 [ ][ ]。
现在让我们声明它们 -
int [][] marks;
现在,让我们初始化它,其中标记是 5 个整数的数组 -
int[][] marks = new int[][]{new int[]{ 90,95 },new int[]{ 89,94 }, new int[]{ 78,87 },new int[]{ 76, 68 }, new int[]{ 98, 91 } };
Example
让我们现在看一下C#中关于锯齿数组的完整示例,并学习如何实现它 −
实时演示
using System; namespace MyApplication { class MyDemoClass { static void Main(string[] args) { int i, j; /* jagged array of 5 array of integers */ int[][] marks = new int[][]{new int[]{90,95},new int[]{89,94}, new int[]{78,87},new int[]{ 76, 68 }, new int[]{ 98, 91}}; for (i = 0; i < 5; i++) { for (j = 0; j < 2; j++) { Console.WriteLine("marks[{0}][{1}] = {2}", i, j, marks[i][j]); } } Console.ReadKey(); } } }
输出
marks[0][0] = 90 marks[0][1] = 95 marks[1][0] = 89 marks[1][1] = 94 marks[2][0] = 78 marks[2][1] = 87 marks[3][0] = 76 marks[3][1] = 68 marks[4][0] = 98 marks[4][1] = 91
以上就是C# 中的双精度数组?的详细内容,更多请关注php中文网其它相关文章!
clojure – 如何共享不在Clojars中的依赖项
如何解决这个问题是否有更好,更标准的想法?
https://github.com/technomancy/s3-wagon-private
clojure – 如何在Compojure / Hiccup中输出HTML注释?
<!--[if lt IE 8]><link rel="stylesheet" href="../blueprint/ie.css" type="text/css" media="screen,projection"><![endif]-->
有没有办法用Hiccup输出html注释文字?
解决方法
user=> (html [:html [:head "<!--[if lt IE 8]>" [:link {:rel "stylesheet" :href "../blueprint/ie.css" :type "text/css" :media "screen,projection"}] "<![endif]-->"]]) <html><head><!--[if lt IE 8]><link href=\"../blueprint/ie.css\" media=\"screen,projection\" rel=\"stylesheet\" type=\"text/css\" /><![endif]--></head></html>
Clojure学习笔记(2)安装Clojure构建工具 leiningen
1.在C盘下创建一个文件夹,并且命名为home_lein,然后把下载的lein.bat文件和leiningen-2.0.0-preview10-standalone.jar包放到C:\home_lein文件夹下。
如下图所示:
2.修改lein.bat脚本
将lein.bat脚本中的第27行的
if "x%LEIN_JAR%" == "x" set "LEIN_JAR=!LEIN_HOME!\self-installs\leiningen-!LEIN_VERSION!-standalone.jar"
修改为如下:
if "x%LEIN_JAR%" == "x" set "LEIN_JAR=C:\home_lein\leiningen-2.0.0-preview10-standalone.jar"
如下图所示:
3.为leiningen设置环境变量
截图
说明
变量名:LEIN_HOME
变量值:C:\home_lein
变量名:LEIN_JAR
变量值:C:\home_lein\leiningen-2.0.0-preview10-standalone.jar
在Path中添加“;%LEIN_HOME%\;”
4.在DOS中输入命令行"lein"以验证leiningen是否已安装成功。
但根据运行反馈的信息,leiningen目前还没安装成功。运行结果如下图所示:
5.通过命令行进入c:\home_lein文件夹下执行命令行"lein.bat"。命令执行结果如下图所示:
Microsoft Windows [版本 6.1.7600]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Users\Administrator>cd c:\home_lein
c:\home_lein>lein.bat
Could not find artifact lein-newnew:lein-newnew:pom:0.3.5 in central (http://rep
o1.maven.org/maven2)
Retrieving lein-newnew/lein-newnew/0.3.5/lein-newnew-0.3.5.pom (3k)
from https://clojars.org/repo/
Could not find artifact stencil:stencil:pom:0.3.0 in central (http://repo1.maven
.org/maven2)
Retrieving stencil/stencil/0.3.0/stencil-0.3.0.pom (3k)
from https://clojars.org/repo/
Retrieving org/clojure/clojure/1.3.0/clojure-1.3.0.pom (5k)
from http://repo1.maven.org/maven2/
Retrieving org/sonatype/oss/oss-parent/5/oss-parent-5.pom (4k)
from http://repo1.maven.org/maven2/
Could not find artifact scout:scout:pom:0.1.0 in central (http://repo1.maven.org
/maven2)
Retrieving scout/scout/0.1.0/scout-0.1.0.pom (2k)from https://clojars.org/repo/
Could not find artifact quoin:quoin:pom:0.1.0 in central (http://repo1.maven.org
/maven2)
Retrieving quoin/quoin/0.1.0/quoin-0.1.0.pom (2k)from https://clojars.org/repo/
Could not find artifact slingshot:slingshot:pom:0.8.0 in central (http://repo1.m
aven.org/maven2)
Retrieving slingshot/slingshot/0.8.0/slingshot-0.8.0.pom (1k)
from https://clojars.org/repo/
Retrieving org/clojure/clojure/1.2.1/clojure-1.2.1.pom (1k)
from http://repo1.maven.org/maven2/
Retrieving org/clojure/core.cache/0.6.1/core.cache-0.6.1.pom (2k)
from http://repo1.maven.org/maven2/
Retrieving org/clojure/pom.contrib/0.0.26/pom.contrib-0.0.26.pom (5k)
from http://repo1.maven.org/maven2/
Retrieving org/clojure/clojure/1.4.0/clojure-1.4.0.pom (5k)
from http://repo1.maven.org/maven2/
Could not find artifact bultitude:bultitude:pom:0.1.7 in central (http://repo1.m
aven.org/maven2)
Retrieving bultitude/bultitude/0.1.7/bultitude-0.1.7.pom (2k)
from https://clojars.org/repo/
Could not find artifact quoin:quoin:jar:0.1.0 in central (http://repo1.maven.org
/maven2)
Could not find artifact scout:scout:jar:0.1.0 in central (http://repo1.maven.org
/maven2)
Retrieving org/clojure/clojure/1.3.0/clojure-1.3.0.jar (3311k)
from http://repo1.maven.org/maven2/
Could not find artifact lein-newnew:lein-newnew:jar:0.3.5 in central (http://rep
o1.maven.org/maven2)
Could not find artifact stencil:stencil:jar:0.3.0 in central (http://repo1.maven
.org/maven2)
Could not find artifact slingshot:slingshot:jar:0.8.0 in central (http://repo1.m
aven.org/maven2)
Retrieving org/clojure/core.cache/0.6.1/core.cache-0.6.1.jar (11k)
from http://repo1.maven.org/maven2/
Could not find artifact bultitude:bultitude:jar:0.1.7 in central (http://repo1.m
aven.org/maven2)
Retrieving slingshot/slingshot/0.8.0/slingshot-0.8.0.jar (6k)
from https://clojars.org/repo/
Retrieving scout/scout/0.1.0/scout-0.1.0.jar (4k)from https://clojars.org/repo/
Retrieving quoin/quoin/0.1.0/quoin-0.1.0.jar (3k)from https://clojars.org/repo/
Retrieving stencil/stencil/0.3.0/stencil-0.3.0.jar (13k)
from https://clojars.org/repo/
Retrieving bultitude/bultitude/0.1.7/bultitude-0.1.7.jar (4k)
from https://clojars.org/repo/
Retrieving lein-newnew/lein-newnew/0.3.5/lein-newnew-0.3.5.jar (15k)
from https://clojars.org/repo/
Leiningen is a tool for working with Clojure projects.
Several tasks are available:
check Check syntax and warn on reflection.
classpath Write the classpath of the current project to output-file.
clean Remove all files from project''s target-path.
compile Compile Clojure source into .class files.
deploy Build jar and deploy to remote repository.
deps Show details about dependencies.
do Higher-order task to perform other tasks in succession.
help Display a list of tasks or help for a given task.
install Install current project to the local repository.
jar Package up all the project''s files into a jar file.
javac Compile Java source files.
new Generate project scaffolding based on a template.
plugin DEPRECATED. Please use the :user profile instead.
pom Write a pom.xml file to disk for Maven interoperability.
repl Start a repl session either with the current project or stan
dalone.
retest Run only the test namespaces which failed last time around.
run Run the project''s -main function.
search Search remote maven repositories for matching jars.
show-profiles List all available profiles or display one if given an argum
ent.
test Run the project''s tests.
trampoline Run a task without nesting the project''s JVM inside Leininge
n''s.
uberjar Package up the project files and all dependencies into a jar
file.
upgrade Upgrade Leiningen to specified version or latest stable.
version Print version for Leiningen and the current JVM.
with-profile Apply the given task with the profile(s) specified.
Run lein help $TASK for details.
See also: readme, faq, tutorial, news, sample, profiles,
deploying and copying.
c:\home_lein>
6.根据上图运行反馈的信息,leiningen现在已经安装成功。
现在可以进入到c:\home_lein下通过DOS命令行执行“lein”命令。如下图所示:

7.现在也可以不用切换到c:\home_lein文件夹,直接就在DOS上通过输入“lein”命令来运行leiningen。如下图所示:
8.可以通过DOS命令行来检查目前所安装的leiningen的版本。如下图所示:
leiningen构建工具现在已经安装成功,接下来的学习笔记中将学习采用lein来创建clojure项目。这里要做一个笔记:
因为整个安装过程的截图我保存在word文档中,如果直接复制word文档中的图片黏贴到osc的编辑器中,保存博文之后是无法显示图片的。所以百度了一下怎么把word中的图片还原保存成单个图片,方法如下:
将打开的word文档另存为网页,在word文档的所在位置下会生成一个跟word文档同名的文件夹,里页就有之前保存在word文档中的所有图片。
今天关于如何在Clojure中创建原始的双精度二维和2d数组?的分享就到这里,希望大家有所收获,若想了解更多关于C# 中的双精度数组?、clojure – 如何共享不在Clojars中的依赖项、clojure – 如何在Compojure / Hiccup中输出HTML注释?、Clojure学习笔记(2)安装Clojure构建工具 leiningen等相关知识,可以在本站进行查询。
本文标签: