Saturday, July 9, 2011

Agile and Test driven

  1. Think before writing any code. Have a sketch in mediums other than code
  2. If you're not test-driven, think of the test scenario before coding. Take care about the error handling.
    • [JS] consider about the type passed in
  3. Prioritize the test scenario, make the code pass the tests by order.

inline-block在IE

  1. IE7下block元素不支持inline-block,但是inline元素默认支持inline-block
  2. 在所有浏览器里,inline-block的对齐需要通过vertical-align进行控制。默认的对齐方式是baseline,看起来很奇怪。调节成vertical-align: top会好看很多。

Monday, November 22, 2010

Android模拟器安装“emulator: ERROR: unknown virtual device name” 问题zz

发生在windows xp
造成这种问题的可能性有两种:
1.config.ini文件中包含有中文路径名
2.移动了系统默认的用户文件夹

解决办法:
1.修改路径。修改.ini 文件,即你的.Android 文件夹不能存在含有中文名的路径下,可以将它放到任何没有中文名的路径下都可以。
2.添加一个环境变量ANDROID_SDK_HOME,这个不能改,环境变量的值就是.Android 所在文件夹的路径,比如D:/ADT。
3.修改一下Eclipse中preferences-Android-Bulid-debug keystore,使其路径指向你的\.android\debug.keystore。

Thursday, April 30, 2009

PHP faq

1. php代码如何换行?
直接回车即可
2.数据库查询超时的解决?
超时的原因是不是执行sql语句,而是查询后遍历数据集的时间太长。
可以把数据集缓存本地再访问http://blog.csdn.net/arcow/archive/2006/07/13/915378.aspx

Wednesday, April 15, 2009

EXT js datastore 更改数据

patientStore.getAt(code).set('recommend','');
patientStore.commitChanges();
//PatientStore.loadData(patients);
patientView.refresh();

Tuesday, March 31, 2009

Piwik Os and browser

Piwik处理浏览器和操作系统的代码在piwik/libs/UserAgentParser/UserAgentParser.php

Thursday, March 26, 2009

piwik相关

1. 调整visit默认时间为1秒,如此则可以记录每次页面访问
2. 在visitlog表中添加user_id字段和service_id字段

Mobile banking ideas

1. Acess Anywhere so pay anywhere
2. Location based service
3. Mobile marketing, which includes things such as loyalty programs, ads, and electronic coupons. MasterCard plans to offer rewards and special offers via text messages that customers can redeem when they visit stores, as an incentive for using its mobile services. Similarly, Visa will provide customers with electronic coupons on their cell phones as part of its payment-related services. Other companies have similar mobile marketing efforts under way.
4. SMS receipts, text alert
5. Mobile top up: 直接支付到手机号

see this http://www.ocbc.com.sg/personal-banking/banking/Bnk_Ebk_MobileBnk_mbrportal.shtm
and this http://www.lloydstsb.com/media/lloydstsb2004/flash_files/lloydstsb_mobile_banking_r1.swf

5. 曲线管理。 消费分析

Wednesday, March 25, 2009

Piwik安装后不显示数据

问题描述:在下列情况下,dashboard没有数据显示
1 选择日期为当天
2 数据库中,表格piwik_log_visit有访问数据

解决方法

设置php.ini中的时区为

date.timezone = Asia/Shanghai

若无修改php.ini的权限
修改piwik源码中的 index.php , piwik.php:


date_default_timezone_set("Asia/Shanghai");

php支持的时区列表

如何收集用户数据

通过web analytics我觉得不太靠谱
因为注册用户的信息都存在后台数据库里。
直接与原系统整合,增加用户行为的数据库表格和字段;在程序中添加跟踪代码会比较容易而且容易扩展。】

Monday, March 23, 2009

Usage Analyse

1. 添加用户名
2. 添加访问的service
My Idea presentation implementation
userid较复杂:cookieid 或者 登录用户名
service可以通过链接加参数或直接通过提取链接的一段获得
3. 手机使用
大部分不支持,因为主流方法都是使用javascript嵌入
主要的手机浏览数据获取方法:
page tagging(页面添加额外代码,如javascript代码)Mobilytics
package sniffing 嗅探 Amethon
page redirecting 把访问手机网页先rediret到普通服务器再redirect回手机 Bango

piwik已支持的手机:http://dev.piwik.org/trac/changeset/907
可修改 libs/UserAgent/ 文件夹下的文件增加支持

Friday, March 20, 2009

Piwik visit 定义

Below texts are from here
#
How is a Unique Visitor counted in Piwik?

Unique Visitors is the number of visitors coming to your website; Unique Visitors are determined using cookies. If the visitor doesn't accept cookie, a simple heuristic is used to try to match the visitor to a previous visitor with the same features (IP, resolution, browser, plugins, OS, ...).
#
Positive Negative
How is a 'visit' defined in Piwik?

If a visitor comes to your website for the first time, or if he comes returns to your website 30 minutes after his last page view, this will be recorded as a new visit.

You can change this value for measuring visits (session timeout) in the configuration file (config/global.ini.php) by adjusting the visit_standard_length value (defaults to 1800 seconds, 30 minutes).

