Today’s entry in the Android multi-touch series is a short one. In it, we set up the matrices that will be used later for moving and resizing the image. All source code can be downloaded from the web site for Hello, Android! (3rd edition).
In case you missed the previous articles, here’s an outline of the series so far:
Setting up for Image Transformation
In order to move and zoom the image we’ll use a neat little feature on the ImageView class called matrix transformation. Using a matrix we can represent any kind of translation, rotation, or skew that we want to do to the image. We already turned it on by specifying android:scaleType=”matrix” in the res/layout/main.xml file. In the Touch class, we need to declare two matrices as fields (one for the current value and one for the original value before the transformation). We’ll use them in the onTouch( ) method to transform the image. We also need a mode variable to tell whether we’re in the middle of a drag or zoom gesture:
From Touchv1/src/org/example/touch/Touch.java:
public class Touch extends Activity implements OnTouchListener {
// These matrices will be used to move and zoom image
Matrix matrix = new Matrix();
Matrix savedMatrix = new Matrix();
// We can be in one of these 3 states
static final int NONE = 0;
static final int DRAG = 1;
static final int ZOOM = 2;
int mode = NONE;
@Override
public boolean onTouch(View v, MotionEvent event) {
ImageView view = (ImageView) v;
// Dump touch event to log
dumpEvent(event);
// Handle touch events here...
switch (event.getAction() & MotionEvent.ACTION_MASK) {
}
// Perform the transformation
view.setImageMatrix(matrix);
return true; // indicate event was handled
}
}
The matrix variable will be calculated inside the switch statement when we implement the gestures.
To be continued in Part 5, Implementing the Drag Gesture…
Copyright notice:
This is an excerpt from Hello, Android 3rd edition, published by the Pragmatic Bookshelf. For more information or to purchase a paperback or PDF copy, please visit http://www.pragprog.com/titles/eband3.
Copyright © 2010 The Pragmatic Programmers, LLC. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior consent of the publisher.
I case you hadn't noticed :-) despite the recent transition, JavaOne is indeed happening. The call for papers went out a while ago, and it's it's about to close, so submit your proposal today!.
It promises to be a giant year with JavaOne being just a few blocks from Oracle OpenWorld. That few blocks should provide a gap of sanity (opportunity?) between the Geeks and the BizTypes. San Francisco will be bursting at the seams. And, someone out there is making money on the NetBeans Platform in this case, since purchasing this application will cost you $145, while a trial version is also available.
Quite a lot of work seems to have gone into this application, primarily in the porting from a previous incarnation (shown here):
Must be nice, as a developer of this application, to suddenly have a free docking framework out of the box. :-)
Note: Nowhere on the DbWrench website will you see a reference to the NetBeans Platform. Nothing wrong with that. But it clearly means that it's hard to make an estimate about the actual popularity of the NetBeans Platform. However, from the screenshots page one can safely conclude that the NetBeans Platform is broadly adopted across all sectors developing industrial software applications.
Many thanks to Andrea Cisternino for identifying this application as yet another NetBeans Platform application! Others out there? Let me know!
|
Yesterday morning the USERS mailing list of GlassFish had a thread asking
How to start and run GlassFishV3 without Netbeans...
so, Alexis wrote and posted a
quick Survival Guide
on using GlassFish without an IDE
From question to documentation in a few hours: self-publishing, no webmaster to contact, all links to online documentation... and no lawyer to check with :-) |
|
Indeed.COM shows a spike
In other good adoption indicators:
|
And, before you ask; the roadmap is very close...
I started by downloading NetBeans IDE 6.5, installed the OpenOffice.org API plugin, then moved the OfficeBean sample from the OpenOffice SDK into the OpenOffice Client project type which I then opened in a NetBeans IDE 6.9 development build:
Running it, I see this:
The next step is to open OpenOffice via the OfficeBean into a NetBeans Platform TopComponent. This blog entry will probably be very useful.
In this installment of the Android multi-touch series, we try to understand touch events by writing some sample code that dumps them out and then examines the results. All source code can be downloaded from the web site for Hello, Android! (3rd edition).
Understanding touch events
Whenever I first learn a new API, I like to first put in some code to dump everything out so I can get a feel for what the methods do and in what order events happen. So let’s start with that. First add a call to the dumpEvent() method inside onTouch():
From Touchv1/src/org/example/touch/Touch.java:
@Override
public boolean onTouch(View v, MotionEvent event) {
// Dump touch event to log
dumpEvent(event);
return true; // indicate event was handled
}
Note that we need to return true to indicate to Android that the event has been handled. Next, define the dumpEvent() method. The only parameter is the event that we want to dump.
From Touchv1/src/org/example/touch/Touch.java:
/** Show an event in the LogCat view, for debugging */
private void dumpEvent(MotionEvent event) {
String names[] = { "DOWN" , "UP" , "MOVE" , "CANCEL" , "OUTSIDE" ,
"POINTER_DOWN" , "POINTER_UP" , "7?" , "8?" , "9?" };
StringBuilder sb = new StringBuilder();
int action = event.getAction();
int actionCode = action & MotionEvent.ACTION_MASK;
sb.append("event ACTION_" ).append(names[actionCode]);
if (actionCode == MotionEvent.ACTION_POINTER_DOWN
|| actionCode == MotionEvent.ACTION_POINTER_UP) {
sb.append("(pid " ).append(
action >> MotionEvent.ACTION_POINTER_ID_SHIFT);
sb.append(")" );
}
sb.append("[" );
for (int i = 0; i < event.getPointerCount(); i++) {
sb.append("#" ).append(i);
sb.append("(pid " ).append(event.getPointerId(i));
sb.append(")=" ).append((int) event.getX(i));
sb.append("," ).append((int) event.getY(i));
if (i + 1 < event.getPointerCount())
sb.append(";" );
}
sb.append("]" );
Log.d(TAG, sb.toString());
}
Output will go to the Android debug log, which you can see by opening the LogView view (see Section 3.10, Debugging with Log Messages).
The easiest way to understand this code is to run it. Unfortunately you can’t run this program on the Emulator (actually you can, but the Emulator doesn’t support multi-touch so the results won’t be very interesting). So hook up a real phone to your USB port and run the sample there (see Section 1.4, Running on a Real Phone). When I tried it on my phone and performed a few quick gestures, I received the output below:
1. event ACTION_DOWN[#0(pid 0)=135,179] 2. event ACTION_MOVE[#0(pid 0)=135,184] 3. event ACTION_MOVE[#0(pid 0)=144,205] 4. event ACTION_MOVE[#0(pid 0)=152,227] 5. event ACTION_POINTER_DOWN(pid 1)[#0(pid 0)=153,230;#1(pid 1)=380,538] 6. event ACTION_MOVE[#0(pid 0)=153,231;#1(pid 1)=380,538] 7. event ACTION_MOVE[#0(pid 0)=155,236;#1(pid 1)=364,512] 8. event ACTION_MOVE[#0(pid 0)=157,240;#1(pid 1)=350,498] 9. event ACTION_MOVE[#0(pid 0)=158,245;#1(pid 1)=343,494] 10. event ACTION_POINTER_UP(pid 0)[#0(pid 0)=158,247;#1(pid 1)=336,484] 11. event ACTION_MOVE[#0(pid 1)=334,481] 12. event ACTION_MOVE[#0(pid 1)=328,472] 13. event ACTION_UP[#0(pid 1)=327,471]
Here’s how to interpret the events:
Now the code for dumpEvent() should make a little more sense. The getAction() method returns the action being performed (up, down, or move). The lowest 8 bits of the action is the action code itself, and the next 8 bits is the pointer (finger) id, so we have to use a bitwise AND (&) and a right shift (>>) to separate them.
Then we call the getPointerCount( ) method to see how many finger positions are included. getX( ) and getY() return the X and Y coordinates, respectively. The fingers can appear in any order, so we have to call the getPointerId() to find out which fingers we’re really talking about.
That covers the raw mouse event data. The trick, as you might imagine, is in interpreting and acting on that data.
To be continued in Part 4, Setting up for image transformation >
Copyright notice:
This is an excerpt from Hello, Android 3rd edition, published by the Pragmatic Bookshelf. For more information or to purchase a paperback or PDF copy, please visit http://www.pragprog.com/titles/eband3.
Copyright © 2010 The Pragmatic Programmers, LLC. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior consent of the publisher.
In part 2 of the Android multi-touch series, we start building the sample program introduced in part 1. Excerpted with permission from “Hello, Android! (3rd edition)”. All source code can be downloaded from the book’s web site.
Building the Touch example
To demonstrate multi-touch, we’re going to build a simple image viewer application that lets you zoom in and scroll around an image. See Part 1 for a screenshot of the finished product.
Begin by creating a new “Hello, Android” project with the following parameters in the New Android Project dialog box:
Project name: Touch
Build Target: Android 2.1
Application name: Touch
Package name: org.example.touch
Create Activity: Touch
This will create Touch.java to contain your main activity. Let’s edit it to show a sample image, put in a touch listener, and add a few imports we’ll need later:
From Touchv1/src/org/example/touch/Touch.java:
package org.example.touch;
import android.app.Activity;
import android.graphics.Matrix;
import android.graphics.PointF;
import android.os.Bundle;
import android.util.FloatMath;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.ImageView;
public class Touch extends Activity implements OnTouchListener {
private static final String TAG = "Touch" ;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageView view = (ImageView) findViewById(R.id.imageView);
view.setOnTouchListener(this);
}
@Override
public boolean onTouch(View v, MotionEvent event) {
// Handle touch events here...
}
}
We’ll fill out that onTouch( ) method in a moment. First we need to define
the layout for our activity:
From Touchv1/res/layout/main.xml:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView android:id="@+id/imageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/butterfly"
android:scaleType="matrix" >
</ImageView>
</FrameLayout>
The entire interface is a big ImageView control that covers the whole screen. The android:src=”@drawable/butterfly” value refers to the butterfly image used in the example. You can use any JPG or PNG format image you like, just put it in the res/drawables-nodpi directory. The android:scaleType=”matrix” attribute indicates we’re going to use a matrix to control the position and scale of the image. More on that later. The AndroidManifest.xml file is untouched except for the addition of the android:theme= attribute:
From Touchv1/AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.example.touch"
android:versionCode="1"
android:versionName="1.0" >
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<activity android:name=".Touch"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="7" />
</manifest>
@android:style/Theme.NoTitleBar.Fullscreen, as the name suggests, tells Android to use the entire screen with no title bar or status bar at the top. You can run the application now and it will simply display the picture.
Continued in Part 3, Understanding touch events >
Copyright notice:
This is an excerpt from Hello, Android 3rd edition, published by the Pragmatic Bookshelf. For more information or to purchase a paperback or PDF copy, please visit http://www.pragprog.com/titles/eband3.
Copyright © 2010 The Pragmatic Programmers, LLC. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior consent of the publisher.
We are glad to announce the first release of JBoss jBPM plugin with:



