08/19/2008 09:47:00 tommy wrote:

目前版本GAE SDK的Python限制

目前版本GAE的Python运行环境使用的是Python 2.5.2.

工作于Python运行环境的代码必须都是由纯粹的Python写成,不能包括任何c扩展或者其它任何需要编译的语言代码。

这个Python运行环境包括一个受限版的Python标准库。因为不被App Engine支持,所以有些模块被禁用掉了,例如网络和文件系统读写API。另外,os模块是可用的,当然,除了某些不受支持的特性之外。如果你企图调用不受支持的模块或者特性的话,将会触发一个异常(我说:当然,这不是我们希望见到的事情,所以。。。嗯。。。别违规)

有些标准库的模块被替换掉了,或者重新修改以适应App Engine的运作,例如:

  • cPickle被重命名为pickle。调用cPickle命名空间引用的功能将不再可用。
  • marshal现在是个空引用。可以正常导入,但是不会起任何作用。
  • 同样,这些模块也成了空引用,impftplibselectsocket (就像上面说得,这些都是网络模块,说白了,Google不想让你自己写socket级别的网络应用,而是调用Google提供的类似于GData之类的API)
  • tempfile被禁用掉了,除了TemporaryFile之外,对这个模块其它功能的调用将会触发StringIO异常。
  • logging模块是可用的,而且我们非常鼓励开发者使用这个模块!

除了Python的标准库和App Engine SDK的库之外,我们也提供了一些第三方的库,比如:

你也能在程序中包括一些其它的由纯Python写作的库,把这些库放在你的程序开发路径下面。如果你创建了一个指向某一个第三方模块的符号链接,那么在通过appcfg.py上传程序的时候,appcfg将会自动的将这个模块包含在你的程序中,一并上传到服务器。(当然,这是基于Linux和OS X开发者来说的,Win32没有符号链接这么一说。)

Python的模块搜索路径包括你的应用程序的根(即包括app.yaml的那个路径),你自己创建的放在根路径下面的模块,通过对根路径的相对引用是可以被访问到的,但是别忘了在模块路径下面建立一个__init__.py文件,这样,Python才知道这个路径下的所有文件是在一个里面。

read more

comments (0)

add comment

08/19/2008 07:24:19 tommy wrote:

Google is announcing a beta release of the Android SDK

Android SDK 1.0 is coming, Dan Morrill from Google™ post a article on Android blog:

I'm pretty happy today, for two reasons. First, I'm happy because I get to let everyone know that we're releasing a beta SDK. You can read about the new Android 0.9 SDK beta at the Android Developers' Site, or if you want to get straight to the bits, you can visit the download page. Once you've got it, be sure to visit our Developer Forum if you have any questions.

Back in November, we made some SDK builds available that we referred to as "early look" SDKs. The goal was to give developers insight into the platform as early on as possible, and to get some initial feedback. Since then, we've been working with our Open Handset Alliance partners to incorporate much of that feedback, and finish the first devices. Since those devices are shipping in the fourth quarter, the platform is now converging on a final "Android 1.0" version.

The beta SDK that we're releasing today is the first big step on the SDK's road to compatibility with 1.0. Since this is a beta release, applications developed with it may not quite be compatible with devices running the final Android 1.0. However, the APIs are now pretty stable and we don't expect any major changes. If you're one of the many developers who were waiting for something a bit more mature, this might be a good time to take another look.

Since we're now moving quickly toward 1.0, it may also help to know which direction we're headed. To help out, we've also prepared a development roadmap. This will be a living document, and we'll keep it up to date as the Android landscape evolves. Currently it covers the next few months, roughly through the end of the year and a bit into next year. We'll update it with additional detail as we are able to, but even right now it can help give you a picture of how things will play out as the first phones draw near.

Enough of that though -- you're probably wondering what's actually new in the SDK. Well, you should read the Release Notes, the Change Overview and the API Delta Report for all the details, but here are a few highlights:

  • First and most obviously, the new Home screen is included, along with a ton of UI changes for 1.0.
  • Some new applications are included: an Alarm Clock, Calculator, Camera, Music player, Picture viewer, and Messaging (for SMS/MMS conversations.)
  • Several new development tools were added, such as a graphical preview for XML layouts for users of Eclipse, and a tool for constructing 9-patch images.
  • Since we've got a new Home screen application now, we thought the now-obsolete version from the M5 early-look SDK might be helpful to developers, so its source is included as a sample.
  • A number of new APIs are fleshed out and improved, and others are now close to their final forms for 1.0.
  • Tons of bugs were fixed, of course. (If you had problems with the MediaPlayer, try it now!)

