Subway

Description
You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don't want to be late for class, you want to know how long it will take you to get to school.
You walk at a speed of 10 km/h. The subway travels at 40 km/h. Assume that you are lucky, and whenever you arrive at a subway station, a train is there that you can board immediately. You may get on and off the subway any number of times, and you may switch between different subway lines if you wish. All subway lines go in both directions.
Input
Input consists of the x,y coordinates of your home and your school, followed by specifications of several subway lines. Each subway line consists of the non-negative integer x,y coordinates of each stop on the line, in order. You may assume the subway runs in a straight line between adjacent stops, and the coordinates represent an integral number of metres. Each line has at least two stops. The end of each subway line is followed by the dummy coordinate pair -1,-1. In total there are at most 200 subway stops in the city.
Output
Output is the number of minutes it will take you to get to school, rounded to the nearest minute, taking the fastest route.
Sample Input
0 0 10000 1000
0 200 5000 200 7000 200 -1 -1
2000 600 5000 600 10000 600 -1 -1
Sample Output
21

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Subway planning
Problem Description The government in a foreign country is looking into the possibility of establishing a subway system in its capital. Because of practical reasons, they would like each subway line to start at the central station and then go in a straight line in some angle as far as necessary. You have been hired to investigate whether such an approach is feasible. Given the coordinates of important places in the city as well as the maximum distance these places can be from a subway station (possibly the central station, which is already built), your job is to calculate the minimum number of subway lines needed. You may assume that any number of subway stations can be built along a subway line. Figure 1: The figure above corresponds to the first data set in the example input. Input The first line in the input file contains an integer N, the number of data sets to follow. Each set starts with two integers, n and d (1 <= n <= 500, 0 <= d < 150). n is the number of important places in the city that must have a subway station nearby, and d is the maximum distance allowed between an important place and a subway station. Then comes n lines, each line containing two integers x and y (-100 <= x, y <= 100), the coordinates of an important place in the capital. The central station will always have coordinates 0, 0. All pairs of coordinates within a data set will be distinct (and none will be 0, 0). Output For each data set, output a single integer on a line by itself: the minimum number of subway lines needed to make sure all important places in the city is at a distance of at most d from a subway station. Sample Input 2 7 1 -1 -4 -3 1 -3 -1 2 3 2 4 2 -2 6 -2 4 0 0 4 -12 18 0 27 -34 51 Sample Output 4 2
Subway tree systems 程序的思路
Problem Description Some major cities have subway systems in the form of a tree, i.e. between any pair of stations, there is one and only one way of going by subway. Moreover, most of these cities have a unique central station. Imagine you are a tourist in one of these cities and you want to explore all of the subway system. You start at the central station and pick a subway line at random and jump aboard the subway car. Every time you arrive at a station, you pick one of the subway lines you have not yet travelled on. If there is none left to explore at your current station, you take the subway line back on which you first came to the station, until you eventually have travelled along all of the lines twice, once for each direction. At that point you are back at the central station. Afterwards, all you remember of the order of your exploration is whether you went further away from the central station or back towards it at any given time, i.e. you could encode your tour as a binary string, where 0 encodes taking a subway line getting you one station further away from the central station, and 1 encodes getting you one station closer to the central station. Figure 1. To the left: A subway tree system. The larger dot is the central station. To the right: Three out of several possible encodings of exploration tours for the subway system. Input On the first line of input is a single positive integer n, telling the number of test scenarios to follow. Each test scenario consists of two lines, each containing a string of the characters '0' and '1' of length at most 3000, both describing a correct exploration tour of a subway tree system. Output For each test scenario, output one line containing the text “same” if the two strings may encode exploration tours of the same subway tree system, or the text “different” if the two strings cannot be exploration tours of the same subway tree system. Sample Input 2 0010011101001011 0100011011001011 0100101100100111 0011000111010101 Sample Output same different
Subway planning
Problem Description The government in a foreign country is looking into the possibility of establishing a subway system in its capital. Because of practical reasons, they would like each subway line to start at the central station and then go in a straight line in some angle as far as necessary. You have been hired to investigate whether such an approach is feasible. Given the coordinates of important places in the city as well as the maximum distance these places can be from a subway station (possibly the central station, which is already built), your job is to calculate the minimum number of subway lines needed. You may assume that any number of subway stations can be built along a subway line. Figure 1: The figure above corresponds to the first data set in the example input. Input The first line in the input file contains an integer N, the number of data sets to follow. Each set starts with two integers, n and d (1 <= n <= 500, 0 <= d < 150). n is the number of important places in the city that must have a subway station nearby, and d is the maximum distance allowed between an important place and a subway station. Then comes n lines, each line containing two integers x and y (-100 <= x, y <= 100), the coordinates of an important place in the capital. The central station will always have coordinates 0, 0. All pairs of coordinates within a data set will be distinct (and none will be 0, 0). Output For each data set, output a single integer on a line by itself: the minimum number of subway lines needed to make sure all important places in the city is at a distance of at most d from a subway station. Sample Input 2 7 1 -1 -4 -3 1 -3 -1 2 3 2 4 2 -2 6 -2 4 0 0 4 -12 18 0 27 -34 51 Sample Output 4 2
Subway tree systems 地铁的模拟编程
Description Some major cities have subway systems in the form of a tree, i.e. between any pair of stations, there is one and only one way of going by subway. Moreover, most of these cities have a unique central station. Imagine you are a tourist in one of these cities and you want to explore all of the subway system. You start at the central station and pick a subway line at random and jump aboard the subway car. Every time you arrive at a station, you pick one of the subway lines you have not yet travelled on. If there is none left to explore at your current station, you take the subway line back on which you first came to the station, until you eventually have travelled along all of the lines twice,once for each direction. At that point you are back at the central station. Afterwards, all you remember of the order of your exploration is whether you went further away from the central station or back towards it at any given time, i.e. you could encode your tour as a binary string, where 0 encodes taking a subway line getting you one station further away from the central station, and 1 encodes getting you one station closer to the central station. Input On the first line of input is a single positive integer n, telling the number of test scenarios to follow.Each test scenario consists of two lines, each containing a string of the characters '0' and '1' of length at most 3000, both describing a correct exploration tour of a subway tree system. Output exploration tours of the same subway tree system, or the text "different" if the two strings cannot be exploration tours of the same subway tree system. Sample Input 2 0010011101001011 0100011011001011 0100101100100111 0011000111010101 Sample Output same different
Subway tree systems
Description Some major cities have subway systems in the form of a tree, i.e. between any pair of stations, there is one and only one way of going by subway. Moreover, most of these cities have a unique central station. Imagine you are a tourist in one of these cities and you want to explore all of the subway system. You start at the central station and pick a subway line at random and jump aboard the subway car. Every time you arrive at a station, you pick one of the subway lines you have not yet travelled on. If there is none left to explore at your current station, you take the subway line back on which you first came to the station, until you eventually have travelled along all of the lines twice,once for each direction. At that point you are back at the central station. Afterwards, all you remember of the order of your exploration is whether you went further away from the central station or back towards it at any given time, i.e. you could encode your tour as a binary string, where 0 encodes taking a subway line getting you one station further away from the central station, and 1 encodes getting you one station closer to the central station. ![](http://poj.org/images/1635_1.jpg) Input On the first line of input is a single positive integer n, telling the number of test scenarios to follow.Each test scenario consists of two lines, each containing a string of the characters '0' and '1' of length at most 3000, both describing a correct exploration tour of a subway tree system. Output exploration tours of the same subway tree system, or the text "different" if the two strings cannot be exploration tours of the same subway tree system. Sample Input 2 0010011101001011 0100011011001011 0100101100100111 0011000111010101 Sample Output same different
如何修建道路可以最小距离的算法,利用C语言程序的设计的思想来实现?
Problem Description The government in a foreign country is looking into the possibility of establishing a subway system in its capital. Because of practical reasons, they would like each subway line to start at the central station and then go in a straight line in some angle as far as necessary. You have been hired to investigate whether such an approach is feasible. Given the coordinates of important places in the city as well as the maximum distance these places can be from a subway station (possibly the central station, which is already built), your job is to calculate the minimum number of subway lines needed. You may assume that any number of subway stations can be built along a subway line. Figure 1: The figure above corresponds to the first data set in the example input. Input The first line in the input file contains an integer N, the number of data sets to follow. Each set starts with two integers, n and d (1 <= n <= 500, 0 <= d < 150). n is the number of important places in the city that must have a subway station nearby, and d is the maximum distance allowed between an important place and a subway station. Then comes n lines, each line containing two integers x and y (-100 <= x, y <= 100), the coordinates of an important place in the capital. The central station will always have coordinates 0, 0. All pairs of coordinates within a data set will be distinct (and none will be 0, 0). Output For each data set, output a single integer on a line by itself: the minimum number of subway lines needed to make sure all important places in the city is at a distance of at most d from a subway station. Sample Input 2 7 1 -1 -4 -3 1 -3 -1 2 3 2 4 2 -2 6 -2 4 0 0 4 -12 18 0 27 -34 51 Sample Output 4 2
Bus Schedules 怎么做呢
Problem Description The Association of Commuters in Montreal (ACM) wishes to create a website for the city’s publictransit commuters, in order to promote public transit. A prominent reason for people to drive to work instead of commuting is the time wasted on the subway and buses. For this reason, the ACM wishes to add a form on their website so that visitors will be able to specify two points on the island, and the website will find the quickest route between those two points using its database of subway and bus schedules. Seeing how this may help improve the environment and the greenhouse effect, you offer your help. Input The first line of each test case will contain a positive integer n, the number of bus and subway schedules which will follow. Each schedule will begin with a line containing a positive integer m, the number of stops along the path. m lines will follow, describing the stops of the day in chronological order. Each stop will begin by a time in the format hh : mm, between 00 : 00 and 23 : 59 inclusively. There will be at least one minute between each stop — in other words, all the stop times for a particular bus will be different. A single space will follow, and the rest of the line will contain a name describing the stop. The name will not contain spaces nor capital letters, and will be at most 20 characters long. Stops with the same name obviously denote the same physical location, where passengers can wait for other buses or subways to stop. After the day completes, the buses and subways mysteriously disappear and reappear at some point before their first stop. They cannot carry any passengers at that time, so the passengers must spend the night waiting at some stop.Each schedule repeats itself every day. After the schedules, a line will contain a time and two locations of at most 20 characters, the start and the goal. Output the minimum number of minutes needed for a passenger at the start location at the given time to reach the goal location. He is able to enter any bus which stops at his start location at the given starting time or later, and he can also switch from a bus to another instantaneously if they happen to stop at the same place at the same time. He can also wait at a stop for an arbitrary amount of time. Output If the destination cannot be reached, output “impossible”. The last line of the input will contain the integer 0 and should not be processed. All the numbers in the input will be at most 1000. Sample Input 2 4 00:01 loc_a 00:02 loc_b 00:10 loc_c 00:20 loc_a 2 00:02 loc_b 00:04 loc_c 00:00 loc_a loc_c 1 3 00:00 foo 01:00 bar 02:00 baz 01:30 bar foo 1 4 00:00 baz 01:00 foo 02:00 bar 03:00 baz 02:30 bar foo 0 Sample Output 4 impossible 2790
向量和欧几里得的距离的计算,求最短的距离,给定的点,采用C语言算法怎么实现
Problem Description The government in a foreign country is looking into the possibility of establishing a subway system in its capital. Because of practical reasons, they would like each subway line to start at the central station and then go in a straight line in some angle as far as necessary. You have been hired to investigate whether such an approach is feasible. Given the coordinates of important places in the city as well as the maximum distance these places can be from a subway station (possibly the central station, which is already built), your job is to calculate the minimum number of subway lines needed. You may assume that any number of subway stations can be built along a subway line. Figure 1: The figure above corresponds to the first data set in the example input. Input The first line in the input file contains an integer N, the number of data sets to follow. Each set starts with two integers, n and d (1 <= n <= 500, 0 <= d < 150). n is the number of important places in the city that must have a subway station nearby, and d is the maximum distance allowed between an important place and a subway station. Then comes n lines, each line containing two integers x and y (-100 <= x, y <= 100), the coordinates of an important place in the capital. The central station will always have coordinates 0, 0. All pairs of coordinates within a data set will be distinct (and none will be 0, 0). Output For each data set, output a single integer on a line by itself: the minimum number of subway lines needed to make sure all important places in the city is at a distance of at most d from a subway station. Sample Input 2 7 1 -1 -4 -3 1 -3 -1 2 3 2 4 2 -2 6 -2 4 0 0 4 -12 18 0 27 -34 51 Sample Output 4 2
谷歌面试题,求大神帮忙
原题是这样的(后面我补充了中文解释): Don't mind the map ================== After the trauma of Dr. Boolean's lab, the rabbits are eager to get back to their normal lives in a well-connected community, where they can visit each other frequently. Fortunately, the rabbits learned something about engineering as part of their escape from the lab. To get around their new warren fast, they built an elaborate subway system to connect their holes. Each station has the same number of outgoing subway lines (outgoing tracks), which are numbered. Unfortunately, sections of warrens are very similar, so they can't tell where they are in the subway system. Their stations have system maps, but not an indicator showing which station the map is in. Needless to say, rabbits get lost in the subway system often. The rabbits adopted an interesting custom to account for this: Whenever they are lost, they take the subway lines in a particular order, and end up at a known station. For example, say there were three stations A, B, and C, with two outgoing directions, and the stations were connected as follows Line 1 from A, goes to B. Line 2 from A goes to C. Line 1 from B, goes to A. Line 2 from B goes to C. Line 1 from C, goes to B. Line 2 from C goes to A. Now, suppose you are lost at one of the stations A, B, or C. Independent of where you are, if you take line 2, and then line 1, you always end up at station B. Having a path that takes everyone to the same place is called a meeting path. We are interested in finding a meeting path which consists of a fixed set of instructions like, 'take line 1, then line 2,' etc. It is possible that you might visit a station multiple times. It is also possible that such a path might not exist. However, subway stations periodically close for maintenance. If a station is closed, then the paths that would normally go to that station, go to the next station in the same direction. As a special case, if the track still goes to the closed station after that rule, then it comes back to the originating station. Closing a station might allow for a meeting path where previously none existed. That is, if you have A -> B -> C and station B closes, then you'll have A -> C Alternately, if it was A -> B -> B then closing station B yields A -> A Write a function answer(subway) that returns one of: -1 (minus one): If there is a meeting path without closing a station The least index of the station to close that allows for a meeting path or -2 (minus two): If even with closing 1 station, there is no meeting path. subway will be a list of lists of integers such that subway[station][direction] = destination_station. That is, the subway stations are numbered 0, 1, 2, and so on. The k^th element of subway (counting from 0) will give the list of stations directly reachable from station k. The outgoing lines are numbered 0, 1, 2... The r^th element of the list for station k, gives the number of the station directly reachable by taking line r from station k. Each element of subway will have the same number of elements (so, each station has the same number of outgoing lines), which will be between 1 and 5. There will be at least 1 and no more than 50 stations. For example, if subway = [[2, 1], [2, 0], [3, 1], [1, 0]] Then one could take the path [1, 0]. That is, from the starting station, take the second direction, then the first. If the first direction was the red line, and the second was the green line, you could phrase this as: if you are lost, take the green line for 1 stop, then the red line for 1 stop. So, consider following the directions starting at each station. 0 -> 1 -> 2. 1 -> 0 -> 2. 2 -> 1 -> 2. 3 -> 0 -> 2. So, no matter the starting station, the path leads to station 2. Thus, for this subway, answer should return -1. If subway = [[1], [0]] then no matter what path you take, you will always be at a different station than if you started elsewhere. If station 0 closed, that would leave you with subway = [[0]] So, in this case, answer would return 0 because there is no meeting path until you close station 0. To illustrate closing stations, subway = [[1,1],[2,2],[0,2]] If station 2 is closed, then station 1 direction 0 will follow station 2 direction 0 to station 0, which will then be its new destination. station 1 direction 1 will follow station 2 direction 1 to station 2, but that station is closed, so it will get routed back to station 1, which will be its new destination. This yields subway = [[1,1],[0,1]] Languages ========= To provide a Python solution, edit solution.py To provide a Java solution, edit solution.java Test cases ========== Inputs: (int) subway = [[2, 1], [2, 0], [3, 1], [1, 0]] Output: (int) -1 Inputs: (int) subway = [[1, 2], [1, 1], [2, 2]] Output: (int) 1 大概意思就是,兔子在兔子窝(n <= 50)之间修了地铁,有k(k <= 5)条线路,每条线每一站都有出发,但是不一定每站都到,比如1号线可能是A->B, B->A, C->B; 2号线可能是A->C, B->C, C->A. 由于兔子窝长得都一样,所以兔子经常不知道自己究竟在哪一站,所以它们想了个办法,在任何一站,只要按照某种顺序乘坐地铁,最终都会到达某一站,比如上面的线路,只要按照先坐一号线,再坐二号线的顺序,无论在ABC哪一站出发,最后都会到C站。现在给出一种地铁线路,问存不存在这样一种顺序,满足按照这个顺序坐地铁,从任何一站出发都能到达某一站。以及如果有一站地铁关门维修了(如果某站关门了,那么到达这一站的车这一站不停,直接前往下一站,如果这一站的下一站还是自己,那么就在上一站循环),是否还存在这样一种顺序。 想了两天了,暴力解的话2^50严重超时,跪求大神帮忙
两个图的比较问题,怎么计算出这里车站的编号,用C语言
Problem Description jiefangxuanyan and yiyi cat are universally acknowledged model couples. Once jiefangxuanyan has time, he takes a train to yiyi cat’s city and meet her. This time, as usual, jiefangxuanyan gets out from the railway station, and enters the subway, only to find that the subway stations of the whole city changes their names! As a direction idiot, jiefangxuanyan felt helpless with this situation. He called yiyi cat for help. Because the subway map is so complicated, she can’t remember it either. Fortunately, only the names of the stations changed, the structure of subway lines is the same. So she picks out the old map to make a mapping. But mapping such a confused subway map is definitely a difficult task. So she has to use the computer. Unfortunately, she just spilt wonton soup into her computer. So, yiyi cat asked you for help, hoping you can help her with this problem. The subway in the city forms a tree, with N subway stations and N-1 subway lines. Any pair of stations are connected with one or more subway lines. You need to find a bijective mapping from the old names to the new names, that for each pair of stations connected by exactly one line in the old map, their new names are also connected by exactly one line in the new map. Input The input has multiple test cases, please process to the end of file. For each test case, the first line is an integer N(1≤N≤100000). In the following N−1 lines, each line has two space-separated string, as two stations connected by one line in the old map. In the following N−1 lines, each line has two space-separated string, as two stations connected by one line in the new map. Station names are no longer than 10 characters, and only consists of lowercase letters (a~z). Output For each test case, output N lines. Each line consists two space-separated string, as the old name and its corresponding new name. Both the names appeared in the old and new subway map should appear exactly once in the output. You can output the names in any order. And if there are multiple valid mappings, output any one. Names in the old map and the new map may be the same, but this does not mean these two stations are the same. Sample Input 3 a b b c b a a c Sample Output b a a b c c
WebView加载不同的网页地址显示一样
我用WebView加载分别加载不同的地址,如:http://map.baidu.com/subways/?c=wuhan跟http://map.baidu.com/subways/?c=nanjing加载显示的却都是武汉. private void init() { WebSettings webSettings = webView_subway.getSettings(); //设置WebView属性,能够执行Javascript脚本 webSettings.setJavaScriptEnabled(true); webSettings.setDomStorageEnabled(true); //设置支持缩放 webSettings.setBuiltInZoomControls(true); //加载需要显示的网页 webView_subway.loadUrl("http://map.baidu.com/subways/?c=" + spell(city)); //设置Web视图 webView_subway.setWebViewClient(new WebViewClient()); } spell(city)是一个动态的参数.求大神
运行时出现错误:KeyError: Index(['subwayline'], dtype='object')
我知道是那个subwayline那里的问题,但是我不知道如何解决。完整代码如下: #-*- coding:utf-8 -*- import pandas as pd from matplotlib import pyplot as plt # 分析全国哪个城市地铁线最多 def subline_count(): df1 = df.iloc[:, :-1] # 筛选前三列 # print(df1.head()) df2 = df1.drop_duplicates(subset=["city", "subwayline"]) # 去重 df3 = df2["city"].value_counts() # 按照城市排序 df3.plot.bar() plt.savefig("城市地铁线数量排行.png") plt.show() # print(df3) # 分析全国哪个城市地铁站最多 def substation_count(): df2 = df.drop_duplicates(subset=["city", "subwaystation"]) # 去重 df3 = df2["city"].value_counts() # 按照城市排序 df3.plot.bar() plt.savefig("城市地铁站数量排行.png") plt.show() if __name__ == '__main__': df = pd.read_csv("subway.csv", encoding="utf-8") plt.rcParams["font.sans-serif"] = "fangsong" # print(df.head()) subline_count() substation_count()
SQL查询语句的一点困惑
我有一张地铁站表Subway,如下 ticker_id txn_time txn_station trans_code 卡号 时分秒 站牌 进站或出站 比如 001 102520 101 0 001 114000 109 1 002 121102 105 0 002 131102 121 1 001 120055 109 0 001 140343 116 1 表示一个人在101进站,在109出站。 我现在想查询出他的进出站表, select first.ticker_id, first.txn_station as station1, second.txn_station as station2, from Subway first,Subway second where first.ticker_id=second.ticker_id and first.trans_code='0' and second.trans_code='1' 但是遇到一个问题,假如一个人进站多次并出站多次, 查询出来的结果就会不正确,如上面的表, 我希望的结果是: ticker_id station1 station2 001 101 109 001 109 116 002 105 121 而实际的结果是_ ticker_id station1 station2 001 101 109 001 109 116 001 101 116 001 109 109 002 105 121 进出站应该是按时间匹配,第一个进站和第一个出站匹配,第二个进站和第二个出站匹配 请问该怎样正确的写这条sql语句呢 _
echarts地图控件官方实例如何调用 显示地图
//问题描述: 调用了官网提供的地址但是就是不显示地图 //官网地址: https://www.echartsjs.com/examples/zh/editor.html?c=effectScatter-bmap //截图 ![图片说明](https://img-ask.csdn.net/upload/201910/17/1571241681_595745.jpg) //代码展示 ``` <script src="pcManager/dist/echarts.js"></script> <!-- 引入 vintage 主题 --> <script src="pcManager/theme/vintage.js"></script> <script> // 第二个参数可以指定前面引入的主题 var chart = echarts.init(document.getElementById('main'), 'vintage'); chart.setOption({ //把官网提供的option套进去 ... }); </script> ``` //目前显示的界面没有地图 ![图片说明](https://img-ask.csdn.net/upload/201910/17/1571241856_441443.jpg) //由于数据太多 把我的主要代码结构粘出来 ``` <head> <%--引入echarts控件--%> <script src="/erzhentang/FR-LIB/incubator-echarts-4.4.0/dist/echarts.js"></script> <!-- 引入 vintage 主题 --> <script src="/erzhentang/FR-LIB/incubator-echarts-4.4.0/theme/vintage.js"></script> <div id="dv_area" style="width: 800px;height:600px;"></div> <script type="text/javascript"> </head> <body> var myChart1 = echarts.init(document.getElementById('dv_area'),'vintage'); var data = [ {name: '海门', value: 9}, {name: '鄂尔多斯', value: 12}, {name: '招远', value: 12}, {name: '舟山', value: 12}, {name: '齐齐哈尔', value: 14}, {name: '盐城', value: 15}, {name: '赤峰', value: 16}, {name: '青岛', value: 18}, {name: '乳山', value: 18}, {name: '金昌', value: 19}, {name: '泉州', value: 21}, {name: '莱西', value: 21}, {name: '日照', value: 21}, {name: '胶南', value: 22}, {name: '南通', value: 23}, {name: '拉萨', value: 24}, {name: '云浮', value: 24}, {name: '梅州', value: 25}, {name: '文登', value: 25}, {name: '上海', value: 25}, {name: '攀枝花', value: 25}, {name: '威海', value: 25}, {name: '承德', value: 25}, {name: '厦门', value: 26}, {name: '汕尾', value: 26}, {name: '潮州', value: 26}, {name: '丹东', value: 27}, {name: '太仓', value: 27}, {name: '曲靖', value: 27}, {name: '烟台', value: 28}, {name: '福州', value: 29}, {name: '瓦房店', value: 30}, {name: '即墨', value: 30}, {name: '抚顺', value: 31}, {name: '玉溪', value: 31}, {name: '张家口', value: 31}, {name: '阳泉', value: 31}, {name: '莱州', value: 32}, {name: '湖州', value: 32}, {name: '汕头', value: 32}, {name: '昆山', value: 33}, {name: '宁波', value: 33}, {name: '湛江', value: 33}, {name: '揭阳', value: 34}, {name: '荣成', value: 34}, {name: '连云港', value: 35}, {name: '葫芦岛', value: 35}, {name: '常熟', value: 36}, {name: '东莞', value: 36}, {name: '河源', value: 36}, {name: '淮安', value: 36}, {name: '泰州', value: 36}, {name: '南宁', value: 37}, {name: '营口', value: 37}, {name: '惠州', value: 37}, {name: '江阴', value: 37}, {name: '蓬莱', value: 37}, {name: '韶关', value: 38}, {name: '嘉峪关', value: 38}, {name: '广州', value: 38}, {name: '延安', value: 38}, {name: '太原', value: 39}, {name: '清远', value: 39}, {name: '中山', value: 39}, {name: '昆明', value: 39}, {name: '寿光', value: 40}, {name: '盘锦', value: 40}, {name: '长治', value: 41}, {name: '深圳', value: 41}, {name: '珠海', value: 42}, {name: '宿迁', value: 43}, {name: '咸阳', value: 43}, {name: '铜川', value: 44}, {name: '平度', value: 44}, {name: '佛山', value: 44}, {name: '海口', value: 44}, {name: '江门', value: 45}, {name: '章丘', value: 45}, {name: '肇庆', value: 46}, {name: '大连', value: 47}, {name: '临汾', value: 47}, {name: '吴江', value: 47}, {name: '石嘴山', value: 49}, {name: '沈阳', value: 50}, {name: '苏州', value: 50}, {name: '茂名', value: 50}, {name: '嘉兴', value: 51}, {name: '长春', value: 51}, {name: '胶州', value: 52}, {name: '银川', value: 52}, {name: '张家港', value: 52}, {name: '三门峡', value: 53}, {name: '锦州', value: 54}, {name: '南昌', value: 54}, {name: '柳州', value: 54}, {name: '三亚', value: 54}, {name: '自贡', value: 56}, {name: '吉林', value: 56}, {name: '阳江', value: 57}, {name: '泸州', value: 57}, {name: '西宁', value: 57}, {name: '宜宾', value: 58}, {name: '呼和浩特', value: 58}, {name: '成都', value: 58}, {name: '大同', value: 58}, {name: '镇江', value: 59}, {name: '桂林', value: 59}, {name: '张家界', value: 59}, {name: '宜兴', value: 59}, {name: '北海', value: 60}, {name: '西安', value: 61}, {name: '金坛', value: 62}, {name: '东营', value: 62}, {name: '牡丹江', value: 63}, {name: '遵义', value: 63}, {name: '绍兴', value: 63}, {name: '扬州', value: 64}, {name: '常州', value: 64}, {name: '潍坊', value: 65}, {name: '重庆', value: 66}, {name: '台州', value: 67}, {name: '南京', value: 67}, {name: '滨州', value: 70}, {name: '贵阳', value: 71}, {name: '无锡', value: 71}, {name: '本溪', value: 71}, {name: '克拉玛依', value: 72}, {name: '渭南', value: 72}, {name: '马鞍山', value: 72}, {name: '宝鸡', value: 72}, {name: '焦作', value: 75}, {name: '句容', value: 75}, {name: '北京', value: 79}, {name: '徐州', value: 79}, {name: '衡水', value: 80}, {name: '包头', value: 80}, {name: '绵阳', value: 80}, {name: '乌鲁木齐', value: 84}, {name: '枣庄', value: 84}, {name: '杭州', value: 84}, {name: '淄博', value: 85}, {name: '鞍山', value: 86}, {name: '溧阳', value: 86}, {name: '库尔勒', value: 86}, {name: '安阳', value: 90}, {name: '开封', value: 90}, {name: '济南', value: 92}, {name: '德阳', value: 93}, {name: '温州', value: 95}, {name: '九江', value: 96}, {name: '邯郸', value: 98}, {name: '临安', value: 99}, {name: '兰州', value: 99}, {name: '沧州', value: 100}, {name: '临沂', value: 103}, {name: '南充', value: 104}, {name: '天津', value: 105}, {name: '富阳', value: 106}, {name: '泰安', value: 112}, {name: '诸暨', value: 112}, {name: '郑州', value: 113}, {name: '哈尔滨', value: 114}, {name: '聊城', value: 116}, {name: '芜湖', value: 117}, {name: '唐山', value: 119}, {name: '平顶山', value: 119}, {name: '邢台', value: 119}, {name: '德州', value: 120}, {name: '济宁', value: 120}, {name: '荆州', value: 127}, {name: '宜昌', value: 130}, {name: '义乌', value: 132}, {name: '丽水', value: 133}, {name: '洛阳', value: 134}, {name: '秦皇岛', value: 136}, {name: '株洲', value: 143}, {name: '石家庄', value: 147}, {name: '莱芜', value: 148}, {name: '常德', value: 152}, {name: '保定', value: 153}, {name: '湘潭', value: 154}, {name: '金华', value: 157}, {name: '岳阳', value: 169}, {name: '长沙', value: 175}, {name: '衢州', value: 177}, {name: '廊坊', value: 193}, {name: '菏泽', value: 194}, {name: '合肥', value: 229}, {name: '武汉', value: 273}, {name: '大庆', value: 279} ]; var geoCoordMap = { '海门': [121.15, 31.89], '鄂尔多斯': [109.781327, 39.608266], '招远': [120.38, 37.35], '舟山': [122.207216, 29.985295], '齐齐哈尔': [123.97, 47.33], '盐城': [120.13, 33.38], '赤峰': [118.87, 42.28], '青岛': [120.33, 36.07], '乳山': [121.52, 36.89], '金昌': [102.188043, 38.520089], '泉州': [118.58, 24.93], '莱西': [120.53, 36.86], '日照': [119.46, 35.42], '胶南': [119.97, 35.88], '南通': [121.05, 32.08], '拉萨': [91.11, 29.97], '云浮': [112.02, 22.93], '梅州': [116.1, 24.55], '文登': [122.05, 37.2], '上海': [121.48, 31.22], '攀枝花': [101.718637, 26.582347], '威海': [122.1, 37.5], '承德': [117.93, 40.97], '厦门': [118.1, 24.46], '汕尾': [115.375279, 22.786211], '潮州': [116.63, 23.68], '丹东': [124.37, 40.13], '太仓': [121.1, 31.45], '曲靖': [103.79, 25.51], '烟台': [121.39, 37.52], '福州': [119.3, 26.08], '瓦房店': [121.979603, 39.627114], '即墨': [120.45, 36.38], '抚顺': [123.97, 41.97], '玉溪': [102.52, 24.35], '张家口': [114.87, 40.82], '阳泉': [113.57, 37.85], '莱州': [119.942327, 37.177017], '湖州': [120.1, 30.86], '汕头': [116.69, 23.39], '昆山': [120.95, 31.39], '宁波': [121.56, 29.86], '湛江': [110.359377, 21.270708], '揭阳': [116.35, 23.55], '荣成': [122.41, 37.16], '连云港': [119.16, 34.59], '葫芦岛': [120.836932, 40.711052], '常熟': [120.74, 31.64], '东莞': [113.75, 23.04], '河源': [114.68, 23.73], '淮安': [119.15, 33.5], '泰州': [119.9, 32.49], '南宁': [108.33, 22.84], '营口': [122.18, 40.65], '惠州': [114.4, 23.09], '江阴': [120.26, 31.91], '蓬莱': [120.75, 37.8], '韶关': [113.62, 24.84], '嘉峪关': [98.289152, 39.77313], '广州': [113.23, 23.16], '延安': [109.47, 36.6], '太原': [112.53, 37.87], '清远': [113.01, 23.7], '中山': [113.38, 22.52], '昆明': [102.73, 25.04], '寿光': [118.73, 36.86], '盘锦': [122.070714, 41.119997], '长治': [113.08, 36.18], '深圳': [114.07, 22.62], '珠海': [113.52, 22.3], '宿迁': [118.3, 33.96], '咸阳': [108.72, 34.36], '铜川': [109.11, 35.09], '平度': [119.97, 36.77], '佛山': [113.11, 23.05], '海口': [110.35, 20.02], '江门': [113.06, 22.61], '章丘': [117.53, 36.72], '肇庆': [112.44, 23.05], '大连': [121.62, 38.92], '临汾': [111.5, 36.08], '吴江': [120.63, 31.16], '石嘴山': [106.39, 39.04], '沈阳': [123.38, 41.8], '苏州': [120.62, 31.32], '茂名': [110.88, 21.68], '嘉兴': [120.76, 30.77], '长春': [125.35, 43.88], '胶州': [120.03336, 36.264622], '银川': [106.27, 38.47], '张家港': [120.555821, 31.875428], '三门峡': [111.19, 34.76], '锦州': [121.15, 41.13], '南昌': [115.89, 28.68], '柳州': [109.4, 24.33], '三亚': [109.511909, 18.252847], '自贡': [104.778442, 29.33903], '吉林': [126.57, 43.87], '阳江': [111.95, 21.85], '泸州': [105.39, 28.91], '西宁': [101.74, 36.56], '宜宾': [104.56, 29.77], '呼和浩特': [111.65, 40.82], '成都': [104.06, 30.67], '大同': [113.3, 40.12], '镇江': [119.44, 32.2], '桂林': [110.28, 25.29], '张家界': [110.479191, 29.117096], '宜兴': [119.82, 31.36], '北海': [109.12, 21.49], '西安': [108.95, 34.27], '金坛': [119.56, 31.74], '东营': [118.49, 37.46], '牡丹江': [129.58, 44.6], '遵义': [106.9, 27.7], '绍兴': [120.58, 30.01], '扬州': [119.42, 32.39], '常州': [119.95, 31.79], '潍坊': [119.1, 36.62], '重庆': [106.54, 29.59], '台州': [121.420757, 28.656386], '南京': [118.78, 32.04], '滨州': [118.03, 37.36], '贵阳': [106.71, 26.57], '无锡': [120.29, 31.59], '本溪': [123.73, 41.3], '克拉玛依': [84.77, 45.59], '渭南': [109.5, 34.52], '马鞍山': [118.48, 31.56], '宝鸡': [107.15, 34.38], '焦作': [113.21, 35.24], '句容': [119.16, 31.95], '北京': [116.46, 39.92], '徐州': [117.2, 34.26], '衡水': [115.72, 37.72], '包头': [110, 40.58], '绵阳': [104.73, 31.48], '乌鲁木齐': [87.68, 43.77], '枣庄': [117.57, 34.86], '杭州': [120.19, 30.26], '淄博': [118.05, 36.78], '鞍山': [122.85, 41.12], '溧阳': [119.48, 31.43], '库尔勒': [86.06, 41.68], '安阳': [114.35, 36.1], '开封': [114.35, 34.79], '济南': [117, 36.65], '德阳': [104.37, 31.13], '温州': [120.65, 28.01], '九江': [115.97, 29.71], '邯郸': [114.47, 36.6], '临安': [119.72, 30.23], '兰州': [103.73, 36.03], '沧州': [116.83, 38.33], '临沂': [118.35, 35.05], '南充': [106.110698, 30.837793], '天津': [117.2, 39.13], '富阳': [119.95, 30.07], '泰安': [117.13, 36.18], '诸暨': [120.23, 29.71], '郑州': [113.65, 34.76], '哈尔滨': [126.63, 45.75], '聊城': [115.97, 36.45], '芜湖': [118.38, 31.33], '唐山': [118.02, 39.63], '平顶山': [113.29, 33.75], '邢台': [114.48, 37.05], '德州': [116.29, 37.45], '济宁': [116.59, 35.38], '荆州': [112.239741, 30.335165], '宜昌': [111.3, 30.7], '义乌': [120.06, 29.32], '丽水': [119.92, 28.45], '洛阳': [112.44, 34.7], '秦皇岛': [119.57, 39.95], '株洲': [113.16, 27.83], '石家庄': [114.48, 38.03], '莱芜': [117.67, 36.19], '常德': [111.69, 29.05], '保定': [115.48, 38.85], '湘潭': [112.91, 27.87], '金华': [119.64, 29.12], '岳阳': [113.09, 29.37], '长沙': [113, 28.21], '衢州': [118.88, 28.97], '廊坊': [116.7, 39.53], '菏泽': [115.480656, 35.23375], '合肥': [117.27, 31.86], '武汉': [114.31, 30.52], '大庆': [125.03, 46.58] }; var convertData = function (data) { var res = []; for (var i = 0; i < data.length; i++) { var geoCoord = geoCoordMap[data[i].name]; if (geoCoord) { res.push({ name: data[i].name, value: geoCoord.concat(data[i].value) }); } } return res; }; option = { title: { text: '全国主要城市空气质量 - 百度地图', subtext: 'data from PM25.in', sublink: 'http://www.pm25.in', left: 'center' }, tooltip: { trigger: 'item' }, bmap: { center: [104.114129, 37.550339], zoom: 5, roam: true, mapStyle: { styleJson: [{ 'featureType': 'water', 'elementType': 'all', 'stylers': { 'color': '#d1d1d1' } }, { 'featureType': 'land', 'elementType': 'all', 'stylers': { 'color': '#f3f3f3' } }, { 'featureType': 'railway', 'elementType': 'all', 'stylers': { 'visibility': 'off' } }, { 'featureType': 'highway', 'elementType': 'all', 'stylers': { 'color': '#fdfdfd' } }, { 'featureType': 'highway', 'elementType': 'labels', 'stylers': { 'visibility': 'off' } }, { 'featureType': 'arterial', 'elementType': 'geometry', 'stylers': { 'color': '#fefefe' } }, { 'featureType': 'arterial', 'elementType': 'geometry.fill', 'stylers': { 'color': '#fefefe' } }, { 'featureType': 'poi', 'elementType': 'all', 'stylers': { 'visibility': 'off' } }, { 'featureType': 'green', 'elementType': 'all', 'stylers': { 'visibility': 'off' } }, { 'featureType': 'subway', 'elementType': 'all', 'stylers': { 'visibility': 'off' } }, { 'featureType': 'manmade', 'elementType': 'all', 'stylers': { 'color': '#d1d1d1' } }, { 'featureType': 'local', 'elementType': 'all', 'stylers': { 'color': '#d1d1d1' } }, { 'featureType': 'arterial', 'elementType': 'labels', 'stylers': { 'visibility': 'off' } }, { 'featureType': 'boundary', 'elementType': 'all', 'stylers': { 'color': '#fefefe' } }, { 'featureType': 'building', 'elementType': 'all', 'stylers': { 'color': '#d1d1d1' } }, { 'featureType': 'label', 'elementType': 'labels.text.fill', 'stylers': { 'color': '#999999' } }] } }, series: [ { name: 'pm2.5', type: 'scatter', coordinateSystem: 'bmap', data: convertData(data), symbolSize: function (val) { return val[2] / 10; }, label: { normal: { formatter: '{b}', position: 'right', show: false }, emphasis: { show: true } }, itemStyle: { normal: { color: 'purple' } } }, { name: 'Top 5', type: 'effectScatter', coordinateSystem: 'bmap', data: convertData(data.sort(function (a, b) { return b.value - a.value; }).slice(0, 6)), symbolSize: function (val) { return val[2] / 10; }, showEffectOn: 'render', rippleEffect: { brushType: 'stroke' }, hoverAnimation: true, label: { normal: { formatter: '{b}', position: 'right', show: true } }, itemStyle: { normal: { color: 'purple', shadowBlur: 10, shadowColor: '#333' } }, zlevel: 1 } ] }; myChart1.setOption(option); </script> <body> ``` //已解决 需要引入必要的控件 ``` <%--引入echarts控件--%> <script src="/erzhentang/FR-LIB/incubator-echarts-4.4.0/dist/echarts.js"></script> <!-- 引入 vintage 主题 --> <script src="/erzhentang/FR-LIB/incubator-echarts-4.4.0/theme/vintage.js"></script> <%--引入地图所需控件--%> <script type="text/javascript" src="https://www.echartsjs.com/examples/vendors/lodash.js"></script> <script type="text/javascript" src="https://www.echartsjs.com/examples/javascripts/common.js"></script> <script type="text/javascript">function changeLang(lang) { if (lang === 'en') { if (location.hostname !== 'echarts.apache.org') { var re = new RegExp('/zh/', 'g'); var pathname = location.pathname.replace(re, '/en/'); var url = 'https://echarts.apache.org' + pathname + location.search + location.hash; location.href = url; return; } } location.href = location.href.replace( new RegExp('/(zh|en)/', 'g'), '/' + lang + '/' ); } window.ROOT_PATH = 'https://www.echartsjs.com/examples/'; </script> <script type="text/javascript" src="https://www.echartsjs.com/examples/vendors/dat.gui.min.js"></script> <script type="text/javascript" src="https://www.echartsjs.com/examples/vendors/ace/src/ace.js"></script> <script type="text/javascript" src="https://www.echartsjs.com/examples/vendors/ace/src/ext-language_tools.js"></script> <script type="text/javascript" src="https://www.echartsjs.com/examples/javascripts/editor.js?_v_=1571170137685"></script> <script type="text/javascript" src="https://www.echartsjs.com/examples/vendors/echarts-stat/ecStat.min.js?_v_=1571170137685"></script> <script type="text/javascript" src="https://www.echartsjs.com/examples/vendors/echarts/echarts.min.js?_v_=1571170137685"></script> <script type="text/javascript" src="https://www.echartsjs.com/examples/vendors/echarts/map/js/china.js?_v_=1571170137685"></script> <script type="text/javascript" src="https://www.echartsjs.com/examples/vendors/echarts/map/js/world.js?_v_=1571170137685"></script> <script type="text/javascript" src="https://www.echartsjs.com/examples/vendors/echarts/extension/dataTool.js?_v_=1571170137685"></script> <script type="text/javascript" src="https://www.echartsjs.com/examples/vendors/echarts/extension/bmap.js?_v_=1571170137685"></script> <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&amp;ak=KOmVjPVUAey1G2E8zNhPiuQ6QiEmAwZu&amp;__ec_v__=20190126"></script> <script type="text/javascript" src="https://api.map.baidu.com/getscript?v=2.0&amp;ak=KOmVjPVUAey1G2E8zNhPiuQ6QiEmAwZu&amp;services=&amp;t=20190622163250"></script> <script type="text/javascript">document.getElementById('nav-examples').className = 'active';</script> <!-- Baidu Tongji--> <script type="text/javascript">var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?54b918eee37cb8a7045f0fd0f0b24395"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <!-- Google Analytics--> <script type="text/javascript" async="" src="https://www.googletagmanager.com/gtag/js?id=UA-141228404-1"></script> <script type="text/javascript">window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-141228404-1'); </script> ```
相见恨晚的超实用网站
相见恨晚的超实用网站 持续更新中。。。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
python 简易微信实现(注册登录+数据库存储+聊天+GUI+文件传输)
socket+tkinter详解+简易微信实现 历经多天的努力,查阅了许多大佬的博客后终于实现了一个简易的微信O(∩_∩)O~~ 简易数据库的实现 使用pands+CSV实现数据库框架搭建 import socket import threading from pandas import * import pymysql import csv # 创建DataFrame对象 # 存储用户数据的表(...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 cpp 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7 p...
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小型人工智障。 知识可以运用在不同地方,不一定非是天气预报。
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
刷了几千道算法题,这些我私藏的刷题网站都在这里了!
遥想当年,机缘巧合入了 ACM 的坑,周边巨擘林立,从此过上了"天天被虐似死狗"的生活… 然而我是谁,我可是死狗中的战斗鸡,智力不够那刷题来凑,开始了夜以继日哼哧哼哧刷题的日子,从此"读题与提交齐飞, AC 与 WA 一色 ",我惊喜的发现被题虐既刺激又有快感,那一刻我泪流满面。这么好的事儿作为一个正直的人绝不能自己独享,经过激烈的颅内斗争,我决定把我私藏的十几个 T 的,阿不,十几个刷题网...
JavaScript 为什么能活到现在?
作者 | 司徒正美 责编 |郭芮 出品 | CSDN(ID:CSDNnews) JavaScript能发展到现在的程度已经经历不少的坎坷,早产带来的某些缺陷是永久性的,因此浏览器才有禁用JavaScript的选项。甚至在jQuery时代有人问出这样的问题,jQuery与JavaScript哪个快?在Babel.js出来之前,发明一门全新的语言代码代替JavaScript...
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
Nginx 原理和架构
Nginx 是一个免费的,开源的,高性能的 HTTP 服务器和反向代理,以及 IMAP / POP3 代理服务器。Nginx 以其高性能,稳定性,丰富的功能,简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求,主要负责调度工作进程:加载配置、启动工作进程及非停升级。worker 进程负责处...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
Python 编程开发 实用经验和技巧
Python是一门很灵活的语言,也有很多实用的方法,有时候实现一个功能可以用多种方法实现,我这里总结了一些常用的方法和技巧,包括小数保留指定位小数、判断变量的数据类型、类方法@classmethod、制表符中文对齐、遍历字典、datetime.timedelta的使用等,会持续更新......
吐血推荐珍藏的Visual Studio Code插件
作为一名Java工程师,由于工作需要,最近一个月一直在写NodeJS,这种经历可以说是一部辛酸史了。好在有神器Visual Studio Code陪伴,让我的这段经历没有更加困难。眼看这段经历要告一段落了,今天就来给大家分享一下我常用的一些VSC的插件。 VSC的插件安装方法很简单,只需要点击左侧最下方的插件栏选项,然后就可以搜索你想要的插件了。 下面我们进入正题 Material Theme ...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
开源并不是你认为的那些事
点击上方蓝字 关注我们开源之道导读所以 ————想要理清开源是什么?先要厘清开源不是什么,名正言顺是句中国的古代成语,概念本身的理解非常之重要。大部分生物多样性的起源,...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
Python 植物大战僵尸代码实现(2):植物卡片选择和种植
这篇文章要介绍的是: - 上方植物卡片栏的实现。 - 点击植物卡片,鼠标切换为植物图片。 - 鼠标移动时,判断当前在哪个方格中,并显示半透明的植物作为提示。
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
shell脚本基础
shell简介:shell是一种脚本语言,可以使用逻辑判断、循环等语法,可以自定义函数,是系统命令的集合 文章目录shell脚本结构和执行方法shell脚本中date命令的用法 shell脚本结构和执行方法 1.shell脚本开头需要加#!/bin/bash 2.以#开头的行作为注释 3.脚本的名字以.sh结尾,用于区分这是一个shell脚本 4.执行方法有两种: 1)bash test.sh 2...
8年经验面试官详解 Java 面试秘诀
作者 |胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。 Java程序员准备和投递简历的实...
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车?某胡同口的煎饼摊一年能卖出多少个煎饼?深圳有多少个产品经理?一辆公交车里能装下多少个乒乓球?一个正常成年人有多少根头发?这类估算问题,被称为费米问题,是以科学家费米命名的。为什么面试会问这种问题呢?这类问题能把两类人清楚地区分出来。一类是具有文科思维的人,擅长赞叹和模糊想象,它主要依靠的是人的第一反应和直觉,比如小孩...
相关热词 基于c#波形控件 c# 十进制转十六进制 对文件aes加密vc# c#读取栈中所有的值 c# rsa256加密 好 学c# 还是c++ c# 和java的差距 c# curl网络框架 c# https证书请求 c# 中崎
立即提问