I can't resist to link here few new great articles / tutorials dedicated to the Mercurial distributed version control system and HgEclipse plugin for it.
Since the latest IntelliJ IDEA 9.0.2 EAP the IDE contains a bit of new Maven-related pom.xml editor features.
1. Easier Navigation



2. Smarter Paths
‘Path reference’ notion were added to the editor to enhance the code completion, usages search and rename refactoring of project paths.

3. More intelligent plugins configuration
IntelliJ IDEA analyses plugin parameter types and adds smart value editors for plugin configuration tags.

You feedback is as always highly appreciated.
Try the last EAP of IntelliJ IDEA 9.0.2 to test new ‘Generate’ actions for Maven pom.xml editor. Type “Alt+Insert” to invoke the “Generate…” popup menu and select an action to run.
IntelliJ IDEA actually runs live template inside to complete the code generation


Let us know what you think about.
With IntelliJ IDEA 9.0.2 you can enjoy editing web.xml with the new initial parameters support. IntelliJ IDEA now collects parameter names and is also aware of parameter values types. This allows the IDE to generate (with Alt-Insert), complete, highlight and validate them appropriately.

Grab the latest EAP of IntelliJ IDEA 9.0.2 to try it today.
If you are a plugin writer, you can provide your specific context parameters through the special com.intellij.javaee.model.xml.converters.ContextParamsProvider extention point.
This is the first in a series of articles on developing multi-touch applications with Android 2.x. It is excerpted from Chapter 11 of the book “Hello, Android! (3rd edition)”, available in beta now at The Pragmatic Programmers.
Introducing multi-touch
Multi-touch is simply an extension of the regular touch-screen user interface, using two or more fingers instead of one. We’ve used single-finger gestures before, although we didn’t call it that. In Chapter 4 we let the user touch a tile in the Sudoku game in order to change it. That’s called a “tap” gesture. Another gesture is called “drag”. That’s where you hold one finger on the screen and move it around, causing the content under your finger to scroll.
Tap, drag, and a few other single-fingered gestures have always been supported in Android. But due to the popularity of the Apple iPhone, early Android users suffered from a kind of gesture envy. The iPhone supported multi-touch, in particular the “pinch zoom” gesture.

Three common touch gestures: a) tap, b) drag, and c) pinch zoom. (Image courtesy of GestureWorks.com)
With pinch zoom, you place two fingers on the screen and squeeze them together to make the item you’re viewing smaller, or pull them apart to make it bigger. Before Android 2.0 you had to use a clunky zoom control with icons that you pressed to zoom in and out (for example the setBuiltInZoomControls() in the MyMap example). But thanks to its new multi-touch support, you can now pinch to zoom on Android too! As long as the application supports it, of course.
Note: If you try to run the example in this chapter on Android 1.5 or 1.6, it will crash because those versions do not support multi-touch. We’ll learn how to work around that in chapter 13, “Write Once, Test Everywhere”.
Warning: Multi-bugs ahead
Multi-touch, as implemented on current Android phones is extremely buggy. In fact it’s so buggy that it borders on the unusable. The API routinely reports invalid or impossible data points, especially during the transition from one finger to two fingers on the screen and vice-versa.
On the developer forums you can find complaints of fingers getting swapped, x and y axes flipping, and multiple fingers sometimes being treated as one. With a lot of trial and error, I was able to get the example in this chapter working because the gesture it implements is so simple. Until Google acknowledges and fixes the problems, thatmay be about all you can do. Luckily, pinch zoom seems to be the only multi-touch gesture most people want.
The Touch example
To demonstrate multi-touch, we’re going to build a simple image viewer application that lets you zoom in and scroll around an image. Here’s a screenshot of the finished product:

The Touch example implements a simple image viewer with drag and pinch zoom.
Continue reading: Part 2: Building the Touch Example >
Copyright notice:
This is an excerpt from Hello, Android 3rd edition, published by the Pragmatic Bookshelf. For more information or to purchase a paperback or PDF copy, please visit http://www.pragprog.com/titles/eband3.
Copyright © 2010 The Pragmatic Programmers, LLC. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior consent of the publisher.
The "on the Java road" part of my job@Oracle is starting with a busy time:
With IntelliJ IDEA 9.0.2 you can edit HTML and CSS code really fast using Zen Coding features.
To use it, you have to install Zen Coding plugin for Web IDE/IntelliJ IDEA: go to Zen Coding Project Download Page, download an archive that contains a set of live templates, and extract it to “<Your Home Directory>\.IntelliJIdea90\config\templates” folder (”~/Library/Preferences/IntelliJIDEA90/templates” for Mac OS X).
To learn more about Zen Coding features, you can watch screencasts on Zen Coding project home page.
Note that Zen Coding native support is a part of IDEA Community Edition, and its source code is freely available.
The latest IntelliJ IDEA 9.0.2 EAP contains a big number of Database-related functionality changes:

The Hibernate Console has also been improved accordingly (separate toolwindow, console-like UI and per-result paging actions).
Try all this in the latest EAP and let us know what you think.
Since IntelliJ IDEA 9.0.2 Database Diagram supports drag-and-drop for adding more tables to the view. The screenshot below shows the way to access the diagram if you somehow missed the What’s New in 9.0 page.

You can try this right now in the latest EAP.
If you work on large projects with dozens of Flex modules (or facets) you’ll like this new feature of IntelliJ IDEA 9.0.2, which lets shorten project build time by compiling several independent Flex modules (facets) in parallel.
To enable this feature go to Settings (Ctrl+Alt+S), Compiler node and then Flex Compiler page:

