释放mainStem的节点，重新选择工作节点
422924
public void release(Long pipelineId) {
        MainstemMonitor mainstemMonitor = ArbitrateFactory.getInstance(pipelineId, MainstemMonitor.class);
        mainstemMonitor.releaseMainstem();
    }
137801
def update(self):
        """"""
        # Init new stats
        stats = self.get_init_value()

        if self.input_method == 'local':
            for k, v in iteritems(self.glances_amps.update()):
                stats.append({'key': k,
                              'name': v.NAME,
                              'result': v.result(),
                              'refresh': v.refresh(),
                              'timer': v.time_until_refresh(),
                              'count': v.count(),
                              'countmin': v.count_min(),
                              'countmax': v.count_max()})
        else:
            # Not available in SNMP mode
            pass

        # Update the stats
        self.stats = stats

        return self.stats
171719
public static void main(String[] args) throws Exception {

		
		CWSTagger cws = new CWSTagger("../models/seg.m");
		tag = new POSTagger(cws,"../models/pos.m");
		
		System.out.println("得到支持的词性标签集合");
		System.out.println(tag.getSupportedTags());
		System.out.println(tag.getSupportedTags().size());
		System.out.println("\n");
		
		String str = "媒体计算研究所成立了，高级数据挖掘很难。乐phone很好！";
		String s = tag.tag(str);
		System.out.println("处理未分词的句子");
		System.out.println(s);
		
		System.out.println("使用英文标签");
		tag.SetTagType("en");		
		System.out.println(tag.getSupportedTags());
		System.out.println(tag.getSupportedTags().size());
		s = tag.tag(str);
		System.out.println(s);		
		System.out.println();
		
		CWSTagger cws2 = new CWSTagger("../models/seg.m", new Dictionary("../models/dict.txt"));
		
		//bool值指定该dict是否用于cws分词（分词和词性可以使用不同的词典）
		tag = new POSTagger(cws2, "../models/pos.m"
				, new Dictionary("../models/dict.txt"), true);//true就替换了之前的dict.txt
		tag.removeDictionary(false);//不移除分词的词典
		tag.setDictionary(new Dictionary("../models/dict.txt"), false);//设置POS词典，分词使用原来设置
		
		String str2 = "媒体计算研究所成立了，高级数据挖掘很难。乐phone很好！";
		String s2 = tag.tag(str2);
		System.out.println("处理未分词的句子，使用词典");
		System.out.println(s2);
		System.out.println();
		
		Dictionary dict = new Dictionary();
		dict.add("媒体计算","mypos1","mypos2");
		dict.add("乐phone","专有名");
		tag.setDictionary(dict, true);
		String s22 = tag.tag(str2);
		System.out.println(s22);
		System.out.println();
		
		POSTagger tag1 = new POSTagger("../models/pos.m");
		String str1 = "媒体计算 研究所 成立 了 , 高级 数据挖掘 很 难";
		String[] w = str1.split(" ");
		String[] s1 = tag1.tagSeged(w);
		System.out.println("直接处理分好词的句子:++++++++++");
		for(int i=0;i<s1.length;i++){
			System.out.print(w[i]+"/"+s1[i]+" ");
		}
		System.out.println("\n");
		
		POSTagger tag3 = new POSTagger("../models/pos.m", new Dictionary("../models/dict.txt"));
		String str3 = "媒体计算 研究所 成立 了 , 高级 数据挖掘 很 难 ";
		String[] w3 = str3.split(" ");
		String[] s3 = tag3.tagSeged(w3);
		System.out.println("直接处理分好词的句子，使用词典");
		for(int i=0;i<s3.length;i++){
			System.out.print(w3[i]+"/"+s3[i]+" ");
		}
		System.out.println("\n");
		
		//????????????????????????????
		
		System.out.println("重新构造");
		cws = new CWSTagger("../models/seg.m");
		tag = new POSTagger(cws,"../models/pos.m");
		str = "媒体计算研究所成立了, 高级数据挖掘很难";
		System.out.println(tag.tag(str));
		String[][] sa = tag.tag2Array(str);
		for(int i = 0; i < sa.length; i++) {
			for(int j = 0; j < sa[i].length; j++) {
					System.out.print(sa[i][j] + " ");
			}
			System.out.println();
		}
		
		String s4 = tag.tagFile("../example-data/data-tag.txt");
		System.out.println("\n处理文件：");
		System.out.println(s4);
	}
