网站上传文件后,如果是图片,都要对文件进行处理,压缩、缩放之类的。 import java.nio.file.*;//如果是图片文件,则执行缩放处理
Path source = Paths.get(newFilePath);
String contentType = Files.probeContentType(source);
if (contentType.starts...
分类:
编程语言 时间:
2014-09-11 19:23:12
阅读次数:
159
Path Sum II
Total Accepted: 18489 Total
Submissions: 68323My Submissions
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For exampl...
分类:
其他好文 时间:
2014-09-10 01:38:49
阅读次数:
223
思路: 其实答案就是 C(m+n-2, m-1). 但是写程序利用动态规划会简单快捷。(给两个代码,第一个方便理解,第二个是基于第一个的优化)
思路:同上,只是最初初始化全 0 . 当前位置为 1 时,则当到达前位置的步数为 0.
分类:
其他好文 时间:
2014-09-09 10:29:48
阅读次数:
255
Unique Paths:
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
The robot can only move either down or right at any point in time. The robot is t...
分类:
其他好文 时间:
2014-09-06 22:37:14
阅读次数:
246
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i...
分类:
其他好文 时间:
2014-09-06 05:27:32
阅读次数:
203
Paths中的几个重要元素Pointsvoid CGContextMoveToPoint ( CGContextRef c, CGFloat x, CGFloat y);指定一个点成为current pointQuartz会跟踪current point一般执行完一个相关函数后,current po...
分类:
其他好文 时间:
2014-09-05 22:20:42
阅读次数:
325
1,获取家目录路径的函数:NSString *homeDir = NSHomeDirectory();2,获取Documents目录路径的方法:NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUs...
分类:
其他好文 时间:
2014-09-05 19:43:22
阅读次数:
148
#-*-coding:utf-8-*-
[p_w_upload]
max_size=262144
render_unsafe_content=false
[browser]
color_scale=True
downloadable_paths=/trunk,/branches/*,/tags/*
hide_properties=svk:merge
intermediate_color=
intermediate_point=
newest_color=(255,136,136)
oldest_color..
分类:
其他好文 时间:
2014-09-05 10:11:21
阅读次数:
2915
Path Sum II
Total Accepted: 18489 Total
Submissions: 68323My Submissions
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For exampl...
分类:
其他好文 时间:
2014-08-31 21:28:11
阅读次数:
180