我正在使用版本4.1.3的角度动画
以下是代码:
@Component({
selector : 'my-fader',
animations: [
trigger('visibilityChanged', [
state('true' , style({ opacity: 1, transform: 'scale(1.0)' })),
state('false', style({ opacity: 0, transform: 'scale(0.0)' })),
transition('1 => 0', animate('300ms')),
transition('0 => 1', animate('900ms'))
])
]
...
Run Code Online (Sandbox Code Playgroud)
现在,而不是状态中的样式我想给现有的类名,即使用样式表中定义的类(即非内联样式)
那可能吗?如果是这样请帮助.
我循环遍历一个有6个对象的数组,并使用ngFor,我想只循环4个元素.我怎么能这样做?
<div class="item active" *ngFor="#data of lengthArray">
content
</div>
Run Code Online (Sandbox Code Playgroud)
在LengthArray我有6但是如何循环到4个记录?
而且我想从另一个div中的第4条记录循环到第6条记录.我怎样才能从第4条记录开始?
我尝试了下面的代码,无法导入sqlContext.implicits._- 它抛出一个错误(在Scala IDE中),无法构建代码:
value implicits不是org.apache.spark.sql.SQLContext的成员
我是否需要添加任何依赖项pom.xml?
Spark版本1.5.2
package com.Spark.ConnectToHadoop
import org.apache.spark.SparkConf
import org.apache.spark.SparkConf
import org.apache.spark._
import org.apache.spark.sql._
import org.apache.spark.sql.hive.HiveContext
import org.apache.spark.sql.SQLContext
import org.apache.spark.rdd.RDD
//import groovy.sql.Sql.CreateStatementCommand
//import org.apache.spark.SparkConf
object CountWords {
def main(args:Array[String]){
val objConf = new SparkConf().setAppName("Spark Connection").setMaster("spark://IP:7077")
var sc = new SparkContext(objConf)
val objHiveContext = new HiveContext(sc)
objHiveContext.sql("USE test")
var rdd= objHiveContext.sql("select * from Table1")
val options=Map("path" -> "hdfs://URL/apps/hive/warehouse/test.db/TableName")
//val sqlContext = new org.apache.spark.sql.SQLContext(sc)
val sqlContext = new SQLContext(sc)
import sqlContext.implicits._ //Error
val dataframe = …Run Code Online (Sandbox Code Playgroud) 我想更新 orc 格式的 hive 表,我可以从 ambari hive 视图进行更新,但无法从 sacla (spark-shell) 运行相同的更新语句
objHiveContext.sql("select * from table_name ") 能够看到数据,但是当我运行时
objHiveContext.sql("update table_name set column_name='testing' ") 无法运行,一些 Noviable 异常(更新附近的语法无效等)发生在我能够从 Ambari 视图更新的地方(因为我设置了所有必需的配置)即 TBLPROPERTIES "orc.compress"="NONE" 事务 true 等)
尝试使用 Insert into using case 语句,但都失败了 我们可以从 Spark 更新 hive ORC 表吗?如果是的话,程序是什么?
下面导入
import org.apache.spark.SparkConf
import org.apache.spark.SparkConf
import org.apache.spark._
import org.apache.spark.sql._
import org.apache.spark.sql.hive.HiveContext
import org.apache.spark.sql.hive.orc._
Run Code Online (Sandbox Code Playgroud)
注意:我没有在该表上应用任何分区或分桶如果我应用分桶,当存储为 ORC Hive 版本:1.2.1 Spark 版本:1.4.1 Scala 版本:2.10.6 时,我什至无法查看数据
我正在使用ng2-toastr并得到以下错误
https://www.npmjs.com/package/ng2-toastr
Attempt to use a destroyed view: detectChanges Error: Attempt to use a destroyed view: detectChanges at ViewDestroyedError
Run Code Online (Sandbox Code Playgroud)
我在按钮点击事件中有这个.
我试图从我的html页面调用click函数中的函数,添加来自nuget的所有typescript定义文件但出现问题我的Click Function无法正常工作....控制台中没有错误甚至
这是我的Hrml和控制器代码
Html页面
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="Scripts/angular.js"></script>
<script src="test.js"></script>
<title></title>
</head>
<body ng-app="testModule">
<div ng-controller="test">
<input type="button" ng-click="click()" value="test" />
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
调节器
angular.module("testModule", []);
class test {
constructor() { }
click() {
alert();
}
}
angular.module("testModule").controller("test", test );
Run Code Online (Sandbox Code Playgroud) 我',试图动态地向 div 添加一个 html 控件,在创建控件后,我想通过创建 viewchild 对其执行操作
@ViewChild('dropDownListReference') myDropDownList: typeOfComponent
Run Code Online (Sandbox Code Playgroud)
能够在类中创建但在生成控件后的方法中无法初始化此
AddLevelClick() {
var el: HTMLElement = document.getElementById('multi-sort-body');
el.innerHTML = "<div #test1></div>";
@ViewChild('test1') myDropDownList: typeOfComponent // Unable to create here
}
Run Code Online (Sandbox Code Playgroud)
关于在本地创建 ViewChild 元素的任何线索?
我尝试使用spark和scala中的下面代码,附加代码和pom.xml
package com.Spark.ConnectToHadoop
import org.apache.spark.SparkConf
import org.apache.spark.SparkConf
import org.apache.spark._
import org.apache.spark.sql._
import org.apache.spark.sql.hive.HiveContext
import org.apache.spark.sql.SQLContext
import org.apache.spark.rdd.RDD
//import groovy.sql.Sql.CreateStatementCommand
//import org.apache.spark.SparkConf
object CountWords {
def main(args:Array[String]){
val objConf = new SparkConf().setAppName("Spark Connection").setMaster("spark://IP:7077")
var sc = new SparkContext(objConf)
val objHiveContext = new HiveContext(sc)
objHiveContext.sql("USE test")
var test= objHiveContext.sql("show tables")
var i = 0
var testing = test.collect()
for(i<-0 until testing.length){
println(testing(i))
}
}
}
Run Code Online (Sandbox Code Playgroud)
我添加了spark-core_2.10,spark-catalyst_2.10,spark-sql_2.10,spark-hive_2.10依赖项我是否需要添加更多依赖项???
编辑:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.Sudhir.Maven1</groupId>
<artifactId>SparkDemo</artifactId>
<version>IntervalMeterData1</version>
<packaging>jar</packaging>
<name>SparkDemo</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spark.version>1.5.2</spark.version> …Run Code Online (Sandbox Code Playgroud) 这是问题,甚至不能理解为什么会出现这个问题.
严重级代码说明项目文件行错误"FindConfigFiles"任务意外失败.System.InvalidOperationException:项目元数据"%(FULLPATH)"不能被应用到路径"内容\脚本\角\分型\node_modules \分型芯\node_modules \棒冰\node_modules \形式数据\node_modules \联合流\node_modules \延迟流\测试\一体化\测试延迟stream.js".内容\脚本\角\分型\node_modules \分型芯\node_modules \棒冰\node_modules \形式数据\node_modules \联合流\node_modules \延迟流\测试\集成\测试延迟stream.js在微软. Build.Shared.ErrorUtilities.ThrowInvalidOperation在Microsoft.Build.Shared.FileUtilities在Microsoft.Build.Shared.ErrorUtilities.VerifyThrowInvalidOperation(布尔条件,字符串资源名称,对象为arg0,对象ARG1,对象ARG2)(字符串资源名称,对象[]参数) Microsoft.Build.Evaluation.BuiltInMetadata.GetMetadataValueEscaped(String currentDirectory,String evaluatedIncludeBeforeWildcardExpansionEscaped,String evaluatedIncludeEscaped,String definingProjectEscaped,String name,String&fullPath)at.ItemSpecModifiers.GetItemSpecModifier(String currentDirectory,String itemSpec,String definedProjectEscaped,String modifier,String&fullPath)at at Microsoft.Build.Executi上的Microsoft.Build.Execution.ProjectItemInstance.TaskItem.GetBuiltInMetadataEscaped(String name)在Microsoft.Build.Execution.ProjectItemInstance.TaskItem.GetMetadata(字符串metadataName)在TypeScript.Tasks.FindConfigFiles on.ProjectItemInstance.TaskItem.GetMetadataEscaped(字符串metadataName).<> c.b__12_0(ITaskItem f)位于System.Linq.Enumerable. WhereArrayIterator 1.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable的1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable1源)在TypeScript.Tasks.FindConfigFiles.Execute()在Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()在Microsoft.Build.BackEnd.TaskBuilder.d__26 .MoveNext()
我一直在实施延迟加载,直到某个时候一切正常,但突然间我遇到了错误。
关于可能的可能性的任何想法
RangeError: Maximum call stack size exceeded
at CatchSubscriber.OuterSubscriber [as constructor] (OuterSubscriber.ts:9)
at new CatchSubscriber (catch.ts:48)
at CatchOperator.call (catch.ts:35)
at Observable.subscribe (Observable.ts:93)
at Object.subscribeToResult (subscribeToResult.ts:32)
at MergeAllSubscriber._next (mergeAll.ts:86)
at MergeAllSubscriber.Subscriber.next (Subscriber.ts:95)
at MapSubscriber._next (map.ts:84)
at MapSubscriber.Subscriber.next (Subscriber.ts:95)
at ArrayObservable._subscribe (ArrayObservable.ts:124)
Run Code Online (Sandbox Code Playgroud) angular ×6
apache-spark ×3
scala ×3
typescript ×3
hivecontext ×2
maven ×2
angularjs ×1
css ×1
hiveql ×1
html ×1
javascript ×1
lazy-loading ×1
ngfor ×1
viewchild ×1