This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-env node */ | |
/** | |
* -------------------------- Part 1 ----------------------------- | |
*/ | |
/** | |
* In this assignment you will implement one or more algorithms for the traveling | |
* salesman problem, such as the dynamic programming algorithm covered in the | |
* video lectures. Here is a data file describing a TSP instance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable arrow-body-style, object-property-newline, no-undef */ | |
class Graph { | |
/* | |
* Construct a graph | |
* | |
* @param {Map} nodeVsLocation - node => {x: number, y: number} | |
*/ | |
constructor(nodeVsLocation) { | |
this.nodeVsLocation = nodeVsLocation; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bdanforth ~/src/mozilla-unified $ ./mach test devtools/server/tests/unit/test_extension_storage_actor.js | |
0:01.27 INFO Found node at /Users/bdanforth/.mozbuild/node/bin/node | |
0:01.27 INFO Found moz-http2 at /Users/bdanforth/src/mozilla-unified/testing/xpcshell/moz-http2/moz-http2.js | |
0:01.39 INFO Running tests sequentially. | |
0:01.39 SUITE_START: xpcshell - running 1 tests | |
0:01.41 INFO profile dir is /var/folders/r4/54vpbnzx4_l3jk8cmjgs5v040000gn/T/firefox/xpcshellprofile | |
0:01.42 TEST_START: devtools/server/tests/unit/test_extension_storage_actor.js | |
0:01.42 INFO devtools/server/tests/unit/test_extension_storage_actor.js | full command: ['/Users/bdanforth/src/mozilla-unified/objdir-frontend-debug-artifact/dist/Nightly.app/Contents/MacOS/xpcshell', '-g', '/Users/bdanforth/src/mozilla-unified/objdir-frontend-debug-artifact/dist/Nightly.app/Contents/Resources', '-a', '/Users/bdanforth/src/mozilla-unified/objdir-frontend-debug-artifact/dist/Nightly.app/Contents/Resources/browser', '-r', '/Users/bdanforth/src/moz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bdanforth ~/src/mozilla-unified $ ./mach test devtools/server/tests/unit/test_extension_storage_actor.js | |
0:01.30 INFO Found node at /Users/bdanforth/.mozbuild/node/bin/node | |
0:01.30 INFO Found moz-http2 at /Users/bdanforth/src/mozilla-unified/testing/xpcshell/moz-http2/moz-http2.js | |
0:01.41 INFO Running tests sequentially. | |
0:01.41 SUITE_START: xpcshell - running 1 tests | |
0:01.43 INFO profile dir is /var/folders/r4/54vpbnzx4_l3jk8cmjgs5v040000gn/T/firefox/xpcshellprofile | |
0:01.43 TEST_START: devtools/server/tests/unit/test_extension_storage_actor.js | |
0:01.43 INFO devtools/server/tests/unit/test_extension_storage_actor.js | full command: ['/Users/bdanforth/src/mozilla-unified/objdir-frontend-debug-artifact/dist/Nightly.app/Contents/MacOS/xpcshell', '-g', '/Users/bdanforth/src/mozilla-unified/objdir-frontend-debug-artifact/dist/Nightly.app/Contents/Resources', '-a', '/Users/bdanforth/src/mozilla-unified/objdir-frontend-debug-artifact/dist/Nightly.app/Contents/Resources/browser', '-r', '/Users/bdanforth/src/moz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in storage actor's `populateStoresForHost` method... | |
this.hostVsStores = new HostVsStoresRouter(host); | |
// Add an intermediary "area" layer between host and storeMap in this.hostVsStores | |
class HostVsStoresRouter { | |
constructor(host) { | |
this.DEFAULT_AREA = "local"; | |
// a triple nested map: host => areaMap, where areaMap is area => storeMap and storeMap is key => value | |
this.router = (new Map()),set(host, new Map()); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This Source Code Form is subject to the terms of the Mozilla Public | |
* License, v. 2.0. If a copy of the MPL was not distributed with this | |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
"use strict"; | |
const {Cc, Ci, Cu, CC} = require("chrome"); | |
const protocol = require("devtools/shared/protocol"); | |
const {LongStringActor} = require("devtools/server/actors/string"); | |
const {DebuggerServer} = require("devtools/server/main"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Any copyright is dedicated to the Public Domain. | |
http://creativecommons.org/publicdomain/zero/1.0/ */ | |
/* globals browser */ | |
"use strict"; | |
const { | |
AddonTestUtils, | |
} = ChromeUtils.import("resource://testing-common/AddonTestUtils.jsm"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Avoid reading `display: none` due to Bug 1381071 | |
isVisible(fnode) { | |
const element = fnode.element; | |
if (element.getBoxQuads().length === 0) { | |
// The element has no box (display: none subtree?), checking | |
// getBoundingClientRect instead for a width and height of 0 only tells | |
// us it is a zero-sized box. | |
return false; | |
} | |
const eleStyle = getComputedStyle(element); |