How to use mem1 method in wpt

Best JavaScript code snippet using wpt

header2.jsx

Source:header2.jsx Github

copy

Full Screen

1import React, { useState, useEffect } from 'react';2import { makeStyles } from '@material-ui/core/styles';3import AppBar from '@material-ui/core/AppBar';4import Toolbar from '@material-ui/core/Toolbar';5import Typography from '@material-ui/core/Typography';6import Button from '@material-ui/core/Button';7import IconButton from '@material-ui/core/IconButton';8import Drawer from '@material-ui/core/Drawer';9import TreeView from '@material-ui/lab/TreeView';10import TreeItem from '@material-ui/lab/TreeItem';11import Tooltip from '@material-ui/core/Tooltip';12import Slider from '@material-ui/core/Slider';13import MenuItem from '@material-ui/core/MenuItem';14import Menu from '@material-ui/core/Menu';15import PlayArrowIcon from '@material-ui/icons/PlayArrow';16import StopIcon from '@material-ui/icons/Stop';17import SkipNextIcon from '@material-ui/icons/SkipNext';18import MenuIcon from '@material-ui/icons/Menu';19import ExpandMoreIcon from '@material-ui/icons/ExpandMore';20import ChevronRightIcon from '@material-ui/icons/ChevronRight';21import AllOutIcon from '@material-ui/icons/AllOut';22import BugReportIcon from '@material-ui/icons/BugReport';23import UpdateIcon from '@material-ui/icons/Update';24import DescriptionIcon from '@material-ui/icons/Description';25import FolderOpenIcon from '@material-ui/icons/FolderOpen';26import InfoIcon from '@material-ui/icons/Info';27import { useContext } from '../utils/context';28import event from '../utils/event';29import { isEmpty } from '../utils';30const { ipcRenderer } = window.electron;31const useStyles = makeStyles((theme) => ({32 root: {33 flexGrow: 1,34 backgroundColor: '#191a21',35 },36 menuButton: {37 marginRight: theme.spacing(2),38 },39 title: {40 flexGrow: 1,41 },42 button: {43 '&.Mui-disabled': {44 color: 'rgba(255,255,255,0.4)',45 },46 },47 slider: {48 '& .MuiSlider-valueLabel': {49 top: 'inherit',50 bottom: -51,51 '&>span': {52 transform: 'rotate(135deg)',53 '& >span': {54 transform: 'rotate(-135deg)',55 color: '#333',56 },57 },58 },59 },60 menu: {61 '& .MuiPaper-root': {62 backgroundColor: '#63668a !important',63 width: '15em',64 },65 '& ul': {66 listStyleType: 'none',67 padding: 0,68 },69 },70 menuOption: {71 fontSize: '.8em',72 fontWeight: 'bold',73 backgroundColor: '#fff0',74 color: 'white',75 padding: '1em',76 display: 'flex',77 justifyContent: 'flex-start',78 alignItems: 'center',79 cursor: 'pointer',80 transition: 'all .1s',81 '&:hover': {82 backgroundColor: '#fff8',83 color: 'black',84 },85 },86}));87const requests = [88 'requestExpandMacros',89 'requestTest',90 'requestAssembleAndRun',91 'requestAssembleAndRunBySteps',92 'requestRun',93 'requestRunBySteps',94 'requestNextStep',95 'requestKillProcess',96 'requestClockChange',97 'requestSendInput',98 'simulate',99];100const Header = () => {101 const { memory, currentFile, addFile, alertShow, playing, setPlaying,byStep,setByStep } = useContext();102 //const { addFile, currentID, alertShow } = useContext();103 const [anchorEl, setAnchorEl] = useState(null);104 const [clock, setClock] = useState(16);105 const classes = useStyles();106 const [open, setOpen] = useState(false);107 const handleDrawerOpen = () => {108 setOpen(true);109 };110 const handleDrawerClose = () => {111 setOpen(false);112 };113 const getBytecodeFromEditor = () => {114 return currentFile?.code115 .replace(/[^0-9a-fA-F]/g, '')116 .match(/.{2}/g)117 .map((current) => parseInt('0x'.concat(current)))118 .filter((current) => !isNaN(current));119 };120 const handlePlay = (type) => () => {121 let memoryToBytes = [];122 for (let i = 0; i < memory.length; i++) {123 let string = String(memory[i]).padStart(4, 0);124 memoryToBytes.push(parseInt(string.substr(0, 2), 16));125 memoryToBytes.push(parseInt(string.substr(2, 2), 16));126 }127 console.log(memoryToBytes);128 // play_expandMacros129 if (!isEmpty(currentFile?.code) || type == 'simulate') {130 // Habilita ou não o "Playing"131 if (type == 'simulate' || type == 'requestEndTest' || type == 'requestTest' || type == 'requestKillProcess') setPlaying(false);132 else setPlaying(true);133 const params = [];134 // Adicionar as instruções135 if (['requestRun', 'requestRunBySteps'].includes(type)) {136 let arr = getBytecodeFromEditor()137 console.log(arr)138 params.push(arr);139 }140 if (['requestExpandMacros', 'requestAssembleAndRun', 'requestAssembleAndRunBySteps'].includes(type)) {141 params.push(currentFile?.code);142 }143 if (['requestAssembleAndRun', 'requestAssembleAndRunBySteps', 'requestRun', 'requestRunBySteps'].includes(type)) {144 params.push(memoryToBytes);145 }146 if(['requestRunBySteps','requestAssembleAndRunBySteps','requestNextStep'].includes(type)){147 console.log("Header|BySteyp",type,true);148 setByStep(true);149 }else{150 console.log("Header|BySteyp",type,false);151 setByStep(false);152 }153 event('play', [type, params]);154 }155 };156 const handleClickDebug = (type) => () => {157 handlePlay(type)();158 setAnchorEl(null);159 };160 const handleAdd = () => {161 addFile('', '', 'Novo Arquivo');162 setOpen(false);163 };164 const handleUpload = () => {165 ipcRenderer.send('invoke_open_file');166 ipcRenderer.once('open_file', (e, path, code = '') => {167 if (path === false) {168 if (code != '') {169 alertShow('error', code);170 }171 } else {172 alertShow('success', 'Arquivo aberto');173 addFile(path, code);174 }175 });176 setOpen(false);177 };178 const handleChangeClock = (e,value) => {179 // console.log(e.target.value);180 // const value = parseInt(e.target.value);181 event('clock_change',[value]);182 setClock(value);183 }184 const handleAbout = () => { };185 return (186 <div className={classes.root}>187 <AppBar position='static' style={{ backgroundColor: '#191a21' }}>188 <Toolbar variant='dense'>189 <IconButton190 edge='start'191 className={classes.menuButton}192 color='inherit'193 aria-label='menu'194 onClick={handleDrawerOpen}195 >196 <MenuIcon />197 </IconButton>198 <UpdateIcon />199 <Slider200 onBlur={() => event('clock_change',[clock])}201 className={classes.slider}202 defaultValue={16}203 valueLabelDisplay='auto'204 step={1}205 marks206 min={1}207 max={20}208 onChange={(e,value) => setClock(value)}209 value={clock}210 style={{211 color: '#fff',212 width: 200,213 marginLeft: '1em',214 marginRight: '2em',215 }}216 />217 <Tooltip title='Expandir Macro (requestExpandMacros)'>218 <Button219 color='inherit'220 onClick={handlePlay('requestExpandMacros')}221 disabled={playing}222 className={classes.button}223 >224 <AllOutIcon225 style={{ color: !playing ? '#169dff' : '#169dff55' }}226 />227 </Button>228 </Tooltip>229 <Tooltip title='Executar (requestRun)'>230 <Button231 color='inherit'232 onClick={handlePlay('requestRun')}233 disabled={playing}234 className={classes.button}235 >236 <PlayArrowIcon237 style={{ color: !playing ? '#3dff3d' : '#3dff3d55' }}238 />239 </Button>240 </Tooltip>241 <Tooltip title={byStep ? 'Avançar (requestNextStep)' :'Avançar (requestRunBySteps)'}>242 <Button243 color='inherit'244 onClick={handlePlay(byStep ? 'requestNextStep' : 'requestRunBySteps')}245 disabled={playing}246 className={classes.button}247 >248 <SkipNextIcon />249 </Button>250 </Tooltip>251 <Tooltip title='Parar (requestKillProcess)'>252 <Button253 color='inherit'254 onClick={handlePlay('requestKillProcess')}255 disabled={!playing}256 className={classes.button}257 >258 <StopIcon style={{ color: playing ? '#ff6535' : '#ff653555' }} />259 </Button>260 </Tooltip>261 <Tooltip title='Debugar'>262 <Button263 color='inherit'264 onClick={(event) => setAnchorEl(event.currentTarget)}265 className={classes.button}266 >267 <BugReportIcon />268 </Button>269 </Tooltip>270 </Toolbar>271 </AppBar>272 <Drawer273 className={classes.menu}274 anchor={'left'}275 open={open}276 onClose={handleDrawerClose}277 >278 <ul>279 <li>280 <div281 className={classes.menuOption}282 aria-label='novo arquivo'283 onClick={handleAdd}284 >285 <DescriptionIcon286 style={{ fontSize: '1.5em', margin: '0 1em 0 .25em' }}287 />288 Novo arquivo289 </div>290 </li>291 <li>292 <div293 className={classes.menuOption}294 aria-label='menu'295 onClick={handleUpload}296 >297 <FolderOpenIcon298 style={{ fontSize: '1.5em', margin: '0 1em 0 .25em' }}299 />300 Abrir arquivo301 </div>302 </li>303 <li>304 <div305 className={classes.menuOption}306 aria-label='menu'307 onClick={handleAbout}308 >309 <InfoIcon310 style={{ fontSize: '1.5em', margin: '0 1em 0 .25em' }}311 />312 Sobre313 </div>314 </li>315 </ul>316 </Drawer>317 <Menu318 anchorEl={anchorEl}319 anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}320 id='debug'321 keepMounted322 //transformOrigin={{ vertical: 'top', horizontal: 'left' }}323 open={Boolean(anchorEl)}324 onClose={() => setAnchorEl(null)}325 >326 {requests.map((name) => (327 <MenuItem onClick={handleClickDebug(name)}>{name}</MenuItem>328 ))}329 </Menu>330 </div>331 );332};333/*334<TreeView335 color='primary'336 className={classes.root}337 defaultCollapseIcon={<ExpandMoreIcon />}338 defaultExpandIcon={<ChevronRightIcon />}339 multiSelect340 >341 <TreeItem nodeId='1' label='Applications'>342 <TreeItem nodeId='2' label='Calendar' />343 <TreeItem nodeId='3' label='Chrome' />344 <TreeItem nodeId='4' label='Webstorm' />345 </TreeItem>346 </TreeView>347*/348export default Header;349/*350SomaMem MACRO Mem1, Mem2351[1] mov AX,Mem1352[1] push AX353[1] ENDM354[1] l0: SomaMem MACRO Mem1, Mem2355[1]356[1] l1: mov AX,Mem1357[1]358[1] l2: push AX359[1]360[1] l3: ENDM361[1] size: 49362[1] entrou no set363[1] ------------------------------364[1] %c DEBUG: init365[1] ------------------------------366[1] SomaMem MACRO Mem1, Mem2367[1]368[1] ^369[1] curr char: S370[1] SomaMem MACRO Mem1, Mem2371[1]372[1] ^373[1] curr char: o374[1] SomaMem MACRO Mem1, Mem2375[1]376[1] ^377[1] curr char: m378[1] SomaMem MACRO Mem1, Mem2379[1]380[1] ^381[1] curr char: a382[1] SomaMem MACRO Mem1, Mem2383[1]384[1] ^385[1] curr char: M386[1] SomaMem MACRO Mem1, Mem2387[1]388[1] ^389[1] curr char: e390[1] SomaMem MACRO Mem1, Mem2391[1]392[1] ^393[1] curr char: m394[1] SomaMem MACRO Mem1, Mem2395[1]396[1] ^397[1] curr char:398[1] SomaMem MACRO Mem1, Mem2399[1]400[1] ^401[1] curr char: M402[1] t: 25, n: -1403[1] ------------------------------404[1] %c DEBUG: somamem405[1] ------------------------------406[1] SomaMem MACRO Mem1, Mem2407[1]408[1] ^409[1] curr char: M410[1] SomaMem MACRO Mem1, Mem2411[1]412[1] ^413[1] curr char: A414[1] SomaMem MACRO Mem1, Mem2415[1]416[1] ^417[1] curr char: C418[1] SomaMem MACRO Mem1, Mem2419[1]420[1] ^421[1] curr char: R422[1] SomaMem MACRO Mem1, Mem2423[1]424[1] ^425[1] curr char: O426[1] SomaMem MACRO Mem1, Mem2427[1]428[1] ^429[1] curr char:430[1] SomaMem MACRO Mem1, Mem2431[1]432[1] ^433[1] curr char: M434[1] qEnd Success435[1] t: 0, n: 0436[1] ------------------------------437[1] %c DEBUG: macro438[1] ------------------------------439[1] SomaMem MACRO Mem1, Mem2440[1]441[1] ^442[1] curr char: M443[1] SomaMem MACRO Mem1, Mem2444[1]445[1] ^446[1] curr char: e447[1] SomaMem MACRO Mem1, Mem2448[1]449[1] ^450[1] curr char: m451[1] SomaMem MACRO Mem1, Mem2452[1]453[1] ^454[1] curr char: 1455[1] SomaMem MACRO Mem1, Mem2456[1]457[1] ^458[1] curr char: ,459[1] SomaMem MACRO Mem1, Mem2460[1]461[1] ^462[1] curr char:463[1] t: 25, n: -1464[1] ------------------------------465[1] %c DEBUG: mem1466[1] ------------------------------467[1] SomaMem MACRO Mem1, Mem2468[1]469[1] ^470[1] curr char: ,471[1] SomaMem MACRO Mem1, Mem2472[1]473[1] ^474[1] curr char:475[1] qEnd Success476[1] t: 21, n: 59477[1] ------------------------------478[1] %c DEBUG: ,479[1] ------------------------------480[1] SomaMem MACRO Mem1, Mem2481[1]482[1] ^483[1] curr char: M484[1] SomaMem MACRO Mem1, Mem2485[1]486[1] ^487[1] curr char: e488[1] SomaMem MACRO Mem1, Mem2489[1]490[1] ^491[1] curr char: m492[1] SomaMem MACRO Mem1, Mem2493[1]494[1] ^495[1] curr char: 2496[1] SomaMem MACRO Mem1, Mem2497[1]498[1] ^499[1] curr char:500[1]501[1] SomaMem MACRO Mem1, Mem2502[1]503[1] ^504[1] curr char:505[1] t: 25, n: -1506[1] ------------------------------507[1] %c DEBUG: mem2508[1] ------------------------------509[1] SUCESSO510[1] entrou no set511[1] ------------------------------512[1] %c DEBUG: init513[1] ------------------------------514[1] mov AX,Mem1515[1]516[1] ^517[1] curr char: m518[1] mov AX,Mem1519[1]520[1] ^521[1] curr char: o522[1] mov AX,Mem1523[1]524[1] ^525[1] curr char: v526[1] mov AX,Mem1527[1]528[1] ^529[1] curr char:530[1] mov AX,Mem1531[1]532[1] ^533[1] curr char: A534[1] qEnd Success535[1] t: 3, n: 23536[1] mov AX,Mem1537[1]538[1] ^539[1] curr char: m540[1] mov AX,Mem1541[1]542[1] ^543[1] curr char: o544[1] mov AX,Mem1545[1]546[1] ^547[1] curr char: v548[1] mov AX,Mem1549[1]550[1] ^551[1] curr char:552[1] mov AX,Mem1553[1]554[1] ^555[1] curr char: A556[1] qEnd Success557[1] t: 3, n: 23558[1] entrou no set559[1] ------------------------------560[1] %c DEBUG: init561[1] ------------------------------562[1] push AX563[1]564[1] ^565[1] curr char: p566[1] push AX567[1]568[1] ^569[1] curr char: u570[1] push AX571[1]572[1] ^573[1] curr char: s574[1] push AX575[1]576[1] ^577[1] curr char: h578[1] push AX579[1]580[1] ^581[1] curr char:582[1] push AX583[1]584[1] ^585[1] curr char: A586[1] qEnd Success587[1] t: 3, n: 25588[1] push AX589[1]590[1] ^591[1] curr char: p592[1] push AX593[1]594[1] ^595[1] curr char: u596[1] push AX597[1]598[1] ^599[1] curr char: s600[1] push AX601[1]602[1] ^603[1] curr char: h604[1] push AX605[1]606[1] ^607[1] curr char:608[1] push AX609[1]610[1] ^611[1] curr char: A612[1] qEnd Success613[1] t: 3, n: 25614[1] entrou no set615[1] ------------------------------616[1] %c DEBUG: init617[1] ------------------------------618[1] ENDM619[1]620[1] ^621[1] curr char: E622[1] ENDM623[1]624[1] ^625[1] curr char: N626[1] ENDM627[1]628[1] ^629[1] curr char: D630[1] ENDM631[1]632[1] ^633[1] curr char: M634[1] ENDM635[1]636[1] ^637[1] curr char:638[1]639[1] ENDM640[1]641[1] ^642[1] curr char:643[1] qEnd Success644[1] t: 1, n: 3645[1] ------------------------------646[1] %c DEBUG: endm647[1] ------------------------------648[1] SUCESSO649[1] -> SomaMem MACRO Mem1, Mem2650[1]651[1] -> mov AX,Mem1652[1]653[1] -> push AX654[1]655[1] -> ENDM656[1]657[1] Erro: macro n foi definida direito (FIM DO ARQUIVO)658[1] ### START ......

Full Screen

Full Screen

options.ts

Source:options.ts Github

copy

Full Screen

1export const HOME_DATABASE_ENGINE_TYPES = {2 'MySQL': 'aurora-mysql',3 'PostgreSQL': 'aurora-postgresql',4}5export const HOME_DATABASE_MYSQL_INSTANCE_VERSIONS = {6 V_5_7_12: '5.7.12',7}8export const HOME_DATABASE_POSTGRESQL_INSTANCE_VERSIONS = {9 V_9_6_16: '9.6.16',10 V_9_6_17: '9.6.17',11 V_9_6_18: '9.6.18',12 V_9_6_19: '9.6.19',13 V_10_14: '10.14',14}15export const HOME_DATABASE_INSTANCE_CLASSES = [16 'db_std1_x2',17 'db_mem1_x2',18 'db_mem1_x4',19 'db_mem1_x8',20 'db_mem1_x16',21 'db_mem1_x32',22 'db_mem1_x48',23 'db_mem1_x64',24]25export const HOME_DATABASE_INSTANCES = {26 DB_STD1_X2: 'db_std1_x2',27 DB_MEM1_X2: 'db_mem1_x2',28 DB_MEM1_X4: 'db_mem1_x4',29 DB_MEM1_X8: 'db_mem1_x8',30 DB_MEM1_X16: 'db_mem1_x16',31 DB_MEM1_X32: 'db_mem1_x32',32 DB_MEM1_X48: 'db_mem1_x48',33 DB_MEM1_X64: 'db_mem1_x64',34}35export const HOME_DATABASE_LABELS = {36 'db_std1_x2': 'DB Baseline 1 x 2',37 'db_mem1_x2': 'DB Mem 1 x 2',38 'db_mem1_x4': 'DB Mem 1 x 4',39 'db_mem1_x8': 'DB Mem 1 x 8',40 'db_mem1_x16': 'DB Mem 1 x 16',41 'db_mem1_x32': 'DB Mem 1 x 32',42 'db_mem1_x48': 'DB Mem 1 x 48',43 'db_mem1_x64': 'DB Mem 1 x 64',44 'aurora-mysql': 'MySQL',45 'aurora-postgresql': 'PostgreSQL',46 'available': 'Available',47 'creating': 'Creating',48 'starting': 'Starting',49 'stopped': 'Stopped',50 'stopping': 'Stopping',51 'terminated': 'Terminated',52 'terminating': 'Terminating',53}54const checkDisabledInstances = (engine: string) => { return !engine }55export const instancesOptions = (engine?: string) => engine ? [56 {57 value: HOME_DATABASE_INSTANCES.DB_STD1_X2,58 label: HOME_DATABASE_LABELS['db_std1_x2'],59 isDisabled: checkDisabledInstances(engine),60 },61 {62 value: HOME_DATABASE_INSTANCES.DB_MEM1_X2,63 label: HOME_DATABASE_LABELS['db_mem1_x2'],64 isDisabled: checkDisabledInstances(engine),65 },66 {67 value: HOME_DATABASE_INSTANCES.DB_MEM1_X4,68 label: HOME_DATABASE_LABELS['db_mem1_x4'],69 isDisabled: checkDisabledInstances(engine),70 },71 {72 value: HOME_DATABASE_INSTANCES.DB_MEM1_X8,73 label: HOME_DATABASE_LABELS['db_mem1_x8'],74 isDisabled: checkDisabledInstances(engine),75 },76 {77 value: HOME_DATABASE_INSTANCES.DB_MEM1_X16,78 label: HOME_DATABASE_LABELS['db_mem1_x16'],79 isDisabled: checkDisabledInstances(engine),80 },81 {82 value: HOME_DATABASE_INSTANCES.DB_MEM1_X32,83 label: HOME_DATABASE_LABELS['db_mem1_x32'],84 isDisabled: checkDisabledInstances(engine),85 },86 {87 value: HOME_DATABASE_INSTANCES.DB_MEM1_X48,88 label: HOME_DATABASE_LABELS['db_mem1_x48'],89 isDisabled: checkDisabledInstances(engine),90 },91 {92 value: HOME_DATABASE_INSTANCES.DB_MEM1_X64,93 label: HOME_DATABASE_LABELS['db_mem1_x64'],94 isDisabled: checkDisabledInstances(engine),95 },96] : []97const hideMysqlVersions = (engine: string) => { return engine === HOME_DATABASE_ENGINE_TYPES['PostgreSQL'] }98const hidePgVersions = (engine: string) => { return engine === HOME_DATABASE_ENGINE_TYPES['MySQL'] }99const restrictedPgInstances = [100 HOME_DATABASE_INSTANCES.DB_STD1_X2,101 HOME_DATABASE_INSTANCES.DB_MEM1_X2,102 HOME_DATABASE_INSTANCES.DB_MEM1_X4,103 HOME_DATABASE_INSTANCES.DB_MEM1_X8,104 HOME_DATABASE_INSTANCES.DB_MEM1_X16,105 HOME_DATABASE_INSTANCES.DB_MEM1_X48,106]107const hidePgVersionsForSomeInstances = (dxInstanceClass: string) => { return restrictedPgInstances.includes(dxInstanceClass) }108const checkDisabledVersions = (engine: string, dxInstanceClass: string) => { return !(dxInstanceClass && engine) }109export const versionsOptions = (engine?: string, dxInstanceClass?: string) => engine && dxInstanceClass ? [110 {111 value: HOME_DATABASE_MYSQL_INSTANCE_VERSIONS.V_5_7_12,112 label: HOME_DATABASE_MYSQL_INSTANCE_VERSIONS.V_5_7_12,113 isDisabled: checkDisabledVersions(engine, dxInstanceClass) || hideMysqlVersions(engine),114 },115 {116 value: HOME_DATABASE_POSTGRESQL_INSTANCE_VERSIONS.V_9_6_16,117 label: HOME_DATABASE_POSTGRESQL_INSTANCE_VERSIONS.V_9_6_16,118 isDisabled: checkDisabledVersions(engine, dxInstanceClass) || hidePgVersions(engine) || hidePgVersionsForSomeInstances(dxInstanceClass),119 },120 {121 value: HOME_DATABASE_POSTGRESQL_INSTANCE_VERSIONS.V_9_6_17,122 label: HOME_DATABASE_POSTGRESQL_INSTANCE_VERSIONS.V_9_6_17,123 isDisabled: checkDisabledVersions(engine, dxInstanceClass) || hidePgVersions(engine) || hidePgVersionsForSomeInstances(dxInstanceClass),124 },125 {126 value: HOME_DATABASE_POSTGRESQL_INSTANCE_VERSIONS.V_9_6_18,127 label: HOME_DATABASE_POSTGRESQL_INSTANCE_VERSIONS.V_9_6_18,128 hide: hidePgVersions(engine) || hidePgVersionsForSomeInstances(dxInstanceClass),129 isDisabled: checkDisabledVersions(engine, dxInstanceClass) || hidePgVersions(engine) || hidePgVersionsForSomeInstances(dxInstanceClass),130 },131 {132 value: HOME_DATABASE_POSTGRESQL_INSTANCE_VERSIONS.V_9_6_19,133 label: HOME_DATABASE_POSTGRESQL_INSTANCE_VERSIONS.V_9_6_19,134 isDisabled: checkDisabledVersions(engine, dxInstanceClass) || hidePgVersions(engine) || hidePgVersionsForSomeInstances(dxInstanceClass),135 },136 {137 value: HOME_DATABASE_POSTGRESQL_INSTANCE_VERSIONS.V_10_14,138 label: HOME_DATABASE_POSTGRESQL_INSTANCE_VERSIONS.V_10_14,139 isDisabled: checkDisabledVersions(engine, dxInstanceClass) || hidePgVersions(engine),140 },...

Full Screen

Full Screen

index.js

Source:index.js Github

copy

Full Screen

1let btn=document.getElementById('btn');2btn.addEventListener('click',myfun);3function myfun(){4 5 let winner=document.getElementById('winner');6 winner.innerText=null;7 8 let member_1=document.getElementById('member-1');9 let member_2=document.getElementById('member-2');10 let member_3=document.getElementById('member-3');11 member_1.style.backgroundColor='transparent';12 member_2.style.backgroundColor='transparent';13 member_3.style.backgroundColor='transparent';14 15 let mem1= member_1.innerText=parseInt(Math.random()*6);16 let mem2= member_2.innerText=parseInt(Math.random()*6);17 let mem3 = member_3.innerText=parseInt(Math.random()*6);18 19 if(mem1>mem2 && mem1>mem3) {20 winner.innerText='member-1';21 member_1.style.backgroundColor="green";22 }else if(mem2>mem1 && mem2>mem3){23 winner.innerText='member-2';24 member_2.style.backgroundColor="green";25 }26 else if(mem3>mem1 && mem3>mem2){27 winner.innerText='member-3';28 member_3.style.backgroundColor="green";29 }30 else if(mem1==mem2 && mem2==mem3) {31 winner.innerHTML='Draw';32 member_1.style.backgroundColor='blue';33 member_2.style.backgroundColor='blue';34 member_3.style.backgroundColor='blue';35 }36 if(mem1>mem2 && mem1<mem3 || mem1<mem2 && mem1>mem3){37 member_1.style.backgroundColor='yellow';38 }39 else if(mem2>mem1 && mem2<mem3 || mem2<mem1 && mem2>mem3){40 member_2.style.backgroundColor='yellow';41 }42 else if(mem3>mem2 && mem3<mem1 || mem3<mem2 && mem3>mem1){43 member_3.style.backgroundColor='yellow';44 }45 46 if(mem1<mem2 && mem1<mem3){47 member_1.style.backgroundColor='red';48 }49 else if(mem2<mem1 && mem2<mem3){50 member_2.style.backgroundColor='red';51 }52else if(mem3<mem2 && mem3<mem1){53 member_3.style.backgroundColor='red';54 } 55 56 if(mem1==mem2 && mem1<mem3 ||mem1==mem2 && mem1>mem3){57 member_1.style.backgroundColor='blue';58 member_2.style.backgroundColor='blue';59 }60 else if(mem2==mem3 && mem2<mem1 ||mem2==mem3 && mem2>mem1){61 member_2.style.backgroundColor='blue';62 member_3.style.backgroundColor='blue';63 }64 else if(mem1==mem3 && mem1<mem2 || mem1==mem3 && mem1>mem2){65 member_1.style.backgroundColor='blue';66 member_3.style.backgroundColor='blue';67 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2wpt.mem1(function(data){3 console.log(data);4});5var wpt = require('wpt');6wpt.mem2(function(data){7 console.log(data);8});9var wpt = require('wpt');10wpt.mem1(function(data){11 console.log(data);12});13var wpt = require('wpt');14wpt.mem2(function(data){15 console.log(data);16});17var wpt = require('wpt');18wpt.mem1(function(data){19 console.log(data);20});21var wpt = require('wpt');22wpt.mem2(function(data){23 console.log(data);24});25var wpt = require('wpt');26wpt.mem1(function(data){27 console.log(data);28});29var wpt = require('wpt');30wpt.mem2(function(data){31 console.log(data);32});33var wpt = require('wpt');34wpt.mem1(function(data){35 console.log(data);36});37var wpt = require('wpt');38wpt.mem2(function(data){39 console.log(data);40});41var wpt = require('wpt');42wpt.mem1(function(data){43 console.log(data);44});45var wpt = require('wpt');46wpt.mem2(function(data){47 console.log(data);48});49var wpt = require('wpt');50wpt.mem1(function(data){51 console.log(data);52});53var wpt = require('wpt');54wpt.mem2(function(data){

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2wpt.mem1(function (data) {3 console.log(data);4});5var wpt = require('wpt');6wpt.mem2(function (data) {7 console.log(data);8});9var wpt = require('wpt');10wpt.mem3(function (data) {11 console.log(data);12});13var wpt = require('wpt');14wpt.mem4(function (data) {15 console.log(data);16});17var wpt = require('wpt');18wpt.mem5(function (data) {19 console.log(data);20});21var wpt = require('wpt');22wpt.mem6(function (data) {23 console.log(data);24});25var wpt = require('wpt');26wpt.mem7(function (data) {27 console.log(data);28});29var wpt = require('wpt');30wpt.mem8(function (data) {31 console.log(data);32});33var wpt = require('wpt');34wpt.mem9(function (data) {35 console.log(data);36});37var wpt = require('wpt');38wpt.mem10(function (data) {39 console.log(data);40});41var wpt = require('wpt');42wpt.mem11(function (data) {43 console.log(data);44});45var wpt = require('wpt');46wpt.mem12(function (data) {47 console.log(data);48});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var test = new wpt('www.webpagetest.org');3test.mem1('www.google.com', function(err, data) {4 if (err) console.log(err);5 else console.log(data);6});7var wpt = require('webpagetest');8var test = new wpt('www.webpagetest.org');9test.mem2('www.google.com', function(err, data) {10 if (err) console.log(err);11 else console.log(data);12});13var wpt = require('webpagetest');14var test = new wpt('www.webpagetest.org');15test.mem3('www.google.com', function(err, data) {16 if (err) console.log(err);17 else console.log(data);18});19var wpt = require('webpagetest');20var test = new wpt('www.webpagetest.org');21test.mem4('www.google.com', function(err, data) {22 if (err) console.log(err);23 else console.log(data);24});25var wpt = require('webpagetest');26var test = new wpt('www.webpagetest.org');27test.mem5('www.google.com', function(err, data) {28 if (err) console.log(err);29 else console.log(data);30});31var wpt = require('webpagetest');32var test = new wpt('www.webpagetest.org');33test.mem6('www.google.com', function(err, data) {34 if (err) console.log(err);35 else console.log(data);36});37var wpt = require('webpagetest');38var test = new wpt('www.webpagetest.org');39test.mem7('www.google.com', function(err, data) {40 if (err) console.log(err);41 else console.log(data);42});43var wpt = require('webpag

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2wpt.mem1(function(err, data) {3 console.log('mem1: ' + data);4});5var wpt = require('wpt');6wpt.mem2(function(err, data) {7 console.log('mem2: ' + data);8});9var wpt = require('wpt');10wpt.mem3(function(err, data) {11 console.log('mem3: ' + data);12});13The output is as expected because the memory is not yet allocated. Now, we will allocate the memory and call the mem1() method again:14var wpt = require('wpt');15wpt.mem1(function(err, data) {16 console.log('mem1: ' + data);17});18The output is as expected because the memory is allocated now. Now, we will call the mem2() method again:19var wpt = require('wpt');20wpt.mem2(function(err, data) {21 console.log('mem2: ' + data);22});23The output is as expected because the memory is allocated now. Now, we will call the mem3() method again:24var wpt = require('wpt');25wpt.mem3(function(err, data) {26 console.log('mem3: ' + data);27});28Now, we will call the mem1() method again:29var wpt = require('wpt');30wpt.mem1(function(err, data) {31 console.log('mem1: ' + data);32});33The output is as expected because the memory is deallocated now. Now, we will call the mem2() method again:34var wpt = require('wpt');

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2wpt.mem1();3exports.mem1 = function() {4 var mem = require('mem');5 mem.mem2();6}7exports.mem2 = function() {8 var mem = require('mem');9 mem.mem3();10}11exports.mem3 = function() {12 var mem = require('mem');13 mem.mem3();14}15var wpt = require('wpt');16wpt.mem1();17var mem = require('mem');18exports.mem1 = function() {19 mem.mem2();20}21var mem = require('mem');22exports.mem2 = function() {23 mem.mem3();24}25var mem = require('mem');26exports.mem3 = function() {27 mem.mem3();28}29var wpt = require('wpt');30wpt.mem1();31var mem = require('mem');32exports.mem1 = function() {33 mem.mem2();34}35var mem = require('mem');36exports.mem2 = function() {

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt');2wpt.mem1();3exports.mem1 = function() {4 console.log("mem1");5}6var wpt = require('./wpt');7wpt.mem2();8exports.mem2 = function() {9 console.log("mem2");10}11The solution is to use the require() function with the cache property set to false, as shown in the following code:12var wpt = require('./wpt', {cache: false});13wpt.mem1();14exports.mem1 = function() {15 console.log("mem1");16}17var wpt = require('./wpt', {cache: false});18wpt.mem2();19exports.mem2 = function() {20 console.log("mem2");21}22The require() function with the cache property set to false is a solution for the problem, but it is not the best solution. The best solution is to use the module.exports object instead of the exports object, as shown in the following code:23var wpt = require('./wpt');24wpt.mem1();25module.exports.mem1 = function() {26 console.log("mem1");27}28var wpt = require('./wpt');29wpt.mem2();

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful