Monday, June 29, 2009

Computation on encrypted data: IBM breakthrough

IBM made a discovery that allows computations to be performed on encrypted data without decrypting it first. That could open up the possibility for some very interesting services. It would be easier to calculate, for example, aggregate statistics on sensitive data (such as financial or medical) regarding an individual, without requiring certain sensitive information (such as account numbers, specific balances, DNA sequences) to be leaked. There are almost certainly applications for this technology that have not even been dreamed of yet. The biggest downside so far is that the CPU performance hit is enormous.

http://www-03.ibm.com/press/us/en/pressrelease/27840.wss

http://www.forbes.com/2009/06/24/encryption-rsa-privacy-technology-breakthroughs-ibm.html

http://www.eweek.com/c/a/Security/IBM-Uncovers-Encryption-Scheme-That-Could-Improve-Cloud-Security-Spam-Filtering-135413/

Tuesday, June 23, 2009

Cross-platform ways to develop for iPhone

Irrlicht
Engine, SDK, basic editor
License: Free
Runtime platforms: Windows 98, ME, NT 4, 2000, XP, XP64, Vista, CE, Linux, Mac OSX, Solaris, iPhone
http://irrlicht.sourceforge.net/index.html
http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=32494

Rhodes
Ruby-based engine, SDK
License: Commercial with GPL option for GPL apps
Runtime platforms: iPhone, Windows Mobile, BlackBerry (RIM), Symbian, Android (Google)
http://www.rhomobile.com/

Game Salad
Beta engine, rich editor
License: Commercial (at least for iPhone)
Runtime platforms: web, iPhone
http://gamesalad.com/

Torque
Highly polished engine, SDK, rich editor
License: Commercial
Runtime platforms: Windows, Mac, Xbox 360, Wii, iPhone, web
http://www.garagegames.com/products/torque-2d/iphone

Monday, June 8, 2009

Jumpstart on iPhone with Objective-C in Windows

Eager to learn about building an iPhone app but not quite ready to set aside the money for a Mac? That's okay, you can still get started using the Objective-C programming language right away. Objective-C is the language used to write iPhone, iPod Touch, and Mac applications. Luckily it is supported by gcc (GNU Compiler Collection), which is available on many platforms.

If you have a Windows box handy, then you just need gcc with Objective-C support. The easiest way to do that in Windows is with MinGW, Minimalist GNU for Windows. The download page should have an Automated MinGW Installer for Windows.

Once you've installed MinGW, you can add the binaries to your path or use a build file of sorts; there are lots of options depending on your taste.

Let's see a basic Hello World app; we'll call it Main.m (m is the preferred file extension for Objective-C programs):
// From http://codewandering.blogspot.com/
// Main.m
int main(void)
{
printf("Hello, world!\n");
}
Look familiar? Objective-C is a proper superset of the C language, so valid C code is valid Objective-C code. Of course, to get the full power of Objective-C you'll want to use the object-oriented programming aspects of Objective-C as well.

A simple batch file like this will compile the program:
@rem From http://codewandering.blogspot.com/
setlocal
set path=%path%;c:\MinGW\bin\
gcc.exe -x objective-c Main.m -lobjc
endlocal
You may need to modify the set path command if you specified a different home folder for MinGW.

Now just run the batch file from a command line, which produces a.exe, your executable program. If you run that, you should see:
Hello, world!
Ready for more? Check out these great resources:

Tuesday, April 21, 2009

Forcing WebLogic to run in debug mode

I was working with a WebLogic installation the other day that I simply could not get to start in debug mode from Eclipse. This story is to share that experience in case anyone else runs into a similar problem. The initial symptom was that Eclipse (i.e. Workshop) would not recognize WebLogic as running in debug mode; it complained of a port not being open (the debug port).

Well, here is what the WebLogic server console was giving me:
WLS Start Mode=Production
.

Starting WLS with line:
C:\bea\JROCKI~1\bin\java -jrockit [missing some parameters] -Xms256m -Xmx512m…
That's never going to start in debug mode, because Production mode precludes debug mode. I needed to get the server to start in Development mode first.

I ended up having to go through my server startup (*.cmd or *.sh) and config (*.xml) files looking for things like this:
set PRODUCTION_MODE=true
...or this:
<setenv name="PRODUCTION_MODE">
<value>true</value>
</setenv>
...and changing them from true to false. I had used a customized installer which probably had set them to true.

That finally did the trick; now when I started the server in debug mode in Eclipse, I got the following in the server console:
WLS Start Mode=Development
.

Starting WLS with line:
C:\bea\JROCKI~1\bin\java -jrockit -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socke
t,address=8453,server=y,suspend=n -Djava.compiler=NONE -Xms256m -Xmx512m…
And the Eclipse debugger can now talk to the server.

Thursday, February 5, 2009

Careful w/ Java ME Screen Updates: Don't Trust Your Emulator

