- 博客(44)
- 收藏
- 关注
原创 OpenWrt环境下,由于wget不支持ssl/tls导致执行opkg update失败的解决方法
OpenWrt环境下,由于wget不支持ssl/tls导致执行opkg update失败的解决方法
2023-11-17 17:13:04
10798
2
原创 VUE中图片高度占满父容器高度,宽度按图片高宽比自动调整的方法
没什么好分析的,直接上代码:<template>... ... <img src='@/assets/logo.png' style='height: 100%' :style='{ width: logoWidth + "px" }' @load='justifyImgWidth($event)' />... ...</template><...
2019-12-10 18:19:03
4595
原创 Go语言实现Square sums (simple)
描述:Write function square_sums_row (or squareSumsRow/SquareSumsRow depending on language rules) that, given integer number N (in range 2…43), returns array of integers 1…N arranged in a way, so sum of...
2019-11-15 16:39:59
440
原创 Go语言实现The Clockwise Spiral
描述:Do you know how to make a spiral? Let’s test it!Classic definition: A spiral is a curve which emanates from a central point, getting progressively farther away as it revolves around the point.Yo...
2019-11-11 16:40:44
236
原创 Go语言实现Longest Common Subsequence
描述Write a function called LCS that accepts two sequences and returns the longest subsequence common to the passed in sequences.SubsequenceA subsequence is different from a substring. The terms of a...
2019-11-07 17:52:05
145
原创 Go语言实现Josephus Permutation
描述This problem takes its name by arguably the most important event in the life of the ancient historian Josephus: according to his tale, he and his 40 soldiers were trapped in a cave by the Romans du...
2019-11-07 15:30:10
151
原创 Go语言实现Best travel
描述John and Mary want to travel between a few towns A, B, C … Mary has on a sheet of paper a list of distances between these towns. ls = [50, 55, 57, 58, 60]. John is tired of driving and he says to M...
2019-11-07 11:29:57
414
原创 Go语言实现Is my friend cheating?
描述A friend of mine takes a sequence of numbers from 1 to n (where n > 0).Within that sequence, he chooses two numbers, a and b.He says that the product of a and b should be equal to the sum of a...
2019-11-06 11:26:41
244
原创 Go语言实现Pick peaks
描述In this kata, you will write a function that returns the positions and the values of the “peaks” (or local maxima) of a numeric array.For example, the array arr = [0, 1, 2, 5, 1, 0] has a peak at ...
2019-11-05 16:38:17
282
原创 Go语言实现Directions Reduction
描述Once upon a time, on a way through the old wild west,…… a man was given directions to go from one point to another. The directions were “NORTH”, “SOUTH”, “WEST”, “EAST”. Clearly “NORTH” and “SOUTH...
2019-11-04 18:02:46
324
原创 Go语言实现Valid Parentheses
描述Write a function called that takes a string of parentheses, and determines if the order of the parentheses is valid. The function should return true if the string is valid, and false if it’s invali...
2019-11-04 16:53:13
171
原创 Go语言实现Union of Intervals
描述Write a function interval_insert which takes as inputa list myl of disjoint closed intervals with integer endpoints, sorted by increasing order of left endpointsan interval intervaland returns t...
2019-10-27 11:54:46
359
原创 Go语言实现Cartesian neighbors distance
描述In previous kata we have been searching for all the neighboring points in a Cartesian coordinate system. As we know each point in a coordinate system has eight neighboring points when we search it ...
2019-10-25 17:05:22
194
原创 Go语言实现Floating-point Approximation (I)
描述Consider the functionf: x -> sqrt(1 + x) - 1 at x = 1e-15.We get: f(x) = 4.44089209850062616e-16or something around that, depending on the language.This function involves the subtraction of ...
2019-10-23 16:31:57
206
原创 Go语言实现Catalog
描述You are given a small extract of a catalog:s =<prod><name>drill</name><prx>99</prx><qty>5</qty></prod><prod><name>hammer</name>&...
2019-10-21 19:31:17
257
原创 Go语言实现Irreducible Sum of Rationals
描述You will have a list of rationals in the formlst = [ [numer_1, denom_1] , … , [numer_n, denom_n] ]orlst = [ (numer_1, denom_1) , … , (numer_n, denom_n) ]where all numbers are positive integers....
2019-10-21 13:16:49
189
原创 Go语言实现Pyramid Array
描述Write a function that when given a number >= 0, returns an Array of ascending length subarrays.pyramid(0) => [ ]pyramid(1) => [ [1] ]pyramid(2) => [ [1], [1, 1] ]pyramid(3) => [ ...
2019-10-19 19:36:48
140
原创 Go语言实现Playing on a chessboard
描述With a friend we used to play the following game on a chessboard (8, rows, 8 columns). On the first row at the bottom we put numbers:1/2, 2/3, 3/4, 4/5, 5/6, 6/7, 7/8, 8/9On row 2 (2nd row from t...
2019-10-19 10:38:04
486
原创 Go语言实现A disguised sequence (I)
描述Given u0 = 1, u1 = 2 and the relation 6unun+1-5unun+2+un+1un+2 = 0 calculate un for any integer n >= 0.#Examplesfcn(n) returns un: fcn(17) -> 131072, fcn(21) -> 2097152Remark: You can t...
2019-10-19 09:55:31
203
原创 Go语言实现Two Sum
描述Write a function that takes an array of numbers (integers for the tests) and a target number. It should find two different items in the array that, when added together, give the target value. The i...
2019-10-17 12:07:49
335
原创 Go语言实现Bouncing Balls
描述A child is playing with a ball on the nth floor of a tall building. The height of this floor, h, is known.He drops the ball out of the window. The ball bounces (for example), to two-thirds of its ...
2019-10-16 17:35:06
233
原创 Go语言实现Sum of odd numbers
描述Given the triangle of consecutive odd numbers:13 57 9 1113 15 17 1921 23 25 27 29…Calculate the row sums of this triangle from the row index (starting at index ...
2019-10-16 10:19:13
160
原创 Go语言实现Find the odd int
描述Given an array, find the int that appears an odd number of times.There will always be only one integer that appears an odd number of times.分析方法1:遍历数组,借助map保存已遍历过的数据的重复次数。最后遍历map,返回重复次数为奇数的键值。方法...
2019-10-15 17:35:36
305
原创 Go语言实现The Baum-Sweet sequence
描述The Baum–Sweet sequence is an infinite automatic sequence of 0s and 1s defined by the rule:bn = 1 if the binary representation of n contains no block of consecutive 0s of odd length;bn = 0 otherw...
2019-10-15 12:43:31
185
原创 Go语言实现Floating-point Approximation (III)
描述Professor Chambouliard has just completed an experiment on gravitational waves. He measures their effects on small magnetic particles. This effect is very small and negative. In his first experimen...
2019-10-14 14:55:12
236
原创 Go语言实现Baby shark lyrics generator
描述Create a function, as short as possible, that returns this lyrics.Your code should be less than 300 characters. Watch out for the three points at the end of the song.Baby shark, doo doo doo doo d...
2019-10-13 19:30:41
225
原创 Go语言实现Easy Line
描述In the drawing below we have a part of the Pascal’s triangle, lines are numbered from zero (top).We want to calculate the sum of the squares of the binomial coefficients on a given line with a fun...
2019-10-12 14:08:53
217
原创 Go语言实现Drying Potatoes
描述引自codewars:All we eat is water and dry matter.John bought potatoes: their weight is 100 kilograms. Potatoes contain water and dry matter.The water content is 99 percent of the total weight. He t...
2019-10-08 15:01:11
165
原创 Go语言实现Growth of a Population
描述引自codewars:In a small town the population is p0 = 1000 at the beginning of a year. The population regularly increases by 2 percent per year and moreover 50 new inhabitants per year come to live in...
2019-10-06 19:47:19
218
原创 Go语言实现To square(root) or not to square(root)
描述Write a method, that will get an integer array as parameter and will process every number from this array.Return a new array with processing every number of the input-array like this:If the numbe...
2019-10-06 12:15:00
349
原创 Go语言实现Abbreviate a Two Word Name
题目引自codewars:Write a function to convert a name into initials. This kata strictly takes two words with one space in between them.The output should be two capital letters with a dot seperating them....
2019-10-05 21:08:34
233
原创 Go语言实现Reversed Strings
题目引自 codewars:Complete the solution so that it reverses the string value passed into it.Solution(“world”) // returns “dlrow”分析错误实现:func Solution(word string) string { for i, j := 0, len(word) ...
2019-10-05 11:35:12
224
原创 Webpack打包路径问题
Webpack打包路径缺省为绝对路径。如果想把打包路径改为相对自定义路径,对于build环境(即最终一般会部署到proxy后),需要修改config/index.js中的build段中的assetsPublicPath即可。... ...module.exports = { dev: { // Paths assetsSubDirectory: 'static',...
2019-04-08 14:33:06
2752
原创 带参数路由面包屑的实现
主要参考:https://segmentfault.com/a/1190000010574901改进:VUEX用于组件间通信。此问题无需进程间通信。面包屑最后一级(当前路由页面)应该是无链接状态。最简代码(使用element组件库):<template> <el-breadcrumb separator="/"> <transition-g...
2018-10-15 09:32:06
6772
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人