这个多组件不起作用;
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, Link, browserHistory, IndexRoute } from 'react-router'
class App extends React.Component {
render() {
return (
<div>
<ul>
<li><Link>Home</Link></li>
</ul>
{this.props.children}
</div>
)
}
}
export default App;
class Home extends React.Component {
render() {
return (
<div>
<h1>Home...</h1>
</div>
)
}
}
export default Home;
ReactDOM.render((
<Router history = {browserHistory}>
<Route path = "/" component = {App}>
<IndexRoute component = {Home} />
<Route path = "home" component …Run Code Online (Sandbox Code Playgroud) 我想升级ng1组件以在ng2组件中使用.
如果我只使用模板字符串ng1组件,要升级,它的工作原理.但是,如果我切换到使用templateUrl,应用程序崩溃并给我这个错误:
angular.js:13920 Error: loading directive templates asynchronously is not supported
at RemoteUrlComponent.UpgradeComponent.compileTemplate (upgrade-static.umd.js:720)
at RemoteUrlComponent.UpgradeComponent (upgrade-static.umd.js:521)
at new RemoteUrlComponent (remote-url.component.ts:11)
at new Wrapper_RemoteUrlComponent (wrapper.ngfactory.js:7)
at View_AppComponent1.createInternal (component.ngfactory.js:73)
at View_AppComponent1.AppView.create (core.umd.js:12262)
at TemplateRef_.createEmbeddedView (core.umd.js:9320)
at ViewContainerRef_.createEmbeddedView (core.umd.js:9552)
at eval (common.umd.js:1670)
at DefaultIterableDiffer.forEachOperation (core.umd.js:4653)
Run Code Online (Sandbox Code Playgroud)
这是一个证明我的问题的插件:
https://plnkr.co/edit/2fXvfc?p=info
我遵循了Angular 1 - > 2升级指南,似乎这段代码应该可行.我不太确定为什么它不起作用.
我从这个github项目中知道Swift +++和<<<"运营商".
这是我很难搜索此对谷歌,因为+++和<<<也许某种特殊字符,没有出现在搜索结果的.当我写问题标题时,它甚至没有出现可能已经有 Stack Overflow的答案部分的问题.
你能简单解释一下这些奇怪的算子是什么吗?也许有些文章可以进一步阅读?
我有3个数组如下.
$array1 = Array
(
[0] => 05/01
[1] => 05/02
)
$array2 =Array
(
[0] => ED
[1] => P
)
$array3 =Array
(
[0] => Mon
[1] => Tue
)
Run Code Online (Sandbox Code Playgroud)
我想合并这三个数组,如下所示$result_array.我编写了如下代码.但它给了一个空数组.
$result_array =Array
(
[0] => Array
(
[0] => 05/01
[1] => ED
[2] => Mon
)
[1] => Array
(
[0] => 05/02
[1] => P
[2] => Tue
)
)
Run Code Online (Sandbox Code Playgroud)
码:
for($z=0; $z<count($array1); $z++){
$all_array[$z][] = array_merge($array1[$z],$array2[$z] );
$all_array2[$z] = array_merge($all_array[$z],$array3[$z] );
} …Run Code Online (Sandbox Code Playgroud) 我一直在努力使用RoboGuice和碎片而没有运气.我有一个扩展的片段RoboFragment,以及一个扩展的活动RoboActivity,但似乎在其中RoboActivity,该方法getFragmentManager是不兼容的RoboFragment.
它看起来像RoboFragment扩展android.support.v4.app.Fragmentment但getFragmentManager需要android.app.Fragment.
这有什么用?
我创建了一个主题,并放置了一个简单的生产者来在该主题中发布一些消息
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic streams-file-input
bin/kafka-console-producer.sh --broker-list localhost:9092 --streams-file-input
Run Code Online (Sandbox Code Playgroud)
我在 kafka 流中运行下面的简单示例,但遇到了一个我无法处理的奇怪异常
Properties props = new Properties();
props.put(StreamsConfig.APPLICATION_ID_CONFIG, "streams-pipe");
props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "192.168.1.3:9092");
props.put(StreamsConfig.KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass());
props.put(StreamsConfig.VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass());
// setting offset reset to earliest so that we can re-run the demo code with the same pre-loaded data
props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
KStreamBuilder builder = new KStreamBuilder();
builder.stream("streams-file-input").to("streams-pipe-output");
KafkaStreams streams = new KafkaStreams(builder, props);
streams.start();
// usually the stream application would be running forever,
// in this example we just …Run Code Online (Sandbox Code Playgroud) import java.util.Scanner;
public class Main {
private static Scanner scan;
private static int n;
private static int b[];
private static String a1;
private static String a2;
private static int t[];
public static void main(String s[]) {
scan = new Scanner(System.in);
n = scan.nextInt();
b = new int[n];
t = new int[n];
for (int i = 0; i < n; i++) {
b[i] = scan.nextInt();
}
a1 = scan.next();
a2 = scan.next();
for (int i = 0; i < n; i++) …Run Code Online (Sandbox Code Playgroud) 我有一个包含 2 个文本视图的弹出窗口。
如果用户单击一个文本视图 toast 必须出现。我为此功能编码但显示Nullpointer exception在线far.setOnClickListener(new OnClickListener() {请帮助我。
我的代码:
btn_a.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
LayoutInflater lInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View popup_view = lInflater.inflate(R.layout.popup_a, null);
final PopupWindow popup = new PopupWindow(popup_view,200,75,true);
popup.setFocusable(true);
popup.setBackgroundDrawable(new ColorDrawable());
popup.showAsDropDown(btn_a, 0,0);
TextView far = (TextView) rootView.findViewById(R.id.fartext);
far.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getActivity(), "Clicked Far", Toast.LENGTH_SHORT).show();
}
});
}
});
Run Code Online (Sandbox Code Playgroud) 我有一个如下所示的数组
$array1 = Array
(
[0] => 20225,2017-02-20
[1] => 20225,2017-02-20
[2] => 10027,2017-02-20
[3] => 10027,2017-02-20
[4] => 10021,2017-02-20
[5] => 20205,2017-02-20
[6] => 50003,2017-02-20
[7] => 20225,2017-02-20
[8] => 20205,2017-02-20
[9] => 10021,2017-02-20
[10] => 50003,2017-02-20
[11] => 10027,2017-02-20
[12] => 20225,2017-02-20
[13] => 20225,2017-02-21
[14] => 20225,2017-02-21
)
Run Code Online (Sandbox Code Playgroud)
如果数组包含的相同结果超过 2 个,我想将其中一个值获取到另一个名为 的数组$array2。
请帮我做到这一点
我想将定义的全局变量传递给echo php中的java脚本代码.
以下是我的代码.这不起作用.请帮我解决一下这个.
echo '<script language="javascript">';
echo 'alert('.$this->msg5.')'; //not working alert here
echo '</script>';
Run Code Online (Sandbox Code Playgroud) php ×3
android ×2
arrays ×2
java ×2
angular ×1
angularjs ×1
apache-kafka ×1
array-merge ×1
codeigniter ×1
components ×1
fragment ×1
javascript ×1
ng-upgrade ×1
onclick ×1
operators ×1
roboguice ×1
swift ×1
xcode ×1