324736
public function commit()
    {
        if ($this->_active && $this->_db->getActive()) {
            $this->_db->getPdoInstance()->commit();
            $this->_active = false;
        } else {
            throw new Exception('"Transaction"尚属未激活状态，不能执行"commit"和"rollback"操作', 101300601);
        }
    }
1178468
function next() {
		var module;

		if (pool.queue.length <= 0) {
			if (pool.install.length) {
				error('Update needed: ' + pool.install.map(function(module) {
					return module.name;
				}).join(', '));
			}
			else {
				wanted.emit('ready', pool.processed.map(shallow));
			}

			return reset();
		}

		module = pool.queue.shift();

		fileExists(module.path + '/package.json', function(file) {
			var json;

			if (file) {
				json = require(file);
				module.installed = json.version;
				module.upgrade   = !semver.satisfies(json.version, module.version);
			}

			if (!module.installed || module.upgrade) {
				request(module);
			}
			else {
				module.current = true;
				wanted.emit('current', shallow(module));

				processed(module);
			}
		});
	}
1121956
public function start() {
        #设置DEBUG引导程序
        (new This7Debug())->bootstrap();
        #设置配置文件
        This7Config::defineConst();
        #获取驱动列表
        $this->drives = $this->getDeviceList(VENDOR_DIR . DS . 'this7');
        #自动加载类
        spl_autoload_register(array($this, 'autoload'));
        #设置静态化
        staticize::setApplication($this);
        #绑定核心驱动
        $this->bindDrives();
        #启动路由
        routes::start();
    }
16623
void update() {
        Application.update(filter, list, main, footer, toggleAll, count, clearCompleted);
    }
361921
public static void main(String[] args) {

    try {
      MnistDAO.init("/usr/local/Datasets"); // setup data
    System.out.println("here");
      MnistImageDisplayApp mnistImageDisplayApp = new MnistImageDisplayApp();
      mnistImageDisplayApp.go(args);
    } catch (Exception e) {
      // eat it.
    } finally {
      MnistDAO.release(); // release data resources
    }

  }
441000
public static function resetUniqids()
    {
        $posix_getpid = posix_getpid();
        unset(self::$uniqids[$posix_getpid]);
        unset(self::$i[$posix_getpid]);
        //重新设置数据库的值
        PdoConfig::unsetAllinstance();
    }
779558
public void train() throws Exception {

		loadData();
		/**
		 * 
		 * 更新参数的准则
		 */
		Update update;
		// viterbi解码
		Inferencer inference;

		HammingLoss loss = new HammingLoss();
		if (standard) {
			inference = new LinearViterbi(templets, labels.size());
			update = new LinearViterbiPAUpdate((LinearViterbi) inference, loss);
		} else {
			inference = new HigherOrderViterbi(templets, labels.size());
			update = new HigherOrderViterbiPAUpdate(templets, labels.size(), true);
		}

		OnlineTrainer trainer;

		if(cl!=null){
			trainer = new OnlineTrainer(cl, update, loss, factory,iterNum, c);
		}else{
			trainer = new OnlineTrainer(inference, update, loss,
					factory, iterNum, c);
		}

		cl = trainer.train(trainSet, testSet);

		if(cl!=null&&newmodel!=null)
			saveTo(newmodel);
		else
			saveTo(model);

	}
1062451
private void startup() throws InterruptedException {
        try {
            arbitrateEventService.mainStemEvent().await(pipelineId);
        } catch (Throwable e) {
            if (isInterrupt(e)) {
                logger.info("INFO ## this node is interrupt", e);
            } else {
                logger.warn("WARN ## this node is crashed.", e);
            }
            arbitrateEventService.mainStemEvent().release(pipelineId);
            return;
        }

        executor = Executors.newFixedThreadPool(2); // 启动两个线程
        // 启动selector
        otterSelector = otterSelectorFactory.getSelector(pipelineId); // 获取对应的selector
        otterSelector.start();

        canStartSelector.set(false);// 初始化为false
        startProcessTermin();
        startProcessSelect();

        isStart = true;
    }
