unity3d导出pdf
unity生成pdf格式,首先需要导入iTextSharp.dll ,下面是我写的一些方法,可以直接用.直接贴代码,
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using iTextSharp.text.pdf;
using iTextSharp.text;
using System.Text.RegularExpressions;
using System.Data.OracleClient;
using System; //需要用到的数据结构
public class PdfUserInformation
{
public string goodsName;
public string youzhanType;
public string cvsLevel;
public string writeTime;
public string creater;
public string creatTime;
};
//数据结构
public class PdfInformation
{
public string mID;
public string mName;
public string mReserve;
// ....
}; public class PDFMakerManager { public static PDFMakerManager PDFInstance;
public static PDFMakerManager createPDFMakerManager()
{
if(PDFInstance==null)
{
PDFInstance = new PDFMakerManager ();
} return PDFInstance;
} //获取物品的子物体名字 通过子物体的名字获取物体 返回物体的链表
public List<PdfInformation> getObjChildsName(Transform mParentObj)
{ if(mParentObj!=null)
{
List<string> mChildObjs = new List<string>();
List<PdfInformation> mInfoList = new List<PdfInformation>();
foreach (Transform mChildTransform in mParentObj)
{
mChildObjs.Add(mChildTransform.gameObject.name);
Debug.Log(mChildTransform.gameObject.name);
}
//获取 数据库 信息
getPdfDatasFromDB();
//通过子物体的名字 获取物体信息
for (int i = 0; i < mChildObjs.Count; i++)
{
mInfoList.Add(mDirectoryData[mChildObjs[i]]);
}
return mInfoList;
}
return null;
}
//每行五个 还有问题,由于需求以及时间关系,没时间去管了 谁看到了可以帮忙解决下,.thanks
List<PdfInformation> mGoodsInfoList = new List<PdfInformation>();
public List<List<PdfInformation>> getAllGoods(List<PdfInformation> mList)
{
List<List<PdfInformation>> mGoodsAll = new List<List<PdfInformation>>();
List<List<PdfInformation>> mGoods = new List<List<PdfInformation>>(); for (int i = 1; i <= mList.Count;i++ )
{
mGoodsInfoList.Add(mList[i-1]); if(i%5==0)
{ mGoodsAll.Add(mGoodsInfoList);
Debug.Log("xx"+mGoodsInfoList.Count);
mGoodsInfoList.Clear(); for (int j = 0; j < mGoodsAll.Count; j++)
{
Debug.Log("InfoList [[[" + j + "]]]is:" + mGoodsAll[j].Count);
} }else if(i%5!=0&&i==mList.Count)
{
mGoodsAll.Add(mGoodsInfoList);
mGoodsInfoList.Clear();
}
}
Debug.Log("InfoList [[[is:" + mGoodsAll.Count);
//for (int j = 0; j < mGoodsAll.Count;j++ )
//{
// Debug.Log("InfoList [[[" + j + "]]]is:" + mGoodsAll[j].Count);
//} return mGoodsAll;
}
//从数据库 获取 PDF 信息
Dictionary<string, PdfInformation> mDirectoryData = new Dictionary<string, PdfInformation>();
public List<PdfInformation> getPdfDatasFromDB()
{
List<PdfInformation> mInfoList = new List<PdfInformation>(); Oracle mDB = new Oracle ();
try
{
string mSearch = "select * from mdb";
mInfoList = mDB.Select(mSearch);
mDirectoryData = mDB.getPdfDictionary();
}catch(Exception e)
{
mDB.Close();
Debug.Log("sql error");
}
return mInfoList;
} // / pdf 行
public PdfPTable CreateRankGoodsInforMationTable(List<List<PdfInformation>> mList)
{
PdfPTable mTable=new PdfPTable(1); mTable.SetTotalWidth(new float[]{300}); mTable.HorizontalAlignment = PdfPTable.LINECANVAS; if(mList.Count>0)
{
for(int i=0;i<mList.Count;i++)
{
Debug.Log("xx"+i+"xxxxxx:"+mList[i].Count);
// mTable.AddCell(CreateCell(CreateRowGoodsInforMationTable2(mList[i]),-1,0));
} } mTable.LockedWidth = true;
return mTable;
}
//
//pdf 列
PdfPTable CreateRowGoodsInforMationTable2(System.Collections.Generic.List<PdfInformation> mList)
{
PdfPTable mTable =new PdfPTable (mList.Count);
System.Collections.Generic.List<float> Width = new System.Collections.Generic.List<float> ();
if(mList.Count>0)
{
for(int i=0;i<mList.Count;i++)
{
Width.Add(80f);
}
}
float []mWidth = Width.ToArray();
mTable.HorizontalAlignment = PdfPTable.BACKGROUNDCANVAS; if (mWidth[0] != -1)
{
mTable.SetTotalWidth(mWidth);
}
mTable.LockedWidth = true;
for(int i=0;i<mList.Count;i++)
{ mTable.AddCell(CreateGoodsInformationCell(mList[i]));
}
mList.Clear();
return mTable;
} //pdf 图 暂时没用
byte[] GoodsImgPrint(Camera SmallCamera,GameObject TakeHuoJia)
{
int swidth = (int)(SmallCamera.WorldToScreenPoint(TakeHuoJia.transform.position + TakeHuoJia.renderer.bounds.size).x - SmallCamera.WorldToScreenPoint(TakeHuoJia.transform.position - TakeHuoJia.renderer.bounds.size).x); RenderTexture rt = new RenderTexture(Screen.width, resHeight, 72);
SmallCamera.pixelRect = new Rect(0, 0, Screen.width, Screen.height);
SmallCamera.targetTexture = rt;
Texture2D screenShot = new Texture2D(swidth + 100, resHeight, TextureFormat.ARGB32, false);
SmallCamera.Render();
RenderTexture.active = rt; screenShot.ReadPixels(new Rect(SmallCamera.WorldToScreenPoint(TakeHuoJia.transform.position - TakeHuoJia.renderer.bounds.size).x, 0, swidth + 100, resHeight), 0, 0);
screenShot.Apply();
SmallCamera.targetTexture = null;
RenderTexture.active = null; //
UnityEngine.Object.Destroy(rt);
byte[] bytes = screenShot.EncodeToPNG(); return bytes;
}
//打印物品详细信息 图 (左边字 右边图 分开的 ,写法一:pdf字和摄像头图)
public void PrintGoodsInformations2(string filePath, Camera mCam, GameObject mObj, PdfUserInformation mInfo)
{
Document document = new Document(new Rectangle(PageSize.A4.Height, PageSize.A4.Width));
PdfWriter.GetInstance(document, new FileStream(filePath, FileMode.Create));
document.Open(); PdfPTable tableAll = tableAll = CreateTable(2, PdfPTable.BACKGROUNDCANVAS, new float[] { document.PageSize.Width / 2 - 50, document.PageSize.Width / 2 - 50 }, true);
//
PdfPTable tableLeft = PrintGoodsInformations_Left(mInfo); Image tableRight = MakeCameraImg(mCam, 512, 512);//Image.GetInstance( GoodsImgPrint(mCam,mObj)); tableAll.AddCell(CreateCell(tableLeft, -1, 0));
tableAll.AddCell(CreateCell(tableRight, -1, 0));
document.Add(tableAll);
document.Close();
ShowTips.showTips(" 打印完成!文件保存在:" + filePath);
}
//打印物品详细信息 图 (左边字 右边图 分开的 ,写法2:摄像头全图,包括字和图)
public void PrintGoodsInformations(string filePath, Camera mCam,GameObject mObj,PdfUserInformation mInfo)
{
Document document = new Document(new Rectangle(PageSize.A4.Height, PageSize.A4.Width));
PdfWriter.GetInstance(document, new FileStream(filePath, FileMode.Create));
document.Open(); PdfPTable tableAll = CreateTable(1, PdfPTable.BACKGROUNDCANVAS, new float[] {document.PageSize.Width -100 }, true);
//
PdfPTable tableLeft = PrintGoodsInformations_Left(mInfo); Image tableRight = MakeCameraImg(mCam,680,512);//Image.GetInstance( GoodsImgPrint(mCam,mObj)); // tableAll.AddCell(CreateCell(tableLeft, -1, 0));
tableAll.AddCell(CreateCell(tableRight, -1, 0));
document.Add(tableAll);
document.Close();
ShowTips.showTips(" 打印完成!文件保存在:" + filePath);
} //打印物品详细信息 左边字 右边字
public void PrintGoodsInformations(string filePath,PdfUserInformation mInfo)
{
Document document = new Document(new Rectangle(PageSize.A4.Height,PageSize.A4.Width));
PdfWriter.GetInstance(document,new FileStream(filePath,FileMode.Create));
document.Open(); PdfPTable tableAll = CreateTable(2, PdfPTable.BACKGROUNDCANVAS, new float[] { document.PageSize.Width / 2 - 50, document.PageSize.Width / 2 - 50 }, true);
//
PdfPTable tableLeft = PrintGoodsInformations_Left(mInfo); //测试数据 ....
PdfInformation mInfo1 = new PdfInformation();
mInfo1.mName = "aaaa";
PdfInformation mInfo2 = new PdfInformation();
mInfo2.mName = "bbbbb"; List<PdfInformation> mInfoList = new List<PdfInformation>();
mInfoList.Add(mInfo1);
mInfoList.Add(mInfo2); PdfInformation mInfo3 = new PdfInformation();
mInfo3.mName = "ccccc";
PdfInformation mInfo4 = new PdfInformation();
mInfo4.mName = "ddddd"; List<PdfInformation> mInfoList2 = new List<PdfInformation>();
mInfoList2.Add(mInfo3);
mInfoList2.Add(mInfo4); List<List<PdfInformation>> mLLInfo = new List<List<PdfInformation>>();
mLLInfo.Add(mInfoList);
mLLInfo.Add(mInfoList2); //....... //测试数据 数据库数据
// List<List<PdfInformation>> mDBTestList = new List<List<PdfInformation>>();
//mDBTestList = getAllGoods(getPdfDatasFromDB()); //Debug.Log("DBList is:"+mDBTestList.Count);
//...... PdfPTable tableRight = CreateRankGoodsInforMationTable(mDBTestList);
tableRight.HorizontalAlignment = PdfPTable.BACKGROUNDCANVAS;
tableAll.AddCell(CreateCell(tableLeft, -1, 0));
tableAll.AddCell(CreateCell(tableRight,-1,0));
document.Add(tableAll);
document.Close();
ShowTips.showTips(" 打印完成!文件保存在:" + filePath); }
//详细信息的左半部分
PdfPTable PrintGoodsInformations_Left(PdfUserInformation mInfo)
{
PdfPTable tableHeaderR = CreateTable(1, PdfPTable.BACKGROUNDCANVAS, new float[] { -1 }, false);
PdfPTable tableHeaderminiR = CreateTable(2, PdfPTable.BACKGROUNDCANVAS, new float[] { 1, 3 }, false); Image mark = Image.GetInstance(Application.dataPath + "/Icon.png");
mark.ScaleAbsolute(250, 250);
mark.Alignment = Image.LEFT_BORDER;
tableHeaderminiR.AddCell(CreateCell(mark, 2, 0));//<<<<<<<<< //tableHeaderminiR.AddCell(CreateCell("商品", -1, 0, CreateFont(32, iTextSharp.text.Font.NORMAL)));//<<<<<<<<
tableHeaderminiR.AddCell(CreateCell("标题", -1, 0, CreateFont(32, iTextSharp.text.Font.NORMAL)));//<<<<<<<<
tableHeaderminiR.AddCell(CreateCell("xxx", -1, 0, CreateFont(22, iTextSharp.text.Font.NORMAL)));//<<<<<<<< PdfPTable tableDataR = CreateTable(1, PdfPTable.BACKGROUNDCANVAS, new float[] { 350 }, true);
tableDataR.AddCell(CreateCell("\n", -1, 0, CreateFont(12, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell("名称:\n", -1, -1, CreateFont(22, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell(mInfo.goodsName, -1, -1, CreateFont(20, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell("类型:\n", -1, -1, CreateFont(22, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell(mInfo.youzhanType, -1, -1, CreateFont(20, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell("级别:\n", -1, -1, CreateFont(22, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell(mInfo.cvsLevel, -1, -1, CreateFont(20, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell("时间:\n", -1, -1, CreateFont(22, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell(mInfo.writeTime, -1, -1, CreateFont(20, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell("创建者:", -1, -1, CreateFont(22, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell(mInfo.creater, -1, -1, CreateFont(20, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell("创建时间:\n", -1, -1, CreateFont(22, iTextSharp.text.Font.NORMAL)));
tableDataR.AddCell(CreateCell(mInfo.creatTime, -1, -1, CreateFont(20, iTextSharp.text.Font.NORMAL)));
tableHeaderR.AddCell(CreateCell(tableHeaderminiR, -1, 0));//<<<<<<<<
tableHeaderR.AddCell(CreateCell(tableDataR, -1, 0)); return tableHeaderR;
} //把摄像头视野 制作成png图片
private Rect CutRect = new Rect(0, 0, 1, 1);
private int resWidth = 710;
private int resHeight = 512;
private Image MakeCameraImg(Camera mCam,int width,int height)
{
Image mImage;
RenderTexture rt = new RenderTexture(width, height, 2);
mCam.pixelRect = new Rect(0, 0, Screen.width, Screen.height);
mCam.targetTexture = rt;
Texture2D screenShot = new Texture2D((int)(width * CutRect.width), (int)(height * CutRect.height),
TextureFormat.RGB24, false);
mCam.Render();
RenderTexture.active = rt;
screenShot.ReadPixels(new Rect(width * CutRect.x, width * CutRect.y, width * CutRect.width, height * CutRect.height), 0, 0);
mCam.targetTexture = null;
RenderTexture.active = null;
UnityEngine.Object.Destroy(rt);
byte[] bytes = screenShot.EncodeToPNG();
//string filename = Application.dataPath + "/Print/3D"
// + System.DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".png";
//System.IO.File.WriteAllBytes(filename, bytes); mImage = Image.GetInstance(bytes);
return mImage; }
//打印图片 (摄像头视野看到的/生成的图片) 成PDF
public void PrintImgPdf(string filePath, Camera mCam)
{
Document document = new Document(new Rectangle(PageSize.A4.Height, PageSize.A4.Width));
PdfWriter.GetInstance(
document,
new FileStream(filePath, FileMode.Create)
); document.Open();
Image imge;
imge = MakeCameraImg(mCam,700,512);
PdfPTable tableAll = CreateTable(1, PdfPTable.BACKGROUNDCANVAS, new float[] { document.PageSize.Width -50}, true);
PdfPTable tableHeaderR = CreateTable(1, PdfPTable.BACKGROUNDCANVAS, new float[] { -1 }, false);
PdfPTable tableHeaderminiR = CreateTable(1, PdfPTable.BACKGROUNDCANVAS, new float[] { 1 }, false);
//
Image mark = imge;
mark.ScaleAbsolute(mark.Width, mark.Height);
mark.Alignment = Image.LEFT_BORDER;
tableHeaderminiR.AddCell(CreateCell(mark, 2, 0));//<<<<<<<<< tableHeaderR.AddCell(CreateCell(tableHeaderminiR, -1, 0));//<<<<<<<<
tableAll.AddCell(CreateCell(tableHeaderR, -1, 0));//<<<<<<<< document.Add(tableAll);
document.Close();
ShowTips.showTips(" 打印完成!文件保存在:" + filePath); }
public PdfPTable CreateTable(int numCol, int HorizontalAlignmentStyle, float[] Width, bool isLockedWidth)
{
PdfPTable tableAll = new PdfPTable(numCol);
tableAll.HorizontalAlignment = HorizontalAlignmentStyle;
if (Width[0] != -1)
{
tableAll.SetTotalWidth(Width);
}
tableAll.LockedWidth = isLockedWidth;
return tableAll;
} public PdfPCell CreateCell(PdfPTable table, int rowspan, int borderStyle)
{
PdfPCell cell = new PdfPCell(table);
if (borderStyle != -1 && borderStyle >= 0)
{
cell.Border = borderStyle;
}
if (rowspan != -1)
{
cell.Rowspan = rowspan;
} cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfPCell.ALIGN_LEFT | PdfPCell.ALIGN_CENTER;
return cell;
} public PdfPCell CreateCell(Image image, int rowspan, int borderStyle)
{
PdfPCell cell = new PdfPCell(image);
if (borderStyle != -1 && borderStyle >= 0)
{
cell.Border = borderStyle;
}
if (rowspan != -1)
{
cell.Rowspan = rowspan;
}
cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfPCell.ALIGN_BASELINE;
return cell;
} public PdfPCell CreateCell(string text, int rowspan, int borderStyle, iTextSharp.text.Font cellFont)
{
PdfPCell cell = new PdfPCell(new Phrase(text, cellFont));
if (borderStyle != -1 && borderStyle>=0)
{
cell.Border = borderStyle;
}
if (rowspan != -1)
{
cell.Rowspan = rowspan;
} cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfPCell.ALIGN_CENTER;
return cell;
}
/// <summary> 只在详细信息的时候用
PdfPCell CreateGoodsInformationCell(PdfInformation mInfo)
{ string text = mInfo.mName +"\n";
iTextSharp.text.Font font =CreateFont(20, iTextSharp.text.Font.NORMAL);
PdfPCell cell = new PdfPCell(new Phrase(text,font));
cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
cell.VerticalAlignment = PdfPCell.ALIGN_LEFT; return cell; }
/// </param>/ public void CellAddTable(PdfPCell cell,PdfPTable table)
{
cell.AddElement(table);
}
public iTextSharp.text.Font CreateFont(float fontSize, int fontStyle)
{
BaseFont bfChinese = BaseFont.CreateFont( Application.dataPath + "/font/MSYH.TTF",
BaseFont.IDENTITY_H,
BaseFont.NOT_EMBEDDED ); return new iTextSharp.text.Font(bfChinese, fontSize, fontStyle);
} }
下面是调用:
using UnityEngine;
using System.Collections; public class PrintPdf : MonoBehaviour { //需要将这几个摄像头绑定对应的
PDFMakerManager mPdfManager;
public Camera m3DCamera;
public Camera mHightCam;
public GameObject mObj;
public Camera mInfoCamera;
string mPdfPath; public GameObject[] Texts = new GameObject[6];
public string[] Textstext;
PdfUserInformation mPDFUserInfo;
// Use this for initialization
void Start () { Textstext = new string[6];
mPdfManager = new PDFMakerManager();
mPDFUserInfo = new PdfUserInformation(); } // Update is called once per frame
void Update () { } void OnGUI()
{ if (GUI.Button(new Rect(100, 100, 100, 40), "PdfInfoPrint"))
{ PrintInfoPdf();
}
if (GUI.Button(new Rect(300, 100, 100, 40), "PdfInfoImgPrint"))
{ PrintInfoImgPdf();
}
if (GUI.Button(new Rect(400, 100, 100, 40), "PdfHightPrint"))
{
PrintHightImgPdf();
}
} // 还需要把摄像头绑定对
// 把写字的物体绑定对
// 在 调用函数 需要 找对 位置
public void getText()
{
for (int i = 0; i < Texts.Length; i++)
{
Textstext[i] = Texts[i].GetComponent<UILabel>().text;
}
mPDFUserInfo.goodsName = Textstext[0];
mPDFUserInfo.youzhanType = Textstext[1];
mPDFUserInfo.cvsLevel = Textstext[2];
mPDFUserInfo.writeTime = Textstext[3];
mPDFUserInfo.creater = Textstext[4];
mPDFUserInfo.creatTime = Textstext[5]; }
//打印 左边字 右边表格
public void PrintInfoPdf()
{
getText();
mPdfManager.PrintGoodsInformations(mPdfPath,mPDFUserInfo);
}
//打印 信息 图片
public void PrintInfoImgPdf()
{ getText();
mPdfPath = Application.dataPath + "/Print/InfoImg"
+ System.DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".pdf"; mPdfManager.PrintGoodsInformations(mPdfPath, mInfoCamera, mObj, mPDFUserInfo); } //打印 图
public void PrintHightImgPdf()
{
mPdfPath = Application.dataPath + "/Print/Top"
+ System.DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".pdf";
mPdfManager.PrintImgPdf(mPdfPath, mHightCam); }
}
注:如需转载,请注明出处,
unity3d导出pdf的更多相关文章
- .Net导出pdf文件,C#实现pdf导出
最近碰见个需求需要实现导出pdf文件,上网查了下代码资料总结了以下代码.可以成功的实现导出pdf文件. 在编码前需要在网上下载个itextsharp.dll,此程序集是必备的.楼主下载的是5.0版本, ...
- GJM :Unity3d导出eclipse工程,导入Android Studio
unity3d导出eclipse工程,导入Android Studio 标签: unity3Dandroid studio 2016-08-11 10:42 398人阅读 评论(1) 收藏 举报 分类 ...
- JS导出PDF插件(支持中文、图片使用路径)
在WEB上想做一个导出PDF的功能,发现jsPDF比较多人推荐,遗憾的是不支持中文,最后找到pdfmake,很好地解决了此问题.它的效果可以先到http://pdfmake.org/playgroun ...
- ITextSharp导出PDF表格和图片(C#)
文章主要介绍使用ITextSharp导出PDF表格和图片的简单操作说明,以下为ITextSharp.dll下载链接 分享链接:http://pan.baidu.com/s/1nuc6glj 密码:3g ...
- JAVA导出pdf实例
一.直接导出成PDF Java代码 1. import java.io.FileNotFoundException; 2. import java.io.FileOutputStream; 3. ...
- 利用ITextSharp导出PDF文件
最近项目中需要到处PDF文件,最后上网搜索了一下,发现ITextSharp比较好用,所以做了一个例子: public string ExportPDF() { //ITextSharp Usage / ...
- iText导出pdf、word、图片
一.前言 在企业的信息系统中,报表处理一直占比较重要的作用,本文将介绍一种生成PDF报表的Java组件--iText.通过在服务器端使用Jsp或JavaBean生成PDF报表,客户端采用超级连接显示或 ...
- Itext导出PDF,word,图片案例
iText导出pdf.word.图片 一.前言 在企业的信息系统中,报表处理一直占比较重要的作用,本文将介绍一种生成PDF报表的Java组件--iText.通过在服务器端使用Jsp或JavaBean生 ...
- Ireport 报表导出 Poi + ireport 导出pdf, word ,excel ,htm
Ireport 报表导出 Poi + ireport 导出pdf, doc ,excel ,html 格式 下面是报表导出工具类reportExportUtils 需要导出以上格式的报表 只需要调用本 ...
随机推荐
- 前台利用jcrop做头像选择预览,后台通过django利用Uploadify组件上传图最终使用PIL做图像裁切
之前一直使用python的PIL自定义裁切图片,今天有需求需要做一个前端的选择预览页面,索性就把这个功能整理一下,分享给大家. 实现思路: 1.前端页面: 用户选择本地一张图片,然后通过鼠标缩放和移动 ...
- 2014第2周四部署环境&买火车票
2014第2周四部署环境&买火车票 今天遇到mysql一个问题:要把两个包含不同数据库的绿色mysql安装包中的数据库文件合并到一个数据库中,之前在sqlserver下操作很简单,只需要分离. ...
- 常用数据结构及复杂度 array、LinkedList、List、Stack、Queue、Dictionary、SortedDictionary、HashSet、SortedSet
原文地址:http://www.cnblogs.com/gaochundong/p/data_structures_and_asymptotic_analysis.html 常用数据结构的时间复杂度 ...
- Pascal's Triangle 解答
Question Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows ...
- 今日成长笔记2016-11-18 - 关于java开发
好久没有写今日成长笔记了,要记得上一次写笔记还是2016-09-05,今天心血来潮,写一写最近发生在自己身上的事情,以后我要坚持每天写日记.我承认自己身上的确或多或少的存在不足,现在把它们抛出来,并记 ...
- hdu 5631 Rikka with Graph(图)
n个点最少要n-1条边才能连通,可以删除一条边,最多删除2条边,然后枚举删除的1条边或2条边,用并查集判断是否连通,时间复杂度为O(n^3) 这边犯了个错误, for(int i=0;i<N;i ...
- PHP Database ODBC 之 ODBC
ODBC 是一种应用程序编程接口(Application Programming Interface,API),使我们有能力连接到某个数据源(比如一个 MS Access 数据库). 创建 ODBC ...
- mysql配置的讲解 mysql的root密码重置 mysql的登录
一,MySQL配置的讲解 port 默认mysql端口 socket 用于服务器端和客户端通信的套连接文字 skip-locking 取消文件系统的外部锁 key_buffer_size 索引缓 ...
- swfobject.js 2.2简单使用方法
swfobject.js 2.2简单使用方法 官方网址介绍http://code.google.com/p/swfobject/wiki/documentation 用法:html部分<div ...
- 在任务计划程序用Bat命令执行exe程序
@echo off :open choice /c:123 /m "1:创建,2:终止,3:删除" if errorlevel 3 goto delete if errorleve ...