text
stringlengths
1
1.05M
StartTest(function(t) { var rect1 = new Siesta.Util.Rect({ left : 10, top : 10, width : 1, height : 1 }) var rect2 = new Siesta.Util.Rect({ left : 100, top : 100, right : 109, bottom : 109 }) var rect3 = new Siesta.Util.Rect({ left : 105, top : 105, right : 107, bottom : 118 }) t.it("Should calculate missing properties", function (t) { t.is(rect1.right, 10) t.is(rect1.bottom, 10) t.is(rect2.width, 10) t.is(rect2.height, 10) }) t.it("`Contains` should work", function (t) { t.ok(rect1.contains(10, 10), "Rect contains own px") t.notok(rect1.contains(11, 10), "Rect does not contain different px") t.ok(rect2.contains(105, 108)) t.notOk(rect2.contains(110, 108)) }) t.it("`intersect` should work", function (t) { var result1 = rect1.intersect(rect2) var result2 = rect2.intersect(rect1) t.isaOk(result1, Siesta.Util.Rect, "Result of interesection is a new rectangle instance") t.isaOk(result2, Siesta.Util.Rect, "Result of interesection is a new rectangle instance") t.ok(result1.isEmpty(), "And its empty") t.ok(result2.isEmpty(), "And its empty") var result3 = rect2.intersect(rect3) var result4 = rect3.intersect(rect2) t.ok(result3.equalsTo(result4), "Both intersections have produced same results") t.is(result3.left, 105) t.is(result3.right, 107) t.is(result3.top, 105) t.is(result3.bottom, 109) }) t.it("`cropLeftRight` should work", function (t) { var result1 = rect2.cropLeftRight(rect3) t.isaOk(result1, Siesta.Util.Rect, "Result of `cropLeftRight` is a new rectangle instance") t.is(result1.left, 105) t.is(result1.right, 107) t.is(result1.top, 100) t.is(result1.bottom, 109) }) t.it("`cropTopBottom` should work", function (t) { var result1 = rect2.cropTopBottom(rect3) t.isaOk(result1, Siesta.Util.Rect, "Result of `cropTopBottom` is a new rectangle instance") t.is(result1.left, 100) t.is(result1.right, 109) t.is(result1.top, 105) t.is(result1.bottom, 109) }) })
$('#btnUpdate').click(function () { update_tranfer_collection_segregate($(this).val(),getSegregationFormVal(), function(result) { if (result.id == 1) { Toast.fire({ type: 'success', title: 'Successfull' }); }else { Toast.fire({ type: 'error', title: 'Something Went Wrong!' }); } $('#btnShowUpdate').addClass('d-none'); $('#btnshowDelete').addClass('d-none'); $('#btnSave').removeClass('d-none'); transferCollectionSegregation_Table($('#fromDate').val(),$('#toDate').val()); }); }); function update_tranfer_collection_segregate(id,data,callBack) { $.ajax({ type: "PUT", headers: { "Authorization": "Bearer " + $('meta[name=api-token]').attr("content"), "Accept": "application/json" }, url: "api/transfer_segregate/id/" + id, data: data, dataType: "json", cache: false, processDaate: false, success: function (result) { if (typeof callBack !== 'undefined' && callBack != null && typeof callBack === "function") { callBack(result); } }, error: function (xhr, textStatus, errorThrown) { alert(textStatus + ':' + errorThrown); } }); }
<reponame>triszt4n/blog<filename>src/types/work.props.ts import { ImageDataLike } from 'gatsby-plugin-image' export interface WorkProps { title: string lead?: string date: Date url: string featuredImage: ImageDataLike status: { label: string color: string } techs: Array<string> }
echo "********* Set up demo enrichment table **************" echo "*****************************************************" echo '{"1.2.3.4":{"hostname":"test-name"}}' > hostname.json curl -F "uploaded_file=@hostname.json;" https://enrichment.local/upload.php curl -X 'POST' https://rest.siembol.local/api/v1/enrichment/enrichment/tables -H 'accept: application/json' -H 'Content-Type: application/json' -d '{\"name\": \"hostname\",\"path\": \"/download.php?filename=dns.json\"}' echo "************************************************************" echo "Check uploaded table through this url in the browser:" echo "https://enrichment.local/download.php?filename=hostname.json" echo "************************************************************" echo "Check siembol table info through this url in the browser:" echo "https://rest.siembol.local/api/v1/enrichment/enrichment/tables" echo "************************************************************"
<reponame>madebr/3d-pinball-space-cadet // // Created by neo on 2019-08-15. // #include "../../pinball.h" #ifndef PINBALL_TLINE_H #define PINBALL_TLINE_H /* 122 */ struct TLine; TLine* __thiscall TLine::TLine(TLine* this, struct TCollisionComponent* a2, char* a3, unsigned int a4, float a5, float a6, float a7, float a8); double __thiscall TLine::FindCollisionDistance(TLine* this, struct ray_type* a2); TLine* __thiscall TLine::TLine(TLine* this, struct TCollisionComponent* a2, char* a3, unsigned int a4, struct vector_type* a5, struct vector_type* a6); void __thiscall TLine::EdgeCollision(TLine* this, struct TBall*, float); // idb void __thiscall TLine::Offset(TLine* this, float); // idb void __thiscall TLine::place_in_grid(TLine* this); // idb void* TLine::vftable = &TLine::EdgeCollision; // weak #endif //PINBALL_TLINE_H
import fs from 'fs' import path from 'path' import express from 'express' const router = express.Router() const indexJs = path.basename(__filename) // NOTE: users.route.js + get('/') => localhost:3000/users/ fs.readdirSync(__dirname) .filter(file => (file.indexOf('.') !== 0) && (file !== indexJs) && (file.slice(-9) === '.route.js')) .forEach(routeFile => router.use(`/${routeFile.split('.')[0]}`, require(`./${routeFile}`).default)) export default router
import java.util.Random; public class Average { public static void main(String[] args) { int[] array = new int[10]; Random rand = new Random(); int total = 0; for (int i = 0; i < array.length; i++) { // Generate random numbers array[i] = rand.nextInt(); // Calculate sum total += array[i]; } // Get the average int average = total / array.length; System.out.println("The average value is: " + average); } }
import { Injectable } from '@angular/core'; import { ASWorkbook } from '../../model/asworkbook'; import { KeyPair } from '../../model/keypair'; import { ColumnComparisonService } from './columncomparison.service'; @Injectable({ providedIn: 'root' }) export class CopyStoreService { currentWorkbooks: Array<ASWorkbook> = []; copyToHeader = ''; copyFromHeader = ''; diffHeaderOne = ''; diffHeaderTwo = ''; rowMap = {}; diffMap = {}; diffOpen = false; keyPair: KeyPair; // I'd like to move this to // the workbook components // but it'll leave here for a bit editCount = 0; columnPreviews = {}; constructor(public compService: ColumnComparisonService) { } checkIfRowMap() { return typeof this.rowMap !== 'undefined' && Object.keys(this.rowMap).length > 0; } isSelected(filename: string, header: string) { return this.keyPair.createKey(filename, header) === this.copyToHeader || this.keyPair.createKey(filename, header) === this.copyFromHeader; } isDiffSelected(filename: string, header: string) { return this.keyPair.createKey(filename, header) === this.diffHeaderOne || this.keyPair.createKey(filename, header) === this.diffHeaderTwo; } openPreview(filename: string, header: string) { console.log(this.currentWorkbooks[0]); this.columnPreviews[filename] = header; } addCopyHeader(filename: string, header: string) { if (!this.keyPair.doBothKeysExist()) { return; } if (this.keyPair.getWhichKeyFileIn(filename) === 1) { if (this.copyToHeader === this.keyPair.createKey(filename, header)) { this.copyToHeader = ''; return; } this.copyToHeader = this.keyPair.createKey(filename, header); } else if (this.keyPair.getWhichKeyFileIn(filename) === 2) { if (this.copyFromHeader === this.keyPair.createKey(filename, header)) { this.copyFromHeader = ''; return; } this.copyFromHeader = this.keyPair.createKey(filename, header); } } // DIFF addDiffHeader(filename: string, header: string) { if (!this.keyPair.doBothKeysExist()) { return; } if (this.keyPair.getWhichKeyFileIn(filename) === 1) { if (this.diffHeaderOne === this.keyPair.createKey(filename, header)) { this.diffHeaderOne = ''; this.diffMap = {}; return; } this.diffHeaderOne = this.keyPair.createKey(filename, header); this.calculateDiffIfFull(); } else if (this.keyPair.getWhichKeyFileIn(filename) === 2) { if (this.diffHeaderTwo === this.keyPair.createKey(filename, header)) { this.diffHeaderTwo = ''; this.diffMap = {}; return; } this.diffHeaderTwo = this.keyPair.createKey(filename, header); this.calculateDiffIfFull(); } } areBothDiffsSelected() { return this.diffHeaderOne !== '' && this.diffHeaderTwo !== ''; } calculateDiffIfFull() { if (this.areBothDiffsSelected()) { this.openPreview(this.diffHeaderOne.split(':')[0], this.diffHeaderOne.split(':')[1]); this.calcDiff(); } } // This is really just a wrapper function copyColumns() { this.compService.mode = 'copy'; this.compService.copyColumns(this.keyPair, this.currentWorkbooks, this.copyToHeader, this.copyFromHeader, this.rowMap); this.editCount += 1; this.copyToHeader = ''; this.copyFromHeader = ''; this.compService.mode = ''; } calcDiff() { this.compService.mode = 'diff'; this.compService.copyColumns(this.keyPair, this.currentWorkbooks, this.diffHeaderOne, this.diffHeaderTwo, this.diffMap); this.compService.mode = ''; } clearRowMap() { this.rowMap = {}; this.copyToHeader = ''; this.copyFromHeader = ''; this.editCount = 0; } clearInfo() { this.copyToHeader = ''; this.copyFromHeader = ''; this.diffHeaderOne = ''; this.diffHeaderTwo = ''; this.rowMap = {}; this.diffMap = {}; this.editCount = 0; this.keyPair.deleteKeys(); } closeFile(filename: string) { const index = this.currentWorkbooks.findIndex(x => x.filename === filename); if (index !== -1) { this.currentWorkbooks.splice(index, 1); } this.clearInfo(); } getWorkbookByFileName(filename: string) { const wb = this.currentWorkbooks.filter( workbook => { return workbook.filename === filename; }); return wb[0]; } }
<reponame>wujingchao/jmtp /* * Copyright 2007 <NAME> * * This file is part of JMTP. * * JTMP is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of * the License, or any later version. * * JMTP is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU LesserGeneral Public * License along with JMTP. If not, see <http://www.gnu.org/licenses/>. */ package be.derycke.pieter.com; /** * * @author <NAME> */ public class COM { //CLSCTX public static final long CLSCTX_INPROC_SERVER = 0x1; public static final long CLSCTX_INPROC_HANDLER = 0x2; /* * Algemene COM methoden */ public static native COMReference CoCreateInstance(CLSID rclsid, long pUnkOuter, long dwClsContext, IID riid) throws COMException; }
<reponame>wilbur147/Ruoyi-VUE-Plus package com.ruoyi.content.controller; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.SetFilePath; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.content.bo.ConCategroyAddBo; import com.ruoyi.content.bo.ConCategroyEditBo; import com.ruoyi.content.bo.ConCategroyQueryBo; import com.ruoyi.content.service.IConCategroyService; import com.ruoyi.content.vo.ConCategroyVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import java.util.Arrays; import java.util.List; /** * 分类Controller * * @author ruoyi * @date 2021-05-12 */ @Api(value = "分类控制器", tags = {"分类管理"}) @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController @RequestMapping("/content/categroy") public class ConCategroyController extends BaseController { private final IConCategroyService iConCategroyService; /** * 查询分类列表 */ @ApiOperation("查询分类列表") @PreAuthorize("@ss.hasPermi('content:categroy:list')") @GetMapping("/list") public AjaxResult<List<ConCategroyVo>> list(ConCategroyQueryBo bo) { return AjaxResult.success(iConCategroyService.queryList(bo)); } /** * 导出分类列表 */ @ApiOperation("导出分类列表") @PreAuthorize("@ss.hasPermi('content:categroy:export')") @Log(title = "分类", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult<ConCategroyVo> export(ConCategroyQueryBo bo) { List<ConCategroyVo> list = iConCategroyService.queryList(bo); ExcelUtil<ConCategroyVo> util = new ExcelUtil<ConCategroyVo>(ConCategroyVo.class); return util.exportExcel(list, "分类"); } /** * 获取分类详细信息 */ @ApiOperation("获取分类详细信息") @PreAuthorize("@ss.hasPermi('content:categroy:query')") @SetFilePath(name = {"icon"}) @GetMapping("/{conCategroyId}") public AjaxResult<ConCategroyVo> getInfo(@PathVariable("conCategroyId" ) Long conCategroyId) { return AjaxResult.success(iConCategroyService.queryById(conCategroyId)); } /** * 新增分类 */ @ApiOperation("新增分类") @PreAuthorize("@ss.hasPermi('content:categroy:add')") @Log(title = "分类", businessType = BusinessType.INSERT) @PostMapping() public AjaxResult<Void> add(@RequestBody ConCategroyAddBo bo) { return toAjax(iConCategroyService.insertByAddBo(bo) ? 1 : 0); } /** * 修改分类 */ @ApiOperation("修改分类") @PreAuthorize("@ss.hasPermi('content:categroy:edit')") @Log(title = "分类", businessType = BusinessType.UPDATE) @PutMapping() public AjaxResult<Void> edit(@RequestBody ConCategroyEditBo bo) { return toAjax(iConCategroyService.updateByEditBo(bo) ? 1 : 0); } /** * 删除分类 */ @ApiOperation("删除分类") @PreAuthorize("@ss.hasPermi('content:categroy:remove')") @Log(title = "分类" , businessType = BusinessType.DELETE) @DeleteMapping("/{conCategroyIds}") public AjaxResult<Void> remove(@PathVariable Long[] conCategroyIds) { return toAjax(iConCategroyService.deleteWithValidByIds(Arrays.asList(conCategroyIds), true) ? 1 : 0); } }
import tensorflow as tf class BaseFeature(object): def __init__(self, name, dim=1, dtype=tf.float32, **kwargs): self._name = name self._dim = dim self._dtype = dtype @property def name(self): return self._name @property def dim(self): return self._dim @property def dtype(self): return self._dtype def __str__(self): return "BaseFeature name: {0}, dim: {1}, dtype: {2}".format(self._name, self._dim, self._dtype) class DenseFeature(BaseFeature): def __init__(self, name, dim=1, dtype=tf.float32, func=None, **kwargs): self._func = func super(DenseFeature, self).__init__(name, dim, dtype, **kwargs) @property def func(self): return self._func def __str__(self): return "DenseFeature name: {0}, dim: {1}, dtype: {2}".format(self.name, self.dim, self.dtype) class SparseFeature(BaseFeature): def __init__(self, name, dim=1, dtype=tf.float32, vocab_size=None, hash_size=None, emb_size=None, **kwargs): self._hash_size = hash_size self._vocab_size = vocab_size self._emb_size = emb_size super(SparseFeature, self).__init__(name, dim, dtype, **kwargs) @property def hash_size(self): return self._hash_size @property def vocab_size(self): return self._vocab_size @property def emb_size(self): return self._emb_size def __str__(self): return "SparseFeature name: {0}, dim: {1}, dtype: {2}, " \ "hash_size: {3}, vocab_size : {4}, emb_size: {5}".format(self.name, self.dim, self.dtype, self.hash_size, self.vocab_size, self.emb_size)
<filename>gulimall-ware/src/main/java/com/atguigu/gulimall/ware/dao/PurchaseDetailDao.java package com.atguigu.gulimall.ware.dao; import com.atguigu.gulimall.ware.entity.PurchaseDetailEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** * * * @author awesomeChick * @email <EMAIL> * @date 2021-12-04 21:55:18 */ @Mapper public interface PurchaseDetailDao extends BaseMapper<PurchaseDetailEntity> { }
<reponame>yafraorg/yafra-database<filename>yafradb/dbe_generate_mysql.sql use yafra; SET FOREIGN_KEY_CHECKS=0 ; DROP TABLE IF EXISTS yafra.YafraUserRole CASCADE ; SET FOREIGN_KEY_CHECKS=1 ; SET FOREIGN_KEY_CHECKS=0 ; DROP TABLE IF EXISTS yafra.YafraRole CASCADE ; SET FOREIGN_KEY_CHECKS=1 ; SET FOREIGN_KEY_CHECKS=0 ; DROP TABLE IF EXISTS yafra.PersonLog CASCADE ; SET FOREIGN_KEY_CHECKS=1 ; SET FOREIGN_KEY_CHECKS=0 ; DROP TABLE IF EXISTS yafra.YafraAudit CASCADE ; SET FOREIGN_KEY_CHECKS=1 ; SET FOREIGN_KEY_CHECKS=0 ; DROP TABLE IF EXISTS yafra.YafraBusinessRole CASCADE ; SET FOREIGN_KEY_CHECKS=1 ; SET FOREIGN_KEY_CHECKS=0 ; DROP TABLE IF EXISTS yafra.Person CASCADE ; SET FOREIGN_KEY_CHECKS=1 ; SET FOREIGN_KEY_CHECKS=0 ; DROP TABLE IF EXISTS yafra.YafraUserDevice CASCADE ; SET FOREIGN_KEY_CHECKS=1 ; SET FOREIGN_KEY_CHECKS=0 ; DROP TABLE IF EXISTS yafra.YafraUser CASCADE ; SET FOREIGN_KEY_CHECKS=1 ; CREATE TABLE yafra.YafraUser (email VARCHAR(200) NULL, name VARCHAR(1000) NOT NULL, phone VARCHAR(200) NULL, picturelink VARCHAR(4000) NULL, pkYafraUser INT NOT NULL, userid VARCHAR(500) NOT NULL, PRIMARY KEY (pkYafraUser)) ENGINE=InnoDB ; CREATE TABLE yafra.YafraUserDevice (YUser INT NOT NULL, deviceAuthDate DATE NULL, deviceAuthToken VARCHAR(500) NULL, deviceId VARCHAR(300) NOT NULL, deviceOs VARCHAR(100) NULL, devicePushToken VARCHAR(500) NULL, deviceRegistrationDate DATE NULL, pkYafraUserDevice INT NOT NULL, PRIMARY KEY (pkYafraUserDevice), KEY (YUser)) ENGINE=InnoDB ; CREATE TABLE yafra.Person (address VARCHAR(4000) NULL, country VARCHAR(1000) NULL, email VARCHAR(200) NULL, firstname VARCHAR(1000) NOT NULL, googleId VARCHAR(4000) NULL, id INT NOT NULL, name VARCHAR(1000) NOT NULL, pkPerson INT NOT NULL, type VARCHAR(100) NOT NULL, PRIMARY KEY (pkPerson)) ENGINE=InnoDB ; CREATE TABLE yafra.YafraBusinessRole (description VARCHAR(4000) NULL, flag BOOL NULL, name VARCHAR(1000) NOT NULL, pkYafraBusinessRole INT NOT NULL, PRIMARY KEY (pkYafraBusinessRole)) ENGINE=InnoDB ; CREATE TABLE yafra.YafraAudit (auditobject VARCHAR(1000) NULL, audittext VARCHAR(4000) NOT NULL, fkUser INT NOT NULL, pkAudit INT NOT NULL, timestamp DATE NOT NULL, PRIMARY KEY (pkAudit), KEY (fkUser)) ENGINE=InnoDB ; CREATE TABLE yafra.PersonLog (eventAudit VARCHAR(4000) NULL, eventAuditReviewer VARCHAR(1000) NULL, eventCreator VARCHAR(1000) NOT NULL, eventDate DATE NOT NULL, eventDescription VARCHAR(4000) NOT NULL, fkPersonId INT NOT NULL, pkPersonLog INT NOT NULL, PRIMARY KEY (pkPersonLog), KEY (fkPersonId)) ENGINE=InnoDB ; CREATE TABLE yafra.YafraRole (description VARCHAR(4000) NULL, fkBusinessRole INT NOT NULL, name VARCHAR(1000) NOT NULL, pkYafraRole INT NOT NULL, rights VARCHAR(1000) NULL, PRIMARY KEY (pkYafraRole), KEY (fkBusinessRole)) ENGINE=InnoDB ; CREATE TABLE yafra.YafraUserRole (YRole INT NOT NULL, YUser INT NOT NULL, pkYafraUserRole INT NOT NULL, PRIMARY KEY (pkYafraUserRole), KEY (YRole), KEY (YUser)) ENGINE=InnoDB ; ALTER TABLE yafra.YafraUserDevice ADD FOREIGN KEY (YUser) REFERENCES yafra.YafraUser (pkYafraUser) ; ALTER TABLE yafra.YafraAudit ADD FOREIGN KEY (fkUser) REFERENCES yafra.YafraUser (pkYafraUser) ; ALTER TABLE yafra.PersonLog ADD FOREIGN KEY (fkPersonId) REFERENCES yafra.Person (pkPerson) ; ALTER TABLE yafra.YafraRole ADD FOREIGN KEY (fkBusinessRole) REFERENCES yafra.YafraBusinessRole (pkYafraBusinessRole) ; ALTER TABLE yafra.YafraUserRole ADD FOREIGN KEY (YRole) REFERENCES yafra.YafraBusinessRole (pkYafraBusinessRole) ; ALTER TABLE yafra.YafraUserRole ADD FOREIGN KEY (YUser) REFERENCES yafra.YafraUser (pkYafraUser) ; DROP TABLE IF EXISTS AUTO_PK_SUPPORT ; CREATE TABLE AUTO_PK_SUPPORT ( TABLE_NAME CHAR(100) NOT NULL, NEXT_ID BIGINT NOT NULL, UNIQUE (TABLE_NAME)) ; DELETE FROM AUTO_PK_SUPPORT WHERE TABLE_NAME IN ('Person', 'PersonLog', 'YafraAudit', 'YafraBusinessRole', 'YafraRole', 'YafraUser', 'YafraUserDevice', 'YafraUserRole') ; INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('Person', 200) ; INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('PersonLog', 200) ; INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('YafraAudit', 200) ; INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('YafraBusinessRole', 200) ; INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('YafraRole', 200) ; INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('YafraUser', 200) ; INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('YafraUserDevice', 200) ; INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('YafraUserRole', 200) ;
#!/bin/bash # Archived program command-line for experiment # Copyright 2017 Xiang Zhang # # Usage: bash {this_file} [additional_options] set -x; set -e; LOCATION=models/rakutenbinary/wordunigramroman_tuned; TRAIN_DATA=data/rakuten/sentiment/binary_train_hepburn_wordtoken_shuffle.txt; TEST_DATA=data/rakuten/sentiment/binary_test_hepburn_wordtoken_shuffle.txt; fasttext supervised -input $TRAIN_DATA -output $LOCATION/model -dim 10 -lr 0.1 -wordNgrams 1 -minCount 1 -bucket 10000000 -epoch 10 -thread 10; fasttext test $LOCATION/model.bin $TRAIN_DATA; fasttext test $LOCATION/model.bin $TEST_DATA;
#!/bin/bash cp /config/params.js /timetrack NODE_ENV=production DEBUG=timetrack:* node dist/server/main.js
<gh_stars>0 #include "Etterna/Globals/global.h" #include "Etterna/Actor/Base/ActorUtil.h" #include "Etterna/Singletons/GameSoundManager.h" #include "Etterna/Models/Misc/InputEventPlus.h" #include "Etterna/Models/Misc/ScreenDimensions.h" #include "Etterna/Singletons/ScreenManager.h" #include "ScreenPrompt.h" #include "Etterna/Singletons/ThemeManager.h" PromptAnswer ScreenPrompt::s_LastAnswer = ANSWER_YES; bool ScreenPrompt::s_bCancelledLast = false; #define ANSWER_TEXT(s) THEME->GetString(m_sName, s) static const char* PromptAnswerNames[] = { "Yes", "No", "Cancel", }; XToString(PromptAnswer); // Settings: namespace { RString g_sText; PromptType g_PromptType; PromptAnswer g_defaultAnswer; void (*g_pOnYes)(void*); void (*g_pOnNo)(void*); void* g_pCallbackData; }; void ScreenPrompt::SetPromptSettings(const RString& sText, PromptType type, PromptAnswer defaultAnswer, void (*OnYes)(void*), void (*OnNo)(void*), void* pCallbackData) { g_sText = sText; g_PromptType = type; g_defaultAnswer = defaultAnswer; g_pOnYes = OnYes; g_pOnNo = OnNo; g_pCallbackData = pCallbackData; } void ScreenPrompt::Prompt(ScreenMessage smSendOnPop, const RString& sText, PromptType type, PromptAnswer defaultAnswer, void (*OnYes)(void*), void (*OnNo)(void*), void* pCallbackData) { SetPromptSettings(sText, type, defaultAnswer, OnYes, OnNo, pCallbackData); SCREENMAN->AddNewScreenToTop("ScreenPrompt", smSendOnPop); } REGISTER_SCREEN_CLASS(ScreenPrompt); void ScreenPrompt::Init() { ScreenWithMenuElements::Init(); m_textQuestion.LoadFromFont(THEME->GetPathF(m_sName, "question")); m_textQuestion.SetName("Question"); LOAD_ALL_COMMANDS(m_textQuestion); this->AddChild(&m_textQuestion); m_sprCursor.Load(THEME->GetPathG(m_sName, "cursor")); m_sprCursor->SetName("Cursor"); LOAD_ALL_COMMANDS(m_sprCursor); this->AddChild(m_sprCursor); for (int i = 0; i < NUM_PromptAnswer; i++) { m_textAnswer[i].LoadFromFont(THEME->GetPathF(m_sName, "answer")); // The name of the actor isn't set because it is not known at this point // how many answers there will be, and the name depends on the number of // answers as a clumsy way of letting the themer set different positions // for different answer groups. The name is set in BeginScreen, and // then the commands are loaded. -Kyz (At least, that seems like the // explanation to me, reading the code years after the author left) this->AddChild(&m_textAnswer[i]); } m_sndChange.Load(THEME->GetPathS(m_sName, "change"), true); } void ScreenPrompt::BeginScreen() { ScreenWithMenuElements::BeginScreen(); m_Answer = g_defaultAnswer; ENUM_CLAMP(m_Answer, PromptAnswer(0), PromptAnswer(g_PromptType)); m_textQuestion.SetText(g_sText); SET_XY(m_textQuestion); m_textQuestion.PlayCommand("On"); m_sprCursor->PlayCommand("On"); for (int i = 0; i <= g_PromptType; i++) { RString sElem = ssprintf("Answer%dOf%d", i + 1, g_PromptType + 1); m_textAnswer[i].SetName(sElem); LOAD_ALL_COMMANDS(m_textAnswer[i]); // Side note: Because LOAD_ALL_COMMANDS occurs here, InitCommand will // not be run for the actors. People can just use OnCommand instead. RString sAnswer = PromptAnswerToString((PromptAnswer)i); // FRAGILE if (g_PromptType == PROMPT_OK) sAnswer = "OK"; m_textAnswer[i].SetText(ANSWER_TEXT(sAnswer)); m_textAnswer[i].PlayCommand("On"); SET_XY(m_textAnswer[i]); } for (int i = g_PromptType + 1; i < NUM_PromptAnswer; i++) m_textAnswer[i].SetText(""); PositionCursor(); } bool ScreenPrompt::Input(const InputEventPlus& input) { if (IsTransitioning()) return false; if (input.type == IET_RELEASE) return false; if (input.DeviceI.device == DEVICE_KEYBOARD) { switch (input.DeviceI.button) { case KEY_LEFT: return this->MenuLeft(input); case KEY_RIGHT: return this->MenuRight(input); default: break; } } return ScreenWithMenuElements::Input(input); } bool ScreenPrompt::CanGoRight() { switch (g_PromptType) { case PROMPT_OK: return false; case PROMPT_YES_NO: return m_Answer < ANSWER_NO; case PROMPT_YES_NO_CANCEL: return m_Answer < ANSWER_CANCEL; default: FAIL_M(ssprintf("Invalid PromptType: %i", g_PromptType)); } } void ScreenPrompt::Change(int dir) { m_textAnswer[m_Answer].StopEffect(); m_Answer = static_cast<PromptAnswer>(m_Answer + dir); ASSERT(m_Answer >= 0 && m_Answer < NUM_PromptAnswer); PositionCursor(); m_sndChange.Play(true); } bool ScreenPrompt::MenuLeft(const InputEventPlus& input) { if (CanGoLeft()) { Change(-1); return true; } return false; } bool ScreenPrompt::MenuRight(const InputEventPlus& input) { if (CanGoRight()) { Change(+1); return true; } return false; } bool ScreenPrompt::MenuStart(const InputEventPlus& input) { if (m_Out.IsTransitioning() || m_Cancel.IsTransitioning()) return false; End(false); return true; } bool ScreenPrompt::MenuBack(const InputEventPlus& input) { if (m_Out.IsTransitioning() || m_Cancel.IsTransitioning()) return false; switch (g_PromptType) { case PROMPT_OK: case PROMPT_YES_NO: // don't allow cancel break; case PROMPT_YES_NO_CANCEL: End(true); return true; } return false; } void ScreenPrompt::End(bool bCancelled) { switch (m_Answer) { case ANSWER_YES: m_smSendOnPop = SM_Success; break; case ANSWER_NO: m_smSendOnPop = SM_Failure; break; default: break; } if (bCancelled) { Cancel(SM_GoToNextScreen); } else { SCREENMAN->PlayStartSound(); StartTransitioningScreen(SM_GoToNextScreen); } switch (m_Answer) { case ANSWER_YES: if (g_pOnYes != nullptr) g_pOnYes(g_pCallbackData); break; case ANSWER_NO: if (g_pOnNo != nullptr) g_pOnNo(g_pCallbackData); break; default: break; } s_LastAnswer = bCancelled ? ANSWER_CANCEL : m_Answer; s_bCancelledLast = bCancelled; } void ScreenPrompt::PositionCursor() { BitmapText& bt = m_textAnswer[m_Answer]; m_sprCursor->SetXY(bt.GetX(), bt.GetY()); } void ScreenPrompt::TweenOffScreen() { m_textQuestion.PlayCommand("Off"); m_sprCursor->PlayCommand("Off"); for (int i = 0; i <= g_PromptType; i++) m_textAnswer[i].PlayCommand("Off"); ScreenWithMenuElements::TweenOffScreen(); }
<reponame>landenlabs/all-uitest package com.landenlabs.all_uiTest; /* * Copyright (C) 2019 <NAME> (<EMAIL>) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import android.annotation.SuppressLint; import android.graphics.Rect; import android.graphics.drawable.Animatable2; import android.graphics.drawable.AnimatedVectorDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TableLayout; import androidx.annotation.NonNull; /** * Fragment demonstrates animating a path around the container cells. * * Sample animated heart pulse. * https://github.com/IhorKlimov/Android-Animations/blob/master/app/src/main/res/drawable/heart_rate.xml * * Online tool to adjust AVD * https://shapeshifter.design/ * * https://github.com/harjot-oberai/VectorMaster */ @SuppressWarnings("FieldCanBeLocal") public class FragAnimBorderDemo extends FragBottomNavBase implements View.OnTouchListener { private TableLayout tableLayout; private ImageView avecIV; private static final int LAYOUT_ID = R.layout.frag_anim_border; // --------------------------------------------------------------------------------------------- @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, LAYOUT_ID); setBarTitle("Animate Border"); initUI(); return root; } @SuppressLint("ClickableViewAccessibility") private void initUI() { tableLayout = root.findViewById(R.id.page6_tableLayout); avecIV = root.findViewById(R.id.page6_avec_image); if (avecIV.getDrawable() instanceof AnimatedVectorDrawable) { final AnimatedVectorDrawable avec = (AnimatedVectorDrawable)avecIV.getDrawable(); avec.start(); avec.registerAnimationCallback(new Animatable2.AnimationCallback() { @Override public void onAnimationEnd(Drawable drawable) { super.onAnimationEnd(drawable); avec.start(); } }); } tableLayout.setOnTouchListener(this); } @SuppressLint("ClickableViewAccessibility") @SuppressWarnings("SwitchStatementWithTooFewBranches") @Override public boolean onTouch(View view, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { View viewTouched; int globalXpx = (int)event.getX(); int globalYpx = (int)event.getY(); Rect rect = new Rect(); view.getGlobalVisibleRect(rect); globalXpx += rect.left; globalYpx += rect.top; switch (view.getId()) { case R.id.page6_tableLayout: viewTouched = findViewAtPosition(tableLayout, globalXpx, globalYpx); if (viewTouched != null) { doAction(viewTouched, tableLayout); return true; } break; } } return false; } /** * Find child view hit by touch position. * Set row and column in tags. */ private View findViewAtPosition(View parent, int globalXpx, int globalYpx) { if (parent instanceof ViewGroup) { ViewGroup viewGroup = (ViewGroup)parent; for (int i=0; i < viewGroup.getChildCount(); i++) { View child = viewGroup.getChildAt(i); View viewAtPosition = findViewAtPosition(child, globalXpx, globalYpx); if (viewAtPosition != null) { // Assume Table structure, view inside row container. if (viewAtPosition.getTag(R.id.tag_col) == null) { viewAtPosition.setTag(R.id.tag_col, i); // Set column first in inner container } else if (viewAtPosition.getTag(R.id.tag_row) == null) { viewAtPosition.setTag(R.id.tag_row, i); // Set row in 2nd outer container. } return viewAtPosition; } } return null; } else { Rect rect = new Rect(); parent.getGlobalVisibleRect(rect); if (rect.contains(globalXpx, globalYpx)) { return parent; } else { return null; } } } /** * Execute action on touched view. */ @SuppressWarnings("unused") private void doAction(View view, ViewGroup parent) { } }
(() => { let counter = 0; let numbered; let source = document.getElementsByClassName( 'prettyprint source' ); if ( source && source[ 0 ] ) { source = source[ 0 ].getElementsByTagName( 'code' )[ 0 ]; numbered = source.innerHTML.split( '\n' ); numbered = numbered.map( item => { counter++; return `<span id="line${counter}" class="line"></span>${item}`; } ); source.innerHTML = numbered.join( '\n' ); } })();
using FluentAssertions; using NUnit.Framework; public class Configuration { public string Name { get; set; } public int Value { get; set; } public SubConfiguration SubConfig { get; set; } } public class SubConfiguration { public string SubName { get; set; } public int SubValue { get; set; } } public class Result { public string Name { get; set; } public int Value { get; set; } public SubResult SubRes { get; set; } } public class SubResult { public string SubName { get; set; } public int SubValue { get; set; } } [TestFixture] public class ConfigurationTests { [Test] public void Configuration_Should_Be_Equivalent_To_Result() { // Arrange var configuration = new Configuration { Name = "Test", Value = 10, SubConfig = new SubConfiguration { SubName = "SubTest", SubValue = 5 } }; var result = new Result { Name = "Test", Value = 10, SubRes = new SubResult { SubName = "SubTest", SubValue = 5 } }; // Act // Assert result.Should().BeEquivalentTo(configuration, options => { options .ExcludingMissingMembers() // Exclude missing members from comparison .ExcludingNestedObjects(); // Exclude nested objects from comparison }); } }
#!/bin/bash ## Push to local location ## Variables SCRIPTDIRA=$(dirname $0) source "$SCRIPTDIRA"/foldervars.var WHATITIS="Localhost Web Directory" CHECKME=$LOCALHOSTDIR timestamp=$(echo `date`) if [[ -z $CHECKME ]] then echo "* $WHATITIS Not Set. Please Fix. $timestamp" | tee --append $RECENTRUN &>/dev/null echo "Local Host Web Directory Not Set." exit fi if ls $CHECKME &> /dev/null; then echo "* $WHATITIS Already there no need to mkdir. $timestamp" | tee --append $RECENTRUN &>/dev/null else echo "* $WHATITIS Not There. Please Fix. $timestamp" | tee --append $RECENTRUN &>/dev/null exit fi WHATITIS="Locally Hosted Biglist" CHECKME=$CLOCALHOST timestamp=$(echo `date`) if ls $CHECKME &> /dev/null; then rm $CHECKME echo "* $WHATITIS Removed. $timestamp" | tee --append $RECENTRUN &>/dev/null else echo "* $WHATITIS Not Removed. $timestamp" | tee --append $RECENTRUN &>/dev/null fi ## Copy it over CHECKME=$CLOCALHOST if ls $CHECKME &> /dev/null; then cp -p $COMBINEDBLACKLISTS $CLOCALHOST else echo "* $WHATITIS Not Created. $timestamp" | tee --append $RECENTRUN &>/dev/null fi WHATITIS="Locally Hosted Biglist (Edited)" CHECKME=$DBBLOCALHOST timestamp=$(echo `date`) if ls $CHECKME &> /dev/null; then rm $CHECKME echo "* $WHATITIS Removed. $timestamp" | tee --append $RECENTRUN &>/dev/null else echo "* $WHATITIS Not Removed. $timestamp" | tee --append $RECENTRUN &>/dev/null fi ## Copy it over CHECKME=$DBBLOCALHOST if ls $CHECKME &> /dev/null; then cp -p $COMBINEDBLACKLISTSDBB $DBBLOCALHOST else echo "* $WHATITIS Not Created. $timestamp" | tee --append $RECENTRUN &>/dev/null fi
// // NSString+Hash.h // // Created by Annabelle on 16/6/10. // Copyright © 2016年 annabelle. All rights reserved. // #import <Foundation/Foundation.h> @interface NSString (Hash) #pragma mark - 散列函数 /** * 计算MD5散列结果 * * 终端测试命令: * @code * md5 -s "string" * @endcode * * <p>提示:随着 MD5 碰撞生成器的出现,MD5 算法不应被用于任何软件完整性检查或代码签名的用途。<p> * * @return 32个字符的MD5散列字符串 */ - (NSString *)yj_md5String; /** * 计算SHA1散列结果 * * 终端测试命令: * @code * echo -n "string" | openssl sha -sha1 * @endcode * * @return 40个字符的SHA1散列字符串 */ - (NSString *)yj_sha1String; /** * 计算SHA224散列结果 * * 终端测试命令: * @code * echo -n "string" | openssl sha -sha224 * @endcode * * @return 56个字符的SHA224散列字符串 */ - (NSString *)yj_sha224String; /** * 计算SHA256散列结果 * * 终端测试命令: * @code * echo -n "string" | openssl sha -sha256 * @endcode * * @return 64个字符的SHA256散列字符串 */ - (NSString *)yj_sha256String; /** * 计算SHA 384散列结果 * * 终端测试命令: * @code * echo -n "string" | openssl sha -sha384 * @endcode * * @return 96个字符的SHA 384散列字符串 */ - (NSString *)yj_sha384String; /** * 计算SHA 512散列结果 * * 终端测试命令: * @code * echo -n "string" | openssl sha -sha512 * @endcode * * @return 128个字符的SHA 512散列字符串 */ - (NSString *)yj_sha512String; #pragma mark - HMAC 散列函数 /** * 计算HMAC MD5散列结果 * * 终端测试命令: * @code * echo -n "string" | openssl dgst -md5 -hmac "key" * @endcode * * @return 32个字符的HMAC MD5散列字符串 */ - (NSString *)yj_hmacMD5StringWithKey:(NSString *)key; /** * 计算HMAC SHA1散列结果 * * 终端测试命令: * @code * echo -n "string" | openssl sha -sha1 -hmac "key" * @endcode * * @return 40个字符的HMAC SHA1散列字符串 */ - (NSString *)yj_hmacSHA1StringWithKey:(NSString *)key; /** * 计算HMAC SHA256散列结果 * * 终端测试命令: * @code * echo -n "string" | openssl sha -sha256 -hmac "key" * @endcode * * @return 64个字符的HMAC SHA256散列字符串 */ - (NSString *)yj_hmacSHA256StringWithKey:(NSString *)key; /** * 计算HMAC SHA512散列结果 * * 终端测试命令: * @code * echo -n "string" | openssl sha -sha512 -hmac "key" * @endcode * * @return 128个字符的HMAC SHA512散列字符串 */ - (NSString *)yj_hmacSHA512StringWithKey:(NSString *)key; #pragma mark - 文件散列函数 /** * 计算文件的MD5散列结果 * * 终端测试命令: * @code * md5 file.dat * @endcode * * @return 32个字符的MD5散列字符串 */ - (NSString *)yj_fileMD5Hash; /** * 计算文件的SHA1散列结果 * * 终端测试命令: * @code * openssl sha -sha1 file.dat * @endcode * * @return 40个字符的SHA1散列字符串 */ - (NSString *)yj_fileSHA1Hash; /** * 计算文件的SHA256散列结果 * * 终端测试命令: * @code * openssl sha -sha256 file.dat * @endcode * * @return 64个字符的SHA256散列字符串 */ - (NSString *)yj_fileSHA256Hash; /** * 计算文件的SHA512散列结果 * * 终端测试命令: * @code * openssl sha -sha512 file.dat * @endcode * * @return 128个字符的SHA512散列字符串 */ - (NSString *)yj_fileSHA512Hash; @end
USE db_loja_segunda; INSERT INTO estados (nome, sigla) VALUES ("Acre", "AC"), ("Alagoas","AL"), ("Amapá", "AP"), ("Amazonas", "AM"), ("Bahia", "BA"), ("Ceará", "CE"), ("Distrito Federal", "DF"), ("Espirito Santo", "ES"), ("Goiás", "GO"), ("Maranhão", "MA"), ("Mato Grosso", "MT"), ("Mato Grosso do Sul", "MS"), ("Minas Gerais", "MG"), ("Pará", "PA"), ("Paraiba", "PB"), ("Paraná", "PR"), ("Pernanbuco", "PE"), ("Piauí", "PI"), ("Rio de Janeiro", "RJ"), ("Rio Grande do Norte", "RN"), ("Rio grande do Sul", "RS"), ("Rondônia", "RO"), ("Roraima", "RR"), ("Santa Catarina", "SC"), ("São Paulo", "SP"), ("Sergipe", "SE"), ("Tocantins", "TO"); INSERT INTO cidades (nome, estado_id) VALUES ("São Paulo", 25), ("São José do Rio Preto", 25), ("Rio de Janeiro", 19), ("Salvador", 5), ("Belo Horizonte", 13), ("Mirassol", 25); INSERT INTO clientes ( nome, email, senha, telefone, cpf, cep, endereco, bairro, numero, cidade_id, ativo, criado, modificado ) VALUES ("<NAME>","<EMAIL>", "123" , "(17)9999-9999", "999.999.999-99", "15.000-000", "Rua 1", "Centro", "S/N", 1, 1, NOW(),NOW()), ("<NAME>","<EMAIL>", "456" , "(17)8888-8888", "999.999.999-99", "15.000-000", "Rua 2", "Centro", "S/N", 2, 1, NOW(),NOW()), ("<NAME>","<EMAIL>", "789" , "(17)7777-7777", "999.999.999-99", "15.000-000", "Rua 3", "Centro", "S/N", 2, 1, NOW(),NOW());
fn main() { let mut x = 5; let mut y = 10; println!("x = {} and y = {}", x, y); // swap x and y let temp = x; x = y; y = temp; println!("x = {} and y = {}", x, y); }
#!/bin/sh rm -f "$DOWNLOADS_PATH/npmdone" "$JACKBONEGAP_PATH/scripts/init.sh" || exit 1
<filename>src/base-validators/number.test.ts import validator, { NumberValidationError } from "./number"; describe("validator", () => { it("can validate and invalidate a number", () => { expect(validator({ type: "number" }, "im a number")).toBeInstanceOf(NumberValidationError); expect(validator({ type: "number" }, 123)).toBe(true); expect(validator({ type: "number" }, {})).toBeInstanceOf(NumberValidationError); expect(validator({ type: "number" }, true)).toBeInstanceOf(NumberValidationError); expect(validator({ type: "number" }, false)).toBeInstanceOf(NumberValidationError); expect(validator({ type: "number" }, null)).toBeInstanceOf(NumberValidationError); expect(validator({ type: "number" }, 123.123)).toBe(true); }); it("multipleOf", () => { expect(validator({ type: "number", multipleOf: 10 }, 100)).toBe(true); expect(validator({ type: "number", multipleOf: 100 }, 10)).toBeInstanceOf(NumberValidationError); }); it("maximum", () => { expect(validator({ type: "number", maximum: 10 }, 10)).toBe(true); expect(validator({ type: "number", maximum: 10 }, 11)).toBeInstanceOf(NumberValidationError); }); it("exclusiveMaximum", () => { expect(validator({ type: "number", exclusiveMaximum: 10 }, 9)).toBe(true); expect(validator({ type: "number", exclusiveMaximum: 10 }, 10)).toBeInstanceOf(NumberValidationError); }); it("minimum", () => { expect(validator({ type: "number", minimum: 10 }, 10)).toBe(true); expect(validator({ type: "number", minimum: 10 }, 9)).toBeInstanceOf(NumberValidationError); }); it("exclusiveMinimum", () => { expect(validator({ type: "number", exclusiveMinimum: 10 }, 11)).toBe(true); expect(validator({ type: "number", exclusiveMinimum: 10 }, 10)).toBeInstanceOf(NumberValidationError); }); it("const", () => { expect(validator({ type: "number", const: 123 }, 123)).toBe(true); expect(validator({ type: "number", const: 456 }, 123)).toBeInstanceOf(NumberValidationError); }); it("enum", () => { expect(validator({ type: "number", enum: [123] }, 123)).toBe(true); expect(validator({ type: "number", enum: [123] }, 456)).toBeInstanceOf(NumberValidationError); expect(validator({ type: "number", enum: [123, 456] }, 123)).toBe(true); expect(validator({ type: "number", enum: [123, 456] }, 1)).toBeInstanceOf(NumberValidationError); expect(validator({ type: "number", enum: ["foo", "123", "bar"] }, 123)).toBeInstanceOf(NumberValidationError); }); });
<gh_stars>1-10 // ==UserScript== // @name Netflix // @namespace https://github.com/matt-tingen/userscripts // @version 1.0 // @author <NAME> // @description Skip the interruptions // @downloadURL https://raw.githubusercontent.com/matt-tingen/userscripts/master/dist/netflix.user.js // @match https://www.netflix.com/* // @require https://cdnjs.cloudflare.com/ajax/libs/arrive/2.4.1/arrive.min.js // @require https://raw.githubusercontent.com/matt-tingen/userscripts/master/src/netflix/index.js // @grant none // ==/UserScript==
<gh_stars>1-10 package com.example.t_t; public class ItemList { private String itemTitle; private Integer itemQuantity = 0 ; private String itemUnits; private String itemUrl; public ItemList(){ } public ItemList(String name, Integer num,String units,String url) { itemTitle = name; itemQuantity = num; itemUnits = units; itemUrl = url; } public String getText() { return itemTitle; } public void setText(String s) { this.itemTitle = s;} public Integer getQuantity() { return itemQuantity; } public void setQuantity(Integer in) { this.itemQuantity = in; } public String getUnits (){ return itemUnits; } public void setUnits (String t) { this.itemUnits = t;} public String getItemUrl(){ return itemUrl; } public void setItemUrl(String p){ this.itemUrl = p; } }
#!/usr/bin/env bash # # required environment variables: # AWS_ACCESS_KEY_ID # AWS_SECRET_ACCESS_KEY # AWS_DEFAULT_REGION AWS_S3_BUCKET="matthiaskretschmann.com" AWS_S3_BUCKET_BETA="beta.matthiaskretschmann.com" SITEMAP_URL="https%3A%2F%2Fmatthiaskretschmann.com%2Fsitemap.xml" # set -e; function s3sync { aws s3 sync ./public s3://"$1" \ --include "*" \ --exclude "*.html" \ --exclude "sw.js" \ --exclude "*page-data.json" \ --exclude "*app-data.json" \ --exclude "chunk-map.json" \ --exclude "sitemap.xml" \ --exclude ".iconstats.json" \ --exclude "humans.txt" \ --exclude "robots.txt" \ --cache-control public,max-age=31536000,immutable \ --delete \ --acl public-read aws s3 sync ./public s3://"$1" \ --exclude "*" \ --include "*.html" \ --include "sw.js" \ --include "*page-data.json" \ --include "*app-data.json" \ --include "chunk-map.json" \ --include "sitemap.xml" \ --include ".iconstats.json" \ --include "humans.txt" \ --include "robots.txt" \ --cache-control public,max-age=0,must-revalidate \ --delete \ --acl public-read } # purge full Cloudflare cache # https://api.cloudflare.com/#zone-purge-all-files function purge { curl -X POST "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE/purge_cache" \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_KEY" \ -H "Content-Type: application/json" \ --data '{"purge_everything":true}' } # ping search engines # returns: HTTP_STATUSCODE URL function ping { curl -sL -w "%{http_code} %{url_effective}\\n" \ "http://www.google.com/webmasters/tools/ping?sitemap=$SITEMAP_URL" -o /dev/null \ "http://www.bing.com/webmaster/ping.aspx?siteMap=$SITEMAP_URL" -o /dev/null } ## ## check for pull request against master ## if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then s3sync $AWS_S3_BUCKET_BETA ## ## check for master push which is no pull request ## elif [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] || [ "$TRAVIS" != true ]; then s3sync $AWS_S3_BUCKET purge ping echo "---------------------------------------------" echo " ✓ done deployment " echo "---------------------------------------------" exit; else echo "---------------------------------------------" echo " nothing to deploy " echo "---------------------------------------------" fi
let arr = ["one", "two", "three", "two"] func removeDuplicates(arr: [String]) -> [String] { var unique = [String]() for item in arr { if !unique.contains(item) { unique.append(item) } } return unique } print(removeDuplicates(arr: arr)) // Output: ["one", "two", "three"]
CREATE FUNCTION page_deleted() RETURNS TRIGGER LANGUAGE plpgsql AS $mw$ BEGIN DELETE FROM recentchanges WHERE rc_namespace = OLD.page_namespace AND rc_title = OLD.page_title; RETURN NULL; END; $mw$; CREATE TRIGGER page_deleted AFTER DELETE ON page FOR EACH ROW EXECUTE PROCEDURE page_deleted();
import React from 'react'; class CalendarApp extends React.Component { constructor(props) { super(props); this.state = { events: [ { name: 'My Event1', startDate: '01/01/2020', endDate: '01/03/2020', category: 'Sports', location: 'New York' }, { name: 'My Event2', startDate: '01/15/2020', endDate: '01/20/2020', category: 'Concert', location: 'Los Angeles' }, { name: 'My Event3', startDate: '02/10/2020', endDate: '02/15/2020', category: 'Theatre', location: 'San Francisco' } ] } } render() { return ( <div> <h1>My Events Calendar</h1> <ul> { this.state.events.map(event => <li> <p>Name: {event.name}</p> <p>Date: {event.startDate} - {event.endDate}</p> <p>Category: {event.category}</p> <p>Location: {event.location}</p> </li> ) } </ul> </div> ); } } export default CalendarApp;
#!/usr/bin/bash if [ $# -eq 0 ] then echo "Current server: $HOSTNAME!" elif [ $1 == '-l' ] then echo "Current server:$USER@$HOSTNAME!" elif [ $1 == '--help' ] then echo "Usage: query_server.sh [OPTION] Prints the name of the current server as: \"Current Server:[servername]\" -l Prints the username with the servername Exit status: 0 if OK, 1 Problem with command line" else echo "exit" exit 1 fi exit 0
<reponame>Eureka1024/RP2040-MicroPython-Mouse from machine import Pin,Timer import time import hid import st7789 as st7789 from fonts import vga2_8x8 as font1 from fonts import vga1_16x32 as font2 import framebuf import uos def mouse_move(x, y): for column in range(y+0,y+21): buf = f_image.read(30) display.blit_buffer(buf, x, column, 15, 1) # 摇杆的端口配置 -> AD采样端口 XdeviationAD = machine.ADC(3) YdeviationAD = machine.ADC(2) # A、B按键配置 buttonA = Pin(6, Pin.IN, Pin.PULL_UP) buttonB = Pin(5, Pin.IN, Pin.PULL_UP) # usb_hid 配置 mouse = hid.Mouse() image_file0 = "/mouse2.bin" #图片文件地址 .bin" #图片文件地 st7789_res = 0 #复位引脚 st7789_dc = 1 #D/C引脚 disp_width = 240 #屏幕宽度 disp_height = 240 #屏幕高度 CENTER_Y = int(disp_width/2) #Y轴中心点 CENTER_X = int(disp_height/2)#X轴中心点 # print(uos.uname()) spi_sck=machine.Pin(2)#SCK spi_tx=machine.Pin(3) #TX spi0=machine.SPI(0,baudrate=4000000, phase=1, polarity=1, sck=spi_sck, mosi=spi_tx) # print(spi0) # 屏幕显示 display = st7789.ST7789(spi0, disp_width, disp_width, reset=machine.Pin(st7789_res, machine.Pin.OUT), dc=machine.Pin(st7789_dc, machine.Pin.OUT), xstart=0, ystart=0, rotation=0) display.fill(st7789.WHITE) display.text(font2, "Menu", 90, 10, color=st7789.BLACK, background=st7789.WHITE) display.text(font2, "Connect PC", 10, 50, color=st7789.BLACK, background=st7789.WHITE) display.text(font2, "Sensitivity", 10, 100, color=st7789.BLACK, background=st7789.WHITE) display.text(font2, "Other", 10, 150, color=st7789.BLACK, background=st7789.WHITE) currentX = 200 currentY = 200 f_image = open("/mouse_pic.bin", 'rb') mouse_move(currentX, currentY) # 按键扫描 # tim = Timer() # def key_scan(timer): # # # # tim.init(period=100, mode=Timer.PERIODIC, callback=key_scan)#100ms调用一次 status_mode = 0 while True: Xdeviation = XdeviationAD.read_u16() Ydeviation = YdeviationAD.read_u16() if (Xdeviation > 25000) and (Xdeviation < 35000): Xdeviation = 32500 if (Ydeviation > 25000) and (Ydeviation < 35000): Ydeviation = 32500 if (Xdeviation == 32500) and (Ydeviation == 32500): continue Xdeviation = Xdeviation - 32500 Ydeviation = Ydeviation - 32500 # print(Xdeviation) # print(Ydeviation) # if (Xdeviation != 0) or (Ydeviation != 0): # mouse.move(Xdeviation, Ydeviation) # # if buttonA.value() == 0: # mouse.click(mouse.BUTTON_RIGHT) # if buttonB.value() == 0: # mouse.click(mouse.BUTTON_LEFT) # f_image = open(image_file0, 'rb') # mouse_move(Xdeviation*10, Ydeviation*10) # time.sleep(0.1) if (status_mode == 0): #主菜单 display.fill_rect(currentX, currentY, 15, 21, st7789.WHITE) display.text(font2, "Menu", 90, 10, color=st7789.BLACK, background=st7789.WHITE) display.text(font2, "Connect PC", 10, 50, color=st7789.BLACK, background=st7789.WHITE) display.text(font2, "Sensitivity", 10, 100, color=st7789.BLACK, background=st7789.WHITE) display.text(font2, "Other", 10, 150, color=st7789.BLACK, background=st7789.WHITE) currentX = currentX + int(Xdeviation/800) if (currentX < 0): currentX = 0 if (currentX > 239): currentX = 239 currentY = currentY + int(Ydeviation/800) if (currentY < 0): currentY = 0 if (currentY > 239): currentY = 239 f_image = open("/mouse_pic.bin", 'rb') mouse_move(currentX, currentY) # display.text(font2, "www.eetree.cn", 30, 200) # elif (status_mode == 1) # # elif (status_mode == 2)
#!/bin/bash -e # get the directory of this script # snippet from https://stackoverflow.com/a/246128/10102404 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" GIT_ROOT=$(dirname "$SCRIPT_DIR") EXIT_CODE=0 cd "$GIT_ROOT" if [ -d vendor.bk ]; then echo "vendor.bk exits - remove before continuing" exit 1 fi trap cleanup 1 2 3 6 cleanup() { cd "$GIT_ROOT" # restore the vendor dir rm -r vendor if [ -d vendor.bk ]; then mv vendor.bk vendor fi exit $EXIT_CODE } # if the vendor directory exists, back it up so we can build a fresh one if [ -d vendor ]; then mv vendor vendor.bk fi # create a vendor dir with the mod dependencies GO111MODULE=on go mod vendor # turn on nullglobbing so if there is nothing in cmd dir then we don't do # anything in this loop shopt -s nullglob if [ ! -f Attribution.txt ]; then echo "An Attribution.txt file is missing, please add" EXIT_CODE=1 else # loop over every library in the modules.txt file in vendor while IFS= read -r lib; do if ! grep -q "$lib" Attribution.txt && [ "$lib" != "explicit" ]; then echo "An attribution for $lib is missing from in Attribution.txt, please add" # need to do this in a bash subshell, see SC2031 (( EXIT_CODE=1 )) fi done < <(grep '#' < "$GIT_ROOT/vendor/modules.txt" | awk '{print $2}') fi cd "$GIT_ROOT" cleanup
<reponame>GattoJohnny/MMM-CalendarExt2 /* global Slot */ // eslint-disable-next-line no-unused-vars class CellSlot extends Slot { constructor(view, period, daySeq = 0, weekSeq = 0) { super(view, period, daySeq); this.start = period.start; this.end = period.end; this.seq = daySeq; this.daySeq = daySeq; this.weekSeq = weekSeq; this.makeSlotDomClass(view, daySeq, weekSeq); } static factory(view, slotPeriods, weekSeq = 0, events) { const slots = []; for (let i = 0; i < slotPeriods.length; i++) { const slot = new CellSlot(view, slotPeriods[i], i, weekSeq); // slot.assign(events) slots.push(slot); } return slots; } init(view) { this.makeDom(); this.makeSlotHeader(view); this.adjustSlotHeight(view, this.contentDom); } adjustSlotHeight(view, dom) { view.adjustSlotHeight(dom); } makeSlotHeader(view) { view.makeSlotHeader(this); } makeSlotDomClass(view, daySeq, weekSeq) { view.makeCellDomClass(this, daySeq, weekSeq); this.dom.classList.add("cellSlot"); } }
#!/bin/bash startNum=${1} totalNum=${2} VBC_DWMRI='/data/project/SC_pipeline/01_MRI_pipelines/Container/Singularity/Container_SC_pipeline.simg' DATA_DIR='/data/project/SC_pipeline/02_MRI_data' ATLAS_DIR='/data/project/SC_pipeline/02_MRI_data/Atlases' OUTPUT_DIR='/data/project/SC_pipeline/03_Structural_Connectivity' FREESURFER_OUTPUT='/data/project/SC_pipeline/Neuroimage/Tools/freesurfer/subjects' FREESURFER_LICENSE='/opt/freesurfer/6.0/license.txt' RUN_SHELLSCRIPT='/data/project/SC_pipeline/02_MRI_data/multiple_reconstruct.sh' SUBJECTS_LIST='/data/project/SC_pipeline/02_MRI_data/list_PD_HHU_QC_N73.txt' # Condition 1 # ----------- INPUT_PARAMETERS=$(pwd)/input_PD_HHU_10M_Schaefer100P17N_MNI152.txt singularity exec --cleanenv -B ${DATA_DIR}:/mnt_sp,${OUTPUT_DIR}:/mnt_tp,${FREESURFER_OUTPUT}:/mnt_fp,${ATLAS_DIR}:/mnt_ap,${FREESURFER_LICENSE}:/opt/freesurfer/license.txt,${INPUT_PARAMETERS}:/opt/input.txt,${RUN_SHELLSCRIPT}:/opt/script.sh,${SUBJECTS_LIST}:/opt/list.txt ${VBC_DWMRI} /opt/script.sh /opt/list.txt /opt/input.txt ${startNum} ${totalNum} # Condition 2 # ----------- INPUT_PARAMETERS=$(pwd)/input_PD_HHU_2M_Schaefer100P17N_MNI152.txt singularity exec --cleanenv -B ${DATA_DIR}:/mnt_sp,${OUTPUT_DIR}:/mnt_tp,${FREESURFER_OUTPUT}:/mnt_fp,${ATLAS_DIR}:/mnt_ap,${FREESURFER_LICENSE}:/opt/freesurfer/license.txt,${INPUT_PARAMETERS}:/opt/input.txt,${RUN_SHELLSCRIPT}:/opt/script.sh,${SUBJECTS_LIST}:/opt/list.txt ${VBC_DWMRI} /opt/script.sh /opt/list.txt /opt/input.txt ${startNum} ${totalNum} # Condition 3 # ----------- INPUT_PARAMETERS=$(pwd)/input_PD_HHU_500K_Schaefer100P17N_MNI152.txt singularity exec --cleanenv -B ${DATA_DIR}:/mnt_sp,${OUTPUT_DIR}:/mnt_tp,${FREESURFER_OUTPUT}:/mnt_fp,${ATLAS_DIR}:/mnt_ap,${FREESURFER_LICENSE}:/opt/freesurfer/license.txt,${INPUT_PARAMETERS}:/opt/input.txt,${RUN_SHELLSCRIPT}:/opt/script.sh,${SUBJECTS_LIST}:/opt/list.txt ${VBC_DWMRI} /opt/script.sh /opt/list.txt /opt/input.txt ${startNum} ${totalNum} # Condition 4 # ----------- INPUT_PARAMETERS=$(pwd)/input_PD_HHU_100K_Schaefer100P17N_MNI152.txt singularity exec --cleanenv -B ${DATA_DIR}:/mnt_sp,${OUTPUT_DIR}:/mnt_tp,${FREESURFER_OUTPUT}:/mnt_fp,${ATLAS_DIR}:/mnt_ap,${FREESURFER_LICENSE}:/opt/freesurfer/license.txt,${INPUT_PARAMETERS}:/opt/input.txt,${RUN_SHELLSCRIPT}:/opt/script.sh,${SUBJECTS_LIST}:/opt/list.txt ${VBC_DWMRI} /opt/script.sh /opt/list.txt /opt/input.txt ${startNum} ${totalNum} # Condition 5 # ----------- INPUT_PARAMETERS=$(pwd)/input_PD_HHU_50K_Schaefer100P17N_MNI152.txt singularity exec --cleanenv -B ${DATA_DIR}:/mnt_sp,${OUTPUT_DIR}:/mnt_tp,${FREESURFER_OUTPUT}:/mnt_fp,${ATLAS_DIR}:/mnt_ap,${FREESURFER_LICENSE}:/opt/freesurfer/license.txt,${INPUT_PARAMETERS}:/opt/input.txt,${RUN_SHELLSCRIPT}:/opt/script.sh,${SUBJECTS_LIST}:/opt/list.txt ${VBC_DWMRI} /opt/script.sh /opt/list.txt /opt/input.txt ${startNum} ${totalNum} # Condition 6 # ----------- INPUT_PARAMETERS=$(pwd)/input_PD_HHU_10K_Schaefer100P17N_MNI152.txt singularity exec --cleanenv -B ${DATA_DIR}:/mnt_sp,${OUTPUT_DIR}:/mnt_tp,${FREESURFER_OUTPUT}:/mnt_fp,${ATLAS_DIR}:/mnt_ap,${FREESURFER_LICENSE}:/opt/freesurfer/license.txt,${INPUT_PARAMETERS}:/opt/input.txt,${RUN_SHELLSCRIPT}:/opt/script.sh,${SUBJECTS_LIST}:/opt/list.txt ${VBC_DWMRI} /opt/script.sh /opt/list.txt /opt/input.txt ${startNum} ${totalNum}
#!/bin/bash # From https://stackoverflow.com/a/246128 SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" GIST_URL="https://github.com/MaximDevoir/steam-fix" ISSUES_URL="https://github.com/MaximDevoir/steam-fix/issues" make_backup_dir () { mkdir -p "$DIR/backup" } make_backup_dir first_message () { log_about echo "Are you ready to start?" select yn in "Yes" "No"; do case $yn in Yes ) fix_steam; break;; No ) echo 'You selected NO; exiting now' && exit;; esac done } log_about () { echo "" echo "Steam Fixer for Linux Systems" echo "- Maxim Devoir 2019" echo "Available at $GIST_URL" echo "Report any issues to $ISSUES_URL" echo "" echo "This program removes libstdc++* and libgcc* libraries from" echo "$HOME/.local/share/Steam/" echo "" } fix_steam () { echo "" echo "Fixing steam" echo "" COMMAND_TO_RUN="/bin/bash -e -c $DIR/fixSteam.sh" echo "Executing $COMMAND_TO_RUN" $COMMAND_TO_RUN fixed_steam } # The messsages to run after `fix_steam` fixed_steam () { echo -e "\e[0;31m---------------------------------\033[0m" echo -e "\e[0;37m---------------------------------\033[0m" echo -e "\e[0;34m---------------------------------\033[0m" echo -e "\e[0;32m📖 📖 FINISHED 📖 📖\033[0m" echo "📘 A backup of the removed files has been made at:" echo "📘 $DIR/backup" echo "" echo "📗 If you encounter any problems with steam or any games, you can try restoring the files by:" echo "📗 - Restoring the deleted files from Trash (recommended)" echo "📗 - Copying the backup files into $HOME/.local/share/Steam" echo "📗 - Reinstalling Steam (which restores Steam's libstdc and libgcc files)" echo "📗 - Verifying the integrity of a game (which restores libgcc and libstdc files)" echo "" echo "📗 Report any issues to $ISSUES_URL" echo "" echo "" echo -e "\e[0;35m REMINDER \033[0m" echo "📖 Steam and games in your library may automatically" echo "📖 re-add libstdc and libgcc file with updates or integrity checks." echo "📖 As such, the software must be run with each of their updates" echo "" echo "⭐ If this utility has been useful, consider give us a ⭐" echo "⭐ ⭐ $GIST_URL ⭐ ⭐" echo "👍 Goodbye 👍" } # Follows semi-semver spec. Uses ABBCC format where A is major version, BB is # minor, and CC is patch. BB and CC must be exactly 2 digits long. Otherwise, # the script will do incorrect calculations for checking if software is # up-to-date. CURRENT_VERSION=$(head -n 1 "$DIR"/version) SCRIPT_VERSION_URL="https://raw.githubusercontent.com/MaximDevoir/steam-fix/master/version" echo "Checking if software is up-to-date" echo "" REMOTE_LATEST_VERSION=$(wget $SCRIPT_VERSION_URL -q -O -) re='^[0-9]+$' if ! [[ $REMOTE_LATEST_VERSION =~ $re ]] ; then echo "Error: Couldn't fetch the latest version." echo "Try checking if you are connected to the internet and rerun the script" echo "Or, verify that you can load $SCRIPT_VERSION_URL" echo "" echo "Would you like to ignore checking the latest version" select yn in "Yes, ignore checking if I have the latest version" "No, quit now"; do case $yn in Yes* ) first_message; break;; No* ) echo "You selected no; exiting now" && exit;; esac done fi if (( REMOTE_LATEST_VERSION > CURRENT_VERSION )); then echo "Software is out-of-date." echo "Your version: $CURRENT_VERSION" echo "Latest version: $REMOTE_LATEST_VERSION" echo "Please update your scripts at $GIST_URL" echo "" echo "Would you like to ignore updating to the current version (not recommended)" select yn in "Yes, ignore updating" "No, I will update the scripts"; do case $yn in Yes* ) first_message; break;; No* ) echo "You selected no; visit $GIST_URL to update your scripts; exiting now" && exit;; esac done else echo "Software up to date" echo "Your version: $CURRENT_VERSION" echo "Latest version: $REMOTE_LATEST_VERSION" first_message fi
chown :root /etc/resolv.conf
import { Injectable } from '@angular/core'; import { Router } from '@angular/router'; @Injectable({ providedIn: 'root' }) export class GuardService { constructor(public router:Router){ } isLoggedIn():any { // let data = localStorage.getItem('data'); // if(data == 'true'){ // return true; // }else{ // return false; // } let loginLocalData = JSON.parse(localStorage.getItem('LoginResponse')) let GmailLogin = JSON.parse(localStorage.getItem('gmailLogin')); let fbLogin = JSON.parse(localStorage.getItem('fbLogin')); if(loginLocalData !== null || GmailLogin !== null || fbLogin !== null ){ this.router.navigateByUrl('/home') console.log('hi') return true; }else{ return false; } } }
#!/bin/bash set -e RES="vivado.tex" ;\ LUT=`grep -m1 -o 'LUTs\ *|\ * [0-9]*' vivado.log | sed s/'| L'/L/g | sed s/\|/'\&'/g` ;\ FF=`grep -m1 -o 'Registers\ *|\ * [0-9]*' vivado.log | sed s/'| L'/L/g | sed s/\|/'\&'/g` ;\ DSP=`grep -m1 -o 'DSPs\ *|\ * [0-9]*' vivado.log | sed s/'| L'/L/g | sed s/\|/'\&'/g` ;\ BRAM=`grep -m1 -o 'Block RAM Tile \ *|\ * [0-9.]*' vivado.log | sed s/'| L'/L/g | sed s/\|/'\&'/g | sed s/lock\ //g | sed s/Tile//g` ;\ PIN=`grep -m1 -o 'Bonded IOB\ *|\ * [0-9]*' vivado.log | sed s/'| L'/L/g | sed s/\|/'\&'/g | sed s/'Bonded IOB'/PIN/g` ;\ echo "$LUT \\\\ \\hline" > $RES ;\ echo "\rowcolor{iob-blue}" >> $RES ;\ echo "$FF \\\\ \\hline" >> $RES ;\ echo "$DSP \\\\ \\hline" >> $RES ;\ echo "\rowcolor{iob-blue}" >> $RES ;\ echo "$BRAM \\\\ \\hline" >> $RES ;\ #if [ "$PIN" ]; then \ #echo "$PIN \\\\ \\hline" >> $RES ;\ #fi \
package client import ( "testing" "github.com/emersion/go-imap" ) func TestClient_Capability(t *testing.T) { c, s := newTestClient(t) defer s.Close() var caps map[string]bool done := make(chan error, 1) go func() { var err error caps, err = c.Capability() done <- err }() tag, cmd := s.ScanCmd() if cmd != "CAPABILITY" { t.Fatalf("client sent command %v, want CAPABILITY", cmd) } s.WriteString("* CAPABILITY IMAP4rev1 XTEST\r\n") s.WriteString(tag + " OK CAPABILITY completed.\r\n") if err := <-done; err != nil { t.Error("c.Capability() = ", err) } if !caps["XTEST"] { t.Error("XTEST capability missing") } } func TestClient_Noop(t *testing.T) { c, s := newTestClient(t) defer s.Close() done := make(chan error, 1) go func() { done <- c.Noop() }() tag, cmd := s.ScanCmd() if cmd != "NOOP" { t.Fatalf("client sent command %v, want NOOP", cmd) } s.WriteString(tag + " OK NOOP completed\r\n") if err := <-done; err != nil { t.Error("c.Noop() = ", err) } } func TestClient_Logout(t *testing.T) { c, s := newTestClient(t) defer s.Close() done := make(chan error, 1) go func() { done <- c.Logout() }() tag, cmd := s.ScanCmd() if cmd != "LOGOUT" { t.Fatalf("client sent command %v, want LOGOUT", cmd) } s.WriteString("* BYE Client asked to close the connection.\r\n") s.WriteString(tag + " OK LOGOUT completed\r\n") if err := <-done; err != nil { t.Error("c.Logout() =", err) } if state := c.State(); state != imap.LogoutState { t.Errorf("c.State() = %v, want %v", state, imap.LogoutState) } } func TestClient_Fubb(t *testing.T) { c, s := newTestClient(t) defer s.Close() setClientState(c, imap.SelectedState, nil) seqset, _ := imap.ParseSeqSet("1:4") fields := []imap.FetchItem{imap.FetchUid, imap.FetchModSeq, imap.FetchFlags} done := make(chan error, 1) messages := make(chan *imap.Message, 2) go func() { done <- c.Fetch(seqset, fields, messages) }() tag, cmd := s.ScanCmd() if cmd != "FETCH 1:4 (UID MODSEQ FLAGS)" { t.Fatalf("client sent command %v, want %v", cmd, "FETCH 1:4 (UID BODY[])") } // s.WriteString("* 1 FETCH (MODSEQ (5) FLAGS (\\Flagged \\Seen) UID 1)\r\n") // s.WriteString("* 2 FETCH (MODSEQ (10) FLAGS (\\Flagged \\Seen) UID 2)\r\n") // s.WriteString("* 3 FETCH (MODSEQ (15) FLAGS (\\Flagged \\Seen) UID 3)\r\n") // s.WriteString("* 4 FETCH (MODSEQ (20) FLAGS (\\Flagged \\Seen) UID 4)\r\n") // s.WriteString(tag + " OK FETCH completed\r\n") s.WriteString("* 1 FETCH (MODSEQ (5) BODY[1] {3}\r\n") s.WriteString("Hey") s.WriteString(")\r\n") s.WriteString(tag + " OK FETCH completed\r\n") // fmt.Println("Sended") if err := <-done; err != nil { t.Fatalf("c.Fetch() = %v", err) } <-messages // section, _ := imap.ParseBodySectionName("BODY[]") // msg := <-messages // fmt.Println(msg) // if msg.SeqNum != 2 { // t.Errorf("First message has bad sequence number: %v", msg.SeqNum) // } // if msg.Uid != 42 { // t.Errorf("First message has bad UID: %v", msg.Uid) // } // if body, _ := ioutil.ReadAll(msg.GetBody(section)); string(body) != "I love potatoes." { // t.Errorf("First message has bad body: %q", body) // } // msg = <-messages // if msg.SeqNum != 3 { // t.Errorf("First message has bad sequence number: %v", msg.SeqNum) // } // if msg.Uid != 28 { // t.Errorf("Second message has bad UID: %v", msg.Uid) // } // if body, _ := ioutil.ReadAll(msg.GetBody(section)); string(body) != "Hello World!" { // t.Errorf("Second message has bad body: %q", body) // } }
package controllers import play.api._ import play.api.mvc._ import org.jsoup.Jsoup import collection.immutable._ import java.net.{URL, URLConnection, URLEncoder} import play.api.db.DB import anorm._ import anorm.SqlParser._ import play.api.Play.current import models._ import play.api.data._ import play.api.data.Forms._ import collection.JavaConversions._ import breeze.linalg._ import com.mongodb.casbah.Imports._ import io.Source object PairsController extends Controller { val coll = MongoConnection()("typedynamic")("pairs") def periodPrices(symbol: String, days: Int): List[Double] = { return Source.fromInputStream(new URL("http://ichart.finance.yahoo.com/table.csv?s="+symbol+"&d=6&e=22&f=2012&g=d&a=6&b=9&c=2011&ignore=.csv"). openConnection.getInputStream).getLines(). map(line => line.split(",")(6)).drop(1).take(days). map(p => p.toDouble).toList } def periodReturn(prices: List[Double]): Double = { return (prices.head - prices.last) / prices.last } def periodPairReturn(long: String, short: String, days: Int): Double = { val longPrices = periodPrices(long, days) val shortPrices = periodPrices(short, days) return periodReturn(longPrices) - periodReturn(shortPrices) } def maxReturnPair(prices: DenseMatrix[Double]): (Int, Int) = { return (0, 0) } def portfolioComponents(symbol: String): List[String] = { val queryURLstr = "http://finance.yahoo.com/q/cp?s=" return Jsoup.connect(queryURLstr + URLEncoder.encode(symbol,"UTF-8")).get. select(".yfnc_tabledata1 a").map(x => x.text()).toList } def portfolioReturns(symbol: String, days: Int): DenseMatrix[Double] = { val components = portfolioComponents(symbol) return new DenseMatrix[Double](days, components.size(), components.flatMap(c => periodPrices(c, days)).toArray) } def show(long: String, short: String) = Action { val ret = periodPairReturn(long, short, 5) val o = MongoDBObject("pair" -> MongoDBObject("long" -> long, "short" -> short, "ret" -> ret)) coll.findOne(o) match { case None => coll += o case Some(_) => () } Ok(views.html.pairs.show( Map("pairReturn" -> ret.toString))) } def index() = Action { val results = coll.map(x => x.getAs[DBObject]("pair"). map( y => (y("long").asInstanceOf[String], y("short").asInstanceOf[String] ))). map(_.get).toList println(results) Ok(views.html.pairs.index(results)) } }
<filename>src/statusTypes.js export const LOGGED_IN = 'Logged in'; export const LOGGED_OUT = 'Logged out'; export const LOGIN_ERROR = 'Login error'; export const LOGIN_CANCELLED = 'Login cancelled';
require 'spec_helper' describe Codelocks::CollectionProxy do subject(:proxy) { Codelocks::CollectionProxy.new(model: model, client: client) } let(:client) { Codelocks::Client.new } let(:model) { Codelocks::Model } describe "attribute accessors" do [:client, :model].each do |attr| it { is_expected.to respond_to(attr) } it { is_expected.to respond_to(:"#{attr}=") } end end describe "#initialize" do subject { proxy.send(:initialize, client: client, model: model) } after { subject } it "sets the client" do expect(proxy).to receive(:client=).with(client) end it "sets the model" do expect(proxy).to receive(:model=).with(model) end it "sets itself as the model's proxy" do expect(model).to receive(:collection_proxy=).with(proxy) end end end
<gh_stars>0 { "binhacks": { "sprintf_call_1": { "code": "50e8[strings_vsprintf]894580", "title": "Safe sprintf (first call)" }, "sprintf_call_2": { "code": "50e8[strings_vsprintf]8945b8", "title": "Safe sprintf (second call)" }, "sprintf_rep": { "code": "8b", "title": "Safe sprintf (replace pointer)" }, "music_title_prepare": { "code": "8d8c0fdca301005153518b8e901b0100e861c9fdff598b45ec803c1800742b8d9361ffffff8b45f450688020300068ffe0d000909090909090", "title": "Prepare Music Room title parameter fetching" }, "music_cmt_rewrite": { "code": "d1e872064883f8077605e9ee01000069f8a4020000c68437029f0100018dbc37049d01008b9e741b010080bbac814a000074196bd04269cb9202000001ca8d8c32b6c900009090909090eb078b0c85bc1d4a0089f85131dbe98701000090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090", "title": "Rewrite Music Room comment render calls" } }, "game": "th09", "title": "東方花映塚 ~ Phantasmagoria of Flower View", "url_update": "http://kourindou.exblog.jp/1327589/", "url_trial": "http://www16.big.or.jp/~zun/html/th09dl.html", "latest": "v1.50a", "formats": { "msg": "msg09", "anm": "anm06" } }
import {HttpHandler, HttpRequest} from '@angular/common/http'; import {ConfigurationService} from 'projects/commons/src/lib/config/configuration.service'; import {configurationServiceMock} from 'projects/commons/src/lib/config/configuration.service.spec'; import {AnalysisApplicationIdService} from 'projects/analysis/src/lib/analysis-application-id.service'; import {AnalysisConfigurationService} from 'projects/analysis/src/lib/analysis-configuration.service'; import {analysisConfigurationServiceSpy} from 'projects/analysis/src/lib/analysis-configuration.service.spec'; describe('AnalysisApplicationIdService', () => { let interceptor: AnalysisApplicationIdService; let next: HttpHandler; let configuration: ConfigurationService; let analysisConfiguration: AnalysisConfigurationService; beforeEach(() => { configuration = configurationServiceMock(); analysisConfiguration = analysisConfigurationServiceSpy(); interceptor = new AnalysisApplicationIdService(configuration, analysisConfiguration); next = jasmine.createSpyObj('next', ['handle']); }); it('should be created', () => { expect(interceptor).toBeTruthy(); }); it('should intercept', () => { const req = new HttpRequest('GET', analysisConfiguration.analysisApiUrl('/path')); const intercepted = req.clone({ headers: req.headers.set('ApplicationId', configuration.applicationId) }); interceptor.intercept(req, next); expect(next.handle).toHaveBeenCalledWith(intercepted); }); it('should not intercept', () => { const req = new HttpRequest('GET', 'apiUrl/path'); interceptor.intercept(req, next); expect(next.handle).toHaveBeenCalledWith(req); }); });
#!/usr/local/bin/bash # # spamfilter.sh # # Simple filter to plug SpamAssassin into the Postfix MTA # # Modified by Jeremy Morton # # This script should probably live at /usr/bin/spamfilter.sh # ... and have 'chown root:root' and 'chmod 755' applied to it. # # For use with: # Postfix 20010228 or later # SpamAssassin 2.42 or later # Note: Modify the file locations to suit your particular # server and installation of SpamAssassin. # File locations: # (CHANGE AS REQUIRED TO SUIT YOUR SERVER) SENDMAIL=/usr/sbin/sendmail SPAMASSASSIN=/usr/local/bin/spamc logger <<<"Spam filter piping to SpamAssassin, then to: $SENDMAIL $@" ${SPAMASSASSIN} | ${SENDMAIL} "$@" exit $?
#!/bin/bash # No grep -oE support on Solaris if [ "$(uname)" = "SunOS" ] then exit 0 fi # sed -r on Linux, sed -E on MacOSX sed_extended_regex_switch="-r" if [ "$(uname)" = "Darwin" ] then sed_extended_regex_switch="-E" fi # Path is relative to the directory path of this script, usually /packaging/ xtreemfs_version_management_files="../java/xtreemfs-foundation/src/main/java/org/xtreemfs/foundation/VersionManagement.java:RELEASE_VERSION ../cpp/include/libxtreemfs/version_management.h:XTREEMFS_VERSION_STRING" xtreemfs_release_names=" 1.0|Jelly Donut 1.1|Hot Tamales 1.2|Luscious Lebkuchen 1.3|Tasty Tartlet 1.4|Salty Sticks 1.5|Wonderful Waffles " function display_usage() { cat <<EOF Usage: ./set-version.sh [option] where option may be -i Prompt for new version from stdin. If found, the release name will be appended in parentheses. -n <version> Set <version> to new version string. If found, the release name will be appended in parentheses. -s Generate version string from SVN revision obtained from "svn info" EOF } # Updates the version information in the package files. Only executed if started with -n or -i. function update_version_macos_packaging() { version="$1" package_files="../packaging/macosx/XtreemFS_MacOSX_Package.pmdoc/01mount.xml ../packaging/macosx/XtreemFS_MacOSX_Package.pmdoc/02mkfs.xml ../packaging/macosx/XtreemFS_MacOSX_Package.pmdoc/03rmfs.xml ../packaging/macosx/XtreemFS_MacOSX_Package.pmdoc/04lsfs.xml ../packaging/macosx/XtreemFS_MacOSX_Package.pmdoc/05uninstall.xml ../packaging/macosx/XtreemFS_MacOSX_Package.pmdoc/06xtreemfs.xml ../packaging/macosx/XtreemFS_MacOSX_Package.pmdoc/07xtfsutil.xml" if [ "$(uname)" != "Darwin" ] then # Skip editing the MacOSX files if we aren't on a MacOSX system. return fi for file in $package_files do file="${path_to_packaging_directory}/${file}" # Retrieve current version current_version=$(grep "<version>" "$file" | sed $sed_extended_regex_switch -e "s|^.*<version>(.*)</version>.*$|\1|") # Change version if [ "$current_version" != "$version" ] then #echo "Replacing current version: $current_version with new version string: $version" if [ "$(uname)" = "Darwin" ] then sed -i '' "s|<version>$current_version</version>|<version>$version</version>|" $file else sed -i "s|<version>$current_version</version>|<version>$version</version>|" $file fi fi done } function update_version() { version_string="$1" add_svn_revision_only="$2" for entry in $xtreemfs_version_management_files do file=$(echo "$entry" | cut -d: -f1) file="${path_to_packaging_directory}/${file}" keyword=$(echo "$entry" | cut -d: -f2) # DEBUG: #svn revert "$file" &>> /dev/null # Check first if key word exists in version file grep "$keyword" "$file" >> /dev/null if [ $? -ne 0 ] then echo "No key word \"$keyword\" found in file $file, so the version could not get adjusted there." continue fi # Retrieve current version current_version=$(grep "$keyword" "$file" | grep -oE "\".*\"" | tr -d '"') if [ -n "$add_svn_revision_only" ] then current_version=$(echo "$current_version" | sed $sed_extended_regex_switch -e "s|^.*-?trunk|trunk|") echo "$current_version" "$version_string" fi # Change version if [ "$current_version" != "$version_string" ] then if [ -n "$add_svn_revision_only" ] then #echo "Replacing trunk with new version string: $version_string" if [ "$(uname)" = "Darwin" ] then sed -i '' "s/$current_version\"/$version_string\"/" $file else sed -i "s/$current_version\"/$version_string\"/" $file fi else #echo "Replacing current version: $current_version with new version string: $version_string" if [ "$(uname)" = "Darwin" ] then sed -i '' "s/\"$current_version\"/\"$version_string\"/" $file else sed -i "s/\"$current_version\"/\"$version_string\"/" $file fi fi if [ $? -ne 0 ] then echo "Failed to run sed on file: $file" fi # else # echo "No need to replace: $current_version with: $version_string" fi done } function find_releasename() { local version="$1" # Strip last version number until there is no number left release_name_found=0 while [ $release_name_found -eq 0 ] do # Abort version detection for single version numbers (e.g. "1") as it would match every version numbers=$(echo "$version" | awk -F. '{ print NF }') if [ $numbers -lt 2 ] then break fi IFS=' ' for line in $xtreemfs_release_names do # Skip empty lines if [ -z "$line" ] then continue fi number=$(echo "$line" | cut -f1 -d\|) release=$(echo "$line" | cut -f2 -d\|) echo "$number" | grep -E "^$version$" >> /dev/null if [ $? -eq 0 ] then echo $release release_name_found=1 break fi done unset IFS version=`echo "$version" | sed $sed_extended_regex_switch -e "s|\.?[0-9]$||"` done } function check_version_format() { local version="$1" echo "$version" | grep -E "^[1-9]\.([0-9]|[1-9][0-9]+)(\.([0-9]|[1-9][0-9]+))?(\.([89][0-9]))?$" >> /dev/null if [ $? -ne 0 ] then echo "Invalid version entered: $version" echo display_usage exit 2 fi } # main() if [ -z "$1" ] then display_usage exit 1 fi path_to_packaging_directory=$(dirname "$0") case "$1" in -i) while [ -z "$version" ] do cat << EOF Please enter the new version. Format: 1.x.y(.z) x stands for feature and y for stable releases. z is optional and may be in the following ranges: .80+ = beta releases .90+ = release candidates Known release names, which will be automatically appended in parentheses, are: EOF IFS=' ' for line in $xtreemfs_release_names do # Skip empty lines [ -z "$line" ] && continue number=$(echo "$line" | cut -f1 -d\|) release=$(echo "$line" | cut -f2 -d\|) echo "- starting with $number: $release" done unset IFS echo echo -n "enter new version: " read version done check_version_format "$version" releasename=$(find_releasename "$version") if [ -z "$releasename" ] then version_string=$version else version_string="$version ($releasename)" fi update_version "$version_string" update_version_macos_packaging "$version" echo "Changed version string to: $version_string" ;; -n) if [ -z "$2" ] then echo "No version entered as second parameter." echo display_usage exit 1 fi version="$2" check_version_format "$version" releasename=$(find_releasename "$2") if [ -z "$releasename" ] then version_string=$version else version_string="$version ($releasename)" fi update_version "$version_string" update_version_macos_packaging "$version" echo "OK $version $releasename" ;; -s) svn_root="${path_to_packaging_directory}/.." svn info "$svn_root" &>/dev/null if [ $? -ne 0 ] then # silently stop here if no 'svn' is installed to retrieve branch and revision of the sources exit 0 fi revision=$(svn info "$svn_root" | grep ^Revision | awk '{ print $2 }') svn_url=$(svn info "$svn_root" | grep ^URL) # Do not modify the version of a release located in tags/ if [ -n "$(echo "$svn_url" | grep -E "http(s)?://xtreemfs.googlecode.com/svn/tags/")" ] then exit 0 fi trunk_or_branch=$(echo "$svn_url" | sed $sed_extended_regex_switch -e "s|URL:[ \t]+http(s)?://xtreemfs.googlecode.com/svn/(branches/)?||") if [ "$trunk_or_branch" = "trunk" ] then version_string="trunk-svn-r${revision}" update_version "$version_string" "replace-trunk-only" else version_string="${trunk_or_branch} svn-r${revision}" update_version "$version_string" fi ;; *) echo "Unknown option: $1" echo display_usage exit 1 ;; esac
#!/bin/bash # pe-test file=${1} svtk pe-test ${file}_short_diploidSV.standardize.vcf ${file}_discfile.gz ${file}_pe
<gh_stars>1-10 in_array = function(array, e) { for (var i = 0; i < array.length && array[i] !== e; i++); return !(i === array.length); }; exports.Eval = function() { var scope; var original_scope = { find_v: function(id) { var e = this, o; while (true) { o = e.v[id]; if (o) { return o; } e = e.parent; if (!e) { return null; } } }, find_f: function(id) { var e = this, o; while (true) { o = e.f[id]; if (o) { return o; } e = e.parent; if (!e) { throw 'Undefined function ' + id + '()'; } } }, def_f: function(id, value) { var o = this.f[id]; if (o) { throw 'Redefine function ' + id + '()'; } this.f[id] = { id: id, value: value }; return this.f[id]; }, def_v: function(id, value) { this.v[id] = { id: id, value: value }; return this.v[id]; }, pop: function() { scope = this.parent; } }; var new_scope = function() { var s = scope; scope = Object.create(original_scope); scope.v = {}; scope.f = {}; scope.parent = s; scope.v['__CONTROL'] = { id: '__CONTROL', value: null }; scope.v['__rtn'] = { id: '__rtn', value: undefined }; return scope; }; var matchEval = function(tree) { switch (tree.arity) { case 'binary': return eval_bina(tree); case 'ternary': return eval_terna(tree); case 'unary': return eval_una(tree); case 'statement': return eval_stmt(tree); case 'name': return scope.find_v(tree.value); case 'fname': return scope.find_f(tree.value); case 'literal': return tree.value; default: throw 'Unknown arity: ' + tree.arity; } }; var eval_stmts = function(tree) { for (var i = 0; i < tree.length; i++) { matchEval(tree[i]); if ( scope.find_v('__CONTROL').value === 'BREAK' || scope.find_v('__CONTROL').value === 'CONTINUE' ) { break; } } }; var eval_bina = function(tree) { switch (tree.value) { case '+': return getValue(tree.first) + getValue(tree.second); case '-': return getValue(tree.first) - getValue(tree.second); case '*': return getValue(tree.first) * getValue(tree.second); case '/': return getValue(tree.first) / getValue(tree.second); case '%': return getValue(tree.first) % getValue(tree.second); case '&&': return getValue(tree.first) && getValue(tree.second); case '||': return getValue(tree.first) || getValue(tree.second); case '==': return getValue(tree.first) === getValue(tree.second); case '!=': return getValue(tree.first) !== getValue(tree.second); case '<=': return getValue(tree.first) <= getValue(tree.second); case '>=': return getValue(tree.first) >= getValue(tree.second); case '<': return getValue(tree.first) < getValue(tree.second); case '>': return getValue(tree.first) > getValue(tree.second); case '=': if (matchEval(tree.first) === null) { scope.def_v(tree.first.value, 0); } return (matchEval(tree.first).value = getValue(tree.second)); case '+=': if (matchEval(tree.first) === null) { throw 'Undefined variable ' + tree.first.value; } return (matchEval(tree.first).value += getValue(tree.second)); case '-=': if (matchEval(tree.first) === null) { throw 'Undefined variable ' + tree.first.value; } return (matchEval(tree.first).value -= getValue(tree.second)); case '[': return getValue(tree.first)[getValue(tree.second)]; case 'in': return in_array(getValue(tree.second), getValue(tree.first)); case '(': return eval_func(tree); default: throw 'Unknown operator: ' + tree.value; } }; var eval_func = function(tree) { var func = matchEval(tree.first).value; var args = []; for (var i = 0; i < tree.second.length; i++) { args.push(getValue(tree.second[i])); } return func(args); }; var eval_terna = function(tree) { switch (tree.value) { case '?': return getValue(tree.first) ? getValue(tree.second) : getValue(tree.third); default: throw 'Unknown operator: ' + tree.value; } }; var eval_una = function(tree) { var list = []; var dic = {}; switch (tree.value) { case '!': return !getValue(tree.first); case '-': return -getValue(tree.first); case '[': for (var i = 0; i < tree.first.length; i++) { list.push(getValue(tree.first[i])); } return list; case '{': for (var i = 0; i < tree.first.length; i++) { dic[tree.first[i].key] = getValue(tree.first[i]); } return dic; default: throw 'Unknown operator: ' + tree.value; } }; var eval_stmt = function(tree) { switch (tree.value) { case 'def': return eval_def(tree); case 'while': return eval_while(tree); case 'if': return eval_if(tree); case 'for': return eval_for(tree); case 'break': return eval_break(tree); case 'continue': return eval_continue(tree); case 'return': return eval_return(tree); default: throw 'Unknown statement: ' + tree.value; } }; var eval_def = function(tree) { var func = function(args) { var rtn; new_scope(); for (var i = 0; i < tree.first.length; i++) { scope.def_v(tree.first[i].value, args[i]); } eval_stmts(tree.second); rtn = scope.find_v('__rtn').value; scope.pop(); if (rtn !== undefined) { return rtn; } }; scope.def_f(tree.name, func); }; var eval_while = function(tree) { while (getValue(tree.first)) { new_scope(); eval_stmts(tree.second); if (scope.find_v('__CONTROL').value === 'BREAK') { scope.pop(); break; } scope.pop(); } }; var eval_if = function(tree) { if (getValue(tree.first)) { eval_stmts(tree.second); } else if (tree.third !== null) { if (tree.third.value === 'elif') { eval_if(tree.third); } else { eval_stmts(tree.third); } } }; var eval_for = function(tree) { if (tree.first.value !== 'in') { throw 'Unknown for statement'; } var o = getValue(tree.first.second); // for (var index = 0; index < o.length; index++) { for (var index in o) { new_scope(); scope.def_v(tree.first.first.value, o[index]); eval_stmts(tree.second); if (scope.find_v('__CONTROL').value === 'BREAK') { scope.pop(); break; } scope.pop(); } }; var eval_break = function(tree) { scope.def_v('__CONTROL', 'BREAK'); }; var eval_continue = function(tree) { scope.def_v('__CONTROL', 'CONTINUE'); }; var eval_return = function(tree) { var first = matchEval(tree.first); var value = first.value ? first.value : first; scope.find_v('__rtn').value = value; }; var set_print = function() { var func = function(args) { if (args.length !== 1) { throw 'Unexpected arguments in print()'; } console.log(args[0]); }; scope.def_f('print', func); }; // var set_input = function() { // var func = function(args) { // if (args !== null || args !== undefined) { // throw("Unexpected arguments in input()"); // } // var input = readlineSync.question(); // return input; // } // } var set_range = function() { var func = function(args) { if (args.length === 1) { var list = []; for (var i = 0; i < args[0]; i++) { list.push(i); } return list; } else if (args.length < 4 && args.length > 1) { var list = []; var gap = args[2] ? args[2] : 1; for (var i = args[0]; i < args[1]; i += gap) { list.push(i); } return list; } else { throw 'Unexpected arguments in range()'; } }; scope.def_f('range', func); }; var set_builtin = function() { set_print(); set_range(); }; var getValue = function(tree) { var sec = matchEval(tree); if (sec === null) { throw 'Undefined variable ' + tree.value; } else if (sec.value === null || sec.value === undefined) { return sec; } else { return sec.value; } }; return function(tree) { new_scope(); set_builtin(); eval_stmts(tree); scope.pop(); }; };
<filename>Basil/include/Platform/OpenGL/OpenGLTexture2D.h /* * This header files declares the OpenGL implementation of Texture2D. */ #pragma once #include "Renderer/Texture2D.h" #include <glad/glad.h> namespace Basil { class OpenGLTexture2D : public Texture2D { public: OpenGLTexture2D(const std::string& path); OpenGLTexture2D(uint32_t width, uint32_t height); ~OpenGLTexture2D(); uint32_t getWidth() const override; uint32_t getHeight() const override; uint32_t getRendererID() const override; void setData(void* data, uint32_t size) override; void bind(unsigned int slot = 0) const override; bool isTextureLoaded() const override; bool operator==(const Texture& other) const override; private: std::string path; bool isLoaded; uint32_t width; uint32_t height; uint32_t rendererID; GLenum internalFormat; GLenum dataFormat; }; }
<reponame>Evgeniy-Polyak/CSharp.HelperPlus<gh_stars>0 import * as vscode from 'vscode'; import { DependencyInjector } from './inject-dependency'; import { FileCreator } from './file-creator'; import { CodeEmbed } from './code-embed'; import { NamespaceFixer } from './namespace-fixer'; import { MethodAsyncToggler } from './method-async-toggler'; import { FilenameFixer } from './filename-fixer'; export function activate(context: vscode.ExtensionContext) { const injector = new DependencyInjector() context.subscriptions.push(vscode.commands.registerCommand('csharp-helper-plus.inject-dependency', injector.inject)); const fileCreator = new FileCreator(); context.subscriptions.push(vscode.commands.registerCommand('csharp-helper-plus.create-class', fileCreator.createClass)); context.subscriptions.push(vscode.commands.registerCommand('csharp-helper-plus.create-interface', fileCreator.createInterface)); context.subscriptions.push(vscode.commands.registerCommand('csharp-helper-plus.create-enum', fileCreator.createEnum)); context.subscriptions.push(vscode.commands.registerCommand('csharp-helper-plus.create-test', fileCreator.createTest)); const codeEmbed = new CodeEmbed(); context.subscriptions.push(vscode.commands.registerCommand('csharp-helper-plus.embed-code', codeEmbed.embedCode)); const namespaceFixer = new NamespaceFixer(); context.subscriptions.push(vscode.commands.registerCommand('csharp-helper-plus.fix-namespace', namespaceFixer.fix)); const filenameFixer = new FilenameFixer(); context.subscriptions.push(vscode.commands.registerCommand('csharp-helper-plus.fix-filename', filenameFixer.fix)); const methodAsyncToggler = new MethodAsyncToggler(); context.subscriptions.push(vscode.commands.registerCommand('csharp-helper-plus.toggle-method-sync', methodAsyncToggler.toggle)); } export function deactivate() { }
package compliance import ( "crypto/sha256" "encoding/json" "strconv" "time" ) // GenerateNonce generates a nonce and assigns it to `Nonce` field. // It does not have to be crypto random. We just want two attachments // always have a different hashes. func (attachment *Attachment) GenerateNonce() { attachment.Nonce = strconv.FormatInt(time.Now().UnixNano(), 10) } // Hash returns sha-256 hash of the JSON marshalled attachment. func (attachment *Attachment) Hash() ([32]byte, error) { marshalled, err := attachment.Marshal() if err != nil { return [32]byte{}, err } return sha256.Sum256(marshalled), nil } // Marshal marshals Attachment func (attachment *Attachment) Marshal() ([]byte, error) { return json.Marshal(attachment) }
#!/bin/bash set -e cd `dirname ${0}` source common_code OUT=$(mktemp /tmp/output.XXXXXXXXXX) || { echo "Failed to create temp file"; exit 1; } # Get year default_year=$(date +"%Y") if [[ ! -z $DOD_YEAR ]] ; then year="$DOD_YEAR" else # We assume the current year (and also assume bash 3, because macs) read -p "Enter your event year (default: $default_year): " year fi [ -z "${year}" ] && year="$default_year" # Get city if [[ ! -z $DOD_CITY ]] ; then city="$DOD_CITY" else read -p "Enter your city name: " city fi city_slug=$(echo $city | tr '-' ' ' | tr -dc '[:alpha:][:blank:]' | tr '[:upper:]' '[:lower:]'| tr 'āáǎàãâēéěèīíǐìōóǒòöūúǔùǖǘǚǜü' 'aaaaaaeeeeiiiiooooouuuuuuuuu' | tr ' ' '-') # Generate event slug event_slug=$year-$city_slug # Create necessary directories mkdir -p ../static/events/$event_slug/organizers # Set the creation date to current timestamp datestamp=$(date +%Y-%m-%dT%H:%M:%S%z | sed 's/^\(.\{22\}\)/\1:/') # Prompt for inputting organizers while true; do echo "What would you like to do?" echo "1. Add info for an organizer" echo "2. View organizers thus far" echo "3. Exit" echo echo -n "Enter your choice: " read choice echo case $choice in 1) ################# # Organizer entry ################# read -p "Enter organizer name: " organizername organizer_slug=$(echo $organizername | tr -dc '[:alpha:][:blank:]' | tr '[:upper:]' '[:lower:]'| tr 'āáǎàãâēéěèīíǐìōóǒòöūúǔùǖǘǚǜü' 'aaaaaaeeeeiiiiooooouuuuuuuuu' | tr ' ' '-') # employer read -p "Enter organizer's employer (return to skip): " employer [ -z "${employer}" ] && employer="" # twitter handle read -p "Enter organizer twitter handle (return to skip): " twitter [ -z "${twitter}" ] && twitter='' # remove @ if they added it twitter=$(echo $twitter | sed 's/@//') # bio read -p "Enter organizer bio (return to skip): " bio [ -z "${bio}" ] && bio="" ####################### # Set organizer image ####################### read -p "Enter path to organizer image as jpg (return to skip): " organizerimage [ -z "${organizerimage}" ] && organizerimage='' if [ $organizerimage ]; then cp "$organizerimage" ../static/events/$event_slug/organizers/$organizer_slug.jpg else echo "Put organizer image at ../static/events/$event_slug/organizers/$organizer_slug.jpg before creating the pull request, if desired." fi #################### # Populate data file #################### echo " - name: \"$organizername\" employer: \"$employer\" twitter: \"$twitter\" bio: \"$bio\"" >> $OUT if [ $organizerimage ]; then echo " image: \"$organizer_slug.jpg\"" >> $OUT fi ;; 2) cat "$OUT" ;; 3) echo "Add to ../data/events/$event_slug.yml under team_members: " cat "$OUT" break ;; *) echo "Invalid choice. Choose a number from 1 to 3." ;; esac done rm $OUT
<reponame>wongoo/alipay-sdk-java-all package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 设备服务信息 * * @author auto create * @since 1.0, 2021-04-07 19:21:32 */ public class DeviceServiceBaseVO extends AlipayObject { private static final long serialVersionUID = 8137118262688838937L; /** * 设备别名 */ @ApiField("alias_name") private String aliasName; /** * 图标 */ @ApiField("icon") private String icon; /** * 节点类型 0为网关设备。1.为mesh子设备。2为除网关类的其他直连设备。3为外设 */ @ApiField("node_type") private Long nodeType; /** * 产品名称 */ @ApiField("product_name") private String productName; /** * 设备在线状态 0为离线。1为在线 */ @ApiField("status") private String status; /** * xpId */ @ApiField("xp_id") private String xpId; public String getAliasName() { return this.aliasName; } public void setAliasName(String aliasName) { this.aliasName = aliasName; } public String getIcon() { return this.icon; } public void setIcon(String icon) { this.icon = icon; } public Long getNodeType() { return this.nodeType; } public void setNodeType(Long nodeType) { this.nodeType = nodeType; } public String getProductName() { return this.productName; } public void setProductName(String productName) { this.productName = productName; } public String getStatus() { return this.status; } public void setStatus(String status) { this.status = status; } public String getXpId() { return this.xpId; } public void setXpId(String xpId) { this.xpId = xpId; } }
def parse_settings(settings_list): settings_dict = {} for setting in settings_list: category, setting_info = setting.split('-') setting_name, setting_property = setting_info.split('-') if '-' in setting_info else (setting_info, '') if category in settings_dict: settings_dict[category].append((setting_name, setting_property)) else: settings_dict[category] = [(setting_name, setting_property)] return settings_dict
#!/usr/bin/env bash set -e [ "$DEBUG" == 'true' ] && set -x DAEMON=sshd echo "> Starting SSHD" # Copy default config from cache, if required if [ ! "$(ls -A /etc/ssh)" ]; then cp -a /etc/ssh.cache/* /etc/ssh/ fi set_hostkeys() { printf '%s\n' \ 'set /files/etc/ssh/sshd_config/HostKey[1] /etc/ssh/keys/ssh_host_rsa_key' \ 'set /files/etc/ssh/sshd_config/HostKey[3] /etc/ssh/keys/ssh_host_ecdsa_key' \ 'set /files/etc/ssh/sshd_config/HostKey[4] /etc/ssh/keys/ssh_host_ed25519_key' \ | augtool -s 1> /dev/null } print_fingerprints() { local BASE_DIR=${1-'/etc/ssh'} for item in rsa ecdsa ed25519; do echo ">>> Fingerprints for ${item} host key" ssh-keygen -E md5 -lf ${BASE_DIR}/ssh_host_${item}_key ssh-keygen -E sha256 -lf ${BASE_DIR}/ssh_host_${item}_key ssh-keygen -E sha512 -lf ${BASE_DIR}/ssh_host_${item}_key done } check_authorized_key_ownership() { local file="$1" local _uid="$2" local _gid="$3" local uid_found="$(stat -c %u ${file})" local gid_found="$(stat -c %g ${file})" if ! ( [[ ( "$uid_found" == "$_uid" ) && ( "$gid_found" == "$_gid" ) ]] || [[ ( "$uid_found" == "0" ) && ( "$gid_found" == "0" ) ]] ); then echo "WARNING: Incorrect ownership for ${file}. Expected uid/gid: ${_uid}/${_gid}, found uid/gid: ${uid_found}/${gid_found}. File uid/gid must match SSH_USERS or be root owned." fi } # Generate Host keys, if required if ls /etc/ssh/keys/ssh_host_* 1> /dev/null 2>&1; then echo ">> Found host keys in keys directory" set_hostkeys print_fingerprints /etc/ssh/keys elif ls /etc/ssh/ssh_host_* 1> /dev/null 2>&1; then echo ">> Found Host keys in default location" # Don't do anything print_fingerprints else echo ">> Generating new host keys" mkdir -p /etc/ssh/keys ssh-keygen -A mv /etc/ssh/ssh_host_* /etc/ssh/keys/ set_hostkeys print_fingerprints /etc/ssh/keys fi # Fix permissions, if writable. # NB ownership of /etc/authorized_keys are not changed if [ -w ~/.ssh ]; then chown root:root ~/.ssh && chmod 700 ~/.ssh/ fi if [ -w ~/.ssh/authorized_keys ]; then chown root:root ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys fi if [ -w /etc/authorized_keys ]; then chown root:root /etc/authorized_keys chmod 755 /etc/authorized_keys # test for writability before attempting chmod for f in $(find /etc/authorized_keys/ -type f -maxdepth 1); do [ -w "${f}" ] && chmod 644 "${f}" done fi # Add users if SSH_USERS=user:uid:gid set if [ -n "${SSH_USERS}" ]; then USERS=$(echo $SSH_USERS | tr "," "\n") for U in $USERS; do IFS=':' read -ra UA <<< "$U" _NAME=${UA[0]} _UID=${UA[1]} _GID=${UA[2]} if [ ${#UA[*]} -ge 4 ]; then _SHELL=${UA[3]} else _SHELL='' fi echo ">> Adding user ${_NAME} with uid: ${_UID}, gid: ${_GID}, shell: ${_SHELL:-<default>}." if [ ! -e "/etc/authorized_keys/${_NAME}" ]; then echo "WARNING: No SSH authorized_keys found for ${_NAME}!" else check_authorized_key_ownership /etc/authorized_keys/${_NAME} ${_UID} ${_GID} fi getent group ${_NAME} >/dev/null 2>&1 || groupadd -g ${_GID} ${_NAME} getent passwd ${_NAME} >/dev/null 2>&1 || useradd -r -m -p '' -u ${_UID} -g ${_GID} -s ${_SHELL:-""} -c 'SSHD User' ${_NAME} done else # Warn if no authorized_keys if [ ! -e ~/.ssh/authorized_keys ] && [ ! "$(ls -A /etc/authorized_keys)" ]; then echo "WARNING: No SSH authorized_keys found!" fi fi # Unlock root account, if enabled if [[ "${SSH_ENABLE_ROOT}" == "true" ]]; then echo ">> Unlocking root account" usermod -p '' root else echo "INFO: root account is now locked by default. Set SSH_ENABLE_ROOT to unlock the account." fi # Update MOTD if [ -v MOTD ]; then echo -e "$MOTD" > /etc/motd fi # PasswordAuthentication (disabled by default) if [[ "${SSH_ENABLE_PASSWORD_AUTH}" == "true" ]]; then echo 'set /files/etc/ssh/sshd_config/PasswordAuthentication yes' | augtool -s 1> /dev/null echo "WARNING: password authentication enabled." else echo 'set /files/etc/ssh/sshd_config/PasswordAuthentication no' | augtool -s 1> /dev/null echo "INFO: password authentication is disabled by default. Set SSH_ENABLE_PASSWORD_AUTH=true to enable." fi configure_sftp_only_mode() { echo "INFO: configuring sftp only mode" : ${SFTP_CHROOT:='/data'} chown 0:0 ${SFTP_CHROOT} chmod 755 ${SFTP_CHROOT} printf '%s\n' \ 'set /files/etc/ssh/sshd_config/Subsystem/sftp "internal-sftp"' \ 'set /files/etc/ssh/sshd_config/AllowTCPForwarding no' \ 'set /files/etc/ssh/sshd_config/GatewayPorts no' \ 'set /files/etc/ssh/sshd_config/X11Forwarding no' \ 'set /files/etc/ssh/sshd_config/ForceCommand internal-sftp' \ "set /files/etc/ssh/sshd_config/ChrootDirectory ${SFTP_CHROOT}" \ | augtool -s 1> /dev/null } configure_scp_only_mode() { echo "INFO: configuring scp only mode" USERS=$(echo $SSH_USERS | tr "," "\n") for U in $USERS; do _NAME=$(echo "${U}" | cut -d: -f1) usermod -s '/usr/bin/rssh' ${_NAME} done (grep '^[a-zA-Z]' /etc/rssh.conf.default; echo "allowscp") > /etc/rssh.conf } configure_rsync_only_mode() { echo "INFO: configuring rsync only mode" USERS=$(echo $SSH_USERS | tr "," "\n") for U in $USERS; do _NAME=$(echo "${U}" | cut -d: -f1) usermod -s '/usr/bin/rssh' ${_NAME} done (grep '^[a-zA-Z]' /etc/rssh.conf.default; echo "allowrsync") > /etc/rssh.conf } configure_ssh_options() { # Enable AllowTcpForwarding if [[ "${TCP_FORWARDING}" == "true" ]]; then echo 'set /files/etc/ssh/sshd_config/AllowTcpForwarding yes' | augtool -s 1> /dev/null fi # Enable GatewayPorts if [[ "${GATEWAY_PORTS}" == "true" ]]; then echo 'set /files/etc/ssh/sshd_config/GatewayPorts yes' | augtool -s 1> /dev/null fi # Disable SFTP if [[ "${DISABLE_SFTP}" == "true" ]]; then printf '%s\n' \ 'rm /files/etc/ssh/sshd_config/Subsystem/sftp' \ 'rm /files/etc/ssh/sshd_config/Subsystem' \ | augtool -s 1> /dev/null fi } # Configure mutually exclusive modes if [[ "${SFTP_MODE}" == "true" ]]; then configure_sftp_only_mode elif [[ "${SCP_MODE}" == "true" ]]; then configure_scp_only_mode elif [[ "${RSYNC_MODE}" == "true" ]]; then configure_rsync_only_mode else configure_ssh_options fi # Run scripts in /etc/entrypoint.d for f in /etc/entrypoint.d/*; do if [[ -x ${f} ]]; then echo ">> Running: ${f}" ${f} fi done stop() { echo "Received SIGINT or SIGTERM. Shutting down $DAEMON" # Get PID local pid=$(cat /var/run/$DAEMON/$DAEMON.pid) # Set TERM kill -SIGTERM "${pid}" # Wait for exit wait "${pid}" # All done. echo "Done." } echo "Running $@" if [ "$(basename $1)" == "$DAEMON" ]; then trap stop SIGINT SIGTERM $@ & pid="$!" mkdir -p /var/run/$DAEMON && echo "${pid}" > /var/run/$DAEMON/$DAEMON.pid wait "${pid}" exit $? else exec "$@" fi
package com.lewisallen.rtdptiCache.repositories; import com.lewisallen.rtdptiCache.models.Timetable; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; import java.util.Optional; public interface TimetableRepository extends JpaRepository<Timetable, Long> { Optional<Timetable> findTimetableByData(String timetabledata); List<Timetable> findAllByOrderByLastUsedDateDesc(); }
#!/bin/bash # Script to use dolphine to open Downloads dolphin /home/liu/Downloads
<reponame>ksattler/piglet package dbis.setm import etm.core.configuration.BasicEtmConfigurator import etm.core.configuration.EtmManager import etm.core.renderer.{MeasurementRenderer, SimpleTextRenderer} /** * SETM is a simple wrapper for JETM to provide a * more Scala-like usage. * * See http://jetm.void.fm/ */ object SETM { BasicEtmConfigurator.configure(true) // nested private val monitor = EtmManager.getEtmMonitor() // Start monitoring monitor.start() var quiet: Boolean = false def enable = monitor.enableCollection() def disable = monitor.disableCollection() /* * Stop monitoring, collect results and render them * * @param renderer The renderer to use */ def collect() = { monitor.render(new SimpleTextRenderer()) monitor.stop() } /** * Measure execution time of the given function * * @param name A human readable name to identify this timing measurement * @param f The function to measure execution time of */ def timing[T](name: String)(f: => T) = { val p = monitor.createPoint(name) if(!quiet) print(s"==> $name \r") try { f } finally { p.collect } } }
import java.util.*; public class Main { public static void main (String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = in.nextInt(); } int maximum = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (maximum < a[i] + a[j]) { maximum = a[i] + a[j]; } } } System.out.println("Maximum: "+ maximum); } }
<filename>app/components/Admin/Featured/TabsFeatured.js import React, { Component } from 'react'; import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'; import 'react-tabs/style/react-tabs.css'; import styled from 'styled-components'; import axios from 'axios'; import NumberFormat from 'react-number-format'; import ChartConf from './ChartConf'; import ChartRecov from './ChartRecov'; import ChartDea from './ChartDea'; const Value = styled.div` font-size: 32px; margin-top: 10px; @media screen and (max-width: 960px) { font-size: 16px; } `; class TabsFeatured extends Component { constructor(props) { super(props); this.state = { postsconfirmed: [], postsrecovered: [], postsdeaths: [], }; } componentDidMount() { axios .get('https://covid19.mathdro.id/api/countries/India') .then(response => { this.setState({ postsconfirmed: response.data.confirmed, postsrecovered: response.data.recovered, postsdeaths: response.data.deaths, }); }) .catch(error => { console.log(error); }); } render() { const { postsconfirmed, postsrecovered, postsdeaths } = this.state; // console.log("asd") return ( <Tabs> <TabList> <Tab> Confirmed - India <Value> <NumberFormat thousandSeparator displayType="text" value={postsconfirmed.value} /> </Value> </Tab> <Tab> Recovered - India <Value> <NumberFormat thousandSeparator displayType="text" value={postsrecovered.value} /> </Value> </Tab> <Tab> Deaths - India <Value> <NumberFormat thousandSeparator displayType="text" value={postsdeaths.value} /> </Value> </Tab> </TabList> <TabPanel> <ChartConf /> </TabPanel> <TabPanel> <ChartRecov /> </TabPanel> <TabPanel> <ChartDea /> </TabPanel> </Tabs> ); } } export default TabsFeatured;
<filename>src/SmartComponents/GlobalFilterAlert/GlobalFilterAlert.js import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Alert } from '@patternfly/react-core'; export class GlobalFilterAlert extends Component { constructor(props) { super(props); } isFilterSelected = (workloadsFilter) => { for (const workload in workloadsFilter) { if (workloadsFilter[workload].isSelected) { return true; } } return false; } buildBody = () => { const { sidsFilter, tagsFilter, workloadsFilter } = this.props.globalFilterState; let filters = ''; let first = true; for (const workload in workloadsFilter) { if (workloadsFilter[workload].isSelected) { if (!first) { filters = `${ filters }, ${ workload }`; } else { filters = `Workloads: ${ workload }`; first = false; } } } if (!first) { filters += '. '; } if (sidsFilter.length) { filters += 'SAP ID (SID): '; for (let i = 0; i < sidsFilter.length; i++) { filters += sidsFilter[i]; if (i + 1 === sidsFilter.length) { filters += '. '; } else { filters += ', '; } } } if (tagsFilter.length) { let tags = []; let tagsList = {}; filters += 'Tags: '; tagsFilter.forEach(function(tag) { tags.push(tag.split('/')); }); tags.forEach(function(tag) { if (!(tag[0] in tagsList)) { tagsList[tag[0]] = [ tag[1] ]; } else { tagsList[tag[0]].push(tag[1]); } }); for (const [ key, value ] of Object.entries(tagsList)) { filters += key + ': '; for (let i = 0; i < value.length; i++) { filters += value[i]; if (i + 1 === value.length) { filters += '. '; } else { filters += ', '; } } } } return filters; } render() { const { sidsFilter, tagsFilter, workloadsFilter } = this.props.globalFilterState; return ( <React.Fragment> { this.isFilterSelected(workloadsFilter) || sidsFilter.length > 0 || tagsFilter.length > 0 ? <Alert variant='info' title='Your systems are pre-filtered by the global context selector.' isInline > <p> { this.buildBody() } </p> </Alert> : null } </React.Fragment> ); } } GlobalFilterAlert.propTypes = { globalFilterState: PropTypes.object }; export default GlobalFilterAlert;
'use strict'; describe('rest-redis', function () { require('./test-connections'); require('./test-command'); });
<gh_stars>10-100 # #!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2009 <NAME>. All rights reserved. # """ """ #end_pymotw_header import sys print 'Initial limit:', sys.getrecursionlimit() sys.setrecursionlimit(10) print 'Modified limit:', sys.getrecursionlimit() def generate_recursion_error(i): print 'generate_recursion_error(%s)' % i generate_recursion_error(i+1) try: generate_recursion_error(1) except RuntimeError, err: print 'Caught exception:', err
<gh_stars>1-10 package fr.syncrase.ecosyst.aop.crawlers.service.wikipedia; import fr.syncrase.ecosyst.ClassificationMsApp; import fr.syncrase.ecosyst.domain.classification.CronquistClassificationBranch; import fr.syncrase.ecosyst.domain.crawler.wikipedia.WikipediaCrawler; import fr.syncrase.ecosyst.domain.classification.entities.IClassificationNom; import fr.syncrase.ecosyst.domain.classification.entities.ICronquistRank; import fr.syncrase.ecosyst.domain.classification.enumeration.RankName; import fr.syncrase.ecosyst.service.classification.CronquistService; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.io.IOException; import java.util.Set; import java.util.stream.Collectors; import static org.junit.Assert.*; @RunWith(SpringRunner.class) @SpringBootTest(classes = ClassificationMsApp.class) public class ScrapAndInsertClassificationIntegrationTest { WikipediaCrawler wikipediaCrawler; TestUtils utils = new TestUtils(); @Autowired private CronquistService cronquistService; public ScrapAndInsertClassificationIntegrationTest() { this.wikipediaCrawler = new WikipediaCrawler(cronquistService); } // @Test // public void lesNomsDeRangsIncoherentsNeSontPasPrisEnCompte() { // // // TODO en quoi les noms de rang sont incohérents ? // CronquistClassificationBranch classification; // try { // String wiki = "https://fr.wikipedia.org/wiki/Chironia"; // wiki = "https://fr.wikipedia.org/wiki/Chironia"; // classification = wikipediaCrawler.scrapWiki(wiki); // Collection<CronquistRank> chironiaRanks = cronquistService.saveCronquist(classification, wiki); // // wiki = "https://fr.wikipedia.org/wiki/Monodiella"; // classification = wikipediaCrawler.scrapWiki(wiki); // Collection<CronquistRank> monodiellaRanks = cronquistService.saveCronquist(classification, wiki); // // wiki = "https://fr.wikipedia.org/wiki/Aldrovanda"; // classification = wikipediaCrawler.scrapWiki(wiki); // Collection<CronquistRank> aldrovandaRanks = cronquistService.saveCronquist(classification, wiki); // // wiki = "https://fr.wikipedia.org/wiki/Amphorogyne";// Rosidae // classification = wikipediaCrawler.scrapWiki(wiki); // Collection<CronquistRank> amphorogyneRanks = cronquistService.saveCronquist(classification, wiki); // // } catch (IOException e) { // e.printStackTrace(); // } // } // @Test // public void enregistrementDUneClassificationAvecDeuxRangsSynonymesSuccessifs2() { // List<String> wikis = new ArrayList<>(); // wikis.add("https://fr.wikipedia.org/wiki/Bridgesia_incisifolia"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_de_Miyabe"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_de_Montpellier"); // // => vérifier la synonymie + les enfants ont bien été mergés // } // // @Test // public void testAvecToutConfonduDansTousLesSens() { // List<String> wikis = new ArrayList<>(); // wikis.add("https://fr.wikipedia.org/wiki/Acanthe"); // wikis.add("https://fr.wikipedia.org/wiki/Acanthe_%C3%A0_feuilles_molles"); // wikis.add("https://fr.wikipedia.org/wiki/Acanthus_spinosus"); // wikis.add("https://fr.wikipedia.org/wiki/Acer_campestre"); // wikis.add("https://fr.wikipedia.org/wiki/Acer_cappadocicum"); // wikis.add("https://fr.wikipedia.org/wiki/Acer_carpinifolium"); // wikis.add("https://fr.wikipedia.org/wiki/Acer_chaneyi"); // wikis.add("https://fr.wikipedia.org/wiki/Acer_circinatum"); // wikis.add("https://fr.wikipedia.org/wiki/Acer_davidii"); // wikis.add("https://fr.wikipedia.org/wiki/Acer_douglasense"); // wikis.add("https://fr.wikipedia.org/wiki/Acer_velutinum"); // wikis.add("https://fr.wikipedia.org/wiki/Aldrovanda"); // wikis.add("https://fr.wikipedia.org/wiki/Amphorogyne");// Rosidae // wikis.add("https://fr.wikipedia.org/wiki/Andrographis"); // wikis.add("https://fr.wikipedia.org/wiki/Andrographis_paniculata"); // wikis.add("https://fr.wikipedia.org/wiki/Anisacanthus"); // wikis.add("https://fr.wikipedia.org/wiki/Anisoptera_(v%C3%A9g%C3%A9tal)"); // wikis.add("https://fr.wikipedia.org/wiki/Anthobolus");// Rosidae // wikis.add("https://fr.wikipedia.org/wiki/Aphelandra"); // wikis.add("https://fr.wikipedia.org/wiki/Aphelandra_sinclairiana"); // wikis.add("https://fr.wikipedia.org/wiki/Arjona");// Rosidae// : merge branch // wikis.add("https://fr.wikipedia.org/wiki/Asystasia"); // wikis.add("https://fr.wikipedia.org/wiki/Asystasia_gangetica"); // wikis.add("https://fr.wikipedia.org/wiki/Atalaya_(genre)");// : merge branch // wikis.add("https://fr.wikipedia.org/wiki/Avicennia_germinans"); // wikis.add("https://fr.wikipedia.org/wiki/Barleria"); // wikis.add("https://fr.wikipedia.org/wiki/Barleria_cristata"); // wikis.add("https://fr.wikipedia.org/wiki/Barleria_obtusa"); // wikis.add("https://fr.wikipedia.org/wiki/Barleriola"); // wikis.add("https://fr.wikipedia.org/wiki/Blackstonia"); // wikis.add("https://fr.wikipedia.org/wiki/Blechum"); // wikis.add("https://fr.wikipedia.org/wiki/Bois_de_Judas");// Rosidae// : merge branch // wikis.add("https://fr.wikipedia.org/wiki/Bridgesia_incisifolia"); // wikis.add("https://fr.wikipedia.org/wiki/Buckleya"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_argent%C3%A9"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_%C3%A0_%C3%A9corce_de_papier"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_%C3%A0_%C3%A9pis"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_%C3%A0_cinq_folioles"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_%C3%A0_feuille_de_vigne"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_%C3%A0_feuilles_d%27obier"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_%C3%A0_grandes_feuilles"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_champ%C3%AAtre"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_de_Cappadoce"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_de_Cr%C3%A8te"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_de_Miyabe"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_de_Montpellier"); // wikis.add("https://fr.wikipedia.org/wiki/%C3%89rable_de_Pennsylvanie"); // wikis.add("https://fr.wikipedia.org/wiki/Carlowrightia"); // wikis.add("https://fr.wikipedia.org/wiki/Centaurium"); // wikis.add("https://fr.wikipedia.org/wiki/Cervantesia"); // wikis.add("https://fr.wikipedia.org/wiki/Chironia"); // wikis.add("https://fr.wikipedia.org/wiki/Corylopsis");// Synonymes // wikis.add("https://fr.wikipedia.org/wiki/Cossinia");// : merge branch // wikis.add("https://fr.wikipedia.org/wiki/Deinanthe"); // wikis.add("https://fr.wikipedia.org/wiki/Diatenopteryx_sorbifolia"); // wikis.add("https://fr.wikipedia.org/wiki/Dicliptera"); // wikis.add("https://fr.wikipedia.org/wiki/Dicliptera_suberecta"); // wikis.add("https://fr.wikipedia.org/wiki/Dipterocarpus"); // wikis.add("https://fr.wikipedia.org/wiki/Distylium");// Synonymes // wikis.add("https://fr.wikipedia.org/wiki/Eremophila_latrobei"); // wikis.add("https://fr.wikipedia.org/wiki/Eremophila_mitchellii"); // wikis.add("https://fr.wikipedia.org/wiki/Eremophila_nivea"); // wikis.add("https://fr.wikipedia.org/wiki/Eremophila_(plante)"); // wikis.add("https://fr.wikipedia.org/wiki/Graptophyllum"); // wikis.add("https://fr.wikipedia.org/wiki/Hemigraphis"); // wikis.add("https://fr.wikipedia.org/wiki/Huaceae"); // wikis.add("https://fr.wikipedia.org/wiki/Hygrophila_(plante)"); // wikis.add("https://fr.wikipedia.org/wiki/Hygrophila_polysperma"); // wikis.add("https://fr.wikipedia.org/wiki/Justicia_adhatoda"); // wikis.add("https://fr.wikipedia.org/wiki/Justicia_aurea"); // wikis.add("https://fr.wikipedia.org/wiki/Justicia_betonica"); // wikis.add("https://fr.wikipedia.org/wiki/Justicia_californica"); // wikis.add("https://fr.wikipedia.org/wiki/Justicia_carnea"); // wikis.add("https://fr.wikipedia.org/wiki/Justicia_gendarussa"); // wikis.add("https://fr.wikipedia.org/wiki/Justicia_spicigera"); // wikis.add("https://fr.wikipedia.org/wiki/Kielmeyera"); // wikis.add("https://fr.wikipedia.org/wiki/Lepisanthes_senegalensis"); // wikis.add("https://fr.wikipedia.org/wiki/Loropetalum"); // wikis.add("https://fr.wikipedia.org/wiki/Lyallia_kerguelensis"); // wikis.add("https://fr.wikipedia.org/wiki/Molinadendron"); // wikis.add("https://fr.wikipedia.org/wiki/Monodiella"); // wikis.add("https://fr.wikipedia.org/wiki/Odontonema"); // wikis.add("https://fr.wikipedia.org/wiki/Oxera_pulchella"); // wikis.add("https://fr.wikipedia.org/wiki/Phlogacanthus"); // wikis.add("https://fr.wikipedia.org/wiki/Phlogacanthus_turgidus"); // wikis.add("https://fr.wikipedia.org/wiki/Picanier_jaune"); // wikis.add("https://fr.wikipedia.org/wiki/Pseuderanthemum"); // wikis.add("https://fr.wikipedia.org/wiki/Ptychospermatinae"); // wikis.add("https://fr.wikipedia.org/wiki/Ruellia"); // wikis.add("https://fr.wikipedia.org/wiki/Ruellia_brevifolia"); // wikis.add("https://fr.wikipedia.org/wiki/Ruellia_chartacea"); // wikis.add("https://fr.wikipedia.org/wiki/Ruellia_devosiana"); // wikis.add("https://fr.wikipedia.org/wiki/Ruellia_geminiflora"); // wikis.add("https://fr.wikipedia.org/wiki/Ruellia_schnellii"); // wikis.add("https://fr.wikipedia.org/wiki/Ruellia_simplex"); // wikis.add("https://fr.wikipedia.org/wiki/Ruellia_tuberosa"); // wikis.add("https://fr.wikipedia.org/wiki/Sanchezia"); // wikis.add("https://fr.wikipedia.org/wiki/Strobilanthes_kunthiana"); // wikis.add("https://fr.wikipedia.org/wiki/Thunbergia"); // wikis.add("https://fr.wikipedia.org/wiki/Thunbergia_alata"); // wikis.add("https://fr.wikipedia.org/wiki/Thunbergia_erecta"); // wikis.add("https://fr.wikipedia.org/wiki/Thunbergia_fragrans"); // wikis.add("https://fr.wikipedia.org/wiki/Thunbergia_grandiflora"); // wikis.add("https://fr.wikipedia.org/wiki/Thunbergia_mysorensis"); // wikis.add("https://fr.wikipedia.org/wiki/Whitfieldia"); // wikis.add("https://fr.wikipedia.org/wiki/Whitfieldia_elongata"); // // => vérifier la synonymie + les enfants ont bien été mergés // } }
#!/usr/bin/env bash yum update -y aws-cfn-bootstrap yum install -y docker rsyslog echo 'OPTIONS="-p 2222"' > /etc/sysconfig/sshd systemctl restart sshd systemctl restart docker systemctl stop rpcbind systemctl disable rpcbind systemctl mask rpcbind systemctl stop rpcbind.socket systemctl disable rpcbind.socket echo -e 'module(load="imtcp")\ninput(type="imtcp" port="514" address="172.17.0.1")' > /etc/rsyslog.d/99_listen.conf systemctl daemon-reload systemctl restart rsyslog; wget -O /usr/bin/systemd-docker https://github.com/ibuildthecloud/systemd-docker/releases/download/v0.2.1/systemd-docker chmod 755 /usr/bin/systemd-docker echo "[Unit] Description=docker-passwd-pot After=network.target auditd.service docker.service Requires=docker.service [Service] EnvironmentFile=/etc/default/docker-passwd-pot TimeoutStartSec=0 Restart=always ExecStart=/usr/bin/systemd-docker run \$DOCKER_OPTS [Install] WantedBy=multi-user.target " > /etc/systemd/system/docker-passwd-pot.service if [ -z "$API_SERVER" ]; then API_SERVER="https://api.passwd-pot.io" fi dh=`curl -s http://169.254.169.254/latest/meta-data/public-hostname` PORTS="-p 22:2222 -p 127.0.0.1:6161:6161 -p 127.0.0.1:6060:6060 -p 80:8000 -p 21:2121 -p 8080:8000 -p 8000:8000 -p 8888:8000 -p 110:1110 -p 5432:5432" echo "SSHD_OPTS=\"-o Audit=yes -o MaxAuthTries=200 -o AuditSocket=/tmp/passwd.socket -o AuditUrl=http://${API_SERVER}\"" > /etc/default/docker-passwd-pot echo "PASSWD_POT_OPTS=\" --all --bind 0.0.0.0 --syslog 172.17.0.1:514 --server https://$API_SERVER --logz $LOGZ\"" >> /etc/default/docker-passwd-pot echo "PASSWD_POT_SOCKET_OPTS=\"--duration 30m --syslog 172.17.0.1:514 --server https://$API_SERVER --socket /tmp/passwd.socket --logz $LOGZ\"" >> /etc/default/docker-passwd-pot echo "DOCKER_OPTS=\"-e SSHD_OPTS -e PASSWD_POT_OPTS -e PASSWD_POT_SOCKET_OPTS $PORTS --hostname=$dh --rm --name docker-passwd-pot $IMAGE\"" >> /etc/default/docker-passwd-pot systemctl daemon-reload systemctl start docker-passwd-pot sleep 10 systemctl status docker-passwd-pot
<reponame>zrwusa/expo-bunny<filename>src/screens/DemoDating/Settings/industries.ts export const industries = [ { 'industry': { 'industryId': '1', 'industryName': 'Aerospace and Defense' }, 'subIndustries': [ { 'industryId': '1_1', 'industryName': 'Aerospace Products and Parts' }, { 'industryId': '1_2', 'industryName': 'Aerospace Research and Development' }, { 'industryId': '1_3', 'industryName': 'Aircraft Manufacturing' }, { 'industryId': '1_4', 'industryName': 'Military Vehicles Manufacturing' }, { 'industryId': '1_5', 'industryName': 'Ordnance, Missiles, Weaponry and Related' }, { 'industryId': '1_6', 'industryName': 'Space Vehicles, Satellites and Related' } ] }, { 'industry': { 'industryId': '2', 'industryName': 'Agriculture and Forestry' }, 'subIndustries': [ { 'industryId': '2_1', 'industryName': 'Agricultural Machinery and Equipment' }, { 'industryId': '2_10', 'industryName': 'Gardening Supplies' }, { 'industryId': '2_11', 'industryName': 'Grains Farming' }, { 'industryId': '2_12', 'industryName': 'Horticulture' }, { 'industryId': '2_13', 'industryName': 'Irrigation and Drainage Districts' }, { 'industryId': '2_14', 'industryName': 'Livestock and Husbandry' }, { 'industryId': '2_15', 'industryName': 'Oilseeds Farming' }, { 'industryId': '2_16', 'industryName': 'Pulses and Legume Farming' }, { 'industryId': '2_17', 'industryName': 'Sericulture and Beekeeping' }, { 'industryId': '2_2', 'industryName': 'Agricultural Product Distribution' }, { 'industryId': '2_3', 'industryName': 'Agriculture Services' }, { 'industryId': '2_4', 'industryName': 'Coffee, Tea and Cocoa Farming' }, { 'industryId': '2_5', 'industryName': 'Cotton and Textile Farming' }, { 'industryId': '2_6', 'industryName': 'Farming Materials and Supplies' }, { 'industryId': '2_7', 'industryName': 'Fishing and Aquaculture' }, { 'industryId': '2_8', 'industryName': 'Forestry and Logging' }, { 'industryId': '2_9', 'industryName': 'Fruits and Vegetables Farming' } ] }, { 'industry': { 'industryId': '3', 'industryName': 'Automotive' }, 'subIndustries': [ { 'industryId': '3_1', 'industryName': 'Automobile Parts Manufacturing' }, { 'industryId': '3_2', 'industryName': 'Motor Vehicle Manufacturing' }, { 'industryId': '3_3', 'industryName': 'Motor Vehicle Parts Suppliers' }, { 'industryId': '3_4', 'industryName': 'Motor Vehicle Repair and Servicing' }, { 'industryId': '3_5', 'industryName': 'Truck and Bus Parts Manufacturing' }, { 'industryId': '3_6', 'industryName': 'Truck, Bus and Other Vehicle Manufacturing' } ] }, { 'industry': { 'industryId': '4', 'industryName': 'Banks' }, 'subIndustries': [ { 'industryId': '4_1', 'industryName': 'Automated Teller Machine Operators' }, { 'industryId': '4_10', 'industryName': 'Offshore Banks' }, { 'industryId': '4_11', 'industryName': 'Regional Banks' }, { 'industryId': '4_12', 'industryName': 'Savings Institutions' }, { 'industryId': '4_13', 'industryName': 'Short-Term Business Loans and Credit' }, { 'industryId': '4_14', 'industryName': 'Trust, Fiduciary and Custody Activities' }, { 'industryId': '4_2', 'industryName': 'Banking Transaction Processing' }, { 'industryId': '4_3', 'industryName': 'Central Banks' }, { 'industryId': '4_4', 'industryName': 'Commercial Banking ' }, { 'industryId': '4_5', 'industryName': 'Credit Agencies' }, { 'industryId': '4_6', 'industryName': 'Credit Unions' }, { 'industryId': '4_7', 'industryName': 'Islamic Banks' }, { 'industryId': '4_8', 'industryName': 'Landesbanken' }, { 'industryId': '4_9', 'industryName': 'Mortgage Banking' } ] }, { 'industry': { 'industryId': '5', 'industryName': 'Chemicals' }, 'subIndustries': [ { 'industryId': '5_1', 'industryName': 'Agricultural Chemicals' }, { 'industryId': '5_10', 'industryName': 'Polymers and Films' }, { 'industryId': '5_11', 'industryName': 'Sealants and Adhesives' }, { 'industryId': '5_12', 'industryName': 'Specialty Chemicals' }, { 'industryId': '5_2', 'industryName': 'Commodity Chemicals' }, { 'industryId': '5_3', 'industryName': 'Diversified Chemicals' }, { 'industryId': '5_4', 'industryName': 'Explosives and Petrochemicals' }, { 'industryId': '5_5', 'industryName': 'Fine Chemicals' }, { 'industryId': '5_6', 'industryName': 'Industrial Fluid Manufacturing' }, { 'industryId': '5_7', 'industryName': 'Medicinal Chemicals and Botanicals' }, { 'industryId': '5_8', 'industryName': 'Paints, Dyes, Varnishes and Lacquers' }, { 'industryId': '5_9', 'industryName': 'Plastic and Fiber Manufacturing' } ] }, { 'industry': { 'industryId': '6', 'industryName': 'Civic, Non-Profit and Membership Groups' }, 'subIndustries': [ { 'industryId': '6_1', 'industryName': 'Business Associations' }, { 'industryId': '6_10', 'industryName': 'Social Services Institutions' }, { 'industryId': '6_2', 'industryName': 'Charities' }, { 'industryId': '6_3', 'industryName': 'Environmental and Wildlife Organizations' }, { 'industryId': '6_4', 'industryName': 'Foundations' }, { 'industryId': '6_5', 'industryName': 'Humanitarian and Emergency Relief' }, { 'industryId': '6_6', 'industryName': 'Labor Unions' }, { 'industryId': '6_7', 'industryName': 'Political Organizations' }, { 'industryId': '6_8', 'industryName': 'Public Policy Research and Advocacy' }, { 'industryId': '6_9', 'industryName': 'Religious Organizations' } ] }, { 'industry': { 'industryId': '7', 'industryName': 'Computer Hardware' }, 'subIndustries': [ { 'industryId': '7_1', 'industryName': 'ATMs and Self-Service Terminals' }, { 'industryId': '7_10', 'industryName': 'Optical, Magnetic and Mass Storage' }, { 'industryId': '7_11', 'industryName': 'Peripherals, Computers and Accessories' }, { 'industryId': '7_12', 'industryName': 'Personal Storage Drives and Media' }, { 'industryId': '7_13', 'industryName': 'POS and Electronic Retail Systems' }, { 'industryId': '7_14', 'industryName': 'Printing and Imaging Equipment' }, { 'industryId': '7_15', 'industryName': 'Routing and Switching' }, { 'industryId': '7_16', 'industryName': 'Semiconductor Equipment and Testing' }, { 'industryId': '7_17', 'industryName': 'Semiconductors' }, { 'industryId': '7_18', 'industryName': 'Servers and Mainframes' }, { 'industryId': '7_19', 'industryName': 'Storage Networking' }, { 'industryId': '7_2', 'industryName': 'Computer Communications Equipment' }, { 'industryId': '7_20', 'industryName': 'Wireless Networking' }, { 'industryId': '7_3', 'industryName': 'Computer Display Units and Projectors' }, { 'industryId': '7_4', 'industryName': 'Computer Input Devices and Speakers' }, { 'industryId': '7_5', 'industryName': 'Computer Networking Equipment' }, { 'industryId': '7_6', 'industryName': 'Computer Storage Devices' }, { 'industryId': '7_7', 'industryName': 'Network Security Devices' }, { 'industryId': '7_8', 'industryName': 'Office Equipment' }, { 'industryId': '7_9', 'industryName': 'Office Supplies' } ] }, { 'industry': { 'industryId': '8', 'industryName': 'Computer Software' }, 'subIndustries': [ { 'industryId': '8_1', 'industryName': 'Accounting and Tax Software' }, { 'industryId': '8_10', 'industryName': 'Casino Management Software' }, { 'industryId': '8_11', 'industryName': 'Catalog Management Software' }, { 'industryId': '8_12', 'industryName': 'Channel Partner Management Software' }, { 'industryId': '8_13', 'industryName': 'Collaborative Software' }, { 'industryId': '8_14', 'industryName': 'Compliance and Governance Software' }, { 'industryId': '8_15', 'industryName': 'Computer-Aided Manufacturing Software' }, { 'industryId': '8_16', 'industryName': 'Construction and Architecture Software' }, { 'industryId': '8_17', 'industryName': 'Content Management Software' }, { 'industryId': '8_18', 'industryName': 'Customer Relationship Management' }, { 'industryId': '8_19', 'industryName': 'Data Warehousing' }, { 'industryId': '8_2', 'industryName': 'Advertising Industry Software' }, { 'industryId': '8_20', 'industryName': 'Database Management Software' }, { 'industryId': '8_21', 'industryName': 'Defense and Military Software' }, { 'industryId': '8_22', 'industryName': 'Desktop Publishing Software' }, { 'industryId': '8_23', 'industryName': 'Development Tools and Utilities Software' }, { 'industryId': '8_24', 'industryName': 'Distribution Software' }, { 'industryId': '8_25', 'industryName': 'Document Management Software' }, { 'industryId': '8_26', 'industryName': 'E-Commerce Software' }, { 'industryId': '8_27', 'industryName': 'Education and Training Software' }, { 'industryId': '8_28', 'industryName': 'Electronics Industry Software' }, { 'industryId': '8_29', 'industryName': 'Engineering, Scientific and CAD Software' }, { 'industryId': '8_3', 'industryName': 'Agriculture Industry Software' }, { 'industryId': '8_30', 'industryName': 'Enterprise Application Integration (EAI)' }, { 'industryId': '8_31', 'industryName': 'Enterprise Resource Planning Software' }, { 'industryId': '8_32', 'industryName': 'Event Planning Industry Software' }, { 'industryId': '8_33', 'industryName': 'File Management Software' }, { 'industryId': '8_34', 'industryName': 'Financial Services Software' }, { 'industryId': '8_35', 'industryName': 'Food and Beverage Industry Software' }, { 'industryId': '8_36', 'industryName': 'Health Care Management Software' }, { 'industryId': '8_37', 'industryName': 'Hotel Management Industry Software' }, { 'industryId': '8_38', 'industryName': 'Human Resources Software' }, { 'industryId': '8_39', 'industryName': 'Insurance Industry Software' }, { 'industryId': '8_4', 'industryName': 'Application Service Providers (ASPs)' }, { 'industryId': '8_40', 'industryName': 'Law Enforcement Industry Software' }, { 'industryId': '8_41', 'industryName': 'Legal Industry Software' }, { 'industryId': '8_42', 'industryName': 'Management Consulting Software' }, { 'industryId': '8_43', 'industryName': 'Manufacturing and Industrial Software' }, { 'industryId': '8_44', 'industryName': 'Marketing Automation Software' }, { 'industryId': '8_45', 'industryName': 'Message, Conference and Communications' }, { 'industryId': '8_46', 'industryName': 'Mobile Application Software' }, { 'industryId': '8_47', 'industryName': 'Multimedia and Graphics Software' }, { 'industryId': '8_48', 'industryName': 'Networking and Connectivity Software' }, { 'industryId': '8_49', 'industryName': 'Operating System Software' }, { 'industryId': '8_5', 'industryName': 'Automotive Industry Software' }, { 'industryId': '8_50', 'industryName': 'Order Management Software' }, { 'industryId': '8_51', 'industryName': 'Pharma and Biotech Software' }, { 'industryId': '8_52', 'industryName': 'Procurement Software' }, { 'industryId': '8_53', 'industryName': 'Programming and Data Processing Services' }, { 'industryId': '8_54', 'industryName': 'Project Management Software' }, { 'industryId': '8_55', 'industryName': 'Purchasing Software' }, { 'industryId': '8_56', 'industryName': 'Quality Assurance Software' }, { 'industryId': '8_57', 'industryName': 'Real Estate Industry Software' }, { 'industryId': '8_58', 'industryName': 'Restaurant Industry Software' }, { 'industryId': '8_59', 'industryName': 'Retail Management Software' }, { 'industryId': '8_6', 'industryName': 'Banking Software' }, { 'industryId': '8_60', 'industryName': 'Sales Force Automation Software' }, { 'industryId': '8_61', 'industryName': 'Sales Intelligence Software' }, { 'industryId': '8_62', 'industryName': 'Security Software' }, { 'industryId': '8_63', 'industryName': 'Service Industry Software' }, { 'industryId': '8_64', 'industryName': 'Smart Home Software' }, { 'industryId': '8_65', 'industryName': 'Storage and Systems Management Software' }, { 'industryId': '8_66', 'industryName': 'Supply Chain and Logistics Software' }, { 'industryId': '8_67', 'industryName': 'Telecommunication Software' }, { 'industryId': '8_68', 'industryName': 'Textiles Industry Software' }, { 'industryId': '8_69', 'industryName': 'Tourism Industry Software' }, { 'industryId': '8_7', 'industryName': 'Billing and Service Provision Software' }, { 'industryId': '8_70', 'industryName': 'Trading and Order Management Software' }, { 'industryId': '8_71', 'industryName': 'Transportation Industry Software' }, { 'industryId': '8_72', 'industryName': 'Warehousing Software' }, { 'industryId': '8_73', 'industryName': 'Wireless Communication Software' }, { 'industryId': '8_8', 'industryName': 'Budgeting and Forecasting Software' }, { 'industryId': '8_9', 'industryName': 'Business Intelligence Software' } ] }, { 'industry': { 'industryId': '9', 'industryName': 'Construction and Building Materials' }, 'subIndustries': [ { 'industryId': '9_1', 'industryName': 'Aggregates, Concrete and Cement' }, { 'industryId': '9_10', 'industryName': 'Construction Materials' }, { 'industryId': '9_11', 'industryName': 'Electrical Work' }, { 'industryId': '9_12', 'industryName': 'Engineering Services' }, { 'industryId': '9_13', 'industryName': 'General Contractors - Non-Residential' }, { 'industryId': '9_14', 'industryName': 'General Contractors - Residential' }, { 'industryId': '9_15', 'industryName': 'Hardware Wholesalers' }, { 'industryId': '9_16', 'industryName': 'Heavy Construction' }, { 'industryId': '9_17', 'industryName': 'Plumbing and HVAC Equipment ' }, { 'industryId': '9_18', 'industryName': 'Plywood, Veneer and Particle Board' }, { 'industryId': '9_19', 'industryName': 'Prefabricated Buildings' }, { 'industryId': '9_2', 'industryName': 'Apartment and Condominium Construction' }, { 'industryId': '9_20', 'industryName': 'Sawmills and Other Mill Operations' }, { 'industryId': '9_21', 'industryName': 'Single-Family Housing Builders' }, { 'industryId': '9_22', 'industryName': 'Specialty Construction' }, { 'industryId': '9_23', 'industryName': 'Water, Sewer and Power Line' }, { 'industryId': '9_24', 'industryName': 'Wood Production and Timber Operations' }, { 'industryId': '9_25', 'industryName': 'Wood Products' }, { 'industryId': '9_26', 'industryName': 'Wood Window and Door Manufacturing' }, { 'industryId': '9_3', 'industryName': 'Architecture and Engineering Services' }, { 'industryId': '9_4', 'industryName': 'Asphalt and Roofing Materials' }, { 'industryId': '9_5', 'industryName': 'Carpentry and Floor Work' }, { 'industryId': '9_6', 'industryName': 'Ceramic, Tile, Roofing and Clay Products' }, { 'industryId': '9_7', 'industryName': 'Construction and Engineering' }, { 'industryId': '9_8', 'industryName': 'Construction and Mining Equipment Sales' }, { 'industryId': '9_9', 'industryName': 'Construction Equipment' } ] }, { 'industry': { 'industryId': '10', 'industryName': 'Consumer Products' }, 'subIndustries': [ { 'industryId': '10_1', 'industryName': 'Accessories' }, { 'industryId': '10_10', 'industryName': 'Cutlery and Handtools' }, { 'industryId': '10_11', 'industryName': 'Dinnerware, Cookware and Cutlery' }, { 'industryId': '10_12', 'industryName': 'Electrical Housewares' }, { 'industryId': '10_13', 'industryName': 'Eyewear Manufacturers' }, { 'industryId': '10_14', 'industryName': 'Footwear' }, { 'industryId': '10_15', 'industryName': 'Garden Equipment, Mowers and Tractors ' }, { 'industryId': '10_16', 'industryName': 'Gold and Silverware' }, { 'industryId': '10_17', 'industryName': 'Hand and Power Tools' }, { 'industryId': '10_18', 'industryName': 'Home Furnishings' }, { 'industryId': '10_19', 'industryName': 'Household Furniture' }, { 'industryId': '10_2', 'industryName': 'Apparel' }, { 'industryId': '10_20', 'industryName': 'Household Products' }, { 'industryId': '10_21', 'industryName': 'Housewares and Home Storage Products' }, { 'industryId': '10_22', 'industryName': 'Jewelry and Gemstones' }, { 'industryId': '10_23', 'industryName': 'Knitting Mills' }, { 'industryId': '10_24', 'industryName': 'Lighting and Wiring Equipment' }, { 'industryId': '10_25', 'industryName': 'Linens' }, { 'industryId': '10_26', 'industryName': 'Major Appliances' }, { 'industryId': '10_27', 'industryName': 'Man-Made Fiber and Silk Mills' }, { 'industryId': '10_28', 'industryName': 'Mattresses and Bed Manufacturers' }, { 'industryId': '10_29', 'industryName': 'Men\'s Clothing' }, { 'industryId': '10_3', 'industryName': 'Baby Supplies and Accessories' }, { 'industryId': '10_30', 'industryName': 'Miscellaneous Durable Goods' }, { 'industryId': '10_31', 'industryName': 'Miscellaneous Non-Durable Goods' }, { 'industryId': '10_32', 'industryName': 'Office Furniture and Fixtures' }, { 'industryId': '10_33', 'industryName': 'Paper and Paper Products' }, { 'industryId': '10_34', 'industryName': 'Perfumes, Cosmetics and Toiletries' }, { 'industryId': '10_35', 'industryName': 'Pet Products' }, { 'industryId': '10_36', 'industryName': 'Photographic Equipment and Supplies' }, { 'industryId': '10_37', 'industryName': 'Pottery' }, { 'industryId': '10_38', 'industryName': 'Shelving, Partitions and Fixtures' }, { 'industryId': '10_39', 'industryName': 'Soaps and Detergents' }, { 'industryId': '10_4', 'industryName': 'Biological Products' }, { 'industryId': '10_40', 'industryName': 'Specialty Cleaning Products' }, { 'industryId': '10_41', 'industryName': 'Textile Products' }, { 'industryId': '10_42', 'industryName': 'Textiles and Leather Goods' }, { 'industryId': '10_43', 'industryName': 'Tobacco Products and Distributors' }, { 'industryId': '10_44', 'industryName': 'Watches, Clocks and Clockwork Devices' }, { 'industryId': '10_45', 'industryName': 'Window Coverings and Wall Coverings' }, { 'industryId': '10_46', 'industryName': 'Women\'s Clothing' }, { 'industryId': '10_47', 'industryName': 'Wood Furniture' }, { 'industryId': '10_5', 'industryName': 'Carpets, Rugs and Floor Coverings' }, { 'industryId': '10_6', 'industryName': 'Children\'s Clothing' }, { 'industryId': '10_7', 'industryName': 'Collectibles and Giftware Products' }, { 'industryId': '10_8', 'industryName': 'Costume Jewelry' }, { 'industryId': '10_9', 'industryName': 'Cotton Fabric Mills' } ] }, { 'industry': { 'industryId': '11', 'industryName': 'Consumer Services' }, 'subIndustries': [ { 'industryId': '11_1', 'industryName': 'Child Care Services' }, { 'industryId': '11_10', 'industryName': 'Optical Services' }, { 'industryId': '11_11', 'industryName': 'Personal Products' }, { 'industryId': '11_12', 'industryName': 'Personal Services' }, { 'industryId': '11_13', 'industryName': 'Photographic Services' }, { 'industryId': '11_14', 'industryName': 'Spas and Fitness Services' }, { 'industryId': '11_15', 'industryName': 'Taxi and Limousine Services' }, { 'industryId': '11_16', 'industryName': 'Travel Agencies and Services' }, { 'industryId': '11_17', 'industryName': 'Veterinary Care' }, { 'industryId': '11_18', 'industryName': 'Weight and Health Management' }, { 'industryId': '11_2', 'industryName': 'Coffee and Water Beverage Services' }, { 'industryId': '11_3', 'industryName': 'Courier, Messenger and Delivery Services' }, { 'industryId': '11_4', 'industryName': 'Death Care Products and Services' }, { 'industryId': '11_5', 'industryName': 'Hair Salons and Beauty Treatments ' }, { 'industryId': '11_6', 'industryName': 'Laundry and Dry Cleaning Services' }, { 'industryId': '11_7', 'industryName': 'Motor Vehicle Parking and Garages' }, { 'industryId': '11_8', 'industryName': 'Motor Vehicle Rental and Leasing' }, { 'industryId': '11_9', 'industryName': 'Moving Services' } ] }, { 'industry': { 'industryId': '12', 'industryName': 'Corporate Services' }, 'subIndustries': [ { 'industryId': '12_1', 'industryName': 'Advertising Agencies' }, { 'industryId': '12_10', 'industryName': 'Computer Processing and Data Services' }, { 'industryId': '12_11', 'industryName': 'Consumer Credit Reporting' }, { 'industryId': '12_12', 'industryName': 'Detective and Other Security Services' }, { 'industryId': '12_13', 'industryName': 'Direct Marketing' }, { 'industryId': '12_14', 'industryName': 'Executive Search' }, { 'industryId': '12_15', 'industryName': 'Facilities Support' }, { 'industryId': '12_16', 'industryName': 'General Rental Center' }, { 'industryId': '12_17', 'industryName': 'Human Resources and Staffing' }, { 'industryId': '12_18', 'industryName': 'Integrated Computer Systems Design' }, { 'industryId': '12_19', 'industryName': 'IT Services and Consulting' }, { 'industryId': '12_2', 'industryName': 'Arbitration Services' }, { 'industryId': '12_20', 'industryName': 'Law Firms' }, { 'industryId': '12_21', 'industryName': 'Legal Services' }, { 'industryId': '12_22', 'industryName': 'Mailing and Commercial Art Services' }, { 'industryId': '12_23', 'industryName': 'Management Consulting' }, { 'industryId': '12_24', 'industryName': 'Management Services' }, { 'industryId': '12_25', 'industryName': 'Market Research Services' }, { 'industryId': '12_26', 'industryName': 'Marketing and Advertising' }, { 'industryId': '12_27', 'industryName': 'Media Representatives' }, { 'industryId': '12_28', 'industryName': 'Miscellaneous' }, { 'industryId': '12_29', 'industryName': 'Miscellaneous Computer Related Services' }, { 'industryId': '12_3', 'industryName': 'Artists, Writers and Performers' }, { 'industryId': '12_30', 'industryName': 'Miscellaneous Repair Services' }, { 'industryId': '12_31', 'industryName': 'Miscellaneous Services' }, { 'industryId': '12_32', 'industryName': 'Mobile Application Developers' }, { 'industryId': '12_33', 'industryName': 'Networking Services' }, { 'industryId': '12_34', 'industryName': 'Online Staffing and Recruitment Services' }, { 'industryId': '12_35', 'industryName': 'Other Equipment Rental and Leasing' }, { 'industryId': '12_36', 'industryName': 'Outsourced Human Resources Services' }, { 'industryId': '12_37', 'industryName': 'Photo Labs' }, { 'industryId': '12_38', 'industryName': 'Public Relations' }, { 'industryId': '12_39', 'industryName': 'Records Management Services' }, { 'industryId': '12_4', 'industryName': 'Auctions and Internet Auctions' }, { 'industryId': '12_40', 'industryName': 'Sales Promotion and Targeted Marketing' }, { 'industryId': '12_41', 'industryName': 'Services for the Printing Trade' }, { 'industryId': '12_42', 'industryName': 'Talent and Modeling Agencies' }, { 'industryId': '12_43', 'industryName': 'Technology' }, { 'industryId': '12_44', 'industryName': 'Testing Lab and Scientific Research ' }, { 'industryId': '12_45', 'industryName': 'Trade Show, Event Planning and Support' }, { 'industryId': '12_46', 'industryName': 'Uniform Supplies' }, { 'industryId': '12_5', 'industryName': 'Billboards and Outdoor Advertising' }, { 'industryId': '12_6', 'industryName': 'Business Services' }, { 'industryId': '12_7', 'industryName': 'Cleaning and Facilities Management' }, { 'industryId': '12_8', 'industryName': 'Commercial Printing Services' }, { 'industryId': '12_9', 'industryName': 'Computer Facilities ' } ] }, { 'industry': { 'industryId': '13', 'industryName': 'Electronics' }, 'subIndustries': [ { 'industryId': '13_1', 'industryName': 'Appliances and Tools and Housewares' }, { 'industryId': '13_10', 'industryName': 'Magnetic and Optical Recording' }, { 'industryId': '13_11', 'industryName': 'Miscellaneous Electrical Equipment' }, { 'industryId': '13_12', 'industryName': 'Printed Circuit Boards' }, { 'industryId': '13_13', 'industryName': 'Sound and Lighting Equipment' }, { 'industryId': '13_2', 'industryName': 'Consumer Electronics' }, { 'industryId': '13_3', 'industryName': 'Electric Testing Equipment' }, { 'industryId': '13_4', 'industryName': 'Electronic Coils and Transformers' }, { 'industryId': '13_5', 'industryName': 'Electronic Components and Accessories' }, { 'industryId': '13_6', 'industryName': 'Electronic Connectors' }, { 'industryId': '13_7', 'industryName': 'Electronic Gaming Products' }, { 'industryId': '13_8', 'industryName': 'Electronic Parts and Equipment' }, { 'industryId': '13_9', 'industryName': 'Heavy Electrical Equipment' } ] }, { 'industry': { 'industryId': '14', 'industryName': 'Energy and Environmental' }, 'subIndustries': [ { 'industryId': '14_1', 'industryName': 'Alternative Energy Sources' }, { 'industryId': '14_10', 'industryName': 'Electricity Transmission' }, { 'industryId': '14_11', 'industryName': 'Electricity, Gas and Sanitation Services' }, { 'industryId': '14_12', 'industryName': 'Energy Equipment and Services' }, { 'industryId': '14_13', 'industryName': 'Environmental Services' }, { 'industryId': '14_14', 'industryName': 'Fossil Fuel Power Generation' }, { 'industryId': '14_15', 'industryName': 'Fuel Oil Dealers' }, { 'industryId': '14_16', 'industryName': 'Gasoline Retailers' }, { 'industryId': '14_17', 'industryName': 'Hazardous Waste Management' }, { 'industryId': '14_18', 'industryName': 'Hydroelectric Power Generation' }, { 'industryId': '14_19', 'industryName': 'Independent/Merchant Power Production' }, { 'industryId': '14_2', 'industryName': 'Cogeneration and Small Power Producers' }, { 'industryId': '14_20', 'industryName': 'Integrated Oil and Gas' }, { 'industryId': '14_21', 'industryName': 'Liquefied Petroleum Gas Dealers' }, { 'industryId': '14_22', 'industryName': 'Natural Gas Gathering and Processing ' }, { 'industryId': '14_23', 'industryName': 'Natural Gas Pipelines' }, { 'industryId': '14_24', 'industryName': 'Natural Gas Transmission' }, { 'industryId': '14_25', 'industryName': 'Natural Gas Utilities' }, { 'industryId': '14_26', 'industryName': 'Nuclear Power Generation' }, { 'industryId': '14_27', 'industryName': 'Oil and Gas - Field Services' }, { 'industryId': '14_28', 'industryName': 'Oil and Gas - Marketing and Refining' }, { 'industryId': '14_29', 'industryName': 'Oil and Gas - Production and Exploration' }, { 'industryId': '14_3', 'industryName': 'Combined Electric and Gas Utilities' }, { 'industryId': '14_30', 'industryName': 'Oil and Gas - Transportation and Storage' }, { 'industryId': '14_31', 'industryName': 'Oil Drilling and Gas Wells' }, { 'industryId': '14_32', 'industryName': 'Oil Related Equipment and Services' }, { 'industryId': '14_33', 'industryName': 'Other Utilities ' }, { 'industryId': '14_34', 'industryName': 'Petroleum Pipelines' }, { 'industryId': '14_35', 'industryName': 'Refined Petroleum Pipelines' }, { 'industryId': '14_36', 'industryName': 'Refuse Systems' }, { 'industryId': '14_37', 'industryName': 'Remediation and Environmental Cleanup ' }, { 'industryId': '14_38', 'industryName': 'Retail Energy Marketing' }, { 'industryId': '14_39', 'industryName': 'Sanitary and Sewage Districts' }, { 'industryId': '14_4', 'industryName': 'Conservation Districts' }, { 'industryId': '14_40', 'industryName': 'Sanitation Services' }, { 'industryId': '14_41', 'industryName': 'Solid Waste Services and Recycling' }, { 'industryId': '14_42', 'industryName': 'Trusts' }, { 'industryId': '14_43', 'industryName': 'Utilities - Multiline' }, { 'industryId': '14_44', 'industryName': 'Waste Management Districts' }, { 'industryId': '14_45', 'industryName': 'Wastewater Treatment' }, { 'industryId': '14_46', 'industryName': 'Water Distribution' }, { 'industryId': '14_47', 'industryName': 'Water Supply and Utilities' }, { 'industryId': '14_48', 'industryName': 'Wholesale Energy Trading and Marketing' }, { 'industryId': '14_49', 'industryName': 'Wholesale Petroleum and Related Products' }, { 'industryId': '14_5', 'industryName': 'Crude Petroleum and Natural Gas' }, { 'industryId': '14_50', 'industryName': 'Wholesale Petroleum Bulk Stations' }, { 'industryId': '14_6', 'industryName': 'Crude Petroleum Pipelines' }, { 'industryId': '14_7', 'industryName': 'Electric Power Distribution' }, { 'industryId': '14_8', 'industryName': 'Electric Power Transmission' }, { 'industryId': '14_9', 'industryName': 'Electric Utilities' } ] }, { 'industry': { 'industryId': '15', 'industryName': 'Financial Services' }, 'subIndustries': [ { 'industryId': '15_1', 'industryName': 'Accounting, Tax, Bookkeeping and Payroll' }, { 'industryId': '15_10', 'industryName': 'Currency and Forex Brokers' }, { 'industryId': '15_11', 'industryName': 'Currency, Commodity & Futures Trading' }, { 'industryId': '15_12', 'industryName': 'Diversified Financial Services' }, { 'industryId': '15_13', 'industryName': 'Diversified Lending' }, { 'industryId': '15_14', 'industryName': 'Electronic Funds Transfer' }, { 'industryId': '15_15', 'industryName': 'Electronic Payment Systems' }, { 'industryId': '15_16', 'industryName': 'Energy Exchanges' }, { 'industryId': '15_17', 'industryName': 'Finance Authorities' }, { 'industryId': '15_18', 'industryName': 'Financial Leasing Companies' }, { 'industryId': '15_19', 'industryName': 'Financial Transaction Settlement' }, { 'industryId': '15_2', 'industryName': 'Asset Management' }, { 'industryId': '15_20', 'industryName': 'Forfeiting and Factoring' }, { 'industryId': '15_21', 'industryName': 'Hedge Funds' }, { 'industryId': '15_22', 'industryName': 'Investment Banking' }, { 'industryId': '15_23', 'industryName': 'Investment Management and Fund Operators' }, { 'industryId': '15_24', 'industryName': 'Investment Services and Advice' }, { 'industryId': '15_25', 'industryName': 'Investment Trusts ' }, { 'industryId': '15_26', 'industryName': 'Leveraged Finance' }, { 'industryId': '15_27', 'industryName': 'Market Makers and Trade Clearing' }, { 'industryId': '15_28', 'industryName': 'Miscellaneous Investment Firms' }, { 'industryId': '15_29', 'industryName': 'Mobile Payment Systems' }, { 'industryId': '15_3', 'industryName': 'Blank Check Companies' }, { 'industryId': '15_30', 'industryName': 'Mortgage Brokers' }, { 'industryId': '15_31', 'industryName': 'Patent Owners and Lessors' }, { 'industryId': '15_32', 'industryName': 'Pension and Retirement Funds' }, { 'industryId': '15_33', 'industryName': 'Private Equity' }, { 'industryId': '15_34', 'industryName': 'Royalty Trusts' }, { 'industryId': '15_35', 'industryName': 'Securities Brokers and Traders ' }, { 'industryId': '15_36', 'industryName': 'Specialty Financial Services' }, { 'industryId': '15_37', 'industryName': 'Stock Exchanges' }, { 'industryId': '15_38', 'industryName': 'Trade Facilitation' }, { 'industryId': '15_39', 'industryName': 'Venture Capital' }, { 'industryId': '15_4', 'industryName': 'Consumer Credit Reporting' }, { 'industryId': '15_5', 'industryName': 'Credit and Collection Services' }, { 'industryId': '15_6', 'industryName': 'Credit Cards' }, { 'industryId': '15_7', 'industryName': 'Credit Intermediation' }, { 'industryId': '15_8', 'industryName': 'Credit Rating Agency' }, { 'industryId': '15_9', 'industryName': 'Crowdfunding' } ] }, { 'industry': { 'industryId': '16', 'industryName': 'Food and Beverage' }, 'subIndustries': [ { 'industryId': '16_1', 'industryName': 'Bakery and Bakery Products' }, { 'industryId': '16_10', 'industryName': 'Flours and Baked Goods' }, { 'industryId': '16_11', 'industryName': 'Food Oils' }, { 'industryId': '16_12', 'industryName': 'Food Processing' }, { 'industryId': '16_13', 'industryName': 'Food Products' }, { 'industryId': '16_14', 'industryName': 'Food Wholesale Distributors' }, { 'industryId': '16_15', 'industryName': 'Fresh and Frozen Seafood' }, { 'industryId': '16_16', 'industryName': 'Meat Packing and Meat Products' }, { 'industryId': '16_17', 'industryName': 'Pastas and Cereals' }, { 'industryId': '16_18', 'industryName': 'Poultry' }, { 'industryId': '16_19', 'industryName': 'Sausages and Other Prepared Meats' }, { 'industryId': '16_2', 'industryName': 'Beverages - Brewers' }, { 'industryId': '16_3', 'industryName': 'Beverages - Distillers and Wineries' }, { 'industryId': '16_4', 'industryName': 'Beverages - Non-Alcoholic' }, { 'industryId': '16_5', 'industryName': 'Bottling and Distribution' }, { 'industryId': '16_6', 'industryName': 'Candy and Confections' }, { 'industryId': '16_7', 'industryName': 'Canned and Frozen Fruits and Vegetables' }, { 'industryId': '16_8', 'industryName': 'Dairy Products' }, { 'industryId': '16_9', 'industryName': 'Flavorings, Spices and Other Ingredients' } ] }, { 'industry': { 'industryId': '17', 'industryName': 'Government' }, 'subIndustries': [ { 'industryId': '17_1', 'industryName': 'Cities, Towns, and Municipalities' }, { 'industryId': '17_10', 'industryName': 'Legislatures' }, { 'industryId': '17_11', 'industryName': 'National Security' }, { 'industryId': '17_12', 'industryName': 'Police Protection' }, { 'industryId': '17_13', 'industryName': 'Special Districts' }, { 'industryId': '17_14', 'industryName': 'State, Provincial or Regional Government' }, { 'industryId': '17_15', 'industryName': 'Villages and Small Municipalities' }, { 'industryId': '17_2', 'industryName': 'Correctional Facilities' }, { 'industryId': '17_3', 'industryName': 'County Governments' }, { 'industryId': '17_4', 'industryName': 'Courts of Law' }, { 'industryId': '17_5', 'industryName': 'Executive Government Offices' }, { 'industryId': '17_6', 'industryName': 'Federal Government Agencies' }, { 'industryId': '17_7', 'industryName': 'Fire Protection' }, { 'industryId': '17_8', 'industryName': 'International Government Agencies' }, { 'industryId': '17_9', 'industryName': 'Legal Counsel and Prosecution' } ] }, { 'industry': { 'industryId': '18', 'industryName': 'Holding Companies ' }, 'subIndustries': [ { 'industryId': '18_1', 'industryName': 'Industrial Conglomerates' } ] }, { 'industry': { 'industryId': '19', 'industryName': 'Hospitals and Healthcare' }, 'subIndustries': [ { 'industryId': '19_1', 'industryName': 'Ambulance Services' }, { 'industryId': '19_10', 'industryName': 'Diagnostic Imaging Centers' }, { 'industryId': '19_11', 'industryName': 'Electromedical and Therapeutic Equipment' }, { 'industryId': '19_12', 'industryName': 'Emergency Medical Services' }, { 'industryId': '19_13', 'industryName': 'Family Planning Clinics' }, { 'industryId': '19_14', 'industryName': 'Fertility Clinics' }, { 'industryId': '19_15', 'industryName': 'General Healthcare Equipment' }, { 'industryId': '19_16', 'industryName': 'General Medical and Surgical Hospitals' }, { 'industryId': '19_17', 'industryName': 'General Physicians and Clinics' }, { 'industryId': '19_18', 'industryName': 'Healthcare Districts' }, { 'industryId': '19_19', 'industryName': 'Home Healthcare' }, { 'industryId': '19_2', 'industryName': 'Assisted Living Facilities' }, { 'industryId': '19_20', 'industryName': 'Hospice Services' }, { 'industryId': '19_21', 'industryName': 'Integrated Healthcare Networks' }, { 'industryId': '19_22', 'industryName': 'Kidney Dialysis Centers' }, { 'industryId': '19_23', 'industryName': 'Medical and Dental Laboratories' }, { 'industryId': '19_24', 'industryName': 'Medical Practice Management and Services' }, { 'industryId': '19_25', 'industryName': 'Mental Health Practitioners' }, { 'industryId': '19_26', 'industryName': 'Nursing Homes and Extended Care' }, { 'industryId': '19_27', 'industryName': 'Obstetricians and Gynecologists' }, { 'industryId': '19_28', 'industryName': 'Oncology Services' }, { 'industryId': '19_29', 'industryName': 'Ophthalmic Equipment' }, { 'industryId': '19_3', 'industryName': 'Blood and Organ Banks' }, { 'industryId': '19_30', 'industryName': 'Ophthalmologists and Optometrists' }, { 'industryId': '19_31', 'industryName': 'Orthopedic and Prosthetic Equipment' }, { 'industryId': '19_32', 'industryName': 'Orthopedic Services' }, { 'industryId': '19_33', 'industryName': 'Other Specialty Hospitals' }, { 'industryId': '19_34', 'industryName': 'Pediatricians' }, { 'industryId': '19_35', 'industryName': 'Physical Therapy Facilities' }, { 'industryId': '19_36', 'industryName': 'Podiatrists' }, { 'industryId': '19_37', 'industryName': 'Psychiatric Hospitals' }, { 'industryId': '19_38', 'industryName': 'Radiology Services' }, { 'industryId': '19_39', 'industryName': 'Specialty Surgical Hospitals' }, { 'industryId': '19_4', 'industryName': 'Cardiologists' }, { 'industryId': '19_40', 'industryName': 'Substance Abuse Rehabilitation Centers' }, { 'industryId': '19_41', 'industryName': 'Surgical and Medical Devices' }, { 'industryId': '19_42', 'industryName': 'Urgent Care Centers' }, { 'industryId': '19_43', 'industryName': 'X-Ray Equipment' }, { 'industryId': '19_5', 'industryName': 'Children\'s Hospitals' }, { 'industryId': '19_6', 'industryName': 'Chiropractors' }, { 'industryId': '19_7', 'industryName': 'Dental Equipment and Supplies' }, { 'industryId': '19_8', 'industryName': 'Dentists' }, { 'industryId': '19_9', 'industryName': 'Dermatologists' } ] }, { 'industry': { 'industryId': '20', 'industryName': 'Industrial Manufacturing and Services' }, 'subIndustries': [ { 'industryId': '20_1', 'industryName': 'Advanced Medical Equipment' }, { 'industryId': '20_10', 'industryName': 'Electromedical Devices and Equipment' }, { 'industryId': '20_11', 'industryName': 'Engines and Turbines' }, { 'industryId': '20_12', 'industryName': 'Envelopes' }, { 'industryId': '20_13', 'industryName': 'Fabricated Rubber Products' }, { 'industryId': '20_14', 'industryName': 'Farm Equipment' }, { 'industryId': '20_15', 'industryName': 'Flat Glass' }, { 'industryId': '20_16', 'industryName': 'Gaskets and Sealing Devices' }, { 'industryId': '20_17', 'industryName': 'Glass, Glass Containers and Glassware' }, { 'industryId': '20_18', 'industryName': 'Heating Equipment' }, { 'industryId': '20_19', 'industryName': 'Industrial Equipment and Machinery' }, { 'industryId': '20_2', 'industryName': 'Air and Gas Compressors' }, { 'industryId': '20_20', 'industryName': 'Industrial Fans' }, { 'industryId': '20_21', 'industryName': 'Industrial Furnaces and Ovens' }, { 'industryId': '20_22', 'industryName': 'Industrial Machinery Distribution' }, { 'industryId': '20_23', 'industryName': 'Industrial Measurement Devices' }, { 'industryId': '20_24', 'industryName': 'Laboratory Equipment' }, { 'industryId': '20_25', 'industryName': 'Manifold Business Forms' }, { 'industryId': '20_26', 'industryName': 'Measuring Devices and Controllers' }, { 'industryId': '20_27', 'industryName': 'Metalworking Machinery' }, { 'industryId': '20_28', 'industryName': 'Miscellaneous Fabricated Wire Products' }, { 'industryId': '20_29', 'industryName': 'Miscellaneous Manufacturing' }, { 'industryId': '20_3', 'industryName': 'Automated Climate Controls' }, { 'industryId': '20_30', 'industryName': 'Miscellaneous Petroleum Products' }, { 'industryId': '20_31', 'industryName': 'Miscellaneous Plastics' }, { 'industryId': '20_32', 'industryName': 'Motors and Generators' }, { 'industryId': '20_33', 'industryName': 'Paper Board and Paper Products' }, { 'industryId': '20_34', 'industryName': 'Paper Containers and Packaging' }, { 'industryId': '20_35', 'industryName': 'Paper Mills' }, { 'industryId': '20_36', 'industryName': 'Paperboard Mills' }, { 'industryId': '20_37', 'industryName': 'Plastic Materials and Synthetic Resins' }, { 'industryId': '20_38', 'industryName': 'Plastics, Foil and Coated Paper Bags' }, { 'industryId': '20_39', 'industryName': 'Power Distribution and Transformers' }, { 'industryId': '20_4', 'industryName': 'Ball Bearings and Roller Bearing' }, { 'industryId': '20_40', 'industryName': 'Printing Press Machinery' }, { 'industryId': '20_41', 'industryName': 'Pulp Mills' }, { 'industryId': '20_42', 'industryName': 'Pumping Equipment' }, { 'industryId': '20_43', 'industryName': 'Relays and Industrial Controls' }, { 'industryId': '20_44', 'industryName': 'Screw Machines' }, { 'industryId': '20_45', 'industryName': 'Specialty Industrial Machinery' }, { 'industryId': '20_46', 'industryName': 'Stationery and Related Products' }, { 'industryId': '20_47', 'industryName': 'Switching and Switchboard Equipment' }, { 'industryId': '20_48', 'industryName': 'Tires and Inner Tubes' }, { 'industryId': '20_49', 'industryName': 'Totalizing Fluid Meters' }, { 'industryId': '20_5', 'industryName': 'Bolts, Nuts, Screws, Rivets and Washers' }, { 'industryId': '20_6', 'industryName': 'Building Climate Control and HVAC' }, { 'industryId': '20_7', 'industryName': 'Commercial Equipment and Supplies' }, { 'industryId': '20_8', 'industryName': 'Converted Paper Products' }, { 'industryId': '20_9', 'industryName': 'Electric Lighting and Wiring' } ] }, { 'industry': { 'industryId': '21', 'industryName': 'Insurance' }, 'subIndustries': [ { 'industryId': '21_1', 'industryName': 'Automobile Insurance' }, { 'industryId': '21_10', 'industryName': 'Insurance Financing' }, { 'industryId': '21_11', 'industryName': 'Liability Insurance' }, { 'industryId': '21_12', 'industryName': 'Life Insurance' }, { 'industryId': '21_13', 'industryName': 'Mortgage Insurance' }, { 'industryId': '21_14', 'industryName': 'Multiline Insurance' }, { 'industryId': '21_15', 'industryName': 'Property and Casualty Insurance' }, { 'industryId': '21_16', 'industryName': 'Reinsurance' }, { 'industryId': '21_17', 'industryName': 'Risk Management' }, { 'industryId': '21_18', 'industryName': 'Specialty Insurance' }, { 'industryId': '21_19', 'industryName': 'Surety Insurance' }, { 'industryId': '21_2', 'industryName': 'Claims Administration and Processing' }, { 'industryId': '21_20', 'industryName': 'Travel Insurance' }, { 'industryId': '21_21', 'industryName': 'Workers\' Compensation' }, { 'industryId': '21_3', 'industryName': 'Commercial Insurance' }, { 'industryId': '21_4', 'industryName': 'Credit Insurance' }, { 'industryId': '21_5', 'industryName': 'Disability Insurance' }, { 'industryId': '21_6', 'industryName': 'Fire and Marine Insurance' }, { 'industryId': '21_7', 'industryName': 'Health Insurance' }, { 'industryId': '21_8', 'industryName': 'Homeowners and Title Insurance' }, { 'industryId': '21_9', 'industryName': 'Insurance Agents and Brokers' } ] }, { 'industry': { 'industryId': '22', 'industryName': 'Leisure, Sports and Recreation' }, 'subIndustries': [ { 'industryId': '22_1', 'industryName': 'Accommodation' }, { 'industryId': '22_10', 'industryName': 'Golf Equipment ' }, { 'industryId': '22_11', 'industryName': 'Hotels and Motels' }, { 'industryId': '22_12', 'industryName': 'Leisure Products' }, { 'industryId': '22_13', 'industryName': 'Motion Picture Distribution' }, { 'industryId': '22_14', 'industryName': 'Museums and Art Galleries' }, { 'industryId': '22_15', 'industryName': 'Musical Instruments' }, { 'industryId': '22_16', 'industryName': 'Park and Recreation Districts' }, { 'industryId': '22_17', 'industryName': 'Professional Sports Teams' }, { 'industryId': '22_18', 'industryName': 'Racetracks' }, { 'industryId': '22_19', 'industryName': 'Sporting Goods, Outdoor Gear and Apparel ' }, { 'industryId': '22_2', 'industryName': 'Amusement and Recreation' }, { 'industryId': '22_20', 'industryName': 'Sports and Recreations Clubs' }, { 'industryId': '22_21', 'industryName': 'Sports Equipment ' }, { 'industryId': '22_3', 'industryName': 'Art Supplies' }, { 'industryId': '22_4', 'industryName': 'Athletic Facilities' }, { 'industryId': '22_5', 'industryName': 'Bicycles and Accessories ' }, { 'industryId': '22_6', 'industryName': 'Casinos and Gambling' }, { 'industryId': '22_7', 'industryName': 'Dolls and Stuffed Toys' }, { 'industryId': '22_8', 'industryName': 'Entertainment Services' }, { 'industryId': '22_9', 'industryName': 'Games and Toys' } ] }, { 'industry': { 'industryId': '23', 'industryName': 'Media' }, 'subIndustries': [ { 'industryId': '23_1', 'industryName': 'Audiovisual Equipment Sales and Services' }, { 'industryId': '23_10', 'industryName': 'Diversified Media' }, { 'industryId': '23_11', 'industryName': 'Film and Video' }, { 'industryId': '23_12', 'industryName': 'Greeting Cards' }, { 'industryId': '23_13', 'industryName': 'Internet Content Providers' }, { 'industryId': '23_14', 'industryName': 'Internet Information Services' }, { 'industryId': '23_15', 'industryName': 'Internet Search and Navigation Services' }, { 'industryId': '23_16', 'industryName': 'Motion Picture and Video Production' }, { 'industryId': '23_17', 'industryName': 'Motion Picture Equipment' }, { 'industryId': '23_18', 'industryName': 'Motion Picture Theaters' }, { 'industryId': '23_19', 'industryName': 'Music Recording and Distribution' }, { 'industryId': '23_2', 'industryName': 'Book Publishers' }, { 'industryId': '23_20', 'industryName': 'Newspaper Publishers' }, { 'industryId': '23_21', 'industryName': 'Newspapers and Online News Organizations' }, { 'industryId': '23_22', 'industryName': 'Periodical and Magazine Publishers' }, { 'industryId': '23_23', 'industryName': 'Publishing' }, { 'industryId': '23_24', 'industryName': 'Radio Broadcasting' }, { 'industryId': '23_25', 'industryName': 'Television Broadcasting' }, { 'industryId': '23_26', 'industryName': 'Trading Cards and Comic Books' }, { 'industryId': '23_27', 'industryName': 'Video Game Software' }, { 'industryId': '23_3', 'industryName': 'Broadcasting' }, { 'industryId': '23_4', 'industryName': 'Broadcasting Equipment' }, { 'industryId': '23_5', 'industryName': 'Cable and Satellite Services' }, { 'industryId': '23_6', 'industryName': 'Cable Networks and Program Distribution ' }, { 'industryId': '23_7', 'industryName': 'Cable TV System Operators' }, { 'industryId': '23_8', 'industryName': 'CD and DVD Manufacturing and Supply' }, { 'industryId': '23_9', 'industryName': 'Directories and Yellow Pages Publishers' } ] }, { 'industry': { 'industryId': '24', 'industryName': 'Mining and Metals' }, 'subIndustries': [ { 'industryId': '24_1', 'industryName': 'Aluminum Producers' }, { 'industryId': '24_10', 'industryName': 'Metal Forgings' }, { 'industryId': '24_11', 'industryName': 'Metals and Minerals Distribution' }, { 'industryId': '24_12', 'industryName': 'Mining Machinery' }, { 'industryId': '24_13', 'industryName': 'Miscellaneous Fabricated Metal Products' }, { 'industryId': '24_14', 'industryName': 'Miscellaneous Metal Mining' }, { 'industryId': '24_15', 'industryName': 'Miscellaneous Metal Products' }, { 'industryId': '24_16', 'industryName': 'Non-Ferrous Foundries' }, { 'industryId': '24_17', 'industryName': 'Non-Metallic Mining and Quarrying' }, { 'industryId': '24_18', 'industryName': 'Other Non Metallic Mineral Products' }, { 'industryId': '24_19', 'industryName': 'Precious Metals and Minerals' }, { 'industryId': '24_2', 'industryName': 'Coal Mining' }, { 'industryId': '24_20', 'industryName': 'Prefabricated Metal Buildings' }, { 'industryId': '24_21', 'industryName': 'Rolling and Extruding Non-Ferrous Metals' }, { 'industryId': '24_22', 'industryName': 'Sheet Metal' }, { 'industryId': '24_23', 'industryName': 'Shipping Barrels, Drums, Kegs and Pails' }, { 'industryId': '24_24', 'industryName': 'Smelting and Refining Non-Ferrous Metals' }, { 'industryId': '24_25', 'industryName': 'Specialty Mining and Metals' }, { 'industryId': '24_26', 'industryName': 'Steel Pipes and Tubes' }, { 'industryId': '24_27', 'industryName': 'Steel Works and Coke Ovens' }, { 'industryId': '24_28', 'industryName': 'Stone Products' }, { 'industryId': '24_3', 'industryName': 'Coating and Engravings' }, { 'industryId': '24_4', 'industryName': 'Concrete and Gypsum' }, { 'industryId': '24_5', 'industryName': 'Fabricated Structural Metal' }, { 'industryId': '24_6', 'industryName': 'Gold and Silver Mining' }, { 'industryId': '24_7', 'industryName': 'Iron and Steel Foundries' }, { 'industryId': '24_8', 'industryName': 'Machine Tools and Metal Equipment ' }, { 'industryId': '24_9', 'industryName': 'Metal Cans' } ] }, { 'industry': { 'industryId': '25', 'industryName': 'Pharmaceuticals and Biotech' }, 'subIndustries': [ { 'industryId': '25_1', 'industryName': 'Biopharmaceuticals and Biotherapeutics' }, { 'industryId': '25_10', 'industryName': 'Pharmaceuticals - Generic and Specialty' }, { 'industryId': '25_11', 'industryName': 'Pharmaceuticals Wholesale' }, { 'industryId': '25_12', 'industryName': 'Vitamin, Nutritional and Health Products' }, { 'industryId': '25_13', 'industryName': 'Wholesale Drugs and Pharmacy Supplies' }, { 'industryId': '25_2', 'industryName': 'Biotechnology' }, { 'industryId': '25_3', 'industryName': 'Biotechnology Research Equipment' }, { 'industryId': '25_4', 'industryName': 'Biotechnology Research Services' }, { 'industryId': '25_5', 'industryName': 'Commercial Scientific Research Services' }, { 'industryId': '25_6', 'industryName': 'Diagnostic Substances' }, { 'industryId': '25_7', 'industryName': 'Drug Delivery Systems' }, { 'industryId': '25_8', 'industryName': 'Over-the-Counter Medications' }, { 'industryId': '25_9', 'industryName': 'Pharmaceuticals - Diversified' } ] }, { 'industry': { 'industryId': '26', 'industryName': 'Real Estate Services' }, 'subIndustries': [ { 'industryId': '26_1', 'industryName': 'Building Operators' }, { 'industryId': '26_10', 'industryName': 'Mortgage and Investment REITs' }, { 'industryId': '26_11', 'industryName': 'Office REITs' }, { 'industryId': '26_12', 'industryName': 'Other Real Estate Investors' }, { 'industryId': '26_13', 'industryName': 'Planning and Development Authorities' }, { 'industryId': '26_14', 'industryName': 'Real Estate Appraisers' }, { 'industryId': '26_15', 'industryName': 'Real Estate Brokers' }, { 'industryId': '26_16', 'industryName': 'Real Estate Development' }, { 'industryId': '26_17', 'industryName': 'Real Estate Investment Trusts (REITs)' }, { 'industryId': '26_18', 'industryName': 'Real Estate Leasing' }, { 'industryId': '26_19', 'industryName': 'Real Estate Operators' }, { 'industryId': '26_2', 'industryName': 'Health Care REITs' }, { 'industryId': '26_20', 'industryName': 'Real Estate Property Management' }, { 'industryId': '26_21', 'industryName': 'REIT - Residential and Commercial' }, { 'industryId': '26_22', 'industryName': 'Retail REITs' }, { 'industryId': '26_23', 'industryName': 'School and Public Building Authorities' }, { 'industryId': '26_24', 'industryName': 'Title Abstract Offices' }, { 'industryId': '26_3', 'industryName': 'Hotel and Motel REITs' }, { 'industryId': '26_4', 'industryName': 'Housing Authorities' }, { 'industryId': '26_5', 'industryName': 'Industrial Development Authorities' }, { 'industryId': '26_6', 'industryName': 'Industrial REITs' }, { 'industryId': '26_7', 'industryName': 'Land REITs' }, { 'industryId': '26_8', 'industryName': 'Leisure and Entertainment REITs' }, { 'industryId': '26_9', 'industryName': 'Mobile Homes' } ] }, { 'industry': { 'industryId': '27', 'industryName': 'Retail' }, 'subIndustries': [ { 'industryId': '27_1', 'industryName': 'Arts, Gifts and Novelties Retail' }, { 'industryId': '27_10', 'industryName': 'Footwear Retailers' }, { 'industryId': '27_11', 'industryName': 'Furniture Retailers' }, { 'industryId': '27_12', 'industryName': 'Gasoline Stations' }, { 'industryId': '27_13', 'industryName': 'Grocery and Food Stores' }, { 'industryId': '27_14', 'industryName': 'Hardware and Garden stores' }, { 'industryId': '27_15', 'industryName': 'Hobby, Toy and Game Stores' }, { 'industryId': '27_16', 'industryName': 'Home Furnishings and Improvement Retail' }, { 'industryId': '27_17', 'industryName': 'Home Improvement and Hardware Retail ' }, { 'industryId': '27_18', 'industryName': 'Hyper and Supermarkets' }, { 'industryId': '27_19', 'industryName': 'Jewelry and Gemstone Retail' }, { 'industryId': '27_2', 'industryName': 'Boat Retail' }, { 'industryId': '27_20', 'industryName': 'Lumber Retailers' }, { 'industryId': '27_21', 'industryName': 'Mail-Order Retailers' }, { 'industryId': '27_22', 'industryName': 'Miscellaneous General Retailers' }, { 'industryId': '27_23', 'industryName': 'Mobile Home Dealers' }, { 'industryId': '27_24', 'industryName': 'Motor Vehicle Dealers' }, { 'industryId': '27_25', 'industryName': 'Music, Video and Book Retail' }, { 'industryId': '27_26', 'industryName': 'Musical Equipment Retail' }, { 'industryId': '27_27', 'industryName': 'Party and Holiday Accessories Retail ' }, { 'industryId': '27_28', 'industryName': 'Restaurants, Bars and Eateries' }, { 'industryId': '27_29', 'industryName': 'Retail - Apparel and Accessories' }, { 'industryId': '27_3', 'industryName': 'Building Materials Retailers' }, { 'industryId': '27_30', 'industryName': 'Retail - Department Stores' }, { 'industryId': '27_31', 'industryName': 'Retail - Discount and Variety Stores' }, { 'industryId': '27_32', 'industryName': 'Retail - Drugs' }, { 'industryId': '27_33', 'industryName': 'Retail - Electronics Products' }, { 'industryId': '27_34', 'industryName': 'Retail - Internet and Catalog Order' }, { 'industryId': '27_35', 'industryName': 'Specialty Retailers' }, { 'industryId': '27_36', 'industryName': 'Sports and Recreational Equipment Retail' }, { 'industryId': '27_37', 'industryName': 'Warehouse Clubs and Superstores' }, { 'industryId': '27_38', 'industryName': 'Women\'s Clothing Stores' }, { 'industryId': '27_4', 'industryName': 'Clock parts and Watch Retailers' }, { 'industryId': '27_5', 'industryName': 'Computer and Software Retail' }, { 'industryId': '27_6', 'industryName': 'Convenience Stores' }, { 'industryId': '27_7', 'industryName': 'Cosmetics and Perfume Retail' }, { 'industryId': '27_8', 'industryName': 'Family and Children\'s Products Stores' }, { 'industryId': '27_9', 'industryName': 'Floral and Florists' } ] }, { 'industry': { 'industryId': '28', 'industryName': 'Schools and Education' }, 'subIndustries': [ { 'industryId': '28_1', 'industryName': 'Colleges and Universities' }, { 'industryId': '28_10', 'industryName': 'School Districts' }, { 'industryId': '28_11', 'industryName': 'Training Institutions and Services' }, { 'industryId': '28_12', 'industryName': 'Vocational and Technical Schools' }, { 'industryId': '28_2', 'industryName': 'Community Colleges' }, { 'industryId': '28_3', 'industryName': 'Educational Services' }, { 'industryId': '28_4', 'industryName': 'Elementary and Secondary Schools' }, { 'industryId': '28_5', 'industryName': 'Graduate and Professional Schools' }, { 'industryId': '28_6', 'industryName': 'Internet Educational Services' }, { 'industryId': '28_7', 'industryName': 'Law Schools' }, { 'industryId': '28_8', 'industryName': 'Libraries' }, { 'industryId': '28_9', 'industryName': 'Medical Schools' } ] }, { 'industry': { 'industryId': '29', 'industryName': 'Telecommunications' }, 'subIndustries': [ { 'industryId': '29_1', 'industryName': 'Data Network Operators' }, { 'industryId': '29_10', 'industryName': 'Messaging Services Providers' }, { 'industryId': '29_11', 'industryName': 'Miscellaneous Communications Services' }, { 'industryId': '29_12', 'industryName': 'Miscellaneous Telecommunications ' }, { 'industryId': '29_13', 'industryName': 'Optical Switching and Transmission' }, { 'industryId': '29_14', 'industryName': 'Satellite and Broadcasting Equipment' }, { 'industryId': '29_15', 'industryName': 'Satellite System Operators' }, { 'industryId': '29_16', 'industryName': 'Telecom Equipment and Services' }, { 'industryId': '29_17', 'industryName': 'Telecommunications Equipment' }, { 'industryId': '29_18', 'industryName': 'Telecommunications Infra Development' }, { 'industryId': '29_19', 'industryName': 'Telecommunications Resellers' }, { 'industryId': '29_2', 'industryName': 'Data Services' }, { 'industryId': '29_20', 'industryName': 'Telecommunications Services' }, { 'industryId': '29_21', 'industryName': 'Teleconferencing Services Providers' }, { 'industryId': '29_22', 'industryName': 'Telemetry and Telematics Services' }, { 'industryId': '29_23', 'industryName': 'TV and Radio Broadcasting Equipment' }, { 'industryId': '29_24', 'industryName': 'Videoconferencing Equipment' }, { 'industryId': '29_25', 'industryName': 'Web Hosting Services' }, { 'industryId': '29_26', 'industryName': 'Wire Switching and Transmission' }, { 'industryId': '29_27', 'industryName': 'Wired Telecommunications Carriers' }, { 'industryId': '29_28', 'industryName': 'Wireless Broadband Service Equipment' }, { 'industryId': '29_29', 'industryName': 'Wireless Network Operators' }, { 'industryId': '29_3', 'industryName': 'Electronic Communications Networks' }, { 'industryId': '29_30', 'industryName': 'Wireless Switching and Transmission' }, { 'industryId': '29_31', 'industryName': 'Wireless Telecommunications Equipment' }, { 'industryId': '29_32', 'industryName': 'Wireless Telecommunications Resellers' }, { 'industryId': '29_33', 'industryName': 'Wireless Telecommunications Services' }, { 'industryId': '29_34', 'industryName': 'Wireless Telephone Handsets' }, { 'industryId': '29_35', 'industryName': 'Wireline Telecommunications Equipment' }, { 'industryId': '29_4', 'industryName': 'Enterprise Telecommunications Equipment' }, { 'industryId': '29_5', 'industryName': 'Fixed-Line Voice Services Providers' }, { 'industryId': '29_6', 'industryName': 'Internet and Online Services Providers' }, { 'industryId': '29_7', 'industryName': 'Local Exchange Carriers' }, { 'industryId': '29_8', 'industryName': 'Long-Distance Carriers' }, { 'industryId': '29_9', 'industryName': 'Managed Network Services' } ] }, { 'industry': { 'industryId': '30', 'industryName': 'Transportation' }, 'subIndustries': [ { 'industryId': '30_1', 'industryName': 'Air Freight Transportation' }, { 'industryId': '30_10', 'industryName': 'Highways and Toll Road Management' }, { 'industryId': '30_11', 'industryName': 'Locomotive and Rail Car Manufacturing' }, { 'industryId': '30_12', 'industryName': 'Marine Shipping' }, { 'industryId': '30_13', 'industryName': 'Marine Transportation Support' }, { 'industryId': '30_14', 'industryName': 'Non-Scheduled and Charter Air Transport' }, { 'industryId': '30_15', 'industryName': 'Passenger Railroads' }, { 'industryId': '30_16', 'industryName': 'Ports, Harbors and Marinas' }, { 'industryId': '30_17', 'industryName': 'Postal Services' }, { 'industryId': '30_18', 'industryName': 'Railroad Equipment Manufacturing' }, { 'industryId': '30_19', 'industryName': 'Railroad Terminal Management' }, { 'industryId': '30_2', 'industryName': 'Aircraft Leasing' }, { 'industryId': '30_20', 'industryName': 'Railroads and Rail Tracks Maintenance' }, { 'industryId': '30_21', 'industryName': 'Ship and Boat Manufacturing' }, { 'industryId': '30_22', 'industryName': 'Ship and Boat Parts Manufacturing' }, { 'industryId': '30_23', 'industryName': 'Ship and Boat Repair' }, { 'industryId': '30_24', 'industryName': 'Shipping Equipment' }, { 'industryId': '30_25', 'industryName': 'Storage and Warehousing' }, { 'industryId': '30_26', 'industryName': 'Terminal Facilities For Motor Vehicles' }, { 'industryId': '30_27', 'industryName': 'Transportation Authorities' }, { 'industryId': '30_28', 'industryName': 'Truck Rental and Leasing' }, { 'industryId': '30_29', 'industryName': 'Truck Transportation and Services' }, { 'industryId': '30_3', 'industryName': 'Airlines and Scheduled Air Transport' }, { 'industryId': '30_4', 'industryName': 'Airport and Terminal Management' }, { 'industryId': '30_5', 'industryName': 'Bus Services' }, { 'industryId': '30_6', 'industryName': 'Container Leasing' }, { 'industryId': '30_7', 'industryName': 'Ferries and Water Transport' }, { 'industryId': '30_8', 'industryName': 'Freight Railroads' }, { 'industryId': '30_9', 'industryName': 'Helicopter Services' } ] } ];
/* copyright 2016 wanghongyu. The project page:https://github.com/hardman/AWLive My blog page: http://blog.csdn.net/hard_man/ */ /* utils log等便利函数 */ #ifndef aw_utils_h #define aw_utils_h #include <stdio.h> #include <string.h> #include "aw_alloc.h" #define AWLog(...) \ do{ \ printf(__VA_ARGS__); \ printf("\n");\ }while(0) #define aw_log(...) AWLog(__VA_ARGS__) //视频编码加速,stride须设置为16的倍数 #define aw_stride(wid) ((wid % 16 != 0) ? ((wid) + 16 - (wid) % 16): (wid)) #endif /* aw_utils_h */
import { Base } from '../base' import { Desc } from '../descriptive/desc' import { Metadata } from '../descriptive/metadata' import { Title } from '../descriptive/title' import { Animate } from '../animation/animate' import { AnimateColor } from '../animation/animate-color' import { SVGSet } from '../common/set' import { A } from '../common/a' import { AltGlyph } from './alt-glyph' import { Tref } from './tref' import { CoreAttributes, ConditionalProcessingAttributes, GraphicalEventAttributes, PresentationAttributes, CommonStyleAttributes, ExternalResourceAttributes } from '../../types/common-attributes' type TspanAttributes = CoreAttributes & ConditionalProcessingAttributes & GraphicalEventAttributes & PresentationAttributes & CommonStyleAttributes & ExternalResourceAttributes & { x?: string y?: string dx?: string dy?: string rotate?: string textLength?: string lengthAdjust?: string } type ChildElement = | Desc | Metadata | Title | Animate | AnimateColor | SVGSet | A | AltGlyph | Tref | Tspan class Tspan extends Base<'tspan', TspanAttributes> { public tagName = 'tspan' as const constructor(attrs?: TspanAttributes) { super('tspan', attrs) } public append(child: ChildElement) { super.appendSVG(child) } } export { Tspan, TspanAttributes }
<gh_stars>0 import java.util.concurrent.ScheduledExecutorService; import net.runelite.mapping.Export; import net.runelite.mapping.ObfuscatedGetter; import net.runelite.mapping.ObfuscatedName; import net.runelite.mapping.ObfuscatedSignature; @ObfuscatedName("ap") public enum class34 implements Enumerated { @ObfuscatedName("f") @ObfuscatedSignature( descriptor = "Lap;" ) field236(0, 0); @ObfuscatedName("rl") @ObfuscatedSignature( descriptor = "Lby;" ) @Export("decimator") static Decimator decimator; @ObfuscatedName("g") @Export("soundSystemExecutor") static ScheduledExecutorService soundSystemExecutor; @ObfuscatedName("aw") static String field229; @ObfuscatedName("ak") @ObfuscatedGetter( intValue = -1478025593 ) static int field232; @ObfuscatedName("nb") @ObfuscatedGetter( intValue = -337730907 ) @Export("widgetDragDuration") static int widgetDragDuration; @ObfuscatedName("o") @ObfuscatedGetter( intValue = -1373587667 ) public final int field230; @ObfuscatedName("u") @ObfuscatedGetter( intValue = -2109916151 ) final int field233; class34(int var3, int var4) { this.field230 = var3; // L: 12 this.field233 = var4; // L: 13 } // L: 14 @ObfuscatedName("f") @ObfuscatedSignature( descriptor = "(I)I", garbageValue = "-1000839247" ) @Export("rsOrdinal") public int rsOrdinal() { return this.field233; // L: 17 } @ObfuscatedName("f") @ObfuscatedSignature( descriptor = "(B)Z", garbageValue = "0" ) public static boolean method415() { ReflectionCheck var0 = (ReflectionCheck)class69.reflectionChecks.last(); // L: 24 return var0 != null; // L: 25 } @ObfuscatedName("ex") @ObfuscatedSignature( descriptor = "(I)V", garbageValue = "-842302459" ) @Export("load") static void load() { int var26; if (Client.titleLoadingStage == 0) { // L: 1281 WorldMapArea.scene = new Scene(4, 104, 104, Tiles.Tiles_heights); // L: 1282 for (var26 = 0; var26 < 4; ++var26) { // L: 1283 Client.collisionMaps[var26] = new CollisionMap(104, 104); } class19.sceneMinimapSprite = new SpritePixels(512, 512); // L: 1284 Login.Login_loadingText = "Starting game engine..."; // L: 1285 Login.Login_loadingPercent = 5; // L: 1286 Client.titleLoadingStage = 20; // L: 1287 } else if (Client.titleLoadingStage == 20) { // L: 1290 Login.Login_loadingText = "Prepared visibility map"; // L: 1291 Login.Login_loadingPercent = 10; // L: 1292 Client.titleLoadingStage = 30; // L: 1293 } else if (Client.titleLoadingStage == 30) { // L: 1296 TriBool.archive0 = HitSplatDefinition.newArchive(0, false, true, true); // L: 1297 class367.archive1 = HitSplatDefinition.newArchive(1, false, true, true); // L: 1298 class235.archive2 = HitSplatDefinition.newArchive(2, true, false, true); // L: 1299 class5.archive3 = HitSplatDefinition.newArchive(3, false, true, true); // L: 1300 ItemContainer.archive4 = HitSplatDefinition.newArchive(4, false, true, true); // L: 1301 class157.archive5 = HitSplatDefinition.newArchive(5, true, true, true); // L: 1302 class8.archive6 = HitSplatDefinition.newArchive(6, true, true, true); // L: 1303 class12.archive7 = HitSplatDefinition.newArchive(7, false, true, true); // L: 1304 SoundSystem.archive8 = HitSplatDefinition.newArchive(8, false, true, true); // L: 1305 AbstractWorldMapData.archive9 = HitSplatDefinition.newArchive(9, false, true, true); // L: 1306 class373.archive10 = HitSplatDefinition.newArchive(10, false, true, true); // L: 1307 class10.archive11 = HitSplatDefinition.newArchive(11, false, true, true); // L: 1308 BuddyRankComparator.archive12 = HitSplatDefinition.newArchive(12, false, true, true); // L: 1309 MilliClock.archive13 = HitSplatDefinition.newArchive(13, true, false, true); // L: 1310 WorldMapSection0.archive14 = HitSplatDefinition.newArchive(14, false, true, true); // L: 1311 Buddy.archive15 = HitSplatDefinition.newArchive(15, false, true, true); // L: 1312 class0.archive17 = HitSplatDefinition.newArchive(17, true, true, true); // L: 1313 class246.archive18 = HitSplatDefinition.newArchive(18, false, true, true); // L: 1314 class283.archive19 = HitSplatDefinition.newArchive(19, false, true, true); // L: 1315 NPCComposition.archive20 = HitSplatDefinition.newArchive(20, false, true, true); // L: 1316 Login.Login_loadingText = "Connecting to update server"; // L: 1317 Login.Login_loadingPercent = 20; // L: 1318 Client.titleLoadingStage = 40; // L: 1319 } else if (Client.titleLoadingStage != 40) { // L: 1322 Archive var21; Archive var22; Archive var23; if (Client.titleLoadingStage == 45) { // L: 1369 boolean var30 = !Client.isLowDetail; // L: 1370 PcmPlayer.field394 = 22050; // L: 1373 PcmPlayer.PcmPlayer_stereo = var30; // L: 1374 Frames.field2007 = 2; // L: 1375 MidiPcmStream var27 = new MidiPcmStream(); // L: 1377 var27.method3938(9, 128); // L: 1378 ApproximateRouteStrategy.pcmPlayer0 = class3.method57(GameEngine.taskHandler, 0, 22050); // L: 1379 ApproximateRouteStrategy.pcmPlayer0.setStream(var27); // L: 1380 var21 = Buddy.archive15; // L: 1381 var22 = WorldMapSection0.archive14; // L: 1382 var23 = ItemContainer.archive4; // L: 1383 class210.musicPatchesArchive = var21; // L: 1385 class372.musicSamplesArchive = var22; // L: 1386 class210.soundEffectsArchive = var23; // L: 1387 class210.midiPcmStream = var27; // L: 1388 class43.pcmPlayer1 = class3.method57(GameEngine.taskHandler, 1, 2048); // L: 1390 Huffman.pcmStreamMixer = new PcmStreamMixer(); // L: 1391 class43.pcmPlayer1.setStream(Huffman.pcmStreamMixer); // L: 1392 decimator = new Decimator(22050, PcmPlayer.field394); // L: 1393 Login.Login_loadingText = "Prepared sound engine"; // L: 1394 Login.Login_loadingPercent = 35; // L: 1395 Client.titleLoadingStage = 50; // L: 1396 class243.WorldMapElement_fonts = new Fonts(SoundSystem.archive8, MilliClock.archive13); // L: 1397 } else { int var1; if (Client.titleLoadingStage == 50) { // L: 1400 FontName[] var25 = new FontName[]{FontName.FontName_verdana11, FontName.FontName_plain12, FontName.FontName_verdana15, FontName.FontName_bold12, FontName.FontName_plain11, FontName.FontName_verdana13}; // L: 1403 var1 = var25.length; // L: 1405 Fonts var28 = class243.WorldMapElement_fonts; // L: 1406 FontName[] var29 = new FontName[]{FontName.FontName_verdana11, FontName.FontName_plain12, FontName.FontName_verdana15, FontName.FontName_bold12, FontName.FontName_plain11, FontName.FontName_verdana13}; // L: 1409 Client.fontsMap = var28.createMap(var29); // L: 1411 if (Client.fontsMap.size() < var1) { // L: 1412 Login.Login_loadingText = "Loading fonts - " + Client.fontsMap.size() * 100 / var1 + "%"; // L: 1413 Login.Login_loadingPercent = 40; // L: 1414 } else { class0.fontPlain11 = (Font)Client.fontsMap.get(FontName.FontName_plain11); // L: 1417 class14.fontPlain12 = (Font)Client.fontsMap.get(FontName.FontName_plain12); // L: 1418 class368.fontBold12 = (Font)Client.fontsMap.get(FontName.FontName_bold12); // L: 1419 UserComparator8.platformInfo = Client.platformInfoProvider.get(); // L: 1420 Login.Login_loadingText = "Loaded fonts"; // L: 1421 Login.Login_loadingPercent = 40; // L: 1422 Client.titleLoadingStage = 60; // L: 1423 } } else { int var3; int var4; Archive var20; if (Client.titleLoadingStage == 60) { // L: 1426 var20 = class373.archive10; // L: 1428 var21 = SoundSystem.archive8; // L: 1429 var3 = 0; // L: 1431 if (var20.tryLoadFileByNames("title.jpg", "")) { // L: 1432 ++var3; } if (var21.tryLoadFileByNames("logo", "")) { // L: 1433 ++var3; } if (var21.tryLoadFileByNames("logo_deadman_mode", "")) { // L: 1434 ++var3; } if (var21.tryLoadFileByNames("logo_seasonal_mode", "")) { // L: 1435 ++var3; } if (var21.tryLoadFileByNames("titlebox", "")) { // L: 1436 ++var3; } if (var21.tryLoadFileByNames("titlebutton", "")) { // L: 1437 ++var3; } if (var21.tryLoadFileByNames("runes", "")) { // L: 1438 ++var3; } if (var21.tryLoadFileByNames("title_mute", "")) { // L: 1439 ++var3; } if (var21.tryLoadFileByNames("options_radio_buttons,0", "")) { // L: 1440 ++var3; } if (var21.tryLoadFileByNames("options_radio_buttons,2", "")) { // L: 1441 ++var3; } if (var21.tryLoadFileByNames("options_radio_buttons,4", "")) { // L: 1442 ++var3; } if (var21.tryLoadFileByNames("options_radio_buttons,6", "")) { // L: 1443 ++var3; } var21.tryLoadFileByNames("sl_back", ""); // L: 1444 var21.tryLoadFileByNames("sl_flags", ""); // L: 1445 var21.tryLoadFileByNames("sl_arrows", ""); // L: 1446 var21.tryLoadFileByNames("sl_stars", ""); // L: 1447 var21.tryLoadFileByNames("sl_button", ""); // L: 1448 var4 = DirectByteArrayCopier.method4354(); // L: 1452 if (var3 < var4) { // L: 1453 Login.Login_loadingText = "Loading title screen - " + var3 * 100 / var4 + "%"; // L: 1454 Login.Login_loadingPercent = 50; // L: 1455 } else { Login.Login_loadingText = "Loaded title screen"; // L: 1458 Login.Login_loadingPercent = 50; // L: 1459 class20.updateGameState(5); // L: 1460 Client.titleLoadingStage = 70; // L: 1461 } } else if (Client.titleLoadingStage == 70) { // L: 1464 if (!class235.archive2.isFullyLoaded()) { // L: 1465 Login.Login_loadingText = "Loading config - " + class235.archive2.loadPercent() + "%"; // L: 1466 Login.Login_loadingPercent = 60; // L: 1467 } else { Archive var24 = class235.archive2; // L: 1470 FloorOverlayDefinition.FloorOverlayDefinition_archive = var24; // L: 1472 class0.method13(class235.archive2); // L: 1474 var20 = class235.archive2; // L: 1475 var21 = class12.archive7; // L: 1476 KitDefinition.KitDefinition_archive = var20; // L: 1478 class266.KitDefinition_modelsArchive = var21; // L: 1479 KitDefinition.KitDefinition_fileCount = KitDefinition.KitDefinition_archive.getGroupFileCount(3); // L: 1480 var22 = class235.archive2; // L: 1482 var23 = class12.archive7; // L: 1483 boolean var5 = Client.isLowDetail; // L: 1484 ObjectComposition.ObjectDefinition_archive = var22; // L: 1486 ObjectComposition.ObjectDefinition_modelsArchive = var23; // L: 1487 ObjectComposition.ObjectDefinition_isLowDetail = var5; // L: 1488 Decimator.method1114(class235.archive2, class12.archive7); // L: 1490 Archive var6 = class235.archive2; // L: 1491 StructComposition.StructDefinition_archive = var6; // L: 1493 ScriptEvent.method2101(class235.archive2, class12.archive7, Client.isMembersWorld, class0.fontPlain11); // L: 1495 Archive var7 = class235.archive2; // L: 1496 Archive var8 = TriBool.archive0; // L: 1497 Archive var9 = class367.archive1; // L: 1498 SequenceDefinition.SequenceDefinition_archive = var7; // L: 1500 GrandExchangeOfferOwnWorldComparator.SequenceDefinition_animationsArchive = var8; // L: 1501 SequenceDefinition.SequenceDefinition_skeletonsArchive = var9; // L: 1502 Archive var10 = class235.archive2; // L: 1504 Archive var11 = class12.archive7; // L: 1505 SpotAnimationDefinition.SpotAnimationDefinition_archive = var10; // L: 1507 SpotAnimationDefinition.SpotAnimationDefinition_modelArchive = var11; // L: 1508 Archive var12 = class235.archive2; // L: 1510 VarbitComposition.VarbitDefinition_archive = var12; // L: 1512 ItemLayer.method3268(class235.archive2); // L: 1514 Archive var13 = class5.archive3; // L: 1515 Archive var14 = class12.archive7; // L: 1516 Archive var15 = SoundSystem.archive8; // L: 1517 Archive var16 = MilliClock.archive13; // L: 1518 FloorDecoration.Widget_archive = var13; // L: 1520 WorldMapDecoration.Widget_modelsArchive = var14; // L: 1521 UrlRequest.Widget_spritesArchive = var15; // L: 1522 class32.Widget_fontsArchive = var16; // L: 1523 Widget.Widget_interfaceComponents = new Widget[FloorDecoration.Widget_archive.getGroupCount()][]; // L: 1524 class69.Widget_loadedInterfaces = new boolean[FloorDecoration.Widget_archive.getGroupCount()]; // L: 1525 Archive var17 = class235.archive2; // L: 1527 InvDefinition.InvDefinition_archive = var17; // L: 1529 Archive var18 = class235.archive2; // L: 1531 EnumComposition.EnumDefinition_archive = var18; // L: 1533 class303.method5526(class235.archive2); // L: 1535 class6.method97(class235.archive2); // L: 1536 TextureProvider.varcs = new Varcs(); // L: 1537 WorldMapSection0.method3034(class235.archive2, SoundSystem.archive8, MilliClock.archive13); // L: 1538 VertexNormal.method3782(class235.archive2, SoundSystem.archive8); // L: 1539 class18.method280(class235.archive2, SoundSystem.archive8); // L: 1540 Login.Login_loadingText = "Loaded config"; // L: 1541 Login.Login_loadingPercent = 60; // L: 1542 Client.titleLoadingStage = 80; // L: 1543 } } else if (Client.titleLoadingStage == 80) { // L: 1546 var26 = 0; // L: 1547 if (class22.compass == null) { // L: 1548 class22.compass = ModelData0.SpriteBuffer_getSprite(SoundSystem.archive8, class32.spriteIds.compass, 0); } else { ++var26; // L: 1549 } if (class32.redHintArrowSprite == null) { // L: 1550 class32.redHintArrowSprite = ModelData0.SpriteBuffer_getSprite(SoundSystem.archive8, class32.spriteIds.field3898, 0); } else { ++var26; // L: 1551 } if (class18.mapSceneSprites == null) { // L: 1552 class18.mapSceneSprites = class309.method5603(SoundSystem.archive8, class32.spriteIds.mapScenes, 0); } else { ++var26; // L: 1553 } if (ItemContainer.headIconPkSprites == null) { // L: 1554 ItemContainer.headIconPkSprites = class337.method5985(SoundSystem.archive8, class32.spriteIds.headIconsPk, 0); } else { ++var26; // L: 1555 } if (ArchiveDiskActionHandler.headIconPrayerSprites == null) { // L: 1556 ArchiveDiskActionHandler.headIconPrayerSprites = class337.method5985(SoundSystem.archive8, class32.spriteIds.field3901, 0); } else { ++var26; // L: 1557 } if (Script.headIconHintSprites == null) { // L: 1558 Script.headIconHintSprites = class337.method5985(SoundSystem.archive8, class32.spriteIds.field3897, 0); } else { ++var26; // L: 1559 } if (class14.mapMarkerSprites == null) { // L: 1560 class14.mapMarkerSprites = class337.method5985(SoundSystem.archive8, class32.spriteIds.field3903, 0); } else { ++var26; // L: 1561 } if (class18.crossSprites == null) { // L: 1562 class18.crossSprites = class337.method5985(SoundSystem.archive8, class32.spriteIds.field3907, 0); } else { ++var26; // L: 1563 } if (class244.mapDotSprites == null) { // L: 1564 class244.mapDotSprites = class337.method5985(SoundSystem.archive8, class32.spriteIds.field3902, 0); } else { ++var26; // L: 1565 } if (NPCComposition.scrollBarSprites == null) { // L: 1566 NPCComposition.scrollBarSprites = class309.method5603(SoundSystem.archive8, class32.spriteIds.field3906, 0); } else { ++var26; // L: 1567 } if (class93.modIconSprites == null) { // L: 1568 class93.modIconSprites = class309.method5603(SoundSystem.archive8, class32.spriteIds.field3899, 0); } else { ++var26; // L: 1569 } if (var26 < 11) { // L: 1570 Login.Login_loadingText = "Loading sprites - " + var26 * 100 / 12 + "%"; // L: 1571 Login.Login_loadingPercent = 70; // L: 1572 } else { AbstractFont.AbstractFont_modIconSprites = class93.modIconSprites; // L: 1575 class32.redHintArrowSprite.normalize(); // L: 1576 var1 = (int)(Math.random() * 21.0D) - 10; // L: 1577 int var2 = (int)(Math.random() * 21.0D) - 10; // L: 1578 var3 = (int)(Math.random() * 21.0D) - 10; // L: 1579 var4 = (int)(Math.random() * 41.0D) - 20; // L: 1580 class18.mapSceneSprites[0].shiftColors(var4 + var1, var4 + var2, var4 + var3); // L: 1581 Login.Login_loadingText = "Loaded sprites"; // L: 1582 Login.Login_loadingPercent = 70; // L: 1583 Client.titleLoadingStage = 90; // L: 1584 } } else if (Client.titleLoadingStage == 90) { // L: 1587 if (!AbstractWorldMapData.archive9.isFullyLoaded()) { // L: 1588 Login.Login_loadingText = "Loading textures - " + "0%"; // L: 1589 Login.Login_loadingPercent = 90; // L: 1590 } else { FriendLoginUpdate.textureProvider = new TextureProvider(AbstractWorldMapData.archive9, SoundSystem.archive8, 20, Login.clientPreferences.field1304, Client.isLowDetail ? 64 : 128); // L: 1593 Rasterizer3D.Rasterizer3D_setTextureLoader(FriendLoginUpdate.textureProvider); // L: 1594 Rasterizer3D.Rasterizer3D_setBrightness(Login.clientPreferences.field1304); // L: 1595 Client.titleLoadingStage = 100; // L: 1596 } } else if (Client.titleLoadingStage == 100) { // L: 1599 var26 = FriendLoginUpdate.textureProvider.getLoadedPercentage(); // L: 1600 if (var26 < 100) { // L: 1601 Login.Login_loadingText = "Loading textures - " + var26 + "%"; // L: 1602 Login.Login_loadingPercent = 90; // L: 1603 } else { Login.Login_loadingText = "Loaded textures"; // L: 1606 Login.Login_loadingPercent = 90; // L: 1607 Client.titleLoadingStage = 110; // L: 1608 } } else if (Client.titleLoadingStage == 110) { // L: 1611 Language.mouseRecorder = new MouseRecorder(); // L: 1612 GameEngine.taskHandler.newThreadTask(Language.mouseRecorder, 10); // L: 1613 Login.Login_loadingText = "Loaded input handler"; // L: 1614 Login.Login_loadingPercent = 92; // L: 1615 Client.titleLoadingStage = 120; // L: 1616 } else if (Client.titleLoadingStage == 120) { // L: 1619 if (!class373.archive10.tryLoadFileByNames("huffman", "")) { // L: 1620 Login.Login_loadingText = "Loading wordpack - " + 0 + "%"; // L: 1621 Login.Login_loadingPercent = 94; // L: 1622 } else { Huffman var0 = new Huffman(class373.archive10.takeFileByNames("huffman", "")); // L: 1625 ClientPacket.method3884(var0); // L: 1626 Login.Login_loadingText = "Loaded wordpack"; // L: 1627 Login.Login_loadingPercent = 94; // L: 1628 Client.titleLoadingStage = 130; // L: 1629 } } else if (Client.titleLoadingStage == 130) { // L: 1632 if (!class5.archive3.isFullyLoaded()) { // L: 1633 Login.Login_loadingText = "Loading interfaces - " + class5.archive3.loadPercent() * 4 / 5 + "%"; // L: 1634 Login.Login_loadingPercent = 96; // L: 1635 } else if (!BuddyRankComparator.archive12.isFullyLoaded()) { // L: 1638 Login.Login_loadingText = "Loading interfaces - " + (80 + BuddyRankComparator.archive12.loadPercent() / 6) + "%"; // L: 1639 Login.Login_loadingPercent = 96; // L: 1640 } else if (!MilliClock.archive13.isFullyLoaded()) { // L: 1643 Login.Login_loadingText = "Loading interfaces - " + (96 + MilliClock.archive13.loadPercent() / 50) + "%"; // L: 1644 Login.Login_loadingPercent = 96; // L: 1645 } else { Login.Login_loadingText = "Loaded interfaces"; // L: 1648 Login.Login_loadingPercent = 98; // L: 1649 Client.titleLoadingStage = 140; // L: 1650 } } else if (Client.titleLoadingStage == 140) { // L: 1653 Login.Login_loadingPercent = 100; // L: 1654 if (!class283.archive19.tryLoadGroupByName(WorldMapCacheName.field1768.name)) { // L: 1655 Login.Login_loadingText = "Loading world map - " + class283.archive19.groupLoadPercentByName(WorldMapCacheName.field1768.name) / 10 + "%"; // L: 1656 } else { if (UserComparator4.worldMap == null) { // L: 1659 UserComparator4.worldMap = new WorldMap(); // L: 1660 UserComparator4.worldMap.init(class283.archive19, class246.archive18, NPCComposition.archive20, class368.fontBold12, Client.fontsMap, class18.mapSceneSprites); // L: 1661 } Login.Login_loadingText = "Loaded world map"; // L: 1663 Client.titleLoadingStage = 150; // L: 1664 } } else if (Client.titleLoadingStage == 150) { // L: 1667 class20.updateGameState(10); // L: 1668 } } } } else { byte var19 = 0; // L: 1323 var26 = var19 + TriBool.archive0.percentage() * 4 / 100; // L: 1324 var26 += class367.archive1.percentage() * 4 / 100; // L: 1325 var26 += class235.archive2.percentage() * 2 / 100; // L: 1326 var26 += class5.archive3.percentage() * 2 / 100; // L: 1327 var26 += ItemContainer.archive4.percentage() * 6 / 100; // L: 1328 var26 += class157.archive5.percentage() * 4 / 100; // L: 1329 var26 += class8.archive6.percentage() * 2 / 100; // L: 1330 var26 += class12.archive7.percentage() * 56 / 100; // L: 1331 var26 += SoundSystem.archive8.percentage() * 2 / 100; // L: 1332 var26 += AbstractWorldMapData.archive9.percentage() * 2 / 100; // L: 1333 var26 += class373.archive10.percentage() * 2 / 100; // L: 1334 var26 += class10.archive11.percentage() * 2 / 100; // L: 1335 var26 += BuddyRankComparator.archive12.percentage() * 2 / 100; // L: 1336 var26 += MilliClock.archive13.percentage() * 2 / 100; // L: 1337 var26 += WorldMapSection0.archive14.percentage() * 2 / 100; // L: 1338 var26 += Buddy.archive15.percentage() * 2 / 100; // L: 1339 var26 += class283.archive19.percentage() / 100; // L: 1340 var26 += class246.archive18.percentage() / 100; // L: 1341 var26 += NPCComposition.archive20.percentage() / 100; // L: 1342 var26 += class0.archive17.method4430() && class0.archive17.isFullyLoaded() ? 1 : 0; // L: 1343 if (var26 != 100) { // L: 1344 if (var26 != 0) { // L: 1345 Login.Login_loadingText = "Checking for updates - " + var26 + "%"; } Login.Login_loadingPercent = 30; // L: 1346 } else { class231.method4356(TriBool.archive0, "Animations"); // L: 1349 class231.method4356(class367.archive1, "Skeletons"); // L: 1350 class231.method4356(ItemContainer.archive4, "Sound FX"); // L: 1351 class231.method4356(class157.archive5, "Maps"); // L: 1352 class231.method4356(class8.archive6, "Music Tracks"); // L: 1353 class231.method4356(class12.archive7, "Models"); // L: 1354 class231.method4356(SoundSystem.archive8, "Sprites"); // L: 1355 class231.method4356(class10.archive11, "Music Jingles"); // L: 1356 class231.method4356(WorldMapSection0.archive14, "Music Samples"); // L: 1357 class231.method4356(Buddy.archive15, "Music Patches"); // L: 1358 class231.method4356(class283.archive19, "World Map"); // L: 1359 class231.method4356(class246.archive18, "World Map Geography"); // L: 1360 class231.method4356(NPCComposition.archive20, "World Map Ground"); // L: 1361 class32.spriteIds = new GraphicsDefaults(); // L: 1362 class32.spriteIds.decode(class0.archive17); // L: 1363 Login.Login_loadingText = "Loaded update list"; // L: 1364 Login.Login_loadingPercent = 30; // L: 1365 Client.titleLoadingStage = 45; // L: 1366 } } } // L: 1288 1294 1320 1347 1367 1398 1415 1424 1456 1462 1468 1544 1573 1585 1591 1597 1604 1609 1617 1623 1630 1636 1641 1646 1651 1657 1665 1669 1671 @ObfuscatedName("gn") @ObfuscatedSignature( descriptor = "(I)I", garbageValue = "927217331" ) static final int method420() { if (Login.clientPreferences.roofsHidden) { // L: 4051 return class26.Client_plane; } else { int var0 = UserComparator7.getTileHeight(ModeWhere.cameraX, ReflectionCheck.cameraZ, class26.Client_plane); // L: 4052 return var0 - WorldMapRectangle.cameraY < 800 && (Tiles.Tiles_renderFlags[class26.Client_plane][ModeWhere.cameraX >> 7][ReflectionCheck.cameraZ >> 7] & 4) != 0 ? class26.Client_plane : 3; // L: 4053 4054 } } }
import Vue from 'vue' import Vuex from 'vuex' import * as actions from './actions' import * as getters from './getters' import cart from './modules/cart' import products from './modules/products' import users from './modules/users' import app from './modules/app' Vue.use(Vuex) const debug = process.env.NODE_ENV !== 'production' export default new Vuex.Store({ actions, getters, modules: { app, cart, products, users }, strict: debug })
/** * */ /** * @author abinash * */ package tests.renderTest.scenes;
<reponame>Key-CN/Live555Porting-for-Android /********** This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.) This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA **********/ // "liveMedia" // Copyright (c) 1996-2017 Live Networks, Inc. All rights reserved. // A data structure that represents a session that consists of // potentially multiple (audio and/or video) sub-sessions // (This data structure is used for media *streamers* - i.e., servers. // For media receivers, use "MediaSession" instead.) // Implementation #include "ServerMediaSession.hh" #include <GroupsockHelper.hh> #include <math.h> #if defined(__WIN32__) || defined(_WIN32) || defined(_QNX4) #define snprintf _snprintf #endif ////////// ServerMediaSession ////////// ServerMediaSession* ServerMediaSession ::createNew(UsageEnvironment& env, char const* streamName, char const* info, char const* description, Boolean isSSM, char const* miscSDPLines) { return new ServerMediaSession(env, streamName, info, description, isSSM, miscSDPLines); } Boolean ServerMediaSession ::lookupByName(UsageEnvironment& env, char const* mediumName, ServerMediaSession*& resultSession) { resultSession = NULL; // unless we succeed Medium* medium; if (!Medium::lookupByName(env, mediumName, medium)) return False; if (!medium->isServerMediaSession()) { env.setResultMsg(mediumName, " is not a 'ServerMediaSession' object"); return False; } resultSession = (ServerMediaSession*)medium; return True; } static char const* const libNameStr = "LIVE555 Streaming Media v"; char const* const libVersionStr = LIVEMEDIA_LIBRARY_VERSION_STRING; ServerMediaSession::ServerMediaSession(UsageEnvironment& env, char const* streamName, char const* info, char const* description, Boolean isSSM, char const* miscSDPLines) : Medium(env), fIsSSM(isSSM), fSubsessionsHead(NULL), fSubsessionsTail(NULL), fSubsessionCounter(0), fReferenceCount(0), fDeleteWhenUnreferenced(False) { fStreamName = strDup(streamName == NULL ? "" : streamName); char* libNamePlusVersionStr = NULL; // by default if (info == NULL || description == NULL) { libNamePlusVersionStr = new char[strlen(libNameStr) + strlen(libVersionStr) + 1]; sprintf(libNamePlusVersionStr, "%s%s", libNameStr, libVersionStr); } fInfoSDPString = strDup(info == NULL ? libNamePlusVersionStr : info); fDescriptionSDPString = strDup(description == NULL ? libNamePlusVersionStr : description); delete[] libNamePlusVersionStr; fMiscSDPLines = strDup(miscSDPLines == NULL ? "" : miscSDPLines); gettimeofday(&fCreationTime, NULL); } ServerMediaSession::~ServerMediaSession() { deleteAllSubsessions(); delete[] fStreamName; delete[] fInfoSDPString; delete[] fDescriptionSDPString; delete[] fMiscSDPLines; } Boolean ServerMediaSession::addSubsession(ServerMediaSubsession* subsession) { if (subsession->fParentSession != NULL) return False; // it's already used if (fSubsessionsTail == NULL) { fSubsessionsHead = subsession; } else { fSubsessionsTail->fNext = subsession; } fSubsessionsTail = subsession; subsession->fParentSession = this; subsession->fTrackNumber = ++fSubsessionCounter; return True; } void ServerMediaSession::testScaleFactor(float& scale) { // First, try setting all subsessions to the desired scale. // If the subsessions' actual scales differ from each other, choose the // value that's closest to 1, and then try re-setting all subsessions to that // value. If the subsessions' actual scales still differ, re-set them all to 1. float minSSScale = 1.0; float maxSSScale = 1.0; float bestSSScale = 1.0; float bestDistanceTo1 = 0.0; ServerMediaSubsession* subsession; for (subsession = fSubsessionsHead; subsession != NULL; subsession = subsession->fNext) { float ssscale = scale; subsession->testScaleFactor(ssscale); if (subsession == fSubsessionsHead) { // this is the first subsession minSSScale = maxSSScale = bestSSScale = ssscale; bestDistanceTo1 = (float)fabs(ssscale - 1.0f); } else { if (ssscale < minSSScale) { minSSScale = ssscale; } else if (ssscale > maxSSScale) { maxSSScale = ssscale; } float distanceTo1 = (float)fabs(ssscale - 1.0f); if (distanceTo1 < bestDistanceTo1) { bestSSScale = ssscale; bestDistanceTo1 = distanceTo1; } } } if (minSSScale == maxSSScale) { // All subsessions are at the same scale: minSSScale == bestSSScale == maxSSScale scale = minSSScale; return; } // The scales for each subsession differ. Try to set each one to the value // that's closest to 1: for (subsession = fSubsessionsHead; subsession != NULL; subsession = subsession->fNext) { float ssscale = bestSSScale; subsession->testScaleFactor(ssscale); if (ssscale != bestSSScale) break; // no luck } if (subsession == NULL) { // All subsessions are at the same scale: bestSSScale scale = bestSSScale; return; } // Still no luck. Set each subsession's scale to 1: for (subsession = fSubsessionsHead; subsession != NULL; subsession = subsession->fNext) { float ssscale = 1; subsession->testScaleFactor(ssscale); } scale = 1; } float ServerMediaSession::duration() const { float minSubsessionDuration = 0.0; float maxSubsessionDuration = 0.0; for (ServerMediaSubsession* subsession = fSubsessionsHead; subsession != NULL; subsession = subsession->fNext) { // Hack: If any subsession supports seeking by 'absolute' time, then return a negative value, to indicate that only subsessions // will have a "a=range:" attribute: char* absStartTime = NULL; char* absEndTime = NULL; subsession->getAbsoluteTimeRange(absStartTime, absEndTime); if (absStartTime != NULL) return -1.0f; float ssduration = subsession->duration(); if (subsession == fSubsessionsHead) { // this is the first subsession minSubsessionDuration = maxSubsessionDuration = ssduration; } else if (ssduration < minSubsessionDuration) { minSubsessionDuration = ssduration; } else if (ssduration > maxSubsessionDuration) { maxSubsessionDuration = ssduration; } } if (maxSubsessionDuration != minSubsessionDuration) { return -maxSubsessionDuration; // because subsession durations differ } else { return maxSubsessionDuration; // all subsession durations are the same } } void ServerMediaSession::noteLiveness() { // default implementation: do nothing } void ServerMediaSession::deleteAllSubsessions() { Medium::close(fSubsessionsHead); fSubsessionsHead = fSubsessionsTail = NULL; fSubsessionCounter = 0; } Boolean ServerMediaSession::isServerMediaSession() const { return True; } char* ServerMediaSession::generateSDPDescription() { AddressString ipAddressStr(ourIPAddress(envir())); unsigned ipAddressStrSize = strlen(ipAddressStr.val()); // For a SSM sessions, we need a "a=source-filter: incl ..." line also: char* sourceFilterLine; if (fIsSSM) { char const* const sourceFilterFmt = "a=source-filter: incl IN IP4 * %s\r\n" "a=rtcp-unicast: reflection\r\n"; unsigned const sourceFilterFmtSize = strlen(sourceFilterFmt) + ipAddressStrSize + 1; sourceFilterLine = new char[sourceFilterFmtSize]; sprintf(sourceFilterLine, sourceFilterFmt, ipAddressStr.val()); } else { sourceFilterLine = strDup(""); } char* rangeLine = NULL; // for now char* sdp = NULL; // for now do { // Count the lengths of each subsession's media-level SDP lines. // (We do this first, because the call to "subsession->sdpLines()" // causes correct subsession 'duration()'s to be calculated later.) unsigned sdpLength = 0; ServerMediaSubsession* subsession; for (subsession = fSubsessionsHead; subsession != NULL; subsession = subsession->fNext) { char const* sdpLines = subsession->sdpLines(); if (sdpLines == NULL) continue; // the media's not available sdpLength += strlen(sdpLines); } if (sdpLength == 0) break; // the session has no usable subsessions // Unless subsessions have differing durations, we also have a "a=range:" line: float dur = duration(); if (dur == 0.0) { rangeLine = strDup("a=range:npt=0-\r\n"); } else if (dur > 0.0) { char buf[100]; sprintf(buf, "a=range:npt=0-%.3f\r\n", dur); rangeLine = strDup(buf); } else { // subsessions have differing durations, so "a=range:" lines go there rangeLine = strDup(""); } char const* const sdpPrefixFmt = "v=0\r\n" "o=- %ld%06ld %d IN IP4 %s\r\n" "s=%s\r\n" "i=%s\r\n" "t=0 0\r\n" "a=tool:%s%s\r\n" "a=type:broadcast\r\n" "a=control:*\r\n" "%s" "%s" "a=x-qt-text-nam:%s\r\n" "a=x-qt-text-inf:%s\r\n" "%s"; sdpLength += strlen(sdpPrefixFmt) + 20 + 6 + 20 + ipAddressStrSize + strlen(fDescriptionSDPString) + strlen(fInfoSDPString) + strlen(libNameStr) + strlen(libVersionStr) + strlen(sourceFilterLine) + strlen(rangeLine) + strlen(fDescriptionSDPString) + strlen(fInfoSDPString) + strlen(fMiscSDPLines); sdpLength += 1000; // in case the length of the "subsession->sdpLines()" calls below change sdp = new char[sdpLength]; if (sdp == NULL) break; // Generate the SDP prefix (session-level lines): snprintf(sdp, sdpLength, sdpPrefixFmt, fCreationTime.tv_sec, fCreationTime.tv_usec, // o= <session id> 1, // o= <version> // (needs to change if params are modified) ipAddressStr.val(), // o= <address> fDescriptionSDPString, // s= <description> fInfoSDPString, // i= <info> libNameStr, libVersionStr, // a=tool: sourceFilterLine, // a=source-filter: incl (if a SSM session) rangeLine, // a=range: line fDescriptionSDPString, // a=x-qt-text-nam: line fInfoSDPString, // a=x-qt-text-inf: line fMiscSDPLines); // miscellaneous session SDP lines (if any) // Then, add the (media-level) lines for each subsession: char* mediaSDP = sdp; for (subsession = fSubsessionsHead; subsession != NULL; subsession = subsession->fNext) { unsigned mediaSDPLength = strlen(mediaSDP); mediaSDP += mediaSDPLength; sdpLength -= mediaSDPLength; if (sdpLength <= 1) break; // the SDP has somehow become too long char const* sdpLines = subsession->sdpLines(); if (sdpLines != NULL) snprintf(mediaSDP, sdpLength, "%s", sdpLines); } } while (0); delete[] rangeLine; delete[] sourceFilterLine; return sdp; } ////////// ServerMediaSubsessionIterator ////////// ServerMediaSubsessionIterator ::ServerMediaSubsessionIterator(ServerMediaSession& session) : fOurSession(session) { reset(); } ServerMediaSubsessionIterator::~ServerMediaSubsessionIterator() { } ServerMediaSubsession* ServerMediaSubsessionIterator::next() { ServerMediaSubsession* result = fNextPtr; if (fNextPtr != NULL) fNextPtr = fNextPtr->fNext; return result; } void ServerMediaSubsessionIterator::reset() { fNextPtr = fOurSession.fSubsessionsHead; } ////////// ServerMediaSubsession ////////// ServerMediaSubsession::ServerMediaSubsession(UsageEnvironment& env) : Medium(env), fParentSession(NULL), fServerAddressForSDP(0), fPortNumForSDP(0), fNext(NULL), fTrackNumber(0), fTrackId(NULL) { } ServerMediaSubsession::~ServerMediaSubsession() { delete[] (char*)fTrackId; Medium::close(fNext); } char const* ServerMediaSubsession::trackId() { if (fTrackNumber == 0) return NULL; // not yet in a ServerMediaSession if (fTrackId == NULL) { char buf[100]; sprintf(buf, "track%d", fTrackNumber); fTrackId = strDup(buf); } return fTrackId; } void ServerMediaSubsession::pauseStream(unsigned /*clientSessionId*/, void* /*streamToken*/) { // default implementation: do nothing } void ServerMediaSubsession::seekStream(unsigned /*clientSessionId*/, void* /*streamToken*/, double& /*seekNPT*/, double /*streamDuration*/, u_int64_t& numBytes) { // default implementation: do nothing numBytes = 0; } void ServerMediaSubsession::seekStream(unsigned /*clientSessionId*/, void* /*streamToken*/, char*& absStart, char*& absEnd) { // default implementation: do nothing (but delete[] and assign "absStart" and "absEnd" to NULL, to show that we don't handle this) delete[] absStart; absStart = NULL; delete[] absEnd; absEnd = NULL; } void ServerMediaSubsession::nullSeekStream(unsigned /*clientSessionId*/, void* /*streamToken*/, double streamEndTime, u_int64_t& numBytes) { // default implementation: do nothing numBytes = 0; } void ServerMediaSubsession::setStreamScale(unsigned /*clientSessionId*/, void* /*streamToken*/, float /*scale*/) { // default implementation: do nothing } float ServerMediaSubsession::getCurrentNPT(void* /*streamToken*/) { // default implementation: return 0.0 return 0.0; } FramedSource* ServerMediaSubsession::getStreamSource(void* /*streamToken*/) { // default implementation: return NULL return NULL; } void ServerMediaSubsession::deleteStream(unsigned /*clientSessionId*/, void*& /*streamToken*/) { // default implementation: do nothing } void ServerMediaSubsession::testScaleFactor(float& scale) { // default implementation: Support scale = 1 only scale = 1; } float ServerMediaSubsession::duration() const { // default implementation: assume an unbounded session: return 0.0; } void ServerMediaSubsession::getAbsoluteTimeRange(char*& absStartTime, char*& absEndTime) const { // default implementation: We don't support seeking by 'absolute' time, so indicate this by setting both parameters to NULL: absStartTime = absEndTime = NULL; } void ServerMediaSubsession::setServerAddressAndPortForSDP(netAddressBits addressBits, portNumBits portBits) { fServerAddressForSDP = addressBits; fPortNumForSDP = portBits; } char const* ServerMediaSubsession::rangeSDPLine() const { // First, check for the special case where we support seeking by 'absolute' time: char* absStart = NULL; char* absEnd = NULL; getAbsoluteTimeRange(absStart, absEnd); if (absStart != NULL) { char buf[100]; if (absEnd != NULL) { sprintf(buf, "a=range:clock=%s-%s\r\n", absStart, absEnd); } else { sprintf(buf, "a=range:clock=%s-\r\n", absStart); } return strDup(buf); } if (fParentSession == NULL) return NULL; // If all of our parent's subsessions have the same duration // (as indicated by "fParentSession->duration() >= 0"), there's no "a=range:" line: if (fParentSession->duration() >= 0.0) return strDup(""); // Use our own duration for a "a=range:" line: float ourDuration = duration(); if (ourDuration == 0.0) { return strDup("a=range:npt=0-\r\n"); } else { char buf[100]; sprintf(buf, "a=range:npt=0-%.3f\r\n", ourDuration); return strDup(buf); } }
<reponame>smagill/opensphere-desktop<filename>open-sphere-base/analysis/src/main/java/io/opensphere/analysis/baseball/BaseballDataRow.java<gh_stars>10-100 package io.opensphere.analysis.baseball; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; /** * The data to be displayed in a row of cells of the data panel in * the baseball card. */ public class BaseballDataRow { /** The data displayed under the field heading. */ private final StringProperty myFieldProperty; /** The data displayed under the value heading. */ private final ObjectProperty<Object> myValueProperty; /** * Creates a new set of values for the data panel. * * @param field the data for the field column * @param value the data for the value column */ public BaseballDataRow(String field, Object value) { myFieldProperty = new SimpleStringProperty(field); myValueProperty = new SimpleObjectProperty<Object>(); myValueProperty.setValue(value); } /** * Gets the property containing the field information. * * @return the field property */ public StringProperty fieldProperty() { return myFieldProperty; } /** * Gets the data for the field column. * * @return the field data */ public String getField() { return myFieldProperty.get(); } /** * Gets the property containing the value information. * * @return the value property */ public ObjectProperty<Object> valueProperty() { return myValueProperty; } /** * Gets the data for the value column. * * @return the value data */ public Object getValue() { return myValueProperty.get(); } }
<filename>managed/src/main/java/com/yugabyte/yw/forms/TlsToggleParams.java // Copyright (c) YugaByte, Inc. package com.yugabyte.yw.forms; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.yugabyte.yw.commissioner.Common; import com.yugabyte.yw.commissioner.Common.CloudType; import com.yugabyte.yw.common.YWServiceException; import com.yugabyte.yw.models.CertificateInfo; import com.yugabyte.yw.models.Universe; import java.util.UUID; import play.mvc.Http; import play.mvc.Http.Status; @JsonIgnoreProperties(ignoreUnknown = true) @JsonDeserialize(converter = TlsToggleParams.Converter.class) public class TlsToggleParams extends UpgradeTaskParams { public boolean enableNodeToNodeEncrypt = false; public boolean enableClientToNodeEncrypt = false; public boolean allowInsecure = true; public UUID rootCA = null; public UUID clientRootCA = null; public Boolean rootAndClientRootCASame = null; public TlsToggleParams() {} @JsonCreator public TlsToggleParams( @JsonProperty(value = "enableNodeToNodeEncrypt", required = true) boolean enableNodeToNodeEncrypt, @JsonProperty(value = "enableClientToNodeEncrypt", required = true) boolean enableClientToNodeEncrypt) { this.enableNodeToNodeEncrypt = enableNodeToNodeEncrypt; this.enableClientToNodeEncrypt = enableClientToNodeEncrypt; } @Override public void verifyParams(Universe universe) { super.verifyParams(universe); UniverseDefinitionTaskParams universeDetails = universe.getUniverseDetails(); UserIntent userIntent = universeDetails.getPrimaryCluster().userIntent; boolean existingEnableClientToNodeEncrypt = userIntent.enableClientToNodeEncrypt; boolean existingEnableNodeToNodeEncrypt = userIntent.enableNodeToNodeEncrypt; UUID existingRootCA = universeDetails.rootCA; UUID existingClientRootCA = universeDetails.clientRootCA; if (upgradeOption != UpgradeOption.ROLLING_UPGRADE && upgradeOption != UpgradeOption.NON_ROLLING_UPGRADE) { throw new YWServiceException( Status.BAD_REQUEST, "TLS toggle can be performed either rolling or non-rolling way."); } if (this.enableClientToNodeEncrypt == existingEnableClientToNodeEncrypt && this.enableNodeToNodeEncrypt == existingEnableNodeToNodeEncrypt) { throw new YWServiceException( Status.BAD_REQUEST, "No changes in Tls parameters, cannot perform update operation."); } if (existingRootCA != null && rootCA != null && !existingRootCA.equals(rootCA)) { throw new YWServiceException( Status.BAD_REQUEST, "Cannot update root certificate, if already created."); } if (existingClientRootCA != null && clientRootCA != null && !existingClientRootCA.equals(clientRootCA)) { throw new YWServiceException( Status.BAD_REQUEST, "Cannot update client root certificate, if already created."); } if (!CertificateInfo.isCertificateValid(rootCA)) { throw new YWServiceException( Status.BAD_REQUEST, "No valid root certificate found for UUID: " + rootCA); } if (!CertificateInfo.isCertificateValid(clientRootCA)) { throw new YWServiceException( Status.BAD_REQUEST, "No valid client root certificate found for UUID: " + clientRootCA); } if (rootCA != null && CertificateInfo.get(rootCA).certType == CertificateInfo.Type.CustomServerCert) { throw new YWServiceException( Http.Status.BAD_REQUEST, "CustomServerCert are only supported for Client to Server Communication."); } if (rootCA != null && CertificateInfo.get(rootCA).certType == CertificateInfo.Type.CustomCertHostPath && !userIntent.providerType.equals(CloudType.onprem)) { throw new YWServiceException( Status.BAD_REQUEST, "CustomCertHostPath certificates are only supported for on-prem providers."); } if (clientRootCA != null && CertificateInfo.get(clientRootCA).certType == CertificateInfo.Type.CustomCertHostPath && !userIntent.providerType.equals(Common.CloudType.onprem)) { throw new YWServiceException( Http.Status.BAD_REQUEST, "CustomCertHostPath certificates are only supported for on-prem providers."); } if (rootAndClientRootCASame != null && rootAndClientRootCASame && enableNodeToNodeEncrypt && enableClientToNodeEncrypt && rootCA != null && clientRootCA != null && !rootCA.equals(clientRootCA)) { throw new YWServiceException( Http.Status.BAD_REQUEST, "RootCA and ClientRootCA cannot be different when rootAndClientRootCASame is true."); } } public static class Converter extends BaseConverter<TlsToggleParams> {} }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) Microsoft Corporation. All rights reserved. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef _DRIVERS_INSTRUMENTATION_DECL_H_ #define _DRIVERS_INSTRUMENTATION_DECL_H_ 1 //--// void Instrumentation_Initialize (); void Instrumentation_Uninitialize(); void Instrumentation_Running (); void Instrumentation_Sleeping (); //--// #endif // _DRIVERS_INSTRUMENTATION_DECL_H_
/** * Represents the result of package name validation. */ type Result = boolean; /** * Validates a package name according to npm package manager rules. * @param packageName The package name to validate. * @returns A Result indicating whether the package name is valid. */ function validate(packageName: string): Result { const packagePattern = /^[a-z0-9-_.]+$/; const scopedPackagePattern = /^@([a-z0-9-_.]+)\/([a-z0-9-_.]+)$/; if (scopedPackagePattern.test(packageName)) { return true; } else { return packagePattern.test(packageName); } } // Expose scopedPackagePattern property validate.scopedPackagePattern = /^@([a-z0-9-_.]+)\/([a-z0-9-_.]+)$/; // Test cases console.log(validate('123numeric')); // Output: true console.log(validate('@npm/thingy')); // Output: true console.log(validate('@jane/foo.js')); // Output: false console.log(validate.scopedPackagePattern); // Output: /^@([a-z0-9-_.]+)\/([a-z0-9-_.]+)$/
<filename>day05/hkzf/src/pages/Favorate/index.js<gh_stars>1-10 import React, { Component } from 'react' import NavHeader from '../../components/NavHeader' import HouseItem from '../../components/HouseItem' import { API, BASE_URL } from '../../utils' export default class Favorate extends Component { state = { // 我的收藏列表 list: [] } componentDidMount() { this.getHouseList() } async getHouseList() { const res = await API.get('/user/favorites') console.log(res) const { status, body } = res.data if(status === 200) { this.setState({ list: body }) } } renderRentList = () => { const { list } = this.state const { history } = this.props return list[0] ? ( list.map(item => { return ( <HouseItem key={item.houseCode} onClick={() => history.push(`/detail/${item.houseCode}`)} src={BASE_URL + item.houseImg} title={item.title} desc={item.desc} tags={item.tags} price={item.price} /> ) }) ) : null } render() { const { history } = this.props return ( <div> <NavHeader onLeftClick={() => history.go(-1)}>我的收藏</NavHeader> {this.renderRentList()} </div> ) } }
<reponame>lateralblast/duct #!/usr/bin/env ruby # Name: DUCT Webserver # Version: 0.0.6 # Release: 1 # License: CC-BA (Creative Commons By Attribution) # http://creativecommons.org/licenses/by/4.0/legalcode # Group: System # Source: N/A # URL: http://lateralblast.com.au/ # Distribution: UNIX # Vendor: Lateral Blast # Packager: <NAME> <<EMAIL>> # Description: Webserver for DC Utilisation / Capacity Tool # Load methods if File.directory?("./methods") file_list = Dir.entries("./methods") for file in file_list if file =~ /rb$/ require "./methods/#{file}" end end end require 'tilt/erb' # Install required gems if required begin require 'sinatra' rescue LoadError install_gem("sinatra") end begin require 'chartkick' rescue LoadError install_gem("chartkick") end # Set global vars before do set_global_vars() end # Handle requests get '/sun' do if params["report"] @report = params["report"] else @report = "servers" end if params["vendor"] vendor = params["vendor"] else vendor = "sun" end if params["client"] client = params["client"] else client = "test" end case @report when /racks|rack$/ units_file = "./data/sun/rack_units.csv" input_file = "./clients/sun/"+client+".csv" units_type = "Racks" @all_models,@series,@b_models,@c_models,@e_models,@m_models,@n_models,@s_models,@t_models,@u_models,@v_models,@x_models,@z_models = import_mos_unit_info(input_file,units_file,units_type) when /rackunits|rus/ units_file = "./data/sun/rack_units.csv" input_file = "./clients/sun/"+client+".csv" units_type = "RUs" @all_models,@series,@b_models,@c_models,@e_models,@m_models,@n_models,@s_models,@t_models,@u_models,@v_models,@x_models,@z_models = import_mos_unit_info(input_file,units_file,units_type) when /power/ units_file = "./data/sun/power_units.csv" input_file = "./clients/sun/"+client+".csv" units_type = "Watts" @all_models,@series,@b_models,@c_models,@e_models,@m_models,@n_models,@s_models,@t_models,@u_models,@v_models,@x_models,@z_models = import_mos_unit_info(input_file,units_file,units_type) else input_file = "./clients/"+vendor+"/"+client+".csv" @all_models,@series,@b_models,@c_models,@e_models,@m_models,@n_models,@s_models,@t_models,@u_models,@v_models,@x_models,@z_models = import_mos_server_info(input_file) end erb :sun_units end # Redirect Oracle to Sun get '/oracle' do redirect '/sun' end
#To generate RSA keys, on the command line, enter ssh-keygen -t rsa # Make .ssh dir mkdir -p ~/.ssh touch ~/.ssh/authorized_keys #On the remote system, add the contents of your public key file cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
import ViewBase from './viewBase'; import StartTimeSelection from '../modal/startTimeSelection'; import {html, render} from 'lit-html'; import RepositoryStartTime from '../repository/settings/startTime'; import GenericList from '../modal/genericList'; import ModalFeedback from '../modal/feedback'; import PriceListView from '../views/priceList'; import StationDetailsView from '../views/stationDetails'; import noUiSlider from 'nouislider'; import 'nouislider/dist/nouislider.css'; export default class StationPrices extends ViewBase{ constructor(sidebar,depts) { super(depts); this.sidebar = sidebar; this.analytics = depts.analytics(); this.slider = null; this.defaultBatteryRange = [20,80]; this.startTimeRepo = new RepositoryStartTime(); this.currentChargePoint = null; this.sortedCP = [] this.initSlider(); } batteryRangeInfoTempl(obj){ return this.sf(this.t("batteryRangeInfo"),obj.from,obj.to); } parameterNoteTempl(obj){ return html` <span class="w3-left"> <i class="fa fa-clock-o"></i> <span class="link-text" @click="${()=>this.selectStartTime()}">${this.h().timeOfDay(this.getStartTime())}</span> <i class="fa fa-angle-right"></i> ~${this.h().timeOfDay(this.getEndTime(obj.chargePointDuration))} <br> (${this.h().time(obj.chargePointDuration)})* </span> <span class="w3-right"> <i class="fa fa-bolt"></i> ${this.h().int(obj.chargePointEnergy)} kWh (ø ${this.h().power(obj.chargePointEnergy*60/obj.chargePointDuration)} kW)* </span> `; } currentChargePointTemplate(){ const obj = this.currentChargePoint; if(!obj)return ""; return this.sortedCP.map(cp=> html` <span @click="${()=>this.onChargePointChanged(cp)}" class="cp-button ${cp == obj ? "pc-main" : "w3-light-gray"} w3-margin-top w3-margin-bottom ${cp.supportedByVehicle ? "": "w3-disabled"}"> <label>${cp.power} kW</label><br> <label class="w3-small">${this.h().upper(cp.plug)}, ${cp.count}x</label> </span> `); } feedbackTemplate(context){ return html` <label class="w3-block" >${this.t("fbReportPriceText")}</label> <button @click="${()=>this.onReportPrice("missing_price",context)}" class="w3-btn pc-secondary"> ${this.t("fbReportMissing")} </button> <button @click="${()=>this.onReportPrice("wrong_price",context)}" class="w3-btn pc-secondary"> ${this.t("fbReportWrong")} </button> `; } stationPriceGeneralInfoTemplate(station, prices){ if(!station.isFreeCharging && prices.length == 0){ return html`<label class="w3-tag w3-light-blue-grey w3-margin-top"><i class="fa fa-info"></i> ${this.t("noTariffAvailable")}</label>`; } else if(station.isFreeCharging && prices.length > 0 && prices.some(p=>p.price > 0)) { return html`<label class="w3-tag w3-pale-red w3-margin-top"><i class="fa fa-exclamation"></i> ${this.t("freeStationWithPricesInfo")}</label>`; } else return ""; } initSlider(){ this.slider = document.getElementById('batteryRange'); noUiSlider.create(this.slider, { start: this.getStoredOrDefaultBatteryRange(), step: 1, margin: 1, connect: true, range: { min: 0,max: 100 } }); this.updateBatteryRangeInfo(); this.slider.noUiSlider.on('update', ()=>this.updateBatteryRangeInfo()); this.slider.noUiSlider.on('end', ()=>{ this.storeBatteryRange(); const range = this.getBatteryRange(); this.analytics.log('event', 'battery_changed',{ percentage_start: range[0], percentage_end: range[1] }); this.batteryChangedCallback() }); } getBatteryRange(){ return this.slider.noUiSlider.get().map(v=>parseInt(v)); } updateBatteryRangeInfo(){ const range = this.getBatteryRange(); render(this.batteryRangeInfoTempl({from: range[0], to: range[1]}),this.getEl("batteryRangeInfo")); } showStation(station){ this.sortedCP = station.chargePoints.sort((a,b)=>{ const b1 = b.supportedByVehicle; const a1 = a.supportedByVehicle; if(b1 == a1) return (b.power-a.power); else return b1 - a1; }); this.currentChargePoint = this.sortedCP[0]; this.renderCurrentChargePointTemplate(); this.selectedChargePointChangedCallback(); } renderCurrentChargePointTemplate(){ render(this.currentChargePointTemplate(),document.getElementById("select-charge-point")); } onChargePointChanged(value){ if(!value.supportedByVehicle) return; this.currentChargePoint = value; this.renderCurrentChargePointTemplate(); if(this.selectedChargePointChangedCallback) this.selectedChargePointChangedCallback(value); } updateStationPrice(station,prices,options){ const sortedPrices = prices.sort((a,b)=>this.sortPrice(a.price, b.price)); new PriceListView(this.depts,this.sidebar).render(sortedPrices,options,station,"prices") new StationDetailsView(this.depts).render(station,"station-info"); render(this.stationPriceGeneralInfoTemplate(station, prices),this.getEl("priceInfo")) render(this.parameterNoteTempl(options),this.getEl("parameterNote")); render(this.feedbackTemplate({options: options, station: station, prices: sortedPrices}),this.getEl("priceFeedback")); } sortPrice(a,b){ if(a!=null && b!=null) return a - b; if(a==null && b!=null) return 1; if(b==null && a!=null) return -1; return 0; } onBatteryRangeChanged(callback){ this.batteryChangedCallback = callback; } storeBatteryRange(){ localStorage.setItem("batteryRange",JSON.stringify(this.getBatteryRange())); } getStoredOrDefaultBatteryRange(){ if(localStorage.getItem("batteryRange")){ return JSON.parse(localStorage.getItem("batteryRange")); } else return this.defaultBatteryRange; } onStartTimeChanged(callback){ this.startTimeChangedCallback = callback; } onSelectedChargePointChanged(callback){ this.selectedChargePointChangedCallback=callback; } onReportPrice(type, context){ const opts = context.options; const contextString = [ `${opts.myVehicle.brand} ${opts.myVehicle.name}`, `Battery: ${this.getBatteryRange()}`, `${this.currentChargePoint.plug} ${this.currentChargePoint.power} kw`, opts.displayedCurrency ].join(", ") const options = { cpo: context.station.network, poiLink: window.location.href, prices: context.prices, context: contextString } new ModalFeedback(this.depts).show(type,options); } getStartTime(){ const storedStartTime = this.startTimeRepo.get(); if(storedStartTime != null) return storedStartTime; const time = new Date(); return time.getHours()*60+time.getMinutes(); } getEndTime(duration){ return (this.getStartTime() + duration) % 1440; } getCurrentChargePoint(){ return this.currentChargePoint; } selectStartTime(){ new StartTimeSelection(this.depts).show(this.startTimeRepo.get(), (result)=>{ this.startTimeRepo.set(result); if(this.startTimeChangedCallback) this.startTimeChangedCallback(); this.analytics.log('event', 'time_of_day_changed',{new_value: result}); }) } }
//===----------------------------------------------------------------------===// // DuckDB // // duckdb/optimizer/join_order_optimizer.hpp // // //===----------------------------------------------------------------------===// #pragma once #include "duckdb/common/unordered_map.hpp" #include "duckdb/common/unordered_set.hpp" #include "duckdb/optimizer/join_order/query_graph.hpp" #include "duckdb/optimizer/join_order/relation.hpp" #include "duckdb/parser/expression_map.hpp" #include "duckdb/planner/logical_operator.hpp" #include "duckdb/planner/logical_operator_visitor.hpp" #include <functional> namespace duckdb { class JoinOrderOptimizer { public: //! Represents a node in the join plan struct JoinNode { RelationSet *set; NeighborInfo *info; idx_t cardinality; idx_t cost; JoinNode *left; JoinNode *right; //! Create a leaf node in the join tree JoinNode(RelationSet *set, idx_t cardinality) : set(set), info(nullptr), cardinality(cardinality), cost(cardinality), left(nullptr), right(nullptr) { } //! Create an intermediate node in the join tree JoinNode(RelationSet *set, NeighborInfo *info, JoinNode *left, JoinNode *right, idx_t cardinality, idx_t cost) : set(set), info(info), cardinality(cardinality), cost(cost), left(left), right(right) { } }; public: //! Perform join reordering inside a plan unique_ptr<LogicalOperator> Optimize(unique_ptr<LogicalOperator> plan); private: //! The total amount of join pairs that have been considered idx_t pairs = 0; //! Set of all relations considered in the join optimizer vector<unique_ptr<Relation>> relations; //! A mapping of base table index -> index into relations array (relation number) unordered_map<idx_t, idx_t> relation_mapping; //! A structure holding all the created RelationSet objects RelationSetManager set_manager; //! The set of edges used in the join optimizer QueryGraph query_graph; //! The optimal join plan found for the specific RelationSet* unordered_map<RelationSet *, unique_ptr<JoinNode>> plans; //! The set of filters extracted from the query graph vector<unique_ptr<Expression>> filters; //! The set of filter infos created from the extracted filters vector<unique_ptr<FilterInfo>> filter_infos; //! A map of all expressions a given expression has to be equivalent to. This is used to add "implied join edges". //! i.e. in the join A=B AND B=C, the equivalence set of {B} is {A, C}, thus we can add an implied join edge {A <-> //! C} expression_map_t<vector<FilterInfo *>> equivalence_sets; //! Extract the bindings referred to by an Expression bool ExtractBindings(Expression &expression, unordered_set<idx_t> &bindings); //! Traverse the query tree to find (1) base relations, (2) existing join conditions and (3) filters that can be //! rewritten into joins. Returns true if there are joins in the tree that can be reordered, false otherwise. bool ExtractJoinRelations(LogicalOperator &input_op, vector<LogicalOperator *> &filter_operators, LogicalOperator *parent = nullptr); //! Emit a pair as a potential join candidate. Returns the best plan found for the (left, right) connection (either //! the newly created plan, or an existing plan) JoinNode *EmitPair(RelationSet *left, RelationSet *right, NeighborInfo *info); //! Tries to emit a potential join candidate pair. Returns false if too many pairs have already been emitted, //! cancelling the dynamic programming step. bool TryEmitPair(RelationSet *left, RelationSet *right, NeighborInfo *info); bool EnumerateCmpRecursive(RelationSet *left, RelationSet *right, unordered_set<idx_t> exclusion_set); //! Emit a relation set node bool EmitCSG(RelationSet *node); //! Enumerate the possible connected subgraphs that can be joined together in the join graph bool EnumerateCSGRecursive(RelationSet *node, unordered_set<idx_t> &exclusion_set); //! Rewrite a logical query plan given the join plan unique_ptr<LogicalOperator> RewritePlan(unique_ptr<LogicalOperator> plan, JoinNode *node); //! Generate cross product edges inside the side void GenerateCrossProducts(); //! Perform the join order solving void SolveJoinOrder(); //! Solve the join order exactly using dynamic programming. Returns true if it was completed successfully (i.e. did //! not time-out) bool SolveJoinOrderExactly(); //! Solve the join order approximately using a greedy algorithm void SolveJoinOrderApproximately(); unique_ptr<LogicalOperator> ResolveJoinConditions(unique_ptr<LogicalOperator> op); std::pair<RelationSet *, unique_ptr<LogicalOperator>> GenerateJoins(vector<unique_ptr<LogicalOperator>> &extracted_relations, JoinNode *node); }; } // namespace duckdb
import json class InventoryManager: def __init__(self): self.inventory = {'group': {'hosts': []}} def _build_vars(self): # Implement the logic to build vars here return {} # Placeholder for the _build_vars method def update_inventory(self, hosts): self.inventory['group']['hosts'] = hosts varss = self._build_vars() self.inventory['vars'] = varss return json.dumps(self.inventory)
# -*- coding: utf-8 -*- import importlib import os from anki import media, hooks from anki.hooks import wrap from anki.hooks import addHook from aqt import gui_hooks, mw def sync_will_start(): from . import media_filter importlib.reload(media_filter) return media_filter.on_sync() def media_check_will_start(): from . import media_filter importlib.reload(media_filter) return media_filter.on_check_media() def my_redirect_path(self, path, _old): from . import media_filter importlib.reload(media_filter) return media_filter.redirect_path(self, path, _old) def media_file_filter(file_path): full_path = os.path.join(mw.pm.profileFolder(), file_path) if not os.path.exists(full_path): alt_path = os.path.join('filtered_media', file_path) full_path = os.path.join(mw.pm.profileFolder(), alt_path) if os.path.exists(alt_path): file_path = alt_path return file_path if hasattr(hooks, 'media_file_filter'): hooks.media_file_filter.append(media_file_filter) else: # Support for Anki pre-2.1.36 from aqt.sound import MpvManager, OnDoneCallback, SimpleProcessPlayer from aqt import mediasrv from anki.sound import AVTag, SoundOrVideoTag def wrap_play(self, tag: AVTag, on_done: OnDoneCallback, _old): if isinstance(tag, SoundOrVideoTag): tag = SoundOrVideoTag(filename=media_file_filter(tag.filename)) _old(self, tag, on_done) def wrap_redirect(path, _old): (dirname, path) = _old(path) path = media_file_filter(path) return dirname, path MpvManager.play = wrap(MpvManager.play, wrap_play, 'around') SimpleProcessPlayer.play = wrap(SimpleProcessPlayer.play, wrap_play, 'around') mediasrv._redirectWebExports = wrap(mediasrv._redirectWebExports, wrap_redirect, 'around') if hasattr(gui_hooks, 'media_check_will_start'): gui_hooks.media_check_will_start.append(media_check_will_start) else: # Support for Anki pre-2.1.36 from aqt.mediacheck import MediaChecker def wrap_check(self): media_check_will_start() MediaChecker.check = wrap(MediaChecker.check, wrap_check, 'before') gui_hooks.sync_will_start.append(sync_will_start)
from ..xjson import XJson import os def test_alias_key(): xj = XJson(os.path.join("examples", "countries", "single_file.xjson")) assert xj.structure.alias('russia_population') == xj.structure['russia_population'] def test_alias_path(): xj = XJson(os.path.join("examples", "countries", "single_file.xjson")) assert xj.structure.alias('russia_population') == xj.structure.get_value('russia.population')
#!/bin/bash cd /home/container # Set environment variable that holds the Internal Docker IP INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') export INTERNAL_IP # Replace Startup Variables MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')) echo -e ":/home/container$ ${MODIFIED_STARTUP}" # Run the Server eval ${MODIFIED_STARTUP}
#! /bin/bash serveriss="\"http://localhost:8000\"" sed -i "s#AUTH_SERVER_ISS=.*#AUTH_SERVER_ISS=$serveriss#" /var/www/html/api/.env #remove existing multiline value with quotes perl -0777 -i -pe 's/\n\s*AUTH_SERVER_PUBLIC_KEY=".*?"//igs' /var/www/html/api/.env #remove existing singleline value perl -0777 -i -pe 's/\n\s*AUTH_SERVER_PUBLIC_KEY=.*$//igs' /var/www/html/api/.env publickey=`cat /var/www/html/auth/storage/oauth-public.key` echo "AUTH_SERVER_PUBLIC_KEY=\"$publickey\"" >> /var/www/html/api/.env
<reponame>circunspecter/calendar import Month from './Month'; import Week from './Week'; export default class Calendar { constructor(config, date = new Date()) { this.date = new Date(date); this.config = Object.assign({ // Month defaults handled by Month class. month: {}, // Week defaults handled by Week class. week: {} }, config); this.week = new Week(this.config.week, this.config.weekStartDay); this.month = new Month(this.config.month, this.week, this.date); } /** * Set month. * @param {Date} date Selected month. */ setDate(date) { this.date = this.month.date = date; } }
package com.twelvemonkeys.servlet.cache; import com.twelvemonkeys.servlet.ServletUtil; import javax.servlet.http.HttpServletRequest; import java.net.URI; import java.util.List; import java.util.Map; /** * ServletCacheRequest * * @author <a href="mailto:<EMAIL>"><NAME></a> * @author last modified by $Author: haku $ * @version $Id: ServletCacheRequest.java#1 $ */ public final class ServletCacheRequest extends AbstractCacheRequest { private final HttpServletRequest request; private Map<String, List<String>> headers; private Map<String, List<String>> parameters; protected ServletCacheRequest(final HttpServletRequest pRequest) { super(URI.create(pRequest.getRequestURI()), pRequest.getMethod()); request = pRequest; } public Map<String, List<String>> getHeaders() { if (headers == null) { headers = ServletUtil.headersAsMap(request); } return headers; } public Map<String, List<String>> getParameters() { if (parameters == null) { parameters = ServletUtil.parametersAsMap(request); } return parameters; } public String getServerName() { return request.getServerName(); } public int getServerPort() { return request.getServerPort(); } HttpServletRequest getRequest() { return request; } }
function processOptions(array $options, array $values): array { $result = []; $numOptions = count($options); $numValues = count($values); for ($i = 0; $i < $numOptions; $i++) { $option = $options[$i]; $value = ($i < $numValues) ? $values[$i] : null; $result[$option] = $value; } return $result; }
import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResourceDelta; import org.eclipse.core.resources.IResourceDeltaVisitor; import org.eclipse.core.runtime.CoreException; public class FileDeltaProcessor { public Multimap<IProject, IFile> processFileDeltas(IResourceDelta topDelta) throws CoreException { Multimap<IProject, IFile> files = HashMultimap.create(); if (topDelta == null) { return files; } topDelta.accept(new IResourceDeltaVisitor() { @Override public boolean visit(IResourceDelta delta) throws CoreException { if (delta.getResource() instanceof IFile) { IFile file = (IFile) delta.getResource(); files.put(file.getProject(), file); } return true; // Continue visiting other resource deltas } }); return files; } }
import PropTypes from 'prop-types'; import React from 'react'; import classNames from 'classnames'; // material-ui import { makeStyles, useTheme } from '@material-ui/styles'; import { Box, Drawer, useMediaQuery } from '@material-ui/core'; import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; import ListItemIcon from '@material-ui/core/ListItemIcon'; import ListItemText from '@material-ui/core/ListItemText'; import DashboardIcon from '@material-ui/icons/Dashboard'; import SettingsIcon from '@material-ui/icons/Settings'; import { Link } from 'react-router-dom'; import { withStyles } from '@material-ui/styles'; // third-party import PerfectScrollbar from 'react-perfect-scrollbar'; import { BrowserView, MobileView } from 'react-device-detect'; // project imports import MenuList from './MenuList'; import LogoSection from '../LogoSection'; import MenuCard from './MenuCard'; import { drawerWidth } from '../../store/constant'; // style constant const useStyles = (theme) => ({ drawerPaper: { position: 'fixed', top: theme.spacing(8), whiteSpace: 'nowrap', width: drawerWidth, transition: theme.transitions.create('width', { easing: theme.transitions.easing.sharp, duration: theme.transitions.duration.enteringScreen }) }, drawerPaperClose: { overflowX: 'hidden', transition: theme.transitions.create('width', { easing: theme.transitions.easing.sharp, duration: theme.transitions.duration.leavingScreen }), width: theme.spacing(8), [theme.breakpoints.up('sm')]: { width: theme.spacing(9) } } }); // ===========================|| SIDEBAR DRAWER ||=========================== // const Sidebar = ({ drawerOpen, drawerToggle, window, props }) => { const classes = useStyles(); const theme = useTheme(); const matchUpMd = useMediaQuery(theme.breakpoints.up('md')); const { open } = props; const drawer = ( <> <Drawer variant="permanent" classes={{ paper: classNames( classes.drawerPaper, !open && classes.drawerPaperClose ) }} open={open} > <List> <Link to="/"> <ListItem button> <ListItemIcon> <DashboardIcon /> </ListItemIcon> <ListItemText primary="Dashboard" /> </ListItem> </Link> <Link to="/setting"> <ListItem button> <ListItemIcon> <SettingsIcon /> </ListItemIcon> <ListItemText primary="Settings" /> </ListItem> </Link> </List> </Drawer> {/* <Box sx={{ display: { xs: 'block', md: 'none' } }}> <div className={classes.boxContainer}> <LogoSection /> </div> </Box> <BrowserView> <PerfectScrollbar component="div" className={classes.ScrollHeight}> <MenuList /> <MenuCard /> </PerfectScrollbar> </BrowserView> <MobileView> <Box sx={{ px: 2 }}> <MenuList /> <MenuCard /> </Box> </MobileView> */} </> ); const container = window !== undefined ? () => window().document.body : undefined; return ( <nav className={classes.drawer} aria-label="mailbox folders"> <Drawer container={container} variant={matchUpMd ? 'persistent' : 'temporary'} anchor="left" open={drawerOpen} onClose={drawerToggle} classes={{ paper: classes.drawerPaper }} ModalProps={{ keepMounted: true }} color="inherit" > {drawer} </Drawer> </nav> ); }; Sidebar.propTypes = { drawerOpen: PropTypes.bool, drawerToggle: PropTypes.func, window: PropTypes.object }; export default Sidebar;
sub validateIPAddress($ipAddress){ if ($ipAddress =~ /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/) { return 1; } else { return 0; } }
<filename>src/main/java/org/zalando/intellij/swagger/completion/SwaggerCompletionHelper.java<gh_stars>1000+ package org.zalando.intellij.swagger.completion; import com.intellij.psi.PsiElement; import org.zalando.intellij.swagger.traversal.Traversal; import org.zalando.intellij.swagger.traversal.path.swagger.PathResolver; public class SwaggerCompletionHelper extends CompletionHelper { private final PathResolver pathResolver; public SwaggerCompletionHelper( final PsiElement psiElement, final Traversal traversal, final PathResolver pathResolver) { super(psiElement, traversal); this.pathResolver = pathResolver; } public boolean completeRootKey() { return pathResolver.childOfRoot(psiElement); } public boolean completeInfoKey() { return pathResolver.childOfInfo(psiElement); } public boolean completeContactKey() { return pathResolver.childOfContact(psiElement); } public boolean completeLicenseKey() { return pathResolver.childOfLicense(psiElement); } public boolean completePathKey() { return pathResolver.childOfPath(psiElement); } public boolean completeOperationKey() { return pathResolver.childOfOperation(psiElement); } public boolean completeExternalDocsKey() { return pathResolver.childOfExternalDocs(psiElement); } public boolean completeParametersKey() { return pathResolver.childOfParameters(psiElement); } public boolean completeParameterItemsKey() { return pathResolver.childOfParameterItems(psiElement); } public boolean completeResponsesKey() { return pathResolver.childOfResponses(psiElement); } public boolean completeResponseKey() { return pathResolver.childOfResponse(psiElement); } public boolean completeHeaderKey() { return pathResolver.childOfHeader(psiElement); } public boolean completeHeadersKey() { return pathResolver.childOfHeaders(psiElement); } public boolean completeTagKey() { return pathResolver.childOfTag(psiElement); } public boolean completeSecurityDefinitionKey() { return pathResolver.childOfSecurityDefinition(psiElement); } public boolean completeSchemaKey() { return pathResolver.childOfSchema(psiElement); } public boolean completeSchemaItemsKey() { return pathResolver.childOfSchemaItems(psiElement); } public boolean completePropertiesSchemaKey() { return pathResolver.childOfPropertiesSchema(psiElement); } public boolean completeAdditionalPropertiesKey() { return pathResolver.childOfAdditionalProperties(psiElement); } public boolean completeXmlKey() { return pathResolver.childOfXml(psiElement); } public boolean completeDefinitionsKey() { return pathResolver.childOfDefinitions(psiElement); } public boolean completeParameterDefinitionKey() { return pathResolver.childOfParameterDefinition(psiElement); } public boolean completeMimeValue() { return pathResolver.isMimeValue(psiElement); } public boolean completeSchemesValue() { return pathResolver.isSchemesValue(psiElement); } public boolean completeDefinitionRefValue() { return pathResolver.isDefinitionRefValue(psiElement); } public boolean completeParameterRefValue() { return pathResolver.isParameterRefValue(psiElement); } public boolean completeBooleanValue() { return pathResolver.isBooleanValue(psiElement); } public boolean completeTypeValue() { return pathResolver.isTypeValue(psiElement); } public boolean completeFormatValue() { return pathResolver.isFormatValue(psiElement); } public boolean completeInValue() { return pathResolver.isInValue(psiElement); } public boolean completeResponseRefValue() { return pathResolver.isResponseRefValue(psiElement); } public boolean completeResponseDefinition() { return pathResolver.childOfResponseDefinition(psiElement); } public boolean completeRootSecurityKey() { return pathResolver.childOfRootSecurityKey(psiElement); } public boolean completeOperationSecurityKey() { return pathResolver.childOfOperationSecurityKey(psiElement); } public boolean completeItemsCollectionFormat() { return pathResolver.childOfItemsCollectionFormat(psiElement); } public boolean completeParametersCollectionFormat() { return pathResolver.childOfParametersCollectionFormat(psiElement); } public boolean completeHeadersCollectionFormat() { return pathResolver.childOfHeadersCollectionFormat(psiElement); } public boolean completeTagsValue() { return pathResolver.isTagsValue(psiElement); } public boolean completeSecurityScopeNameValue() { return pathResolver.isSecurityScopeNameValue(psiElement); } }
#!/bin/sh set -e SCRIPT_DIR=`realpath $(dirname "$0")` cd $SCRIPT_DIR/vehicle-simulator-ui/ ./gradlew clean shadowJar docker build . -t io.simplematter/fleet-ui
#!/bin/sh set -euo pipefail [ -f function.zip ] && rm function.zip sbt "graalvm-native-image:packageBin" zip -j function.zip \ target/graalvm-native-image/HelloWorld bootstrap function.sh aws lambda update-function-code \ --function-name aesa-test-custom-runtime \ --zip-file fileb://./function.zip [ -f function.zip ] && rm function.zip
# Shell script to chase down apps for cloud foundry admin # There may be easier ways to do this for sure in like the gui, but sometimes # I need it from CLI # input is just app name app=$1 echo app: $app # Ok with the app name you have to figure out space and org. # This output only gives you the space UID and the space name space_url=`cf curl /v2/apps?q=name:$app| grep space_url| sed 's/ "space_url": "\(.*\)",/\1/'` echo space_url: $space_url space_name=`cf curl $space_url|grep name| sed 's/ "name": "\(.*\)",/\1/'` echo space_name: $space_name org_url=`cf curl $space_url|grep organization_url| sed 's/ "organization_url": "\(.*\)",/\1/'` echo org_url: $org_url # Ok with an org URL we can get the org name org_name=`cf curl $org_url|grep name| sed 's/ "name": "\(.*\)",/\1/'` echo org: $org_name cf target -o $org_name -s $space_name # I had this grabbing the logs after targeting the app # but didn't like it not showing me where I was longer. #cf logs --recent $app |more
#!/bin/bash set -e # exit on first error VERSION="3.3.5" CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" main() { cd /tmp && rm -r eigen-git-mirror git clone --depth 1 --branch 3.3.5 https://github.com/eigenteam/eigen-git-mirror.git cd eigen-git-mirror && sudo make install && cd .. && rm -r eigen-git-mirror } main
ID=B for i in {1..5}; do python diatomic.py yml/$ID$i.yml -n $ID$i --run -s 3 done