Thursday, October 18, 2012

Gmail IME, Gmail加入了输入法

刚在黑板报看见说Gmail有了输入法,像translate一样,到邮件界面看,并没有啊! 再到设置里,翻到底也没有?! 最后发现语言旁边有个更多语言选项,在下面就有启动输入工具,打上勾,编辑一下输入法(选择不少,不过没几样我要的,不像百度可以启动手写输入),最后保存,等页面刷新后,在邮件列表左上角就有个按钮是输入选项了。

Wednesday, March 28, 2012

Prompt TextInput in GWT

Prompt text input is very common and useful widget, but GWT does not have it. I create this one with ability to show prompts at the initial and reset to prompt if the text input text is empty. I should thank David Chandler and Geoffrey Wiseman for their implementation of prompt input. Enhancement of this widget is able to be used in UiBinder, show prompt on Blur and uses styleDependentName instead. Problems of this widget are the "italic" style can not set for the prompt if the font-size is small. The prompt default size is changed, I have not found a solution yet. Is it a bug of GWT InputBox?

Source Code for PromptTextBox.java
package com.robinria.gwt.client.custom.widget;

import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
import com.google.gwt.uibinder.client.UiConstructor;
import com.google.gwt.user.client.ui.TextBox;

/**
 * TextBox with input prompts. Prompts hidden When input receive type, click and
 * focus event. Prompts shown when input receives blur event or on initial.
 * 
 */
public class PromptTextBox extends TextBox implements BlurHandler,
  FocusHandler, ClickHandler, KeyPressHandler {

 private String promptText;
 private String promptStyleDependentName;

 /**
  * Construct a new TextBox with prompt text. When instantiate this using
  * UiBinder, either fill in a field marked with @UiField(provided=true),
  * or have to define the all the arguments in UiBinder file.
  * Important: Set styleName should not be used, use set stylePrimaryName instead.
  * 
  * @param promptText prompt text
  * @param promptStyleDependentName style dependent name for prompt text
  */
 @UiConstructor
 public PromptTextBox(String promptText, String promptStyleDependentName) {
  this.promptText = promptText;
  this.promptStyleDependentName = promptStyleDependentName;
  this.addKeyPressHandler(this);
  this.addFocusHandler(this);
  this.addClickHandler(this);
  this.addBlurHandler(this);
  setPrompts();
 }

 /**
  * {@inheritDoc}
  */
 @Override
 public void onBlur(BlurEvent event) {
  if (getText().isEmpty()) {
   setPrompts();
  }
 }

 /**
  * {@inheritDoc}
  */
 @Override
 public void onFocus(FocusEvent event) {
  this.setSelectionRange(0, 0);
 }

 /**
  * {@inheritDoc}
  */
 @Override
 public void onClick(ClickEvent event) {
  if (promptText.equals(getText())) {
   hidePrompts();
  }
 }

 /**
  * {@inheritDoc}
  */
 @Override
 public void onKeyPress(KeyPressEvent event) {
  if (promptText.equals(getText())
    && !(event.getNativeEvent().getKeyCode() == KeyCodes.KEY_TAB)) {
   removePrompts();
  }
 }

 private void setPrompts() {
  this.addStyleDependentName(promptStyleDependentName);
  this.setText(promptText);
 }

 private void removePrompts() {
  this.removeStyleDependentName(promptStyleDependentName);
  this.setText(null);
 }
}
You need to style your prompt input box.
.promptTextBoxStyle {
 overflow: hidden;
}

.promptTextBoxStyle-promptStyle {
 color: #999999;
 /*  - Have this style cause default input size smaller;
  - so comment out for now.
 font-style: italic;
 */
}

Then, if you are using UiBinder, the Xml code is



 


蜀香苑FACEBOOK有了自己的URL了

今天看看facebook,蜀香苑page已经有23人like了,想看看能不能加短的URL,没想到真行了,今后这个<蜀香苑> Facebook URL: http://www.facebook.com/sichuanlegend 就更好记住了. 难道Facebook 取消了名额限制了?

Thursday, February 9, 2012

Dell Voice for Canada

While Google voice for calling phone is available only in US on Android, you can use Dell Voice to call Canadian phone for FREE. Dell's offer now is good for now, I believe Google or others are going to follow this soon.

Tuesday, August 30, 2011

Google+ has games

Just tried a moment ago. It has many popular games including Angry Birds, which was available only in Chrome for browsers. Now I can play it in Firefox.
Great!

Monday, August 29, 2011

Google Image Search

Just tried google's image search for curiosity. I use the profile picture from Szechuan Legend Restaurant's Facebook page.
The result comes with many colorful bamboo design. and the suggested keyword is "bamboo background". Not bad in my opinion.

蜀香苑在Facebook上的的广告

上周末在Facebook上打了个广告,两天就花掉了2大圆,而我还没看见广告到底出现在哪里。头一次做广告,还有点摸不倒头脑。不过蜀香苑Page倒是有了不少人气了,Like的人加到了12人。而且把Profile的图片更换了一下。希望人数能再快点,到25人就能做更多事了。

New Phone System

We had the new phone system today in our office. Looks fancy however ...
The phone is feature rich, but it's IP phone. Anyway, I guess the company is just trying to lower the cost. 5330 for me is too complicated. I may not use many of them in the life time.

Friday, July 15, 2011

Google+ and concern

Join the Google+ today, but I removed my profile photo too.
Maybe I am conservative, but the content is out of your hand once published. Even you close your account and delete all content, it's not guaranteed that things are clear. Yours are still somewhere on the net.
I am not a sociable person and don't want to. So keeping low profile is what I would like to do.

