Admob原生AndroidSDK集成PhonegapCordova_第1页
Admob原生AndroidSDK集成PhonegapCordova_第2页
Admob原生AndroidSDK集成PhonegapCordova_第3页
Admob原生AndroidSDK集成PhonegapCordova_第4页
Admob原生AndroidSDK集成PhonegapCordova_第5页
已阅读5页,还剩30页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

iOS仿apple-pay效果,卡片堆叠效果,关于NSCoding 自定义类无法归档 ,将个别文字变成,粒子效果实现工具代码 UIEffectDesigner 下载地址 ,iOS如何查看日志 私有方法 和私有变量 ,iOS图表,曲线图,柱形图,条形图,饼状图 代码 Java代码 import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.FileWriter;import java.io.InputStream;import java.io.PrintWriter;/iOS 代码只让执行一次 public class FileOperate public FileOperate() /* * 新建目录 * * param folderPath * String 如 c:/fqf * return boolean */ public void newFolder(String folderPath) try String filePath = folderPath; filePath = filePath.toString(); java.io.File myFilePath = new java.io.File(filePath); if (!myFilePath.exists() myFilePath.mkdir(); catch (Exception e) System.out.println(新建目录操作出错); e.printStackTrace(); /iOS 动画效果 /iOS 关于UIPickerView 代理方法 属性 /* * 新建文件 * * param filePathAndName * String 文件路径及名称 如c:/fqf.txt * param fileContent * String 文件内容 * return boolean */ public void newFile(String filePathAndName, String fileContent) try String filePath = filePathAndName; filePath = filePath.toString(); File myFilePath = new File(filePath); if (!myFilePath.exists() myFilePath.createNewFile(); FileWriter resultFile = new FileWriter(myFilePath); PrintWriter myFile = new PrintWriter(resultFile); String strContent = fileContent; myFile.println(strContent); resultFile.close(); catch (Exception e) System.out.println(新建目录操作出错); e.printStackTrace(); /Net Redis实现发布/订阅(RedisPubSubServer) /net remoting 简单应用 /byte string 高效转换 /* * 删除文件 * * param filePathAndName * String 文件路径及名称 如c:/fqf.txt * param fileContent * String * return boolean */ public void delFile(String filePathAndName) try String filePath = filePathAndName; filePath = filePath.toString(); java.io.File myDelFile = new java.io.File(filePath); myDelFile.delete(); catch (Exception e) System.out.println(删除文件操作出错); e.printStackTrace(); /c+andPerl6AbstractType/(Swift)一个爬梯子的小游戏 /* * 删除文件夹 * * param filePathAndName * String 文件夹路径及名称 如c:/fqf * param fileContent * String * return boolean */ public void delFolder(String folderPath) try delAllFile(folderPath); / 删除完里面所有内容 String filePath = folderPath; filePath = filePath.toString(); java.io.File myFilePath = new java.io.File(filePath); myFilePath.delete(); / 删除空文件夹 catch (Exception e) System.out.println(删除文件夹操作出错); e.printStackTrace(); /24game/SolvePerl/猜数游戏while的简单应用 /* * 删除文件夹里面的所有文件 * * param path * String 文件夹路径 如 c:/fqf */ public void delAllFile(String path) File file = new File(path); if (!file.exists() return; if (!file.isDirectory() return; String tempList = file.list(); File temp = null; for (int i = 0; i tempList.length; i+) if (path.endsWith(File.separator) temp = new File(path + tempListi); else temp = new File(path + File.separator + tempListi); if (teisFile() tedelete(); if (teisDirectory() delAllFile(path + / + tempListi);/ 先删除文件夹里面的文件 delFolder(path + / + tempListi);/ 再删除空文件夹 /* * 复制单个文件 * * param oldPath * String 原文件路径 如:c:/fqf.txt * param newPath * String 复制后路径 如:f:/fqf.txt * return boolean */ public void copyFile(String oldPath, String newPath) try int bytesum = 0; int byteread = 0; File oldfile = new File(oldPath); if (oldfile.exists() / 文件存在时 InputStream inStream = new FileInputStream(oldPath); / 读入原文件 FileOutputStream fs = new FileOutputStream(newPath); byte buffer = new byte1444; int length; while (byteread = inStream.read(buffer) != -1) bytesum += byteread; / 字节数 文件大小 System.out.println(bytesum); fs.write(buffer, 0, byteread); inStream.close(); catch (Exception e) System.out.println(复制单个文件操作出错); e.printStackTrace(); /* * 复制整个文件夹内容 * * param oldPath * String 原文件路径 如:c:/fqf * param newPath * String 复制后路径 如:f:/fqf/ff * return boolean */ public void copyFolder(String oldPath, String newPath) try (new File(newPath).mkdirs(); / 如果文件夹不存在 则建立新文件夹 File a = new File(oldPath); String file = a.list(); File temp = null; for (int i = 0; i file.length; i+) if (oldPath.endsWith(File.separator) temp = new File(oldPath + filei); else temp = new File(oldPath + File.separator + filei); if (teisFile() FileInputStream input = new FileInputStream(temp); FileOutputStream output = new FileOutputStream(newPath + / + (tegetName().toString(); byte b = new byte1024 * 5; int len; while (len = input.read(b) != -1) output.write(b, 0, len); output.flush(); output.close(); input.close(); if (teisDirectory() / 如果是子文件夹 copyFolder(oldPath + / + filei, newPath + / + filei); catch (Exception e) System.out.println(复制整个文件夹内容操作出错); e.printStackTrace(); /* * 移动文件到指定目录 * * param oldPath * String 如:c:/fqf.txt * param newPath * String 如:d:/fqf.txt */ public void moveFile(String oldPath, String newPath) copyFile(oldPath, newPath); delFile(oldPath); /* * 移动文件到指定目录 * * param oldPath * String 如:c:/fqf.txt * param newPath * String 如:d:/fqf.txt */ public void moveFolder(String oldPath, String newPath) copyFolder(oldPath, newPath); delFolder(oldPath); 代码 Java代码 try /SmartUpload的初始化,使用这个jspsmart一定要在一开始就这样声明 SmartUpload mySmartUpload = new SmartUpload(); mySmartUpload.initialize(this.getServlet().getServletConfig(), request, response); mySmartUpload.service(request, response); /依据form的内容上传 mySmartUpload.upload(); String year = mySmartUpload.getRequest().getParameter(year); String month = mySmartUpload.getRequest().getParameter(month); FileOperate FileOperate =new FileOperate(); /将上传的文件一个一个取出来处理 for (int i=0;imySmartUpload.getFiles().getCount();i+) /取出一个文件 com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(i); mySmartUpload.save(/upload/); String name = WebUtil.getBasePath()+upload/+myFile.getFileName(); catch (Exception e) e.printStackTrace(); 文件 贪食蛇.zip4KB(250) 文件不存在或者代码语言不存在图片 QQ截图20120131224348.png 代码 Java代码 public static void main(String args) throws Throwable SimpleBenchmark benchmark = new SimpleBenchmark(Benchmark); SimpleBenchmarkReporter reporter = new SimpleBenchmarkReporter(new PrintWriter(System.out); final User user = new User(a); benchmark.addBenchmarkCase(new BenchmarkCase() Override public String getName() return user.getName(); Override public void run() throws Throwable user.getName(); ); benchmark.addBenchmarkCase(new BenchmarkCase() Method method = User.class.getDeclaredMethod(getName, new Class0); Object params = new Object0; Override public String getName() return method.invoke(user, params); Override public void run() throws Throwable method.invoke(user, params); ); benchmark.addBenchmarkCase(new BenchmarkCase() MethodHandle methodHandle = MethodHandles.publicLookup().findVirtual( User.class, getName, MethodType.methodType(String.class, new Class0) ); Override public String getName() return methodHandle.invoke(user); Override public void run() throws Throwable methodHandle.invoke(user); ); reporter.report(benchmark, benchmark.warmUpAndRun(120000); System.exit(0);public class User private String name; public User(String name) = name; public String getName() return name; public void setName(String name) = name; 文件 SimpleBenchmark.java3KB(22) package canghailan.util.benchmark;import java.util.ArrayList;import java.util.List;/* * author canghailan 2012-01-31 20:46 */public class SimpleBenchmark implements Benchmark public static final int DEFAULT_WARM_UP_TIMES = 120000; private final String name; private final List benchmarkCases = new ArrayList(); public SimpleBenchmark(String name) = name; Override public String getName() return name; Override public void addBenchmarkCase(BenchmarkCase benchmarkCase) benchmarkCases.add(benchmarkCase); Override public List getBenchmarkCases() return benchmarkCases; Override public void warmUp(final int times) throws Throwable EmptyBenchmarkCase emptyBenchmarkCase = EmptyBenchmarkCase.INSTANCE; for (int i = 0; i times; +i) emptyBenchmarkCase.run(); for (BenchmarkCase benchmarkCase : benchmarkCases) benchmarkCase.run(); Override public BenchmarkResult run(final int times) throws Throwable final long benchmarkStart = System.nanoTime(); System.gc(); / ? final long emptyCost = getEmptyCost(times); final List caseCosts = new ArrayList(benchmarkCases.size(); for (BenchmarkCase benchmarkCase : benchmarkCases) System.gc(); / ? long caseStart = System.nanoTime(); for (int i = 0; i emptyCost ? caseCost - emptyCost : 1); final long benchmarkCost = System.nanoTime() - benchmarkStart; return new BenchmarkResult() Override public int getTimes() return times; Override public long getTotalCost() return benchmarkCost; Override public List getBenchmarkCaseCosts() return caseCosts; ; public BenchmarkResult warmUpAndRun(final int times) throws Throwable warmUp(DEFAULT_WARM_UP_TIMES); return run(times); private long getEmptyCost(int times) EmptyBenchmarkCase emptyBenchmarkCase = EmptyBenchmarkCase.INSTANCE; long start = System.nanoTime(); for (int i = 0; i times; +i) emptyBenchmarkCase.run(); return System.nanoTime() - start; private static final class EmptyBenchmarkCase implements BenchmarkCase public static final EmptyBenchmarkCase INSTANCE = new EmptyBenchmarkCase(); Override public String getName() return EMPTY BENCHMARK CASE; Override public void run() 文件 SimpleBenchmarkReporter.java5KB(24) package canghailan.util.benchmark;import java.io.IOException;import java.io.Writer;import java.text.NumberFormat;import java.util.concurrent.TimeUnit;/* * author canghailan 2012-01-31 21:31 */public class SimpleBenchmarkReporter implements BenchmarkReporter private static final String HEADS = case name, total(ns), per(ns), ratio ; private final int widths = new intHEADS.length; private final NumberFormat ratioFormat; 小型臭氧发生器 侳侱侲 private final Writer output; public SimpleBenchmarkReporter(Writer output) this.output = output; ratioFormat = NumberFormat.getInstance(); ratioFormat.setMaximumFractionDigits(1); Override public void report(Benchmark benchmark, BenchmarkResult result) assert benchmark.getBenchmarkCases().size() = result.getBenchmarkCaseCosts().size(); calculateWidths(benchmark, result); writeTitle(benchmark); writeTimesAndCost(result); writeHeads(); writeCases(benchmark, result); flush(); 秦皇岛同城购 侭侰侮 private String getCell(Benchmark benchmark, BenchmarkResult result, int row, int column) switch (column) case 0: return benchmark.getBenchmarkCases().get(row).getName(); case 1: return result.getBenchmarkCaseCosts().get(row).toString(); case 2: re

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论