<改变imageView的颜色和状态栏>
1.
- import android.content.Context;
- import android.content.res.TypedArray;
- import android.support.annotation.Nullable;
- import android.util.AttributeSet;
- import android.widget.ImageView;
- import java.util.ArrayList;
- public class RippleImageView extends ImageView {
- public static ArrayList<RippleImageView> ImageList = new ArrayList<RippleImageView>();
- private boolean globalColor = false;
- public RippleImageView(Context context, @Nullable AttributeSet attrs) {
- super(context, attrs);
- StatusBarUtils.RippleView(this, context);
- TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.mk);
- globalColor = ta.getBoolean(R.styleable.mk_globalcolor, false);
- if(globalColor == true)
- {
- setColorFilter(ColorUtils.GlobalColor);
- }
- if(ImageList.contains(this) == false)
- {
- ImageList.add(this);
- }
- }
- public void ChangeColor(int Color)
- {
- if(globalColor == true)
- {
- setColorFilter(Color);
- }
- }
- }
2.
- import android.content.res.ColorStateList;
- public class ColorUtils {
- public static int GlobalColor = 0xffd43b33;
- public static int GlobalColorSelected = 0xffffffff;
- public static String GlobalColorString = "#FFD43B33";
- public static int GlobalTextColorTitle = 0xff606060;
- public static int GlobalTextColorSubtitle = 0xff7f7d7d;
- public static ColorStateList colorStateList= null;
- public static ColorStateList getColorStateList(int mode)
- {
- if(colorStateList == null)
- {
- int[][] states = new int[][];
- states[] = new int[]{android.R.attr.state_pressed};
- states[] = new int[]{android.R.attr.state_enabled};
- int[] colors = new int[]{GlobalColor, GlobalColor};
- colorStateList = new ColorStateList(states, colors);
- }
- return colorStateList;
- }
- public static void SetThemeColor(int BackColor, boolean backColorLight)
- {
- GlobalColor = BackColor;
- if(backColorLight == true)
- {
- GlobalTextColorTitle = 0xff606060;
- GlobalTextColorSubtitle = 0xff7f7d7d;
- }
- else
- {
- GlobalTextColorTitle = 0xffffffff;
- GlobalTextColorSubtitle = 0xffd0cece;
- }
- }
- }
3.
- import android.app.Activity;
- import android.app.Dialog;
- import android.content.Context;
- import android.content.res.TypedArray;
- import android.graphics.Color;
- import android.os.Build;
- import android.view.View;
- import android.view.Window;
- import android.view.WindowManager;
- public class StatusBarUtils {
- public static void setWindowStatusBarColor(Activity activity, String color) {
- try {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- Window window = activity.getWindow();
- window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
- window.setStatusBarColor(Color.parseColor(color));
- //底部导航栏
- //window.setNavigationBarColor(activity.getResources().getColor(colorResId));
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public static void setWindowStatusBarColor(Dialog dialog, String color) {
- try {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- Window window = dialog.getWindow();
- window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
- window.setStatusBarColor(Color.parseColor(color));
- //底部导航栏
- //window.setNavigationBarColor(activity.getResources().getColor(colorResId));
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public static void RippleView(View view, Context context)
- {
- if(android.os.Build.VERSION.SDK_INT >= )
- {
- int[] attrsArray = { android.R.attr.selectableItemBackgroundBorderless };
- //TypedArray typedArray = activity.obtainStyledAttributes(attrsArray);
- TypedArray typedArray = context.obtainStyledAttributes(attrsArray);
- int selector = typedArray.getResourceId(, attrsArray[]);
- view.setBackgroundResource(selector);
- // don't forget the resource recycling
- typedArray.recycle();
- }
- else
- {
- int[] attrsArray = { android.R.attr.selectableItemBackground };
- TypedArray typedArray = context.obtainStyledAttributes(attrsArray);
- //TypedArray typedArray = getActivity().obtainStyledAttributes(attrsArray);
- int selector = typedArray.getResourceId(, attrsArray[]);
- view.setBackgroundResource(selector);
- typedArray.recycle();
- }
- }
- }
3333_
- import android.content.Context;
- import android.content.Intent;
- import android.content.SharedPreferences;
- import android.graphics.Color;
- import android.graphics.PorterDuff;
- import android.support.design.widget.BottomSheetBehavior;
- import android.support.design.widget.CoordinatorLayout;
- import android.support.v4.app.FragmentManager;
- import android.support.v4.app.FragmentTransaction;
- import android.support.v4.widget.NestedScrollView;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.util.Log;
- import android.view.Gravity;
- import android.view.View;
- import android.widget.CompoundButton;
- import android.widget.ImageView;
- import android.widget.LinearLayout;
- import android.widget.RadioButton;
- import android.widget.Switch;
- import android.widget.TextView;
- import org.greenrobot.eventbus.EventBus;
- import org.greenrobot.eventbus.Subscribe;
- import org.greenrobot.eventbus.ThreadMode;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Observable;
- public class MainActivity extends AppCompatActivity {
- private static final String TAG = "MainActivity";
- List<RippleImageView> viewlist=new ArrayList<>();
- //TextView textTest;
- ArrayList<ImageView> buttonGroup = new ArrayList<ImageView>();
- int selectedButtonID = -;
- BottomSheetBehavior behavior;
- String packName;
- int StyleNow; //1-Light Style 2-DarkStyle
- TextView textViewSongName ;
- TextView textViewSingerName;
- /**
- * 自定义stylecolor 标识 1-6种
- */
- int styleNowColor;
- /**
- *
- * 添加部分 gxw 17/06/13
- */
- RippleImageView imageViewCD,imageViewSkip,imageViewNext,imageViewStop,imageViewMore;
- /**
- * 需要改变颜色的底部五个image集合
- */
- RippleList rippleList;
- /**
- * 当前显示的fragment序号
- */
- int fragmentNow;
- /**
- * LinearLayout 界面顶部红色的部分(可以改变颜色的部分)
- */
- LinearLayout appBarLayoutUp;
- FragmentTransaction fragmentTransaction;
- FragmentManager fragmentManager;
- /**
- * 判断HomeActivity需要进入哪个fragment
- */
- int type;
- private void SetChecked(int id)
- {
- selectedButtonID = id;
- for(int i = ; i < buttonGroup.size(); i++)
- {
- if(id == i)
- {
- changeFragment(i+);
- Log.d(TAG, "SetChecked:选择 "+i);
- buttonGroup.get(i).setAlpha(1.0f);
- }
- else
- {
- buttonGroup.get(i).setAlpha(0.7f);
- }
- }
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- EventBus.getDefault().register(this);
- type=getIntent().getIntExtra("type",);
- Log.d(TAG, "onCreate: +type=="+type);
- initView();
- initialize(type);
- packName = getPackageName();
- SharedPreferences prefs = getSharedPreferences(packName, Context.MODE_PRIVATE);
- StyleNow = prefs.getInt("Style", );
- if(StyleNow == ) {
- ColorUtils.SetThemeColor(0xffd43b33, true);
- }
- else if(StyleNow == )
- {
- ColorUtils.SetThemeColor(0xffd43b33, false);
- }
- textViewSongName = (TextView) findViewById(R.id.textViewSongName);
- textViewSingerName = (TextView) findViewById(R.id.textViewSingerName);
- TextView textViewScan = (TextView) findViewById(R.id.textViewScan);
- imageViewCD= (RippleImageView) findViewById(R.id.imageViewCD);
- StatusBarUtils.RippleView(textViewSongName, this);
- StatusBarUtils.RippleView(textViewSingerName, this);
- StatusBarUtils.RippleView(textViewScan, this);
- LinearLayout appBarLayoutUp = (LinearLayout)findViewById(R.id.appBarLayoutUp);
- appBarLayoutUp.setBackgroundColor(ColorUtils.GlobalColor);
- ImageView imageViewProg = (ImageView)findViewById(R.id.imageViewProg);
- imageViewProg.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- SetChecked();
- }
- });
- ImageView imageViewSinger = (ImageView)findViewById(R.id.imageViewSinger);
- imageViewSinger.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- SetChecked();
- }
- });
- ImageView imageViewSong = (ImageView)findViewById(R.id.imageViewSong);
- imageViewSong.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- SetChecked();
- }
- });
- ImageView imageViewFavo = (ImageView)findViewById(R.id.imageViewFavo);
- imageViewFavo.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- SetChecked();
- }
- });
- ImageView imageViewRecord = (ImageView)findViewById(R.id.imageViewRecord);
- imageViewRecord.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- SetChecked();
- }
- });
- buttonGroup.add(imageViewProg);
- buttonGroup.add(imageViewSinger);
- buttonGroup.add(imageViewSong);
- buttonGroup.add(imageViewFavo);
- buttonGroup.add(imageViewRecord);
- ImageView imageViewBagde = (ImageView)findViewById(R.id.imageViewBagde);
- final RippleImageView imageViewStop= (RippleImageView) findViewById(R.id.imageViewStop);
- imageViewStop.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- imageViewStop.ChangeColor(getResources().getColor(R.color.styleColor2));
- }
- });
- BadgeView badge = new BadgeView(this);
- badge.setTargetView(imageViewBagde);
- badge.setBadgeGravity(Gravity.CENTER);
- badge.setBadgeCount();
- StatusBarUtils.setWindowStatusBarColor(this, ColorUtils.GlobalColorString);
- ImageView imageViewMore = (ImageView)findViewById(R.id.imageViewMore);
- imageViewMore.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if(behavior.getState() == BottomSheetBehavior.STATE_EXPANDED) {
- /**
- * 加的
- */
- MainActivity.this.finish();
- behavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
- }else {
- behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
- }
- }
- });
- NestedScrollView nsView = (NestedScrollView)findViewById(R.id.bottomSetting);
- behavior = BottomSheetBehavior.from(nsView);
- behavior.setState(BottomSheetBehavior.STATE_HIDDEN);
- ImageView imageViewBackFromSetting = (ImageView)findViewById(R.id.imageViewBackFromSetting);
- RadioButton rb1 = (RadioButton)findViewById(R.id.radioButtonLight);
- rb1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- if(isChecked == true)
- {
- StyleNow = ;
- EventBus.getDefault().post(new Message());
- CoordinatorLayout coordinatorLayout= (CoordinatorLayout) findViewById(R.id.layoutbase);
- coordinatorLayout.setBackgroundResource(R.drawable.bg01);
- }
- }
- });
- RadioButton rb2 = (RadioButton)findViewById(R.id.radioButtonDark);
- rb2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- if(isChecked == true)
- {
- StyleNow = ;
- EventBus.getDefault().post(new Message());
- CoordinatorLayout coordinatorLayout= (CoordinatorLayout) findViewById(R.id.layoutbase);
- coordinatorLayout.setBackgroundResource(R.drawable.bg02);
- }
- }
- });
- if(StyleNow == )
- {
- rb1.setChecked(true);
- textViewSongName.setTextColor(getResources().getColor(R.color.lightStyle_TextColor));
- textViewSingerName.setTextColor(getResources().getColor(R.color.lightStyle_TextColor));
- }
- else if(StyleNow == )
- {
- rb2.setChecked(true);
- textViewSongName.setTextColor(getResources().getColor(R.color.darkStyle_TextColor));
- textViewSingerName.setTextColor(getResources().getColor(R.color.darkStyle_TextColor));
- }
- imageViewBackFromSetting.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if(StyleNow == ) {
- ColorUtils.SetThemeColor(0xffd43b33, true);
- }
- else if(StyleNow == )
- {
- ColorUtils.SetThemeColor(0xffd43b33, false);
- }
- SharedPreferences prefs = getSharedPreferences(packName, Context.MODE_PRIVATE);
- SharedPreferences.Editor ed = prefs.edit();
- ed.putInt("Style", StyleNow);
- ed.commit();
- behavior.setState(BottomSheetBehavior.STATE_HIDDEN);
- }
- });
- SetChecked(type-);
- imageViewCD.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- startActivity(new Intent(MainActivity.this, PlayActivity.class));
- }
- });
- }
- /**
- * gxw 17/06/13
- */
- public void initialize( int type){
- fragmentManager=getSupportFragmentManager();
- fragmentTransaction=fragmentManager.beginTransaction();
- fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
- switch (type){
- case :
- fragmentTransaction.replace(R.id.fragmentlayout,new ProFragment());
- fragmentNow=;
- break;
- case :
- fragmentTransaction.replace(R.id.fragmentlayout,new SingerFragment());
- fragmentNow=;
- break;
- case :
- fragmentTransaction.replace(R.id.fragmentlayout,new SongFragment());
- fragmentNow=;
- break;
- case :
- fragmentTransaction.replace(R.id.fragmentlayout,new FavoFragment());
- fragmentNow=;
- break;
- case :
- fragmentTransaction.replace(R.id.fragmentlayout,new RecordFragment());
- fragmentNow=;
- break;
- }
- fragmentTransaction.commit();
- }
- public void changeFragment(int i){
- fragmentManager=getSupportFragmentManager();
- fragmentTransaction=fragmentManager.beginTransaction();
- /**
- * 判断动画的切换方向
- */
- if(fragmentNow>i){
- fragmentTransaction.setCustomAnimations(R.anim.push_left_in,R.anim.push_left_out);
- }else if(fragmentNow<i){
- fragmentTransaction.setCustomAnimations(R.anim.back_left_in,R.anim.back_right_out);
- }
- switch (i){
- case :
- fragmentTransaction.replace(R.id.fragmentlayout,new ProFragment());
- fragmentNow=;
- break;
- case :
- fragmentTransaction.replace(R.id.fragmentlayout,new SingerFragment());
- fragmentNow=;
- break;
- case :
- fragmentTransaction.replace(R.id.fragmentlayout,new SongFragment());
- fragmentNow=;
- break;
- case :
- fragmentTransaction.replace(R.id.fragmentlayout,new FavoFragment());
- fragmentNow=;
- break;
- case :
- fragmentTransaction.replace(R.id.fragmentlayout,new RecordFragment());
- fragmentNow=;
- break;
- }
- // fragmentTransaction.addToBackStack(null);
- fragmentTransaction.commit();
- }
- @Subscribe(threadMode = ThreadMode.MAIN)
- public void onEventMainThread(com.multak.cookaraclient.info.Message msg){
- if(msg.getStyle() == )
- {
- textViewSongName.setTextColor(getResources().getColor(R.color.lightStyle_TextColor));
- textViewSingerName.setTextColor(getResources().getColor(R.color.lightStyle_TextColor));
- }
- else if(msg.getStyle() == )
- {
- textViewSongName.setTextColor(getResources().getColor(R.color.darkStyle_TextColor));
- textViewSingerName.setTextColor(getResources().getColor(R.color.darkStyle_TextColor));
- }
- }
- public void initView(){
- appBarLayoutUp= (LinearLayout) findViewById(R.id.appBarLayoutUp);
- int x=SharedPreferencesUtils.getParam(this,"StyleNowColor",);
- Log.d(TAG, "initView: 颜色1::"+x);
- imageViewCD= (RippleImageView) findViewById(R.id.imageViewCD);
- imageViewSkip= (RippleImageView) findViewById(R.id.imageViewSkip);
- imageViewNext= (RippleImageView) findViewById(R.id.imageViewNext);
- imageViewStop= (RippleImageView) findViewById(R.id.imageViewStop);
- imageViewMore= (RippleImageView) findViewById(R.id.imageViewMore);
- viewlist.add(imageViewCD);
- viewlist.add(imageViewSkip);
- viewlist.add(imageViewNext);
- viewlist.add(imageViewStop);
- viewlist.add(imageViewMore);
- rippleList=new RippleList(viewlist,this);
- setStatubar(x);
- rippleList.setColor(x);
- //rippleList.setLinearLayout(appBarLayoutUp,x);
- appBarLayoutUp.setBackgroundColor(getResources().getColor(R.color.styleColor4));
- }
- /**
- *
- * @param view 自定义颜色选择,并作操作处理
- */
- public void setStyleColor(View view){
- switch (view.getId()){
- case R.id.textView_styleColor1:
- rippleList.setColor();
- rippleList.setSharep();
- int x= (Integer) SharedPreferencesUtils.getParam(this,"StyleNowColor",);
- Log.d(TAG, "setStyleColor: 颜色12:"+x);
- appBarLayoutUp.setBackgroundColor(getResources().getColor(R.color.styleColor1));
- setStatubar();
- break;
- case R.id.textView_styleColor2:
- rippleList.setColor();
- rippleList.setSharep();
- setStatubar();
- break;
- case R.id.textView_styleColor3:
- rippleList.setColor();
- rippleList.setSharep();
- setStatubar();
- break;
- case R.id.textView_styleColor4:
- rippleList.setColor();
- rippleList.setSharep();
- setStatubar();
- break;
- case R.id.textView_styleColor5:
- rippleList.setColor();
- rippleList.setSharep();
- setStatubar();
- break;
- case R.id.textView_styleColor6:
- rippleList.setColor();
- rippleList.setSharep();
- setStatubar();
- break;
- default:
- break;
- }
- }
- public void setStatubar(int i) {
- switch (i) {
- /**
- * <color name="styleColor1">#1FC4C4</color>
- <color name="styleColor2">#71C41F</color>
- <color name="styleColor3">#5B0CAA</color>
- <color name="styleColor4">#BABA20</color>
- <color name="styleColor5">#AA0C5B</color>
- <color name="styleColor6">#D43B33</color>
- */
- case :
- StatusBarUtils.setWindowStatusBarColor(this, "1FC4C4");
- break;
- case :
- StatusBarUtils.setWindowStatusBarColor(this, "#71C41F");
- break;
- case :
- StatusBarUtils.setWindowStatusBarColor(this, "#5B0CAA");
- break;
- case :
- StatusBarUtils.setWindowStatusBarColor(this, "#BABA20");
- break;
- case :
- StatusBarUtils.setWindowStatusBarColor(this, "#AA0C5B");
- break;
- case :
- StatusBarUtils.setWindowStatusBarColor(this, "#D43B33");
- break;
- }
- }
- }
- import android.content.Context;
- import android.content.SharedPreferences;
- import android.widget.LinearLayout;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * Created by guoxw on 2017/6/20.
- */
- public class RippleList {
- List<RippleImageView>data=new ArrayList<>();
- Context context;
- public RippleList(List<RippleImageView> data, Context context) {
- this.data = data;
- this.context = context;
- }
- public void setColor(int i){
- if(i==)
- {
- for (RippleImageView ripp : data) {
- ripp.ChangeColor(context.getResources().getColor(R.color.styleColor1));
- }
- }
- if(i==)
- {
- for (RippleImageView ripp : data) {
- ripp.ChangeColor(context.getResources().getColor(R.color.styleColor2));
- }
- }
- if(i==)
- {
- for (RippleImageView ripp : data) {
- ripp.ChangeColor(context.getResources().getColor(R.color.styleColor3));
- }
- }
- if(i==)
- {
- for (RippleImageView ripp : data) {
- ripp.ChangeColor(context.getResources().getColor(R.color.styleColor4));
- }
- }
- if(i==)
- {
- for (RippleImageView ripp : data) {
- ripp.ChangeColor(context.getResources().getColor(R.color.styleColor5));
- }
- }
- if(i==)
- {
- for (RippleImageView ripp : data) {
- ripp.ChangeColor(context.getResources().getColor(R.color.styleColor6));
- }
- }
- }
- public void setSharep(int i){
- SharedPreferencesUtils.setParam(context,"StyleNowColor",i);
- }
- public void setLinearLayout(LinearLayout lauout, int i){
- switch (i){
- case :
- lauout.setBackgroundColor(context.getResources().getColor(R.color.styleColor1));
- break;
- case :
- lauout.setBackgroundColor(context.getResources().getColor(R.color.styleColor2));
- break;
- case :
- lauout.setBackgroundColor(context.getResources().getColor(R.color.styleColor3));
- break;
- case :
- lauout.setBackgroundColor(context.getResources().getColor(R.color.styleColor4));
- break;
- case :
- lauout.setBackgroundColor(context.getResources().getColor(R.color.styleColor5));
- break;
- case :
- lauout.setBackgroundColor(context.getResources().getColor(R.color.styleColor6));
- break;
- }
- }
- }
- import android.content.Context;
- import android.content.SharedPreferences;
- /**
- * Created by guoxw on 2017/6/20.
- */
- public class SharedPreferencesUtils {
- private static String NAME="com.multak.cookaraclient1";
- public static void setParam(Context context, String key, int x){
- SharedPreferences prefs = context.getSharedPreferences(NAME, Context.MODE_PRIVATE);
- SharedPreferences.Editor ed = prefs.edit();
- ed.putInt(key, x);
- ed.commit();
- }
- public static int getParam(Context context,String key,int y){
- SharedPreferences p=context.getSharedPreferences(NAME,Context.MODE_PRIVATE);
- return p.getInt(key,y);
- }
- }
<改变imageView的颜色和状态栏>的更多相关文章
- 简单物联网:外网访问内网路由器下树莓派Flask服务器
最近做一个小东西,大概过程就是想在教室,宿舍控制实验室的一些设备. 已经在树莓上搭了一个轻量的flask服务器,在实验室的路由器下,任何设备都是可以访问的:但是有一些限制条件,比如我想在宿舍控制我种花 ...
- 利用ssh反向代理以及autossh实现从外网连接内网服务器
前言 最近遇到这样一个问题,我在实验室架设了一台服务器,给师弟或者小伙伴练习Linux用,然后平时在实验室这边直接连接是没有问题的,都是内网嘛.但是回到宿舍问题出来了,使用校园网的童鞋还是能连接上,使 ...
- 外网访问内网Docker容器
外网访问内网Docker容器 本地安装了Docker容器,只能在局域网内访问,怎样从外网也能访问本地Docker容器? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动Docker容器 ...
- 外网访问内网SpringBoot
外网访问内网SpringBoot 本地安装了SpringBoot,只能在局域网内访问,怎样从外网也能访问本地SpringBoot? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装Java 1 ...
- 外网访问内网Elasticsearch WEB
外网访问内网Elasticsearch WEB 本地安装了Elasticsearch,只能在局域网内访问其WEB,怎样从外网也能访问本地Elasticsearch? 本文将介绍具体的实现步骤. 1. ...
- 怎样从外网访问内网Rails
外网访问内网Rails 本地安装了Rails,只能在局域网内访问,怎样从外网也能访问本地Rails? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动Rails 默认安装的Rails端口 ...
- 怎样从外网访问内网Memcached数据库
外网访问内网Memcached数据库 本地安装了Memcached数据库,只能在局域网内访问,怎样从外网也能访问本地Memcached数据库? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装 ...
- 怎样从外网访问内网CouchDB数据库
外网访问内网CouchDB数据库 本地安装了CouchDB数据库,只能在局域网内访问,怎样从外网也能访问本地CouchDB数据库? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动Cou ...
- 怎样从外网访问内网DB2数据库
外网访问内网DB2数据库 本地安装了DB2数据库,只能在局域网内访问,怎样从外网也能访问本地DB2数据库? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动DB2数据库 默认安装的DB2 ...
- 怎样从外网访问内网OpenLDAP数据库
外网访问内网OpenLDAP数据库 本地安装了OpenLDAP数据库,只能在局域网内访问,怎样从外网也能访问本地OpenLDAP数据库? 本文将介绍具体的实现步骤. 1. 准备工作 1.1 安装并启动 ...
随机推荐
- redis的跳跃表
跳跃表是一种插入.查询.删除的平均时间复杂度为O(nlogn)的数据结构,在最差情况下是O(n),当然这几乎很难出现. 和红黑树相比较 最差时间复杂度要差很多,红黑树是O(nlogn),而跳跃表是O( ...
- VGG 19
关于VGG19的一些参考资料 http://www.cnblogs.com/vipyoumay/archive/2017/11/23/7884472.html https://cloud.tencen ...
- ionic3、Angular4 定时器的使用
// 声明变量 applicationInterval:any; // 定时器 // 使用定时器,每秒执行一次 ionViewDidEnter(){ let that = this; let appl ...
- java操作Excel的poi基础语法
创建一个简单的实列 package com.java.poi; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache ...
- SaltStact自动化运维工具02
Grains基础:• Grains是saltstack最重要的组件之一• 存储minion端的基本信息,这些信息一般都是静态的,如CPU.内核.操作系统等• Grains存储在minion本地• 管 ...
- Linux分布式测试
在使用Jmeter进行性能测试时,如果并发数比较大(比如最近项目需要支持1000并发),单台电脑的配置(CPU和内存)可能无法支持,这时可以使用Jmeter提供的分布式测试的功能. 执行机和调度机做好 ...
- jemeter参数化读取文件
1.新建一个123.csv文件 如图 2.添加http请求 3.添加一个查看结果树 二.通过函数助手 (1)打开函数助手 ......... 在json属组中引入变量 这是别人参考的
- 我的第一个arcgis地图应用
步骤: 1.设置一个基本的html文档 <!DOCTYPE html> <html> <head> <meta http-equiv="Conten ...
- 关于excel导出
转载自:https://blog.csdn.net/ljj_9/article/details/50395688 //一个excel表格: HSSFWorkbook wb = new HSSFWork ...
- js面向对象编程: js类定义函数时prototype和this差别?
在面向对象编写js脚本时,定义实例方法主要有两种 例如以下: function ListCommon2(afirst) { var first=afirst; this.do1=function () ...