Let’s have a closer look at this feature.
Flex Compiler Shell (fcsh) is good for small projects, and may be useful in large projects as well, when you need to compile only some of the modules (facets). Fcsh process is kept in memory between compilations, so it is able to quickly recompile only changed piece of code (that is called incremental compilation), but in case of large projects fcsh runs out of memory, then IntelliJ IDEA restarts it automatically, but incremental compilation data is lost.
Mxmlc/compc processes are not kept in memory between compilations, but simultaneous running of independent compilations gives a good performance gain. IntelliJ IDEA automatically finds independent compilations based on module-on-module dependencies, configured in Project Structure (Ctrl+Alt+Shifl+S), Modules node, Dependencies tab.
Whatever tool you’re using, IntelliJ IDEA keeps track of modules where nothing was changed since previous compilation and skips compilation of up-to-date swf/swc files.
In conclusion, here are different ways of compilation in IntelliJ IDEA (applicable for Flex as well as for other programming languages):
Only a few projects with any diversity (props to Mylyn, CDT, and Linux tools!); none in the core.
You’ve probably heard that Apple does not allow any interpreted or run-time compiled programs on the iPhone. That’s why you don’t see Flash, C#, or Java used on the iPhone. Now, companies like Adobe and Novell are trying to do something about that. In a ZDNet Q&A, Joseph Hill, product manager for Mono at Novell explains their approach with MonoTouch.
The MonoTouch project lets you run Mono programs on the iPhone. Mono is an open source implementation of Microsoft’s .NET platform sponsored by Novell. Normally, .NET code written, for example, in C# runs inside of a virtual machine. The VM takes an intermediate form of the code called bytecode (or in the case of .NET, MSIL) and either interprets it or does a Just-In-Time compilation to native code as needed. Apple doesn’t allow that, so as Joseph Hill explains, Novell had to take a different tack.
Ed: Why does Apple allow .NET development with MonoTouch when they don’t allow Java development on the iPhone/iPad?
Joseph: Java (and other runtimes) are restricted from being deployed to the iPhone because an application cannot execute writable memory. Virtual machines like Java and .NET generate native code from bytecode at runtime, and then execute this code; however, for various reasons, the iPhone kernel will not allow this code to be executed. Mono’s Ahead-Of-Time (AOT) feature avoids this issue by generating all native code that the application could generate at runtime ahead-of-time, so the application deployed to the iPhone is a 100% native application.
Ed: Does Ahead-Of-Time compilation make some features of .NET unavailable?
Joseph: The primary feature that is lost to AOT compilation is Reflection.Emit. (Since this would generate code that could not be executed.) Normal reflection is okay.
Next: Do I still need a Mac? >
If you’re a lucky owner of IntelliJ IDEA 9 Ultimate Edition, you’ll be surprised to find a new action in VCS History panel: view all changes made in commit in a single dialog. This feature makes it simpler to understand what a commit author made in his change.
To start using this feature, invoke Show History action for any file, then select revision you’d like to investigate, and then click UML icon (or press Control+Shift+D).

This opens the following diff dialog:

As you can see, 3 changes are made in layout.properties, Rounded interface and RoundedButton class. By default, green color marks what was added, blue is for changed, and gray, guess what — deleted. Well, what else can we see here? RoundedButton class doesn’t extend JComponent and does not implement ButtonModel interface anymore, but instead it extends AbstractButton class and implements MouseListener and KeyListener interfaces. Also, author has changed method paint and removed method isPressed. Interface Rounded was added from scratch and some properties were modified, added and removed in layout.properties file. Double click on a node shows standard diff dialog.
You will be able to enjoy this UML-like Diff Tool in next EAPs and also in the nearest IntelliJ IDEA 9 update.
There are many great programming languages. And today we often pick one that fits best for a particular task. IntelliJ IDEA is a great IDE for polyglot programming offering out-of the box support for many languages plus a variety of language plugins.
Last year we’ve started creating language-specific IDEs such RubyMine for Ruby/Rails and Web IDE for HTML, JavaScript and PHP. Recently we’ve made available public preview of a new specialized IDE built on the IntelliJ platform — JetBrains PyCharm.
PyCharm is the environment for programming using Python and for web-development with Django framework.
Obviously, JetBrains PyCharm inherits all the functionality of the latest IntelliJ IDEA 9.0 for editing HTML, CSS, JavaScript, XML, working with VCS and more.
PyCharm 1.0 will be available later this year.

