iOS 中集成百度echarts3.0
- 突然项目中要用到图表,所以就用了百度的echarts,然后就是网上搜了一下,由于本人的JS不是很熟悉,但是研究了一下还是做出来了,其实也不是很难
- 最后做的效果大概如下图这种,由于界面上没调整,所以粗糙了一点
- 不多说 前端的代码如下
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" /> <title>ECharts</title>
<!-- 引入 echarts.js -->
<script src="echarts.js"></script>
<script type="text/javascript" language="javascript">
var title = "";
var subtext = "";
var legendData;
var xAxisData;
var valueDate;
var valueDateA;
var valueDateB;
var valueDateC;
var subType;
var series;
var myChart = null;
var option; function setLegendData(legendDat) {
legendData = legendDat;
}
function setXAxisData(xAxisDat
){
xAxisData = xAxisDat;
}
function setValueDate(valueDat){
valueDate = valueDat;
}
function setValueDateA(valuedatA){
valueDateA = valuedatA;
}
function setValueDateB(valuedatB){
valueDateB = valuedatB;
} function setValueDateC(valuedatC){
valueDateC = valuedatC;
} function setSubType(type) {
if(type == "I"){
legendData = new Array('A相电流','B相电流','C相电流');
series = [{
name:legendData[0],
type:'line',
data:valueDateA
},
{
name:legendData[1],
type:'line',
data:valueDateB
},
{
name:legendData[2],
type:'line',
data:valueDateC
},
];
title = "电流曲线";
subtext = "单位(A)"
}else if(type == "U"){
legendData = new Array('A相电压','B相电压','C相电压');
series = [{
name:legendData[0],
type:'line',
data:valueDateA
},
{
name:legendData[1],
type:'line',
data:valueDateB
},
{
name:legendData[2],
type:'line',
data:valueDateC
},
];
title = "电压曲线";
subtext = "单位(V)"
}else if(type == "P"){
legendData = new Array('总有功功率','A相有功功率','B相有功功率','C相有功功率');
series = [{
name:legendData[0],
type:'line',
data:valueDate
},
{
name:legendData[1],
type:'line',
data:valueDateA
},
{
name:legendData[2],
type:'line',
data:valueDateB
},
{
name:legendData[3],
type:'line',
data:valueDateC
}
]; title = "有功功率曲线";
subtext = "单位(kW)"
}else if(type == "Q"){
legendData = new Array('总无功功率','A相无功功率','B相无功功率','C相无功功率');
series = [{
name:legendData[0],
type:'line',
data:valueDate
},
{
name:legendData[1],
type:'line',
data:valueDateA
},
{
name:legendData[2],
type:'line',
data:valueDateB
},
{
name:legendData[3],
type:'line',
data:valueDateC
}
]; title = "无功功率曲线";
subtext = "单位(kVar)"
}else if(type == "S"){
legendData = new Array('总视在功率','A相视在功率','B相视在功率','C相视在功率');
series = [{
name:legendData[0],
type:'line',
data:valueDate
},
{
name:legendData[1],
type:'line',
data:valueDateA
},
{
name:legendData[2],
type:'line',
data:valueDateB
},
{
name:legendData[3],
type:'line',
data:valueDateC
}
];
title = "视在功率曲线";
subtext = "单位(kW)" }else if(type == "cos"){
legendData = new Array('总功率因数','A相功率因数','B相功率因数','C相功率因数');
series = [{
name:legendData[0],
type:'line',
data:valueDate
},
{
name:legendData[1],
type:'line',
data:valueDateA
},
{
name:legendData[2],
type:'line',
data:valueDateB
},
{
name:legendData[3],
type:'line',
data:valueDateC
}
];
title = "视在功率曲线"; }
} function update() {
// 指定图表的配置项和数据
option = { title: {
// text: title,
subtext:subtext
},
toolbox: {
show: true,
feature: {
dataZoom: {
yAxisIndex: 'none'
},
}
},
tooltip: {
trigger: 'axis'
},
legend: {
data:legendData
}, xAxis: {
type: 'category',
boundaryGap: false,
data: xAxisData
},
yAxis: {
type: 'value',
axisLabel: {
formatter: '{value}'
}
},
series: series
};
myChart = echarts.init(document.getElementById('main'));
myChart.setOption(option);
} </script>
</head>
<body>
<div id="main" style="width: 100%;height:230px;"></div>
<script type="text/javascript" language="javascript"> </script> </body>
</html>json 文件代码如下
{
"status": "",
"message": "成功",
"data": [
{
"p": "",
"qb": "",
"q": "",
"qc": "",
"ia": "",
"fixTimeDate": "",
"s": "",
"cosb": "",
"cos": "",
"ib": "",
"ua": "",
"ub": "",
"ic": "",
"devId": "8a3ae71e5ac56347015ac6520afd0002",
"uc": "",
"id": "418A48AEDFAA4236854388B4F38D41F6",
"pa": "",
"recTime": "",
"sa": "",
"cosc": "",
"pb": "",
"sb": "",
"pc": "",
"sc": "",
"cosa": "",
"qa": ""
},
{
"p": "",
"qb": "",
"q": "",
"qc": "",
"ia": "",
"fixTimeDate": "",
"s": "",
"cosb": "",
"cos": "",
"ib": "",
"ua": "",
"ub": "",
"ic": "",
"devId": "8a3ae71e5ac56347015ac6520afd0002",
"uc": "",
"id": "418A48AEDFAA4236854388B4F38D41F6",
"pa": "",
"recTime": "",
"sa": "",
"cosc": "",
"pb": "",
"sb": "",
"pc": "",
"sc": "",
"cosa": "",
"qa": ""
},
{
"p": "",
"qb": "",
"q": "",
"qc": "",
"ia": "",
"fixTimeDate": "",
"s": "",
"cosb": "",
"cos": "",
"ib": "",
"ua": "",
"ub": "",
"ic": "",
"devId": "8a3ae71e5ac56347015ac6520afd0002",
"uc": "",
"id": "418A48AEDFAA4236854388B4F38D41F6",
"pa": "",
"recTime": "",
"sa": "",
"cosc": "",
"pb": "",
"sb": "",
"pc": "",
"sc": "",
"cosa": "",
"qa": ""
},
{
"p": "",
"qb": "",
"q": "",
"qc": "",
"ia": "",
"fixTimeDate": "",
"s": "",
"cosb": "",
"cos": "",
"ib": "",
"ua": "",
"ub": "",
"ic": "",
"devId": "8a3ae71e5ac56347015ac6520afd0002",
"uc": "",
"id": "418A48AEDFAA4236854388B4F38D41F6",
"pa": "",
"recTime": "",
"sa": "",
"cosc": "",
"pb": "",
"sb": "",
"pc": "",
"sc": "",
"cosa": "",
"qa": ""
}
]
}这里做的只是一个测试项目 ,所以json 里面的数据都是一样的
- 控制器中设立了一个表格 然后读取本地的数据
#import "ViewController.h"
#import "HistoryDateCell.h"
#import "HistoryDateModel.h"
#import "MJExtension.h"
@interface ViewController ()<UITableViewDelegate,UITableViewDataSource>
/** 表格 */
@property(strong,nonatomic) UITableView *tableView;
@property(strong,nonatomic) NSArray *historyArray; @end @implementation ViewController
static NSString *HistoryDateCellID = @"HistoryDateCellId"; - (void)viewDidLoad {
[super viewDidLoad];
[self setupTableView];
[self initJson]; } #pragma mark - JSON 解析
-(void)initJson{
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"json"];
NSData *jdata = [[NSData alloc]initWithContentsOfFile:filePath]; NSDictionary *hisDict = [NSJSONSerialization JSONObjectWithData:jdata options:kNilOptions error:nil];
self.historyArray = [HistoryDateModel mj_objectArrayWithKeyValuesArray:hisDict[@"data"]];
} #pragma mark - 设置表格
-(void)setupTableView{
self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
for (UIView *subView in self.tableView.subviews) {
if ([subView isKindOfClass:[UIScrollView class]]) {
((UIScrollView *)subView).delaysContentTouches = NO;
}
}
self.tableView.delaysContentTouches = NO; self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([HistoryDateCell class]) bundle:nil] forCellReuseIdentifier:HistoryDateCellID]; [self.view addSubview:self.tableView]; }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return ;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
HistoryDateCell *cell = [tableView dequeueReusableCellWithIdentifier:HistoryDateCellID];
cell.historyDate = self.historyArray;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return ; } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
} - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
} @end然后 话折线图的代码 都放在自定义cell 的代码里面,具体如下,我这里是对传入的参数进行了分类 真正测试的话不会有这个复杂,并且我用的是wkwebview,这个的内存泄露没UIwebview那么严重,所以就用了这个
#import "HistoryDateCell.h"
#import "HistoryDateModel.h"
#import <WebKit/WebKit.h>
#import "TimeTools.h" #define BTN_BACKCOLOR JdryRGBColorAlpha(25, 180, 212, 0.2)
#define SELECTBTN_BACKCOLOR JdryColorFromHex(0xFFFFFF)
/* 颜色进行宏定义 */
#define JdryColorFromHex(s) [UIColor colorWithRed:(((s & 0xFF0000) >> 16))/255.0 green:(((s &0xFF00) >>8))/255.0 blue:((s &0xFF))/255.0 alpha:1.0]
#define JdryRGBColor(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define JdryRGBColorAlpha(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a];
#define BACK_COLOR JdryColorFromHex(0xE8F0F2)
#define BLUE_COLOR JdryColorFromHex(0x19B5D4)
#define RED_COLOR JdryColorFromHex(0xF95656) /* 获取设备屏幕的大小 */
#define JdryScreeWidth [UIScreen mainScreen].bounds.size.width
#define JdryScreeHeight [UIScreen mainScreen].bounds.size.height
#define JdryScreeBounds [UIScreen mainScreen].bounds
@interface HistoryDateCell ()<WKNavigationDelegate>
@property (weak, nonatomic) IBOutlet UIButton *dayBtn;
@property (weak, nonatomic) IBOutlet UIButton *monthBtn;
@property (weak, nonatomic) IBOutlet UIButton *yearBtn;
/** echart */
@property(strong,nonatomic) WKWebView *wkWebView;
/** xAxisData */
@property(strong,nonatomic) NSString *xAxisData;
/** 总 */
@property(strong,nonatomic) NSMutableString *valueDat;
/** A */
@property(strong,nonatomic) NSMutableString *valueDatA;
/** B */
@property(strong,nonatomic) NSMutableString *valueDatB;
/** C */
@property(strong,nonatomic) NSMutableString *valueDatC;
/** X轴 */
@property(strong,nonatomic) NSMutableString *xAxis; @end @implementation HistoryDateCell - (void)awakeFromNib {
[super awakeFromNib]; self.xAxis = [NSMutableString string];
[self setEcharts:self.webContentView];
} -(void)setHistoryDate:(NSArray *)historyDate{
_historyDate = historyDate;
self.subType = @"cos";
self.timeType = @"";
[self selectSubType:self.subType timeType:_timeType];
} -(void)selectSubType:(NSString *)subType timeType:(NSString *)timeType{
self.valueDat = [NSMutableString string];
self.valueDatA = [NSMutableString string];
self.valueDatB = [NSMutableString string];
self.valueDatC = [NSMutableString string]; if ([subType isEqualToString:@"I"]) {
for (HistoryDateModel *model in _historyDate) {
[_valueDatA appendString:[NSString stringWithFormat:@"'%@',",model.ia]];
[_valueDatB appendString:[NSString stringWithFormat:@"'%@',",model.ib]];
[_valueDatC appendString:[NSString stringWithFormat:@"'%@',",model.ic]];
}
}else if ([subType isEqualToString:@"U"]){
for (HistoryDateModel *model in _historyDate) {
[_valueDatA appendString:[NSString stringWithFormat:@"'%@',",model.ua]];
[_valueDatB appendString:[NSString stringWithFormat:@"'%@',",model.ub]];
[_valueDatC appendString:[NSString stringWithFormat:@"'%@',",model.uc]];
}
}else if ([subType isEqualToString:@"P"]){
for (HistoryDateModel *model in _historyDate) {
[_valueDat appendString:[NSString stringWithFormat:@"'%@',",model.p]];
[_valueDatA appendString:[NSString stringWithFormat:@"'%@',",model.pa]];
[_valueDatB appendString:[NSString stringWithFormat:@"'%@',",model.pb]];
[_valueDatC appendString:[NSString stringWithFormat:@"'%@',",model.pc]];
}
}else if ([subType isEqualToString:@"Q"]){
for (HistoryDateModel *model in _historyDate) {
[_valueDat appendString:[NSString stringWithFormat:@"'%@',",model.q]];
[_valueDatA appendString:[NSString stringWithFormat:@"'%@',",model.qa]];
[_valueDatB appendString:[NSString stringWithFormat:@"'%@',",model.qb]];
[_valueDatC appendString:[NSString stringWithFormat:@"'%@',",model.qc]];
}
}else if ([subType isEqualToString:@"S"]){
for (HistoryDateModel *model in _historyDate) {
[_valueDat appendString:[NSString stringWithFormat:@"'%@',",model.s]];
[_valueDatA appendString:[NSString stringWithFormat:@"'%@',",model.sa]];
[_valueDatB appendString:[NSString stringWithFormat:@"'%@',",model.sb]];
[_valueDatC appendString:[NSString stringWithFormat:@"'%@',",model.sc]];
}
}else if ([subType isEqualToString:@"cos"]){
for (HistoryDateModel *model in _historyDate) {
[_valueDat appendString:[NSString stringWithFormat:@"'%@',",model.cos]];
[_valueDatA appendString:[NSString stringWithFormat:@"'%@',",model.cosa]];
[_valueDatB appendString:[NSString stringWithFormat:@"'%@',",model.cosb]];
[_valueDatC appendString:[NSString stringWithFormat:@"'%@',",model.cosc]];
}
} for (HistoryDateModel *model in _historyDate) {
if ([timeType isEqualToString:@""]) {
[_xAxis appendString:[NSString stringWithFormat:@"'%@',",[TimeTools timeWithDateAndHourAndMIn:model.fixTimeDate]]];
}else if ([timeType isEqualToString:@""]){
[_xAxis appendString:[NSString stringWithFormat:@"'%@',",[TimeTools timeWithDayAndMonthString:model.fixTimeDate]]];
}else if ([timeType isEqualToString:@""]){
[_xAxis appendString:[NSString stringWithFormat:@"'%@月',",[TimeTools timeWithDateAndMonth:model.fixTimeDate]]];
} } if (![subType isEqualToString:@"I"] && ![subType isEqualToString:@"U"]) {
[_valueDat deleteCharactersInRange:NSMakeRange(_valueDat.length -, )];
}
[_valueDatA deleteCharactersInRange:NSMakeRange(_valueDatA.length -, )];
[_valueDatB deleteCharactersInRange:NSMakeRange(_valueDatB.length -, )];
[_valueDatC deleteCharactersInRange:NSMakeRange(_valueDatC.length -, )];
[_xAxis deleteCharactersInRange:NSMakeRange(_xAxis.length -, )];
} #pragma mark - 设置echarts
-(void)setEcharts:(UIView *)contentView{
NSString *path = [[NSBundle mainBundle] pathForResource:@"HistoryData" ofType:@"html"];
self.wkWebView = [[WKWebView alloc] initWithFrame:CGRectMake(, , JdryScreeWidth - , )];
if(path){
if ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0) {
NSURL *fileURL = [NSURL fileURLWithPath:path];
[self.wkWebView loadFileURL:fileURL allowingReadAccessToURL:fileURL];
} else {
NSURL *fileURL = [self fileURLForBuggyWKWebView8:[NSURL fileURLWithPath:path]];
NSURLRequest *request = [NSURLRequest requestWithURL:fileURL];
[self.wkWebView loadRequest:request];
}
}
self.wkWebView.navigationDelegate = self;
[contentView addSubview: self.wkWebView];
} - (NSURL *)fileURLForBuggyWKWebView8:(NSURL *)fileURL {
NSError *error = nil;
if (!fileURL.fileURL || ![fileURL checkResourceIsReachableAndReturnError:&error]) {
return nil;
}
// Create "/temp/www" directory
NSFileManager *fileManager= [NSFileManager defaultManager];
NSURL *temDirURL = [[NSURL fileURLWithPath:NSTemporaryDirectory()] URLByAppendingPathComponent:@"www"];
[fileManager createDirectoryAtURL:temDirURL withIntermediateDirectories:YES attributes:nil error:&error]; NSURL *dstURL = [temDirURL URLByAppendingPathComponent:fileURL.lastPathComponent];
// Now copy given file to the temp directory
[fileManager removeItemAtURL:dstURL error:&error];
[fileManager copyItemAtURL:fileURL toURL:dstURL error:&error];
// Files in "/temp/www" load flawlesly :)
return dstURL;
} -(void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{ [self.wkWebView evaluateJavaScript:[NSString stringWithFormat:@"setValueDate([%@])",_valueDat] completionHandler:^(id dict, NSError * error) {
NSLog(@"%@",error); }]; [self.wkWebView evaluateJavaScript:[NSString stringWithFormat:@"setValueDateA([%@])",_valueDatA] completionHandler:^(id dict, NSError * error) {
NSLog(@"%@",error); }]; [self.wkWebView evaluateJavaScript:[NSString stringWithFormat:@"setValueDateB([%@])",_valueDatB]completionHandler:^(id dict, NSError * error) {
NSLog(@"%@",error); }]; [self.wkWebView evaluateJavaScript:[NSString stringWithFormat:@"setValueDateC([%@])",_valueDatC] completionHandler:^(id dict, NSError * error) {
NSLog(@"%@",error); }]; [self.wkWebView evaluateJavaScript:[NSString stringWithFormat:@"setXAxisData([%@])",_xAxis]
completionHandler:^(id dict, NSError * error) {
NSLog(@"%@",error); }]; [self.wkWebView evaluateJavaScript:[NSString stringWithFormat:@"setSubType('%@')",self.subType]
completionHandler:^(id dict, NSError * error) { NSLog(@"%@",error); }];
[self.wkWebView evaluateJavaScript:@"update()" completionHandler:^(id dict, NSError * error) {
NSLog(@"%@",error); }]; } -(void)setFrame:(CGRect)frame{
frame.origin.y = frame.origin.y += ;
frame.size.height = frame.size.height -= ; [super setFrame:frame];
} - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated]; // Configure the view for the selected state
}
- (IBAction)selectDay:(UIButton *)sender {
sender.backgroundColor = SELECTBTN_BACKCOLOR;
self.monthBtn.backgroundColor = BTN_BACKCOLOR;
self.yearBtn.backgroundColor = BTN_BACKCOLOR;
} - (IBAction)selectMonth:(UIButton *)sender {
sender.backgroundColor = SELECTBTN_BACKCOLOR;
self.dayBtn.backgroundColor = BTN_BACKCOLOR;
self.yearBtn.backgroundColor = BTN_BACKCOLOR;
} - (IBAction)selectYear:(UIButton *)sender {
sender.backgroundColor = SELECTBTN_BACKCOLOR;
self.monthBtn.backgroundColor = BTN_BACKCOLOR;
self.dayBtn.backgroundColor = BTN_BACKCOLOR;
} @end
iOS 中集成百度echarts3.0的更多相关文章
- AngularJS进阶(十九)在AngularJS应用中集成百度地图实现定位功能
在AngularJS应用中集成百度地图实现定位功能 注:请点击此处进行充电! 前言 根据项目需求,需要实现手机定位功能,考虑到百度业务的强大能力,遂决定使用百度地图第三方服务. 添加第三方模块的步骤与 ...
- 【军哥谈CI框架】之CI中集成百度UEditor
Hello,各位亲,新的一周来临啦,很高兴这么快又跟大家伙见面!话说上一回,军哥带大家用JQuery写了一个城市级联菜单的例子 ,不知道亲们学会了多少,是否自己可以独立写出来了呢. 军哥很是期待大家学 ...
- Android Studio 项目中集成百度地图SDK报Native method not found: com.baidu.platform.comjni.map.commonmemcache.JNICommonMemCache.Create:()I错误
Android Studio 项目中集成百度地图SDK报以下错误: java.lang.UnsatisfiedLinkError: Native method not found: com.baidu ...
- IOS中使用百度地图定位后获取城市坐标,城市名称,城市编号信息
IOS中使用百度地图定位后获取城市坐标,城市名称,城市编号信息 /**当获取到定位的坐标后,回调函数*/ - (void)didUpdateBMKUserLocation:(BMKUserLocati ...
- 如何在ios中集成微信登录功能
在ios中集成微信的登录功能有两种方法 1 用微信原生的api来做,这样做的好处就是轻量级,程序负重小,在Build Settings 中这样设置 然后设置 友盟的设置同上,但是要注意,加入你需要的所 ...
- iOS开发---集成百度地图完善版
一.成为百度的开发者.创建应用 http://developer.baidu.com/map/index.php?title=首页 (鼠标移向 然后选择你的项目需要的功能 你可以在里面了解到你想要使用 ...
- iOS开发---集成百度地图
由于iOS MapKit框架很多情况并不能满足我们的需求,我们可以选择集成百度地图,那该如何操作呢? 申请Key 登录百度API管理中心申请Key http://lbsyun.baidu.com/ap ...
- iOS中集成ijkplayer视频直播框架
ijkplayer 是一款做视频直播的框架, 基于ffmpeg, 支持 Android 和 iOS, 网上也有很多集成说明, 但是个人觉得还是不够详细, 在这里详细的讲一下在 iOS 中如何集成ijk ...
- iOS开发---集成百度地图,位置偏移问题
iOS 集成百度SDK 请参考 百度地图官方文档 ,这里不就多啰嗦了 本文介绍的是在百度地图上根据经纬度,自定义气泡时,气泡位置的偏移,在我们天朝这种事是很常见的,也见怪不怪了,在项目中使用的百度地图 ...
随机推荐
- HiWorkV1.3版震撼公布,今日起正式公开測试!
今天HiWork迎来了公开測试和V1.3大版本号更迭,HiWork集成的机器人达到20种,未读消息提醒亦可从不同维度进行设置,不断变好真是件振奋人心的事儿呢. 在这个看重颜值(kan lian)的互联 ...
- poj 2585 Window Pains 暴力枚举排列
题意: 在4*4的格子中有9个窗体,窗体会覆盖它之下的窗体,问是否存在一个窗体放置的顺序使得最后的结果与输入同样. 分析: 在数据规模较小且不须要剪枝的情况下能够暴力(思路清晰代码简单),暴力一般分为 ...
- iOS音频播放 (四):AudioFile 转
原文出处 : http://msching.github.io/blog/2014/07/19/audio-in-ios-4/ 前言 接着第三篇的AudioStreamFile这一篇要来聊一下Audi ...
- 微博试水卖车社交电商怎样令4S“颤抖”?
微博对社交电商的探索一直在深入,年初.微博上线了"支付"产品.从而使社交产业链实现了闭环,随后,微博又尝试售卖多种商品,不断扩大移动电商的试水范围,近期微博大规模汽车销售收 ...
- ubuntu下,创建ruby环境时出现 checking for Magick-config... no
解决:sudo apt-get install libmagickcore-dev libmagickwand-dev
- jackson实体为NULL或者为空不显示
1.实体上 @JsonInclude(JsonInclude.Include.NON_NULL) 将该注解放在属性上,如果该属性为null则不参与序列化: 如果放在类上边,那对这个类的全部属性起作用 ...
- YTU 2580: 改错题----修改revert函数
2580: 改错题----修改revert函数 时间限制: 1 Sec 内存限制: 128 MB 提交: 194 解决: 82 题目描述 修改revert函数,实现输入N个数,顺序倒置后输出 #i ...
- YTU 2887: D--机器人Bill
2887: D--机器人Bill 时间限制: 1 Sec 内存限制: 128 MB 提交: 112 解决: 22 题目描述 最近,Dr. Jiang 新设计一个机器人Bill.Bill很聪明,会做 ...
- HAProxy+Keepalived构建高可用负载均衡
http://www.linuxidc.com/Linux/2012-03/55880.htm web1 IP 192.168.0.47 web2 IP 192.168.0.48 haproxy_ma ...
- HDU - 4513 吉哥系列故事――完美队形II(manacher)
1.找出一个最长的回文子串,要求中间的值最大,然后向两侧递减. 2.判断条件改为:Ma[i+Mp[i]]==Ma[i-Mp[i]]&&Ma[i-Mp[i]]<=Ma[i-Mp[i ...