码迷,mamicode.com
首页 >  
搜索关键字:the xor-longest path    ( 29635个结果
linux shell执行方式
linux shell执行有两种方式shell脚本以#!/bin/bash开头,执行shell时先检查首行,在内部以下列方式执行:$/bin/bash script.sh1. 使用sh执行。 $sh script.sh #脚本位于当前目录下或者 $sh /home/path/script.sh #使...
分类:系统相关   时间:2014-05-26 23:16:32    阅读次数:344
解决Win8下使用net use命令磁盘映射无效的问题
该问题由UAC机制引起,可尝试如下方案:以管理员身份打开Powershell,运行:New-ItemProperty -Path "registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Syst...
分类:Windows程序   时间:2014-05-26 23:14:45    阅读次数:825
为Python加入默认模块搜索路径
为Python加入默认模块搜索路径方法一:函数加入1) import sys2) 查看sys.path3) 加入sys.path.append("c:\\")方法二:改动环境变量windows用户能够改动系统环境变量PYTHONPATH方法三:添加.pth文件,推荐!在site-packages加入...
分类:编程语言   时间:2014-05-26 21:30:47    阅读次数:333
python的 for dirpath, dirnames, filenames in os.walk(rs_path):
假设这三个目录三个文件放在rs_path=d:/gmz目录里面。那么要获取所有的文件路径,可以用如下方式for parentpath, dirnames, filenames in os.walk(rs_path): for filename in filenames: print "fileP.....
分类:编程语言   时间:2014-05-23 06:35:00    阅读次数:875
转 Ubuntu Linux 环境变量PATH设置
Ubuntu Linux系统环境变量配置文件:/etc/profile : 在登录时,操作系统定制用户环境时使用的第一个文件 ,此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行。/etc /environment : 在登录时操作系统使用的第二个文件, 系统在读取你自己的prof...
分类:系统相关   时间:2014-05-23 06:24:10    阅读次数:323
Geeks Union-Find Algorithm Union By Rank and Path Compression 图环算法
同样是查找一个图是否有环的算法,但是这个算法很牛逼,构造树的时候可以达到O(lgn)时间效率。n代表顶点数 原因是根据需要缩减了树的高度,也叫压缩路径(Path compression),名字很高深,不过其实不难理解,简单来说就是每次查找一个节点的时候,都把这一路径中的所有节点都赋予根节点作为路径。 原文没指出的地方: 也因为需要压缩,所以初始化的时候注意,不能如前面简单实用Unio...
分类:其他好文   时间:2014-05-23 00:21:42    阅读次数:305
0521.使用UIWebView加载来自NetWork、Project、Documents的html、javascript文件
话不多少,直接上代码,思路还是挺简单的。 UIWebView *webView = [[UIWebView alloc]initWithFrame:self.view.frame]; // HTML文件来自Project // 步骤:path - > url - > request with url - > loadRequest NSStrin...
分类:编程语言   时间:2014-05-22 23:53:05    阅读次数:442
关于finfo_file函数获取文件mime值验证出错的问题
今天在做图片上传 验证图片mime值时 突然发现  个别特殊情况下finfo_file 获取的MIME值不能直接使用,按照官方的写法是 $finfo=finfo_open(FILEINFO_MIME); $mime=finfo_file($finfo,$file_path); finfo_close($finfo); alert($mime);这样子获得文件mime类型的但是今天发现这样子...
分类:其他好文   时间:2014-05-22 22:37:21    阅读次数:443
Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:其他好文   时间:2014-05-22 16:05:56    阅读次数:239
python实现代码行的统计
最近闲来无事写了一个统计C或者C++代码行数的程序,主要用到了python以及正则表达式 #-*-coding:utf-8 #!/usr/bin/python import re import os import sys '''get the file or dir in one path''' def getfilename(path): if os.path.exi...
分类:编程语言   时间:2014-05-21 15:06:30    阅读次数:379
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!