Download Public preview of PyCharm now to try it.
Read more about JetBrains PyCharm and participate in the Early Access Program.
We are going to continue to develop and release the Python plugin for IntelliJ IDEA. The plugin will remain free for all users of IntelliJ IDEA Ultimate.
Develop with pleasure,
JetBrains Team
Hypothetically speaking, if I had received an invite to join the Kindle Development Kit (KDK) for active content limited Beta program, which I didn’t, and had read over the Terms and Conditions for the KDK, which don’t officially exist, I wouldn’t have seen this section:
You will not, without our prior written consent, use our trademarks, trade names or logos in any manner, or issue or contribute to any press release or any other public statement relating to the Program, our relationship with you or the terms or existence of this Agreement.
If such a policy existed, and I’m not saying it does or doesn’t, it might prevent anyone from disclosing that they were even working on any Kindle apps. It’s a good thing I’m not doing that. And I certainly wouldn’t be able to share any source code examples or documentation from the KDK with you because the non-existent policy might say:
We will from time to time provide you access to certain software, documentation and related materials (the “Materials”) in our sole discretion. … You will not use or authorize a third party to use any software in a manner that would in any way cause the Materials to be licensed free of charge, distributed in source code form or modifiable other than as expressly permitted in this Agreement.
It’s really too bad the beta program doesn’t exist because if it did I could tell you about the neat <redacted> feature, the fact that the whole thing is based on <redacted>, or the <redacted> limit of <redacted> KB/month. Wow, I can’t believe nobody has reported on that yet.
So… what could we talk about instead? How bout ‘dem Saints?
For those of us who uses Mercurial distributed version control system (DVCS), I have great news: Intland has released the 1.6.0 snapshot of the MercurialEclipse plugin!
The main changes are dedicated the "enterprise" use case - we've improved scalability, usability and performance of the plugin.
P.S. Screenshots are coming soon...
Are you interested in SWT API for the Windows Ribbon Framework? If yes please raise your voice in bug 293637. It looks like the Ribbon can’t be used in the SDK or any other Eclipse project at the moment. However, it’s still unclear if it can be part of the SWT API.
If we allow others to make decisions about what the Net is for — preferring some content and services to others — the Net won’t feel like it’s ours, and we'll lose some of the enthusiasm (= love) that drives our participation, innovation, and collaborative efforts.or, reworded for Eclipse:
If we allow others to make decisions about what Eclipse is — preferring some plug-ins and projects to others — Eclipse won’t feel like it’s ours, and we'll lose some of the enthusiasm (= love) that drives our participation, innovation, and collaborative efforts.In other words, as long as the official Eclipse distros are controlled by single companies, the growing body of users will continue to be disenfranchised. I think the Apache Foundation epitomizes what the Eclipse Foundation should strive to emulate:
We consider ourselves not simply a group of projects sharing a server, but rather a community of developers and users.Required diversity, decisions made by contributors, refusal to allow sponsors to control project direction, ... those are some of Apache's open fundamentals. If elected to the Board, I will work for moving the Foundation in that direction. I'm pro-member-company-profits, but not in a way that is anti-open. I want Eclipse and the Foundation to be viable in the long-term and I believe the only way to accomplish that long-term relevance is through a truly open meritocracy.
Here’s a scary thought for you. Every day, hundreds of billions of dollars of financial transactions are driven completely autonomously by computer algorithms. The fate of corporations and nations rests on bits of computer code sent out by their makers to do battle in a high-stakes trading war. And when something goes wrong, it can go spectacularly wrong.
When you think of stock exchanges you probably have a quaint notion of a paper-strewn room full of stressed-out traders yelling to be heard over each other while watching big screen monitors that cover every square inch of the walls. Or maybe you have a more modern picture of an army of white collar workers barricaded in their caves of steel intently staring at computer displays, waiting to pounce on the right news or slightest movement by executing a quick buy or sell order.
In reality, today’s markets are largely driven not by bellicose bombasts or educated elites but by algorithms written by programmers like you and me. Programs that are set free to wreak profit (or havoc) in the innards of the world’s electronic cyber-market. According to the Financial Times, program trading accounts for about 30% of the total daily activity on the New York Stock Exchange, and a whopping 60-70% of the activity on other markets such as the Nasdaq. In 2008, the total world derivatives market was estimated at nearly $800 *trillion* dollars.
Unsatisfied by the decision speeds of mere humans, huge banks have turned over the keys to the vault to programs to do the trading of stocks and derivatives for them. The idea has a certain appeal: Put in a few billion dollars, push a button, and walk away while the computer does all the work. When you come back, if all goes well, you’ve made a nice profit. “Leave the driving to us,” as the slogan goes. Even a monkey could do it. Right?
Well, if you’re not a developer and you’re reading this, please take heed. Computers make mistakes, because they just do what their programs tell them to do, and all programs have mistakes lurking in them. “Bugs,” we call them. Much of the craft of computer programming is concerned with reducing the number of bugs. When a program controls something really important, like say an X-Ray machine, a fighter jet, a space craft, or a nuclear power plant, extreme efforts are put into eliminating as many bugs as humanly possible. But as a number of high profile cases have proven, it’s impossible to detect them all.
Take the case of the NYSE Euronext exchange operator. Recently it fined a trading firm for “failing to control” its trading algorithm. One day, out of the blue, the program decided to send “hundreds of thousands” of messages for faulty orders, clogging up the exchange for everyone for hours. All it takes is a bad “if” statement or a misplaced semicolon, or maybe an array that grows larger than expected or a race condition in multi-threaded code. Let’s not even mention what a malicious hacker with an agenda can do.
So what’s the fix? Acknowledge that bugs happen, and put in checks and balances to catch and contain them. Don’t assume computers are infallible. They’re just as fallible as the humans that build and program them. More, because humans have the advantage of common sense. Let’s use it.
Photo credit: Walt Dabney
You've probably seen the news - the Sun/Oracle transaction has closed. With the passing of that milestone, I can once again speak freely.
Having had nine months to accelerate down the runway, there's not a doubt in my mind Oracle's takeoff and ascent will be fast and dramatic. I wish the combined entity the best of luck, and have enormous confidence in the opportunity.
Greg Papadopoulos, one of the brightest people I've ever known, once made a very interesting statement - all technology ultimately becomes a fashion item. It was true for timekeeping, and it's definitely true of computing and telecommunications. To that law, I'd like to add a simple corollary: the technology industry only gets more interesting. It's been true my entire life.
As for where life takes me next, you should follow me via Twitter at openjonathan to find out. I'll also be rehosting this blog (and again, stay tuned to Twitter by following me here). I expect to do my part to keep things interesting.
Thank you for your support and commitment. I wish you all the best of luck building, taking advantage of (and likely wearing) the future!
Jonathan Schwartz
CEO, Sun Microsystems, Inc.
A Wholly Owned Subsidiary of Oracle Corporation.
Steve Jobs has just announced the iPad, calling it a “magical device at a breakthrough price”. Apple says the iPad runs all applications currently available on the iPhone App Store, plus apps customized for the device.

