fredt@users 20020305 - patch 460907 by fredt - soundex
183290
public static int difference(String s1, String s2) {

        /** @todo: check if this is the standard algorithm */
        if ((s1 == null) || (s2 == null)) {
            return 0;
        }

        s1 = soundex(s1);
        s2 = soundex(s2);

        int e = 0;

        for (int i = 0; i < 4; i++) {
            if (s1.charAt(i) != s2.charAt(i)) {
                e++;
            }
        }

        return e;
    }
364232
public function update_8009000() {
    $project_yml = $this->updater->getProjectYml();
    if (!empty($project_yml['behat']['launch-phantomjs']) && $project_yml['behat']['launch-phantomjs']) {
      $project_yml['behat']['web-driver'] = 'phantomjs';
    }
    else {
      $project_yml['behat']['web-driver'] = 'selenium';
    }
    unset($project_yml['behat']['launch-selenium']);
    unset($project_yml['behat']['launch-phantomjs']);

    if (!empty($project_yml['multisite.name'])) {
      $project_yml['multisites'][] = $project_yml['multisite.name'];
      unset ($project_yml['multisite.name']);
    }
    unset($project_yml['import']);

    if (file_exists($this->updater->getRepoRoot() . '/Vagrantfile')) {
      $project_yml['vm']['enable'] = TRUE;
    }

    $this->updater->writeProjectYml($project_yml);

    $messages = [
      "You have updated to a new major version of BLT, which introduces backwards-incompatible changes.",
      "You may need to perform the following manual update steps:",
      "  - View the full list of commands via `blt list`, <comment>BLT commands have changed</comment>",
      "  - Re-initialize default Travis CI configuration via `blt recipes:ci:travis:init`.
         - Re-initialize default Acquia Pipelines configuration via `blt recipes:ci:pipelines:init`.",
      "  - Port custom Phing commands to Robo. All Phing commands are now obsolete. See:",
      "    http://blt.readthedocs.io/en/9.x/readme/extending-blt/",
    ];
    if (file_exists($this->updater->getRepoRoot() . '/blt/composer.overrides.json')) {
      $messages[] = "  - <comment>blt/composer.overrides.json</comment> is no longer necessary.";
      $messages[] = "  -  Move your overrides to your root composer.json, and set extra.merge-plugin.ignore-duplicates to true.";
    }
    $formattedBlock = $this->updater->getFormatter()->formatBlock($messages, 'ice');
    $this->updater->getOutput()->writeln("");
    $this->updater->getOutput()->writeln($formattedBlock);
    $this->updater->getOutput()->writeln("");
  }
241330
public function update_8006004() {
    $composer_json = $this->updater->getComposerJson();
    $remove_packages = [
      'drupal/coder',
      'drupal-composer/drupal-security-advisories',
      'phing/phing',
      'phpunit/phpunit',
      'behat/mink-extension',
      'behat/mink-goutte-driver',
      'behat/mink-browserkit-driver',
    ];
    foreach ($remove_packages as $package) {
      unset($composer_json['require'][$package]);
      unset($composer_json['require-dev'][$package]);
    }
    $this->updater->writeComposerJson($composer_json);
  }
1036418
def getLeapSecondLastUpdated():  # @NoSelf
        
        print('Leap second last updated:', str(CDFepoch.LTS[-1][0]) + '-' +
              str(CDFepoch.LTS[-1][1]) + '-' + str(CDFepoch.LTS[-1][2]))
468979
void setMOD(MODSound sound) {
		if (!soundWorks) {
			return;
		}

		currentMusic = sources.get(0);
		stopSource(0);
		
		this.mod = sound;
		if (sound != null) {
			this.stream = null;
		}
		paused = false;
	}
