- 浏览: 307164 次
- 性别:
- 来自: 北京
-
最新评论
-
zczjdyj123:
...
Linux SSH 登录其他机器 -
chenzheng8975:
搞得不错 32个赞。。。。。
圆角PopupWindow对话框和圆角EditText -
guoxianyu521:
感谢楼主!!!!
DateChooser日期选择器swing -
雪尹江泽:
千言万语,就一句:太感谢你了!
圆角PopupWindow对话框和圆角EditText -
laozhao:
非常感谢楼主,非常好用。抄走了。呵呵。
DateChooser日期选择器swing
文章列表
I:访问本程序的(FirstApp)SharedPreferences中的数据代码如下:
SharedPreferences sharedPreferences = getSharedPreferences("first_app_perferences", Context.MODE_PRIVATE);
String name = sharedPreferences.getString("name", ""); //getString()第二个参数为缺省值,如果preference中不存在该key,将返回缺省值
int a ...
Android默认的PopupWindow和EditText的外观是矩形框,看起来不是太好,本示例通过设置布局View的背景和PopupWindowd对象的背景,实现有白色圆角边框的对话框效果和圆角文字编辑框。代码如下(关键部分是背景布局XML):
对话框弹出效果图:
package com.test;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.text.InputType;
imp ...
两个Activity跳转的时候,自定义翻页效果:
Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
startActivityForResult(intent, 11);
//添加界面切换效果,注意只有Android的2.0(SdkVersion版本号为5)以后的版本才支持
int version = Integer.valueOf(android.os.Build.VERSION.SDK);
if(version >= 5) {
overri ...
1, 创建
/**
* 为程序创建桌面快捷方式
*/
private void addShortcut(){
Intent shortcut = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
//快捷方式的名称
shortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.app_name));
...
【转载文章】
Redis指令手册中文版
连接控制QUIT :退出,关闭连接
代码实例:连接 退出telnet localhost 6379QUITAUTH : 密码验证
举例说明1、首先需要在redis的配置文件redis.conf中requirepass注释掉的内容,设置需要密码连接,否则auth任何密码都通过2、重新启动redis3、验证 auth testpassword,testpassword是我在配置文件中设置的requirepass testpassword4、redis 服务器的速度众所周知,因此官方文件中 提醒设置比较复杂的密码,防止机器破解
telnet lo ...
【转载文章】本文包括如下内容:
Redis简介
Redis的性能
安装Redis、Redis启动参数介绍
应用实例:利用Redis构建简单的微博系统(官方例子链接)
1.Redis简介
Redis是一个key-value存储系统。和Memcached类似,但是解决了断 ...
Android Permission中英对照
android.permission.ACCESS_CHECKIN_PROPERTIES Allows read/write access to the "properties" table in the checkin database, to change values that get uploaded 允许读写访问 "properties"表在checkin数据库中,改值可以修改上传 android.permission.ACCESS_COARSE_LOCATION All ...
1.从google搜索内容Intent intent = new Intent();intent.setAction(Intent.ACTION_WEB_SEARCH);intent.putExtra(SearchManager.QUERY,"searchString")startActivity(intent);2.浏览网页Uri uri = Uri.parse("http://www.google.com");Intent it = new Intent(Intent.ACTION_VIEW,uri);startActivity(it); ...
WAP
Wireless Application Protocol 简称WAP,无线应用协议
是一种向移动终端提供互联网内容和先进增值服务的全球统一的开放式协议标准, 是简化了的无线Internet 协议。WAP 将Internet和移动电话技术结合起来,使随时随地访问丰富的互联网络资源成为现实。WAP 服务是一种手机直接上网,通过手机WAP“浏览器”浏览wap 站点的服务,可享受新闻浏览、股票查询、邮件收发、在线游戏、聊天等多种应用服务。通过GPRS 网络接入WAP,可充分发挥接入时延短(2 秒接入)速率高、永远在线、切换方便等优点 WAP能支持HT ...
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.FileConfiguration;
import org.apache.commons.configuration.reloading.F ...
- 2009-07-16 13:42
- 浏览 1510
- 评论(0)
public class Distance {
/** 地球半径,以千米(km)为计算单位 */
private final static double EARTH_RADIUS = 6378.137;
/** 求弧度大小 */
private static double rad(double d) {
return d * Math.PI / 180.0;
}
/**
* 根据地球上两点间的经纬度求距离
*
* @param lat1
* @param lng1
* @param lat2
* @param lng ...
- 2009-07-16 13:34
- 浏览 3058
- 评论(0)
现在网上有很多在用户登陆或注册的时候为了防止程序攻击,加入了动态验证的技术,一般是让用户输入随即生成的验证码来实现。下面是一个用Servlet生成动态验证码的一个实例,可以根据实际需要进行修改。
1,生成动 ...
1,电话本主应用程序。注意:该程序为控制台应用程序,所有操作均在控制台进行。
package com.peak.telbook;
import java.util.Scanner;
/**
* 电话本应用程序的主要控制逻辑类,包含程序的主入口main方法。
*
* @author PeifengYan
* @version 1.0 12/10/2008
*/
public class Application {
/**创建一个操作实体类Operate的对象*/
Operate op = new Operate();
/**创建一个输入格式检查类T ...
//下面是用来生成Excel数据的Servlet,在web.xml中映射成 /data.xls
import java.io.IOException;
import javax.servlet.ServletException;import javax.servlet.ServletOutputStream;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;
import com.carle ...
1, 中文Cookie问题,由于Cookie的编码问题,导致在保存中文的Cookie时,不能正常保存。
解决方案:
第一步:保存中文的Cookie之前做一下编码,用到了