echart polar中的axisLabel属性无效

import numpy as np import matplotlib.pyplot as plt plt.subplot(111,polar = True) dataLenth = 5 angles = np.linspace(0,2*np.pi,dataLenth,endpoint=False) labels =['沟通能力','业务理解能力','逻辑思维能力','快速学习能力','工具使用能力'] data = [2,3.5,4,4.5,5] data = np.concatenate((data, [data[0]])) angles = np.concatenate((angles, [angles[0]])) plt.polar(angles,data,color = "r",marker = "o") plt.xticks(angles,labels) plt.title(t = "某数据分析师的综合评级") plt.savefig("D:/pyx/polarplot.jpg") 上面是相关代码，运行后提示错误：TypeError: title() missing 1 required positional argument: 'label'，求解。
Shortest Path on a Cylinder 是怎么编写的呢
Problem Description Ant Smart is on a surface of cylinder now. He wants to move to another position of the cylinder’s surface. Like many other animals named Smart, he wants to find out the shortest path from one point to another. Unfortunately, Ant Smart is not enough smart to solve this question now. It is your task to find out the answer. Input There are several test cases in this problem. The first line of input contains a single integer denoting the number of test cases. For each test case, the first line contains two integers: radius and height (1<=radius<=100, 1<=height<=100), denoting the radius and height of the cylinder. For the next two lines, each line contains three integers: h, a and r (0 <= h <= height, 0 <= a < 360, 0 <= r <= radius), denoting one point on the surface of cylinder each. The h indicates a circle on the surface of cylinder which apart h from the bottom. And the polar angle a and radius r indicates the position of the point on the circle. In the other words, if the cylinder is (0,0,0) - (0,0,height) on the 3D grid coordinate. The point can be represented as (cos(a)*r, sin(a)*r, h). You may assume that r!=radius only when h=0 or h=height for each point. Warning: There are about one thousand test cases. Be careful with the time efficiency. Output For each test case, output only one line contains the length of the shortest path on the surface of cylinder. The answer should be rounded to two digits after the decimal point. Sample Input 2 5 10 10 0 3 5 0 5 90 49 49 312 39 0 52 65 Sample Output Case #1: 7.00 Case #2: 171.02
Defense of the Ancients
Problem Description DotA? I’m afraid you’ve got a wrong impression, because we are talking about some real Ancients. A lot of towers are in the first quadrant of rectangular coordinates. And between every two towers there is a wall. All of them are Ancients. Somehow, some skytroopers are trying to attack our Ancients and all we know is that they’ll land at the second, third and fourth quadrant of rectangular coordinates. Because those areas are desolation, the troops decided to follow a fixed straight line. Now we’ve got all the landing coordinates of the troops and the polar angle of their walking lines. To protect our Ancients, we need to know where the troops will first arrive at the Ancients. Input There are multiple test cases. First line contains a single integer T (T<=10), indicates the number of test cases. For each test case: The first line has two positive integers N and M (1<N<=100000, M<=100000), represent the number of towers and skytroopers. Following N lines, each line contains two integers X and Y, represents the coordinate of the tower. Following M lines, each line has three integers SX, SY and XITA, indicates the coordinates of a skytrooper and the polar angle of their attacking line (in degrees). SX and SY will not bigger than 0 at the same time. All the coordinates values lies in [-20000, 20000]. No two towers will be in same place. Output For every skytrooper, output one line, if the trooper can reach the Ancients, output the coordinate he will first arrive, otherwise output “safe”. If the value differs in 0.01 with our standard output, we’ll consider it as accepted. Sample Input 1 6 3 5 1 8 5 13 2 14 7 7 9 1 7 -2 -2 45 8 -2 90 -3 7 120 Sample Output 3.400000 3.400000 8.000000 1.375000 safe
Shortest Path on a Cylinder 最短路径
Problem Description Ant Smart is on a surface of cylinder now. He wants to move to another position of the cylinder’s surface. Like many other animals named Smart, he wants to find out the shortest path from one point to another. Unfortunately, Ant Smart is not enough smart to solve this question now. It is your task to find out the answer. Input There are several test cases in this problem. The first line of input contains a single integer denoting the number of test cases. For each test case, the first line contains two integers: radius and height (1<=radius<=100, 1<=height<=100), denoting the radius and height of the cylinder. For the next two lines, each line contains three integers: h, a and r (0 <= h <= height, 0 <= a < 360, 0 <= r <= radius), denoting one point on the surface of cylinder each. The h indicates a circle on the surface of cylinder which apart h from the bottom. And the polar angle a and radius r indicates the position of the point on the circle. In the other words, if the cylinder is (0,0,0) - (0,0,height) on the 3D grid coordinate. The point can be represented as (cos(a)*r, sin(a)*r, h). You may assume that r!=radius only when h=0 or h=height for each point. Warning: There are about one thousand test cases. Be careful with the time efficiency. Output For each test case, output only one line contains the length of the shortest path on the surface of cylinder. The answer should be rounded to two digits after the decimal point. Sample Input 2 5 10 10 0 3 5 0 5 90 49 49 312 39 0 52 65 Sample Output Case #1: 7.00 Case #2: 171.02
Shortest Path on a Cylinder 圆柱的问题
Problem Description Ant Smart is on a surface of cylinder now. He wants to move to another position of the cylinder’s surface. Like many other animals named Smart, he wants to find out the shortest path from one point to another. Unfortunately, Ant Smart is not enough smart to solve this question now. It is your task to find out the answer. Input There are several test cases in this problem. The first line of input contains a single integer denoting the number of test cases. For each test case, the first line contains two integers: radius and height (1<=radius<=100, 1<=height<=100), denoting the radius and height of the cylinder. For the next two lines, each line contains three integers: h, a and r (0 <= h <= height, 0 <= a < 360, 0 <= r <= radius), denoting one point on the surface of cylinder each. The h indicates a circle on the surface of cylinder which apart h from the bottom. And the polar angle a and radius r indicates the position of the point on the circle. In the other words, if the cylinder is (0,0,0) - (0,0,height) on the 3D grid coordinate. The point can be represented as (cos(a)*r, sin(a)*r, h). You may assume that r!=radius only when h=0 or h=height for each point. Warning: There are about one thousand test cases. Be careful with the time efficiency. Output For each test case, output only one line contains the length of the shortest path on the surface of cylinder. The answer should be rounded to two digits after the decimal point. Sample Input 2 5 10 10 0 3 5 0 5 90 49 49 312 39 0 52 65 Sample Output Case #1: 7.00 Case #2: 171.02

