REST easy with kbmMW #24 使用kbmMW实现JSON/XML/YAML转换成对象
你想过没有,把一个给定的xml或json生成一个Delphi类,并通过这个类完成对xml或json的读写操作吗?
不管有没有,现在kbmMW为我们实现了,看下面这行代码:
var
s:string;
...
s:=TkbmMWJSONMarshal.GenerateDelphiClassFromUTF8File('auctions.json','Unit2','JSONData');
...
{
"realm":{"name":"Aegwynn","slug":"aegwynn"},
"alliance":{"auctions":[
{"auc":1972333274,"item":22574,"owner":"Schäuble","bid":51300,"buyout":54000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":30355200},
{"auc":1970925966,"item":22446,"owner":"Aenni","bid":1890000,"buyout":2450000,"quantity":10,"timeLeft":"LONG","rand":0,"seed":1280052352},
{"auc":1972187088,"item":82800,"owner":"Ainshu","bid":4329000,"buyout":4329000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":955897088,"petSpeciesId":122,"petBreedId":5,"petLevel":1,"petQualityId":2},
{"auc":1972201216,"item":51950,"owner":"Ulath","bid":119157,"buyout":121590,"quantity":3,"timeLeft":"VERY_LONG","rand":0,"seed":1109650432},
... + entries
]},
"horde":{"auctions":[
{"auc":1970970808,"item":82952,"owner":"Guldarak","bid":4004290,"buyout":4004426,"quantity":1,"timeLeft":"LONG","rand":0,"seed":950078272},
{"auc":1971973942,"item":4306,"owner":"Blutrabé","bid":94500,"buyout":99999,"quantity":20,"timeLeft":"VERY_LONG","rand":0,"seed":956528896},
{"auc":1971973992,"item":4306,"owner":"Blutrabé","bid":94500,"buyout":99999,"quantity":20,"timeLeft":"VERY_LONG","rand":0,"seed":1476867968},
{"auc":1972449149,"item":87893,"owner":"Thêlon","bid":2375000,"buyout":2500000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":848616448},
{"auc":1971763986,"item":74705,"owner":"Gondoline","bid":15558129,"buyout":16662661,"quantity":1,"timeLeft":"LONG","rand":0,"seed":577727872},
... + entries
]},
"neutral":{"auctions":[
{"auc":1971600068,"item":72145,"owner":"Mellkore","bid":59990000,"buyout":59990000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":436886144},
{"auc":1972336265,"item":8485,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0},
{"auc":1972336316,"item":8487,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0},
{"auc":1972336611,"item":8487,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0},
{"auc":1972336922,"item":8488,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0},
{"auc":1972336986,"item":8488,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0},
{"auc":1971335148,"item":76085,"owner":"Splatthy","bid":4418750,"buyout":4950000,"quantity":5,"timeLeft":"VERY_LONG","rand":0,"seed":2058173312},
{"auc":1972336837,"item":8487,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0},
{"auc":1972336524,"item":8486,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0},
{"auc":1971335152,"item":76085,"owner":"Splatthy","bid":4418750,"buyout":4950000,"quantity":5,"timeLeft":"VERY_LONG","rand":0,"seed":2058173312},
{"auc":1972336351,"item":8485,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0},
{"auc":1972386885,"item":4338,"owner":"Huntez","bid":90284,"buyout":95038,"quantity":15,"timeLeft":"VERY_LONG","rand":0,"seed":944449152},
{"auc":1971335163,"item":76085,"owner":"Splatthy","bid":17675000,"buyout":19800000,"quantity":20,"timeLeft":"VERY_LONG","rand":0,"seed":1033557888},
{"auc":1972336774,"item":8487,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0},
{"auc":1971335155,"item":76085,"owner":"Splatthy","bid":4418750,"buyout":4950000,"quantity":5,"timeLeft":"VERY_LONG","rand":0,"seed":2058173312},
{"auc":1972336383,"item":8485,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0},
{"auc":1972336563,"item":8486,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0},
{"auc":1972386607,"item":12808,"owner":"Huntez","bid":71499,"buyout":79999,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":266490112},
{"auc":1971335149,"item":76085,"owner":"Splatthy","bid":4418750,"buyout":4950000,"quantity":5,"timeLeft":"VERY_LONG","rand":0,"seed":2058173312},
{"auc":1972336707,"item":8486,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0},
{"auc":1972386682,"item":16249,"owner":"Huntez","bid":11250,"buyout":0,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":747154816},
{"auc":1972386894,"item":4338,"owner":"Huntez","bid":90284,"buyout":95038,"quantity":15,"timeLeft":"VERY_LONG","rand":0,"seed":944449152},
{"auc":1972337130,"item":8488,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0},
{"auc":1972336425,"item":8485,"owner":"Zaruman","bid":351500,"buyout":450000,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":0}]}
}
一行代码,把给定的JSON文件,生成对应的类单元,类名为TJSONData。
将上面的s变量,存在文件,就得到了生成的单元,加入到自己的项目中,就可以通过TJSONData类来访问对应的auctions.json中的内容了!
下面是生成的内容:
unit Unit2; // ==========================================================================
// Generated by kbmMW ObjectNotation marshalling converter
// 11/03/2019 00:07:12
// ========================================================================== interface uses
Classes,
Generics.Collections,
kbmMWRTTI,
kbmMWObjectMarshal,
kbmMWDateTime,
kbmMWNullable; type TJSONData=class;
Trealm=class;
Talliance=class;
TauctionsList=class;
Tauctions=class;
Thorde=class;
Tneutral=class;
[kbmMW_Root('TJSONData',[mwrfIncludeOnlyTagged])]
TJSONData=class
private
Frealm:Trealm;
Falliance:Talliance;
Fhorde:Thorde;
Fneutral:Tneutral;
protected
procedure Setrealm(const AValue:Trealm); virtual;
procedure Setalliance(const AValue:Talliance); virtual;
procedure Sethorde(const AValue:Thorde); virtual;
procedure Setneutral(const AValue:Tneutral); virtual;
public
destructor Destroy; override; [kbmMW_Element('realm')]
property realm:Trealm read Frealm write Setrealm; [kbmMW_Element('alliance')]
property alliance:Talliance read Falliance write Setalliance; [kbmMW_Element('horde')]
property horde:Thorde read Fhorde write Sethorde; [kbmMW_Element('neutral')]
property neutral:Tneutral read Fneutral write Setneutral;
end; [kbmMW_Root('realm',[mwrfIncludeOnlyTagged])]
Trealm=class
private
Fname:kbmMWNullable<string>;
Fslug:kbmMWNullable<string>;
public
[kbmMW_Element('name')]
property name:kbmMWNullable<string> read Fname write Fname; [kbmMW_Element('slug')]
property slug:kbmMWNullable<string> read Fslug write Fslug;
end; [kbmMW_Root('alliance',[mwrfIncludeOnlyTagged])]
Talliance=class
private
Fauctions:TauctionsList;
protected
procedure Setauctions(const AValue:TauctionsList); virtual;
public
destructor Destroy; override; [kbmMW_Element('auctions')]
property auctions:TauctionsList read Fauctions write Setauctions;
end; [kbmMW_Child('auctions',[mwcfFlatten])]
TauctionsList=class(TObjectList<Tauctions>);
[kbmMW_Root('auctions',[mwrfIncludeOnlyTagged])]
Tauctions=class
private
FpetSpeciesId:kbmMWNullable<double>;
FpetBreedId:kbmMWNullable<double>;
FpetLevel:kbmMWNullable<double>;
FpetQualityId:kbmMWNullable<double>;
Fauc:kbmMWNullable<double>;
Fitem:kbmMWNullable<double>;
Fowner:kbmMWNullable<string>;
Fbid:kbmMWNullable<double>;
Fbuyout:kbmMWNullable<double>;
Fquantity:kbmMWNullable<double>;
FtimeLeft:kbmMWNullable<string>;
Frand:kbmMWNullable<double>;
Fseed:kbmMWNullable<double>;
public
[kbmMW_Element('petSpeciesId')]
property petSpeciesId:kbmMWNullable<double> read FpetSpeciesId write FpetSpeciesId; [kbmMW_Element('petBreedId')]
property petBreedId:kbmMWNullable<double> read FpetBreedId write FpetBreedId; [kbmMW_Element('petLevel')]
property petLevel:kbmMWNullable<double> read FpetLevel write FpetLevel; [kbmMW_Element('petQualityId')]
property petQualityId:kbmMWNullable<double> read FpetQualityId write FpetQualityId; [kbmMW_Element('auc')]
property auc:kbmMWNullable<double> read Fauc write Fauc; [kbmMW_Element('item')]
property item:kbmMWNullable<double> read Fitem write Fitem; [kbmMW_Element('owner')]
property owner:kbmMWNullable<string> read Fowner write Fowner; [kbmMW_Element('bid')]
property bid:kbmMWNullable<double> read Fbid write Fbid; [kbmMW_Element('buyout')]
property buyout:kbmMWNullable<double> read Fbuyout write Fbuyout; [kbmMW_Element('quantity')]
property quantity:kbmMWNullable<double> read Fquantity write Fquantity; [kbmMW_Element('timeLeft')]
property timeLeft:kbmMWNullable<string> read FtimeLeft write FtimeLeft; [kbmMW_Element('rand')]
property rand:kbmMWNullable<double> read Frand write Frand; [kbmMW_Element('seed')]
property seed:kbmMWNullable<double> read Fseed write Fseed;
end; [kbmMW_Root('horde',[mwrfIncludeOnlyTagged])]
Thorde=class
private
Fauctions:TauctionsList;
protected
procedure Setauctions(const AValue:TauctionsList); virtual;
public
destructor Destroy; override; [kbmMW_Element('auctions')]
property auctions:TauctionsList read Fauctions write Setauctions;
end; [kbmMW_Root('neutral',[mwrfIncludeOnlyTagged])]
Tneutral=class
private
Fauctions:TauctionsList;
protected
procedure Setauctions(const AValue:TauctionsList); virtual;
public
destructor Destroy; override; [kbmMW_Element('auctions')]
property auctions:TauctionsList read Fauctions write Setauctions;
end; implementation procedure TJSONData.Setrealm(const AValue:Trealm);
begin
if Assigned(Frealm) then
Frealm.Free;
Frealm:=AValue;
end; procedure TJSONData.Setalliance(const AValue:Talliance);
begin
if Assigned(Falliance) then
Falliance.Free;
Falliance:=AValue;
end; procedure TJSONData.Sethorde(const AValue:Thorde);
begin
if Assigned(Fhorde) then
Fhorde.Free;
Fhorde:=AValue;
end; procedure TJSONData.Setneutral(const AValue:Tneutral);
begin
if Assigned(Fneutral) then
Fneutral.Free;
Fneutral:=AValue;
end; destructor TJSONData.Destroy;
begin
Frealm.Free;
Falliance.Free;
Fhorde.Free;
Fneutral.Free;
inherited;
end; procedure Talliance.Setauctions(const AValue:TauctionsList);
begin
if Assigned(Fauctions) then
Fauctions.Free;
Fauctions:=AValue;
end; destructor Talliance.Destroy;
begin
Fauctions.Free;
inherited;
end; procedure Thorde.Setauctions(const AValue:TauctionsList);
begin
if Assigned(Fauctions) then
Fauctions.Free;
Fauctions:=AValue;
end; destructor Thorde.Destroy;
begin
Fauctions.Free;
inherited;
end; procedure Tneutral.Setauctions(const AValue:TauctionsList);
begin
if Assigned(Fauctions) then
Fauctions.Free;
Fauctions:=AValue;
end; destructor Tneutral.Destroy;
begin
Fauctions.Free;
inherited;
end; initialization
kbmMWRegisterKnownClasses([TMainClass,Trealm,Talliance,TauctionsList,Tauctions,Thorde,Tneutral]); end.
要实际读取文件,创建一个程序,将Unit2.pas添加到它,并编写以下代码:
procedure TForm1.Button1Click(Sender: TObject);
var
m:TkbmMWCustomRTTIMarshal;
o:TJSONData;
begin
m:=TkbmMWJSONMarshal.Create;
try
TkbmMWJSONMarshal(m).AnonymousRoot:=true;
o:=TkbmMWJSONMarshal(m).ValueFromUTF8File<TJSONData>('auctions.json');
// Your complete parsed file is now contained in the object instance o.
finally
o.Free;
m.Free;
end;
end;
下面是一个xml文件:
<?xml version="1.0"?>
<root>
<course>
<reg_num>10577</reg_num>
<subj>ANTH</subj>
<crse>211</crse>
<sect>F01</sect>
<title>Introduction to Anthropology</title>
<units>1.0</units>
<instructor>Brightman</instructor>
<days>M-W</days>
<time>
<start_time>03:10PM</start_time>
<end_time>04:30</end_time>
</time>
<place>
<building>ELIOT</building>
<room>414</room>
</place>
</course>
<course>
<reg_num>20573</reg_num>
<subj>ANTH</subj>
<crse>344</crse>
<sect>S01</sect>
<title>Sex and Gender</title>
<units>1.0</units>
<instructor>Makley</instructor>
<days>T-Th</days>
<time>
<start_time>10:30AM</start_time>
<end_time>11:50</end_time>
</time>
<place>
<building>VOLLUM</building>
<room>120</room>
</place>
</course>
<course>
<reg_num>10624</reg_num>
<subj>BIOL</subj>
<crse>431</crse>
<sect>F01</sect>
<title>Field Biology of Amphibians</title>
<units>0.5</units>
...
</course>
...
</root>
把上面xml内容生成类的代码:
var
s:string;
...
s:=TkbmMWXMLMarshal.GenerateDelphiClassFromFile('courses.xml','Unit3','XMLData');
...
把s变成存为Unit3.pas文件:
unit Unit3; // ==========================================================================
// Generated by kbmMW ObjectNotation marshalling converter
// 10/03/2019 23:54:52
// ========================================================================== interface uses
Classes,
Generics.Collections,
kbmMWRTTI,
kbmMWObjectMarshal,
kbmMWDateTime,
kbmMWNullable; type Troot=class;
TcourseList=class;
Tcourse=class;
Ttime=class;
Tplace=class;
[kbmMW_Root('root',[mwrfIncludeOnlyTagged])]
Troot=class
private
Fcourse:TcourseList;
protected
procedure Setcourse(const AValue:TcourseList); virtual;
public
destructor Destroy; override; [kbmMW_Element('course')]
property course:TcourseList read Fcourse write Setcourse;
end; [kbmMW_Child('course',[mwcfFlatten])]
TcourseList=class(TObjectList<Tcourse>);
[kbmMW_Root('course',[mwrfIncludeOnlyTagged])]
Tcourse=class
private
Ftime:Ttime;
Fplace:Tplace;
Freg_num:kbmMWNullable<string>;
Fsubj:kbmMWNullable<string>;
Fcrse:kbmMWNullable<string>;
Fsect:kbmMWNullable<string>;
Ftitle:kbmMWNullable<string>;
Funits:kbmMWNullable<string>;
Finstructor:kbmMWNullable<string>;
Fdays:kbmMWNullable<string>;
Fxml_repository:kbmMWNullable<string>;
protected
procedure Settime(const AValue:Ttime); virtual;
procedure Setplace(const AValue:Tplace); virtual;
public
destructor Destroy; override; [kbmMW_Element('time')]
property time:Ttime read Ftime write Settime; [kbmMW_Element('place')]
property place:Tplace read Fplace write Setplace; [kbmMW_Element('reg_num')]
property reg_num:kbmMWNullable<string> read Freg_num write Freg_num; [kbmMW_Element('subj')]
property subj:kbmMWNullable<string> read Fsubj write Fsubj; [kbmMW_Element('crse')]
property crse:kbmMWNullable<string> read Fcrse write Fcrse; [kbmMW_Element('sect')]
property sect:kbmMWNullable<string> read Fsect write Fsect; [kbmMW_Element('title')]
property title:kbmMWNullable<string> read Ftitle write Ftitle; [kbmMW_Element('units')]
property units:kbmMWNullable<string> read Funits write Funits; [kbmMW_Element('instructor')]
property instructor:kbmMWNullable<string> read Finstructor write Finstructor; [kbmMW_Element('days')]
property days:kbmMWNullable<string> read Fdays write Fdays; [kbmMW_Element('xml_repository')]
property xml_repository:kbmMWNullable<string> read Fxml_repository write Fxml_repository;
end; [kbmMW_Root('time',[mwrfIncludeOnlyTagged])]
Ttime=class
private
Fstart_time:kbmMWNullable<string>;
Fend_time:kbmMWNullable<string>;
public
[kbmMW_Element('start_time')]
property start_time:kbmMWNullable<string> read Fstart_time write Fstart_time; [kbmMW_Element('end_time')]
property end_time:kbmMWNullable<string> read Fend_time write Fend_time;
end; [kbmMW_Root('place',[mwrfIncludeOnlyTagged])]
Tplace=class
private
Fbuilding:kbmMWNullable<string>;
Froom:kbmMWNullable<string>;
public
[kbmMW_Element('building')]
property building:kbmMWNullable<string> read Fbuilding write Fbuilding; [kbmMW_Element('room')]
property room:kbmMWNullable<string> read Froom write Froom;
end; implementation procedure Troot.Setcourse(const AValue:TcourseList);
begin
if Assigned(Fcourse) then
Fcourse.Free;
Fcourse:=AValue;
end; destructor Troot.Destroy;
begin
Fcourse.Free;
inherited;
end; procedure Tcourse.Settime(const AValue:Ttime);
begin
if Assigned(Ftime) then
Ftime.Free;
Ftime:=AValue;
end; procedure Tcourse.Setplace(const AValue:Tplace);
begin
if Assigned(Fplace) then
Fplace.Free;
Fplace:=AValue;
end; destructor Tcourse.Destroy;
begin
Ftime.Free;
Fplace.Free;
inherited;
end; initialization
kbmMWRegisterKnownClasses([Troot,TcourseList,Tcourse,Ttime,Tplace]); end.
读取和写入这个XML数据的Delphi代码:
procedure TForm1.Button2Click(Sender: TObject);
var
m:TkbmMWCustomRTTIMarshal;
o:Troot;
s:string;
begin
m:=TkbmMWXMLMarshal.Create;
try
o:=TkbmMWXMLMarshal(m).ValueFromFile<Troot>('courses.xml');
// o now contains all courses. s:=TkbmMWXMLMarshal(m).ValueToString(o);
// s now contains XML generated from o.
finally
o.Free;
m.Free;
end;
end;
REST easy with kbmMW #24 使用kbmMW实现JSON/XML/YAML转换成对象的更多相关文章
- 编程题:1. var person = '{name:"Lily",sex:"famale",age:24,country:"US"}';将person转换成JSON对象并便利每个属性值。
/// <summary> /// Json工具类 /// </summary> public class JsonUtility { private static JsonU ...
- (24)Spring Boot环境变量读取和属性对象的绑定【从零开始学Spring Boot】
凡是被Spring管理的类,实现接口 EnvironmentAware 重写方法 setEnvironment 可以在工程启动时,获取到系统环境变量和application配置文件中的变量. com. ...
- [.NET Core 24]把project.json迁移到.csproj
链接:https://blog.jetbrains.com/dotnet/2017/04/04/rider-eap-update-csproj-based-net-core-support-migra ...
- 第24课经典问题(中)-----关于const对象的疑问
关于const对象的疑问const关键字能否修饰类的对象?如果可以,有什么特性?const关键字能够修饰对象const修饰的对象为只读对象只读对象的成员变量不允许被改变.(对象是只读的,成员变量不允许 ...
- JAXB注解的使用详解
前言: 最近一直在做各种接口的对接,接触最多的数据类型就是JSON和XML数据,还有XML中包含JSON的数据,而在Java中对象和XML之间的转换经常用到JAXB注解,抽空在这里总结一下,首先做一下 ...
- 13年总结js,css,java xml
--------------------------------------javaScript知识点----------------------------- jQuery对象[Object obj ...
- 初识kbmmw 中的ORM
在kbmmw 5.02.1 中,加入了ORM 的功能(这里可能和其他语言的定义不完全一样),我们就简单的认为 它就是一个类与数据库的转换吧.今天就先介绍一下如何通过kbmmw 的ORM 功能,实现类与 ...
- struts-2.3.24.1中的jar的详解
Struts2.3.24.1核心Jar包详解 antlr-2.7.2.jar 语言转换工具,它是接受词文法语言描述,并能产生识别这些语言的语句的程序的一种工具 a ...
- JSON-lib框架,JAVA对象与JSON、XML之间的相互转换
Json-lib可以将Java对象转成json格式的字符串,也可以将Java对象转换成xml格式的文档,同样可以将json字符串转换成Java对象或是将xml字符串转换成Java对象. 一. 准备工作 ...
随机推荐
- SSM项目思路整合NEW
#首先进行项目思路整体分析,具体包括哪些模块,如何实现等: 一)搭建环境 1.导包: (Spring核心包4个 + 面向切面的包4个 + SpringJDBC和事务的包各一个, SpringMVC两个 ...
- kernel: INFO: task sadc:14833 blocked for more than 120 seconds.
早上一到,发现oracle连不上. 到主机上,发现只有oracleora11g一个进程,其他进程全没了. Nov 14 23:33:30 hs-test-10-20-30-15 kernel: INF ...
- 浅析Tomcat、JBOSS、WebSphere、WebLogic、Apache
做任何web项目,都离不开服务器,有钱的公司用WebSphere.WebLogic,没钱公司用nginx+tomcat,不要小瞧nginx+tomcat麻雀虽小,五脏俱全. 服务器的知识,在笔试.面试 ...
- nmon 性能监控网页结果显示——EasyNmon
首先,看看最终展示的结果显示样式: 报告界面: 1.安装包下载地址:https://github.com/mzky/easyNmon 2.下载后有2个压缩文件: 其中,nmon16g_x86中含有不同 ...
- 剧透 & 报名 | 蚂蚁金服ATEC城市峰会·上海即将开幕
小蚂蚁说: 2019年1月4日,蚂蚁金服ATEC城市峰会将以“数字金融新原力(The New Force of Digital Finance)”为主题,在中国上海举办.蚂蚁金服ATEC(Ant Te ...
- java IO和NIO区别
面向流与面向缓冲 Java NIO和IO之间第一个最大的区别是,IO是面向流的,NIO是面向缓冲区的. Java IO面向流意味着每次从流中读一个或多个字节,直至读取所有字节,它们没有被缓存在任何地方 ...
- TCP/IP三次握手和四次挥手
原博链接:https://www.cnblogs.com/Andya/p/7272462.html
- DAY8 文件操作(二)
一.写 1.1写文件 # w:没有文件新建文件,有文件就清空文件 w = open('1.txt', 'w', encoding='utf-8') w.write('000\n') # 在写入大量数据 ...
- angular面试记忆的内容
1.ng-class的用法:ng-class="{red:true}"; 2.ng-repeat怎么可以添加重复数据.ng-repeat="item in arr tra ...
- 周鸿祎IOT发布会思考
周鸿祎的IOT发布会提出了一个新的东西,就是一个智能家居的应用场景,但是与传统的智能家居的应用场景不同,周鸿祎的智能家居概念添加了一个关键的边缘计算节点,这个节点置于家庭端,旨在提高家庭端的计算能力, ...