1154344
function exec_command0(losk_version) {
    console.log(colors.cyan('Check update package...'));
    exec('npm outdated -json --long',
    (error, stdout, stderr) => {
        countpackege = 0;
        lengmass = 0;
        var massfordelete = new Array();
        massfordelete.fill(0);


        if (error !== null) {
            console.log(`exec error 1 : ${error}`);
        } else {
            if (stdout != "") {
                obj = JSON.parse(stdout);
                keys = Object.keys(obj);
                // [LATEST]
                //l------------------------------------------------------------------
                if (losk_version == 'latest') {
                    for (var i = 0 ; keys.length > i ; i++) {
                        //filter
                        //f----------------------------------------------------------
                        if (obj[keys[i]].latest > obj[keys[i]].current && obj[keys[i]].wanted <= obj[keys[i]].latest) {
                            countpackege = countpackege + 1;
                        }
                        if (obj[keys[i]].current == obj[keys[i]].latest && obj[keys[i]].wanted <= obj[keys[i]].latest) {
                            massfordelete[i] = keys[i];
                        }
                        if (obj[keys[i]].wanted > obj[keys[i]].latest) {
                            massfordelete[i] = keys[i];
                        }
                        //f----------------------------------------------------------

                        //start
                        //s----------------------------------------------------------
                        if (i == keys.length - 1 && countpackege != 0) {
                            for (var i2 = 0 ; massfordelete.length > i2 ; i2++) {
                                delete obj[massfordelete[i2]];
                            }
                            keys = Object.keys(obj);
                            exec_command1();
                        } else if (i == keys.length - 1 && countpackege == 0) {
                            for (var i3 = 0 ; massfordelete.length > i3 ; i3++) {
                                delete obj[massfordelete[i3]];
                            }
                            console.log(colors.cyan('Completed!'));
                        }
                        //s----------------------------------------------------------
                    }
                }
                //l------------------------------------------------------------------


                // [WANTED]
                //w------------------------------------------------------------------
                if (losk_version == 'wanted') {
                    if (obj[keys[i]].wanted > obj[keys[i]].current) {
                        xec_command1_wanted();
                        //....
                        //
                        // Will be updated
                        //
                        //....
                    }
                }
                //w------------------------------------------------------------------
            } else {
                console.log(colors.cyan('Completed!'));
            }
        }
    });
}
609138
function updateBinary (os = platform, arch = process.arch) {
  return new Promise((resolve, reject) => {
    if (platform === 'freebsd') return resolve(`
There are no static ffmpeg builds for FreeBSD currently available.
The module will try to use the system-wide installation.

Install it by running "pkg install ffmpeg" or via ports.
`)
    if (platform === 'openbsd') return resolve(`
There are no static ffmpeg builds for OpenBSD currently available.
The module will try to use the system-wide installation.

Install it by running "pkg_add ffmpeg" or via ports.
`) 
    const dir = `bin/${os}/${arch}`
    const bin = `${dir}/ffmpeg${os === 'win32' ? '.exe' : ''}`
    const dest = path.join(__dirname, bin)
    const fname = `${os}-${arch}.tar.bz2`
    const tmp = path.join(__dirname, 'bin', fname)
    try { fs.mkdirSync(path.join(__dirname, 'bin')) } catch(e) {}
    let bar

	// Cleanup directory
	fs.emptyDirSync('bin')

    // Get the latest version
    const req = request.get(`https://github.com/FocaBot/ffmpeg-downloader/raw/master/bin/${fname}`)
    req.on('error', e => reject(e)) // Handle errors
    .on('data', c => {
      bar = bar || new ProgressBar(`${fname} [:bar] :percent (ETA: :etas)`, {
        complete: '=',
        incomplete: ' ',
        width: 25,
        total: parseInt(req.response.headers['content-length'])
      })

      bar.tick(c.length)
    })
    .on('end', () => setTimeout(() => {
      bar.tick(bar.total - bar.curr)
      console.log('Decompressing...')
      decompress(tmp, path.join(__dirname, 'bin')).then(f => {
        fs.unlinkSync(tmp)
        // Try to get the version number
        // Skip this if not the same arch/os as what launched it
        if (os === platform && arch === process.arch) {
          execFile(dest, ['-version'], (error, stdout, stderr) => {
            if (error || stderr.length) return reject(error || stderr)
            resolve(stdout)
          })
        } else {
          resolve('Platform and arch are different than this system, cannot display ffmpeg version') 
        }
      })
    }, 1000))
    .pipe(fs.createWriteStream(tmp, { mode: 0o755 }))
  })
}
31625
function() {
        elemData.sound = soundEditor.find('.kelmu-sound-url').val();
        window.kelmu.data[id].actions.update();
        updateView(true, true);
        notifyModifications();
      }
836880
def _update_uncompressed(collection_name, upsert, multi, spec,
                         doc, safe, last_error_args, check_keys, opts):
    """"""
    op_update, max_bson_size = _update(
        collection_name, upsert, multi, spec, doc, check_keys, opts)
    rid, msg = __pack_message(2001, op_update)
    if safe:
        rid, gle, _ = __last_error(collection_name, last_error_args)
        return rid, msg + gle, max_bson_size
    return rid, msg, max_bson_size
374086
public static function echoDirtyTransactionCleanupCommands($handle = STDERR): void
    {
        if (0 === count(self::$pathsCreated)) {
            return;
        }
        $sinceTimeSeconds = ceil(microtime(true) - self::$startTime);
        // why, because of xdebug break - you could easily spend over 1 minute stepping through
        $sinceTimeMinutes = ceil($sinceTimeSeconds / 60);
        $pathsToSearch    = [];
        foreach (self::$pathsCreated as $path) {
            $realPath = realpath($path);
            if ($realPath) {
                $pathsToSearch[$realPath] = $realPath;
            }
        }
        if (0 === count($pathsToSearch)) {
            return;
        }
        $findCommand   = 'find ' . implode(' ', $pathsToSearch) . "  -mmin -$sinceTimeMinutes";
        $line          = str_repeat('-', 15);
        $deleteCommand = "$findCommand -exec rm -rf";
        fwrite(
            $handle,
            "\n$line\n"
            . "\n\nUnclean File Creation Transaction:"
            . "\n\nTo find created files:\n$findCommand"
            . "\n\nTo remove created files:\n$deleteCommand"
            . "\n\n$line\n\n"
        );
    }
