首页
关于
壁纸
直播
留言
友链
统计
Search
1
《三国志英杰传》攻略
6,034 阅读
2
Emby客户端IOS破解
5,769 阅读
3
白嫖Emby
5,768 阅读
4
《吞食天地1》金手指代码
4,694 阅读
5
破解emby-server
4,040 阅读
moonjerx
game
age-of-empires
zx3
san-guo-zhi
尼尔:机械纪元
net
emby
learn-video
docker
torrent
photoshop
route
minio
git
ffmpeg
im
vue
gitlab
typecho
svn
alipay
nasm
srs
mail-server
tailscale
kkfileview
aria2
webdav
synology
redis
oray
chemical
mxsite
math
π
x-ui
digital-currency
server
nginx
baota
k8s
http
cloud
linux
shell
database
vpn
esxi
rancher
domain
k3s
ewomail
os
android
windows
ios
app-store
macos
develop
java
javascript
uniapp
nodejs
hbuildx
maven
android-studio
jetbrain
jenkins
css
mybatis
php
python
hardware
hard-disk
pc
RAM
software
pt
calibre
notion
office
language
literature
philosophy
travel
登录
Search
标签搜索
ubuntu
mysql
openwrt
zerotier
springboot
centos
openvpn
jdk
吞食天地2
synology
spring
idea
windows11
吞食天地1
transmission
google-play
Japanese
xcode
群晖
kiftd
MoonjerX
累计撰写
370
篇文章
累计收到
459
条评论
首页
栏目
moonjerx
game
age-of-empires
zx3
san-guo-zhi
尼尔:机械纪元
net
emby
learn-video
docker
torrent
photoshop
route
minio
git
ffmpeg
im
vue
gitlab
typecho
svn
alipay
nasm
srs
mail-server
tailscale
kkfileview
aria2
webdav
synology
redis
oray
chemical
mxsite
math
π
x-ui
digital-currency
server
nginx
baota
k8s
http
cloud
linux
shell
database
vpn
esxi
rancher
domain
k3s
ewomail
os
android
windows
ios
app-store
macos
develop
java
javascript
uniapp
nodejs
hbuildx
maven
android-studio
jetbrain
jenkins
css
mybatis
php
python
hardware
hard-disk
pc
RAM
software
pt
calibre
notion
office
language
literature
philosophy
travel
页面
关于
壁纸
直播
留言
友链
统计
搜索到
68
篇与
develop
的结果
2023-07-01
Javascript中0 == ""的判断结果为true
$(function() { console.log("0 == ' ':" + (0 == '')); console.log("0 === '':" + (0 === '')); console.log("0 == null:" + (0 == null)); console.log("0 === null:" + (0 === null)); console.log("1 == true:" + (1 == true)); console.log("1 === true:" + (1 === true)); console.log("0 == false:" + (0 == false)); console.log("0 === false:" + (0 === false)); console.log("null == undefined:" + (null == undefined)); console.log("null === undefined:" + (null === undefined)); })先来说一下 === 吧1、首先是判断两值的类型是否一样,不一样就不相等。2、字符串为例,需要两个字符串的长度一致和每个字符的位置都一致才相等。3、如果两都是引用,比较引用是否一致。4、从上面的运行结果可以看出 null === undefined 是 false的,因为两个值的类型不一样。其实,js的 === 有点类似 Java 里面的 equals 方法。最后就是 js 的 == 了1、如果两值的类型一样,然后就进行 === 比较。2、如果两值的类型不一样,就先转为相同的类型再进行比较。【1】从上面的运行结果可以看到 null == undefined 为 true 的,null == undefined 比较时是不进行转换的,并且规定 null 等于 undefined。【2】如果不同类型与 true 或者 false 进行比较时,会先把true转成 1 ,false 转成 0 ,再进行比较。这就解释了为什么 0 == false 和 1== true 为 true 了。【3】如果一个是基本数据类型一个是对象,那会先把对象先转成基本数据类型,再进行比较。【4】本文的重点:0 == ' ' 为 true,因为0可以为 false,空格或空值也为 false,所以它们相等。我们 if 判断 if(null) 是false,那么为什么 0 == null 是 false呢,是因为null 和 undefined 和 NaN 是特殊值,不进行转换的。NaN == null ,NaN == undefined 都为 false,无论 NaN == 啥都为 false。
2023年07月01日
70 阅读
0 评论
0 点赞
2023-01-12
Linux+Nginx+PHP
配置php.ini首先定位配置文件php.ini 的位置。php --ini |grep Loaded编辑fix_pathinfo的设置内容。在这个文件中,找到设置cgi.fix_pathinfo的参数。 这将用分号(;)注释掉,默认设置为“1”。这是一个非常不安全的设置,因为它告诉PHP尝试执行最近的文件,如果找不到请求的PHP文件,它可以找到它。 这可以允许用户以一种允许他们执行不应允许执行的脚本的方式制作PHP请求。取消注释并将其设置为“0”,如下所示:cgi.fix_pathinfo=0配置nginx的PHP解析nginx.conf 文件通常在“/etc/nginx”目录下。通常有下面的描述。user nginx;...http{...include /etc/nginx/conf.d/*.conf;}注意,这里用户用从nginx改为www-data。user www-data www-data;#fastcgi_pass localhost:9000 #改成 fastcgi_pass unix:/run/php/php7.2-fpm.sock; #默认安装是sock方式 #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; #改成 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
2023年01月12日
75 阅读
0 评论
0 点赞
2023-01-07
解决maven出现“连接到http://repo.maven.apache.org被拒绝”的问题
1、原因这个问题的原因就是无法连接到http://repo.maven.apache.org/maven2镜像2、解决办法修改maven默认镜像仓库地址为国内可用的镜像地址,比如这里推荐阿里的镜像仓库地址http://maven.aliyun.com/nexus/content/groups/public/该镜像仓库地址亲测可用,而且速度极快,强烈推荐3、操作步骤1、找到你IDEA配置的maven位置
2023年01月07日
148 阅读
0 评论
0 点赞
2023-01-03
修改idea的maven3远程镜像仓库地址settings.xml
1.找到idea安装目录中maven3插件位置以我自己的安装目录为例: D:\Program Files\JetBrains\IntelliJ IDEA 2020.3\plugins\maven\lib\maven3\conf 修改 settings.xml 文件,原文件几乎没有任何配置。2.修改镜像仓库远程地址在 mirrors 标签中加入以下部分,配置私有镜像仓库地址。可以在私有镜像仓库缓存中央仓库jar包,可以加速本地下载jar包速度。<mirror> <id>maven-public</id> <mirrorOf>*</mirrorOf> <name>maven-public</name> <url>http://192.168.2.199:8080/repository/maven-public/</url> <blocked>true</blocked> </mirror>中央仓库<mirror> <id>maven-public</id> <mirrorOf>*</mirrorOf> <name>maven-public</name> <url>https://repo1.maven.org/maven2/</url> <blocked>true</blocked> </mirror>阿里镜像仓库<mirror> <id>public</id> <mirrorOf>*</mirrorOf> <name>aliyun nexus</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <blocked>true</blocked> </mirror>或<mirror> <id>mirror-aliyun-releases</id> <mirrorOf>*</mirrorOf> <name>aliyun maven mirror</name> <url>https://maven.aliyun.com/repository/public</url> <blocked>true</blocked> </mirror><?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- | This is the configuration file for Maven. It can be specified at two levels: | | 1. User Level. This settings.xml file provides configuration for a single user, | and is normally provided in ${user.home}/.m2/settings.xml. | | NOTE: This location can be overridden with the CLI option: | | -s /path/to/user/settings.xml | | 2. Global Level. This settings.xml file provides configuration for all Maven | users on a machine (assuming they're all using the same Maven | installation). It's normally provided in | ${maven.conf}/settings.xml. | | NOTE: This location can be overridden with the CLI option: | | -gs /path/to/global/settings.xml | | The sections in this sample file are intended to give you a running start at | getting the most out of your Maven installation. Where appropriate, the default | values (values used when the setting is not specified) are provided. | |--> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- localRepository | The path to the local repository maven will use to store artifacts. | | Default: ${user.home}/.m2/repository <localRepository>/path/to/local/repo</localRepository> --> <!-- interactiveMode | This will determine whether maven prompts you when it needs input. If set to false, | maven will use a sensible default value, perhaps based on some other setting, for | the parameter in question. | | Default: true <interactiveMode>true</interactiveMode> --> <!-- offline | Determines whether maven should attempt to connect to the network when executing a build. | This will have an effect on artifact downloads, artifact deployment, and others. | | Default: false <offline>false</offline> --> <!-- pluginGroups | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e. | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list. |--> <pluginGroups> <!-- pluginGroup | Specifies a further group identifier to use for plugin lookup. <pluginGroup>com.your.plugins</pluginGroup> --> </pluginGroups> <!-- proxies | This is a list of proxies which can be used on this machine to connect to the network. | Unless otherwise specified (by system property or command-line switch), the first proxy | specification in this list marked as active will be used. |--> <proxies> <!-- proxy | Specification for one proxy, to be used in connecting to the network. | <proxy> <id>optional</id> <active>true</active> <protocol>http</protocol> <username>proxyuser</username> <password>proxypass</password> <host>proxy.host.net</host> <port>80</port> <nonProxyHosts>local.net|some.host.com</nonProxyHosts> </proxy> --> </proxies> <!-- servers | This is a list of authentication profiles, keyed by the server-id used within the system. | Authentication profiles can be used whenever maven must make a connection to a remote server. |--> <servers> <!-- server | Specifies the authentication information to use when connecting to a particular server, identified by | a unique name within the system (referred to by the 'id' attribute below). | | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are | used together. | <server> <id>deploymentRepo</id> <username>repouser</username> <password>repopwd</password> </server> --> <!-- Another sample, using keys to authenticate. <server> <id>siteServer</id> <privateKey>/path/to/private/key</privateKey> <passphrase>optional; leave empty if not used.</passphrase> </server> --> </servers> <!-- mirrors | This is a list of mirrors to be used in downloading artifacts from remote repositories. | | It works like this: a POM may declare a repository to use in resolving certain artifacts. | However, this repository may have problems with heavy traffic at times, so people have mirrored | it to several places. | | That repository definition will have a unique id, so we can create a mirror reference for that | repository, to be used as an alternate download site. The mirror site will be the preferred | server for that repository. |--> <mirrors> <!-- mirror | Specifies a repository mirror site to use instead of a given repository. The repository that | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. | <mirror> <id>mirrorId</id> <mirrorOf>repositoryId</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://my.repository.com/repo/path</url> </mirror> --> <mirror> <id>maven-public</id> <mirrorOf>*</mirrorOf> <name>maven-public</name> <url>http://192.168.2.199:8080/repository/maven-public/</url> <blocked>true</blocked> </mirror> </mirrors> <!-- profiles | This is a list of profiles which can be activated in a variety of ways, and which can modify | the build process. Profiles provided in the settings.xml are intended to provide local machine- | specific paths and repository locations which allow the build to work in the local environment. | | For example, if you have an integration testing plugin - like cactus - that needs to know where | your Tomcat instance is installed, you can provide a variable here such that the variable is | dereferenced during the build process to configure the cactus plugin. | | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles | section of this document (settings.xml) - will be discussed later. Another way essentially | relies on the detection of a system property, either matching a particular value for the property, | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'. | Finally, the list of active profiles can be specified directly from the command line. | | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact | repositories, plugin repositories, and free-form properties to be used as configuration | variables for plugins in the POM. | |--> <profiles> <!-- profile | Specifies a set of introductions to the build process, to be activated using one or more of the | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/> | or the command line, profiles have to have an ID that is unique. | | An encouraged best practice for profile identification is to use a consistent naming convention | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc. | This will make it more intuitive to understand what the set of introduced profiles is attempting | to accomplish, particularly when you only have a list of profile id's for debug. | | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo. <profile> <id>jdk-1.4</id> <activation> <jdk>1.4</jdk> </activation> <repositories> <repository> <id>jdk14</id> <name>Repository for JDK 1.4 builds</name> <url>http://www.myhost.com/maven/jdk14</url> <layout>default</layout> <snapshotPolicy>always</snapshotPolicy> </repository> </repositories> </profile> --> <!-- | Here is another profile, activated by the system property 'target-env' with a value of 'dev', | which provides a specific path to the Tomcat instance. To use this, your plugin configuration | might hypothetically look like: | | ... | <plugin> | <groupId>org.myco.myplugins</groupId> | <artifactId>myplugin</artifactId> | | <configuration> | <tomcatLocation>${tomcatPath}</tomcatLocation> | </configuration> | </plugin> | ... | | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to | anything, you could just leave off the <value/> inside the activation-property. | <profile> <id>env-dev</id> <activation> <property> <name>target-env</name> <value>dev</value> </property> </activation> <properties> <tomcatPath>/path/to/tomcat/instance</tomcatPath> </properties> </profile> --> </profiles> <!-- activeProfiles | List of profiles that are active for all builds. | <activeProfiles> <activeProfile>alwaysActiveProfile</activeProfile> <activeProfile>anotherAlwaysActiveProfile</activeProfile> </activeProfiles> --> </settings>3.也可以直接在pom.xml修改镜像仓库远程地址<repositories> <repository> <id>maven-public</id> <name>maven-public</name> <url>http://192.168.2.199:8080/repository/maven-public/</url> <releases> <enabled>true</enabled> </releases> </repository> <repository> <id>public</id> <name>aliyun nexus</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>maven-public</id> <name>maven-public</name> <url>http://192.168.2.199:8080/repository/maven-public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> <pluginRepository> <id>public</id> <name>aliyun nexus</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories>
2023年01月03日
70 阅读
0 评论
0 点赞
2022-12-16
事物隔离级别
1、最开始问题2、找到接口,debug调试,最终确定哪个方法出现问题3、最开始怀疑问题原因,是并发导致的bug 经过多次调试,不是这个问题,安卓在开启直播时会连续调两次这个接口,这是直接原因,让安卓减少调这个接口次数,问题可以解决。但就算安卓连续调两次,也不应该出现这种问题,这说明后端代码还是出现了问题,接下来就算继续debug调试排查。 经过多次调试,发现第一次进来没问题,数据完整产生,而且正常回调回去,紧接着第二次进来,走同样的代码,数据库已经有数据,但如下图缺一直读不到数据,一直是空的状态,开始怀疑mybatis缓存问题。4、穿插一个知识,mybatis的一二级缓存https://tech.meituan.com/2018/01/19/mybatis-cache.html二级缓存介绍 在上文中提到的一级缓存中,其最大的共享范围就是一个SqlSession内部,如果多个SqlSession之间需要共享缓存,则需要使用到二级缓存。开启二级缓存后,会使用CachingExecutor装饰Executor,进入一级缓存的查询流程前,先在CachingExecutor进行二级缓存的查询,具体的工作流程如下所示。 二级缓存开启后,同一个namespace下的所有操作语句,都影响着同一个Cache,即二级缓存被多个SqlSession共享,是一个全局的变量。当开启缓存后,数据的查询执行的流程就是 二级缓存 -> 一级缓存 -> 数据库。总结MyBatis的二级缓存相对于一级缓存来说,实现了SqlSession之间缓存数据的共享,同时粒度更加的细,能够到namespace级别,通过Cache接口实现类不同的组合,对Cache的可控性也更强。MyBatis在多表查询时,极大可能会出现脏数据,有设计上的缺陷,安全使用二级缓存的条件比较苛刻。在分布式环境下,由于默认的MyBatis Cache实现都是基于本地的,分布式环境下必然会出现读取到脏数据,需要使用集中式缓存将MyBatis的Cache接口实现,有一定的开发成本,直接使用Redis、Memcached等分布式缓存可能成本更低,安全性也更高。与执行select不同的是,执行update,insert,delect操作后会清空一级缓存中的数据,而不是通过算法生成缓存的键值存入一级缓存,之所以有这种差别是因为 select的flushCache(清空缓存)默认为false,而update,insert,delect的flushCache(清空缓存)默认为true。5.百度到的结果,很明显是清空缓存flushCache = true,如下图6.使用百度的做法,进行调试,结果还是不尽人意,如下图还是重复数据。7、这使我们开始怀疑,mybatis这个调试是否有用,是否真的清除缓存,带着这个疑问,开始调试数据库,看是否两次都有执行数据库查询,还是只有执行一次,代码如下图:调试的结果是,已经执行了两次,缓存也清除,说明我们刚的做法没错,回头想一想,结合一二级缓存原理,增删改情况也会清除缓存,多次测试结果一样,问题还是没解决。总结,不是mybatis的问题,后面开始对配置文件下手,感觉有问题,如下图配置,进行了修改补充,多次调试执行的结果还是一样,没有用。百度到下图信息,看着好像很有道理,但感觉跟这个就没关系,所以就没去试,后面也证实这样做是对的:8.接下操作开始比较贴近解决问题的方法了 事物问题,大哥提出了两个数据库产生事物锁的方法,要解决读取不到数据,或脏读的情况,如下图,每次进入该方法都会到数据库修改count字段,每次都加一,意思是要么都成功,要么都失败,这样就相当于数据库产生的事物锁。多次调试,每次进入同样会加一,说明这个锁的方向还是错误。9.冲突问题10.了解下事物的隔离级别11.详细隔离级别和锁:https://www.cnblogs.com/tian666/p/7852646.html12.最终解决问题的办法是,调整springboot的事物隔离级别,改成不可重复读级别就可以完美解决问题。13.spring的7种事物传播行为各个传播行为是干什么详解https://www.cnblogs.com/ll409546297/p/11076258.html14.事物的特性
2022年12月16日
92 阅读
0 评论
0 点赞
1
2
3
...
14
您的IP: