首页 文章 精选 留言 我的

精选列表

搜索[Vue3组件库],共10000篇文章
优秀的个人博客,低调大师

elk组件的安装 第一版

OS:centos6.6 64bit java:jdk-7u79-linux-x64.rpm E:elasticsearch-1.7.3.tar.gz L:logstash-1.5.6-1.noarch.rpm K:kibana-4.1.2-linux-x64.tar.gz elasticsearch-2.1.1 kibana-4.3.1 logstash-2.1.1-1 filebeat-1.0.1 https://www.elastic.co/downloads/past-releases/logstash-1-5-6 https://www.elastic.co/downloads/past-releases/kibana-4-1-4 https://www.elastic.co/downloads/past-releases/elasticsearch-1-7-4 rpm -ivh elasticsearch-1.7.4.noarch.rpm rpm -ivh logstash-1.5.6-1.noarch.rpm # tar zxvf kibana-4.1.4-linux-x64.tar.gz //这本身就是拆箱即用的东西, 我们给它找个好地方放起来 # mv kibana-4.1.4-linux-x64/ /usr/local/kibana # ln -sv /usr/local/kibana/bin/kibana /usr/bin/kibana #http://mo0on.blog.51cto.com/10522787/1729618 配置redis # tar zxvf redis-3.0.6.tar.gz # cd redis-3.0.6 # make PREFIX=/usr/local/redis install //这里纠结一下, redis如果不指定prefix路径,那么默认会在你这个解压的文件夹中编译生成bin文件 # ln -sv /usr/local/redis/bin/redis-server /usr/bin/redis-server # ln -sv /usr/local/redis/bin/redis-cli /usr/bin/redis-cli /usr/share/elasticsearch/bin/elasticsearch /etc/logstash/conf.d/ logstash配置 Shipper->Broker->Indexer->ES 其中, Shipper可以理解为监控节点,将所有的(分布式业务中)业务产生的消息(log)发送给Broker,然后,Indexer从Broker读取数据并推送给ES,我们就可以用kibana中获取想要的信息了 这里我们纠结一下input的file配置: 首先,这个file插件只是在进程运行的注册阶段初始化的一个FileWatch对象,它并不能支持l类似fluentd那样的 path => "/path/to/%{+yyyy/MM/dd/hh}.log" indexer.conf input { redis { host => "127.0.0.1" port => 6379 password => "8ff35947f8efe8db806622f6a98a1ea3" type => "redis-input" data_type => "list" key => "key_count" } } output { stdout {} elasticsearch { cluster => "elasticsearch" codec => "json" protocol => "http" } } shipper.conf input { file { path => ["/var/log/*.log", "/var/log/message"] type => "system" start_position => "beginning" } } output { stdout {} redis { host => "127.0.0.1" port => 6379 password => "8ff35947f8efe8db806622f6a98a1ea3" data_type => "list" key => "key_count" } } service logstash start /usr/bin/kibana & #ln -sv /usr/local/java/bin/java /usr/bin/java 报错 {"name":"Kibana","hostname":"localhost","pid":18106,"level":30,"msg":"No existing kibana index found","time":"2016-10-14T08:01:33.983Z","v":0} {"name":"Kibana","hostname":"localhost","pid":18106,"level":30,"msg":"Listening on 0.0.0.0:5601","time":"2016-10-14T08:01:34.002Z","v":0} http://bbotte.com/logs-service/use-elk-processing-logs-basic-installation-and-config/ es插件 http://xx:9200/_plugin/kopf/#!/cluster 访问kibanahttp://xx:5601/ 启动 nohup /usr/bin/kibana & logstash -f /etc/logstash/conf.d/logstash-indexer.conf or service logstash start nohup /usr/share/elasticsearch/bin/elasticsearch & 本文转自 liqius 51CTO博客,原文链接:http://mo0on.blog.51cto.com/10522787/1729263,如需转载请自行联系原作者

优秀的个人博客,低调大师

android组件通讯 Intent Filter隐式实现Intent

