- 浏览: 436803 次
- 性别:
最新评论
-
nianhua2008:
你好,请问哪个cocos版本可以读取cbx文件?
Cocos3dx入门 -
ihic11:
我的为什么Receive.jsp一直有乱码?请帮忙
网银在线支付注意事项 -
奔跑的蓝猫:
楼主你好!请问这两个文件怎么使用啊?
楼主能把源代码发给我下吗 ...
简易视频聊天 -
wx_hello:
不错。。学习了。。
jquery解析xml -
ocaicai:
圣人啊,救星啊,我被这个问题折磨得蛋疼!对了,我在google ...
struts2+urlrewrite
文章列表
<s:test>判断实例
- 博客分类:
- SSH
<s:if test="%{#request.news.biaoti != null}">
struts2在Action使用模型驱动
public class NewsAction extends BaseAction implements ModelDriven<News>
获取News存入request范围内request..setAttribute("news", news);
在页面中获取方式:
<s:textfield name="biaoti" label="标题" value="%{#request.news.biaoti}"></s:textfiel ...
1、将字符串转换成date
nowDate = time.strptime('2010-05-27', "%Y-%m-%d")
2、获取年、月、日
year = nowDate[0]
month = nowDate[1]
day = nowDate[2]
3、日期想减,计算天数
d1 = datetime.datetime(2005, 2, 16)
d2 = datetime.datetime(2004, 12, 31)
days = (d1 – d2).days
# -*- coding:UTF-8 -*-
'''
Created on 2010-5-27
@author: 忧里修斯
'''
import smtplib
import email
import os
import traceback
from email.message import Message
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from ...
使用JDO查询时,要为查询涉及到的字段配置索引。否则报com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found..
在war/WEB-INF/下新建datastore-indexes-auto.xml
内容类似如下:
<datastore-indexes>
<datastore-index kind="FanOrder" ancestor="false" source="auto" ...
GAP使用JDO查询
- 博客分类:
- 中间件
注意事项:
1、与条件使用 &&
2、过滤条件queryTemplate 不能加上排序order by语句。解决方法是使用query.setOrdering("orderDate desc");
public List<FanOrder> queryByUsername(String username,String startDate,String endDate){
List<FanOrder> orders = null;
Query query = null;
try {
String quer ...
特别注意:
加锁的位置一定要只包住临界资源,如:
self.stateLock.acquire()
tstate = self.state
self.stateLock.release()
class NetworkMgr(object):
'''
网络设置管理
'''
def __init__(self):
self.state = True
self.getThread = None
self.stateLock = threading.RLock()
...
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
"""ping.py
ping.py uses the ICMP protocol's mandatory ECHO_REQUEST
datagram to elicit an ICMP ECHO_RESPONSE from a
host or gateway.
Copyright (C) 2004 - Lars Strand <lars strand at gnist org>;
This program is fr ...
1、main.py
#!/usr/bin/env python
#Boa:App:BoaApp
import wx
import mainFrame
modules ={'mainFrame': [1, 'Main frame of Application', 'mainFrame.py']}
class BoaApp(wx.App):
def OnInit(self):
self.main = mainFrame.create(None)
self.main.Show()
self.SetTopWindo ...
1、比如在浏览器通过以下地址访问:http://localhost:8000/webUI/index.html2、而在index.html通过jquery Ajax请求如下:$.ajax({ url: 'http://127.0.0.1:8000/?cmd=login, type:"GET", dataType:"text", ....});则会出现code 501, message Unsupported method ('OPTIONS')原因就是js限制了跨域访问。1使用的是localhost,而2使用的是127.0.0.1
1、首先下载已安装的对应Python版本的py2exe
2、将写好的程序拷入类似文件夹
C:\Python26\Lib\site-packages\py2exe\samples
3、假设写好的程序全部放在capturer文件夹中
4、编写setup.py
如下:
from distutils.core import setup
import py2exe
setup(
# The first three parameters are not required, if at least a
# 'version' is given, then a versioninfo ...
说明:必须安装PIL库
# -*- coding:UTF-8 -*-
'''
Created on 2010-5-6
@author: shiyong
'''
import os
from PIL import ImageGrab
import time
class Capturer(object):
'''截屏程序'''
def capture(self,path='C:\\images'):
'''
截屏并保存图片至path目录下
'''
...
# -*- coding:UTF-8 -*-
'''
Created on 2010-4-26
@author: shiyong
'''
import urllib
import sys
import urllib2
import mimetools, mimetypes
import os, stat
from IdongNet import IdongNet
from UserManager import UserManager
import cookielib
class Callable:
def __init__(self, anycal ...
# -*- coding:UTF-8 -*-
'''
Created on 2010-4-30
@author: shiyong
'''
import os
class Compare(object):
'''
文件夹比较工具
功能:目前只未比较文件的名称和大小,未比较md5
'''
def __init__(self):
'''
Constructor
'''
#遍历比较
def visit(self ...
class Getmyip:
def getip(self):
try:
myip = self.visit("http://www.ip138.com/ip2city.asp")
except:
try:
myip = self.visit("http://www.bliao.com/ip.phtml")
except:
try:
...