首页 文章 精选 留言 我的

精选列表

搜索[有状态计算],共10028篇文章
优秀的个人博客,低调大师

用web查看hadoop运行状态

我们安装完hadoop,下面我们从视觉上看看hadoop怎么玩的。 我们可以在win7系统上,通过web界面,在浏览器地址栏输入地址,直接查看hadoop的运行情况; 10.10.11.191:50030 这个里面,我们可以看到Map/Reduce的管理情况 10.10.11.191:50070 这里可以看到HDFS的管理情况。 但是在这里,会有一个问题。 问题:点击上图中,红框锁定的链接,Browser the filesystem,打不开界面。这是什么情况呢? 点击Live Nodes,进入如下界面: 点击host2,同样打不开界面…… host2对应的ip为10.10.11.192 而链接地址为host2:50070/browseDirectory.jsp?namenodeInfoPort=50070&dir=%2F 直接访问的host2主机地址。 很明显,出现这种状况的原因是win7电脑,并不知道host2是谁,所以需要在win7电脑的hosts文件中,添加上host2,host3,host4,master主机和ip地址的映射 win7系统,hosts文件位置:C:\Windows\System32\drivers\etc 在win7电脑上,添加完hosts配置,我们就可以解决上面的问题了。host2也就可以访问了。如下 摘自http://www.cnblogs.com/laov/p/3433994.html 本文转自茄子_2008博客园博客,原文链接:http://www.cnblogs.com/xd502djj/p/4241111.html,如需转载请自行联系原作者。

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

Android 监听手机GPS打开状态

转载请标明出处:http://blog.csdn.net/zhaoyanjun6/article/details/70854942 本文出自【赵彦军的博客】 GPS_Presenter package com.yiba.core; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.location.LocationManager; /** * Created by ${zhaoyanjun} on 2017/3/29. * GPS 开关监听 */ public class GPS_Presenter { private Context mContext ; private Receiver receiver ; private GPS_Interface mInterface ; private String GPS_ACTION = "android.location.PROVIDERS_CHANGED" ; public GPS_Presenter(Context context , GPS_Interface mInterface ){ this.mContext = context ; this.mInterface = mInterface ; observeWifiSwitch(); } private void observeWifiSwitch(){ IntentFilter filter = new IntentFilter(); filter.addAction( GPS_ACTION ); receiver = new Receiver() ; mContext.registerReceiver(receiver, filter); } /** * 释放资源 */ public void onDestroy(){ if ( receiver != null ){ mContext.unregisterReceiver( receiver ); } if (mContext!=null){ mContext = null; } } class Receiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().matches( GPS_ACTION )) { if ( mInterface != null ){ mInterface.gpsSwitchState( gpsIsOpen( context )); } } } } /** * 判断GPS是否开启,GPS或者AGPS开启一个就认为是开启的 * @param context * @return true 表示开启 */ public boolean gpsIsOpen(final Context context) { LocationManager locationManager = (LocationManager) context.getApplicationContext().getSystemService(Context.LOCATION_SERVICE); // 通过GPS卫星定位,定位级别可以精确到街(通过24颗卫星定位,在室外和空旷的地方定位准确、速度快) boolean gps = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); // 通过WLAN或移动网络(3G/2G)确定的位置(也称作AGPS,辅助GPS定位。主要用于在室内或遮盖物(建筑群或茂密的深林等)密集的地方定位) boolean network = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); if (gps || network) { return true; } return false; } } GPS_Interface 回调接口 package com.yiba.core; /** * Created by ${zhaoyanjun} on 2017/3/29. * gps 开关监听 */ public interface GPS_Interface { void gpsSwitchState( boolean gpsOpen ); } 在 Activity 中使用 package com.yiba.core; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.Toast; public class MainActivity extends AppCompatActivity implements GPS_Interface { private GPS_Presenter gps_presenter ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); gps_presenter = new GPS_Presenter( this , this ) ; } @Override protected void onDestroy() { super.onDestroy(); //释放资源 if ( gps_presenter != null ){ gps_presenter.onDestroy(); } } @Override public void gpsSwitchState(boolean gpsOpen) { if ( gpsOpen ){ Toast.makeText(this, " 手机GPS 打开", Toast.LENGTH_SHORT).show(); }else { Toast.makeText(this, " 手机GPS 关闭", Toast.LENGTH_SHORT).show(); } } }

资源下载

更多资源
Mario

Mario

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

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

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

用户登录
用户注册