Loading...
Logo
Processing Forum

New Processing Forum

in General Discussion  •  Other  •  3 years ago  
Welcome to the new Processing Forum. We've re-organized a lot of the Processing reference and community materials last week and there's more to come. This forum is a change that we're extremely excited about and it fits into the plans for the new Processing wiki, the upcoming Processing blog, and recent move of the code to Google Code. We see these four pieces fitting together as follows:

Processing Forum
The forum is the place where things begin and discussions are held. It's a place for the exchange of ideas and knowledge. We're excited to start fresh (a little late spring cleaning) so we're not porting over the previous content or user accounts. The previous two Processing forums (one for the software from beta to 1.0 and one for the alpha software) will be archived as HTML pages and will remain available. The Processing community has held some amazing discussions over the years and we want that knowledge to remain publicly available.

Processing Wiki
The wiki holds the technical documentation and community-generated code examples and tutorials. The best discussions from the forum will hopefully be edited and documented on the wiki as examples and tutorials for easy reference and updates.

Processing Blog
The blog is for announcements from the Processing developers. It's a one-way communication channel used for new releases and changes to the software. The announcements that used to be made through the Processing Discourse Forum will now go through the blog.

Processing on Google Code
This is the active resource for the SVN code repository, source browsing, and bug tracking. All bugs reports and suggestions for the software will now be handled through this site.

The main Processing website will remain the place for the exhibition, code reference, tutorials, and the software download. The main website is the public face of the project, while the work and innovation happens on the forum and wiki.

Replies(5)

Kind of a bummer not very compatible with lynx. It's cool though change isn't always a bad thing.
Good move!
They use HTML formatting here, so the Copy for Discourse tool in the PDE will no longer be useful.
That's a good opportunity for somebody to make a Copy to HTML tool, I suppose, which can later replace the old one.

Mmm, let's make a little try with the export capability of SciTE, my favorite editor...

final color START_COLOR_TOP     = # 335533 ;
final color START_COLOR_BOTTOM = # 55AA55 ;
final color END_COLOR_TOP       = # 333355 ;
final color END_COLOR_BOTTOM    = # 5555AA ;

final int MAX_FRAME_NB   = 72 ;

int colorCycleDirection = 1 ;
int colorCycleCursor ;

void setup ()
{
  size ( 1000 , 700 );
  colorMode (HSB , 360 , 100 , 100 );

  smooth ();
//  noLoop();
  background ( 150 );
  noFill ();

}

void draw ()
{
  DrawBackground ();
}

color InterpolateColor (color startC , color endC )
{
  colorCycleCursor += colorCycleDirection ;
   if (colorCycleCursor >= MAX_FRAME_NB || colorCycleCursor < 0 )
   {
    colorCycleDirection = -colorCycleDirection ;
    colorCycleCursor += colorCycleDirection ;
   }
   return lerpColor (startC , endC , ( float ) colorCycleCursor / ( float ) MAX_FRAME_NB );
}

Wow, it works! It accepts a style section inside a message... Cool! Ah, no, bummer! It shows OK in the preview, but the CSS section is stripped from the final message...

[EDIT] Ah, saw in another message that there might be auto syntax highlighting? Let's try it:
Copy code
  1. final color START_COLOR_TOP    = #335533;
  2. final color START_COLOR_BOTTOM = #55AA55;
  3. final color END_COLOR_TOP      = #333355;
  4. final color END_COLOR_BOTTOM   = #5555AA;
  5. final int MAX_FRAME_NB  = 72;
  6. int colorCycleDirection = 1;
  7. int colorCycleCursor;
  8. void setup()
  9. {
  10.   size(1000, 700);
  11.   colorMode(HSB, 360, 100, 100);
  12.   smooth();
  13. //  noLoop();
  14.   background(150);
  15.   noFill();
  16. }
  17. void draw()
  18. {
  19.   DrawBackground();
  20. }
  21. color InterpolateColor(color startC, color endC)
  22. {
  23.   colorCycleCursor += colorCycleDirection;
  24.   if (colorCycleCursor >= MAX_FRAME_NB || colorCycleCursor < 0)
  25.   {
  26.     colorCycleDirection = -colorCycleDirection;
  27.     colorCycleCursor += colorCycleDirection;
  28.   }
  29.   return lerpColor(startC, endC, (float) colorCycleCursor / (float) MAX_FRAME_NB);
  30. }
Mmm, grayish, and no syntax highlight. The line numbers can be useful, though.
With a bit of customization?
Copy code
  1. void setup()
  2. {
  3.   size(1000, 700);
  4.   colorMode(HSB, 360, 100, 100);
  5.   smooth();
  6. //  noLoop();
  7.   background(150);
  8.   noFill();
  9. }
  10. void draw()
  11. {
  12.   DrawBackground();
  13. }