Here are the official specs direct from Apple:
Price: $499 for 16GB, $599 for 32GB, $699 for 64GB. If you want 3G that’s $130 extra up front, plus $14.99 for 250MB/moth, or $29.99/month for unlimited data.
Shipping is expected in March worldwide for the WiFi model, April for the 3G model. Unfortunately you can’t pre-order one right now pending FCC approval.
The iPhone 3.3 beta SDK with support for the iPad is available now from the Apple Developer’s web site. It includes an iPad simulator so you can begin testing right away. Similar to Android, you write one iPhone/iPod Touch/iPad app that runs on any device but adapts its user interface to the user’s resolution.
If you try to run an unmodified iPhone app on the big screen, it will either display in a small window in the middle of the screen or the user can zoom it up to 2x size. Zoomed apps won’t appear as crisp as apps adapted for the iPad, of course. That’s because original iPhone apps were designed for a resolution of 480×320 pixels. If you blow that up to 2x the size, you have 960×640 but every dot is 4 times bigger (and blockier) than it was originally.
See also: Live coverage of the announcement.
It’s “T-Day” for Apple as the company is set to announce the long awaited Apple Tablet. I blogged about the event as it happened, and now that it’s all over I’ve re-arranged the comments a bit for easier reading. Enjoy!
[ See also: $499 gets you a powerful tablet for browsing, books, and apps ]
7:57am (Pacific time): The media mob is already assembling at the Yerba Buena Center for the Arts. If you’re like me and you can’t be there in person, I’ll try to make you feel like you are. The temperature is a little nippy, 50 degrees, so bundle up, folks.

8:02am: It’s not too late to try your luck at the Apple Tablet polls. Scroll down to the very end of this post to see them. Polls close at 10am Pacific time.
8:11am: Interesting article at The Gawker about all the Apple Tablet anticipation. They call speculating about the tablet “one of the great modern pastimes”.
8:22am: Crowdsource prediction from the polls below: iSlate, available in March, for Book reading, $700-799, programmed in Objective C. My predictions: iPad, in June, for Games, $900-999, in Objective C.
8:26am: Apple Tablet, #Apple, iSlate, and iTablet are all trending on Twitter. No surprise there, but the one I can’t explain is “Frantic Steve Jobs”.
8:29am: Comments are open! Add your voice to the Trackback area below. We did away with that nasty registration form, so jump in.
8:33am: Is this the outside of the Apple Tablet? Looks pretty bland but plausible.
8:38am: Quite a mix of people in the crowd. Young and old, sweatpants and power suits, not to mention “black clad Apple security types” guarding the entrances. Not many women. Maybe they’re smart enough to avoid standing out in the cold for 3 hours.
8:43am: Lots of iPhone developers in the crowd. Everybody is wondering how compatible the tablet will be with the iPhone/iPod touch. Will it start with zero apps or 100,000?
8:50am: Apple shares down $3.38 this morning to $202.56. Is this a case of Buy on the rumor, sell on the news?
9:05am: Wireless networking is becoming a problem. WiFi is prohibited in the center, and 3G is iffy. Ars writes “We use Sprint [on EVDO] actually, at any big event, AT&T dies because there are 1000’s of iPhones around”. Even people with wireless mice are having a hard time.
9:07am: If the Apple Tablet allows background processing, and is available on carriers other than AT&T (or no carrier at all), I wonder what that will do to the momentum behind Android? Comments welcome.
9:20am: Some people are getting inside the building now (the glass part), others are still standing in the long registration line.
9:22am: Overheard on gizmodo: “I hope Apple announces a tablet that’s really just 6 iPod touches glued together, bezels and all.”
9:28am: Doors are about to open; mood is jovial but some crowding.
9:36am: No, there is no live video feed available. That’s what you have us for! You know, everybody disses Apple for this but I think it just builds on the whole anticipation/insider/secret knowledge thing they have going. Is that why Google events are so boring in comparison? Yeah, that’s it.
9:38am: Another good one: “I hope Apple announces a tablet that makes us all understand why we inexplicably crave a tablet.” Only 20 minutes left before the polls close!
9:42am: Doors are open and the crowd streams in. Looks like Steve Jobs will be in attendance after all. How can we tell? Because Dylan is playing.
9:45am: What kind of company would Apple be without Steve Jobs? He certainly makes it more fun.
9:46am: This just in: Leaked pictures of the Tablet! Er, not really, but funny.
9:48am: Everybody is commenting on the chair on stage. Is Steve J not feeling up to standing? Please God don’t let this turn into Dick Clark’s New Years Rockin’ Eve.

