- 博客(128)
- 资源 (2)
- 收藏
- 关注
原创 kotlin笔记代码17-jvm编译相关注解
@JvmName, @JvmField, @JvmOverloads, @JvmStatic, @JvmMultifileClass, @JvmSynthetic, @Throws
2022-10-08 12:21:04
664
原创 kotlin笔记代码15-block: () -> T, block: (T) -> T,block: T.() -> T函数参数定义语法区别
【代码】kotlin笔记代码15-block: () -> T, block: (T) -> T,block: T.() -> T函数参数定义语法区别。
2022-10-08 12:15:39
631
原创 kotlin笔记代码03-集合-List,Mutable|List,Set|MutableSet等用法区别
【代码】kotlin笔记代码03-集合-List,Mutable|List,Set|MutableSet等用法区别。
2022-10-07 05:23:58
466
原创 kotlin笔记代码02-apply,let,run,with,also等扩展函数用法区别
apply,let,run,with,also,takeIf,takeUnless等扩展函数用法区别。
2022-10-07 05:19:45
152
原创 okhttp请求django服务器-ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接的处理
ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接的处理
2022-05-31 09:22:27
1810
原创 Android 获取当前wifi网络或者mobile网络的本地IPv4 的IP地址
package com.common.utils;import android.app.Application;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.net.ConnectivityManager;import android.
2021-03-28 21:58:56
1679
原创 java程序运行adb命令-logcat获取Android Log
class AndroidLogCat { private static void exeCmd() { try { String ins_1 = "cmd.exe /c dir " + System.getProperty("user.home") + "&&"; String ins_2 = "adb devices && adb logcat -c && adb logcat -.
2021-03-14 16:52:22
852
3
原创 Android-获取子View在父View中相对自身的可见宽度比率
/** * 获取子View在父View中相对自身的可见宽度比率 */ public static float getVisibleWidthRatio(ViewGroup parent, View child) { float ratio = 0f; if (child.getRight() > parent.getPaddingStart() && child.getLeft() < parent.getWi...
2021-03-12 22:13:51
369
原创 Android CoordinatorLayout+RecyclerView 在一个Demo Project测试悬浮头不能通过滑动RecyclerView来隐藏的问题
<androidx.coordinatorlayout.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent"> <com.google.android.material.appbar.AppBarLayout android:layout_width="match_p...
2020-11-15 08:50:01
280
原创 Android- 关于webView的canGoBack()失效,不能正常判断是否已经不能后退的bug定位
如下代码,正常情况,web页面历史浏览栈只剩下一个页面的时候,此时webView的canGoBack()函数正常情况应该返回false,但是异常发生时,一直返回true. public boolean onWebBack() { if (canGoBack()) { getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK); goBack();
2020-10-24 12:38:57
5079
原创 Android- Handler更新UI避免内存泄露的三种写法比较
最近,换了公司。新公司的项目,估计很古老了。发现很多模块的Handler写法都是很古老的,没有经过优化的写法,编译器一大块(可能造成内存泄露)黄色警告。虽然工作多年,对Handler的使用优化,基本上也是参考网上的代码,使用静态匿名内部类+弱引用处理,使编译器不再警告即可。如今再碰到这样的问题,就准备稍微总结一下。不总结不知道,一总结,发现这里面还是存在一些,我无法完全解释的问题。package com.test.util.ori_code;import android.annotation.Su
2020-10-24 12:14:03
497
1
原创 使用SmartRefreshLayout 给RecyclerView 添加反弹效果示例
//横向滑动反弹:<com.scwang.smartrefresh.horizontal.SmartRefreshHorizontal xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" app...
2019-11-15 10:41:48
730
原创 小米8Lite Android 8.1 从竖屏activity切换回横屏activity。横屏的activity会变成竖屏
小米8Lite Android 8.1 从竖屏activity切换回横屏activity。横屏的activity会变成竖屏,而且原本横屏的activity没有触发activity的setRequestedOrientation(int requestedOrientation)函数。所以无法通过重写activity的setRequestedOrientation函数解决问题。本人从网上看了几篇...
2019-11-15 10:26:13
822
原创 vuex代码笔记
store.js文件:import Vue from 'vue'import Vuex from 'vuex'Vue.use(Vuex);export default new Vuex.Store({ state: { size: 5 }, mutations: { //同步执行 add: function (state,pa...
2018-10-22 13:14:17
169
原创 前端框架Vue中methods,computed,watch的调用时机的理解
最近在学Vue框架的 时候对methods,computed不甚理解,看了几篇别人写的博客感觉描述的也很模糊,故而在稍微明白他们之间主要差异的时候,写篇博客记录分享一下。methods中定义的函数,其调用时机是:当页面引用了vue data关键字的属性,并且这些属性发生改变的时候,就会执行methods中定义的函数,并且不管methods中定义的函数是否依赖了data关键字中的属性,metho...
2018-10-20 10:30:23
7017
原创 apache+PHP 配置
PHP使用的版本是:php-7.2.11-Win32-VC15-x64.zipApache使用版本是:httpd-2.4.35-win64-VC15Apache的安装与配置以及在上两篇博客中写过,这里直接开始配置php:1.把下载PHP包解压缩 2.打开 E:\Apache\Apache24\conf\httpd.conf 配置两处地方即可: 1.第一处(184行...
2018-10-13 14:50:07
397
原创 apache 服务虚拟主机配置
上一篇博客中,Apache服务已经成功安装,配置,启动成功。现在对配置文件 进行进一步配置:1.配置文件路径:E:/Apache/Apache24/conf/httpd.conf 1.端口配置 修改59行:(不同版本 行号可能不一样),这里默认的是80端口,端口可以配置多个 #Listen 12.34.56.78:80 Listen 802.根目录配置: 修改25...
2018-10-13 12:46:43
571
原创 apache 服务 安装 记录
解压 从官网下载的 httpd-2.4.35-win64-VC15.zip文件 到 E:\Apache\后 以管理员权限打开cmd窗口 ,执行如下E:\Apache\Apache24\bin>httpd -k install -n "Apache"Installing the 'Apache' serviceThe 'Apache' service is successfully ...
2018-10-13 09:34:48
461
原创 Unity -- 物品背包的物品拖动脚本示例
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.EventSystems;public class DragGridHelper : MonoBehaviour,IBeginDragHandler, IDragHandler, IEndDragHa...
2018-10-04 10:19:41
2086
3
原创 Unity -- 3D人物角色简单的摄像机跟随脚本
using UnityEngine;public class ManPlayerCameraFollow3D : MonoBehaviour { public Transform target; public float distanc = 3.5f; public float height = 1.88f; // Use this for initializ...
2018-09-30 15:08:50
939
原创 Unity3D --//IK简单代码使用示例
private void OnAnimatorIK(int layerIndex) { AnimatorStateInfo info = my_ani.GetCurrentAnimatorStateInfo(1); if(info.IsName("r_hand")) { if (Vector3.Angle(tran...
2018-09-29 16:13:09
1003
原创 Unity3D-轮子碰撞器控制坦克移动的简单示例
using System.Collections;using System.Collections.Generic;using UnityEngine;public class PlayerTanke : TankeBase { protected override void Start() { base.Start(); //隐藏鼠标...
2018-09-28 16:32:18
2229
原创 Unity3D --//简单的音频播放脚本
using System.Collections;using System.Collections.Generic;using UnityEngine;public class AudioManager : MonoBehaviour { public static AudioManager Instance; // Use this for initialization...
2018-09-27 16:36:34
2390
1
原创 Unity3D --//2d游戏 怪物左右移动,碰撞方向判断
using System.Collections;using System.Collections.Generic;using UnityEngine;public class EnemyContro : MonoBehaviour { // Use this for initialization public float speed = 1; int move...
2018-09-25 23:03:46
5534
2
原创 Unity3D --//通过射线判断角色是否在地面
using System.Collections;using System.Collections.Generic;using UnityEngine;public class PlayerContro : MonoBehaviour { public float speed; public Animator myAnimator; public SpriteR...
2018-09-23 23:55:03
6378
原创 window10中使用charles抓包手机数据,手机设置代理后无法连接网络的解决办法
最近在win10系统中使用charles抓包手机联网数据,但是手机设置好charles的代理后,手机就不能访问网络了。手机连接的WiFi是win10系统分享的移动热点。这个问题瞎整了几天都没有找到办法。后面无意中把win10的防火墙全部关闭,手机一下子就能正常连接网络了。解决步骤,打开win10的防火墙和网络保护面板,面板中有三种网络:1,域网络 2.专用网络 3.公用网络(使用中)。公用网络后面...
2018-05-28 12:30:09
17243
2
原创 Spring以注解方式配置事物
Spring以注解方式配置事物:@Transactional(isolation=Isolation.REPEATABLE_READ,propagation=Propagation.REQUIRED,readOnly=true)//类上配置的注解会对所有方法生效public class AccountServiceImplimplements AccountService {pri
2017-12-28 09:38:47
256
Snipaste-2.3-Beta-x64.zip
2020-11-21
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人