Intent Filter是android里非常有特色的一个概念。他的用户体验和windows下的文件管理器的弹出菜单里的“打开方式”非常相似。在windows中,当用户选择了打开方式菜单后,系统让用户选择应用来打开所选择的文件。而在android中的文件已经被uri资源代替了。 Intent Filter在android中的应用非常普遍,尤其在资源共享中。例如,当用户选择了一个图片,选择了共享,我们常常会发现一个选择列表。这个选择列表是动态生成的,不是一成不变的。假如你新安装了facebook应用,那么facebook就会出现在这个列表里面。从这个例子可以发现,intent filter的设计使得android系统显得更加灵活了。 要实现一个Intent Filter, 我们要在AndroidManifest.xml中加入必要的设置,以通知系统某个activity都能够处理什么类型的URI资源,然后要在activity的onCreate中加入必要的代码以处理系统传递过来rui资源。 一个Service、 Activity 或者 Brodcast Reciever 的Intent Filter , 的事件过滤器, 我们用着大家都很了然的说法来描述之吧, 实际上描述了拥有这些过滤器组建在系统中所具有能力。 Filter 的创建都是通过 manifest.xml 文件, 但是对于 Broadcast Reciever 用Context.registerReceiver()来创建。Filter 可以包含三种类型的过滤条件 <action> <category> <data> 一个Intent 是否能够通过一个过滤器到达对应的处理器取决于, Intent 所包含的 所有Categroy 是够都在 过滤器中的catergory 列表里出现。 换句话说, 没有 catergory字段的Inteng 可以通过任何过滤器, 而一个过滤器, 必须至少要有一个可以通过的限定,Category 或者 Action。 对于Action 也一样, 能够通过Filter 的Itent的 Action必须被列与 Category中。同样, 没有Action 的Intent 也可以通过所有的Filter。 对于<data>过滤条件稍微复杂点, 但是总的原则还是, 只有Intent 能够通过 Filter, 那么Intent 中的信息,必须出现在Filter中。 <data> 需要指定scheme://host:port/path , 条件顺序的优先级随着范围缩小而降低,相当于,看作目录,在子目录下匹配。比如, Filter指定了 scheme, 那么所有具有这个 scheme 的 Intent 都能通过,这个Filter, 类似的通配符的情况也是允许的。 这里翻译文档中的四个例子情况: a.如果没有定义URI 和数据类型, 则,该Intent只能通过没有定义URI和 数据类型的 过滤器。 b.只定义了URI的 Intent 只能通过只定义了 URI 的过滤器。 c.只定义了 数据类型的 Intent 也只能通过只定义了 数据类型的过滤器。 d. 如果一个Intent同事定义了URI和 数据类型, 或者数据类型可以由URI推定, 则只有具备了对应的数据类型,或者 content: 或者 file: 类型,并且没有定义URI的过滤器。(这种情况, 你自己代码一下就明白了, 在写下去,我也不鸟鸟了。) 如果通向Activities 的Intent 引起了多个响应, 就会出现需要用户指定的提示, 或者是异常。 差不多就是这样的情况了, android 的这种机制非常适合移动设备之间的应用相互调用, 以便在更大的粒度上达成复用。很强大。 /Chapter06_Intent_Filter/src/com/amaker/ch06/app/MainActivity.java 代码 packagecom.amaker.ch06.app; importcom.amaker.ch06.app.R; importandroid.app.Activity; importandroid.content.Intent; importandroid.net.Uri; importandroid.os.Bundle; importandroid.view.View; importandroid.view.View.OnClickListener; importandroid.widget.Button; /** * *IntentFilter测试 */ publicclassMainActivityextendsActivity{ //声明Button privateButtonbtn; privatestaticfinalStringACTION1="com.amaker.ch06.app.TEST_ACTION1"; privatestaticfinalStringACTION2="com.amaker.ch06.app.TEST_ACTION2"; privatestaticfinalStringACTION3="com.amaker.ch06.app.TEST_ACTION3"; privatestaticfinalStringCATEGORY1="com.amaker.ch06.app.CATEGORY1"; @Override publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); //设置内容布局 setContentView(R.layout.main); //实例化按钮 btn=(Button)findViewById(R.id.Button01); Stringa=Intent.ACTION_VIEW; //添加单击监听器 btn.setOnClickListener(newOnClickListener(){ @Override publicvoidonClick(Viewview){ Intentintent=newIntent(); //intent.setAction(ACTION1); //Uridata=Uri.parse("content://com.amaker.ch07.app/abc"); //intent.setData(data); intent.addCategory(CATEGORY1); intent.setAction("android.intent.action.VIEW"); intent.setData(Uri.parse("http://www.google.com")); startActivity(intent); } }); } } /Chapter06_Intent_Filter/src/com/amaker/ch06/app/TestActivity.java 代码 packagecom.amaker.ch06.app; importcom.amaker.ch06.app.R; importandroid.app.Activity; importandroid.os.Bundle; /** *测试IntentFilter */ publicclassTestActivityextendsActivity{ @Override publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.main1); } } /Chapter06_Intent_Filter/res/layout/main.xml 代码 <?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <Button android:text="测试IntentFilter" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> </LinearLayout> /Chapter06_Intent_Filter/res/layout/main1.xml 代码 <?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:text="测试IntentFilter" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> </LinearLayout> /Chapter06_Intent_Filter/AndroidManifest.xml 代码 <?xmlversion="1.0"encoding="utf-8"?> <manifestxmlns:android="http://schemas.android.com/apk/res/android" package="com.amaker.ch06.app" android:versionCode="1" android:versionName="1.0"> <applicationandroid:icon="@drawable/icon"android:label="@string/app_name"> <activityandroid:name=".MainActivity" android:label="@string/app_name"> <intent-filter> <actionandroid:name="android.intent.action.MAIN"/> <categoryandroid:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activityandroid:name="TestActivity"> <intent-filter> <actionandroid:name="com.amaker.ch06.app.TEST_ACTION1"/> <actionandroid:name="com.amaker.ch06.app.TEST_ACTION2"/> <actionandroid:name="com.amaker.ch06.app.TEST_ACTION3"/> <actionandroid:name="android.intent.action.VIEW"/> <dataandroid:scheme="content"android:path="com.amaker.ch07.app/abc"/> <dataandroid:scheme="http"android:path="www.google.com"/> <categoryandroid:name="android.intent.category.DEFAULT"/> <categoryandroid:name="android.intent.category.BROWSABLE"/> <categoryandroid:name="com.amaker.ch07.app.CATEGORY1"/> </intent-filter> </activity> </application> <uses-sdkandroid:minSdkVersion="3"/> </manifest> 本文转自linzheng 51CTO博客,原文链接:http://blog.51cto.com/linzheng/1080659

