Developer42

2009-11-23

Google Wave Robot :: Standard Commands

Filed under: Google, Technology, Wave — Tags: , , , , , , , , , , — Developer42 @ 19:57

Currently each programmer writing a bot for Google Wave is able to write whatever they want, sometimes providing support, but using their own, custom syntax. Having a set of commands which all (or many) bots implement would make the user experience far better, as users would then be able to easily find out how to use the bot, or where to find additional help.
e.g.
botName@appspot.com /? //see /help
botName@appspot.com /help //brings up a list of commands available
botName@appspot.com /about //displays a summary of what this robot does
botName@appspot.com /devsite //provides a link to the developer’s site
botName@appspot.com /mode private //the bot’s responses are only shown to the person who invited it
botName@appspot.com /mode public //everyone in the wave sees the bot’s responses

I’ve also made a summary of this post available on the Google Wave Bots site. Please can you post any responses to that site, as this will allow all communications to be kept in the same place.

2009-11-08

Psychic Site

Filed under: Ideas, Psychology, Technology — Tags: , , , , , , , , — Developer42 @ 16:35

One of the many projects I have queued up to code one day is a psychic site. This isn’t going to be any weird paranormal thing, or a way of ripping people off, but a way of showing what’s possible. The idea is to create a site, where a user fills in a few details, then the site does a cold reading. However, rather than just using the information provided, the site’s able to use information the person didn’t know they were giving to make it appear to be doing the impossible. Useful tools to aid with this are linked below:

Gender Genie. This shows how the language a person uses gives some indication as to their gender.
Polite Software’s Web Spy. This is a security flaw I discovered a while back, which it seems many geeks have worked out for themselves, but is still not that well known. Since you can tell a visited link from an active link by taking advantage of the different CSS style, and reading this using javascript, you can tell which popular sites a person’s been to. You can then use this information to build up a profile of the person, based on the sites and their demographics (e.g. someone who visits facebook is likely to be under 30, whilst someone going to the bbc news site is likely to be over 20).
HTML 5 GEO. HTML 5 introduces an amazing feature; your standard web browser is able to tell your location without requiring GPS. This is done by using GPS where available, your wireless network card to detect signals from various mobile phone masts, then using the strength of each of these signals along with signal strength maps to triangulate your location, your IP address to find the location of your ISP and various other methods. More on how this works can be found here W3 Geo Spec. Getting hold of this info is slightly less covert, as browser security will prompt the user to allow their location to be sent, but this small snippet of information can tell you much more. Once you know someone’s location, you can assume it’s their home, business, or school, since these are the most likely places from which someone will be accessing the net. You can then use data about these places to work out who someone works for, or how much their income’s likely to be (based on where they can afford to live), giving an idea of that person’s status in society. For an idea of what info you can get from someone’s address, UK residents may like to try putting their postcode into this site: Home Check.
You can then wrap all this data in with a few cold reading general comments (there’s a great example in Derren Brown’s
Tricks of the Mind, of a few paragraphs which describe almost anyone between 20 and 40, but sound as if they’re aimed directly at the reader) to make the few bits of real data you’ve gathered have more impact.

Other potential sources of info.
PIPL. Search for people.
192. Another person search tool
Facebook. Details on how to read data from people’s facebook accounts (with their permission!).
Google Dashboard. Everything Google knows about you (if you have a google account).
What’s My IP. Details glean-able from your IP address.
. Information on what web browser you use (safari people are artistic, chrome are techie purists, opera like elegance, firefox like functionality, and IE people follow the status quo).
How long is a piece of string?. A book with a few examples of ways in which people have been conned by not understanding statistics. Slightly off topic, but an interesting read (my favourite is the football score predictor that gets the result right every time).

When you find out how much it’s possible to find out about yourself, you may get scared. However, most of this information is harmless for people to find out, and the stuff that isn’t you have protection from (privacy settings in applications such as Facebook, prompts before allowing features such as HTML5’s Geo). These features can be put to good use, for example by having a site which changes it’s style to match the user’s likely tastes, and to bring more relevant content to the front (such as Google searches bringing up local restaurants when you look for somewhere to eat).

2009-11-05

2009-11-04

Ideas for Wave Robots

Filed under: Google, Ideas, Technology, Wave — Tags: , , , , , , , , , , , — Developer42 @ 21:32

One of the hardest things about developing a wave robot is coming up with an original idea. My smiley bot [smiley_wave@appspot.com] was just for me to play with wave & get used to uploading apps to App Engine / get back into java coding and using eclipse. Now that that’s done, it’s time to think of something useful; an application that people will actually want to use. The point of this post is partly a brainstorming session for myself, and partly to put these ideas out there to anyone stuck for ideas, who think they can code one of these, and finally, to encourage others to submit ideas.

Webby – The Web Service Robot
A robot which when added, detects any URLs pointing to web services, generates a form based on the parameters, then submits this data via SOAP, and puts the return value into a new blip.

Squely – A Database Query Bot
A robot which can run SQL statements against given connection strings. At present, this will only be possible if the database is publicly accessible, or if you have a wave server installed on the same network as your database.

