我有一个需要旋转/轴交换的html表.它可以脱机完成.任何人都知道我可以使用的工具吗?
是否有一个我可以使用的标准函数,它类似于ForEach迭代一个数组,将一个函数应用于每个元素并用结果替换它在数组中?
类似下面的内容,但后面的维度包含每个元素的IntPow(2,i)的结果.
dimensionPowers = Enumerable.Range(0, dimensions + 1).ToArray();
Array.ForEach(dimensionPowers,
(i) => IntPow(2, i));
Run Code Online (Sandbox Code Playgroud)
(我知道我可以使用for循环迭代数组 - 我只是想知道是否有更简洁的替代方案).
我正在尝试用CSS创建一个多维数据集.我实际上认为它已经存在但我看不到它.随意编辑小提琴.
我不明白为什么这个观点不起作用.这是最佳做法吗?
是否可以整体旋转立方体?
来源:24ways.
HTML:
<section class="container">
<div id="cube">
<figure class="front">1</figure>
<figure class="back">2</figure>
<figure class="right">3</figure>
<figure class="left">4</figure>
<figure class="top">5</figure>
<figure class="bottom">6</figure>
</div>
</section>
Run Code Online (Sandbox Code Playgroud)
CSS:
.container {
margin: 200px auto;
width: 200px;
height: 200px;
position: relative;
-webkit-perspective: 800px;
}
#cube {
width: 100%;
height: 100%;
position: absolute;
-webkit-transform-style: preserve-3d;
}
#cube figure {
width: 198px;
height: 198px;
display: block;
position: absolute;
border: 1px solid #ddd;
background-color: rgba(0,0,0,0.2);
}
#cube .front { -webkit-transform: rotateY(0deg) translateZ(100px); }
#cube .back …Run Code Online (Sandbox Code Playgroud) 我试图检测浏览器是否支持3d css转换.我已经查看了网络上提供的每个解决方案,但它们都没有为我工作,然后尝试使用@support css属性来完成我的工作.它在Linux中的chrome和firefox中完美运行,但在Windows中却没有.
可能是因为我在两个操作系统中使用chrome 23进行了测试,并且根据https://developer.mozilla.org/en-US/docs/CSS/@supports#Browser_compatibility中的兼容性表, 只有chrome 24支持@支持规则.
有没有想过这种方法是否适合检查对3d的支持?我只关心chrome 23.x及以上版本和firefox 18及以上版本,而不是任何其他浏览器,
@supports(-webkit-transform: perspective( 1px ) )or
(-moz-transform: perspective( 1px) ) or
(-o-transform: perspective( 1px) ) or
(transform: perspective( 1px) ){
#supports {
display:block;
}
}
Run Code Online (Sandbox Code Playgroud) java.lang.RuntimeException: Hive Runtime Error while closing operators
at org.apache.hadoop.hive.ql.exec.ExecMapper.close(ExecMapper.java:226)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:57)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:436)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:372)
at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1136)
at org.apache.hadoop.mapred.Child.main(Child.java:249)
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: [Error 20003]: An error occurred when trying to close the Operator running your custom script.
at org.apache.hadoop.hive.ql.exec.ScriptOperator.close(ScriptOperator.java:486)
at org.apache.hadoop.hive.ql.exec.Operator.close(Operator.java:567)
at org.apache.hadoop.hive.ql.exec.Operator.close(Operator.java:567)
at org.apache.hadoop.hive.ql.exec.Operator.close(Operator.java:567)
at org.apache.hadoop.hive.ql.exec.ExecMapper.close(ExecMapper.java:193)
... 8 more
HQL脚本如下:
SELECT
TRANSFORM (userid, movieid, rating)
USING 'python /home/daxingyu930/test_data_mapper2.py'
AS userid, movieid, rating
;
Run Code Online (Sandbox Code Playgroud)
python脚本非常简单,\t用于分割线条.
我已经使用follow shell脚本测试了Linux中的python脚本:
cat test_data/u_data.txt | python …Run Code Online (Sandbox Code Playgroud) 我的gradle Dependency看起来像这样,
dependencies {
compile files('libs/Shutterbug-1.0.0.jar')
compile files('libs/VolleyWithJsonArrayRequest.jar')
compile files('libs/android-async-http-1.4.3.jar')
compile files('libs/geonames-1.1.12.jar')
compile files('libs/jdom-1.0.jar')
compile files('libs/kenburnsview-1.0.6.jar')
compile files('libs/libGoogleAnalyticsServices.jar')
compile files('libs/multiselectlistpreferencecompat.jar')
compile files('libs/universal-image-loader-1.9.1.jar')
compile 'com.android.support:support-v4:23.1.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'com.google.android.gms:play-services-identity:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
}
Run Code Online (Sandbox Code Playgroud)
但是当在android studio 1.5上运行应用程序时,我收到以下错误:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/analytics/internal/Command$1.class
Run Code Online (Sandbox Code Playgroud) transform duplicates gradle google-play-services android-studio
我正在用以下代码绘制一些数据的均值和方差的变化
import matplotlib.pyplot as pyplot
import numpy
vis_mv(data, ax = None):
if ax is None: ax = pyplot.gca()
cmap = pyplot.get_cmap()
colors = cmap(numpy.linspace(0, 1, len(data)))
xs = numpy.arange(len(data)) + 1
means = numpy.array([ numpy.mean(x) for x in data ])
varis = numpy.array([ numpy.var(x) for x in data ])
vlim = max(1, numpy.amax(varis))
# variance
ax.imshow([[0.,1.],[0.,1.]],
cmap = cmap, interpolation = 'bicubic',
extent = (1, len(data), -vlim, vlim), aspect = 'auto'
)
ax.fill_between(xs, -vlim, -varis, color = 'white')
ax.fill_between(xs, varis, …Run Code Online (Sandbox Code Playgroud) vector<string> v = {"AAAAidad", "bbbb", "ADWHIBQSDS", "Hi", "fes", "dafegrg", "QQEEQEQEQEQ
E", "\"", "a"};
transform1(v.begin(), v.end(), back_inserter(v),
[] (string s) -> string{
for(char& c:s)
{
c = toupper(c);
}
return s;
});
Run Code Online (Sandbox Code Playgroud)
使用上面的代码段,我希望在v的末尾插入大写的字符串元素。但是,实际上,我只得到以下输出
v = {"AAAAidad", "bbbb", "ADWHIBQSDS", "Hi", "fes", "dafegrg", "QQEEQEQEQEQ", "AAAAIDAD"}
Run Code Online (Sandbox Code Playgroud)
只有第一个字符串被大写并插入。向量中的其余字符串元素在哪里?
我正在玩XCode 9上的AR入门应用程序,其中锚点是在场景中创建的:
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
guard let sceneView = self.view as? ARSKView else {
return
}
// Create anchor using the camera’s current position
if let currentFrame = sceneView.session.currentFrame {
// Create a transform with a translation of 0.2 meters in front
// of the camera
var translation = matrix_identity_float4x4
translation.columns.3.z = -0.2
let transform = simd_mul(currentFrame.camera.transform, translation)
// Add a new anchor to the session
let anchor = ARAnchor(transform: transform)
sceneView.session.add(anchor: anchor)
} …Run Code Online (Sandbox Code Playgroud)