优秀的个人博客,低调大师

android用户界面-组件Widget-地图视图MapView

一、在Google地图上显示本地的位置。 1、首先注意在AndroidManifest.xml文件中,增加权限: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission> 在application中activity外,增加:uses-library <uses-library android:name="com.google.android.maps" /> 2、在类中,将extends Activity改为extends MapActivity 3、设置可放大缩小地图的控件。 在xml文件中,添加以下内容: <LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/zoom" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" > </LinearLayout> 在类中,加入: LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom); View zoomView = mapView.getZoomControls(); zoomLayout.addView(zoomView, new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); mapView.displayZoomControls(true); mapView.getController().setZoom(14);//设置缩放级别 p = this.getCurrentGeoPoint(); mapView.getController().animateTo(p);// 通过动画方式移动到指定坐标s 4、通过以下方法得到当前位置的经纬度 private GeoPoint getCurrentGeoPoint() { LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); Location location = locationManager .getLastKnownLocation(LocationManager.NETWORK_PROVIDER); return new GeoPoint((int) (location.getLatitude() * 1e6), (int) (location.getLongitude() * 1e6)); } 5、通过以下方式显示当前位置在地图上显示: class MapOverlay extends com.google.android.maps.Overlay { @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); //—translate the GeoPoint to screen pixels— Point screenPts = new Point(); mapView.getProjection().toPixels(p, screenPts); //—add the marker— Bitmap bmp = BitmapFactory.decodeResource( getResources(), R.drawable.pushpin); canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null); return true; } } 在oncreate方法中,加入: MapOverlay mapOverlay = new MapOverlay(); List<Overlay> listOfOverlays = mapView.getOverlays(); listOfOverlays.clear(); listOfOverlays.add(mapOverlay); 这样就能在屏幕中显示你当前位置的地图显示了; 如下图: 源代码见:http://henzil.googlecode.com/svn/trunk/android.googleMap01/ 二、输入地址,在地图上显示相应的位置。此方法是通过查询地址名称,返回一个list结果。在地图上显示: 此方法与上述方法基本一致,不同之处在于:是用getFromLocationName方法,来查询目的地的经纬度。 如下代码: // 通过系统默认区域设置进行地图定位 Geocoder gc = new Geocoder(this); mapView.setStreetView(true); try { // 通过地址名称描述返回一个查询结果的数组(后面参数为返回最大结果数) addresses = gc.getFromLocationName(address, 5); // 如果未查询到任何结果 if (addresses != null) { geoPoint = new GeoPoint( // 返回纬度,经度 (int) (addresses.get(0).getLatitude() * 1E6), (int) (addresses.get(0).getLongitude() * 1E6)); setTitle(addresses.get(0).getFeatureName()); MyOverlay myOverlay = new MyOverlay(); mapView.getOverlays().add(myOverlay); mapView.getController().setZoom(16); mapView.getController().animateTo(geoPoint); } } catch (Exception e) { e.printStackTrace(); } 如下图所示: 本文转自linzheng 51CTO博客,原文链接:http://blog.51cto.com/linzheng/1080684

优秀的个人博客,低调大师

android用户界面-组件Widget-画廊视图Gallery

