Archive for 05月, 2009

端午节快乐–过节印象

星期四, 05月 28th, 2009

小时候很喜欢过节,因为过节的时候有粽子吃,还可以吃馒头,包子。那时候能够吃包子是一件很快乐的事情。粽子也只有过节的时候才会做。现在这种期盼慢慢的的淡忘了,但那种感觉依然那么真切。
晚上去超市买了一些粽子,找了好久也没找到“粽子”的感觉。要么很小,要么很大。太小了,还没鸡蛋大。绑住粽子的是用的白线,而不是用的一种“麻绳”,这种绳子是取自一种植物。长的很直,粗细如手指。每每过节,都很喜欢去割这种东西,然后将它的皮撕下来,这种皮就是绑粽子的绳子了。而将皮撕下后,就会是一根白白的,而且很直的“棍子”。这种皮很结实,经常用来绑东西,用它来绑粽子,那是再好不过了,绝对的绿色。
顺便也买了几个玉米,咸蛋,皮蛋。晚上将玉米和粽子一直煮了。皮蛋,蘸上酱油,香油,辣酱,吃起来还不错。

在城市里没有过节的气氛,没人会挂艾叶和菖蒲,也就只能从网上找几张图了,以聊寄遥远的童年了:
还有记得一定要给家里打个电话:)

发件人 snapshoot
发件人 snapshoot
发件人 snapshoot

wp-syntax无法标记xml

星期四, 05月 28th, 2009

很奇怪,再对xml加上标记的时候,点发布后,并不能看到这些xml,并且在编辑状态,也无法看到xml,只有对应的一段空白。

 

更新前的编辑状态:

发件人 snapshoot

占更新后:

发件人 snapshoot
发件人 snapshoot

mysql 几个命令

星期四, 05月 28th, 2009

1.登录
mysql -u root -p
2.查看当前数据库:
mysql> show databases;
3.选择其中某一个操作:
mysql> use mysql
4.查看这个数据库中有哪些表。
mysql> show tables;
5.查看某个表的结构:
mysql> describe user;
6.查看某个表中所有的元素:
mysql> select * from user;

可以加上where进行过滤。
mysql> select * from user where username=’**’;

mysql> select * from wp_users where user_login=’admin’;

mysql> select user_pass from wp_users where user_login=’admin’;

mysql> select user_pass|user_email from wp_users where user_login=’admin’;

7.可以对某个值进行更新:
mysql> update wp_users set user_pass=’new passwd’ where user_login=’admin’;
这句是用来更新wordpress blog的admin密码,由于我把密码给忘了,所以查了一下mysql的一些用法。

mysql> update wp_users set user_pass=’5d41402abc4b2a76b9719d911017c592′ where user_login=’admin’

5d41402abc4b2a76b9719d911017c592 表示:hello.
这表示将admin的密码设为“hello”,然后用这个密码登录之后,就可以进行密码修改了。

写日志时怎么格式化代码

星期二, 05月 26th, 2009

能不能够语法高亮显示。
显示成下面这个样子(类似于eclipse的样子):

发件人 snapshoot

使用wp-syntax来标记:
http://www.c2cer.com/20081128/wp-syntax-plugins-code/
参考这来实现一键插入:
编辑:\wp-includes\js\quicktags.js

发件人 snapshoot

代码中加入:

发件人 snapshoot
 
package com.qisda.weather;
import android.app.Activity;
import android.os.Bundle;
import android.view.*;
import android.view.View.OnFocusChangeListener;
import android.view.View.OnTouchListener;
import android.widget.ImageView;
 
public class weatherUI extends Activity implements OnTouchListener {
/** Called when the activity is first created. */
 
private ImageView w1;
private ImageView w2;
private ImageView w3;
private ImageView w4;
 
private ImageView wcurrent;
 
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
 
w1 = (ImageView) findViewById(R.id.w1);
w2 = (ImageView) findViewById(R.id.w2);
w3 = (ImageView) findViewById(R.id.w3);
w4 = (ImageView) findViewById(R.id.w4);
wcurrent = (ImageView) findViewById(R.id.wcurrent);
 
w1.setBackgroundResource(R.drawable.weather_clear);
w2.setBackgroundResource(R.drawable.weather_clear_night);
w3.setBackgroundResource(R.drawable.weather_cloudy);
w4.setBackgroundResource(R.drawable.weather_showers);
wcurrent.setBackgroundResource(R.drawable.weather_storm);
 
/*
* wcurrent.setOnFocusChangeListener(new View.OnFocusChangeListener() {
* public void onFocusChange(View v, boolean hasFocus) { if (true ==
* hasFocus) { wcurrent.setBackgroundDrawable(v.getBackground());
*
* } else {
*
* } } }); / wcurrent.setOnTouchListener(new View.OnTouchListener() {
* public boolean onTouch(View v, MotionEvent event) {
*
* return true; }
*
* });
*/
 
w1.setOnTouchListener(this);
w2.setOnTouchListener(this);
w3.setOnTouchListener(this);
w4.setOnTouchListener(this);
wcurrent.setOnTouchListener(this);
 
}
 