Wednesday, March 2, 2011

蜀香苑网站上加入了Facebook 和 Twitter

今天更新了网站,在抬头上加上了“Facebook” Page 的链接和 “Twitter” Follow。而且在每页上也植入了“Like”和“Tweet”功能。原来从来没研究过,原来Facebook还有这么多机关,而且推广网站和推广在Facebook上的Page还有很大不同。Tweet也是,还没搞的太清楚。
朋友对我网站界面的赞赏,很是让我激动啊!希望以后的“真功夫”也能接纳。呵呵...

Monday, February 28, 2011

蜀香苑有 Facebook Page 了

不晓得这种推销方式在中国人中流不流行,不过先加上个链接再说吧。
这个Page刚建立,还不到25人,所以还不能有一个URL,争取让更多人去加“Like”。
这个Vanity URL 还不好挣哦。暂时,这个链接是可以的。
Facebook Page:蜀香苑川菜馆-Szechuan-Legend-Restaurant .

Monday, February 7, 2011

餐厅网站制作-Up and Running

Version 1.0 完成了,昨天集中精力把拖了很久的网站建设完成了。朋友的餐厅这两天就开张了,没太多时间去完善全部功能,就没去想和执行动态更新网页方法,V2的时候再说了。V1相对于草图来说,就加了些底纹图案,地图和菜单链结。

把他们的信息放上来,有空去光顾哦,不会让你失望的,至少菜哈。

餐厅名称叫
【蜀香苑】川菜馆


电话
905-889-7883

地点就在
505 HWY 7 E, Unit 91&92(Commerce Gate),
Richmond Hill, ON
L3T 7T1


网站地址是
http://www.sichuanlegend.com

Thursday, January 27, 2011

Fix Debugging Flash Crash Issue in FireFox 3.6

Read a thread today, found out a reference about how to fix issue of debugging crash in FireFox 3.6. This problem has been there for while, I haven't think about this is a updating issue.
Fix is simple:
Enter "about:config" in address bar;
Find preference of "dom.ipc.plugins.timeoutSecs" and change the value you want. "-1" value will turn it off and is best option for me without timeout.
The reference is here:
Fix FireFox Plugin Container Crash When Debugging Flash

Tuesday, January 25, 2011

餐厅网站制作-草图

昨天把草图做出来了,可行的话,网站coding就能开始了,如果可能争取能在不刷新的情况下显示页面和同步显示相关的图片。
草图:

Monday, January 24, 2011

餐厅网站制作

这几天忙着为朋友做一个网站,因为都是静态的,简单不费脑子,但比较花时间。
如果人流量多了也稳定了,就会逐渐加入一些功能,不但对他们好,也让我也练练手。
希望这个网站能帮他们多拉点生意。
现在还是空架子,等有东西再把网站放上来。

Cairngorm 3 and Parsley in Flex

Past a couple of years, I involved a few projects using Flex tech. we had some problems in my team when developing enterprise project. One is the code maintenance. As the project grows, AS commands, servce controls and UI mxml always involved together and hard to decouple. The other is unit test. The Flex is a very powerful event driven framework. However, when I wrote the unit test for a particular part of code, it because very hard to handle when the data is ready cause I don't know when the event will be triggered to generate the data required for unit tests if testing part involving UI operations.
Starting this year, we introduce Cairngorm 3 framework guideline and Parsley injection framework library. These techs hopefully help us to address the issue. MVC is a long existing framework, which decouple commands, views and controls. The idea of Cairngorm guideline is a implementation of decoupling in Flex. The Parsley lib is a popular IoC framework lib to use.
The resources I found are very useful:
  1. Adobe Cairngorm Home
    The first place you should go.
  2. Parsley lib Home
    Where you can find the guide to using Parsley and it's API.
  3. Arturo Alvarado's Quick Dive into Parsley
    A very good step-by-step guide to know about Parsley.
Unlike Cairngorm 2, Cairngorm 3 is a general guideline with a couple of helpful libs to develop Flex project. I hope there's no much obstacle to use the framework for my project.

Monday, November 29, 2010

"Hello World" App of Flex+Google App Engine+BlazeDS

I've been long time to look some way to develop my sample server host app without a penny.
I registered Google App Engine and Google Site a few years ago, but they both has some limits to start building a site.
Today, after I read this post, I think I may start to build a Flex site, which I can use Flex, Messaging Server and Data Communication Objects. Let's see when I will have my first app posted.

Wednesday, October 6, 2010

Flint Particle System - Cool Flex Effects

Flint Particle System is a very cool open-source library to add effects in Flash. It can be added in AS, Flash or Flex project. The site also provide many example to get started.

Monday, September 27, 2010

Flare - Flex Data Visualization and Interaction

When I'm developing my project about complex reference data nodes which have multiple levels of inheritance and connections, I only foundmark-shepherd.com SpringGraph close to my components. Then I extend that with a few modification. However, there are still some lack of features to satisfy my components.
Today, I read the The Flare Visualization Toolkit from Thomas Burleson. This kit is more organize-chart like and has a few more features I need. It's open source as well(Important!! ^_^).
Don't have time to read all code today, but I think it could be a resource of my project.

Friday, August 27, 2010

Google's gmail phone works for me

Read the news about the google phone in gmail yesterday. It said the offer is for US only and free for US and CA by the end of year.
I curiously tried to install the feature. There's no "Call phone" button displayed in chat panel when I restarted browser. Can't figure it out.
However, when I get to the office and open the browser, The button is shown. Can't wait to try it even I don't have a head mic. It works.
I probably won't use it much, but it still a nice feature. I hope google can integrate all voice feature with gmail.