Android的Gallery控件是个很不错的看图控件,大大减轻了开发者对于看图功能的开发,而且效果也比较美观。 /Chapter04_UI_Gallery01/src/com/amaker/test/MainActivity.java 代码 packagecom.amaker.test; importandroid.app.Activity; importandroid.content.Context; importandroid.os.Bundle; importandroid.view.View; importandroid.view.ViewGroup; importandroid.widget.BaseAdapter; importandroid.widget.Gallery; importandroid.widget.ImageView; publicclassMainActivityextendsActivity{ /**Calledwhentheactivityisfirstcreated.*/ @Override //创建时被调用 publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.main); Galleryg=(Gallery)findViewById(R.id.Gallery01); g.setAdapter(newMyAdapter(this)); } classMyAdapterextendsBaseAdapter{ Contextcontext; MyAdapter(Contextcontext){ this.context=context; } privateInteger[]imgs={ R.drawable.gallery_photo_1, R.drawable.gallery_photo_2, R.drawable.gallery_photo_3, R.drawable.gallery_photo_4, R.drawable.gallery_photo_5, R.drawable.gallery_photo_6, R.drawable.gallery_photo_7, R.drawable.gallery_photo_8, R.drawable.gallery_photo_1, R.drawable.gallery_photo_2, R.drawable.gallery_photo_3, R.drawable.gallery_photo_4, R.drawable.gallery_photo_5, R.drawable.gallery_photo_6, R.drawable.gallery_photo_7, R.drawable.gallery_photo_8 }; publicintgetCount(){ returnimgs.length; } publicObjectgetItem(intitem){ returnitem; } publiclonggetItemId(intid){ returnid; } publicViewgetView(intposition,ViewconvertView,ViewGroupparent){ ImageViewimageView=newImageView(context); imageView.setImageResource(imgs[position]); imageView.setScaleType(ImageView.ScaleType.FIT_XY); imageView.setLayoutParams(newGallery.LayoutParams(136,88)); returnimageView; } } } /Chapter04_UI_Gallery01/res/layout/main.xml 代码 <?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <Gallery android:id="@+id/Gallery01" android:layout_width="wrap_content" android:layout_height="wrap_content"> </Gallery> </LinearLayout> 本文转自linzheng 51CTO博客,原文链接:http://blog.51cto.com/linzheng/1080689

优秀的个人博客,低调大师

android用户界面-组件Widget-网格视图GridView

GridView按照行列的方式来显示内容。一般适合显示图标。图片等内容,主要用于设置Adapter。 通过基础类BaseAdapter类,重写getView()方法来设置图片显示格式。 /Chapter04_UI_GridView01/src/com/amaker/test/MainActivity.java 代码 packagecom.amaker.test; importandroid.app.Activity; importandroid.content.Context; importandroid.os.Bundle; importandroid.view.View; importandroid.view.ViewGroup; importandroid.widget.BaseAdapter; importandroid.widget.GridView; importandroid.widget.ImageView; publicclassMainActivityextendsActivity{ privateGridViewgv; @Override publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.main); gv=(GridView)findViewById(R.id.GridView01); gv.setNumColumns(4); //gv.setNumColumns(3); //String[]strs={"a","a1","a2","b","b1","b2","c","c1","c2"}; //ArrayAdapter<String>adapter=newArrayAdapter<String>(this,android.R.layout.simple_gallery_item,strs); gv.setAdapter(newMyAdapter(this)); } classMyAdapterextendsBaseAdapter{ privateInteger[]imgs={ R.drawable.gallery_photo_1, R.drawable.gallery_photo_2, R.drawable.gallery_photo_3, R.drawable.gallery_photo_4, R.drawable.gallery_photo_5, R.drawable.gallery_photo_6, R.drawable.gallery_photo_7, R.drawable.gallery_photo_8, R.drawable.gallery_photo_1, R.drawable.gallery_photo_2, R.drawable.gallery_photo_3, R.drawable.gallery_photo_4, R.drawable.gallery_photo_5, R.drawable.gallery_photo_6, R.drawable.gallery_photo_7, R.drawable.gallery_photo_8 }; Contextcontext; MyAdapter(Contextcontext){ this.context=context; } publicintgetCount(){ returnimgs.length; } publicObjectgetItem(intitem){ returnitem; } publiclonggetItemId(intid){ returnid; } publicViewgetView(intposition,ViewconvertView,ViewGroupparent){ ImageViewimageView; if(convertView==null){ imageView=newImageView(context); imageView.setLayoutParams(newGridView.LayoutParams(45,45)); imageView.setAdjustViewBounds(false); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); imageView.setPadding(8,8,8,8); }else{ imageView=(ImageView)convertView; } imageView.setImageResource(imgs[position]); returnimageView; } } } 本文转自linzheng 51CTO博客,原文链接:http://blog.51cto.com/linzheng/1080690

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册