Seven Yu @ 01/21/2009 (10:35 pm)

PyAMF 0.4 Released

Tags: , , ::

The PyAMF team is proud to announce the release of 0.4 final!

PyAMF is a lightweight library that allows Flash and Python applications to communicate via Adobe’s ActionScript Message Format.

This release fixes over a 100 tickets, see the changelog for the complete list of changes. We now consider the library to be stable and ready for production! A brief overview of the changes:

  • A new C extension to pyamf.util and pyamf.amf3. This is a work in progress, created using Cython, and more sections of the library will be moved to C as they are identified. Thanks to Gerard Escalante.
  • An adapter for SQLAlchemy 0.4/0.5 is available, allowing object graphs to be easily encoded. See the wiki for more information. Thanks to Dave Thompson and Michael Van Tellingen.
  • Improvements to the Google App Engine adapter to allow datastore objects to be easily encoded/decoded.

Check out the download page, installation instructions or the API documentation for more information.

Questions? First stop is the mailing list but we also hang out on IRC.

转载自: osflash

Seven Yu @ 01/19/2009 (2:55 pm)

让 VB6 IDE 也拥有系统主题

Tags: , ::

之前在我的另外一个Blog上曾经介绍过如何让 VB 程序呈现系统主题(具体细节请阅读这篇日志).

用同样的方法(操作更简单)可以让 VB IDE 的部分界面也拥有系统主题(以vb6为例). 当然更重要的是在 IDE 中编辑我们的软件界面时能实时地观察到最终效果.

方法就是在 vb 安装目录下建立一个名为 vb6.exe.manifest 的文件(通常是 C:\Program Files\Microsoft Visual Studio\VB98), 内容如下:

PLAIN TEXT >> XML:
  1. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  2. <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  3. <assemblyIdentity
  4.     version="1.0.0.0"
  5.     processorArchitecture="X86"
  6.     name="CompanyName.ProductName.YourApp"
  7.     type="win32"
  8. />
  9. <description>Your application description here.</description>
  10. <dependency>
  11. <dependentAssembly>
  12. <assemblyIdentity
  13.     type="win32"
  14.     name="Microsoft.Windows.Common-Controls"
  15.     version="6.0.0.0"
  16.     processorArchitecture="X86"
  17.     publicKeyToken="6595b64144ccf1df"
  18.     language="*"
  19. />
  20.  
  21. </dependentAssembly>
  22. </dependency>
  23. </assembly>

再启动 VB 就看到系统主题了, 新建个工程, 编辑下界面看看 ;)

Seven Yu @ 01/16/2009 (12:27 pm)

jQuery 中 find 和 filter 的区别

Tags: , , ::

之前对 jQuery 中的 findfilter 两个函数理解比较模糊, 以为功能差不多, 今天仔细研究了一下发现有很大区别.

  • find 函数是在当前对象集合子元素中进行查询;
  • filter 函数是对当前对象集合进行过滤, 利用过滤条件缩小范围;
  • find 函数的参数是 jQuery 选择器表达式;
  • filter 的参数也是选择器表达式, 但可以有多个条件, 用逗号分隔(逻辑或关系);
  • filter 的参数也可以是个函数, 调用函数时会自动传入 index 参数, 函数需返回 true或false 以选中或排除元素.

参考下面的例子:

代码:

PLAIN TEXT >> HTML:
  1. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js" type="text/javascript"></script>
  2. <script type="text/javascript"><!--
  3. $(function()
  4. {
  5.     $('div').find('.test').css('color','green');
  6.     $('div').filter('.test, .last').css('backgroundColor','#eee');
  7. });
  8. // --></script>
  9. <div class="first">Hello <span class="test">world</span>!</div>
  10. <div class="test3">Hello <span>world</span>!</div>
  11. <div class="test">Hello <span class="test">world</span>!</div>
  12. <div class="last">Hello <span>world</span>!</div>

效果:

Hello world!
Hello world!
Hello world!
Hello world!

Seven Yu @ 01/15/2009 (8:52 pm)

jQuery 1.3 released

Tags: ::

2009年1月14日是 jQuery 3岁生日, 也正在这一天, 万众期待的 jQuery 1.3 发布了.

新特性:

  • Sizzle: 牛逼的 CSS 选择器引擎.
  • Live 事件: 为 ajax 内容绑定事件更容易.
  • 重构 jQuery Event : 完全重写后拥有更简化的事件处理.
  • 重写了插入 HTML 部分: append HTML 代码部分更轻量级且更快速.
  • 重写了 Offset: Offset 计算更强更快更准确.
  • 不再支持浏览器检测($.browser): 替换以功能检测($.support).

更多细节参考: http://docs.jquery.com/Release:jQuery_1.3

jQuery 文档: http://docs.jquery.com/Main_Page/

jQuery API: http://remysharp.com/jquery-api/

google ajax api 地址: http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js

Seven Yu @ 01/05/2009 (10:55 pm)

Seven Color Picker V1.1.0

Tags: , ::

经过一天一宿的奋战, Seven Color Picker V1.1.0 诞生了, 这个软件可以说是之前 MyColor 的重生版.

因为之前的 MyColor 有内存泄漏问题, 而且版权信息还是 dofy.com (心中永远的痛)的, 源码又在一次硬盘事故(心中另一个永远的痛)中丢失了. 刚好最近有点时间就决定重新写一个.

新版本做了些调整, 没有内存泄漏的问题了, 欢迎大家下载试用. 下面是帮助.

===== 快捷键 ==========

C              打开/关闭 颜色面板
S              保存当前配色方案
空格        获取当前颜色并配色
方向键    控制鼠标移动
F1            帮助
Esc          退出

(若热键无响应,可尝试加 Ctrl 键)

===== 说明 ==========

1. 双击窗体空白区域可 打开/关闭 "颜色面板"
2. 单击 "颜色块" 可将颜色代码复制到剪贴板,
左键复制16进制值, 右键复制RGB值
3. 单击 "颜色面板" 可直接取色并配色
4. 方向键配合控制键(Shift,Ctrl,Alt)可增加移动速度
Shift, Ctrl, Alt 对应速度指数分别为 1, 2, 4
组合使用(或不使用)可以产生 0~7 的速度指数.
速度因数为5, 即可以产生 0, 5, 10, 15, 20, 25
30, 35 的移动速度.