QIFry – Interesting
This robot would monitor waves for key words, then on detection, pop in an interesting fact about that word (e.g. if it spots the word Banana, it says “did you know that bananas are herbs, and these shrubs can walk?”). It also monitors for boring words, and replaces them with more eloquent ones.

Pretty – Pretty Print
Detects common languages / markup & changes the layout to make it more readable.

Recipe
Finds recipes based on ingredients or dish names in the wave.

FindMe
Uses the GEO features of HTML 5 to locate where each wave user is and lets wavers know where their nearest wavers are. This could also take info about their interests to help match people up to folks whose hobbies they share.

2009-11-03

My First Wave Robot :: smiley-wave@appspot.com

Filed under: Google, Technology, Wave — Tags: , , , , , , , — Developer42 @ 00:34

smiley-wave@appspot.com first demo

appengine-web.xml

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
	<application>smiley-wave</application>
	<version>1</version>
</appengine-web-app>

web.xml

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
	<servlet>
		<servlet-name>Smiley</servlet-name>
		<servlet-class>inverso.google.wave.robot.smiley.SmileyServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>Smiley</servlet-name>
		<url-pattern>/_wave/robot/jsonrpc</url-pattern>
	</servlet-mapping>
</web-app>

capabilities.xml

<?xml version="1.0" encoding="utf-8"?>
<w:robot xmlns:w="http://wave.google.com/extensions/robots/1.0">
  <w:capabilities>
    <w:capability name="blip_submitted" content="true" />
    <w:capability name="wavelet_self_added" content="true" />
  </w:capabilities>
  <w:version>1&lt/w:version>
</w:robot>

SmileyServlet.java

package inverso.google.wave.robot.smiley;
import com.google.wave.api.*;
import java.util.*;

//FIX FOR ISSUE 354 is used where the robot suffers from the bug mentioned in the below links
//http://code.google.com/p/google-wave-resources/issues/detail?id=373
//http://code.google.com/p/google-wave-resources/issues/detail?id=354

public class SmileyServlet extends AbstractRobotServlet {

       /**
	 * Robot's version id & usage info
	 */
	private static final long serialVersionUID = 1L;
	private static final long serialSubVersionUID = 2L; //this is to help me prove that my latest changes
                                                            //have been uploaded correctly
	private static final String serialVersionID = "Version #" + new Long(serialVersionUID).toString() + "." +
                                                      new Long(serialSubVersionUID).toString();
	private static final String helpInfo = "\nThis robot is my learning tool for wave development, " +
                                               "so may occasionally break!  Apologies if you're one of " +
                                               "the people for whom it doesn't work!";
	private static HashMap dictionary = null;

	/*
	 * Creates the images & registers them against their invoking smileys
	 * */
	static {
		final int width = 24;
		final int height = 24;
		//http://commons.wikimedia.org/wiki/Smiley
		dictionary = new HashMap();
		dictionary.put(":)",new Image("http://upload.wikimedia.org/wikipedia/commons/7/79/Face-smile.svg",width,height,":)"));
		dictionary.put(":(",new Image("http://upload.wikimedia.org/wikipedia/commons/0/06/Face-sad.svg",width,height,":("));
		dictionary.put(";)",new Image("http://upload.wikimedia.org/wikipedia/commons/5/57/Face-wink.svg",width,height,";)"));
		dictionary.put(":D",new Image("http://upload.wikimedia.org/wikipedia/commons/1/15/Face-smile-big.svg",width,height,":D"));
	}

   /**
     * Handles changes to the wave
     **/
	@Override
	public void processEvents(RobotMessageBundle bundle) {		

		if (bundle.wasSelfAdded()) {
			final Blip blip = bundle.getWavelet().appendBlip();
			blip.getDocument().delete(); //FIX FOR ISSUE 354
			final TextView textView = blip.getDocument();
			textView.append( serialVersionID );
			textView.append( helpInfo );
		}

		for (Event e: bundle.getEvents()) {
			if ((e.getType() == EventType.BLIP_SUBMITTED) || (e.getType() == EventType.WAVELET_SELF_ADDED)) {
				final Blip blip = e.getBlip();
				smile(blip.getDocument());
			}
		}

	}

	private void smile(TextView textView){
		final String text = textView.getText();
		Iterator<Map.Entry> i = dictionary.entrySet().iterator();
		while(i.hasNext()){
			Map.Entry pic = i.next();
			String key = pic.getKey();
			int pos = -1;
			while((pos = text.indexOf(key,++pos))>-1){
				textView.delete(new Range(pos, pos + key.length()));
				textView.insertElement(pos,pic.getValue());
			}
		}
	}

}

2009-10-28

2009-10-27

BizTalk ConnectionString

Filed under: BizTalk, Ideas, Microsoft, Technology — Tags: , , , , , — Developer42 @ 19:24

When using BizTalk, there’s often one or two databases you’ll need to access regularly. Rather than hard coding these in parameters of the database methods, a potential solution is to create a functoid which returns the required connection string. This gives you the advantage that should you need to change your connection string, changing it in your functoid will simultaneously update everywhere using that connection string. Of course, once you’ve got one connection string to your configuration database, you can use simple names to access your other databases, since these names can be stored in your configuration database along with the relevant connection strings, making them even easier to maintain.

