#自定义函数:import ospath="D:\\Temp_del\\a"def gci (path): parents = os.listdir(path) for parent in parents: child = os.path.join(path,parent)...
分类:
编程语言 时间:
2014-07-07 10:08:15
阅读次数:
343
【不要在遍历子结点时修改parent】 在用for/foreach遍历子结点时,如果在这过程中有改变子结点的parent,会导致不可预料的结果。我所遇到的问题是,在此种情况下,并非所有的子结点都能遍历到。如果硬要循环中修改child.transform.parent,则使用索引,从childCou....
分类:
其他好文 时间:
2014-07-06 20:59:02
阅读次数:
204
在项目中难免会遇到这样一个问题就是页面引入了IFrame并且需要父页面调用子页面函数或者子页面需要调用父页面函数。比如说:现在有两个页面parent.html和child.html。其中parent.html中含有IFrame并且IFrame指向child.html。现在需要在parent.html...
分类:
其他好文 时间:
2014-07-06 18:46:08
阅读次数:
212
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana...
分类:
其他好文 时间:
2014-07-06 16:45:00
阅读次数:
201
Write a function to find the longest common prefix string amongst an array of strings.class Solution {public: string longestCommonPrefix(vector &st...
分类:
其他好文 时间:
2014-07-05 18:36:22
阅读次数:
209
Validate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended for the problem stat...
分类:
其他好文 时间:
2014-07-05 17:20:00
阅读次数:
176
Qt 5以后qmlscene被qml所替代,/usr/bin/qml可以用来执行.qml文件。所以,我们就可以和sh一样的来写界面了。#!/usr/bin/env qml
import QtQuick 2.2
Rectangle {
width: 200
height: 100
Text {
anchors.centerIn: parent
...
分类:
其他好文 时间:
2014-07-04 09:14:40
阅读次数:
259
Given a binary tree, determine if it is a valid binary search tree (BST).
分类:
其他好文 时间:
2014-07-03 19:36:49
阅读次数:
196
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
分类:
其他好文 时间:
2014-07-03 19:24:36
阅读次数:
142
在一个字符串中求不重复子串的最大长度是一个经典的贪心法求解问题(说子串自然是连续的,子序列则不要求连续)。
先给出leetcode上这题的描述:
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring wit...
分类:
其他好文 时间:
2014-07-03 16:24:55
阅读次数:
281