I have a cable TV first time in years!!!
Apple Wheel
Using the gwt KeyHandler instead of KeyboardListener
{
searchBox.addKeyDownHandler(new KeyDownHandler()
{
public void onKeyDown(KeyDownEvent event)
{
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER)
{
search(searchBox);
}
}
});
}
Using the gwt KeyHandler instead of KeyboardListener
{
searchBox.addKeyDownHandler(new KeyDownHandler()
{
public void onKeyDown(KeyDownEvent event)
{
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER)
{
search(searchBox);
}
}
});
}
Using the gwt ClickHandler instead of TableListener
{
return new ClickHandler()
{
public void onClick(ClickEvent event)
{
//instead of casting the former sender as a FlexTable, use the original table
Cell cell = table.getCellForEvent(event);
int row = cell.getRowIndex();
int col = cell.getCellIndex();
//original code here
}
}
Using the gwt ClickHandler instead of TableListener
{
return new ClickHandler()
{
public void onClick(ClickEvent event)
{
//instead of casting the former sender as a FlexTable, use the original table
Cell cell = table.getCellForEvent(event);
int row = cell.getRowIndex();
int col = cell.getCellIndex();
//original code here
}
}
iPhone and other mobile devices hacked via SMS
iPhone and other mobile devices hacked via SMS
French onion soup
Just in case you wonder... taste like heaven!
Recipe:
1. thinly slice a lot of onions into a big pot
2. mix it with butter (spoon or so) and let it marinate
3. add beef broth
4. add a lot of spices (all spice, mint, basil, dill, etc.),
5. add few sliced potatoes
6. cook long time with 1/3 bottle of Sherry (I used cream sherry)
7. when serving toast the slice of baguette and sharp cheese (mozzarella, jack cheese)
8. serve with a glass of sherry to complement the bouquet
AppEngine Date field editing
When you have a Java Date field in the AppEngine JDO and try to enter the new value using Google Web interface:
AppEngine Date field editing
When you have a Java Date field in the AppEngine JDO and try to enter the new value using the Google Web interface:
Data Viewer -> Edit Entity or Create an Entity
you may be getting this error: "Could not instantiate int: invalid literal"
I think this is a bug, as this field should be a Date, not an int, but there is a simple work-around:
1) change the int to null, then save
2) change the null to gd:when and you can enter a date in the format 2009-07-29 20:36:17.565000
Using the appengine database
Using the appengine database
Mouse Button Click
if(event.getNativeEvent().getButton() == NativeEvent.BUTTON_RIGHT)
{
GWT.log("Right Click", null);
}
else
{
GWT.log("Left Click", null);
}
Mouse Button Click
if(event.getNativeEvent().getButton() == NativeEvent.BUTTON_RIGHT)
{
GWT.log("Right Click", null);
}
else
{
GWT.log("Left Click", null);
}
GWT 1.6: "removeClickHandler" solution
FocusPanel focus = new FocusPanel();
HandlerRegistration registration = focus.addClickHandler(new ClickHandler()
{
public void onClick(ClickEvent event)
{
// Panel has been clicked
}
});
registration.removeHandler();
GWT 1.6: "removeClickHandler" solution
FocusPanel focus = new FocusPanel();
HandlerRegistration registration = focus.addClickHandler(new ClickHandler()
{
public void onClick(ClickEvent event)
{
// Panel has been clicked
}
});
registration.removeHandler();
KeyPressEvent: Getting the key code
TextBox box = new TextBox();
box.addKeyPressHandler(new KeyPressHandler()
{
public void onKeyPress(KeyPressEvent event)
{
// Listen to key event
}
});
You can use event.getCharCode() to get the character that was pressed, but in order to get the key code (int) that was pressed you need to use the following method:
event.getNativeEvent().getKeyCode()
So here is code to listen to when the "Enter" key is pressed:
TextBox box = new TextBox();
box.addKeyPressHandler(new KeyPressHandler()
{
public void onKeyPress(KeyPressEvent event)
{
if (KeyCodes.KEY_ENTER == event.getNativeEvent().getKeyCode())
{
System.out.println("Enter key has been pressed");
}
}
});
KeyPressEvent: Getting the key code
TextBox box = new TextBox();
box.addKeyPressHandler(new KeyPressHandler()
{
public void onKeyPress(KeyPressEvent event)
{
// Listen to key event
}
});
You can use event.getCharCode() to get the character that was pressed, but in order to get the key code (int) that was pressed you need to use the following method:
event.getNativeEvent().getKeyCode()
So here is code to listen to when the "Enter" key is pressed:
TextBox box = new TextBox();
box.addKeyPressHandler(new KeyPressHandler()
{
public void onKeyPress(KeyPressEvent event)
{
if (KeyCodes.KEY_ENTER == event.getNativeEvent().getKeyCode())
{
System.out.println("Enter key has been pressed");
}
}
});
Apple Tablet
http://mashable.com/2009/07/27/apple-tablet/
Name: Touch Book Pro?
Apple Tablet
Lingo-widget: share it on your own site, or blog
<iframe src="http://lingo-widget.appspot.com/" width="320" height="360"><br /> <p>Your browser does not support iframes.</p><br /></iframe><span class="Apple-style-span" style="font-size: large;">
Lingo-widget: how to submit your own recordings?
Nikon D40
The nicest things about D40 is the wide angle 18-55 mm lens (I know it is silly, I could buy just the lens), otherwise D50 is superior with its internal lens focusing motor which works with my old lenses.
As far as functions I need the following all manual: S, A, M, (basically shutter speed, aperture and ISO) so the fancy cameras with a lot of options make no difference to me, more primitive and simpler the better. Oh, Nikon D60 has sensor cleaning, which I would like to have, my old D50 has an annoying dust spot on all pictures.
In the picture below you can see the bird ("The Dove") that was taken with my Nikon D50 (4.5 mp) and the enlargement looks just fine to me:
Slow food
Today, when I got this picture of Lili, I realized how much I miss the European feel of Quebec, with restaurants, cafe shops, and good bakeries on every street corner, where life and food are good.
Having said that, I also realize that it has been a week since I came back from Quebec, and I did not cook once, not even tea, which I love to drink so often.
Alerting Visitors when JavaScript is Disabled
The web site we're developing is JavaScript based, so we need to warn users if they come to our site with JavaScript disabled. The easiest way to do this is to use the HTML <noscript> tag (http://www.w3schools.com/TAGS/tag_noscript.asp).
For example:
<head>
<script ...
</script>
</head>
<body>
<script ...></script>
<noscript>
<div class="noscript-warning">
<h1>Please turn on JavaScript to use this site.</h1>
<p>
It seems that you have JavaScript turned off. You will need
to turn it on in order to use this site.
</p>
</div>
</noscript>
</body>
The contents of the <noscript> tag will only be displayed when JavaScript is disabled. When JavaScript is enabled, the tag and its contents will not be displayed at all.
Alerting Visitors when JavaScript is Disabled
The web site we're developing is JavaScript based, so we need to warn users if they come to our site with JavaScript disabled. The easiest way to do this is to use the HTML <noscript> tag (http://www.w3schools.com/TAGS/tag_noscript.asp).
For example:
<head>
<script ...
</script>
</head>
<body>
<script ...></script>
<noscript>
<div class="noscript-warning">
<h1>Please turn on JavaScript to use this site.</h1>
<p>
It seems that you have JavaScript turned off. You will need
to turn it on in order to use this site.
</p>
</div>
</noscript>
</body>
The contents of the <noscript> tag will only be displayed when JavaScript is disabled. When JavaScript is enabled, the tag and its contents will not be displayed at all.
"Cherry Blossoms" hanami (はなみ)
Cherry Blossoms, or Hanami, is a lovely German-Japanese film by Doris Dörrie.
It’s about a quiet couple, death, and an unexpected journey to Japan.
It captures the Japanese spirit of hanami (はなみ): fleeting blossoms, fleeting life.
I found it very moving.