9:56am: People are taking their seats (in the audience I mean). Al Gore is here. How come he gets all the good invites?
9:59am: Looks like TechCrunch has crashed under the load. Or maybe the server died in shame over what CrunchPad could have been.
10:01am: Steve is out on stage! Big applause. Big grin on his face. “We want to kick off 2010 by introducing a truly magical and revolutionary new product”. But first, a few updates.
10:08am: (AppleInsider feed falls by the wayside too… zdnet.com and cnet.com showing strain but still up. No update from Ars in like 20 minutes).
10:08am: 250M iPods sold, 140K apps in the App Store, 3 billion apps downloaded.
10:09am: Jobs: Is there room for something in the middle of a laptop and a smartphone? Not the netbook - too slow, low quality display, and PC software. [snicker] It should be better at things like browsing the web. Email. Photos. Videos. Music. Games. eBooks.
10:11am: Jobs holds up the tablet… and the crowd goes wild. It looks just like a big iPhone.
10:14am: It’s called the iPad. Desktop is customizable, looks like a cross between Mac OS X (dock at bottom)and iPhone OS (icons, strip at top). Steve is emphasizing the web browsing right now.
10:14am: Display is not wide screen - looks closer to 4:3. “Much more intimate” than a laptop. Ah, now I see what the chair is for, that intimate, fire-side chat feeling. Steve runs through the demos.
10:18am: On-screen keyboard is *huge*. Looks like full size.
10:20am: Apps are not just scaled up versions of iPhone apps. For example the Calendar is 2 pages wide. Mail shows iPhone-like summary on left, reading pane on right.
10:23am: Interestingly, the demo unit is connected via WiFi. There is no 3G/phone icon visible anywhere.
10:23am: iTunes runs natively on the iPad. Album covers and all. No need to have a computer to sync up with it.
10:25am: Now showing Google Maps with Street View. Graphics are super smooth. I wonder if this has one of those dual-core ARMs? Or is it Intel Atom? Or Snapdragon? It has to be something pretty darned fast.
10:28am: Here come the specs. 0.5″ thick, 1.5 lbs.
10:30am: Custom 1GHz Apple A4 chip.
10:35am: 16-64GB Flash storage. Full capacitive multi-touch. WiFi 802.11n.
10:40am: Existing iPhone apps will run unmodified. They can run in 1x mode, unscaled, in the middle of the screen, or in 2x (full screen mode). The iPhone SDK has been enhanced to support the iPad. Using the new APIs you can write an app that works on *both* devices, and takes advantage of the bigger screen on the iPad if the user has that.
10:42am: Demo of Nova, a first person shooter. Looks nice. Ships “later this year”.
10:45am: Newspaper reading demonstrated with the New York Times. Multiple columns, inline video.
10:46am: Now showing the Brushes demo. Painting on the screen. Like the iPhone app only bigger.
10:48am: Next up: EA games. Given 3 weeks with the device to make a demo. Need for Speed Shift - touch and accelerator enabled. Touch mirror to see behind you. (Sorry for zdnet/cnet slowdown folks, server is getting hammered!)
10:50am: No word on multi-tasking or camera yet, looks doubtful.
10:53am: MLB.com app looks awesome. Live-game experience, navigate through games, pitch-tracker, trajectory of each pitch from the player’s perspective. And oh yeah, real video from the game if you want that.
10:55am: New app: iBook Store. Browse, buy, and read books online. All 5 major publishers (Penguin, Harper Collins, Simon and Schuster, MacMillan and Hachette) are on board. “Stands on the shoulders” of Kindle and goes a bit further. Bookstore opens this afternoon.
10:59am: iBook store uses the standard EPUB format (unlike the Kindle). You can change the font, size, etc..

