当前位置: 首页 > 编程日记 > 正文

AS3版本的MaxRects算法测试

早上,在微博发现一条信息,关于MaxRects算法的,@杜增强DzQ 移植的关于AS3版本的MaxRects算法,具体地址是:http://www.duzengqiang.com/blog/post/971.html

代码如下:

/*
Based on the Public Domain MaxRectanglesBinPack.cpp source by Jukka Jylänki
https://github.com/juj/RectangleBinPack/Based on C# port by Sven Magnus 
http://unifycommunity.com/wiki/index.php?title=MaxRectanglesBinPackPorted to ActionScript3 by DUZENGQIANG
http://www.duzengqiang.com/blog/post/971.html
This version is also public domain - do whatever you want with it.
*/package
{import flash.geom.Rectangle;/***  MaxRectanglesBinPack*  @author DUZENGQIANG*  @date Jun 7, 2012*  @version 1.0*  <p>SinaMicroBlog: http://weibo.com/duzengqiang</p>*  <p>blog: http://www.duzengqiang.com</p>*/public class MaxRectsBinPack{      public var binWidth:int = 0;public var binHeight:int = 0;public var allowRotations:Boolean = false;public var usedRectangles:Vector.<Rectangle> = new Vector.<Rectangle>();public var freeRectangles:Vector.<Rectangle> = new Vector.<Rectangle>();private var score1:int = 0; // Unused in this function. We don't need to know the score after finding the position.private var score2:int = 0;private var bestShortSideFit:int;private var bestLongSideFit:int;public function MaxRectsBinPack( width:int, height:int, rotations:Boolean = true) {init(width, height, rotations);}private function init(width:int, height:int, rotations:Boolean = true):void{if( count(width) % 1 != 0 ||count(height) % 1 != 0)throw new Error("Must be 2,4,8,16,32,...512,1024,...");binWidth = width;binHeight = height;allowRotations = rotations;var n:Rectangle = new Rectangle();n.x = 0;n.y = 0;n.width = width;n.height = height;usedRectangles.length = 0;freeRectangles.length = 0;freeRectangles.push( n );}private function count(n:Number):Number{if( n >= 2 )return count(n / 2);return n;}/*** Insert a new Rectangle * @param width* @param height* @param method* @return * */    public function insert(width:int, height:int,  method:int):Rectangle {var newNode:Rectangle  = new Rectangle();score1 = 0;score2 = 0;switch(method) {case FreeRectangleChoiceHeuristic.BestShortSideFit: newNode = findPositionForNewNodeBestShortSideFit(width, height); break;case FreeRectangleChoiceHeuristic.BottomLeftRule: newNode = findPositionForNewNodeBottomLeft(width, height, score1, score2); break;case FreeRectangleChoiceHeuristic.ContactPointRule: newNode = findPositionForNewNodeContactPoint(width, height, score1); break;case FreeRectangleChoiceHeuristic.BestLongSideFit: newNode = findPositionForNewNodeBestLongSideFit(width, height, score2, score1); break;case FreeRectangleChoiceHeuristic.BestAreaFit: newNode = findPositionForNewNodeBestAreaFit(width, height, score1, score2); break;}if (newNode.height == 0)return newNode;placeRectangle(newNode);trace(newNode);return newNode;}public function insert2( Rectangles:Vector.<Rectangle>, dst:Vector.<Rectangle>, method:int):void {dst.length = 0;while(Rectangles.length > 0) {var bestScore1:int = int.MAX_VALUE;var bestScore2:int = int.MAX_VALUE;var bestRectangleIndex:int = -1;var bestNode:Rectangle = new Rectangle();for(var i:int = 0; i < Rectangles.length; ++i) {var score1:int = 0;var score2:int = 0;var newNode:Rectangle = scoreRectangle(Rectangles[i].width, Rectangles[i].height, method, score1, score2);if (score1 < bestScore1 || (score1 == bestScore1 && score2 < bestScore2)) {bestScore1 = score1;bestScore2 = score2;bestNode = newNode;bestRectangleIndex = i;}}if (bestRectangleIndex == -1)return;placeRectangle(bestNode);Rectangles.splice(bestRectangleIndex,1);}}private function placeRectangle(node:Rectangle):void {var numRectanglesToProcess:int = freeRectangles.length;for(var i:int = 0; i < numRectanglesToProcess; i++) {if (splitFreeNode(freeRectangles[i], node)) {freeRectangles.splice(i,1);--i;--numRectanglesToProcess;}}pruneFreeList();usedRectangles.push(node);}private function scoreRectangle( width:int,  height:int,  method:int, score1:int, score2:int):Rectangle {var newNode:Rectangle = new Rectangle();score1 = int.MAX_VALUE;score2 = int.MAX_VALUE;switch(method) {case FreeRectangleChoiceHeuristic.BestShortSideFit: newNode = findPositionForNewNodeBestShortSideFit(width, height); break;case FreeRectangleChoiceHeuristic.BottomLeftRule: newNode = findPositionForNewNodeBottomLeft(width, height, score1,score2); break;case FreeRectangleChoiceHeuristic.ContactPointRule: newNode = findPositionForNewNodeContactPoint(width, height, score1); // todo: reversescore1 = -score1; // Reverse since we are minimizing, but for contact point score bigger is better.break;case FreeRectangleChoiceHeuristic.BestLongSideFit: newNode = findPositionForNewNodeBestLongSideFit(width, height, score2, score1); break;case FreeRectangleChoiceHeuristic.BestAreaFit: newNode = findPositionForNewNodeBestAreaFit(width, height, score1, score2); break;}// Cannot fit the current Rectangle.if (newNode.height == 0) {score1 = int.MAX_VALUE;score2 = int.MAX_VALUE;}return newNode;}/// Computes the ratio of used surface area.private function occupancy():Number {var usedSurfaceArea:Number = 0;for(var i:int = 0; i < usedRectangles.length; i++)usedSurfaceArea += usedRectangles[i].width * usedRectangles[i].height;return usedSurfaceArea / (binWidth * binHeight);}private function findPositionForNewNodeBottomLeft(width:int, height:int, bestY:int, bestX:int):Rectangle {var bestNode:Rectangle = new Rectangle();//memset(bestNode, 0, sizeof(Rectangle));
            bestY = int.MAX_VALUE;var rect:Rectangle;var topSideY:int;for(var i:int = 0; i < freeRectangles.length; i++) {rect = freeRectangles[i];// Try to place the Rectangle in upright (non-flipped) orientation.if (rect.width >= width && rect.height >= height) {topSideY = rect.y + height;if (topSideY < bestY || (topSideY == bestY && rect.x < bestX)) {bestNode.x = rect.x;bestNode.y = rect.y;bestNode.width = width;bestNode.height = height;bestY = topSideY;bestX = rect.x;}}if (allowRotations && rect.width >= height && rect.height >= width) {topSideY = rect.y + width;if (topSideY < bestY || (topSideY == bestY && rect.x < bestX)) {bestNode.x = rect.x;bestNode.y = rect.y;bestNode.width = height;bestNode.height = width;bestY = topSideY;bestX = rect.x;}}}return bestNode;}private function findPositionForNewNodeBestShortSideFit(width:int, height:int):Rectangle  {var bestNode:Rectangle = new Rectangle();//memset(&bestNode, 0, sizeof(Rectangle));
            bestShortSideFit = int.MAX_VALUE;bestLongSideFit = score2;var rect:Rectangle;var leftoverHoriz:int;var leftoverVert:int;var shortSideFit:int;var longSideFit:int;for(var i:int = 0; i < freeRectangles.length; i++) {rect = freeRectangles[i];// Try to place the Rectangle in upright (non-flipped) orientation.if (rect.width >= width && rect.height >= height) {leftoverHoriz = Math.abs(rect.width - width);leftoverVert = Math.abs(rect.height - height);shortSideFit = Math.min(leftoverHoriz, leftoverVert);longSideFit = Math.max(leftoverHoriz, leftoverVert);if (shortSideFit < bestShortSideFit || (shortSideFit == bestShortSideFit && longSideFit < bestLongSideFit)) {bestNode.x = rect.x;bestNode.y = rect.y;bestNode.width = width;bestNode.height = height;bestShortSideFit = shortSideFit;bestLongSideFit = longSideFit;}}var flippedLeftoverHoriz:Number;var flippedLeftoverVert:Number;var flippedShortSideFit:Number;var flippedLongSideFit:Number;if (allowRotations && rect.width >= height && rect.height >= width) {flippedLeftoverHoriz = Math.abs(rect.width - height);flippedLeftoverVert = Math.abs(rect.height - width);flippedShortSideFit = Math.min(flippedLeftoverHoriz, flippedLeftoverVert);flippedLongSideFit = Math.max(flippedLeftoverHoriz, flippedLeftoverVert);if (flippedShortSideFit < bestShortSideFit || (flippedShortSideFit == bestShortSideFit && flippedLongSideFit < bestLongSideFit)) {bestNode.x = rect.x;bestNode.y = rect.y;bestNode.width = height;bestNode.height = width;bestShortSideFit = flippedShortSideFit;bestLongSideFit = flippedLongSideFit;}}}return bestNode;}private function findPositionForNewNodeBestLongSideFit(width:int, height:int, bestShortSideFit:int, bestLongSideFit:int):Rectangle {var bestNode:Rectangle = new Rectangle();//memset(&bestNode, 0, sizeof(Rectangle));bestLongSideFit = int.MAX_VALUE;var rect:Rectangle;var leftoverHoriz:int;var leftoverVert:int;var shortSideFit:int;var longSideFit:int;for(var i:int = 0; i < freeRectangles.length; i++) {rect = freeRectangles[i];// Try to place the Rectangle in upright (non-flipped) orientation.if (rect.width >= width && rect.height >= height) {leftoverHoriz = Math.abs(rect.width - width);leftoverVert = Math.abs(rect.height - height);shortSideFit = Math.min(leftoverHoriz, leftoverVert);longSideFit = Math.max(leftoverHoriz, leftoverVert);if (longSideFit < bestLongSideFit || (longSideFit == bestLongSideFit && shortSideFit < bestShortSideFit)) {bestNode.x = rect.x;bestNode.y = rect.y;bestNode.width = width;bestNode.height = height;bestShortSideFit = shortSideFit;bestLongSideFit = longSideFit;}}if (allowRotations && rect.width >= height && rect.height >= width) {leftoverHoriz = Math.abs(rect.width - height);leftoverVert = Math.abs(rect.height - width);shortSideFit = Math.min(leftoverHoriz, leftoverVert);longSideFit = Math.max(leftoverHoriz, leftoverVert);if (longSideFit < bestLongSideFit || (longSideFit == bestLongSideFit && shortSideFit < bestShortSideFit)) {bestNode.x = rect.x;bestNode.y = rect.y;bestNode.width = height;bestNode.height = width;bestShortSideFit = shortSideFit;bestLongSideFit = longSideFit;}}}trace(bestNode);return bestNode;}private function findPositionForNewNodeBestAreaFit(width:int, height:int, bestAreaFit:int, bestShortSideFit:int):Rectangle {var bestNode:Rectangle = new Rectangle();//memset(&bestNode, 0, sizeof(Rectangle));
            bestAreaFit = int.MAX_VALUE;var rect:Rectangle;var leftoverHoriz:int;var leftoverVert:int;var shortSideFit:int;var areaFit:int;for(var i:int = 0; i < freeRectangles.length; i++) {rect = freeRectangles[i];areaFit = rect.width * rect.height - width * height;// Try to place the Rectangle in upright (non-flipped) orientation.if (rect.width >= width && rect.height >= height) {leftoverHoriz = Math.abs(rect.width - width);leftoverVert = Math.abs(rect.height - height);shortSideFit = Math.min(leftoverHoriz, leftoverVert);if (areaFit < bestAreaFit || (areaFit == bestAreaFit && shortSideFit < bestShortSideFit)) {bestNode.x = rect.x;bestNode.y = rect.y;bestNode.width = width;bestNode.height = height;bestShortSideFit = shortSideFit;bestAreaFit = areaFit;}}if (allowRotations && rect.width >= height && rect.height >= width) {leftoverHoriz = Math.abs(rect.width - height);leftoverVert = Math.abs(rect.height - width);shortSideFit = Math.min(leftoverHoriz, leftoverVert);if (areaFit < bestAreaFit || (areaFit == bestAreaFit && shortSideFit < bestShortSideFit)) {bestNode.x = rect.x;bestNode.y = rect.y;bestNode.width = height;bestNode.height = width;bestShortSideFit = shortSideFit;bestAreaFit = areaFit;}}}return bestNode;}/// Returns 0 if the two intervals i1 and i2 are disjoint, or the length of their overlap otherwise.private function commonIntervalLength(i1start:int, i1end:int, i2start:int, i2end:int):int {if (i1end < i2start || i2end < i1start)return 0;return Math.min(i1end, i2end) - Math.max(i1start, i2start);}private function contactPointScoreNode(x:int, y:int, width:int, height:int):int {var score:int = 0;if (x == 0 || x + width == binWidth)score += height;if (y == 0 || y + height == binHeight)score += width;var rect:Rectangle;for(var i:int = 0; i < usedRectangles.length; i++) {rect = usedRectangles[i];if (rect.x == x + width || rect.x + rect.width == x)score += commonIntervalLength(rect.y, rect.y + rect.height, y, y + height);if (rect.y == y + height || rect.y + rect.height == y)score += commonIntervalLength(rect.x, rect.x + rect.width, x, x + width);}return score;}private function findPositionForNewNodeContactPoint(width:int, height:int, bestContactScore:int):Rectangle {var bestNode:Rectangle = new Rectangle();//memset(&bestNode, 0, sizeof(Rectangle));
            bestContactScore = -1;var rect:Rectangle;var score:int;for(var i:int = 0; i < freeRectangles.length; i++) {rect = freeRectangles[i];// Try to place the Rectangle in upright (non-flipped) orientation.if (rect.width >= width && rect.height >= height) {score = contactPointScoreNode(rect.x, rect.y, width, height);if (score > bestContactScore) {bestNode.x = rect.x;bestNode.y = rect.y;bestNode.width = width;bestNode.height = height;bestContactScore = score;}}if (allowRotations && rect.width >= height && rect.height >= width) {score = contactPointScoreNode(rect.x, rect.y, height, width);if (score > bestContactScore) {bestNode.x = rect.x;bestNode.y = rect.y;bestNode.width = height;bestNode.height = width;bestContactScore = score;}}}return bestNode;}private function splitFreeNode(freeNode:Rectangle, usedNode:Rectangle):Boolean {// Test with SAT if the Rectangles even intersect.if (usedNode.x >= freeNode.x + freeNode.width || usedNode.x + usedNode.width <= freeNode.x ||usedNode.y >= freeNode.y + freeNode.height || usedNode.y + usedNode.height <= freeNode.y)return false;var newNode:Rectangle;if (usedNode.x < freeNode.x + freeNode.width && usedNode.x + usedNode.width > freeNode.x) {// New node at the top side of the used node.if (usedNode.y > freeNode.y && usedNode.y < freeNode.y + freeNode.height) {newNode = freeNode.clone();newNode.height = usedNode.y - newNode.y;freeRectangles.push(newNode);}// New node at the bottom side of the used node.if (usedNode.y + usedNode.height < freeNode.y + freeNode.height) {newNode = freeNode.clone();newNode.y = usedNode.y + usedNode.height;newNode.height = freeNode.y + freeNode.height - (usedNode.y + usedNode.height);freeRectangles.push(newNode);}}if (usedNode.y < freeNode.y + freeNode.height && usedNode.y + usedNode.height > freeNode.y) {// New node at the left side of the used node.if (usedNode.x > freeNode.x && usedNode.x < freeNode.x + freeNode.width) {newNode = freeNode.clone();newNode.width = usedNode.x - newNode.x;freeRectangles.push(newNode);}// New node at the right side of the used node.if (usedNode.x + usedNode.width < freeNode.x + freeNode.width) {newNode = freeNode.clone();newNode.x = usedNode.x + usedNode.width;newNode.width = freeNode.x + freeNode.width - (usedNode.x + usedNode.width);freeRectangles.push(newNode);}}return true;}private function pruneFreeList():void {for(var i:int = 0; i < freeRectangles.length; i++)for(var j:int = i+1; j < freeRectangles.length; j++) {if (isContainedIn(freeRectangles[i], freeRectangles[j])) {freeRectangles.splice(i,1);break;}if (isContainedIn(freeRectangles[j], freeRectangles[i])) {freeRectangles.splice(j,1);}}}private function isContainedIn(a:Rectangle, b:Rectangle):Boolean {return a.x >= b.x && a.y >= b.y && a.x+a.width <= b.x+b.width && a.y+a.height <= b.y+b.height;}}}
package
{public class FreeRectangleChoiceHeuristic {public static const BestShortSideFit:int = 0; ///< -BSSF: Positions the Rectangle against the short side of a free Rectangle into which it fits the best.public static const BestLongSideFit:int = 1; ///< -BLSF: Positions the Rectangle against the long side of a free Rectangle into which it fits the best.public static const BestAreaFit:int = 2; ///< -BAF: Positions the Rectangle into the smallest free Rectangle into which it fits.public static const BottomLeftRule:int = 3; ///< -BL: Does the Tetris placement.public static const ContactPointRule:int = 4; ///< -CP: Choosest the placement where the Rectangle touches other Rectangles as much as possible.
    }
}

好奇,做了个测试,代码如下:

package
{import flash.display.Bitmap;import flash.display.BitmapData;import flash.display.Sprite;import flash.geom.Point;import flash.geom.Rectangle;[SWF(width="800", height="600", frameRate="30")]public class Demo extends Sprite{[Embed(source="assets/1.png")]private var defence:Class;public function Demo(){var bitmap:Bitmap = Bitmap(new defence());trace(bitmap.width, bitmap.height);//Create new MaxRectsBinPack instancevar maxRect:MaxRectsBinPack = new MaxRectsBinPack(bitmap.width,bitmap.height,false);// insert new rectangle//maxRect.insert(bitmap.width/2, bitmap.height/2, FreeRectangleChoiceHeuristic.BestLongSideFit);// insert new rectangle//maxRect.insert(bitmap.width/2, bitmap.height/2, FreeRectangleChoiceHeuristic.BestLongSideFit);// insert new rectangle//maxRect.insert(bitmap.width/2, bitmap.height/2, FreeRectangleChoiceHeuristic.BestLongSideFit);// insert new rectangle//maxRect.insert(bitmap.width/2, bitmap.height/2, FreeRectangleChoiceHeuristic.BestLongSideFit);var rects:Vector.<Rectangle> = new Vector.<Rectangle>();rects.push(new Rectangle(0,0,bitmap.width/2, bitmap.height/2));rects.push(new Rectangle(0,0,bitmap.width/2, bitmap.height/2));rects.push(new Rectangle(0,0,bitmap.width/2, bitmap.height/2));rects.push(new Rectangle(0,0,bitmap.width/2, bitmap.height/2));maxRect.insert2(rects, new Vector.<Rectangle>(), FreeRectangleChoiceHeuristic.BestLongSideFit);for(var i:int = 0; i < maxRect.usedRectangles.length; i++) {var rect:Rectangle = maxRect.usedRectangles[i];trace(rect);var bitmapData:BitmapData = new BitmapData(rect.width, rect.height, true, 0);bitmapData.copyPixels(bitmap.bitmapData, rect, new Point());var newBitmap:Bitmap = new Bitmap(bitmapData);newBitmap.x = rect.x;newBitmap.y = rect.y;this.addChild(newBitmap);}}}
}

图片用的我们游戏里的,正面2帧,背面2帧,嘿嘿

有几个疑问:

首先,图片要求是2的次幂,如果有的图片,做成影片剪辑时,是3帧,如果能满足 2的次幂的结果是3的倍数呢?这里,我认为有一种方案,可以通过每一帧的偏移量来做,而不是非要3的倍数,不知道这样理解对不对?

其次,这个图片的空白区域,不知道用@杜增强DzQ提供的工具类里,是否带透明部分的自动裁剪。

最后,我试了下面几种方法,但是没感觉到有什么区别,不知道能不能帮忙解答下,非常感谢。

    public class FreeRectangleChoiceHeuristic {public static const BestShortSideFit:int = 0; ///< -BSSF: Positions the Rectangle against the short side of a free Rectangle into which it fits the best.public static const BestLongSideFit:int = 1; ///< -BLSF: Positions the Rectangle against the long side of a free Rectangle into which it fits the best.public static const BestAreaFit:int = 2; ///< -BAF: Positions the Rectangle into the smallest free Rectangle into which it fits.public static const BottomLeftRule:int = 3; ///< -BL: Does the Tetris placement.public static const ContactPointRule:int = 4; ///< -CP: Choosest the placement where the Rectangle touches other Rectangles as much as possible.}

转载于:https://www.cnblogs.com/yourihua/archive/2012/06/19/2554687.html

相关文章:

android 52 粘滞广播

粘滞广播&#xff1a;广播发送出去以后&#xff0c;广播接收者还没有创建&#xff0c;当广播接收者注册的时候就可以接收&#xff0c;如果不是粘滞广播则如果没有广播接收者就以后不能再接收了。 mainActivity: package com.sxt.day07_07;import android.app.Activity; import …

【蓝桥杯】【入门题】【算法提高VIP】1481:剪刀石头布

题目 1481&#xff1a;剪刀石头布 蓝桥杯刷题群已成立&#xff0c;微信后台回复【蓝桥杯】&#xff0c;即可进入。 如果加入了之前的社群不需要重复加入。 时间限制: 1Sec 内存限制: 128MB 1. 题目描述 编写程序实现“剪刀&#xff0c;石头&#xff0c;布”游戏。在这个游戏中…

UI设计培训学习中必须掌握的设计原则

不管是刚开始学习UI设计或者已经在学习UI设计同学中&#xff0c;UI设计的设计原则都是非常重要的&#xff0c;需要大家去重点关注的&#xff0c;下面小编就为大家详细的介绍一下UI设计培训学习中必须掌握的设计原则。 UI设计培训学习中必须掌握的设计原则&#xff1a; 重复 在平…

【复盘】如何培养小朋友的编程能力?

Scratch家长群已成立&#xff0c;微信后台回复【Scratch家长群】&#xff0c;即可进入。 如果加入了之前的社群不需要重复加入。 前几天&#xff0c;我在得到听了 邵慧宁的故事&#xff0c;就想着把游戏化的思维应用于培养自己孩子的编程能力上&#xff0c;并邀请志同道合的家长…

ubuntu系统下载编译android源码

在ubuntu系统下编译android需要注意的事项&#xff1a;1. 参考http://source.android.com/中的安装说明。2. 安装JDK6中碰到的问题可以参考http://hi.baidu.com/designhouse/item/0dbece7c4f6af0376e29f6c1中的说明&#xff0c;记得配置环境变量。3. 下载代码时如果出现timeout…

[windows server 2008 站点系列五]一招加速域用戶的文件查找速度

在企业IT基础环境中&#xff0c;文件服务器的应用越来越平凡&#xff0c;而文件服务器的数量也随之增多。作为IT应用人员习惯性的从管理者的角度出发&#xff0c;找寻DFS等帮助简化管理维护的解决方案。但是&#xff0c;另一方面&#xff0c;企业用户往往很难在为数众多的文件服…

在web.xml文件中配置Servlet时,主要配置哪些信息?

web前端的学习内容是比较多的&#xff0c;其中有一部分就是关于在web.xml文件中配置Servlet时的相关内容&#xff0c;在web.xml文件中配置Servlet时&#xff0c;主要配置哪些信息?来看看下面的详细介绍。 使用IDE开发Servlet时&#xff0c;配置信息可以通过可视化方式定义。然…

Oracle Study之--ORA-12537(TNS:connection closed) 错误案例

系统环境&#xff1a; 操作系统&#xff1a;RedHat EL55 Cluster&#xff1a; Oracle 11gR2 GRID Oracle&#xff1a; Oracle 11gR2 在构建Oracle 11gR2 RAC时出现以下错误&#xff1a; 1、建库时 2、Listener 日志信息 3、客户端连接错误信息 解决方案&#xff1a; 123456789…

MEF: MSDN 杂志上的文章(9) 控制部件创建策略 ???

http://msdn.microsoft.com/zh-cn/magazine/ee291628.aspx 默认情况下&#xff0c;容器中的所有部件实例都是单例&#xff0c;因而由在容器中导入它们的所有部件共享。因此&#xff0c;SalesOrderView 和 ViewFactory 的所有导入程序都将获得同一实例。在很多情况下需要这样&am…

【青少年编程】绘制等腰直角三角形

Scratch竞赛交流群已成立&#xff08;适合6至18周岁的青少年&#xff09;&#xff0c;公众号后台回复【Scratch】&#xff0c;即可进入。 如果加入了之前的社群不需要重复加入。 类比思维就是指把两个或者两类事物进行比较&#xff0c;并进行逻辑推理&#xff0c;找出两者之间的…

考PMP证书一定要参加PMP培训吗?

​ 考PMP证书一定要参加PMP培训吗?这是目前很多想要考pmp认证的小伙伴比较关心的一个问题&#xff0c;小编可以肯定的回答大家&#xff0c;当然需要参加&#xff0c;具体来看看下面的详细介绍。 考PMP证书一定要参加PMP培训吗?当然要&#xff0c;PMP考试要接受PMO授权许可培训…

Apache+PHP in MAC

是以为记&#xff0c;当前OSX下的ApachePHP配置。我的配置跟这篇文章应该一样&#xff1a;http://www.ccvita.com/398.htmlApache重启&#xff1a; apachectl restart|start|stopApache配置文件&#xff1a; /etc/apache2/httpd.conf (php5在这里开启&#xff09;Apache虚拟主机…

【青少年编程】绘制五角星

Scratch竞赛交流群已成立&#xff08;适合6至18周岁的青少年&#xff09;&#xff0c;公众号后台回复【Scratch】&#xff0c;即可进入。 如果加入了之前的社群不需要重复加入。 类比思维就是指把两个或者两类事物进行比较&#xff0c;并进行逻辑推理&#xff0c;找出两者之间的…

Kafka 消息监控 - Kafka Eagle

1.概述 在开发工作当中&#xff0c;消费 Kafka 集群中的消息时&#xff0c;数据的变动是我们所关心的&#xff0c;当业务并不复杂的前提下&#xff0c;我们可以使用 Kafka 提供的命令工具&#xff0c;配合 Zookeeper 客户端工具&#xff0c;可以很方便的完成我们的工作。随着业…

java开发培训好学习吗?难度大不大?

​ 互联网快速的发展&#xff0c;不断的在进行变革和更新&#xff0c;越来越多的人都对这个行业充满向往&#xff0c;很多人都想要学习java技术&#xff0c;那么java开发培训好学习吗?难度大不大?来看看下面的详细介绍。 java开发培训好学习吗?难度大不大?首先&#xff0c;…

gdb 调试动态库

原文链接 cat get.h int get (); int set (int a); cat get.c #include <stdio.h> #include "get.h" static int x0; int get () { printf ( "get x%d\n ", x); return x; } int set (int a) { printf …

【青少年编程】【一级】森林的一天

Scratch竞赛交流群已成立&#xff08;适合6至18周岁的青少年&#xff09;&#xff0c;公众号后台回复【Scratch】&#xff0c;即可进入。 如果加入了之前的社群不需要重复加入。 微信后台回复“资料下载”可获取该程序的代码。 森林的一天 1. 准备工作 &#xff08;1&#xf…

Visual Studio Extensions for SharePoint v1.1

下载Visual Studio Extensions for SharePoint v1.1User Guide1、此版本&#xff08;1.1&#xff09;稍后会发布中文版2、此版本仍然只支持Visual Studio 20053、此版本仍然必须安装在包含了SharePoint Server&#xff08;或WSS&#xff09;、Visual Studio的机器上4、下个版本…

零基础学Java需要做哪些准备

想要成为一名合格的java工程师&#xff0c;那么好好学习java技术是非常重要的&#xff0c;对于零基础同学们来说&#xff0c;大家比较关注的就是“零基础学Java需要做哪些准备”这个问题&#xff0c;下面小编就来为大家做下详细的介绍。 零基础学Java需要做哪些准备? 1.制定学…

C# 启动外部程序的几种方法

C# 启动外部程序的几种方法&#xff1a; 1. 启动外部程序&#xff0c;不等待其退出。 2. 启动外部程序&#xff0c;等待其退出。 3. 启动外部程序&#xff0c;无限等待其退出。 4. 启动外部程序&#xff0c;通过事件监视其退出。 // using System.Diagnostics; private string…

在Mac和Linux之间用Rsync 拷贝文件

因为公司的苹果服务器是物理机&#xff0c;所以备份一直是个问题。Backup Exec 2012 勉强能工作&#xff0c;但是速度和可靠性一直都被我们所诟病。最后&#xff0c;老板决定把所有的数据copy到linux的共享文件夹&#xff0c;然后用Veeam 备份。 *IX系统里面说起拷贝&#xff0…

【复盘】升级打怪第一关,冲啊!

Scratch竞赛交流群已成立&#xff08;适合6至18周岁的青少年&#xff09;&#xff0c;公众号后台回复【Scratch】&#xff0c;即可进入。如果加入了之前的社群不需要重复加入。 微信后台回复“资料下载”可获取以往学习的材料&#xff08;视频、代码、文档&#xff09;。 利用游…

在Java中是如何定义和声明接口的?

java技术需要学习的内容有很多&#xff0c;本期小编整理的教程资料就是关于“在Java中是如何定义和声明接口的?”的内容&#xff0c;希望下面的介绍能够给大家带来帮助。 如果一个抽象类的所有方法都是抽象的&#xff0c;则可以定义这个类为接口。接口是Java中最重要的概念之一…

Android--SQLite(一)

Android系统集成了一个轻量级的数据库&#xff1a;SQLite&#xff0c;SQLite是一个嵌入式的数据库引擎&#xff0c;专门适用于资源有限的设备上&#xff08;手机、PDA&#xff09;的适量数据存储。 Android提供了SQLiteDatabase&#xff0c;它代表了一个SQLite数据库&#xff0…

pku 3422 Kaka's Matrix Travels 最大费用最大流

http://poj.org/problem?id3422 /* 题意&#xff1a;给定一个n*n的矩形方格&#xff0c;要求从&#xff08;1,1&#xff09;出发&#xff0c;只能往右下角走&#xff0c;(i 1,j) 或者 &#xff08;i n,j&#xff09;每次走完将格子里面的数累加&#xff0c;并将所走过的格子…

【青少年编程】全国青少年软件编程等级考试大纲与说明(Scratch)

Scratch竞赛交流群已成立&#xff08;适合6至18周岁的青少年&#xff09;&#xff0c;公众号后台回复【Scratch】&#xff0c;即可进入。如果加入了之前的社群不需要重复加入。 后台回复 资料下载 可获取该考试大纲与说明的PDF版本。

前端中的this,指的是什么?

想要学习前端&#xff0c;短时间内是比较困难的&#xff0c;web前端要学习的内容有很多&#xff0c;今天小编就为大家详细的介绍一下前端中的this&#xff0c;指的是什么?来看看下面的详细介绍。 前端中的this&#xff0c;指的是什么? 1.this是什么 this 是 JavaScript 中的一…

在SQLserver数据库里设置作业的步骤

在SQLserver数据库里设置作业&#xff08;对数据库的表定期进行数据清理&#xff09;的步骤 1.首先&#xff0c;要打开sql server代理的服务&#xff0c;在我的电脑&#xff0c;右键管理的服务打开&#xff0c;SQL Server 代理 (MSSQLSERVER)这个服务一定要打开。2.打开数据库&…

tomcat环境部署

1、java安装 #java env export JAVA_HOME/usr/local/src/jdk1.8.0_162 export JRE_HOME$JAVA_HOME/jre export PATH$JAVE_HOME/bin:$JAVA_HOME/bin:$PATH export CLASSPATH.:$JAVA_HOME/lib:$JAVA_HOME/lib 2、下载tomcat wget http://mirrors.shu.edu.cn/apache/tomcat/tomcat…

【青少年编程】【一级】舞者凯希

Scratch竞赛交流群已成立&#xff08;适合6至18周岁的青少年&#xff09;&#xff0c;公众号后台回复【Scratch】&#xff0c;即可进入。如果加入了之前的社群不需要重复加入。 微信后台回复“资料下载”可获取以往学习的材料&#xff08;视频、代码、文档&#xff09;。 舞者凯…