- 浏览: 177591 次
- 性别:
- 来自: 武汉
最新评论
-
a564941464:
一样
Initializers -- object-c中的alloc init的解释 -
pj7670623:
幸好有~~~有道!!不然咋看的懂哦!
Initializers -- object-c中的alloc init的解释 -
higherzjm:
[flash=200,200][/flash][url][/u ...
用jdb调试Java程序
文章列表
UCenter 分为 MySQL 和远程两种接口连接方式,MySQL 方式是直接连接数据库因此速度较快,但当 UCenter
的服务端和客户端不在同一主机中且没有远程 MySQL 帐号的情况下,则只能使用远程连接方式。使用 UCenter
接口函数前请根据应用程序的需求定义以下相关常量:(此部分的配置可参看config_ucenter.php文件)
UC_CONNECT
连接 UCenter 的方式 mysql:MySQL 方式 空:远程方式
UC_DBHOST
UCenter 数据库主机
UC_DBUSER
UCen ...
How to Increase Mac OS X Snow Leopard Virtual Machine Screen Resolution on Virtu
- 博客分类:
- mac
- virtualbox
Are you running Snow Leopard on Intel or AMD Computers by any of the
desktop virtualization software VMware or VirtualBox? Then this post
will be helpful to increase screen resolution size of Snow Leopard
Virtual Machine to get full screen. Adjusting screen size including wide
screen on VMwar ...
In Scala, every defined variable has to be initialized at the point of its definition.
For instance, the statement var x: Int; is not regarded as a variable definition,
because the initializer ismissing
scala中的case class
- 博客分类:
- scala
scala中的case class中的字段不需要显式声明即可直接使用。
在创建一个case class时也无需new关键字。
(100.12).toInt
(100.12).asInstanceOf[Int]
PHP在页面输出XML的方法.避免乱码.
- 博客分类:
- php
一般都是编码的问题了.
PHP输出XML到页面的方式3种,记录一下:
1:
<?php
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<users>";
echo "<user>";
echo "<name>";
echo "小小菜鸟 ...
SocketServer.StreamRequestHandler中对客户端发过来的数据是用rfile属性来处理的,rfile是一个类file对象.有缓冲.可以按行分次读取;发往客户端的数据通过wfile属性来处理,wfile不缓冲数据,对客户端发送的数据需一次性写入.
如下代码:
#! /usr/bin/env python
#coding=utf-8
'''
单线程服务器程序
'''
from SocketServer import TCPServer as TCP, StreamRequestHandler as SRH
class MyTCPHandler(SRH):
...
input([prompt])
等同于 eval(raw_input(prompt)).
警告:input的输入要求是一个有效的python表达式.
文档原文:
This function is not safe from user errors! It expects a valid Python expression as input; if the input is not syntactically valid, a SyntaxError will be raised. Other exceptions may be raised if there is an error dur ...
wxwidget程序注释
- 博客分类:
- wxwidget
#include "wx/wx.h"
/*声明app*/
class MyApp: public wxApp
{
virtual bool OnInit();
};
/*声明frame*/
class MyFrame: public wxFrame
{
public:
MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
void OnQuit(wxCommandEvent& event);
...
This mini tutorial aims to help people make quick judgements concerning syntax and basic principles. The complete Hello World program is here
You have to include wxWidgets's header files, of course. This can be done on a file by file basis (such as #include "wx/window.h") or using one glob ...
scala中的协变,逆变
- 博客分类:
- scala
trait Queue[+T] { ... }
Prefixing a formal type parameter with a + indicates that subtyping is covariant (flexible) in that parameter. By adding this single character, you are telling Scala that you want Queue[String], for example, to be considered a subtype of Queue[AnyRef]. The compiler will check th ...
scala中的for表达式
- 博客分类:
- scala
通常,scala中for表达式有如下形式:
for ( seq ) yield expr
seq是一个生成器,变量定义,过虑器的序列,序列元素用分号分隔,下面是一个for表达式的例子:
for (p <- persons; n = p.name; if (n startsWith "To"))
yield n
也可以使用大括号来代替圆括号,那么分号就变成了可选项:
for {
p <- persons // a generator
n = p.name // a definition
if (n startsWith "To&qu ...
GridView: A view that shows items in two-dimensional scrolling grid. The items in the grid come from the ListAdapter associated with this view. 简单说,GridView就是我们资源管理器平常见到的一个个文件的icon显示方式。
上面提及到了,GridView的Item是来 ...
Lift项目的生成、配置和运行
- 博客分类:
- lift
1. 安装Maven,配置好环境变量。
2. 使用Maven生成一个Lift项目,如以下命令可生成一个使用Scala 2.8.1、Lift 2.3的HelloWorld项目:
mvn archetype:generate ^
-DarchetypeGroupId=net.liftweb ^
-DarchetypeArtifactId=lift-archetype-basic_2.8.1 ^
-DarchetypeVersion=2.3 ^
...