摘要: # encoding: UTF-8import socket rfile = open('c:\\ip.txt')wfile = open('c:\\result.csv', 'w+')for line in rfile: str = line.strip().split(';') for s in str: s = s.strip().split('/') s = s[0] try: result = socket.gethostbyname(s) except: result =... 阅读全文
posted @ 2012-06-28 14:15 fighter 阅读(1758) 评论(0) 推荐(0) 编辑
摘要: AndroidManifest.xml文件中界面对应的<activity>里加入android:windowSoftInputMode="adjustPan" 键盘就会覆盖屏幕android:windowSoftInputMode="stateVisible|adjustResize" 屏幕整体上移 阅读全文
posted @ 2012-06-28 06:56 fighter 阅读(29865) 评论(2) 推荐(1) 编辑
摘要: public String userLogin(String userName, String pwd) { String url = "http://xx.xx.com/services/User"; String nameSpace = "http://xx.xx.com"; String SOAP_ACTION = "http:/xx.xx.com/services/User/login"; String method = "login"; String result = ""; Soap 阅读全文
posted @ 2012-06-14 12:09 fighter 阅读(5253) 评论(0) 推荐(0) 编辑
摘要: --查看对象是否已经存在 --数据库是否存在 --if exists (select * from sys.databases where name = ’数据库名’) -- drop database [数据库名] if exists(select * from sys.databases where name='FGM_POS') print '存在' --drop database [数据库名] --表是否存在 --if exists (select * from sysobjects where id = object_id(N’[表名]’) and.. 阅读全文
posted @ 2012-05-31 22:07 fighter 阅读(4827) 评论(0) 推荐(2) 编辑
摘要: 最近两天因为需要在linux系统中执行一个常驻内存进程服务,于是想到了python,本身所有linux系统中又自带了python环境,这样使用起来就很方便了。我服务器上系统安装的是ContOS 5.8,查看了python版本是2.4.3,现在用的最多的版本是2.6.*,所以咱也把版本更新到了2.6.5,包含安装python 连接mysql MySQLdb模块,python调用webservice客户端 suds模块,下边是详细的按照步骤。一,更新python版本到2.6.5二,安装MySQLdb模块(用于支持python连接mysql)三,安装suds模块(用于python支持直接调用webs 阅读全文
posted @ 2012-04-20 17:58 fighter 阅读(1605) 评论(2) 推荐(1) 编辑
摘要: BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; //获取这个图片的宽和高 Bitmap bitmap = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory().getAbsolut... 阅读全文
posted @ 2012-03-28 15:31 fighter 阅读(1298) 评论(0) 推荐(0) 编辑
摘要: android开发中在和服务器端接口对接时出现编码问题,从服务器端获取到的数据是"\u8bbe\u59071ID-\u8bbe\u59071\u540d\u79f0;\u8bbe\u59073id-\u8bbe\u59073\u540d\u79f0;\u8bbe\u59077id-\u8bbe\u59077\u540d\u79f0" 接口是通过php函数中json_encode进行编码后返回的,在客户端通过java.net.URLdecoder.decode()解码不管用,但是直接将以上字符串复制到decode()方法中可以正常解码,把接收到的字符串经过utf-8编码后不管 阅读全文
posted @ 2012-03-16 11:33 fighter 阅读(10244) 评论(2) 推荐(1) 编辑
摘要: 在android开发过程中,我们会遇到要检查一个已知包名的android软件是否已经安装,通过以下代码即可实现判断: 1 PackageInfo packageInfo; 2 try { 3 packageInfo = this.getPackageManager().getPackageInfo(packageName, 0); 4 5 } catch (NameNotFoundException e) { 6 packageInfo = null; 7 e... 阅读全文
posted @ 2012-03-01 17:26 fighter 阅读(1523) 评论(0) 推荐(0) 编辑
摘要: <?php $file_name = $_GET['file'] . ".apk"; $file_dir = $_SERVER['DOCUMENT_ROOT'] . "\\"; if(!file_exists($file_dir . $file_name)) { echo "file is not exists"; } else { $file = fopen($file_dir . $file_name, "r"); header("Con... 阅读全文
posted @ 2012-02-22 19:01 fighter 阅读(431) 评论(1) 推荐(0) 编辑
摘要: 一、相关概念1、Drawable就是一个可画的对象,其可能是一张位图(BitmapDrawable),也可能是一个图形(ShapeDrawable),还有可能是一个图层(LayerDrawable),我们根据画图的需求,创建相应的可画对象2、Canvas画布,绘图的目的区域,用于绘图3、Bitmap位图,用于图的处理4、Matrix矩阵二、Bitmap1、从资源中获取Bitmap1 Resources res = getResources();2 Bitmap bmp = BitmapFactory.decodeResource(res, R.drawable.icon);2、... 阅读全文
posted @ 2012-02-20 18:34 fighter 阅读(85280) 评论(2) 推荐(9) 编辑
摘要: 一,android安装已经下载好的apk文件Uri uri = Uri.fromFile(updateFile); //获取文件的UriIntent installIntent = new Intent(Intent.ACTION_VIEW);installIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);installIntent.setDataAndType(uri, "application/vnd.android.package-archive");//设置intent的数据类型startActivity(insta... 阅读全文
posted @ 2012-02-20 18:24 fighter 阅读(8413) 评论(0) 推荐(0) 编辑
摘要: 一,获取手机屏幕分辨率:DisplayMetrics dm = new DisplayMetrics();this.getWindowManager().getDefaultDisplay().getMetrics(dm);int width = dm.widthPixels;//屏幕宽度int height = dm.heightPixels;//屏幕高度二,setRequestedOrientation 设置屏幕方向setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);//通过程序改变屏幕显示的方向1.land 阅读全文
posted @ 2012-02-05 01:01 fighter 阅读(4558) 评论(0) 推荐(0) 编辑
摘要: 今天更新新版android SDK,发现对xml配置文件中各个控件属性设置更加严谨了,以前在strings.xml里配置的带有 %s,%f 等变量格式的符号要求更加成%1$s,%1$f这样的符号来代替,其中%1表示第一个位置的变量, $s表示为字符串类。 阅读全文
posted @ 2012-02-04 22:47 fighter 阅读(4831) 评论(0) 推荐(0) 编辑
摘要: create table users( username varchar(20), userpwd varchar(20), createtime TIMESTAMP default (datetime('now', 'localtime')) ) 阅读全文
posted @ 2011-11-15 14:23 fighter 阅读(629) 评论(0) 推荐(0) 编辑
摘要: 属性名称描述android:background设置背景色/背景图片。可以通过以下两种方法设置背景为透明:”@android:color/transparent”和”@null”。注意TextView默认是透明的,不用写此属性,但是Buttom/ImageButton/ImageView想透明的话就得写这个属性了。android:clickable是否响应点击事件。android:contentDescription设置View的备注说明,作为一种辅助功能提供,为一些没有文字描述的View提供说明,如ImageButton。这里在界面上不会有效果,自己在程序中控制,可临时放一点字符串数据。an 阅读全文
posted @ 2011-09-18 00:18 fighter 阅读(25872) 评论(1) 推荐(2) 编辑