rank of subdirectory and subdomain
the increase in rank of subdirectory can banifit the rank of domain, viceverse. For example , sometimes you search on the network , you may find that the url with subdirectory may in advance of domain. The main reason is the benefit of its domain. Although sub directory is good, subdomain is also useful when you want to classify your website since subdomain is more helpful to further classify your website , and difference ranking in different subdomain.
user exprense of subdomain and subdirectory
subdomain , subdirectory : which one more prefered by the search engine?
ranking of subdirectory is mainly determined by the domain, if domain fully recorded by search engine , this can optimal the recording of subdirectory. Compare to subdirectory, subdomain is relatively independent and works like a new website . The recording speed is slower than the subdirectory. The same , subdomain have a preriod of ( search engine checking ).
subdirectory make userly easier to remember the domain of a website and subdomain make user easier to remember the url of subdomain, this may user easier to input its url directly. This , may greatly benefit your website if your web site is professional , that can be further vary in area or other thing.
In all , if your website is not that full of content, we recommend you use the subdirectory , this can build up your main theme of your website fastly. If your website have many theme and rich of content , we recommend you use the subdomain. If a subdomain punished by search engine would not greatly affect your domain.
This articly is from : http://www.theplanzero.com/blog/2010/01/the-differences-between-subdomain-and-subdirectory/
January 31, 2010
The differences between subdomain and subdirectory
結婚前後對話
結婚前後對話
好有趣, 大家睇睇先。
< 結婚前> 往↓看:
他:太好了!我期盼的日子終於來臨了!我都等不及了!
她:我可以反悔嗎?
他:不,你甚至想都別想!
她:你愛我嗎?
他:當然!
她:你會背叛我嗎?
他:不會,你怎麼會有這種想法?
她:你可以吻我一下嗎?
他:當然,決不可能只有一下!
她:你有可能打我嗎?
他:永遠不可能!
她:我能相信你嗎?
<結婚後 > 從下往上看↑
遇到一位爆强3.1后魔兽职业带刷高端玩家
由于家中电脑被某人长期霸占,所以我晚上只能长期混迹在网吧。随着国服版本的落后,网吧里玩WOW的人是越来越少,现在还在网吧看到玩WOW的,就有一种亲切感,所以总不自觉的凑过去看上一会或搭会讪。
前几天,就是因为这样,我见证了一个3.1后的魔兽新玩家是如何快速成为职业带刷高玩的。
他玩WOW刚2个月,所在服务器2区安纳塞隆部落 。他说他2个月前开始玩WOW,是因为受朋友影响。
最早建号,他选择了法师。他跟我讲述了他最初选择法师的理由-朋友说法师练级快,满级后可以带刷副本,赚钱比较容易。他说他玩其他的游戏时,最喜欢干的也是要在游戏中赚钱,那时他玩游戏的最大乐趣所在。所以再选择玩WOW,第一个要打听的便是怎么玩才能赚钱,而且是要赚很多钱,他始终就是要做游戏中的赚钱达人!
他越讲越有兴头,直接夸夸其谈起来……
(more…)
[Pytnon]學習筆記18-Python中的全局变量
全局变量不符合参数传递的精神,所以,平时我很少使用,除非定义常量。今天有同事问一个关于全局变量的问题,才发现其中原来还有门道。
程序大致是这样的:
CONSTANT = 0
def modifyConstant() :
print CONSTANT
CONSTANT += 1
return
if __name__ == ‘__main__’ :
modifyConstant()
print CONSTANT
运行结果如下:
UnboundLocalError: local variable ‘CONSTANT’ referenced before assignment
看来,全局变量在函数modifyConstant中边成了局部变量,似乎全局变量没有生效?
做点修改:
CONSTANT = 0
def modifyConstant() :
print CONSTANT
#CONSTANT += 1
return
if __name__ == ‘__main__’ :
modifyConstant()
print CONSTANT
运行正常,看来函数内部是可以访问全局变量的。
所以,问题就在于,因为在函数内部修改了变量CONSTANT,Python认为CONSTANT是局部变量,而print CONSTANT又在CONSTANT += 1之前,所以当然会发生这种错误。
那么,应该如何在函数内部访问并修改全局变量呢?应该使用关键字global来修饰变量(有点像PHP):
CONSTANT = 0
def modifyConstant() :
global CONSTANT
print CONSTANT
CONSTANT += 1
return
if __name__ == ‘__main__’ :
modifyConstant()
print CONSTANT
就这么简单!
[Python][Python]學習筆記登陸網站
对于大部分论坛,我们想要抓取其中的帖子分析,首先需要登陆,否则无法查看。
这是因为 HTTP 协议是一个无状态(Stateless)的协议,服务器如何知道当前请求连接的用户是否已经登陆了呢?有两种方式:
1. 在URI 中显式地使用 Session ID;
2. 利用 Cookie,大概过程是登陆一个网站后会在本地保留一个 Cookie,当继续浏览这个网站的时候,浏览器会把 Cookie 连同地址请求一起发送过去。
Python 提供了相当丰富的模块,所以对于这种网络操作只要几句话就可以完成。我以登陆 QZZN 论坛为例,事实上下面的程序几乎所有的 PHPWind 类型的论坛都是适用的。
# -*- coding: GB2312 -*-
from urllib import urlencode
import cookielib, urllib2
# cookie
cj = cookielib.LWPCookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)
# Login
user_data = {‘pwuser’: ‘你的用户名’,
‘pwpwd’: ‘你的密码’,
‘step’:’2′
}
url_data = urlencode(user_data)
login_r = opener.open(“http://bbs.qzzn.com/login.php”, url_data)
一些注释:
1. urllib2 显然是比 urllib 高级一点的模块,里面包括了如何使用 Cookies。
2. 在 urllib2 中,每个客户端可以用一个 opener 来抽象,每个 opener 又可以增加多个 handler 来增强其功能。
3. 在构造 opener 时指定了 HTTPCookieProcessor 做为 handler,因此这个 handler 支持 Cookie。
4. 使用 isntall_opener 后,调用 urlopen 时会使用这个 opener。
5. 如果不需要保存 Cookie,cj 这个参数可以省略。
6. user_data 存放的就是登陆所需要的信息,在登陆论坛的时候把这个信息传递过去就行了。
7. urlencode 功能是把字典 user_data 编码成”?pwuser=username&pwpwd=password”的形式,这样做是为了使程序易读一些。
最后一个问题是,pwuser、pwpwd 这类的名字是从哪儿来的,这就要分析需要登陆的网页了。我们知道,一般的登陆界面都是一个表单,节选如下:
从这里可以看出,我们需要输入的用户名密码对应的就是 pwuser 和 pwpwd,而 step 对应的则是登陆(这个是尝试出来的)。
注意到,这个论坛表单采用的是 post 方式,如果是 get 方式则本文的方法就需要变动一下,不能直接 open,而是应该首先 Request,然后再 open。更详细的请看手册…
January 30, 2010
[PHP]如何去掉轉行符”\n”?
使用 str_replace(“\n”, “”, string) 沒反應, 怎麼辦?
原來是這樣:
str_replace(“\r\n”, “”, string)
哦~~~
January 29, 2010
as3.0 实现FLASH在浏览器中全屏
html code
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,60" width="600" height="400" id="fullscreen" align="middle"> <param name="allowFullScreen" value="true" /> <param name="movie" value="fullscreen.swf" /> <param name="bgcolor" value="#333333" /> <embed src=http://www.y360.net/FLASHEDU_GP/"fullscreen.swf" allowFullScreen="true" bgcolor="#333333" width="600" height="400" name="fullscreen" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> |
as3.0
import flash.display.Stage; import flash.display.StageDisplayState; import flash.events.FullScreenEvent; stage.displayState = StageDisplayState.FULL_SCREEN //启动全屏幕 stage.displayState = StageDisplayState.NORMAL //返回一般模式 对于全屏事件可以这样写 Stage.addEventListener( FullScreenEvent.FULL_SCREEN, fullScreenHandler ); private function fullScreenHandler( event:FullScreenEvent ):void { if ( event.fullScreen == true ) { //如果当前是全屏模式 } else if ( event.fullScreen == false ) { //如果当前是一般模式 } }; |
Palm pre 與 Iphone 之爭
對於手機玩家來說,蘋果iPhone和Palm Pre的影響力都是無法回避的。許多人熱衷於對比Palm Pre和iPhone之間的優劣,但卻很少有人知道iPhone、Palm Pre有著相同的老爸,並且在兩款產品後面隱藏了蘋果與Palm公司的多年恩怨。
98句經典語錄
1. 你以為最酸的感覺是吃醋嗎?不是,最酸的感覺是沒權吃醋。
2. 低頭要有勇氣,抬頭要有底氣。
3. 上天決定了誰是你的親戚,幸運的是在選擇朋友方面它給你留了餘地。
4. 人生就像一杯茶,不會苦一輩子,但總會苦一陣子。
5. 傻與不傻,要看你會不會裝傻。
6. 女人用友情來拒絕愛情,男人用友情來換取愛情。
7. 幸福是可以通過學習來獲得的,儘管它不是我們的母語。
8. 不要見一個愛一個,愛的太多,你的愛就要貶值。
9. 想完全瞭解一個男人,最好別做他的戀人,而做他的朋友。
10. 朋友就是把你看透了,還能喜歡你的人。
(more…)