Google Wave beyond the sandbox
Google Wave beyond the sandbox
In the meanwhile, if you want to see Google Wave in action, come to the Chicago Google Technology User Group conference:
JavaScript: browser type and version detection
<script>if (navigator.userAgent.toLowerCase().match("safari") && navigator.userAgent.toLowerCase().match("version/4")) {window.alert("Detected Safari 4 browser!!");}</script>
JavaScript: browser type and version detection
<script>if (navigator.userAgent.toLowerCase().match("safari") && navigator.userAgent.toLowerCase().match("version/4")) {window.alert("Detected Safari 4 browser!!");}</script>
Re: [gtug-managers] Gain potential members...
it is really not difficult to get a LOT of people attending your GTUG....
Create Event Brite account:
http://chicago-gtug.eventbrite.com/
Create a Meetup.com account:
http://www.meetup.com/chicago-google/
Create a Facebook account:
http://www.facebook.com/group.php?gid=57657640517
Have people following you on Twitter using your specific hashtag (our is #ChiGTUG):
http://twitter.com/#search?q=ChiGTUG
respectfully,
Uki Dominque Lucas
principal @ The Revere Group, an NTT Data Company (Nippon Telegraph &
Telephone Corp.)
Hi.
I have a little problem... well, I don't know a lot of people and I don't know a good way to reach people for the club. Yeap... sounds stupid because I created the group, but that's my initiative I mean I have to motivate people to join the group.
So any idea ? ... little advice ? ... anything it's really appreciated and well... this is the best place to ask
ales
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "gtug-managers" group.
On Jul 21, 2009, at 11:36 PM, ales wrote:
>
> Hi.
>
> I have a little problem... well, I don't know a lot of people and I
> don't know a good way to reach people for the club. Yeap... sounds
> stupid because I created the group, but that's my initiative I mean I
> have to motivate people to join the group.
>
> So any idea ? ... little advice ? ... anything it's really appreciated
> and well... this is the best place to ask
>
> ales
Re: [gtug-managers] Gain potential members...
It is really not difficult to get a LOT of people attending your GTUG....
Create an Event Brite account:
http://chicago-gtug.eventbrite.com/
Create a Meetup.com account:
http://www.meetup.com/chicago-google/
Create a Facebook account:
http://www.facebook.com/group.php?gid=57657640517
Have people following you on Twitter using your specific hashtag (our is #ChiGTUG):
http://twitter.com/#search?q=ChiGTUG
On Jul 21, 2009, at 11:36 PM, A. wrote:
>
> Hi.
>
> I have a little problem... well, I don't know a lot of people and I
> don't know a good way to reach people for the club. Yeap... sounds
> stupid because I created the group, but that's my initiative I mean I
> have to motivate people to join the group.
>
> So any idea ? ... little advice ? ... anything it's really appreciated
> and well... this is the best place to ask
>
> A.
Terminal: RSA host key verification error
Terminal: RSA host key verification error
Entrepreneurial Thought Leaders
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=80867514
few valuable lessons out of this one:
Entrepreneurial Thought Leaders
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=80867514
few valuable lessons from this one:
GWT 1.7 using ChangeHandler on ListBox (drop-down)
GWT 1.7 using ChangeHandler on ListBox (drop-down)
This functionality replaces the deprecated listBox.addChangeListener(new ChangeListener(){//implementation} );
private ListBox populateLearningLanguage(){final ListBox listBox = new ListBox();addLanguages(listBox);listBox.setSelectedIndex(2);listBox.addChangeHandler(new ChangeHandler(){public void onChange(ChangeEvent event){int selectedIndex = listBox.getSelectedIndex();if (selectedIndex > 0)Window.alert("Something got selected " + listBox.getValue(selectedIndex));}});return listBox;}
Flexible USB keyboard
This keyboard is incredibly flexible and the buttons have a real "press down" feeling to them, but as with any new keyboard there is much getting used to be overcome.
The seller advertised it as indestructible, so if you work in the chemical lab, or eat a lot of pizza while typing, that may be a good choice.
I like it because it is super light, flexible and lays down on the table which is good for my wrists. There are only blue and black versions available.
Works both with Mac and Windows.
After using it for few days I have the following problems:
- pressing buttons is a little harder than normal keyboard
- you have to be more precise
- space bar does not get pressed way too often and I end up with words stuck together
- arrows placement is terrible
- Windows/Apple special button is too small for as often as I use it
- backspace is too small
Flexible USB keyboard
This keyboard is incredibly flexible and the buttons have a real "press down" feeling to them, but as with any new keyboard, there is much getting used to.
The seller advertised it as indestructible, so if you work in the chemical lab, or eat a lot of pizza while typing, that may be a good choice.
I like it because it is super light, flexible, and lays down on the table which is good for my wrists. There are only blue and black versions available.
Works both with Mac and Windows.
After using it for a few days I have the following problems:
- pressing buttons is a little harder than a normal keyboard
- you have to be more precise
- space bar does not get pressed way too often and I end up with words stuck together
- arrows placement is terrible
- Windows/Apple special button is too small for as often as I use it
- backspace is too small
Leaving Cleavland at sunset
Chicago.
I am happy to go home, but not looking forward to returning to reality
-- I'd rather eat freshly baked rolls with the apricot and sweet
spread cheese and try to talk French at little cute stores in Quebec.
Creating GWT 1.7 jar to reuse your custom widget
Photoshop tutorial: create aqua button
Photoshop tutorial: create aqua button
Ant: TAR and GZIP task
<tar destfile="${dist}/manual.tar" basedir="htdocs/manual"/><gzip destfile="${dist}/manual.tar.gz" src="${dist}/manual.tar"/>
Ant: TAR and GZIP task
<tar destfile="${dist}/manual.tar" basedir="htdocs/manual"/><gzip destfile="${dist}/manual.tar.gz" src="${dist}/manual.tar"/>
Maven, GWT, and Eclipse round 2
Prerequisites:
Eclipse 3.4
Google Eclipse Plugin
m2eclipse plugin
Create your gwt project:

Create a pom for your project:


Edit the pom to look like this (profiles and resource filtering are definitely not needed and can be removed) and add any other jars you may need for your project:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.demo.application</groupId>
<artifactId>Application</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<outputDirectory>war/WEB-INF/classes</outputDirectory>
<testSourceDirectory>test</testSourceDirectory>
<testOutputDirectory>target/test-classes</testOutputDirectory>
<resources>
<resource>
<filtering>true</filtering>
<directory>src</directory>
<includes>
<!--
This will include all files in the root source like
log4j.properties or applicationContext.xml
-->
<include>*.*</include>
<!--
This will include all files in client: 1. so this project can be
inherited by another project (needs java files) 2. will include
image files for image bundles
-->
<include>**/client/**</include>
<!-- This will include any css and image files in the public folder -->
<include>**/public/**</include>
<include>**/*.gwt.xml</include>
</includes>
</resource>
</resources>
<filters>
<!--
This tells which file to use for filtering, ${target} gets replaced
by the target property specified in your profile
-->
<filter>src/${target}.properties</filter>
</filters>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<!--
This plugin will copy dependencies into the right outputDirectory
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<outputDirectory>war/WEB-INF/lib</outputDirectory>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.3</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>google-maven-repository</id>
<name>Google Maven Repository</name>
<url>http://google-maven-repository.googlecode.com/svn/repository/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>com.google.appengine.orm</groupId>
<artifactId>datanucleus-appengine</artifactId>
<version>1.0.2.final</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-core</artifactId>
<version>1.1.0</version>
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>transaction-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-jpa</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jta_1.1_spec</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jpa_3.0_spec</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>javax.jdo</groupId>
<artifactId>jdo2-api</artifactId>
<version>2.3-ea</version>
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>transaction-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>local</id>
<properties>
<target>local</target>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<target>prod</target>
</properties>
</profile>
</profiles>
</project>
You'll have to install some of the jars into maven manually, they aren't really keeping up to date with these things. For the datanucleus-appengine-1.0.2.final.jar you have to use the one that was placed in the lib folder and run this command
mvn install:install-file -DgroupId=com.google.appengine.orm -DartifactId=datanucleus-appengine -Dversion=1.0.2.final -Dpackaging=jar -Dfile=/path/to/file
At this time I would enable maven (I got some error message but just hit ok):

If you are using profiles (you probably have an error in your project at this point) tell maven which active profile to use:

You'll get a message if you want maven to update your project, hit ok.
You're done, just ignore the warning about the missing gwt-servlet.jar, it will be there, just named differently.
now we just need to make an ant build.xml to make compiling, and deploying easy.
<project name="Application" default="java_compile" basedir=".">
<property file="./src/local.properties" />
<target name="java_compile" description="Java compile, filter resources, copy jars">
<echo>Make sure you have set up Maven Executable in ./src/local.properties</echo>
<echo>Your mvn exe is set to ${MAVEN_EXEC}</echo>
<!-- process-resources filters the files in the resources directory and copies them to target/classes -->
<!-- dependency:copy-dependencies copies the dependencies to the target/dependency folder -->
<delete dir="war/WEB-INF/lib" />
<exec taskname="compile project" dir="${basedir}" executable="${MAVEN_EXEC}">
<arg line="clean process-resources compile dependency:copy-dependencies -P local" />
</exec>
</target>
<path id="project.class.path">
<pathelement location="war/WEB-INF/classes" />
<pathelement location="${gwt.sdk}/gwt-user.jar" />
<fileset dir="${gwt.sdk}" includes="gwt-dev*.jar" />
<!-- Add any additional non-server libs (such as JUnit) -->
<fileset dir="war/WEB-INF/lib" includes="**/*.jar" />
</path>
<target name="gwt_compile" description="GWT compile to JavaScript" depends="java_compile">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="src" />
<path refid="project.class.path" />
</classpath>
<!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
<jvmarg line="-Xmx512M" />
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg value="com.demo.application.Application" />
</java>
</target>
<target name="create_war" depends="gwt_compile">
<echo>Creating the war file in target/Application.war</echo>
<zip destfile="target/Application.war" basedir="war" encoding="UTF8"/>
</target>
</project>
then our local.properties file needs to look something like this
gwt.sdk=/path/to/gwt-os-1.7.0
MAVEN_EXEC=/path/to/mvn.exe
Once that is done you need to run "ant java_compile" to copy the jars into the war/WEB-INF/lib folder. And every time you change the dependencies you'd want to run "ant java_compile"
Now if you ever want to simply create a war file without using eclipse you can just run "ant create_war"
Post Scriptum
I am preparing to cancel the subscription to the e-mail newsletter that sends my articles.
Follow me on:
X.com (Twitter)
Google Scholar
Popular Recent Posts
-
Keishin Kata (敬心形) of Shobudo (正武道) karate kei (敬) respect, reverence, or honor someone or something shin (心) heart or mind kata (形) fo...
-
Before arriving in Okinawa, several experiences prepared me for what I would eventually learn there. Karate was the first. It introduced me ...
-
I came across Ruri Ohama mentioning a book by Takafumi Horie and Yoichi Ochiai titled: “Job Atlas for 10 Years From Now. How Will You Live i...
-
Please look at the newer post: http://ukitech.blogspot.com/2009/09/eclipse-35-galileo-and-gwt-m2-svn.html 1) Upload a new version of Eclipse...
-
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space or Unable to execute dex: Java heap space Java h...
-
I have a habit of "stopping to smell the roses", or as in today's case, to take a photo of baby mushrooms on the forest floor....
-
http://code.google.com/apis/socialgraph/
-
Many online videos warn about vegetables you should never eat, especially those rich in oxalates. The tone is dramatic. The reality is much ...
Most Popular Articles
-
Affordance as a Function of Intent and Action? As a person passionate about Behavioral Sciences, I found myself unable to shake the impre...
-
Step 1: Register you app with Facebook. Sign in to Facebook using your standard credentials. Navigate to http://www.facebook.com/developer...
-
Please look at the newer post: http://ukitech.blogspot.com/2009/09/eclipse-35-galileo-and-gwt-m2-svn.html 1) Upload a new version of Eclipse...
-
Creating Android ROS nodes to: - add control UI (HMI) - utilize existing phone sensors: -- gyroscope -- GPS -- compass -- camera - do...
-
In this tutorial we will learn how to install the Intellij IDEA database plugin. Start with opening Settings > search for plugins ...
-
Installing TuriCreate on Python 3.6 Anaconda Environment 1) Check what Python version Apple Turi Create supports https://github.com/ap...
-
In this tutorial we will overview integration basics of Android Studio and Gradle build tools.
-
This tutorial shows you how to change the code lower/upper case of code in Android Studio.
-
ImportError : No module named 'sklearn.model_selection' Before doing the embarrassing things I did below, read this: Setting Jupy...
-
This minimal PyTorch example implements a custom recurrent neural network (RNN) cell from first principles, showing how sequence memory eme...


























