Monday, 5 May 2008

copy for HTML.

Processing has a "copy for discourse" feature and when it works it awesome. It takes the code in the pde file and formats it for the discourse board. But this doesn't help when you want to publish some code on the rest of the internet. Something like this
void setup(){
String myString = backwards("the quick brown fox");
}

String backwards(String s){
String t = "";
for(int i = s.length() - 1; i >= 0; i --){
t = t + s.charAt(i);
}
return t;
}

OMFG colour. Adds a lot to code doesn't it.

Well I thought that maybe other people might find this tool useful, so here is the pde that makes the pretty colored text above. It takes the contents of the "formated for discourse" clipboard and formats it for the web.
  1. Get your code and copy it for discourse.
  2. Run the copy for HTML pde.
  3. Paste into blog.
copy_to_HTML

Labels: ,

Make your own Engrish

Homo Sausage

Fun with translators. Type in a simple phrase. and then keep translating the output till it can't translate anything else. For example.
  1. Hello what is your name?
  2. When there is a name, present several?
  3. Is there a multiple which when name shows?
  4. When name shows, is there a multiple?
  5. When name multiple it shows there, is?
  6. The first-rate multiple which when, is shown there where it is?
  7. At the place where it has that, the time it is shown first-rate multiple there?
  8. At the place where it has that, has time that been shown first-rate multiple there?
  9. At the place where it has that to that, time has been shown thing first-rate multiple there, it is?
  10. At the place where it has that the, had time been shown the first-rate multiple of thing, there where that it is?
  11. Time having been shown the first-rate multiple of thing in the place where it has, there it is the that somewhere?
  12. At the place where it has first-rate multiple of thing the time when it is shown, there it is that somewhere?
  13. Is first-rate multiple of time thing as for that, there of a certain place which is shown that somewhere?
  14. Is first-rate multiple time a certain place which is shown thing somewhere, there in regard to that?
  15. Is first-rate multiplex time a certain place which has been shown somewhere thing in regard to that, there?

Labels: ,