Start some new particles from the emitters. We roll the dice
        starts_at_once times, seeing if we can start each particle based
        on starts_prob. If we start, the particle gets a color form
        the palette and a velocity from the vel list.
10758
def start_new_particles(self):
        
        for e_pos, e_dir, e_vel, e_range, e_color, e_pal in self.emitters:
            for roll in range(self.starts_at_once):
                if random.random() < self.starts_prob:  # Start one?
                    p_vel = self.vel[random.choice(len(self.vel))]
                    if e_dir < 0 or e_dir == 0 and random.random() > 0.5:
                        p_vel = -p_vel
                    self.particles.append((
                        p_vel,  # Velocity
                        e_pos,  # Position
                        int(e_range // abs(p_vel)),  # steps to live
                        e_pal[
                            random.choice(len(e_pal))],  # Color
                        255))
595102
def start(self):
        
        self.thread = threading.Thread(target=self._animate)
        self.thread.start()
        return
1066292
public void init(ParticleEmitter emitter, float life) {
		x = 0;
		this.emitter = emitter;
		y = 0;
		velx = 0;
		vely = 0;
		size = 10;
		type = 0;
		this.originalLife = this.life = life;
		oriented = false;
		scaleY = 1.0f;
	}
840080
function _drawParticles() {
            // Previous paths...
            let prev = ctx.globalCompositeOperation;
            ctx.globalCompositeOperation = 'destination-in';
            ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
            //ctx.globalCompositeOperation = 'source-over';
            ctx.globalCompositeOperation = prev;

            // fading paths...
            ctx.fillStyle = `rgba(0, 0, 0, ${self.options.fade})`;
            ctx.lineWidth = self.options.width;
            ctx.strokeStyle = self.options.color;

            // New paths
            paths.forEach(function(par) {
                self._drawParticle(viewInfo, ctx, par);
            });
        }
34518
def run_sketch(self):
        
        Sketch.instance = self
        self.init()
        frame = self.create_frame()
        if frame:
            frame.add(self)
            frame.pack()
            frame.visible = 1
1291320
def step(self, amt=1):
        ""
        self.move_particles()
        if self.has_moving_emitters:
            self.move_emitters()
        self.start_new_particles()
        self.render_particles()
        if self.emitters == [] and self.particles == []:
            self.completed = True
944666
public void startLWJGL() {
      if (gameThread != null) {
         return;
      }
      
      gameThread = new Thread() {
         public void run() {
            try {
               canvas.start();
            }
            catch (Exception e) {
               e.printStackTrace();
               if (Display.isCreated()) {
                  Display.destroy();
               }
               displayParent.setVisible(false);//removeAll();
               add(new ConsolePanel(e));
               validate();
            }
         }
      };
      
      gameThread.start();
   }
191275
private static synchronized void start() throws IOException {
        if (s_tracer == null) {
            final VoltTrace tracer = new VoltTrace();
            final Thread thread = new Thread(tracer);
            thread.setDaemon(true);
            thread.start();
            s_tracer = tracer;
        }
    }
635771
private boolean doStart()
  {
    if (! _lifecycle.isActive()) {
      return false;
    }
    
    if (! isEnable()) {
      return false;
    }
    
    int startingCount = _startingCount.get();

    int threadCount = _threadCount.get() + startingCount;

    if (_threadMax < threadCount) {
      onThreadMax();
      
      return false;
    }
    else if (! isIdleTooLow(startingCount)) {
      return false;
    }
    
    _idleCount.incrementAndGet();

    startConnection();
      
    return true;
  }
881586
function _start()
{
  // first argument – runner function
  var runner = arguments[0]
    // take away first argument
    , args   = Array.prototype.slice.call(arguments, 1)
      // second argument - input data
    , input  = args[0]
      // last argument - result callback
    , endCb  = streamify.callback.call(this, args[args.length - 1])
    ;

  args[args.length - 1] = endCb;
  // third argument - iterator
  args[1] = streamify.iterator.call(this, args[1]);

  // allow time for proper setup
  defer(function()
  {
    if (!this.destroyed)
    {
      this.terminator = runner.apply(null, args);
    }
    else
    {
      endCb(null, Array.isArray(input) ? [] : {});
    }
  }.bind(this));
}
1077906
def _create_emitter(self, event):
        """"""
        if not hasattr(self, event):
            setattr(self, event,
                    lambda *args, **kwargs: self.emit(event, *args, **kwargs))
89877
def start(self):
        
        try:
            self._depth_align = False
            if self._registration_mode == RealSenseRegistrationMode.DEPTH_TO_COLOR:
                self._depth_align = True

            self._config_pipe()
            self._profile = self._pipe.start(self._cfg)

            # store intrinsics and depth scale
            self._set_depth_scale()
            self._set_intrinsics()

            # skip few frames to give auto-exposure a chance to settle
            for _ in range(5):
                self._pipe.wait_for_frames()

            self._running = True
        except RuntimeError as e:
            print(e)
396537
def start(self, exit=True):
        '''
        '''
        if self.state == ACTOR_STATES.INITIAL:
            self._concurrency.before_start(self)
            self._concurrency.add_events(self)
            try:
                self.cfg.when_ready(self)
            except Exception:   # pragma    nocover
                self.logger.exception('Unhandled exception in when_ready hook')
            self._started = self._loop.time()
            self._exit = exit
            self.state = ACTOR_STATES.STARTING
            self._run()
213295
def start( self ):
        
        if ( self.localThreadingEnabled() and self.globalThreadingEnabled() ):
            super(XThread, self).start()
        else:
            self.run()
            self.finished.emit()
273208
function start(name) {
  var orb = spheros[name],
      contacts = 0,
      age = 0,
      alive = false;

  orb.detectCollisions();

  born();

  orb.on("collision", function() { contacts += 1; });

  setInterval(function() { if (alive) { move(); } }, 3000);
  setInterval(birthday, 10000);

  // roll Sphero in a random direction
  function move() {
    orb.roll(60, Math.floor(Math.random() * 360));
  }

  // stop Sphero
  function stop() {
    orb.stop();
  }

  // set Sphero's color
  function color(str) {
    orb.color(str);
  }

  function born() {
    contacts = 0;
    age = 0;
    life();
    move();
  }

  function life() {
    alive = true;
    color("green");
  }

  function death() {
    alive = false;
    color("red");
    stop();
  }

  function enoughContacts() {
    return contacts >= 2 && contacts < 7;
  }

  function birthday() {
    age += 1;

    if (alive) {
      console.log("Happy birthday,", name);
      console.log("You are", age, "and had", contacts, "contacts.");
    }

    if (enoughContacts()) {
      if (!alive) { born(); }
    } else {
      death();
    }
  }
}
1196226
void initIRGB(int[] pTemp) {
        final int x = (1 << TRUNCBITS);        // 8 the size of 1 Dimension of each quantized cell
        final int xsqr = 1 << (TRUNCBITS * 2); // 64 - twice the smallest step size vale of quantized colors
        final int xsqr2 = xsqr + xsqr;

        for (int i = 0; i < numColors; ++i) {
            if (i == transparentIndex) {
                // Skip the transparent pixel
                continue;
            }

            int red, r, rdist, rinc, rxx;
            int green, g, gdist, ginc, gxx;
            int blue, b, bdist, binc, bxx;

            // HaraldK 20040801: Added support for int[]
            if (rgbMapByte != null) {
                red = rgbMapByte[i * 4] & 0xFF;
                green = rgbMapByte[i * 4 + 1] & 0xFF;
                blue = rgbMapByte[i * 4 + 2] & 0xFF;
            }
            else if (rgbMapInt != null) {
                red = (rgbMapInt[i] >> 16) & 0xFF;
                green = (rgbMapInt[i] >> 8) & 0xFF;
                blue = rgbMapInt[i] & 0xFF;
            }
            else {
                throw new IllegalStateException("colormap == null");
            }

            rdist = red - x / 2;   // distance of red to center of current cell
            gdist = green - x / 2; // green
            bdist = blue - x / 2;  // blue
            rdist = rdist * rdist + gdist * gdist + bdist * bdist;

            rinc = 2 * (xsqr - (red << TRUNCBITS));
            ginc = 2 * (xsqr - (green << TRUNCBITS));
            binc = 2 * (xsqr - (blue << TRUNCBITS));

            int rgbI = 0;
            for (r = 0, rxx = rinc; r < MAXQUANTVAL; rdist += rxx, ++r, rxx += xsqr2) {
                for (g = 0, gdist = rdist, gxx = ginc; g < MAXQUANTVAL; gdist += gxx, ++g, gxx += xsqr2) {
                    for (b = 0, bdist = gdist, bxx = binc; b < MAXQUANTVAL; bdist += bxx, ++b, ++rgbI, bxx += xsqr2) {
                        if (i == 0 || pTemp[rgbI] > bdist) {
                            pTemp[rgbI] = bdist;
                            inverseRGB[rgbI] = (byte) i;
                        }
                    }
                }
            }
        }
    }
115201
def _start_new_episode(self):
        

        # flush any data left over from the previous episode if any interactions have happened
        if self.has_interaction:
            self._flush()

        # timesteps in current episode
        self.t = 0
        self.has_interaction = False