11:00am: Also new: iWork on the iPad. New Keynote presentations designed specifically for the iPad. New version of Pages (word processor) and Numbers (spreadsheet). [I wonder if it can video out to a projector?]
11:11am: Keyboard changes based on the application. For example there are custom keyboards in the spreadsheet application for entering formulae.
11:12am: iWork apps are $9.99 each (not bundled together).
11:13am: Steve’s back. The iPad supports USB synching, but
also there are models with built-in 3G. There are 2 plans. $14.99 for 250MB/mo, or $29.99 for unlimited data. Wow.
11:15am: 3G is provided by AT&T in the US. International available in June. There is no contract - cancel any time.
11:16am: All models are unlocked and use GSM micro-SIMS.
11:19am: Price: $499 for 16GB, $599 for 32GB, $699 for 64GB. If you want 3G that’s $130 extra. Shipping in 60 days worldwide.
11:22am: Accessories include a nice case, and a dock with a built-in keyboard.
11:30am: Cue video espousing how great the iPad is.
11:34am: “This is a magical device at a breakthrough price”. That’s it folks, thanks for joining us.
Just for fun I’ve created a few polls in the days running up to the event. The polls are closed now, but check it out and see how well you scored.
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll. Note: There is a poll embedded within this post, please visit the site to participate in this post's poll. Note: There is a poll embedded within this post, please visit the site to participate in this post's poll. Note: There is a poll embedded within this post, please visit the site to participate in this post's poll. Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.Enjoy!
This update to the tutorial features some additions and an update to the Deployment trail:
project.xml file was patched. This problem is fixed.
Thanks, as always, for your feedback.
- Sharon Zakhour
One week after releasing the Android Nexus One phone to the public, Google has released the software development kit (SDK) that allows third-party developers to write applications for the phone. Android 2.1 has several new features including:
Version 2.1 is also referred to as Eclair Maintenance Release 1 (MR1), or API level 7 to programmers. In all, 2.1 has 118 API changes, which is approximately a 0.48% difference compared to the previous version.
Availability
Android 2.1 is currently shipping on the HTC Nexus One. The Motorola Droid (Sholes) sold by Verizon is currently at 2.0.1 but users should expect an over the air update “soon” (which could mean anything from 2 weeks to 2 months). As of this writing, all other Android devices (about 80% of the market, according to Google) are running version 1.5 or 1.6:
Source: Google market data collected during the two weeks ending on 1/4/2010
Eventually 2.0.1 will go away, replaced by 2.1 just as 2.0 was replaced by 2.0.1. If current trends continue, we predict that 2.0.1/2.1 will achieve a 25% market share by February, and 50% by the end of the year.
Note that all programs written using the 1.5/1.6 APIs should work on newer devices, but you should test your apps on all targeted versions and screen sizes just to make sure. Programs written to require the 2.0.1/2.1 APIs will not work on older devices.
"The community of developers whose work you see on the Web, who probably don’t know what ADO or UML or JPA even stand for, deploy better systems at less cost in less time at lower risk than we see in the Enterprise. ... More important is the culture: [with] development cycles [no] longer than a single-digit number of weeks."The Foundation needs to both enable, but also to actively lead, the community toward this kind of development... It should take no more than 15 minutes to start a new project (or new projects will go to github). It should take no more than 15 minutes for a newbie to get started contributing to a project (or people won't join). It should take no more than a week to finalize a release (or we'll be left behind). Etc... There's a lot of good technology at Eclipse and a lot of good people in the community, but the software world is going through one of its regular massive waves of change, and the Foundation processes are contra-indicated for being part of that wave. I want to see those processes changed so that the greatness that is Eclipse can participate in the change that is occurring.
An open source organization or company is one that contributes a significant number of developer-person-hours to open source projects.2Microsoft does not contribute significantly to open source projects; Red Hat does. The Eclipse Foundation does not; whereas the Eclipse-centric companies do (IBM being the star contributor). Thus the Foundation itself is not an open source organization: it's a trade association of open source companies, and as a trade association it undertakes activities to support those companies (such as mailing lists and source code repositories).
During a recent visit to the Wikimedia Foundation, I had a very interesting discussion about community and change with Sue Gardner (Executive Director) and Erik Möller (Deputy Director). One of the topics we touched on was the video format the Wikimedia Foundation has chosen: the open format Ogg Theora. They spent a lot of time and energy on the format decision because it was a difficult tradeoff: on one hand, choosing a proprietary format (WMF, Quicktime, Flash, etc) would provide immediate access for everyone, but conflict with their goal of "freely available information everywhere for everyone". On the other hand, choosing an open format would limit availability but would ensure the information remains unfettered by a single company. So what should they do?The Eclipse Foundation could play the same leadership role in solving the Tragedy of the Commons. Mike is the charismatic, forceful leader that member companies would follow - in fact, I think he's the only person in the Eclipse ecosystem who could create the kind of corporate investment that is needed - that's why I was a key vote in hiring him at the beginning1. I believe that no single company is willing to step into the resource vacuum because nobody (not even IBM) has the deep pockets that IBM had from 2000-2004 — our only hope of corporate investment to solve the tragedy is a central leadership bringing the major strategic players to the table to staff the core team.
Instead they chose a third route: they chose an open format but at the same time, used their leadership position in information to convince the major browser vendors to include Ogg in HTML5. This is huge. This is leverage. This is change for the better.
Sometimes you may want to quickly generate graphs programmatically and view/analyze those. Examples include, inheritance/type relation diagrams of an object oriented program, function call graphs and any other domain specific graphs (reporting chain of your organization chart for example). I find GXL very useful for this. GXL stands for Graph eXchange Language. It is a simple XML format to specify graphs. A simple graph stating that "JavaFX" language is related to "Java" language is as follows:
File: Test.gxl<gxl> <!-- edgemode tells this is directed or undirected graph --> <graph id="langs" edgemode="directed"> <!-- write your nodes --> <node id="java"/> <node id="javafx"/> <-- now write your edges --> <edge from="java" to="javafx"/> </graph> </gxl>
You can also add number of "attributes" to nodes and edges - like color of the edge, style of the edge and so on. For example, "red" color can be specified for an edge as follows:
<edge from="java" to="javafx"> <attr name="color"><string>red</string></attr> </edge>
Now that we have written a simple graph with two nodes and a single edge between them, we may want to view it. There are number of tools/libraries to view GXL documents -- I've used Graphviz. Graphviz displays it's own native format called ".dot". Graphviz comes with a set of command line tools. One such tool is "gxl2dot", which as you'd have guessed, can be used to convert a .gxl file to a .dot file.
gxl2dot Test.gxl > Test.dot
Once converted the .dot file can be opened in Graphviz GUI and we can export it to .pdf/.jpg/.png and so on. This way you can email the graphs to others and/or publish in your blogs/webpages easily.
The converted .pdf file for the above simple graph is here: test.pdf
I've used GXL graphs in a recent debugging tool related to JavaFX compiler. More on that later...
... an organization founded and funded by businesses that operate in a specific industry. An industry trade association participates in public relations activities such as advertising, education, political donations, lobbying and publishing, but its main focus is collaboration between companies (see "Membership benefits"), or standardization (see "Eclipse industry working groups").It's ok that the Foundation is an industry trade association, but it means that the open source side of Eclipse (including me) must stop wishing for the Foundation to solve the Tragedy of the Commons and find some other way to make it happen. The Foundation will continue to provide benefits to the corporate members, that's fine - I've always been pro-profit. And the Foundation will continue to do marketing around the open source projects - nobody ever complained about too much PR help!