Problem Description Ant Smart is on a surface of cylinder now. He wants to move to another position of the cylinder’s surface. Like many other animals named Smart, he wants to find out the shortest path from one point to another. Unfortunately, Ant Smart is not enough smart to solve this question now. It is your task to find out the answer. Input There are several test cases in this problem. The first line of input contains a single integer denoting the number of test cases. For each test case, the first line contains two integers: radius and height (1<=radius<=100, 1<=height<=100), denoting the radius and height of the cylinder. For the next two lines, each line contains three integers: h, a and r (0 <= h <= height, 0 <= a < 360, 0 <= r <= radius), denoting one point on the surface of cylinder each. The h indicates a circle on the surface of cylinder which apart h from the bottom. And the polar angle a and radius r indicates the position of the point on the circle. In the other words, if the cylinder is (0,0,0) - (0,0,height) on the 3D grid coordinate. The point can be represented as (cos(a)*r, sin(a)*r, h). You may assume that r!=radius only when h=0 or h=height for each point. Warning: There are about one thousand test cases. Be careful with the time efficiency. Output For each test case, output only one line contains the length of the shortest path on the surface of cylinder. The answer should be rounded to two digits after the decimal point. Sample Input 2 5 10 10 0 3 5 0 5 90 49 49 312 39 0 52 65 Sample Output Case #1: 7.00 Case #2: 171.02

#include<iostream> #include<cmath> // 声明2个结构:polar 和 rect struct polar { double distance; double angle; }; struct rect { double x; double y; }; // 声明 2个指针变量：polar类型rect_to_polar，数组：rect类型的xypos polar rect_to_polar(rect xypos); // polar类型 rect_to_polar和rect类型 xypos void show_polar(polar dapos); // polar类型 dapos int main() { using namespace std; rect rplace; // 创建rect类型的变量rplace polar pplace; cout << "Enter the x and y value: "; while (cin>>rplace.x>>rplace.y) // rplace.x我不太明白如何存储的，rplace的变量名+句点成员x，是不是存储在了结构里了？创建一个变量本身是不产生空间的，创建一个结构才会有空间？ { pplace = rect_to_polar(rplace);// 将对象rect_to_polar（指针）赋给pplace变量？ show_polar(pplace);// 将变量pplace赋给变量show_polar？ cout << "Next two numbers (q to quit): "; } cout << "Done.\n "; return 0; } // 定义polar rect_to_polar(rect xypos) polar rect_to_polar(rect xypos) { using namespace std; polar answer; // 创建polar类型 的 answer answer.distance = sqrt(xypos.x*xypos.x + xypos.y*xypos.y);//xypos.x相当于变量xypos与结构变量x的值，然后赋给了局部变量answer的结构变量distance？ answer.angle = atan2(xypos.y, xypos.x); return answer; } // 定义void show_polar(polar dapos) void show_polar(polar dapos) { using namespace std; const double Rad_to_deg = 57.29577951; cout << "distance = " << dapos.distance; cout << ", angle = " << dapos.angle*Rad_to_deg; cout << "degrees \n "; } ######################## 如果改用指针来指向结构变量又有问题了 #include<iostream> #include<cmath> struct polar { double distance; double angle; }; struct rect { double x; double y; }; void rect_to_polar(const rect*pxy, polar*pda); // 这里为什么设置2个指针*pxy*pda void show_polar(const polar*pda);// 这里又设置了一模一样的*pda，会不会有问题？ int main() { using namespace std; rect rplace; polar pplace; cout << "Enter the x and y values: "; while (cin >> rplace.x >> rplace.y) { rect_to_polar(&rplace, &pplace); // 这里套了2层，将&pplace的地址传导rplace变量，再将&rplace地址传到了rect_to_polar？ show_polar(&pplace); //这里不明白怎么又是&pplace地址了呢 cout << "Next two numbers (q to quit) : "; } cout << "Done.\n"; system("pause"); return 0; } void show_polar(const polar*pda) { using namespace std; const double Rad_to_deg = 57.29577951; cout << "distance=" << pda->distance; cout << ", angle =" << pda->angle*Rad_to_deg; cout << "degrees\n "; } void rect_to_polar(const rect*pxy, polar*pda) { using namespace std; pda->distance = sqrt(pxy->x*pxy->x + pxy->y*pxy->y); pda->angle = atan2(pxy->y, pxy->x); } 上面2题是教程里面的题目，麻烦大神们给我思路理一下，不胜感激啊！