There are a lot of changes -- the ones in the list above are just my personal favorites, so you should check out the links above for the full story. Not all the changes are additions, though: I'm sorry to say that we had to remove a few things, such as the GTalkService (for security reasons), and the Bluetooth API. There's a bit more detail in the links above, and we'll follow up on those in particular here in this blog to give you the scoop. In fact, we've got a little list of topics we want to talk about here, so stay tuned.

At the top of this post I said I was happy for two reasons, and now you know one of them -- but what about the other? Well, the second reason is because now that this is out I can finally go get some sleep!

oh yeah, you got some sleep ;-)

read more

comments (0)

add comment

08/18/2008 19:46:45 tommy wrote:

Righteous Kill Trailer - Pacino & De Niro 2008 德尼罗和帕西诺的新片预告片

Academy Award® winners Robert De Niro (Raging Bull) and Al Pacino (Scent of a Woman) star as a pair of veteran New York City police detectives on the trail of a vigilante serial killer in the adrenaline fueled psychological thriller Righteous Kill, directed by Jon Avnet (Red Corner, Fried Green Tomatoes) and written by Russell Gewirtz (Inside Man). The cast also features hip-hop superstar Curtis Jackson (Get Rich or Die Tryin).

After 30 years as partners in the pressure cooker environment of the NYPD, highly decorated Detectives David Fisk and Thomas Cowan should be ready for retirement, but arent. Before they can hang up their badges, they are called in to investigate the murder of a notorious pimp, which appears to have ties to a case they solved years before.

Like the original murder, the victim is a suspected criminal whose body is found accompanied by a four line poem justifying the killing. When additional crimes take place, it becomes clear the detectives are looking for a serial killer, one who targets criminals that have fallen through the cracks of the judicial system. His mission is to do what the cops cant do on their owntake the culprits off the streets for good. The similarities between the recent killings and their earlier case raise a nagging question: Did they put the wrong man behind bars?

imdb link

read more

comments (0)

add comment

08/18/2008 19:17:01 tommy wrote:

Michael Phelps不幸的童年以及他如何成长为游泳世界记录保持者

环境的艰苦并不会摧毁一个人,虽然外界环境很重要,但是更重要的是持之以恒的毅力和克服困难的决心。没有什么事情是不可能实现的,面对困难的时候,问问自己你能像Phelps一样坚持每周七天游10万米吗?格罗夫说偏执狂才能生存,从某种角度说,这句话的确很对,有人瞧不起丛林法则,是的,但是有时候设想自己正在丛林中也不见得是个坏事!

read more

comments (0)

add comment

08/18/2008 14:56:17 tommy wrote:

The FREE online text encrypter is live now!

I release the free online text encrypter just now, it's powered by henrit's excellent As3 Crypto Library, click the link to use it ;-)

read more

comments (0)

add comment

08/18/2008 04:22:14 anonymous wrote:

As3 Crypto is a cryptography library written in Actionscript 3

As3 Crypto is a cryptography library written in Actionscript 3 that provides several common algorithms. This version also introduces a TLS engine (TLS is commonly known as SSL.)

  • Protocols: TLS 1.0 support (partial)
  • Certificates: X.509 Certificate parsing and validation, built-in Root CAs.
  • Public Key Encryption: RSA (encrypt/decrypt, sign/verify)
  • Secret Key Encryption: AES, DES, 3DES, BlowFish, XTEA, RC4
  • Confidentiality Modes: ECB, CBC, CFB, CFB8, OFB, CTR
  • Hashing Algorithms: MD2, MD5, SHA-1, SHA-224, SHA-256
  • Paddings available: PKCS#5, PKCS#1 type 1 and 2
  • Other Useful Stuff: HMAC, Random, TLS-PRF, some ASN-1/DER parsing

The library is offered under the BSD license, and include several derivative works from Java, C and javascript sources. Check the LICENSE.txt file for a list of contributors.

You can look at a demo of the functionality of the library. It's built with Flex 2. It includes a unit test tab, and a benchmark tab.

read more

comments (0)

add comment

08/15/2008 03:22:20 tommy wrote:

网站将在一到两个月内更新

这个简陋的站点将在一到两个月以内全面更新,首页将不再是blog内容,所有的文章将被移入blog页面。

read more

comments (0)

add comment

08/14/2008 17:27:41 tommy wrote:

有时候GAE上传服务无法正常连接