@Override
public boolean onTouch(View v, MotionEvent event) {
//ImageView imageview = (ImageView)findViewById(v.getId());
//imageview.setBackgroundDrawable(v.getBackground());
 
switch (v.getId()) {
case R.id.w1:
wcurrent.setBackgroundDrawable(v.getBackground());
break;
case R.id.w2:
wcurrent.setBackgroundDrawable(v.getBackground());
break;
 
case R.id.w3:
wcurrent.setBackgroundDrawable(v.getBackground());
break;
 
case R.id.w4:
wcurrent.setBackgroundDrawable(v.getBackground());
break;
 
case R.id.wcurrent:
wcurrent.setBackgroundDrawable(v.getBackground());
break;
 
default:
break;
 
}
return true;
}
}

Android ImageView用法

星期二, 05月 26th, 2009

详见:http://gentoo-pjq.vicp.net/bbs/viewtopic.php?f=8&t=85&p=100&sid=f1b441b45cf00aaa9b3c88e74fc45902#p100

代码可以到这里下载:http://github.com/pjq/weatherUI/tree/master
用git clone:

代码:
git clone git@github.com:pjq/weatherUI.git

要做一个weather report 的UI。
用Droiddraw画了一个UI。
写了一些测试代码,当点到一张图片的时候,并将这张图片显示出来。
这里要注意这一段:

代码:
public boolean onTouch(View v, MotionEvent event) {
ImageView imageview = (ImageView)findViewById(v.getId());
imageview.setBackgroundDrawable(v.getBackground());

按理说不应该再重新设置背景了,但很奇怪的是,当第一次点到一张图片时,会将这张点到的图片放到,所以在那么小的ImageView里就会显示不全,而只显示放大后的图片的一部分。
——后来又试了一下,好像又没问题,奇怪!!!

pjq@localhost ~/eclipse/workspace/weatherUI/src/com/qisda/weather $ cat weatherUI.java
package com.qisda.weather;
 
import android.app.Activity;
import android.os.Bundle;
import android.view.*;
import android.view.View.OnFocusChangeListener;
import android.view.View.OnTouchListener;
import android.widget.ImageView;
 
public class weatherUI extends Activity implements OnTouchListener {
/** Called when the activity is first created. */
 
private ImageView w1;
private ImageView w2;
private ImageView w3;
private ImageView w4;
 
private ImageView wcurrent;
 
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
 
w1 = (ImageView) findViewById(R.id.w1);
w2 = (ImageView) findViewById(R.id.w2);
w3 = (ImageView) findViewById(R.id.w3);
w4 = (ImageView) findViewById(R.id.w4);
wcurrent = (ImageView) findViewById(R.id.wcurrent);
 
w1.setBackgroundResource(R.drawable.weather_clear);
w2.setBackgroundResource(R.drawable.weather_clear_night);
w3.setBackgroundResource(R.drawable.weather_cloudy);
w4.setBackgroundResource(R.drawable.weather_showers);
wcurrent.setBackgroundResource(R.drawable.weather_storm);
 
/*
* wcurrent.setOnFocusChangeListener(new View.OnFocusChangeListener() {
* public void onFocusChange(View v, boolean hasFocus) { if (true ==
* hasFocus) { wcurrent.setBackgroundDrawable(v.getBackground());
*
* } else {
*
* } } }); / wcurrent.setOnTouchListener(new View.OnTouchListener() {
* public boolean onTouch(View v, MotionEvent event) {
*
* return true; }
*
* });
*/
 
w1.setOnTouchListener(this);
w2.setOnTouchListener(this);
w3.setOnTouchListener(this);
w4.setOnTouchListener(this);
wcurrent.setOnTouchListener(this);
 
}
 
@Override
public boolean onTouch(View v, MotionEvent event) {
ImageView imageview = (ImageView)findViewById(v.getId());
imageview.setBackgroundDrawable(v.getBackground());
 
switch (v.getId()) {
case R.id.w1:
wcurrent.setBackgroundDrawable(v.getBackground());
break;
case R.id.w2:
wcurrent.setBackgroundDrawable(v.getBackground());
break;
 
case R.id.w3:
wcurrent.setBackgroundDrawable(v.getBackground());
break;
 
case R.id.w4:
wcurrent.setBackgroundDrawable(v.getBackground());
break;
 
case R.id.wcurrent:
wcurrent.setBackgroundDrawable(v.getBackground());
break;
 
default:
break;
 
}
return true;
}
}pjq@localhost ~/eclipse/workspace/weatherUI/src/com/qisda/weather $

Layout:

 

运行效果:

发件人 snapshoot
发件人 snapshoot

weather

Recent Posts:
  1. 博客搬迁了~
  2. Android live cd试用及介绍
  3. Android Browser Introduction 2:结构图
  4. Android Browser Introduction 1
  5. 从20080707--20090707
  6. Rate My Life Quiz!
  7. Registration
  8. 在公司电脑装上了linux,还存在诸多问题
  9. NND,苏州电信想钱想疯了,上网1.2元/时,强推天冀!!!
  10. google.com被及艾服达不溜了

Register Login