Tabnine Logo
PApplet.nfc
Code IndexAdd Tabnine to your IDE (free)

How to use
nfc
method
in
processing.core.PApplet

Best Java code snippets using processing.core.PApplet.nfc (Showing top 11 results out of 315)

origin: org.processing/core

/**
 * @param right number of digits to the right of the decimal point
*/
static public String[] nfc(float nums[], int right) {
 String formatted[] = new String[nums.length];
 for (int i = 0; i < formatted.length; i++) {
  formatted[i] = nfc(nums[i], right);
 }
 return formatted;
}
origin: ajavamind/Processing-Cardboard

static public String[] nfc(int num[]) {
  String formatted[] = new String[num.length];
  for (int i = 0; i < formatted.length; i++) {
    formatted[i] = nfc(num[i]);
  }
  return formatted;
}
origin: ajavamind/Processing-Cardboard

static public String[] nfc(float num[], int right) {
  String formatted[] = new String[num.length];
  for (int i = 0; i < formatted.length; i++) {
    formatted[i] = nfc(num[i], right);
  }
  return formatted;
}
origin: org.processing/core

/**
 * ( begin auto-generated from nfc.xml )
 *
 * Utility function for formatting numbers into strings and placing
 * appropriate commas to mark units of 1000. There are two versions, one
 * for formatting ints and one for formatting an array of ints. The value
 * for the <b>digits</b> parameter should always be a positive integer.
 * <br/><br/>
 * For a non-US locale, this will insert periods instead of commas, or
 * whatever is apprioriate for that region.
 *
 * ( end auto-generated )
 * @webref data:string_functions
 * @param nums the numbers to format
 * @see PApplet#nf(float, int, int)
 * @see PApplet#nfp(float, int, int)
 * @see PApplet#nfs(float, int, int)
 */
static public String[] nfc(int nums[]) {
 String formatted[] = new String[nums.length];
 for (int i = 0; i < formatted.length; i++) {
  formatted[i] = nfc(nums[i]);
 }
 return formatted;
}
origin: ajavamind/Processing-Cardboard

public void setRowCount(int newCount) {
 if (newCount != rowCount) {
  if (newCount > 1000000) {
   System.out.print("Note: setting maximum row count to " + PApplet.nfc(newCount));
  }
  long t = System.currentTimeMillis();
  for (int col = 0; col < columns.length; col++) {
   switch (columnTypes[col]) {
    case INT: columns[col] = PApplet.expand((int[]) columns[col], newCount); break;
    case LONG: columns[col] = PApplet.expand((long[]) columns[col], newCount); break;
    case FLOAT: columns[col] = PApplet.expand((float[]) columns[col], newCount); break;
    case DOUBLE: columns[col] = PApplet.expand((double[]) columns[col], newCount); break;
    case STRING: columns[col] = PApplet.expand((String[]) columns[col], newCount); break;
    case CATEGORY: columns[col] = PApplet.expand((int[]) columns[col], newCount); break;
   }
   if (newCount > 1000000) {
    try {
     Thread.sleep(10);  // gc time!
    } catch (InterruptedException e) {
     e.printStackTrace();
    }
   }
  }
  if (newCount > 1000000) {
   int ms = (int) (System.currentTimeMillis() - t);
   System.out.println(" (resize took " + PApplet.nfc(ms) + " ms)");
  }
 }
 rowCount = newCount;
}
origin: org.processing/core

public void setRowCount(int newCount) {
 if (newCount != rowCount) {
  if (newCount > 1000000) {
   System.out.print("Note: setting maximum row count to " + PApplet.nfc(newCount));
  }
  long t = System.currentTimeMillis();
  for (int col = 0; col < columns.length; col++) {
   switch (columnTypes[col]) {
    case INT: columns[col] = PApplet.expand((int[]) columns[col], newCount); break;
    case LONG: columns[col] = PApplet.expand((long[]) columns[col], newCount); break;
    case FLOAT: columns[col] = PApplet.expand((float[]) columns[col], newCount); break;
    case DOUBLE: columns[col] = PApplet.expand((double[]) columns[col], newCount); break;
    case STRING: columns[col] = PApplet.expand((String[]) columns[col], newCount); break;
    case CATEGORY: columns[col] = PApplet.expand((int[]) columns[col], newCount); break;
   }
   if (newCount > 1000000) {
    try {
     Thread.sleep(10);  // gc time!
    } catch (InterruptedException e) {
     e.printStackTrace();
    }
   }
  }
  if (newCount > 1000000) {
   int ms = (int) (System.currentTimeMillis() - t);
   System.out.println(" (resize took " + PApplet.nfc(ms) + " ms)");
  }
 }
 rowCount = newCount;
}
origin: mirador/mirador

if (logY) sel.setLabel("log(" + PApplet.nfc(perc, 2) + "%)");
else sel.setLabel(PApplet.nfc(perc, 2) + "%");            
origin: mirador/mirador