there is the CodeFormatter by Anthony Mattox
http://www.anthonymattox.com/code_formatter/index.html
hey PhiLho, what about this?
Copy code
  1.                 
      final color START_COLOR_TOP = #335533;
    final color START_COLOR_BOTTOM = #55AA55;
    final color END_COLOR_TOP = #333355;
    final color END_COLOR_BOTTOM = #5555AA;

    final int MAX_FRAME_NB = 72;

    int colorCycleDirection = 1;
    int colorCycleCursor;

    void [b]setup[/b]()
    {
       size(1000, 700);
       colorMode( HSB, 360, 100, 100);

       smooth();
    //  noLoop();    background(150);
       noFill();

    }

    void [b]draw[/b]()
    {
      DrawBackground();
    }

    color InterpolateColor( color startC, color endC)
    {
      colorCycleCursor += colorCycleDirection;
       if (colorCycleCursor >= MAX_FRAME_NB || colorCycleCursor < 0)
      {
        colorCycleDirection = -colorCycleDirection;
        colorCycleCursor += colorCycleDirection;
      }
       return lerpColor(startC, endC, ( float) colorCycleCursor / ( float) MAX_FRAME_NB);
    }


This is the Result of a CopyToHTML Sketch I once found. Not sure who the author is but its pretty useful.
You CopyForDiscourse first, and then simply run the sketch and get the code in your clipboard turned into html. Probably needs to be updated but thats the code of the copyToHtml Sketch.


Copy code
  1. import java.awt.datatransfer.*;
  2. void setup(){
  3.   String theClipboard = getClipboard();
  4.   if(theClipboard.startsWith("[quote]") == true){
  5.     String[] cfw = split(theClipboard, '\n');
  6.     formatForWeb(cfw);
  7.     theClipboard = join(cfw, '\n');
  8.     setClipboard(theClipboard);
  9.   }
  10.   else{
  11.     println("Copy for discourse first");
  12.   }
  13.   exit();
  14. }
  15. void formatForWeb(String[] s){
  16.   for(int i = 0; i < s.length; i++){
  17.     if( s[i].indexOf("[quote]") != -1){
  18.       s[i] = s[i].replaceAll("\\[quote\\]", "<pre><blockquote>");
  19.     }
  20.     if( s[i].indexOf("[/quote]") != -1){
  21.       s[i] = s[i].replaceAll("\\[/quote\\]", "</blockquote></pre>");
  22.     }
  23.     if( s[i].indexOf("[/color]") != -1){
  24.       s[i] = s[i].replaceAll("\\[/color\\]", "</span>");
  25.     }
  26.     if( s[i].indexOf("[color=#") != -1){
  27.       int start = s[i].indexOf("[color=#");
  28.       String colorString = "";
  29.       //the below could be replaced with a well written regular expression.
  30.       //yep, not enough brain power today.
  31.       while(start != -1){
  32.         colorString = s[i].substring(start+8, start+14);
  33.         s[i] = s[i].replaceAll(colorString + "\\]", colorString + ";\">");
  34.         start = s[i].indexOf("[color=#", start+1);
  35.       }
  36.       s[i] = s[i].replaceAll("\\[color=", "<span style=\"color: ");
  37.     }
  38.   }
  39. }
  40. String getClipboard() {
  41.   Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);
  42.   try {
  43.     if (t != null && t.isDataFlavorSupported(DataFlavor.stringFlavor)) {
  44.       String text = (String)t.getTransferData(DataFlavor.stringFlavor);
  45.       return text;
  46.     }
  47.   }
  48.   catch (UnsupportedFlavorException e) {
  49.   }
  50.   catch (IOException e) {
  51.   }
  52.   return null;
  53. }
  54. // This method writes a string to the system clipboard.
  55. // otherwise it returns null.
  56. void setClipboard(String str) {
  57.   StringSelection ss = new StringSelection(str);
  58.   Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
  59. }

Hey PhiLho what do think of this using jEdit "code to html plugin" (NB: need to be in edit html to insert text line numbering is optional...
42   public void render() {
43     noStroke();
44     fill(saucerColor);
45     // shpt shape point as PVector
46     PVector shpt = getPoint(R1, A1, saucerSize, theta);
47     curveTightness(-0.5F);
48     beginShape();
49     curveVertex(shpt.x, shpt.y);
50     shpt = getPoint(R2, PApplet.TWO_PI - A2, saucerSize, theta);
51     curveVertex(shpt.x, shpt.y);
52     shpt = getPoint(R2, PApplet.PI + A2, saucerSize, theta);
53     curveVertex(shpt.x, shpt.y);
54     shpt = getPoint(R1, PApplet.PI - A1, saucerSize, theta);
55     curveVertex(shpt.x, shpt.y);
56     shpt = getPoint(R2, PApplet.PI + A2, saucerSize, theta);
57     vertex(shpt.x, shpt.y);
58     shpt = getPoint(R3, PApplet.PI, saucerSize, theta);
59     vertex(shpt.x, shpt.y);
60     vertex(shpt.x, shpt.y);
61     shpt = getPoint(R1, PApplet.PI - A1, saucerSize, theta);
62     vertex(shpt.x, shpt.y);
63     vertex(shpt.x, shpt.y);
64     shpt = getPoint(R1, A1, saucerSize, theta);
65     vertex(shpt.x, shpt.y);
66     vertex(shpt.x, shpt.y);
67     shpt = getPoint(R3, A3, saucerSize, theta);
68     vertex(shpt.x, shpt.y);
69     vertex(shpt.x, shpt.y);
70     endShape(PApplet.CLOSE);
71   }
Highlighting is using my processing.xml mode which is based on the toxi original and available as a "contributed" download from jEdit.org I've yet to put in an introduction but previously I was martin_p on the old boards.