最近一个星期以来,经常出现appcfg无法正常update,也就是说,无法正常连接到我的GAE站点,来上传资讯,为什么?why?我不知道,以下有几种可能的解释:

  • GAE的官方服务器不稳定,导致间断性的无法连接。(排除,我压根就没听到国外方面有无法update的消息放出。。。groups上面也没人提到过,用国外的服务器测试连接,也蛮正常的。)
  • 被所谓的GFW屏蔽掉,这个倒是蛮有可能,因为Google拥有的好几个IP真的是被屏蔽掉了,如果不是应用了Google Apps来配置我的GAE服务器,而是继续用Google的二级域名的话,我从国内一样无法访问喔,特别是这个IP 209.85.173.118
  • 奥运期间,国内出口十分拥挤(我宁愿相信是这个原因,至少可以让我看到GAE在国内不会被完全屏蔽的希望!)

GAEAndroid 这些由Google提供的开放技术平台,希望不要被某些小脑控制思维的人给耽误了!

read more

comments (0)

add comment

08/14/2008 17:13:14 tommy wrote:

Use FlashDevelop Instead of FlexBuilder

上一个基于Flex3的Flash播放器是用FlexBuilder3实作的,虽然不是很好看,但是FlexeBuilder的GUI建设效率却让人印象蛮深刻,真的可以拖拖组件边可以搭建Flash UI,以前都不敢想,其实话说回来,用mxml写的方式倒也不算艰苦,毕竟对曾经用过Win32 SDK写过GUI的人来说,这样已经算蛮好了。

FlexBuilder最头疼就是速度了,在我的笔记本上运行虽然不算慢,但是习惯了快速运行的IDE的人来说,真是会有点受不了,也不像是Pydev之类,写写代码,感觉不出什么速度问题,但是涉及到GUI设计的时候,用eclipse到真是有点不习惯,现在又回归到FlashDevelop,C#的速度表现在Win下面的确还是更胜一筹,而且还有haxe的plugin可以使用,知足了!

速度,速度,新的Eclipse 3.4版本进步很多,不光速度加快,以前很让我诟病的update功能现在真的变得蛮好用!而且能改变大部分UI Dialog的字体,这样就可以用我比较喜欢的Trebuchet MS做UI呢,当然涉及到Editor部分还是Monaco!

可以点击这里下载FlashDevelop,点击这里下载Flex SDK, 点击这里下载haxe,(说实话,这个blog的UI部分也从haxe官网捞了不少东西喔!)

read more

comments (0)

add comment

07/30/2008 18:00:20 rocky wrote:

网站管理员指南

网站管理员指南

遵循这些指南有助于 Google 查找您的网站并将其编入索引和进行排名。 即使您选择不采纳这些建议,我们也强烈建议您对"质量 指南"多加留意,其中简要说明了一些可能造成网站从 Google 索引中彻底删除或受到其他处罚的违禁行为。 如果网站受到处罚,则可能不会再出现在 Google.cn 或任何 Google 合作伙伴网站的搜索结果中。

  • 设计、内容与技术指南
  • 质量指南

网站准备就绪后:

  • 将其他相关网站链接到您的网站。
  • 通过 http://www.google.com/addurl.html 将其提交给 Google。
  • 提交 Sitemap,作为 Google 网站管理员工具的一部分。 Google 使用您的 Sitemap 来了解您网站的结构,并提高对您网页的抓取率。
  • 确保应了解您网页的所有网站都知道您的网站已处于在线状态。
  • 将您的网站提交到相关的目录,例如,Open Directory Project(开放式目录管理系统)和 Yahoo!,以及其他特定行业的专业网站。

设计与内容指南

  • 网站应具有清晰的层次结构和文本链接。 每个网页应至少可以通过一个静态文本链接打开。
  • 为用户提供网站地图,列出指向网站重要部分的链接。 如果网站地图上的链接超过或大约为 100 个,则需要将网站地图拆分为多个网页。
  • 网站应实用且信息丰富,网页文字应清晰、准确地表述要传达的内容。
  • 要考虑到用户会使用哪些字词来查找您的网页,确保网站上确实包含了这些文字。
  • 尽量使用文字而不是图片来显示重要的名称、内容或链接。 Google 抓取工具无法识别图片中所含的文字。
  • 确保 TITLE 标记和 ALT 属性具有描述性且准确无误。
  • 检查链接是否损坏,并确保 HTML 格式正确。
  • 如果要使用动态网页(即网址中包含"?" 字符),请注意并非每一个搜索引擎抓取工具都能抓取动态和静态网页。 这有助于缩短参数长度并减少参数数目。
  • 将特定网页上的链接限制在合理的数量内(少于 100 个)。

