Saturday, May 28, 2016

耶鲁大学的格言 Light and truth 光明与真理 אורים ותמים

אורים ותמים 


 耶鲁大学的格言是希伯来文 אורים ותמים

 אורים ותמים (Hebrew) (读音Urim V'Thummim)
Lux et veritas (Latin)
Light and truth(English)

The arms of Yale University, often referred to as the shield of the university. The device on the seal, a book bearing the Hebrew phrase אורים ותמים (English: Urim V'Tamim), originates from the early eighteenth century, and its designer is unknown.
印上是一本写有希伯来文אורים ותמים (英文Urim V’Tamim,中文乌陵和土明)的书, 说是来自18世纪早期。设计者未知。


 אורים ותמים那个希伯来文的翻译没有多少问题。

 תמים: Whole, entire, intact, blameless, sincerely, honestly, perfect in knowledge 整全,完整,无愧,真诚,诚实,知识的完备
אורים:Light 光明


首先这个词(אורים ותמים)多次完整出现在圣经中,意思是“从神那儿得旨意的装备或程序”。


 Ex 28:30 (出埃及记28:30) 30ונתת אל חשן המשפט את האורים ואת התמים והיו על לב אהרן בבאו לפני יהוה ונשא אהרן את משפט בני ישראל על לבו לפני יהוה—תמיד  {ס} 30


 Lv 8:8 (利未记8:8) 8וישם עליו את החשן ויתן אל החשן את האורים ואת התמים 8
又给他佩上胸牌,把乌陵和土明放在胸牌里面 同上

 Dt 33:8 (申命记33:8) 8וללוי אמר תמיך ואוריך לאיש חסידך אשר נסיתו במסה תריבהו על מי מריבה׃ 8



 Ear 2:63 63ויאמר התרשתא להם אשר לא יאכלו מקדש הקדשים עד עמד כהן לאורים ולתמים׃ 63省长告诉他们不可吃至圣之物,直等到有能用乌陵和土明来决疑的祭司兴起来。

 Ne 7:65 65ויאמר התרשתא להם אשר לא יאכלו מקדש הקדשים עד עמד הכהן לאורים ותומים׃ 65省长告诉他们不可吃至圣之物,直等到有能用乌陵和土明来决疑的祭司兴起来。 






约翰福音描述神就是光。耶稣是世界的真光。 。。。。

 所以אורים ותמים一词来自圣经。 


Wednesday, October 28, 2009

Do not give your email id and password to any web site unless you know for sure what you are doing

I and my friends have received invitation from seemly friendly email from friend email to join them such as the "Desk Top Dating".

When you receive the email, delete it immediately and do not follow through it. This is a trap!

Generally, for any email/web site asking for login/password for another email account, don't follow through that and delete that email unless you know you are giving information to a well trusted email service such as google. Otherwise, you are in danger of exposing your complete email contact list to an unknown user/web site.

For example the mentioned "Desktop Dating" email, this is what the hacker site was doing:

1. in the email it ask you to input your email id (for example yahoo) and password,
2. the "desktop dating" site could use your yahoo email id and password and login to your email account and (don't be fooled by the encryption of the password that shows on the page)
3. read your emails and
4. fetch all your email contact and send the chain email to all your contacts.
5. The cycle continues back to step 1 for all your contacts and their contacts again and again unless you stop it from step 1.

If you already input your email id /password to site like that, change your password now, inform your friends do not open that email from you etc.

Sunday, October 25, 2009

Use GSON to access json response in grails action

Communicate with external service through gson
1. download gson package and extract the jar into lib directory
2. grails action

def fetch={
def data
def reader
try {
URL url = new URL("http://localhost:8080/controller/action");
reader = new BufferedReader(new InputStreamReader(url.openStream()));
JsonParser jp = new JsonParser()
JsonElement je = jp.parse(reader)
data = je.getAt("data");

} catch (MalformedURLException e) {
// ...
} catch (IOException e) {
// ...
} finally {
render data;

Saturday, October 24, 2009

Create google wave robot from grails

1. use grails 1.1.1 (1.2.M3 does not work yet!!!)
2. create a grail project gswordwave
grails create-app gswordwave
3. uninstall hiberante
grails uninstall-plugin hibernate

4. install app engine plugin, selected jdo ( default)
grails install-plugin app-engine
5. run the app with this command:
grails app-engine
6. kill it
7. do initial deployment and make sure it works without wave stuff
  • Register your application on appengine site. gswordwave
  • grails set-version 1
  • grails app-engine package
  • %APP-ENGINE-HOME%/bin/appcfg.cmd update ./target/war

8. download the google wave client jars from
  • and copy all the wave client jar to the lib directory in the grails root dir, also download servlet.api.2.5.jar into lib
  • Bulleted List mkdir src/java/parroty/server
  • copy src/parroty/ into the above directory src/java/parroty/server and name it and update the package to parroty.server.
  • Make a web-app/_wave dir. Create in it a capabilties.xml file and copy paste the code

<?xml version="1.0" encoding="utf-8"?>

<w:robot w="">
<w:capability name="WAVELET_PARTICIPANTS_CHANGED" content="true">

9. In your appengine-web.xml (mine is in
you will find your application id is there already(mine, "gswordwave").

<appengine-web-app xmlns="">



10. add your ParrotyServlet config into src\templates\war\web.xml :


11. do redeployment

  • grails app-engine package
  • %APP-ENGINE-HOME%/bin/appcfg.cmd update ./target/war
12. check it out
13. goto your wave account and add onto
your contact list and start to communicate with it

Wednesday, October 21, 2009

Pintout Unicode of a String

I don't use this often but I run into the problem occasionally. For example an special character in a text from database broken XML when it is put into xml. The problem is I don't know what character is doing it. So I need to find the unicode and replace it.

This is how to do it:
def thatString="sdsdsd sd fsd fsd fsd fsd fsd s ->s sd fsdf sdf "
printf("%04X%n", (int)ch);

This will printout all the unicode of the string

Monday, September 14, 2009

GWT on Google Appengine

The first part list the steps to create the first google app engine GWT applicaiton(Mostly copied from Google Instruction). The second part is more detail explanation.

1. Download Eclipse and install google app engine plugin

Eclipse 3.5 (Galileo)

2. Create applicaiton (areyouup)

File > New > Web Application Project (areyouup, com.asianwondersnet.areyouup)

(select workbench if not show up)

3. Running your Web Application locally

Right-click on your web application project and select Debug As > Web Application from the popup menu.

This action creates an Eclipse Web Application launch configuration for you and launches it. The web application launch configuration will start a server and the GWT hosted browser.

At this point, you can set breakpoints, inspect variables and modify code as you would normally expect from a Java Eclipse debugging session.

4. Deploying your Web Application

To deploy your web application, you will need to create an application from the App Engine Administration Console, at the following URL: If you already have one, then you can skip this step.

Once you have an application ID, just right-click on your project, and select Google > App Engine Settings... from the context menu. Enter your application ID into the Application ID text box. Click OK.

Right-click on your project and select Google > Deploy to App Engine. In the resulting Deploy Project to Google App Engine dialog, enter your Google Account email and password.

Note: Don't worry - the plugin doesn't store your password anywhere.

Click Deploy.

Go to to see your application.

The following is a little bit more detail. Here are the steps to add a new service. Using TestService as example.

1. Define

package com.asianwondersnet.areyouup.client;

public interface TestService extends RemoteService{
String testServer(String name);

Please notice the relative path annotation above. We will use that information in web.xml

2. Define the

package com.asianwondersnet.areyouup.client;


public interface TestServiceAsync {
void testServer(String input, AsyncCallback callback);

Notice the above two service interface both has testServer. But there is a little bit difference. The second one has a AsyncCallback argument which we will show it in entrypoint code.

3. Define the which implement the TestService interface.

package com.asianwondersnet.areyouup.server;

import com.asianwondersnet.areyouup.client.TestService;

public class TestServiceImpl extends RemoteServiceServlet implements TestService{

public String testServer(String input) {
StringBuffer sb=new StringBuffer();
try {
URL url = new URL(input);
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
while ((line = reader.readLine()) != null) {

if (sb.length()==0){
sb.append("Please input the full URL for fetching data!");
return sb.toString();


4. Add the servlet configuration in web.xml

The name: testServlet

The class: com.asianwondersnet.areyouup.server.TestServiceImpl

Add the servlet mapping to web.xml

map /areyouup/test to testServlet

The relative path test is annotated in the interface.

Also define the hosting page as welcome-file-list: Areyouup.html

The hosting page was generated automatically but you can change it from the web.xml file.

5. Now the entrypoing code: (This was generated automatically when the application is setup on Eclipse).

package com.asianwondersnet.areyouup.client;


public class Areyouup implements EntryPoint{

private final TestServiceAsync testService = GWT.create(TestService.class);

//The entrypoint
public void onModuleLoad() {

//Define the buttons/textfields specify style as necessary
final Button sendButton = new Button("Send");
final TextBox nameField = new TextBox();
nameField.setText("Input URL");

// We can add style names to widgets

// Add the nameField and sendButton to the RootPanel
// Use RootPanel.get() to get the entire body element

// Focus the cursor on the name field when the app loads

// Create the popup dialog box
final DialogBox dialogBox = new DialogBox();
dialogBox.setText("Remote Procedure Call");
final Button closeButton = new Button("Close");
// We can set the id of a widget by accessing its Element
final Label textToServerLabel = new Label();
final HTML serverResponseLabel = new HTML();
VerticalPanel dialogVPanel = new VerticalPanel();
dialogVPanel.add(new HTML("Sending name to the server:"));
dialogVPanel.add(new HTML("Server replies:"));

// Add a handler to close the DialogBox
closeButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {

// Create a handler for the sendButton and nameField
class MyHandler implements ClickHandler, KeyUpHandler {
* Fired when the user clicks on the sendButton.
public void onClick(ClickEvent event) {

* Fired when the user types in the nameField.
public void onKeyUp(KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {

* Send the name from the nameField to the server and wait for a response.
private void sendNameToServer() {
String textToServer = nameField.getText();
new AsyncCallback() {
public void onFailure(Throwable caught) {
// Show the RPC error message to the user
.setText("Remote Procedure Call - Failure");

public void onSuccess(String result) {
dialogBox.setText("Remote Procedure Call");

// Add a handler to send the name to the server
MyHandler handler = new MyHandler();


The GWT has been simplified a bit from older versions. No more Service casting and the annotation also helps simplify coding.

6. Look at the Hosting page:

In the html header, link style "Areyouup.css" and java script src="areyouup/areyouup.nocache.js"
In the body define the field "nameFieldContainer" and "sendButtonContainer" refered in the code

Ok. Here is the play ground. It has the above function plus some more experimental image animation stuff. The URL:

Thursday, September 10, 2009

Application development process for Google Appengine on Grails

Application development process for Google Appengine on Grails

This is the note I took while watching grocher 's Screen cast from the Grails 1.1.1 announcement
So all honor goes to grocher and the grails/groovy team.

1. grails create-app grails-music-store
2. Goto, add new application grails-music-store . Note the app name must match
3. cd grails-music-store
4. grails uninstall-plugin hibernate
5. grails install-plugin app-engine
6. export APPENGINE_HOME=/Developer/appengine-java-sdk-1.2.0
7. grails app-engine
then goto 8080 and see the skeleton app
8. grails create-domain-class Album
JDO by default
9. grails generate-all
10. grails app-engine
On Windows, After kill the application, the java process is still running. I have to kill the java process manually. (currports is a nice tool for this process)
11. grails app-engine package
12. /Developer/appengine-java-sdk-1.2.0/bin/ update ./target/war
provide password //first time
It will fail. Fail because of version.
13. grails set-version 1 (This is not the app engine version)
14. do step 11-12 to build and deploy again
/Developer/appengine-java-sdk-1.2.0/bin/ update ./target/war
15. Check it out (or list...)

Of course you need to install the app engine sdk first.