1154049
private void monitor() {

		List<File> files  = MyFiles.getAllFiles(fileName,"templete.txt");

		try {
			for(int i=0;i<files.size();i++){

				Long newTime = files.get(i).lastModified();
				Long lastTime = lastModTime.get(files.get(i).toString());
				if(lastTime ==null || !lastTime.equals(newTime)){
					System.out.println("文件改变，重新读入模板");
					loadAll();
					break;
				}

			}

		} catch (Exception e) {
			e.printStackTrace();
		}

	}
406415
public function boot()
    {
        if ($this->app->runningInConsole()) {
            // 讀取套件 migrations
            $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
        }

        $this->publishes([
            __DIR__ . '/../database/migrations/2018_06_28_000000_create_translates_table.php' => database_path('migrations/2018_06_28_000000_create_translates_table.php'),
        ], 'laravel-eloquent-i18n');

    }
32116
def update(self):
        """"""
        # Init new stats
        stats = self.get_init_value()

        if self.input_method == 'local':
            # Update stats using the standard system lib
            stats = self.glancesgrabhddtemp.get()

        else:
            # Update stats using SNMP
            # Not available for the moment
            pass

        # Update the stats
        self.stats = stats

        return self.stats
925997
function updateBoot() {
		var fc;
		//在本次版本目录下创建_boot.js文件
		fc = all_files['boot.js'];
		if (!fc) {
			err_log.push('MOKJS-405: 文件 boot.js 不存在！');
			return;
		}
		fc = fc.replace('//<VERSIONS/>', 'vers="1:'+
			versions['mok'][1]+version_fc+'".split(",");')
			.replace('//<MAINFILES/>', 'var mainFiles={'+main_file_dl.join(',')+'};');
		fc = UglifyJS.minify(fc, {fromString:true});
		sfs.write(path_min+'_boot.js', fc.code);

		//在项目根目录创建更新的version.info文件
		sfs.write(prj_path+'version-'+CURRENT_VER+'.info',
			'LAST_VER:'+CURRENT_VER+'\r\nLAST_FILE:'+last_file+
			'\r\n-'+all_depended.join('\r\n-')+'\r\n');
	}
877503
public function main()
    {
        $gitignoreFiles     = $this->gitignoreFiles;
        $gitignoreMerged    = array();
        $gitignoreFileArray = array();

        if (!empty($gitignoreFiles) && is_array($gitignoreFiles)) {
            foreach ($gitignoreFiles as $gitignoreFile) {
                if (is_file($gitignoreFile)) {
                    $gitignoreFileArray = array_merge(
                        $gitignoreFileArray,
                        file(
                            $gitignoreFile,
                            (FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)
                        )
                    );
                }
            }
        }

        foreach ($gitignoreFileArray as $gitignoreLine) {
            if (strpos($gitignoreLine, '#') === 0) {
                $section = $gitignoreLine;
                if (!isset($gitignoreMerged[$section])) {
                    $gitignoreMerged[$section] = array();
                }
            } else {
                $gitignoreMerged[$section][] = $gitignoreLine;
            }
        }

        asort($gitignoreMerged);
        foreach ($gitignoreMerged as &$merged) {
            $merged = array_unique($merged);
            sort($merged);
        }

    }
286541
private void addRootNode(TrieNode rootNode){
        //计算节点的存储索引
        int index = rootNode.getCharacter()%INDEX_LENGTH;
        //检查索引是否和其他节点冲突
        TrieNode existTrieNode = ROOT_NODES_INDEX[index];
        if(existTrieNode != null){
            //有冲突，将冲突节点附加到当前节点之后
            rootNode.setSibling(existTrieNode);
        }
        //新增的节点总是在最前
        ROOT_NODES_INDEX[index] = rootNode;
    }