protected BoxplotSelection getPercentileSelection(float x0, float x1, 
                         float v0, float v1, float p, 
                         double valx, double valy,
                         int counts, boolean shift) {
 float y0 = 1 - v1;
 float dy =  v1 - v0;          
 float y1 = y0 + dy;
 if (x0 <= valx && valx <= x1 && y0 <= valy && valy <= y1) {
  BoxplotSelection sel = new BoxplotSelection(x0, y0, x1 - x0, dy);
  sel.setColor(mixColors(WHITE, COLOR, 0.5f));
  if (shift) {
   sel.setLabel(PApplet.round(p * counts) + "/" + counts);
  } else {
   sel.setLabel(PApplet.nfc(100 * p, 2) + "%");
  }
  return sel; 
 }
 
 return null;
}

origin: mirador/mirador

public Selection getSelection(double valx, double valy, boolean shift) {
 if (canDraw()) {
  float binw = 1.0f / binCount;          
  for (int bx = 0; bx < binCount; bx++) {        
   float p = density[bx];
   float h = PApplet.map(p, 0, maxProb, 0, 0.5f);
   float x0 = binw * bx;
   float x1 = binw * bx + binw;
   if (x0 < valx && valx < x1) {
    Selection sel = new Selection(x0, (1 - h), binw, h);
    if (shift) {
     sel.setLabel(PApplet.round(sampleSize * p) + "/" + sampleSize);
    } else {
     sel.setLabel(PApplet.nfc(100 * p, 2) + "%");  
    }
    
    return sel;
   }        
  }
 } else {
  return getUnavailableSelection();
 }
 return null;
}
origin: mirador/mirador

public Selection getSelection(double valx, double valy, boolean shift) {
 if (canDraw()) {
  float binw = 1.0f / binCountX;
  float binh = 1.0f / binCountY;
  for (int bx = 0; bx < binCountX; bx++) {
   for (int by = 0; by < binCountY; by++) {
    float x0 = binw * bx;
    float y0 = 1 - binh * by - binh;
    float x1 = x0 + binw; 
    float y1 = y0 + binh;
    if (x0 <= valx && valx <= x1 && y0 <= valy && valy <= y1) {
     Selection sel = new Selection(x0, y0, binw, binh);
     float p = density[bx][by];
     float np = PApplet.map(p, 0, maxProb, 0, 1);
     sel.setColor(mixColors(WHITE, COLOR, np));
     if (shift) {
      sel.setLabel(PApplet.round(sampleSize * p) + "/" + sampleSize);
     } else {
      sel.setLabel(PApplet.nfc(100 * p, 2) + "%");
     }
     return sel;
    }
   }
  }
 } else {
  return getUnavailableSelection();
 }
 return null;
}
origin: mirador/mirador

protected void drawSelection() {
 float x0 = rightm;
 float x1 = x0 + width - leftm - rightm;
 float y0 = topm - 10;
 float y1 = y0 + height - bottomm - topm;
 
 noStroke();
 fill(selBarColor);
 rect(x0, y1, x1 - x0, selW);
 float selx0 = PApplet.map(selRangeLeft, 0, 1, x0, x1);
 float selx1 = selRightHandle.x0; //PApplet.map(selRangeRight, 0, 1, x0, x1);
 fill(selBarColor);
 rect(selx0, y0, selx1 - selx0, y1 - y0);
 
 fill(color(0), 190);
 rect(selx0, y1, selx1 - selx0, selW);
 
 selRightHandle.draw();
 
 if (mira.project.sortMethod == Project.PVALUE) {
  textFont(pFont);
  fill(pColor);
  textAlign(CENTER);
  text("False Discovery Rate < " + PApplet.nfc(fdr, 2) + "%", selx1, y0 - fdrY);
  textAlign(LEFT);
 }
}

processing.corePAppletnfc

Popular methods of PApplet

  • constrain
  • createGraphics
    Create an offscreen graphics surface for drawing, in this case for a renderer that writes to a file
  • loadStrings
    ( begin auto-generated from loadStrings.xml ) Reads the contents of a file or url and creates a Stri
  • saveStrings
    ( begin auto-generated from saveStrings.xml ) Writes an array of strings to a file, one line per str
  • abs
  • createImage
    ( begin auto-generated from createImage.xml ) Creates a new PImage (the datatype for storing images)
  • createShape
  • createWriter
    ( begin auto-generated from createWriter.xml ) Creates a new file in the sketch folder, and a PrintW
  • loadImage
  • main
    main() method for running this class from the command line. Usage: PApplet [options] [s
  • max
  • parseInt
  • max,
  • parseInt,
  • random,
  • round,
  • split,
  • sqrt,
  • unhex,
  • arrayCopy,
  • ceil,
  • checkExtension

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • compareTo (BigDecimal)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • BoxLayout (javax.swing)
  • Join (org.hibernate.mapping)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now