flex4 一些项目使用的技术
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="init()">
<fx:Style> Application{
fontSize:12;
fontFamily:myFont;
}
</fx:Style>
<fx:Script> <![CDATA[
import com.twobowl.component.manualTopo.Nodes;
import com.twobowl.component.manualTopo.line.ILine;
import com.twobowl.component.manualTopo.main.TopoManager;
import com.twobowl.component.manualTopo.node.INode;
import com.twobowl.component.manualTopo.node.Node;
import com.twobowl.component.manualTopo.renderer.lineRenderer.ILineRenderer;
import com.twobowl.component.manualTopo.renderer.lineRenderer.SimpleLineRenderer;
import com.twobowl.component.manualTopo.renderer.nodeRenderer.SimpleNodeRenderer; import flash.utils.flash_proxy;
import flash.utils.getTimer; import mx.charts.renderers.LineRenderer;
import mx.collections.ArrayCollection;
import mx.collections.ArrayList;
import mx.collections.XMLListCollection;
import mx.containers.Panel;
import mx.controls.Alert;
import mx.core.Container;
import mx.core.DragSource;
import mx.core.IFlexDisplayObject;
import mx.core.UIComponent;
import mx.events.DragEvent;
import mx.events.ItemClickEvent;
import mx.managers.DragManager;
import mx.managers.PopUpManager;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.remoting.RemoteObject;
import mx.utils.ObjectUtil;
[Bindable]
private var manager:TopoManager;
[Bindable]
private var array:ArrayList;
[Bindable]
var data:ArrayCollection;
[Bindable]
var str:XML;
var lable:Panel=new Panel;;
var time:Timer;
private var isDragging:Boolean;//推断是否在拖动中的标志
//var isDoubleClick:Boolean = false;//推断是否是双击的标志 private function init():void{
time=new Timer(100);
time.addEventListener(TimerEvent.TIMER,mov);
remote.getXml();
manager=new TopoManager(); manager.drawSpace=drawSpace;
manager.createFromXML(xmldata);
//registerButton();
manager.status=TopoManager.S_NORMAL;
//registerButton();
drawSpace.doubleClickEnabled=true;
Alert.show(drawSpace.getChildren()[0].toString()); for each(var child:Object in drawSpace.getChildren()){
if( child instanceof SimpleLineRenderer){
(child as DisplayObject).addEventListener(MouseEvent.MOUSE_OVER,createLineWindow);
(child as DisplayObject).addEventListener(MouseEvent.MOUSE_OUT,removeLineWindow);
}else{ (child as DisplayObject).addEventListener(MouseEvent.MOUSE_DOWN, innerStartDragging,false,0,true);
(child as DisplayObject).addEventListener(MouseEvent.MOUSE_UP, innerStopDragging,false,0,true);
//(child as DisplayObject).addEventListener(MouseEvent.MOUSE_UP, click_stopDrag,false,0,true);
(child as DisplayObject).addEventListener(MouseEvent.DOUBLE_CLICK, doubleInnerStartDragging);
//(child as DisplayObject).addEventListener(MouseEvent.MOUSE_MOVE,createWindow);
//(child as DisplayObject).addEventListener(MouseEvent.MOUSE_DOWN, mouseDown_startDrag);
(child as DisplayObject).addEventListener(MouseEvent.CLICK, oneInnerStartDragging);
(child as DisplayObject).removeEventListener(MouseEvent.MOUSE_DOWN,addLine);
} }
}
//private function onOverHand(e:Event):void{ //} public var firstWindow:FirstWindow = new FirstWindow();
public var linetWindow:LineRender = new LineRender();
//使用组件对象打开弹出式窗体的最大优点是能够重用组件并保持所以的状态值.
private function createWindow(e:MouseEvent):void
{
firstWindow.addEventListener("pop",getWindowData);
PopUpManager.addPopUp(firstWindow, this, false);
PopUpManager.centerPopUp(firstWindow);
windowInnerStartDragging(e); }
private function getWindowData(e:Event):void
{
createNodeforward(e);
//Alert.show(firstWindow.logs);
//Alert.show(firstWindow.labelPosition.selectedItem.toString());
//Alert.show("color:" + firstWindow.labelColor.selectedColor);
} private function createLineWindow(e:MouseEvent):void
{
//firstWindow.addEventListener("pop",getLineWindowData);
//PopUpManager.addPopUp(linetWindow, this, false);
//PopUpManager.centerPopUp(linetWindow);
//windowLineStartDragging(e);
//Alert.show(e.currentTarget.toString());
//e.currentTarget.lineColor="0xCC336";
lable.x=this.mouseX+5;
lable.y=this.mouseY+5;
//lable.width=100;
//lable.height=40; lable.title="wode"; PopUpManager.addPopUp(lable,this,false);
//time.start(); } //shubiao 窗体移动时间 //Timer监听函数
public function mov(ti:TimerEvent):void{
if(lable.x!=this.mouseX+5||lable.y!=this.mouseY+5)
lable.move(this.mouseX+5,this.mouseY+5); } public function removeLineWindow(e:MouseEvent):void{
//Alert.show("");
PopUpManager.removePopUp(lable); //time.stop();
}
private function getLineWindowData(e:Event):void
{
createNodeforward(e);
//Alert.show(firstWindow.logs);
//Alert.show(firstWindow.labelPosition.selectedItem.toString());
//Alert.show("color:" + firstWindow.labelColor.selectedColor);
} //private var openner:Object;
//private function createWindow(e:MouseEvent):void
//{
// openner = PopUpManager.createPopUp(this, FirstWindow, false);
// PopUpManager.centerPopUp(openner as IFlexDisplayObject);
// openner.setData(new Array("bobo", "huhu", "coco")); // //openner.addEventListener("pop",getWindowData2);
//
//private function getWindowData2(e:Event):void
//{
//Alert.show(openner.logs);
// Alert.show(openner.labelPosition.selectedItem.toString());
// Alert.show("color:" + openner.labelColor.selectedColor);
//}
//private function onMouseDown(event:MouseEvent):void{
//isDragging = false ; //bla bla bla~~
//for each(var child:Object in drawSpace.getChildren()){
// childs.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
//childs.addEventListener(MouseEvent.MOUSE_UP, innerStopDragging);
//}
//}
//private function onMouseMove(event:MouseEvent):void {
//isDragging = true ;
//bla bla bla~~
//innerStartDragging(event);
//} //private function onClick(event:MouseEvent):void {
//if (isDragging == false) {
//bla bla bla~
/// doubleInnerStartDragging(event);
//}
//}
private function getArraylistFromXMLList(data:XMLList):ArrayList
{
array=new ArrayList();
for(var i:int=0;i<data.length();i++)
{
var obj:Object=new Object();
for(var j:int=0;j<data[i].children().length();j++)
{
var dataColoum:String=data[i].children()[j].localName();
obj[dataColoum]=data[i].children()[j].toString(); }
array.addItem(obj);
}
return array;
} private function registerButton():void{
//itemSource1.addEventListener(MouseEvent.MOUSE_DOWN,doItemSourceDrag);
//itemSource2.addEventListener(MouseEvent.MOUSE_DOWN,doItemSourceDrag);
///itemSource3.addEventListener(MouseEvent.MOUSE_DOWN,doItemSourceDrag);
//itemSource4.addEventListener(MouseEvent.MOUSE_DOWN,doItemSourceDrag); //this.addEventListener(MouseEvent.MOUSE_UP,mouseUPHandle,false,0,true);
}
private function unregisterButton():void{
//itemSource1.removeEventListener(MouseEvent.MOUSE_DOWN,doItemSourceDrag);
//itemSource2.removeEventListener(MouseEvent.MOUSE_DOWN,doItemSourceDrag);
//itemSource3.removeEventListener(MouseEvent.MOUSE_DOWN,doItemSourceDrag);
//itemSource4.removeEventListener(MouseEvent.MOUSE_DOWN,doItemSourceDrag); //this.addEventListener(MouseEvent.MOUSE_UP,mouseUPHandle,false,0,true);
}
public function doItemSourceDrag(event:MouseEvent):void{ //var dragItem:Image=ObjectUtil.copy(event.currentTarget) as Image;
//var dragInitiator:Image=Image(event.currentTarget); var ds:DragSource = new DragSource();
//ds.addData(dragInitiator, "itemSource");
//var dragProxy:Image=new Image();
//dragProxy.source=dragInitiator.source;
//dragProxy.width=dragInitiator.width;
//dragProxy.height=dragInitiator.height;
//DragManager.doDrag(dragInitiator, ds, event,dragProxy,0,0,1); } //var mySprite:Sprite = new Sprite(); //mySprite.addEventListener(MouseEvent.CLICK, onClick);
//mySprite.addEventListener(MouseEvent.DOUBLE_CLICK, onDoubleClick);
//private function onDoubleClick(event:MouseEvent):void {
// isDoubleClick = true;
//}
///private function onClick(event:MouseEvent):void {
//isDoubleClick = false;
//if (isDragging == false) {
//var timer:Timer = new Timer(260, 1);
//timer.start();//也就是说两次单击间隔在260毫秒之内的就被觉得是双击
//timer.addEventListener(TimerEvent.TIMER, function(evt:Event):void {
//Alert.show(isDoubleClick.toString());
//if(isDoubleClick){ // doubleInnerStartDragging(event);//调用双击响应函数
//}else{
// oneInnerStartDragging(event);//调用单击响应函数
//}
//});
//}//这边的clickOrDouble也能够写成匿名函数,把mouseEvent传进去
//}
//private function clickOrDouble(event:MouseEvent):void {
//if(isDoubleClick){
// doubleInnerStartDragging(event);//调用双击响应函数
//}else{
// oneInnerStartDragging(event);//调用单击响应函数
//}
//}
// Called when the user moves the drag proxy onto the drop target. private function dragEnterHandler(event:DragEvent):void { if (event.dragSource.hasFormat('itemSource')) {
var dropTarget:Canvas=Canvas(event.currentTarget);
// Accept the drop.
DragManager.acceptDragDrop(dropTarget);
} }
//加入node
private function dragDropHandler(event:DragEvent):void { var data:Object = event.dragSource.dataForFormat('itemSource');
var dragItem:SimpleNodeRenderer=new SimpleNodeRenderer();
//var dragItem:Image=new Image();
//dragItem.source=(data as Image).source;
//Canvas(event.currentTarget).addChild(dragItem);
var tData:XML=<node id="undifine" name="unknow" desc="unknow" x="200" y="600" imgUrl=""/>;
tData.@id=getTimer();
tData.@x=Canvas(event.currentTarget).mouseX;
tData.@y=Canvas(event.currentTarget).mouseY;
//tData.@imgUrl=(data as Image).source+"";;
//dragItem.data=data;
manager.createNode(tData,dragItem);
//dragItem.addEventListener(MouseEvent.MOUSE_DOWN, innerStartDragging);
//dragItem.addEventListener(MouseEvent.MOUSE_UP, innerStopDragging); }
// 按下鼠标按键时会调用此函数。 private function innerStartDragging(event:MouseEvent):void
{ var parent:Container=(event.currentTarget as UIComponent).parent as Container;
parent.removeChild(event.currentTarget as UIComponent);
parent.addChild(event.currentTarget as UIComponent); event.currentTarget.startDrag(); }
private function doubleInnerStartDragging(e:MouseEvent):void
{
//var remotes:RemoteObject = new RemoteObject();
//调用在J2EE端remoting-config.xml中配置的暴露出的类的名称 id
//Alert.show(e.currentTarget.data.message);非常重要 remote.destination = "service";
//调用J2EE端类中的方法
remote.getXmls();
//监听调用成功事件
remote.addEventListener(ResultEvent.RESULT,result);
//监听失败事件
remote.addEventListener(FaultEvent.FAULT,fault);
createWindow(e);
//var str:XML=new XML(remote.getXmls());
//trace(str.toString());
//var s:String=remote.getXmls();
//Alert.show(s);
//var xmlList:XMLListCollection = new XMLListCollection(str.children());
//data.source = xmlList.toArray();
//getArraylistFromXMLList(xmllist); //for(var i:int=0;i<data.length;i++){
//// var o:Object = data.getItemAt(i);
// trace(o["id"],o["source"],o["x"]);
//}
//event.currentTarget.startDrag(); }
private function oneInnerStartDragging(e:MouseEvent):void
{
//var remotes:RemoteObject = new RemoteObject();
//调用在J2EE端remoting-config.xml中配置的暴露出的类的名称 id
//Alert.show(e.currentTarget.data.id);
remote.destination = "service";
//调用J2EE端类中的方法
remote.getXmls();
//监听调用成功事件
remote.addEventListener(ResultEvent.RESULT,result);
//监听失败事件
remote.addEventListener(FaultEvent.FAULT,fault); //var str:XML=new XML(remote.getXmls());
//trace(str.toString());
//var s:String=remote.getXmls();
//Alert.show(s);
//var xmlList:XMLListCollection = new XMLListCollection(str.children());
//data.source = xmlList.toArray();
//getArraylistFromXMLList(xmllist); //for(var i:int=0;i<data.length;i++){
//// var o:Object = data.getItemAt(i);
// trace(o["id"],o["source"],o["x"]);
//}
//event.currentTarget.startDrag(); }
private function result(evt:ResultEvent):void{
//Alert.show(str);
str=new XML(evt.result.toString());
// var xmlList:XMLList=new XMLList();
//var xmlListCollection:XMLListCollection=new XMLListCollection();
// var provider:ArrayCollection;
//xmlList=str.elements("node");
//xmlListCollection.source=xmlList; //provider=new ArrayCollection(xmlListCollection.toArray());
//var str:XML=new XML(evt.result.toString());
//var xmlList:XMLListCollection = new XMLListCollection(str.children());
//data.source = xmlList.toArray();
//data=new ArrayCollection(xmlList.toArray());
//getArraylistFromXMLList(xmllist);
//for(var i:int=0;i<data.length;i++){
// var o:Object = data.getItemAt(i);
//trace(o["id"],o["source"],o["x"]);
//Alert.show(o["id"]);
//}
//Alert.show(xmlList.source);
} private function fault(evt:FaultEvent):void{
Alert.show("调用失败。");
} private function windowInnerStartDragging(e:MouseEvent):void
{ //var remotes:RemoteObject = new RemoteObject();
//调用在J2EE端remoting-config.xml中配置的暴露出的类的名称 id
remote.destination = "service";
//调用J2EE端类中的方法
remote.getXmls();
//监听调用成功事件
remote.addEventListener(ResultEvent.RESULT,windowresult);
//监听失败事件
remote.addEventListener(FaultEvent.FAULT,windowfault);
//var str:XML=new XML(remote.getXmls());
//trace(str.toString());
//var s:String=remote.getXmls();
//Alert.show(s);
//var xmlList:XMLListCollection = new XMLListCollection(str.children());
//data.source = xmlList.toArray();
//getArraylistFromXMLList(xmllist); //for(var i:int=0;i<data.length;i++){
//// var o:Object = data.getItemAt(i);
// trace(o["id"],o["source"],o["x"]);
//}
//event.currentTarget.startDrag(); } private function windowresult(evt:ResultEvent):void{
str=new XML(evt.result.toString());
firstWindow.setData(str);
} private function windowfault(evt:FaultEvent):void{
Alert.show("调用失败!");
}
private function windowLineStartDragging(e:MouseEvent):void
{ remote.destination = "service";
//调用J2EE端类中的方法
remote.getXmls();
//监听调用成功事件
remote.addEventListener(ResultEvent.RESULT,lineresult);
//监听失败事件
remote.addEventListener(FaultEvent.FAULT,linefault); } private function lineresult(evt:ResultEvent):void{
var strs :XML=new XML(evt.result.toString()); linetWindow.setData(strs);
} private function linefault(evt:FaultEvent):void{
Alert.show("调用失败! ");
}
// 松开鼠标按键时会调用此函数。 private function innerStopDragging(event:MouseEvent):void
{ manager.updateLineRendererForNodeUI(event.currentTarget as UIComponent);
event.currentTarget.stopDrag();
}
//暂时画线
private function doDrawLine(event:MouseEvent):void
{
var x:int =Canvas(event.currentTarget).mouseX;
var y:int =Canvas(event.currentTarget).mouseY;
var lineToPoint:Point=new Point(x,y);
curLine.freeDraw(lineFromPoint,lineToPoint);
}
private var lineFromPoint:Point;
private var fromNode:INode;
private var curLine:SimpleLineRenderer;
//加入一条线
private function addLine(event:MouseEvent):void{
if(curLine!=null){
curLine.parent.removeChild(curLine);
curLine=null;
} fromNode=manager.getNodeByUI(event.currentTarget as UIComponent);
if(fromNode){
for each(var child:Object in drawSpace.getChildren()){
if(child!=event.currentTarget){
(child as DisplayObject).addEventListener(MouseEvent.MOUSE_UP,completeDrawLine);
} }
curLine=new SimpleLineRenderer();
drawSpace.addChildAt(curLine,0);
var parent:Canvas=((event.currentTarget as UIComponent).parent) as Canvas;
var x:int =parent.mouseX;
var y:int =parent.mouseY;
lineFromPoint=new Point(x,y);
curLine.freeDraw(lineFromPoint,lineFromPoint);
drawSpace.addEventListener(MouseEvent.MOUSE_MOVE,doDrawLine,false,0,true);
drawSpace.addEventListener(MouseEvent.MOUSE_UP,stopDrawLineAndRemove,false,0,true);
} }
//完毕画线,正式加入一条边
private function completeDrawLine(event:MouseEvent):void{
var toNode:INode=manager.getNodeByUI(event.currentTarget as UIComponent); var tData:XML=<line id="" fromNode="" toNode=""/>;
tData.@id=getTimer();
tData.@fromNode=fromNode.data.@id;
tData.@toNode=toNode.data.@id; //dragItem.data=data;
var newLine:ILine=manager.createLine(tData,curLine);
newLine.viewRenderer.draw(newLine);
removeDrawLineListner();
}
//停止画线
private function stopDrawLineAndRemove(event:MouseEvent):void{
curLine.parent.removeChild(curLine);
removeDrawLineListner(); //curLine.clearDraw(); }
//停止画线监听
private function removeDrawLineListner():void{ drawSpace.removeEventListener(MouseEvent.MOUSE_MOVE,doDrawLine);
drawSpace.removeEventListener(MouseEvent.MOUSE_UP,stopDrawLineAndRemove);
for each(var child:Object in drawSpace.getChildren()){
(child as DisplayObject).removeEventListener(MouseEvent.MOUSE_UP,completeDrawLine); }
curLine=null; }
private function forward(event:MouseEvent):void{
var javaeyeUrl:URLRequest = new URLRequest("topic.html");
navigateToURL(javaeyeUrl);
}
private function createNodeforward(event:Event):void{
var javaeyeUrl:URLRequest = new URLRequest("createNode.html");
navigateToURL(javaeyeUrl);
}
private function forwardJianKong(event:MouseEvent):void{
var javaeyeUrl:URLRequest = new URLRequest("workPieChart.html");
navigateToURL(javaeyeUrl);
} ]]>
</fx:Script>
<fx:Declarations> <s:RemoteObject id="remote" destination="service" >
</s:RemoteObject>
<fx:XML id="xmldata" source="D://testNode.xml"/> </fx:Declarations> <s:BorderContainer width="100%" height="100%"> <s:VGroup x="0" y="0" width="953" height="598"> <s:Group width="100%" height="5%" >
<mx:LinkButton x="23" y="10" label="首页" click="forward(event)"/>
<mx:LinkButton x="138" y="10" label="监控图" paddingLeft="0" paddingRight="0" click="forwardJianKong(event)"/>
<mx:LinkButton x="234" y="10" label="页面"/>
</s:Group>
<s:HGroup width="100%" height="90%">
<s:Group width="100%" height="100%">
</s:Group>
<s:Group width="458" height="533">
<mx:Canvas id="drawSpace" x="-467" y="-1" width="100%" height="100%"
borderVisible="false" dragDrop="dragDropHandler(event);"
dragEnter="dragEnterHandler(event);" horizontalScrollPolicy="off"
verticalScrollPolicy="off"> </mx:Canvas>
<mx:AdvancedDataGrid id="adg1" borderStyle="none" designViewDataType="flat" sortExpertMode="true" sortableColumns="true" width="100%" height="100%">
<mx:dataProvider>
<mx:HierarchicalData id="hd" source="{str.node}"/>
</mx:dataProvider>
<mx:groupedColumns> <mx:AdvancedDataGridColumnGroup headerText="节点统计" >
<mx:AdvancedDataGridColumn headerText="序号 " dataField="@id"/>
<mx:AdvancedDataGridColumn headerText="节点名称" dataField="@source" /> <mx:AdvancedDataGridColumn headerText="提供数据" dataField="@x"/>
<mx:AdvancedDataGridColumn headerText="使用数据" dataField="@y"/>
</mx:AdvancedDataGridColumnGroup>
</mx:groupedColumns>
</mx:AdvancedDataGrid>
</s:Group>
</s:HGroup> </s:VGroup>
</s:BorderContainer> </s:Application>
版权声明:本文博主原创文章,博客,未经同意不得转载。
flex4 一些项目使用的技术的更多相关文章
- atitit 商业项目常用模块技术知识点 v3 qc29
atitit 商业项目常用模块技术知识点 v3 qc29 条码二维码barcodebarcode 条码二维码qrcodeqrcode 条码二维码dm码生成与识别 条码二维码pdf147码 条码二维码z ...
- p2p网贷项目开发全过程技术详解,应用框架是ci2.2
p2p网贷项目开发全过程技术详解,应用框架是ci2.2 很标准的mvc开发代码,代码也很简单,方便二次开发 这篇文章会不断更新
- 1-1 课程导学 & 1-2 项目需求分析,技术分解.
1-1 课程导学 1-2 项目需求分析,技术分解. 要有一定的dart基础,了解安卓和ios的一些普通的开发
- 【SSM之旅】Spring+SpringMVC+MyBatis+Bootstrap整合基础篇(一)项目简介及技术选型相关介绍
试水 一直想去搭建个自己的个人博客,苦于自己的技术有限,然后也个人也比较懒散.想动而不能动,想动而懒得动,就这么一直拖到了现在.总觉得应该把这几年来的所学总结一番,这样才能有所成长. 不知在何时,那就 ...
- Spring+SpringMVC+MyBatis+easyUI整合基础篇(一)项目简述及技术选型介绍
作者:13GitHub:https://github.com/ZHENFENG13版权声明:本文为原创文章,未经允许不得转载. 萌芽阶段 很久之前就开始打算整理一下自己的技术博客了,由于各种原因(借口 ...
- vue项目使用websocket技术
一.为什么需要websocket? 前端和后端的交互模式最常见的就是前端发数据请求,从后端拿到数据后展示到页面中.如果前端不做操作,后端不能主动向前端推送数据,这也是http协议的缺陷. 因此,一种新 ...
- CNBlog客户端--项目介绍以及技术选型
项目背景 由于现在开始在博客园写博客,再加上我是android程序员!所以呢,就自然而然的想到自己开发一个自己认为"美"的客户端!!其实还有个原因就是最近我比较闲!!纯属自己给自己 ...
- Android项目中JNI技术生成并调用.so动态库实现详解
生成 jni方式有两种:一种是通过SWIG从C++代码生成过度的java代码:另一种是通过javah的方式从java代码自动生成过度的C++代码.两种方式下的步骤流程正好相反. 第一种方式:由于需要配 ...
- 项目兼容ie8技术要点
好久没有写博客了,因为最近公司项目要调ie8兼容,一直在忙这事,终于竣工了,跟大家分享下这老掉牙的浏览器是如何搞定的...本人新手一枚,欢迎大家指教 项目是使用的jeecg框架,后台使用的java,前 ...
随机推荐
- Spark中的Scheduler
Spark中的Scheduler scheduler分成两个类型.一个是TaskScheduler与事实上现,一个是DAGScheduler. TaskScheduler:主要负责各stage中传入的 ...
- THashMD5,THashSHA1,THashBobJenkins,TIdHashMessageDigest5的用法
[delphi] view plain copy unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils ...
- hdu 4963(中途相遇法)
题目链接:Dividing a String 题意:给定一个2*n(n<=20)的字符串及每个位置的字符包含的权重,求将该字符串分成两个子序列S1.T1,要求S1=T1且abs(weight1- ...
- hdu 2842 Chinese Rings
点击打开hdu2842 思路: 矩阵快速幂 分析: 1 题目的意思是给定n个环,和一些规则要把所有的环全部拆下最少需要的步数 2 题目规定如果要拆第n个环,那么第n-1个要挂着,n-2环要被拆下.那么 ...
- listview改变选中行字体颜色
[android]listview改变选中行字体颜色 目标:选中item,其字体设置为#3197FF,未选中的,其字体为#FFFFFF 与listvew设置选中行item背景图片一样,使用select ...
- 飘逸的python - yield简明教程
发现还有非常多人对yield不理解,云里雾里,于是试着用文字表述. 仅仅要函数含有yield语句,它就返回一个生成器.所以我们与其把其看成函数定义,不如看作是生成器定义.函数用return返回,而生成 ...
- [Network]Wireless and Mobile
Wireless 1 Introduction 1.1 Elements 1. Wireless Hosts Wireless does not mean mobility. 2. Base Stat ...
- POJ 4003 Bob’s Race && HDU4123 Bob’s Race (dfs+rmq)
Bob’s Race Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 378 Accepted: 119 Descript ...
- poj 动态规划的主题列表和总结
此文转载别人,希望自己可以做完这些题目. 1.POJ动态规划题目列表 easy:1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, ...
- httpd的简单配置(转)
一般网站都采用httpd作web服务器提供web页面,本文主要介绍下几个httpd中常用的配置属性和配置方式,当然具体应用更具具体需求来定. 代理模块配置: 由于网页动态化,网页的生成基本代理到后端服 ...