Unique Visitor 是通过cookie判断的,若cookie禁用,则通过IP,分辨率,浏览器,插件,操作系统等因素与前一访问者比较进行判断。

同一 Visitor 间隔 30分钟内的访问只算一次visit。 可配置

Thursday, March 19, 2009

Piwik 统计来源网站

假设已经在www.example.com/index.html上添加了PiWik跟踪代码
1. 在http://testsite中加入链接 href="http://www.example.com/index.html"
则testsite会显示在 Referers->WebSites
2. 在http://testsite中加入链接
href="http://www.example.com/index.html?piwik_campaign=testsite"
则 Referers->Campaignes中会显示 testsite

可以用api函数Referers.getCampaigns (idSite, period, date, expanded = '') 访问campaigns的数据 API

3 其他参数
; variable name used to specify a download link
; Example: '/piwik.php?idsite=1&download=http://piwik.org/piwik.zip' will redirect to 'http://piwik.org/piwik.zip'
download_url_var_name = download

; variable name used to specify a link to an external website
; Example: '/piwik.php?idsite=1&link=http://piwik.org/' will redirect to 'http://piwik.org/'
outlink_url_var_name = link

; variable that contains the name of the download or the outlink to redirect to
; Example: '/piwik.php?idsite=1&download=http://piwik.org/piwik.zip&name=Piwik last version'
download_outlink_name_var = name

; variable name to track any campaign, for example CPC campaign
; Example: If a visitor first visits 'index.php?piwik_campaign=Adwords-CPC' then it will be counted as a campaign referer named 'Adwords-CPC'
campaign_var_name = piwik_campaign

; variable name to track any campaign keyword
; Example: If a visitor first visits 'index.php?piwik_campaign=Adwords-CPC&piwik_kwd=My killer keyword' then it will be counted as a campaign referer named 'Adwords-CPC' with the keyword 'My killer keyword'
campaign_keyword_var_name = piwik_kwd

更多参数查看piwik安装目录下的
globalconfig.php 文件

Wednesday, March 18, 2009

090318

部署感想
刚从创新中心回来,程序顺利地在ipod上运行起来,效果比电脑模拟还要酷得多。
wemp号称是无视手机型号,根据手机自适应调整界面元素。实际上实现起来还是有很长的路;
例如,ipod上,
  1. 小图标显然不应当出现
  2. 顶部导航条的设计不错,导航条左侧是返回上一级菜单,中间是标题。
  3. 底部可设图片导航

WEMP development: Create portlet project

prerequisites: RAD 7.0 with portal tool and mobile portal toolkit; Websphere Portal 6.0 with mobile portal test enviroment(installed with mobile portal toolkit)
  1. Step 1 创建portlet项目

1.1 File->New->Portlet Project

1.2Specify the attributes(it's alright to set them as default) in the New Portlet Project wizard, take care of the following attributes

* target runtime: WebSphere Portal v6.0(if you don't see this runtime, click new to set one up.
* Portlet Type: Mobile Portlet

1.3 Specify the attributes at Portlet Setting page.
Note that ContentType->x-application/vnd.xdime+xml-> view should be checked if the portlet is going to deploy on mobile portal. Currently the mobile portlet only support view mode at default.
At this point, a new project has created. To change the project settings, we can modify the portlet.xml file located at \WebContent\Web-INF

2. The project structure


src: The java code is contained here. Initially there are 3 kinds of files: portlet, portlet session and language properties files.
At portlet file names like portlet.java we can handle the portlet request, redirect and action handling like a servlet file; It acts like controller of MVC pattern.
At portelt session file we can store some session attribute which both portlet file and jsp file can access. This file acts like model of MVC pattern.
Note that each portlet has its own portlet and portlet session file.

WebContent//jsp: HTML and xdime jsps can be found at this directory. HTML directory contains the jsps used at html chanel. xdime directory is more concerned for wemp developer. The jsps which is the presentation element for wemp apps are stored here. By default a sample jsp is created for a portlet. This acts like view of MVC pattern.

WebContent/mcs-policies: This directory stores the xdime component such as layout(mlyt), theme(mthm), image component(mimg) etc. The jsp file can acess them with path like "/sample.mimg" note that this component are xml files, we can view the xml source when open them with source view.

WebContent/WEB-INF: web.xml and portlet.xml lie here. They are all about the project configuration


3. Add portlet to existing portlet project


3.1 file->new->portlet
3.2 specify the attributes for portlet
portlet project: the exsiting portlet project
portlet type: mobile portlet
3.3 portlet setting page(do as 1.3)



Monday, March 9, 2009

090309

1. 创建portlet project
2. portlet页面的编辑
3. layout
4. theme
5. portletsession and portlet controller
6. summary: the flow
7. portal customization

Thursday, March 5, 2009

090305

1.通过style class属性,为grid定制外观。需要在theme文件里定义对应的class
2. This portlet could not be rendered 错误原因:
在doView里没有处理的语句。可能是参数写错了。

Monday, March 2, 2009

090302

1. Mobile Portal supports this by providing three different markup versions called tree (actually unnamed, but it is the default), icon, and pda. These markup versions are selected by creating a Portal client profile that maps a markup/markup version to a particular user agent.

Tuesday, February 24, 2009