2009-10-26

Genius Ideas

Filed under: Comedy, Ideas — Tags: , , , , , — Developer42 @ 23:07

For anyone who hasn’t seen or heard it, Genius is a BBC Radio 4 show, which recently also aired on TV (BBC 2). The premise of the program is to get members of the public to submit their ideas, after which host Dave Gorman and a guest celebrity “genius” will analyse the idea to determine the intelligence of the submitter. However, these ideas aren’t always the most standard of thoughts or inventions. Ideas such as the Democrabus; a bus where all passengers have their own steering wheel and the bus goes the way of the majority, the Torture Box; a box into which inanimate objects which have in some way wronged you are placed in order to punish them, and Cat Bars; clubs where women sit at a table having a few drinks whilst enjoying the delights of having a cat wander over to their table to be stroked for their pleasure, are just a few examples of the sorts of thing which can be expected. To see some of the televised episodes, look here: http://www.youtube.com/results?search_query=bbc+genius+gorman&search_type=&aq=f.

So, introductions over, what’s this post about. Well, I’ve been busy submitting my own ideas for Genius; though so far have heard no word of a new series. So, in absence of further knowledge, I’ve decided to pop up a post of these ideas for all to enjoy. I hope you do.

The Hover Lawnmower
A device with spinning rotors on the bottom; two things spring immediately to mind. So why not combine these to reuse the rotation, and lose the wheels. This would allow an all-terrain lawnmower, able to cut grass on land or water. Adjusting the shape of the blades to a simple propeller design, and putting a skirt around the edge to focus the flow and reduce grass-throw would make this the perfect pitch preserving device.

Left Hand Man
Like a right hand man, but more creative. Your right hand man is someone who helps take care of all of the tasks you need to do and issues you need to resolve. Your left hand man helps you resolve some of the more design oriented problems, such as choosing the right shade of almost-white to paint the walls, choosing which songs to put on your iPod before jogging, and selecting spices to liven up your chicken pie.
Also available in this range are the right and left hand women (useful if you need to work on several things at once), and the foot range, popular with the upper classes.

The Jigsaw Shredder

Worried about identity theft? Then you need the Jigsaw shredder. This cunning device takes your sensitive documents and turns them into 1000 pieces of criminal entertainment. By moving from strips of paper to puzzle pieces, the task of reassembling the document becomes far more enjoyable. This, you think, may be counter-productive; however it’s actually counter-intuitive. By making the task more enjoyable, you’re encouraging the criminal to take up a new interest, helping to replace their bad habits with wholesome hobbies. Now, I know what you’re thinking. . . what about the edge pieces. If they can get the edge of the document together, they can reassemble my document in no time, making it far too easy to reassemble, thus completed too quickly for the seed of a hobby to be planted. Well, that’s the genius bit. Once a jigsaw shredding has been made, the edge pieces are removed and burnt. This burning of pieces produces enough energy to power the machine (whereas burning all the pieces wouldn’t be environmentally friendly).

2009-10-18

Polychos

Filed under: Books, Ideas — Developer42 @ 19:32

Most books about psychos focus on the negatives, but I’m sure there must be a yang to the yin; people with positive mental disorders. This idea came about from my own condition of “polite tourettes”; not a real condition, but a habit of saying words such as “cool” or “awesome” at random or awkward moments (which can be as bad as real tourettes if one of these words pops out just after someone says “my mum just died”)!
I haven’t started writing this book yet, since I haven’t got enough ideas to make it interesting, but I thought I’d pop it on here to see what people thought of the idea.
Other possible symptoms are:

  • People hear voices in their head telling them to make tea for people.
  • People who can get stuck holding a door open for days, never wanting to go in front of anyone else.
  • Not being able to eat whilst listening to someone else talk, as well as when talking yourself.
  • The inability to be negative about another person, regardless of what that person’s done.

Gradient Tolerent Graphics Tools

Filed under: Ideas — Developer42 @ 19:05

Most graphics tools these days provide a facility to fill areas using a gradient; an area filled with colour which gradually morphs from one colour to another. However, once an area’s filled, there’s rarely much functionality to work with these areas. Useful tools could be:

  • Tolerance Filter: When using tolerance filters, traditionally you can specify that a change is detected when the colour being analysed is a given value away from the selected colour. A more useful tolerance detection would use the tolerance value to compare each step & detect a border where this step is significant. As an example, say the tolerance value is 3 and the selected value is 10, in the following sequence, the area in quotes would be selected: 1,2,4,5,9,10,11,12,10,9,8,7,6,5,4. On the other hand, using the stepped tolerance filter would select the following: 1,2,4,5,9,10,11,12,10,9,8,7,6,5,4.
  • Colour Replace: Building on the above, when pasting an area with a gradient, it would be good to maintain the tone of the colour at the various points, so when pasting red over a blue gradient, the blue is replaced with red, but the shading remains the same (e.g. dark in one corner and light in another).
Older Posts »

Blog at WordPress.com.