技术指南

  • 使用诸如 Lynx 的文本浏览器来检查您的网站,因为大多数搜索引擎抓取工具查看您网站的方式与 Lynx 几乎一样。 如果诸如 Javascript、Cookie、会话 ID、框架、DHTML 或 Flash 等复杂功能造成您在文本浏览器中无法看到整个网站,则搜索引擎抓取工具在抓取您的网站时可能会遇到问题。
  • 允许搜索漫游器抓取您网站时不抓取会话 ID 和跟踪其访问网站路径的参数。 这些技术对跟踪单个用户的行为非常有用,但漫游器的访问模式却完全不同。 如果采用这些技术,可能会导致对网站的索引编制不完整,因为漫游器可能无法排除那些看上去不同,但实际却指向同一个网页的网址。
  • 确保您的网络服务器支持 If-Modified-Since HTTP 标头。 通过该功能,您的网络服务器可以告诉 Google 自上次抓取您的网站以来,内容是否已发生变化。 该功能可以节省您的带宽和开销。
  • 利用网络服务器上的 robots.txt 文件。 该文件会告诉抓取工具哪些目录能够抓取,哪些不能。 确保该文件是网站的最新版本,以免意外拦截 Googlebot 抓取工具。 请访问 http://www.robotstxt.org/wc/faq.html ,了解如何在漫游器访问您的网站时对其进行指示。 您可以使用 Google 网站管理员工具中的 robots.txt 分析工具来测试 robots.txt 文件,以确保正确使用此文件。
  • 如果您的公司购买了内容管理系统,请确保该系统能导出您的内容,以便搜索引擎抓取工具可以抓取您的网站。
  • 使用 robots.txt 可避免抓取搜索结果页或其他自动生成的页面,这些页面对来自搜索引擎的用户没有附加价值。

质量指南

这些质量指南涵盖了最常见的作弊形式或操纵行为,对于此处未列出的其他误导行为(例如,通过注册知名网站的错拼形式来欺骗用户),Google 仍可予以拒绝。 不要抱有侥幸心理,认为某种欺骗手段未在本页中列出,Google 就会认可该手段。作为网站管理员,与其花费大量时间寻找漏洞加以利用,不如尽其所能维护基本原则,以便为用户带来更好的体验,从而使网站获得更高的排名。

如果您认为其他网站正在滥用 Google 质量指南,请通过 https://www.google.com/webmasters/tools/spamreport?hl=zh-CN 举报该网站。 Google 希望能开发出灵活的自动解决方案来解决上述问题,因而尽量避免一一处理违禁行为。 我们收到的滥用行为报告将用于创建灵活的规则系统,以便于识别并阻止以后的滥用企图。

质量指南 - 基本原则

  • 设计网页时该考虑的是用户,而不是搜索引擎。 不要欺骗用户,或提交给搜索引擎一种内容,而显示给用户另一种,这种做法通常称为"隐藏"。
  • 请不要为了提高搜索引擎排名而弄虚作假。 一个简单分辨是非的方法是:您是否可以坦然地跟竞争对手网站解释您对网站所做的事情。 另一个有用的测试手段即扪心自问:"这能否给我的用户带来帮助? 如果不存在搜索引擎,我是否还会这样做?"
  • 请不要参与旨在提高您的网站排名或 PageRank 的链接方案。 尤其要避免链接到违禁的网站或"恶邻",因为您自身的排名会受到这些链接的负面影响。
  • 请不要使用未经授权的计算机程序来提交网页和检查排名等, 这些程序会耗用计算机资源并违反我们的服务条款。 Google 不建议使用 WebPosition Gold™ 这类产品向 Google 发送自动查询或用程序编写的查询。

质量指南 - 具体指南

  • 请不要使用隐藏文本或隐藏链接。
  • 请不要使用隐藏真实内容或欺骗性的重定向手段。 请不要发送自动查询给 Google。
  • 请不要加载使用无关关键字的网页。
  • 请不要创建包含大量重复内容的多个网页、子域或域。
  • 请不要制作欺诈性或安装有病毒、特洛伊木马或其他有害软件的网页。
  • 请不要专门针对搜索引擎创建"桥页",或使用其他如联属计划这类原创内容很少或几乎没有原创内容的俗套 (cookie cutter) 方法。
  • 如果您的网站参与联属计划,请确保您的网站可为其增添价值。 请提供独特且相关的内容,使用户有理由首先访问您的网站。

如果您断定您的网站不符合这些指南,可进行修改使其满足要求,然后提交网站以便重新审核。

read more

comments (1)

add comment


« prev