Be careful when updating a Screen (Alert, Form, List, TextBox) in Java ME (a.k.a. J2ME). I ran into a problem recently where I wanted to make a minor run-time adjustment to a Form in my app. I originally had the code update the Form while the old version of it (pre-update) was already displayed, then call setCurrent() to set the newly updated Form as the current Displayable. It worked fine in Sun's Wireless Toolkit emulator, but when I deployed to a real Sony Ericsson phone, the call to setCurrent() on the updated Form appeared to have no effect. In other words, the old, unchanged Form still showed. The problem lies with the fact that the specification does not define the behavior when a Displayable is changed while visible:

From http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Screen.html:

"It is recommended that applications change the contents of a Screen only while it is not visible (that is, while another Displayable is current). Changing the contents of a Screen while it is visible may result in performance problems on some devices, and it may also be confusing if the Screen's contents changes while the user is interacting with it."

First I tried a couple alternatives like setCurrent(null), which helps neither according to the spec nor based on my own testing. The best solution appears to be to create a second Screen (or Form in my case) and setCurrent() on it when it's ready. I was hoping it wouldn't come to that, but sometimes you just gotta bite the bullet and use a new object.

Happy coding.

Friday, January 23, 2009

Choosing Between Agile and Waterfall: Indicators

How do you know how agile to be in your software development process? Or how rigid?

If you have developed any software, you are probably familiar with pros and cons of both agile and waterfall processes, and you probably understand that agile and waterfall are on a continuum of sorts -- that is, there are shades in between. Even a continuum may be simplistic, because human processes are complex and multidimensional.

Therefore I will write in terms of processes that are "more agile" vs. "more waterfall." To be clear, by a more agile process I mean one more likely to include iteration, lightweight requirements, automated testing, a flexible schedule, and emphasis on continual team communication. By a more waterfall process I mean one more likely to include rigid and detailed requirements, less automation, a predefined schedule, and more restrained communication.

My goal for this entry is to lay out some rules of thumb, or imperfect guidelines, to help you choose a process that is more agile or more waterfall, depending on the circumstances. Because these are rules of thumb, you may need to consider the various factors independently and weight them as appropriate for your project.

Indicators for Agile

In other words, you might want to use a more agile process if...
  • Your customer trusts you.
  • You are developing a service.
  • You are developing for multiple customers.
  • There is no single contract between you and your customer.
  • There is an expectation of maintenance.
  • Your customer is more flexible.
  • You have a flexible or unknown deadline.
  • You are developing a new or innovative sort of product or service.
  • Your customer doesn't know the requirements well.
Indicators for Waterfall

In other words, you might want to use a more waterfall process if...
  • Your customer doesn't trust you.
  • You are developing a one-off, shrink-wrapped product.
  • You are developing for a single customer.
  • You are developing for a single contract.
  • There is no expectation of maintenance.
  • Your customer is less flexible.
  • You have a rigid deadline.
  • You are developing a standard or well-known sort of product or service.
  • Your customer knows the requirements well.
Again, the indicators are not absolute. For example, a more agile process can still work very well, and sometimes better than waterfall, with a rigid deadline. But I list a rigid deadline as an indicator for waterfall because an agile process can be even more helpful when the deadline is flexible or unknown, whereas a waterfall process does not usually work well with a flexible deadline.

I list trust first because it can be a very powerful indicator. Even if most other indicators point to waterfall, a high degree of customer trust can enable a more agile process. I feel comfortable saying this because I have personal experience with it.

Wednesday, November 26, 2008

Instant custom-formatted feeds with ROME, Velocity

It's nice when technologies blend well. ROME is a free, open-source, Java-based feed (Atom/RSS) parser and publishing library from Sun. And it works oh so well with Velocity templates.

Java/Servlet code:

import java.net.*;
import com.sun.syndication.feed.synd.*;
import com.sun.syndication.io.*;

...

URL feedUrl = new
URL("http://codewandering.blogspot.com/feeds/posts/default");
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(new XmlReader(feedUrl));

List entries = feed.getEntries();

context.put("entries",entries);

StringWriter body = new StringWriter();
Velocity.mergeTemplate("Feed.vtl",context,body);
out.print(body.toString());


Velocity code:

#foreach($entry in $entries)
<a href="$entry.link">$entry.title</a><br/>
#{end}

Sample output:

Bruce Schneier as national CTO?

Regression testing for any web application with TeamCity, Selenium, and JUnit

The future of portable gaming

Summary

Because Velocity accesses beans and nested beans via a simple property interface, and ROME parses feed XML into bean structures, you can easily extract exactly the parts of the feeds that you want. The above just does titles and links, but a full list of properties supported by ROME (as getter methods) is given here. Now you have the view flexibility of Velocity matched with feed data ideally structured for it.

And since you're doing the parsing on the server side, you won't risk that nasty "Access to restricted URI denied" code: "1012" error or related security risk.
Copyright 2011 by William Cain