- 博客(60)
- 资源 (2)
- 收藏
- 关注
原创 docker 提交镜像失败问题解决
首先将本地镜像push到docker hub时需先登录 (没有账号可以先去官网注册)> docker login > Username: #Username就是[官网](https://hub.docker.com/)注册的id再通过docker push命令提交遇到报错[denied: requested access to the resource is denied]时,可能是镜像命名格式不正确。正确的镜像命名格式应该是:docker注册时用
2021-06-03 17:49:43
912
1
原创 Mac m1版本docker安装mysql报错
Mac m1版本docker安装mysql报错 no matching manifest for linux/arm64/v8 in the manifest list entries> docker pull mysqlUsing default tag: latestlatest: Pulling from library/mysqlno matching manifest for linux/arm64/v8 in the manifest list entries这是因为M1芯片是
2021-06-03 09:50:15
2097
1
原创 js localeCompare() 方法实现字符串数组排序
localeCompare()方法返回一个数字来指示一个参考字符串是否在排序顺序前面或之后或与给定字符串相同。语法:str.localeCompare(compareStr)当 引用字符串 在 比较字符串 前面时返回 -1当 引用字符串 在 比较字符串 后面时返回 1相同位置时返回 0'a'.localeCompare('b') // 返回-1'b'.localeCompare('a') // 返回 1'a'.localeCompare('a') // 返回 0应用可以结合
2021-01-24 17:40:04
2393
2
原创 三元运算符中不能使用return问题解决
一开始在三元运算符中使用return时遇到报错:(/[aeiouAEIOU ]/.test(n) ? return n : return n + 'egg')查找资料发现在使用三元运算符需要用到return时,需要将return放在三元运算符最前面return (/[aeiouAEIOU ]/.test(n) ? n : n + 'egg')...
2021-01-11 14:20:27
3347
原创 js中ASCII码与字符互相转化方法
字符转ASSCII码charCodeAt()'A'.charCodeAt() // 65ASCII码转成字符:String.fromCharCode()String.fromCharCode(65) // A
2021-01-09 19:21:09
1499
原创 【Codewars】<8kyu>Sum Mixed Array
题目Given an array of integers as strings and numbers, return the sum of the array values as if all were numbers.Return your answer as a number.这道题目要我们实现的是,计算数组所有项的和,数组包含数字跟字符串,如果是字符串的话,转成数字计算。结果返回数字类型。即使用js计算数组各项总和,数组可能包括字符串例子sumMix([9, 3, '7', '3'
2021-01-06 16:14:49
388
原创 substr()、substring()、slice()方法的用法与区别
概括substr()、substring()、slice()三种方法都可以用于字符串截取,其中slice()可以用于数组。简单用法比较如下:var str = 'Hello, javascript!'str.substr(1,4) // "ello"str.substring(1,4) // "ell"str.slice(1,4) // "ell"var arr = ["Mike", "Cameron", "Tom", "Jack"]arr.slice(1,3) // ["C
2021-01-04 13:44:11
1849
2
原创 【Codewars】<4kyu>Sum Strings as Numbers
题目<4kyu>Sum Strings as NumbersGiven the string representations of two integers, return the string representation of the sum of those integers.A string representation of an integer will contain no characters besides the ten numerals “0” to “9”.给定两个整数.
2020-12-30 17:19:43
894
原创 【Codewars】<7kyu>By 3, or not by 3? That is the question . . .
题目A trick I learned in elementary school to determine whether or not a number was divisible by three is to add all of the integers in the number together and to divide the resulting sum by three. If there is no remainder from dividing the sum by three, t
2020-12-29 10:09:34
187
原创 【Codewars】<7kyu> Return a string‘s even characters.
题目Write a function that returns a sequence (index begins with 1) of all the even characters from a string. If the string is smaller than two characters or longer than 100 characters, the function should return “invalid string”.编写一个函数,返回字符串中所有偶数位置的字符(索引
2020-12-28 18:15:51
362
原创 【Codewars】<6kyu>Detect Pangram
一、题目A pangram is a sentence that contains every single letter of the alphabet at least once. For example, the sentence “The quick brown fox jumps over the lazy dog” is a pangram, because it uses the letters A-Z at least once (case is irrelevant).Given a
2020-12-28 14:27:27
583
原创 【Codewars】<7kyu>Char Code Calculation
题目:Given a string, turn each character into its ASCII character code and join them together to create a number - let's call this number total1:'ABC' --> 'A' = 65, 'B' = 66, 'C' = 67 --> 656667Then replace any incidence of the number 7 with the nu
2020-12-27 16:06:16
612
1
原创 【Codewars】<7kyu> Unique string characters
题目:In this Kata, you will be given two strings a and b and your task will be to return the characters that are not common in the two strings.这道题目中,接收两个字符串a和b,目的是返回这两个字符串中不重复的字符。例子solve("xyab","xzca") // "ybzc" solve("xyab","xzca") // "ybzc"solve(
2020-12-24 18:13:26
390
1
原创 【Codewars】<6kyu>Calculate String Rotation
一、题目:Write a function that receives two strings and returns n, where n is equal to the number of characters we should shift the first string > forward to match the second.For instance, take the strings “fatigue” and “tiguefa”. In this case, the fir
2020-12-23 18:22:18
306
原创 【Codewars】<6kyu>What century is it?
题目:Return the century of the input year. The input will always be a 4 digit string, so there is no need for validation.返回输入年份的世纪。输入总是一个4位数的字符串,因此不需要验证。示例:"1999" --> "20th""2011" --> "21st""2154" --> "22nd""2259" --> "23rd""1124" --&g
2020-12-23 11:37:48
256
原创 【Codewars】<7kyu> Vowel Count
一、题目:Return the number (count) of vowels in the given string.这道题要实现的是返回字符串中的元音个数(a,e,i,o,u)二、例子:getCount("abracadabra"), 5三、题解一:// 题解一:function getCount(str) { var vowelsCount = 0; // enter your majic here var arr = str.split('');
2020-12-22 17:38:30
221
原创 【Codewars】<3kyu>Calculator
题目:Create a simple calculator that given a string of operators (), +, -, *, / and numbers separated by spaces returns the value of that expression这个题目要我们实现一个简单的计算器,计算出带加减乘除的字符串运算后的值。例子:Calculator().evaluate("2 / 2 + 3 * 4 - 6") # => 7题解一:// 方法一
2020-12-22 14:07:02
412
原创 【Codewars】<5kyu> ISBN-10 Validation
一、题目:ISBN-10 identifiers are ten digits long. The first nine characters are digits 0-9. The last digit can be 0-9 or X, to indicate a value of 10.An ISBN-10 number is valid if the sum of the digits multiplied by their position modulo 11 equals zero.这道
2020-12-21 17:35:07
223
原创 【Codewars】<5kyu> Moving Zeros To The End
题目:Write an algorithm that takes an array and moves all of the zeros tothe end, preserving the order of the other elements.这道题目要我们实现的是,将一个数组中所有的零移到最后,其他元素保持顺序不变。moveZeros([false,1,0,1,2,0,1,3,"a"]) // returns[false,1,1,2,1,3,"a",0,0]测试用例:moveZero
2020-12-21 15:59:45
232
原创 nginx部署多个vue项目如何配置
使用同一域名或者ip去部署访问多个前端项目,比如域名/ip直接访问官网,域名/ip后面带路径去访问其它项目一、 最终效果官网访问地址: http://192.168.27.119/login项目二访问地址:http://192.168.27.119/biz/login项目三访问地址:http://192.168.27.119/admin/login二、 vue项目中的配置修改注:http://192.168.27.119/login 这个项目无需配置路径,直接打包即可。下面以项目二,通过/bi
2020-10-22 15:00:02
2715
1
原创 vue 使用bus实现组件间(如:兄弟组件)传递事件
例如兄弟组件A和组件B,B要调用A的某个事件一、新建bus.js,并引用/**bus.js**/import Vue from 'vue'const bus = new Vue()export default busbus.js我放在src/assets/utils路径下面二、在B组件页面里// 引入 bus.jsimport bus from '@/assets/utils/bus'// 通过$emit() 传递事件bus.$emit('showTime') // showT
2020-07-08 10:26:19
992
原创 axios 发 post 请求,后端接收不到参数解决方法
一、安装qsnpm install qs二、在要用到的页面引入import qs from 'qs'三、使用qs将请求数据转换为form-data格式let postData = {'hospitalName': this.hospitalName, 'modalities': this.modalities} axios.post('http://192.168.0.1:8082/tbBespoke/reservationTime', qs.stringify( postData
2020-07-08 10:25:27
342
原创 uni-app编译成微信小程序点真机预览报错 desc of scope.userLocation is empty
这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入欢迎使用Markdown编辑器你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Mar
2020-06-17 18:07:57
1128
原创 powershell输入不显示问题
powershell输入不显示最近使用powershell时发现输入不显示,发现是百度输入法中文时出现的问题。解决办法: 将输入法中文切换成英文或者更换输入法即可...
2020-05-07 10:37:27
4691
1
转载 js四元运算符
js实现四元运算符一般的三目运算符就能解决大部分判断筛选的问题,但是当遇到多个数据判断时就可以通过三目运算的嵌套来达到目的。var row.status == 0 ? '未支付' : (row.status == 1 ? '已支付' : '作废')"项目中例子:sex == 'F' ? patientSex = '女' : (sex == 'M' ? patientSex = '男' :...
2019-12-03 17:54:46
7278
原创 echarts 图表tooltip数据实现降序排列
echarts 图表tooltip数据默认是按照series中的数据位置排序。最近遇到需要实现降序排序功能。实现代码如下:tooltip: { trigger: 'axis', formatter: function(params){ let newParams = []; let tooltipString = []; newParams = [...params]; ...
2019-11-01 11:58:49
6392
3
原创 echarts 横坐标(x轴)文本显示不全问题
xAxis添加上"axisLabel":{ interval: 0 }即可实现全部显示。xAxis: { type: 'category', name: '医生名称', "axisLabel":{ interval: 0 }}当文字太多 发生堆叠时,可以设置倾斜角度,使文本倾斜,更好显示。xAxis: { type: 'category', name: '医生名称',...
2019-11-01 11:11:33
2027
原创 echarts 数据重新加载,原数据依然存在图表上的问题
echarts 数据重新加载,原数据依然存在图表上这是因为多次调用时option选项默认是合并(merge)的,加上true表示不合并配置myChart.setOption(option,true); // 加上true表示不合并配置...
2019-10-29 14:29:06
3362
原创 echarts中字符串太长,显示省略号,鼠标移入显示全部
formatter: function (params, index) { // 超出省略 params = params.toString(); var maxlength= 8; if (params.length>maxlength) { return params.substring(0, maxlength-1)+'...'; ...
2019-09-12 18:01:35
3341
原创 jq点击事件(右击)累加问题
每次点击后进行解除绑定,再绑定新事件点击事件$("#div").unbind("click").click(function () { ...});右击事件$("#div").unbind("contextmenu").bind("contextmenu",function () { ...});...
2019-08-29 15:34:51
813
原创 Windows 通过cmd查看端口占用,杀掉端口进程
查看所有端口占用情况netstat -ano查看指定端口占用情况netstat -ano|findstr "8088" //换成你要查询的端口得到进程号(PID)杀掉相应进程1.通过进程号找到进程名称 tasklist|findstr 进程号tasklist|findstr 14340 // 换成你查询到的进程号2.杀掉进程 taskkill /f /t /im 进程...
2019-08-16 15:19:34
3179
1
原创 input限制只能输入数字/字母/文字/特殊符号等情况
限制input框只能输入数字<input type="text" name="" oninput = "value=value.replace(/[^\d]/g,'')">
2019-08-15 16:52:31
6896
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人