342387
private void deliverBeatGridUpdate(int player, BeatGrid beatGrid) {
        if (!getBeatGridListeners().isEmpty()) {
            final BeatGridUpdate update = new BeatGridUpdate(player, beatGrid);
            for (final BeatGridListener listener : getBeatGridListeners()) {
                try {
                    listener.beatGridChanged(update);

                } catch (Throwable t) {
                    logger.warn("Problem delivering beat grid update to listener", t);
                }
            }
        }
    }
929338
def _patch_tf(tf):
  """"""
  global TF_PATCH
  if TF_PATCH:
    return

  v_1_12 = distutils.version.LooseVersion("1.12.0")
  v_1_13 = distutils.version.LooseVersion("1.13.0")
  v_2 = distutils.version.LooseVersion("2.0.0")
  tf_version = distutils.version.LooseVersion(tf.__version__)
  if v_1_12 <= tf_version < v_1_13:
    # TODO(b/123930850): remove when 1.13 is stable.
    TF_PATCH = "tf1_12"
    _patch_for_tf1_12(tf)
  elif v_1_13 <= tf_version < v_2:
    TF_PATCH = "tf1_13"
    _patch_for_tf1_13(tf)
  else:
    TF_PATCH = "tf2"
    _patch_for_tf2(tf)
1054478
def update_sandbox_site(comment_text):
    """"""

    file_to_deliver = NamedTemporaryFile(delete=False)

    file_text = "Deployed at: {} <br /> Comment: {}".format(datetime.datetime.now().strftime('%c'), cgi.escape(comment_text))

    file_to_deliver.write(file_text)
    file_to_deliver.close()

    put(file_to_deliver.name, '/var/www/html/index.html', use_sudo=True)
832243
def update(self, quiet=False, prefix='[polyglot_data] '):
    
    self.clear_status_cache()
    for pkg in self.packages():
      if self.status(pkg) == self.STALE:
        self.download(pkg, quiet=quiet, prefix=prefix)
698187
function updateSampleConfig() {
  console.info('Updating plugin package.json...');

  const argVersion = process.argv[2]; // -v
  const argVersionNumber = process.argv[3]; // eg 1.5.6

  let pluginPackageFile = './package.json';
  let samplePackageFile = './sample/package.json';
  fs.readFile(pluginPackageFile, 'utf8', (err, data) => {
    let obj = JSON.parse(data);

    let versions = new Array();

    versions = obj.version.split('.');

    PLUGIN_NAME = obj.name || PLUGIN_NAME;
    PLUGIN_VERSION = obj.version || PLUGIN_VERSION;

    if (versions && (versions.length > 0)) {
      if (argVersion != undefined && argVersionNumber == undefined) {
        versions[versions.length - 1] = safeIncreaseVersion(versions[versions.length - 1]);
      }
      if (argVersionNumber != undefined) {
        versions = argVersionNumber.split('.');
      }
      console.info(`Version changing ${obj.version} => ${versions.join('.')}`);
      obj.version = versions.join('.');
      PLUGIN_VERSION = versions.join('.');
    }

    const dev = obj.dependencies;
    let sampleDep = {};
    let sample = {};

    fs.readFile(samplePackageFile, 'utf8', (err, res) => {

      sample = JSON.parse(res);
      sampleDep = sample.dependencies;

      sample.dependencies = dev;
      sample.version = PLUGIN_VERSION;
      sample.name = PLUGIN_SAMPLE_NAME;

      obj = JSON.stringify(obj, null, 4);
      let smplObj = JSON.stringify(sample, null, 4);

      fs.writeFile(pluginPackageFile, obj, function (e) { });
      fs.writeFile(samplePackageFile, smplObj, function (e) { });

      console.log('Plugin package.json updated.');

    });


  });
}
1363758
@Override
    public void switchPlayerToSpectator(ApiBaseUser user) {
        try {
            room.switchPlayerToSpectator(CommandUtil.getSfsUser(user, api));
        } catch (SFSRoomException e) {
            throw new IllegalStateException(e);
        }
    }
876127
private void deliverWaveformDetailUpdate(final int player, final WaveformDetail detail) {
        if (!getWaveformListeners().isEmpty()) {
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    final WaveformDetailUpdate update = new WaveformDetailUpdate(player, detail);
                    for (final WaveformListener listener : getWaveformListeners()) {
                        try {
                            listener.detailChanged(update);

                        } catch (Throwable t) {
                            logger.warn("Problem delivering waveform detail update to listener", t);
                        }
                    }
                }
            });
        }
    }