在Linux环境下,两台主机之间传输文件一般使用scp命令,通常用scp命令通过ssh获取对方linux主机文 […]
Yii2路径优化隐藏index.php
1.开启apache-rewrite LoadModule rewrite_module modules/mo […]
采用composer安装yii2
1.将php.exe加入环境变量path 2.下载composer https://getcomposer.o […]
利用.htaccess绑定子域名到子目录
根目录下的.htaccess文件内容:film Despicable Me 3 <IfModule mo […]
Android获取存储卡路径
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
public class TFCardInfo { private static TFCardInfo instance; public String mTFCardName = null; public String mTFCardPath = null; public String mSDCardPath = null; public static synchronized TFCardInfo getInstance() { if (instance == null) { instance = new TFCardInfo(); } return instance; } /** * 功 能:得到TF卡的名字和路径,赋给类变量<br> * 时 间:2014年12月25日 上午10:31:26<br> * 注 意:<br> * 1.要判断磁盘是否准备好<br> * * @param context */ public void GetTFCardPathName(Context context) { /** 要排除的目录名称 */ String[] excludeDirs = { "media_rw", "asec", "cd-rom", "obb", "sdcard", "secure", "shell", "usbotg", "usb_storage", "UsbDrive" }; // 获取扩展存储设备的文件目录 File adbFile = new File("/mnt"); File[] tempList = adbFile.listFiles(); boolean isFind = false; for (File curFile : tempList) { isFind = false; if (curFile.isDirectory()) { for (String dirName : excludeDirs) {// 遍历筛选目录 if (curFile.getName().equals(dirName)) { isFind = true; break; } } if (isFind == false) {// 如果筛选项里没有的话,说明已经找到 mTFCardName = curFile.getName(); mTFCardPath = curFile.getAbsolutePath(); mTFCardPath = "/mnt/" + mTFCardName + "/"; break; } } } } /** * 功 能:判断TF卡是否存在<br> * 时 间:2014年12月19日 上午9:50:10<br> * 注 意:<br> * * @TODO:<br> * @param context * @return <br> */ public Boolean CheckTFCardExists(Context context) { if (mTFCardPath == null) { // 防止先调用了这个函数 GetTFCardPathName(context); } if (mTFCardPath == null) { // 路径不存在,则要返回 return false; } // 下面通过创建一个文件来判断是否存在tfcard String tempfilepathnameString = mTFCardPath + "checktfcard.txt"; File file = new File(tempfilepathnameString); try { file.createNewFile(); } catch (IOException e) { e.printStackTrace(); } if (file.exists()) { file.delete();// 删除此测试文件 return true; } return false; } /** * 功 能:获取SD卡路径<br> * 时 间:2015年4月14日 下午5:49:43<br> * 注 意:<br> * * @return */ public String getSDPath() { boolean sdCardExist = Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED); // 判断sd卡是否存在 if (sdCardExist) { File file = Environment.getExternalStorageDirectory();// 获取跟目录 mSDCardPath = file.toString(); } return mSDCardPath; } } |
使用 [crayon-6866ed6c646 […]
Linux的/etc/sysconfig/i18n文件详解
i18n是internationalization的缩写,意思指i和n之间有18个字母。/etc/syscon […]
spring发行包说明
各发行包的大致描述如下: org.springframework.asm-3.0.0.M4.jar: 提供对A […]
Gestures for Chrome 自定义使用
The?Gestures?for?Chrome?extension is designed to add mo […]
Javascript中的封装多态和继承
封装Encapsulation 如下代码,这就算是封装了 [crayon-6866ed6c648fb38083 […]
ArcGIS Server会导致ArcMap打开发布成服务的Shape文件变慢
问题:使用ArcMAP制作要发布的数据,保存成mxd后发布成服务,发现有些细节不合理,再次打开mxd进行修改, […]
JQuery学习
1 |
jQuery |
1 关于text(),返回选择元素结果集,实 […]
迈乐高清播放器A100,A1000,A1000T,A2000,A3600之间的区别
A1000与A1000T的区别:A1000与A1000T的区别在于A1000的标配是不带空鼠的 A1000T的 […]
arcgis server 动态创建地图服务代码
加入地图包括图层渲染,标注等,数据从ArcSDE中读出! 代码中有两个数据表:mapinfo(存储地图信息,k […]
ArcGIS Server操作Mxd文件详细讲解
Server发布地图都是基于Mxd去发布的,这点与IMS使用axl文件差不多。一般来说,发布后mxd尽可能不要 […]
完全开源Web GIS系统
1. 服务器 服务器端的选择:geoserver.选择它而不选择deegree的原因在于,deegree相当复 […]
SharePoint Foundation和SharePoint Server的区别
SharePoint Server 2010用来取代MOSS 2007,它有标准版和企业版两个版本,使用SQL […]
XDocument输出
使用XDocument时,用普通的ToString方式无法输出声明,可以按如下方式输出声明 [crayon-6 […]
远程访问Mysql Host is not allowed to connect to this MySQL server
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
如果你想连接你的mysql的时候发生这个错误: ERROR 1130: Host '210.13.92.66' is not allowed to connect to this MySQL server 请按照如下方法解决: login as: root ///登陆系统 root@tqwm.cn's password: ///输入密码 Last login: Tue Apr 15 14:06:54 2008 from 210.13.92.66 [root@myserver ~]# /usr/local/mysql/bin/mysql -uroot -hlocalhost -p ///登入mysql Enter password: ///输入mysql对应用户的密码 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 431 Server version: 5.0.58-enterprise-gpl-log Source Type 'help;' or '\h' for help. Type '\c' to clear the buffer. ///登入成功的提示信息 mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'rootpasswd' WITH GRANT OPTION; ///输入这段指令并回车后允许所有用root用户并且输入rootpasswd密码的主机登入该mysql Server 如果将'%'换成'10.1.1.1'那么只有10.1.1.1的主机可以登陆. Query OK, 0 rows affected (0.07 sec) mysql> \q ///退出mysql Bye [root@myserver ~]# 另外还有一种方法转自其他地方 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql -u root -pvmwaremysql>use mysql;mysql>update user set host = '%' where user = 'root';mysql>select host, user from user; 自己的解决方法: 直接在cmd 下进入mysql\bin 下 运行 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION |
Android 和iOS 比较之我见
Android和iOS那个好?应该先往哪个上面投入资源?多次被人问到此类问题,笔者刚好自己的项目也需要考虑iO […]
升级到Flex 4.5 Air 2.6
So if you’re upgrading to Flex SDK 4.5 and Air 2.6 Adob […]
关于浏览器内核的一些小知识,明明白白选浏览器!
一些内容来自于我能找到的资料和我自己的理解,不保证正确,但是大致应该是没错的。 一、排版引擎 首先厘清一下浏览 […]
Google Chrome 11 浏览器 下Flash Debug 插件无效的解决办法
在开发Flex的时候也希望能用chrome来调试自己的flex程序,但是发现无法连接Debug插件,下面总结可 […]
IE中打开UTF-8编码网页显示空白问题
很久很久以前(大概2005年10月~2006年3月),当时在blogger.com写Blog。当时blogge […]
Jbuild7+weblogic6.x配置方法如下:
Win 2000 Temp、Tmp 的配置 因为我们生成的 ejb 相关代码要进行一系列的编译,那么所生成的临 […]
Java时间处理
1:) 字符串转换成时间
1 2 3 4 5 6 7 8 9 10 11 12 13 |
SimpleDateFormat formatter = new SimpleDateFormat ('yyyy.MM.dd'); //假定像2002.07.04的是合法日期其他都非法。 String str='2002.07.04'; ParsePosition pos = new ParsePosition(0); Date dt=formatter.parse(str,pos); if(dt!=null) { //是合法日期 } else { //非法日期 } |
2:)两个日期相减 […]