echarts图表报错，触发事件重新加载图表时报错
var kpiDataList; var supplier; var index; var analysisQuery = function(){ return { fillCharInfo:function(xData,seriesData){ var IndexDataChart = echarts.init(document.getElementById('IndexDataChart')); var option = { tooltip : { trigger: 'axis' }, calculable : true, xAxis : [ { type : 'category', boundaryGap : false, data : xData } ], yAxis : [ { type : 'value', axisLabel : { formatter: '{value}' } } ], grid: { width: 300, height: 150, y: 30, x: 30, borderColor: '#fff' }, series : [ { name:'指标结果值', type:'line', data:seriesData, markPoint : { data : [ {type : 'max', name: '最大值'}, {type : 'min', name: '最小值'} ] }, markLine : { data : [ {type : 'average', name: '平均值'} ] } } ] }; IndexDataChart.setOption(option); }, /** * 查询考核记录排名 */ querySupplierScore : function(){ var timeRange = $("#timeRange").val(); var params = []; params.push({name : 'timeRange', value : timeRange});$.ajax({ type : "POST", url : "srm/owner/facade/assessment/getSupplierRank.shtml", data : params, dataType : "json", async:false, success : function(data) { if (data[0].length > 0) { var dataList = data[0]; drawRankChart(dataList); analysisQuery.querySupplierIndex(dataList[0].companyName); } } }); }, /** * 查询供应商的指标信息分析 */ querySupplierIndex : function(supplierName){ var timeRange = $("#timeRange").val(); var params = []; params.push({name : 'timeRange', value : timeRange}); params.push({name : 'supplierName', value : supplierName });$.ajax({ type : "POST", url : "srm/owner/facade/assessment/getSupplierIndex.shtml", data : params, dataType : "json", async:false, success : function(data) { if (null != data) { $('#IndexAnalysisChart').empty(); var indexNameList = data[0]; var indexMaxValueList = data[1]; var indexValueList = data[2]; kpiDataList = data[3]; drawPieChart(indexNameList,indexMaxValueList,indexValueList); if(indexNameList.length > 0){ drawLineChart(indexNameList[0]); } } } }); }, /** * 查询供应商的考核明细 */ querySupplierKpiDetail : function(supplierName,indexName){ var timeRange =$("#detailTimeRange").val(); var params = []; params.push({name : 'timeRange', value : timeRange}); params.push({name : 'supplierName', value : supplierName }); params.push({name : 'indexName', value : indexName }); $.ajax({ type : "POST", url : "srm/owner/facade/assessment/getSupplierKpiDetail.shtml", data : params, dataType : "json", async:false, success : function(data) { if (null != data) { var list = juicer(tplKpiDetail,data); var totalCount = 0; var totalExceCount = 0; var indexValue = 0; var totalAward = 0; var totalCost = 0; var totalMoney = 0;$("#kpiDetail","#addModal").empty().append(list); var kpiDetailList = data.kpiDetailList; for(var i = 0; i<kpiDetailList.length ;i++){ totalCount += parseInt(kpiDetailList[i].lskdTotalCount); totalExceCount += parseInt(kpiDetailList[i].lskdExceptionCount); indexValue += parseInt(kpiDetailList[i].lskdOldValue); totalAward += parseInt(kpiDetailList[i].lskdAwardMoney); totalCost += parseInt(kpiDetailList[i].lskdAmerceMoney); } totalMoney = totalAward-totalMoney; indexValue = indexValue/(kpiDetailList.length); } } }); } }; }(); require.config({ paths: { echarts: 'srm/manage/js/echarts/dist' } }); function drawRankChart(data){ require( [ 'echarts', 'echarts/chart/bar' // 使用柱状图就加载bar模块，按需加载 ], function(){ // 基于准备好的dom，初始化echarts图表 var seriesData = []; var xData = []; if ('' === data || null === data){ seriesData = [0]; xData = [""]; }else{ if(data.length < 10){ for (var i = 0;i < data.length ; i++){ var supplier = data[i].companyName; var score = data[i].score; seriesData.push(score); xData.push(supplier); } }else{ for (var i = 0;i < 10 ; i++){ var supplier = data[i].companyName; var score = data[i].score; seriesData.push(score); xData.push(supplier); } } } var rankChart = echarts.init(document.getElementById('rankChart')); var ecConfig = echarts.config; rankChart.on(ecConfig.EVENT.CLICK, clickBarChart); rankChart.on(ecConfig.EVENT.DBLCLICK, showKpiDetail); var colorList = [ '#ff7d93', '#52cdd5', '#7ecef4', '#979ec9' ]; var itemStyle = { normal : { color : function(params) { if (params.dataIndex >= 0 && params.dataIndex < 3) { // for legend return colorList[params.dataIndex]; } else { return colorList[colorList.length - 1]; } } } }; var option = { tooltip : { trigger: 'axis', axisPointer : { // 坐标轴指示器，坐标轴触发有效 type : 'shadow' // 默认为直线，可选为：'line' | 'shadow' }, formatter : '{b}<br/>{a0}:{c0}' }, calculable : false, xAxis : [ { type : 'category', splitLine: {show: false}, axisLabel: { textStyle : { align : 'center' }}, data : xData } ], yAxis : [ { type : 'value', splitLine: {show: false}, axisLabel: {show: false}, axisLine: {show:false} } ], grid: { width: 700, height: 170, y: 5, x: 5, borderColor: '#fff' }, series : [ { name:'分数', clickable : true, type:'bar', stack: '总量', barWidth:40, itemStyle: itemStyle, data:seriesData } ] }; // 为echarts对象加载数据 rankChart.setOption(option); } ); } function drawPieChart(indexName,indexMaxValue,indexValue){ require( [ 'echarts', 'echarts/chart/pie' ], function() { var indicatorData = []; for(var i =0 ; i < indexName.length ; i ++){ indicatorData.push({text: indexName[i],max: indexMaxValue[i]}); } var IndexAnalysisChart = echarts.init(document.getElementById('IndexAnalysisChart')); var ecConfig = echarts.config; IndexAnalysisChart.on(ecConfig.EVENT.CLICK, clickPieChart); IndexAnalysisChart.on(ecConfig.EVENT.DBLCLICK, showKpiIndexDetail); var option = { tooltip : { trigger: 'axis' }, polar : [ { indicator : indicatorData } ], grid: { width: 300, height: 190, y: 10, x: 0, borderColor: '#fff' }, series : [ { "symbol":"emptyCircle",//空心节点, type: 'radar', data : [ { value : indexValue, name : '指标得分' } ] } ] }; // 为echarts对象加载数据 IndexAnalysisChart.setOption(option); } ); } function clickBarChart(param) { if (typeof param.seriesIndex === 'undefined') { return; } supplier = param.name; if (param.type === 'click') { analysisQuery.querySupplierIndex(param.name); } } function clickPieChart(param) { if (typeof param.seriesIndex === 'undefined') { return; } if (param.type === 'click') { index = param.name; var seriesData = []; var xData = []; if ('' === kpiDataList || null === kpiDataList){ seriesData = [0]; xData = [""]; return analysisQuery.fillCharInfo(xData,seriesData); } for (var i = 0; i < kpiDataList.length; i++) { if (kpiDataList[i].lskdLepiName === index) { var time = analysisQuery .MonthDayFormatHandler(kpiDataList[i].createTime); var score = kpiDataList[i].lskdOldValue; seriesData.push(score); xData.push(time); } } analysisQuery.fillCharInfo(xData,seriesData); } } 触发事件重新加载图表时报错： “_axisList”的值: 对象为 null 或未定义
Xpath定位xml返回值错误
xml是这样的：（为什么标签写不出来） <?xml version="1.0" encoding="utf-8"?> <doc> <text>凯美瑞现在的价格优势蛮明显的。</text> <evl id="0"> <evlobject firclass="性价比" secclass="" isimplicit="0" pos="6">价格优势</evlobject> <evlcontent polar="A" pos="10">蛮明显</evlcontent> <evlattribute pos="-1"/> <evlnegative pos="-1" neg="0"/> <evlmanuf pos="-1">丰田</evlmanuf> <evlbrand pos="-1">凯美瑞</evlbrand> <evltype pos="-1"/> <evlvsmanuf pos="-1"/> <evlvsbrand pos="-1"/> <evlvstype pos="-1"/> <evlcondition pos="-1"/> </evl> </doc> Xpath语句是这样的：/doc/evl/evlobject 我要查出来的就是“价格优势”这个词，可是返回值有时候查的到有时候查不到，我就纳闷了。 开发源语言是c#。代码是这样的： XmlDocument doc_ = new XmlDocument(); doc_.LoadXml(node.InnerXml); //ele_s:sentence的xml对象 XmlElement ele_s = null; ele_s = doc_.DocumentElement; XmlNodeList sentence = null; XmlNodeList obj = null; sentence = ele_s.SelectNodes("/doc/text"); //读取每条评论本身 obj = ele_s.SelectNodes("/doc/evl/evlobject"); //读取每条评论的评论对象 sentence是每次都能读出来但是obj就老是出错。求大神帮助啊

## **methode.h** /* Klassendefinition*/ using namespace std; class COMPLEX { public: COMPLEX(void){}; COMPLEX(float,float,int); void ein(); void aus(int); friend float RE(COMPLEX); friend float IM(COMPLEX); friend float ABS(COMPLEX); friend float ANGLE(COMPLEX); friend COMPLEX operator+(COMPLEX, COMPLEX); friend COMPLEX operator-(COMPLEX, COMPLEX); friend COMPLEX operator*(COMPLEX, COMPLEX); friend COMPLEX operator/(COMPLEX, COMPLEX); private: float Re, Im, Abs, Angle;//Datenelemente void Umrechnung (float,float,int); }; void Ausgabe(COMPLEX Z1, COMPLEX Z2); ## ****methode.cpp #include "methode.h" #include <iostream> #include <iomanip> #include <cstdlib> #include <cmath> using namespace std; COMPLEX::COMPLEX(float a, float b, int c) { if(c==0) {Re=a; Im=b; Umrechnung(a,b,0);//(Re, Im)-> (Abs, Angle) } else if(c==1) {Abs=a; Angle=b; Umrechnung(a,b,1);//(Abs,Angle)-> (Re, Im) } } float RE(COMPLEX a){return a.Re;} float IM(COMPLEX a){return a.Im;} float ABS(COMPLEX a){return a.Abs;} float ANGLE(COMPLEX a){return a.Angle;} COMPLEX operator+ (COMPLEX Z1, COMPLEX Z2) {return COMPLEX(Z1.Re+Z2.Re,Z1.Im+Z2.Im,0);} COMPLEX operator- (COMPLEX Z1, COMPLEX Z2) {return COMPLEX(Z1.Re-Z2.Re,Z1.Im-Z2.Im,0);} COMPLEX operator* (COMPLEX Z1, COMPLEX Z2) {return COMPLEX(Z1.Re*Z2.Re-Z1.Im*Z2.Im, Z1.Re*Z2.Im+Z1.Im*Z2.Re,0);} COMPLEX operator/ (COMPLEX Z1, COMPLEX Z2) { float l; COMPLEX Z3; l= Z2.Re*Z2.Re+Z2.Im*Z2.Im; if(l==0.0) { cout<<"\nDivision durch Null!"; Z3.Re=Z3.Im=0.0; } else { Z3.Re=(Z1.Re*Z2.Re+Z1.Im*Z2.Im)/l; Z3.Im=(Z2.Re*Z1.Im-Z1.Re*Z2.Im)/l; } Z3.Umrechnung(Z3.Re, Z3.Im, 0); return Z3; } void COMPLEX::ein() { char menu; do {cout<<"\n[k]artesisch oder [P]olar?->"; cin>>menu; if(menu=='p'||menu=='P') { cout<<"\nBetrag ->"; cin>>Abs; cout<<"\nWinkel in Grad ->"; cin>>Angle; Umrechnung(Abs,Angle,1); } else if(menu=='k'||menu=='K') {cout<<"\nRealteil ->"; cin>>Re; cout<<"\nImaginaerteil ->"; cin>>Im; Umrechnung(Re,Im,0); } else cout<<"Falsche Eingabe!"; } while(menu!='p'&&menu!='k'); } //Umwandlung einer komplexer Zahl void COMPLEX::Umrechnung(float a, float b, int c) { if(c==1)//polar-->kartesisch { Re=a*cos(b/180.*M_PI); Im=a*sin(b/180.*M_PI); } else if(c==0)//kartesisch-->polar { Abs=sqrt(a*a+b*b); if(Re==0) Angle=90; else Angle=atan(b/a)*(180./M_PI); } else cout<<"Falscher Umrechen-Parameter!!\n"; } //Ausgabe void COMPLEX::aus(int i) { if(i==0) cout<<Re<<"+"<<Im<<"j"; else if(i==1) cout<<Abs<<"*Exp^("<<(Angle*M_PI/180.)<<")j"; else if(i==2) cout<<Abs<<"*[cos("<<Angle<<")+jsin("<<Angle<<")]"; else cout<<"Undefinierter Ausgabe-Parameter!!!"; } void Ausgabe(COMPLEX Z1,COMPLEX Z2) { COMPLEX Z3; cout<<setiosflags(ios::fixed) <<setiosflags(ios::showpoint) <<setprecision(2)<<endl; cout<<setw(6)<<"Z1"<<setw(3)<<":"<<endl; cout<<"Kartesisch"<<setw(7); Z1.aus(0);cout<<endl; cout<<"Polar exponentiell"<<setw(7); Z1.aus(1);cout<<endl; cout<<"Polar trigonometrisch"<<setw(7); Z1.aus(2);cout<<endl<<endl; cout<<setw(6)<<"Z2"<<setw(3)<<":"<<endl; cout<<"Kartesisch"<<setw(7); Z2.aus(0);cout<<endl; cout<<"Polar exponentiell"<<setw(7); Z2.aus(1);cout<<endl; cout<<"Polar trigonometrisch"<<setw(7); Z2.aus(2);cout<<endl<<endl; Z3=Z1+Z2; cout<<setw(6)<<"Z1+Z2"<<setw(3)<<":"<<endl; cout<<"Kartesisch"<<setw(7); Z3.aus(0);cout<<endl; cout<<"Polar exponentiell"<<setw(7); Z3.aus(1);cout<<endl; cout<<"Polar trigonometrisch"<<setw(7); Z3.aus(2);cout<<endl<<endl; Z3=Z1-Z2; cout<<setw(5)<<"Z1-Z2"<<setw(3)<<":"<<endl; cout<<"Kartesisch"<<setw(7); Z3.aus(0);cout<<endl; cout<<"Polar exponentiell"<<setw(7); Z3.aus(1);cout<<endl; cout<<"Polar trigonometrisch"<<setw(7); Z3.aus(2);cout<<endl<<endl; Z3=Z1*Z2; cout<<setw(5)<<"Z1*Z2"<<setw(3)<<":"<<endl; cout<<"Kartesisch"<<setw(7); Z3.aus(0);cout<<endl; cout<<"Polar exponentiell"<<setw(7); Z3.aus(1);cout<<endl; cout<<"Polar trigonometrisch"<<setw(7); Z3.aus(2);cout<<endl<<endl; Z3=Z1/Z2; cout<<setw(5)<<"Z1/Z2"<<setw(3)<<":"<<endl; cout<<"Kartesisch"<<setw(7); Z3.aus(0);cout<<endl; cout<<"Polar exponentiell"<<setw(7); Z3.aus(1);cout<<endl; cout<<"Polar trigonometrisch"<<setw(7); Z3.aus(2);cout<<endl; } ## **pruefung.cpp** #include "methode.h" #include <iostream> #include <cstdlib> using namespace std; int main(void) { COMPLEX Z1,Z2,Z3; char janein; do{ cout<<"\n1.Wert Z1\n"; cout<<"======="; Z1.ein(); cout<<"\n2.Wert Z2\n"; cout<<"======="; Z2.ein(); system("cls"); Ausgabe(Z1,Z2); cout<<"\nNochmal?[j/n]>"; cin>>janein; } while(toupper(janein)=='J'); return 0; } ## **makefile** pruefung:pruefung.o methode.o g++ -o pruefung pruefung.o methode.o pruefung.o:pruefung.cpp methode.h g++ -o pruefung pruefung.cpp methode.o:methode.cpp methode.h g++ -o methode methode.cpp clean: rm *.o pruefung

EXTJS6.0饼状图报错，困惑我好几天了
![图片说明](https://img-ask.csdn.net/upload/201708/30/1504074320_829831.jpg) 我在百度上搜索的代码都试了一遍几乎都会报这个错  Ext.onReady(function(){ Ext.define('MyApp.store.Expense', { extend : 'Ext.data.Store', alias : 'store.expense', fields : [ 'cat', 'spent' ], data : [ { "cat" : "Restaurant", "spent" : 100 }, { "cat" : "Travel", "spent" : 150 }, { "cat" : "Insurance", "spent" : 500 }, { "cat" : "Rent", "spent" : 1000 }, { "cat" : "Groceries", "spent" : 400 }, { "cat" : "Utilities", "spent" : 300 } ] }); var store = Ext.create("MyApp.store.Expense"); Ext.create('Ext.Container',{ renderTo : Ext.getBody(), width : 600, height : 500, layout : 'fit', items : [ { xtype : 'polar', legend : { docked : 'bottom' }, insetPadding : { top : 100, bottom : 20, left : 20, right : 40 }, store : store, series : [ { type : 'pie', angleField : 'spent', label : { field : 'cat', }, tooltip : { trackMouse : true, renderer : function(storeItem, item) { var value = ((parseFloat(storeItem.get('spent')/ storeItem.store.sum('spent')) * 100.0).toFixed(2)); this.setHtml(storeItem.get('cat') + ': ' + value + '%'); } } } ] } ] }); });  这是我的代码 ![图片说明](https://img-ask.csdn.net/upload/201708/30/1504074415_18803.jpg) 这是我页面上的引入,各位老铁们帮忙看下，困惑我很久了
opencv下笛卡尔坐标图片转化为极坐标图片无法显示彩色图片
uchar interpolate_bilinear(cv::Mat& mat_src, double ri, int rf, int rc, double ti, int tf, int tc) { double inter_value = 0.0; if (rf == rc && tc == tf) { inter_value = mat_src.ptr<uchar>(rc)[tc]; } else if (rf == rc) { inter_value = (ti - tf) * mat_src.ptr<uchar>(rf)[tc] + (tc - ti) * mat_src.ptr<uchar>(rf)[tf]; } else if (tf == tc) { inter_value = (ri - rf) * mat_src.ptr<uchar>(rc)[tf] + (rc - ri) * mat_src.ptr<uchar>(rf)[tf]; } else { double inter_r1 = (ti - tf) * mat_src.ptr<uchar>(rf)[tc] + (tc - ti) * mat_src.ptr<uchar>(rf)[tf]; double inter_r2 = (ti - tf) * mat_src.ptr<uchar>(rc)[tc] + (tc - ti) * mat_src.ptr<uchar>(rc)[tf]; inter_value = (ri - rf) * inter_r2 + (rc - ri) * inter_r1; } return (uchar)inter_value; } bool cartesian_to_polar(cv::Mat& mat_c, cv::Mat& mat_p, int img_d) { int color_num = mat_c.channels(); cout << "color_num=" << color_num << endl; mat_p = cv::Mat::zeros(img_d, img_d, CV_8UC1); //mat_p = cv::Mat::zeros(img_d, img_d, CV_8UC3); //mat_p = cv::Mat::zeros(img_d, img_d, color_num); int line_len = mat_c.rows; int line_num = mat_c.cols; double delta_r = (2.0*line_len) / (img_d - 1); //半径因子 double delta_t = 2.0 * PI / line_num; //角度因子 double center_x = (img_d - 1) / 2.0; double center_y = (img_d - 1) / 2.0; for (int i = 0; i < img_d; i++) { for (int j = 0; j < img_d; j++) { double rx = j - center_x; //图像坐标转世界坐标 double ry = center_y - i; //图像坐标转世界坐标 double r = std::sqrt(rx*rx + ry*ry); if (r <= (img_d - 1) / 2.0) { double ri = r * delta_r; int rf = (int)std::floor(ri); int rc = (int)std::ceil(ri); if (rf < 0) { rf = 0; } if (rc >(line_len - 1)) { rc = line_len - 1; } double t = std::atan2(ry, rx); if (t < 0) { t = t + 2.0 * PI; } double ti = t / delta_t; int tf = (int)std::floor(ti); int tc = (int)std::ceil(ti); if (tf < 0) { tf = 0; } if (tc >(line_num - 1)) { tc = line_num - 1; } mat_p.ptr<uchar>(i)[j] = interpolate_bilinear(mat_c, ri, rf, rc, ti, tf, tc); /* mat_p.ptr<Vec3b>(i, j)[0] = interpolate_bilinear(mat_c, ri, rf, rc, ti, tf, tc); mat_p.ptr<Vec3b>(i, j)[1] = interpolate_bilinear(mat_c, ri, rf, rc, ti, tf, tc); mat_p.ptr<Vec3b>(i, j)[2] = interpolate_bilinear(mat_c, ri, rf, rc, ti, tf, tc); */ } } } return true; }

 int i=0; int stepcount=1; enum type{ and,or,detrusion,equal,level,variable }; struct node{ char *s; type kind; int polar; node *next; node *child; int start; }; struct step{ step *child; step *brother; node *lhead; node *rhead; int count; char name[30]; }; while(i<len){ // i<len if(s[i]=='|'){ //遇到 | if(!(s[i+1]<='Z'&&s[i+1]>='A'||s[i+1]<='z'&&s[i+1]>='a')&&s[i+1]!='1'&&s[i+1]!='0'&&s[i+1]!='('&&s[i+1]!='!'||i==0) return 0; current=(node*)malloc(sizeof(node)); current->kind=or; current->s=NULL; current->next=NULL; current->child=NULL; current->polar=polar; current->start=0; if(last->kind==level&&last->child==NULL){ last->child=current; } else{ last->next=current; } last=current; i++; } else if(s[i]=='&'){ //遇到 & if(!(s[i+1]<='Z'&&s[i+1]>='A'||s[i+1]<='z'&&s[i+1]>='a')&&s[i+1]!='1'&&s[i+1]!='0'&&s[i+1]!='('&&s[i+1]!='!'||i==0)return 0; current=(node*)malloc(sizeof(node)); current->kind=and; current->s=NULL; current->next=NULL; current->child=NULL; current->polar=polar; current->start=0; if(last->kind==level&&last->child==NULL){ last->child=current; } else{ last->next=current; } last=current; i++; } 
Python霍兰德分析报错？？
 #霍兰德人格分析雷达图 import numpy as np import matplotlib.pyplot as plt import matplotlib matplotlib.rcParams['font.family']='SimHei' matplotlib.rcParams['font.sans-serif']=['SimHei'] radar_labels=np.array(['研究型（I）','艺术型（A）','社会型（S）',\ '企业型(E)','常规型（C）','现实型(R)']) nAttr=6 #数据值 data=np.array([[0.40,0.32,0.35,0.30,0.30,0.88], [0.85,0.35,0.30,0.40,0.40,0.30], [0.43,0.89,0.30,0.28,0.22,0.30], [0.30,0.25,0.48,0.85,0.45,0.40], [0.20,0.38,0.87,0.45,0.32,0.28], [0.34,0.31,0.38,0.40,0.92,0.28]]) data_labels=('工程师','实验员','艺术家','推销员','社会工作者','记事员') angles=np.linspace(0,2*np.pi,nAttr,endpoint=False) data=np.concatenate((data,[data[0]])) angles=np.concatenate((angles,[angles[0]])) fig=plt.figure(facecolor="white") plt.subplot(111,polar=True) plt.plot(angles,data,'bo-',color='gray',linewidth=1,alpha=0.2) plt.plot(angles,data,'o-',linewidth=1.5,alpha=0.2) plt.fill(angles,data,alpha=0.25) plt.thetagrids(angles*180/np.pi,radar_labels,frac=1.2) plt.figtext(0.52,0.95,'霍兰德人格分析',ha='center',size=20) legend=plt.legend(data_labels,loc=(0.94,0.80),labelspacing=0.1) plt.setp(legend.get_texts(),fontsize='small') plt.grid(True) plt.savefig('holland_radar.JPG') plt.show()  Traceback (most recent call last): File "D:/Python/霍兰德.py", line 28, in <module> plt.thetagrids(angles*180/np.pi,radar_labels,frac=1.2) File "C:\Users\li\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\matplotlib\pyplot.py", line 1768, in thetagrids lines, labels = ax.set_thetagrids(*args, **kwargs) File "C:\Users\li\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\matplotlib\projections\polar.py", line 1268, in set_thetagrids t.update(kwargs) File "C:\Users\li\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\matplotlib\text.py", line 187, in update super().update(kwargs) File "C:\Users\li\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\matplotlib\artist.py", line 916, in update ret = [_update_property(self, k, v) for k, v in props.items()] File "C:\Users\li\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\matplotlib\artist.py", line 916, in <listcomp> ret = [_update_property(self, k, v) for k, v in props.items()] File "C:\Users\li\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\matplotlib\artist.py", line 912, in _update_property raise AttributeError('Unknown property %s' % k) AttributeError: Unknown property frac

Java学习的正确打开方式

《奇巧淫技》系列-python！！每天早上八点自动发送天气预报邮件到QQ邮箱

Python 植物大战僵尸代码实现(2):植物卡片选择和种植

YOLO 是我非常喜欢的目标检测算法，堪称工业级的目标检测，能够达到实时的要求，它帮我解决了许多实际问题。 这就是 YOLO 的目标检测效果。它定位了图像中物体的位置，当然，也能预测物体的类别。 之前我有写博文介绍过它，但是每次重新读它的论文，我都有新的收获，为此我准备写一个系列的文章来详尽分析它。这是第一篇，从它的起始 YOLOv1 讲起。 YOLOv1 的论文地址：https://www.c

20行Python代码爬取王者荣耀全英雄皮肤

TCP/IP协议是传输层协议，主要解决数据如何在网络中传输，而HTTP是应用层协议，主要解决如何包装数据。 一、TCP与UDP的不同 1. 是否需要建立连接。 UDP在传送数据之前不需要先建立连接；TCP则提供面向连接的服务； 2. 是否需要给出确认 对方的传输层在收到UDP报文后，不需要给出任何确认，而 TCP需要给出确认报文，要提供可靠的、面向连接的传输服务。 3.虽然UDP不提供可靠交...

2019年互联网寒冬，大批企业开始裁员，下图是网上流传的一张截图： 裁员不可避免，那如何才能做到不管大环境如何变化，自身不受影响呢？ 我们先来看一个有意思的故事，如果西游记取经团队需要裁员一名，会裁掉谁呢，为什么？ 西游记团队组成： 1.唐僧 作为团队teamleader，有很坚韧的品性和极高的原则性，不达目的不罢休，遇到任何问题，都没有退缩过，又很得上司支持和赏识(直接得到唐太宗的任命，既给

Python语言高频重点汇总
Python语言高频重点汇总 GitHub面试宝典仓库——点这里跳转 文章目录Python语言高频重点汇总**GitHub面试宝典仓库——点这里跳转**1. 函数-传参2. 元类3. @staticmethod和@classmethod两个装饰器4. 类属性和实例属性5. Python的自省6. 列表、集合、字典推导式7. Python中单下划线和双下划线8. 格式化字符串中的%和format9.

（经验分享）作为一名普通本科计算机专业学生，我大学四年到底走了多少弯路

Redis 面试题 1、什么是 Redis?. 2、Redis 的数据类型？ 3、使用 Redis 有哪些好处？ 4、Redis 相比 Memcached 有哪些优势？ 5、Memcache 与 Redis 的区别都有哪些？ 6、Redis 是单进程单线程的？ 7、一个字符串类型的值能存储最大容量是多少？ 8、Redis 的持久化机制是什么？各自的优缺点？ 9、Redis 常见性...

【设计模式】单例模式的八种写法分析

《面试宝典》：检验是否为合格的初中级程序员的面试知识点，你都知道了吗？查漏补缺

GitHub 标星 1.6w+，我发现了一个宝藏项目，作为编程新手有福了！

Python爬虫爬取淘宝，京东商品信息