├── _config.yml
├── atomic-taro
├── Z-Examples-Z
│ ├── driverTest.taro
│ ├── driverTest-meta
│ │ ├── 0
│ │ │ └── 0
│ │ │ │ ├── M.json
│ │ │ │ └── 0.json
│ │ ├── 4f7ba1deace
│ │ │ └── 0
│ │ │ │ ├── M.json
│ │ │ │ └── 0.json
│ │ └── 4e676725d74
│ │ │ └── 0
│ │ │ ├── M.json
│ │ │ └── 0.json
│ ├── appleTest1.py
│ ├── stringMatch-Steps.py
│ ├── appleTest.py
│ ├── stringMatch.py
│ ├── stringMatch-Steps.py.annot.taro
│ ├── appleTest.py.annot.taro
│ ├── stringMatch_V2.py
│ ├── stringMatch.py.annot.taro
│ ├── appleTest.taro
│ ├── stringMatch.taro
│ ├── stringMatch-Steps.taro
│ ├── plotTest.py
│ └── driverTest.py
├── .gitignore
├── CHANGELOG.md
├── styles
│ ├── taro-variables.less
│ ├── pointer.png
│ ├── editor.atom-text-editor.less
│ ├── diff-panels.less
│ ├── commit-alert.less
│ ├── header-menu.less
│ ├── branch-map.less
│ ├── variant-explorer.less
│ ├── commit-line.less
│ └── output-explorer.less
├── node_modules
│ └── diff
│ │ ├── runtime.js
│ │ ├── images
│ │ ├── node_example.png
│ │ └── web_example.png
│ │ ├── examples
│ │ ├── node_example.js
│ │ └── web_example.html
│ │ ├── CONTRIBUTING.md
│ │ ├── lib
│ │ ├── diff
│ │ │ ├── character.js
│ │ │ ├── css.js
│ │ │ ├── sentence.js
│ │ │ ├── line.js
│ │ │ └── word.js
│ │ ├── util
│ │ │ ├── params.js
│ │ │ ├── array.js
│ │ │ └── distance-iterator.js
│ │ ├── convert
│ │ │ ├── dmp.js
│ │ │ └── xml.js
│ │ └── index.js
│ │ ├── LICENSE
│ │ └── package.json
├── Z-DrivingTest
│ └── CS349-roads-master
│ │ ├── Trip.pyc
│ │ ├── tripmatching
│ │ ├── rdp_trip.pyc
│ │ ├── README.md
│ │ ├── matchDriver.py
│ │ ├── C_rdp.csv
│ │ ├── findMatches.py
│ │ ├── rdp_trip.py
│ │ └── C_angle_dist.csv
│ │ ├── Driver.taro
│ │ ├── Trip.taro
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── experiment.py
│ │ ├── VisualizeDriver.py
│ │ ├── plotTurningSpeed.py
│ │ ├── plotTurningSpeed3s.py
│ │ ├── rdp_trip.py
│ │ ├── performance_data.txt
│ │ ├── Trip_rdp.py
│ │ ├── Driver.py
│ │ └── Driver.py.annot.taro
├── spec
│ ├── atomic-taro-view-spec.coffee
│ └── atomic-taro-spec.coffee
├── README.md
├── lib
│ ├── segment-objects
│ │ ├── git-utils.coffee
│ │ ├── branch-map.coffee
│ │ ├── commit-line.coffee
│ │ ├── diff-panels.coffee
│ │ └── main-menu-header.coffee
│ ├── output.coffee
│ ├── program-processor.coffee
│ ├── undo-agent.coffee
│ ├── commit-travel-agent.coffee
│ ├── right-panel
│ │ └── atomic-taro-tool-pane.coffee
│ ├── atomic-taro.coffee
│ ├── ui-helpers
│ │ └── jquery.hoverIntent.minified.js
│ └── variant-meta-agent.coffee
├── taroPy.py
├── menus
│ └── atomic-taro.cson
├── keymaps
│ └── atomic-taro.cson
├── package.json
└── LICENSE.md
├── images
├── natproglogo.jpg
├── artwork 6_poster_.png
├── artwork 8_poster_.png
├── pasted image 352x179.png
├── sample_of_variolite,_olympic_peninsula,_washington_usa.jpg
├── artwork-8.svg
└── artwork-6.svg
├── assets
└── variolite-supporting-exploratory-programming.pdf
├── README.md
├── scripts
├── whatinput.js
├── jquery.watch.js
└── museconfig.js
├── sitemap.xml
├── muse_manifest.xml
└── css
├── index.css
└── site_global.css
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-minimal
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/driverTest.taro:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/atomic-taro/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | npm-debug.log
3 | node_modules
4 |
--------------------------------------------------------------------------------
/images/natproglogo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkery/Variolite/HEAD/images/natproglogo.jpg
--------------------------------------------------------------------------------
/atomic-taro/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 0.1.0 - First Release
2 | * Every feature added
3 | * Every bug fixed
4 |
--------------------------------------------------------------------------------
/atomic-taro/styles/taro-variables.less:
--------------------------------------------------------------------------------
1 | @import "syntax-variables";
2 |
3 | @fontDemoSize: @font-size;
4 |
--------------------------------------------------------------------------------
/images/artwork 6_poster_.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkery/Variolite/HEAD/images/artwork 6_poster_.png
--------------------------------------------------------------------------------
/images/artwork 8_poster_.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkery/Variolite/HEAD/images/artwork 8_poster_.png
--------------------------------------------------------------------------------
/atomic-taro/styles/pointer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkery/Variolite/HEAD/atomic-taro/styles/pointer.png
--------------------------------------------------------------------------------
/images/pasted image 352x179.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkery/Variolite/HEAD/images/pasted image 352x179.png
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/runtime.js:
--------------------------------------------------------------------------------
1 | require('babel-core/register')({
2 | ignore: /\/lib\/|\/node_modules\//
3 | });
4 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/Trip.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkery/Variolite/HEAD/atomic-taro/Z-DrivingTest/CS349-roads-master/Trip.pyc
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/images/node_example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkery/Variolite/HEAD/atomic-taro/node_modules/diff/images/node_example.png
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/images/web_example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkery/Variolite/HEAD/atomic-taro/node_modules/diff/images/web_example.png
--------------------------------------------------------------------------------
/assets/variolite-supporting-exploratory-programming.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkery/Variolite/HEAD/assets/variolite-supporting-exploratory-programming.pdf
--------------------------------------------------------------------------------
/images/sample_of_variolite,_olympic_peninsula,_washington_usa.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkery/Variolite/HEAD/images/sample_of_variolite,_olympic_peninsula,_washington_usa.jpg
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/tripmatching/rdp_trip.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkery/Variolite/HEAD/atomic-taro/Z-DrivingTest/CS349-roads-master/tripmatching/rdp_trip.pyc
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/driverTest-meta/4f7ba1deace/0/M.json:
--------------------------------------------------------------------------------
1 | {"varID":"4f7ba1deacee2005f477a8aa2326059b90905084","commitID":-1,"branchID":0,"text":[{"text":"\tangles = np.empty(shape = dV.shape[0])"}]}
--------------------------------------------------------------------------------
/atomic-taro/spec/atomic-taro-view-spec.coffee:
--------------------------------------------------------------------------------
1 | AtomicTaroView = require '../lib/atomic-taro-view'
2 |
3 | describe "AtomicTaroView", ->
4 | it "has one valid test", ->
5 | expect("life").toBe "easy"
6 |
--------------------------------------------------------------------------------
/atomic-taro/README.md:
--------------------------------------------------------------------------------
1 | # atomic-taro package
2 |
3 | A short description of your package.
4 |
5 | 
6 |
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/driverTest-meta/4e676725d74/0/M.json:
--------------------------------------------------------------------------------
1 | {"varID":"4e676725d74daa8cba66b4cf8b0f8fb6e394c8ea","commitID":-1,"branchID":0,"text":[{"text":"def distance(x0, y0, x1, y1):\n\treturn math.sqrt((x1-x0)**2 + (y1-y0)**2)"}]}
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/appleTest1.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 |
4 | print "Appsssssssssdlde"
5 |
6 | def doPear(s):
7 | print "Pear!!!"
8 | orange = True
9 | if orange:
10 | print "Also orange!"
11 | # Pear ends
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Variolite
2 | Variolite is a package for the Atom editor that allows for lightweight local versioning.
3 |
4 | Note: Variolite is still called 'AtomicTaro' in the source code. This was an early development name that will be changed to Variolite.
5 |
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/stringMatch-Steps.py:
--------------------------------------------------------------------------------
1 | import re
2 | import difflib
3 | import sys
4 |
5 |
6 | def matchString(s):
7 | print difflib.SequenceMatcher(None, s, 'hello world').ratio()
8 |
9 |
10 |
11 |
12 |
13 | matchString("hello world")
14 |
--------------------------------------------------------------------------------
/atomic-taro/lib/segment-objects/git-utils.coffee:
--------------------------------------------------------------------------------
1 | {Point, Range, TextBuffer} = require 'atom'
2 | JsDiff = require 'diff'
3 |
4 |
5 | module.exports =
6 | class GitUtils
7 |
8 | getLatestCommit: (varID, verID) ->
9 | console.log "latest commit?"
10 |
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/appleTest.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 |
4 | print "ApasVcfdcfffddVddVdddffn"
5 |
6 | def doPear(s):
7 | print "Pefffffffffffffffarffff!!!"
8 | orange = True
9 | if orange:
10 | print "Also orange!"
11 | # Pear ends
12 |
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/driverTest-meta/4f7ba1deace/0/0.json:
--------------------------------------------------------------------------------
1 | {"date":"01/15/2017 8:27pm","text":[{"text":"\tangles = np.empty(shape = dV.shape[0])"}],"varID":"4f7ba1deacee2005f477a8aa2326059b90905084","branchID":0,"commitID":0,"output":["280c26d6fede8cae03fa0593054df5b858b457ab"]}
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/stringMatch.py:
--------------------------------------------------------------------------------
1 | import re
2 | import difflib
3 | import sys
4 |
5 |
6 | def matchString(s):
7 | pat = re.compile('(hello|cat)\\ world')
8 | if pat.match(s):
9 | return True
10 | return False
11 |
12 | print matchString(sys.argv[1])
13 |
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/stringMatch-Steps.py.annot.taro:
--------------------------------------------------------------------------------
1 | import re
2 | import difflib
3 | import sys
4 |
5 |
6 | #%%^%%v0-2
7 | def matchString(s):
8 | print difflib.SequenceMatcher(None, s, 'hello world').ratio()
9 | #^^%^^
10 |
11 |
12 |
13 |
14 |
15 | matchString("hello world")
16 |
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/driverTest-meta/4e676725d74/0/0.json:
--------------------------------------------------------------------------------
1 | {"date":"01/15/2017 8:27pm","text":[{"text":"def distance(x0, y0, x1, y1):\n\treturn math.sqrt((x1-x0)**2 + (y1-y0)**2)"}],"varID":"4e676725d74daa8cba66b4cf8b0f8fb6e394c8ea","branchID":0,"commitID":0,"output":["280c26d6fede8cae03fa0593054df5b858b457ab"]}
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/appleTest.py.annot.taro:
--------------------------------------------------------------------------------
1 | import os
2 |
3 |
4 | print "ApasVcfdcfffddVddVdddffn"
5 |
6 | #%%^%%pear
7 | def doPear(s):
8 | print "Pefffffffffffffffarffff!!!"
9 | #%%^%%orange
10 | orange = True
11 | if orange:
12 | #^^%^^
13 | print "Also orange!"
14 | #^^%^^
15 | # Pear ends
16 |
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/stringMatch_V2.py:
--------------------------------------------------------------------------------
1 | import re
2 | import difflib
3 |
4 |
5 | def matchString(s):
6 | return difflib.SequenceMatcher(None, s, 'hello world').ratio()
7 |
8 | pat = re.compile('(hello|cat)\\ world')
9 | if pat.match(s):
10 | return True
11 | return False
12 |
13 | print matchString('hello world')
14 |
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/stringMatch.py.annot.taro:
--------------------------------------------------------------------------------
1 | import re
2 | import difflib
3 | import sys
4 |
5 |
6 | #%%^%%other string match
7 | def matchString(s):
8 | pat = re.compile('(hello|cat)\\ world')
9 | if pat.match(s):
10 | return True
11 | return False
12 | #^^%^^
13 |
14 | print matchString(sys.argv[1])
15 |
--------------------------------------------------------------------------------
/atomic-taro/taroPy.py:
--------------------------------------------------------------------------------
1 | # a script attempting to run python scripts and capture the output
2 |
3 | import subprocess
4 | import sys
5 |
6 |
7 | inScript = sys.argv[1]
8 |
9 | p = subprocess.Popen(['python', inScript], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
10 |
11 | out, err = p.communicate()
12 | print "Yay!"
13 | print out
14 | print err
15 |
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/examples/node_example.js:
--------------------------------------------------------------------------------
1 | require('colors')
2 | var jsdiff = require('../');
3 |
4 | var one = 'beep boop';
5 | var other = 'beep boob blah';
6 |
7 | var diff = jsdiff.diffChars(one, other);
8 |
9 | diff.forEach(function(part){
10 | // green for additions, red for deletions
11 | // grey for common parts
12 | var color = part.added ? 'green' :
13 | part.removed ? 'red' : 'grey';
14 | process.stderr.write(part.value[color]);
15 | });
16 |
17 | console.log();
--------------------------------------------------------------------------------
/atomic-taro/styles/editor.atom-text-editor.less:
--------------------------------------------------------------------------------
1 | @import "ui-variables";
2 | @import "syntax-variables";
3 |
4 |
5 | atom-text-editor::shadow {
6 | .highlight-green .region {
7 | background-color: rgba(0,255,0,0.1);
8 | }
9 |
10 | .highlight-blue .region {
11 | background-color: blue;
12 | }
13 |
14 | .highlight-red .region {
15 | background-color: rgba(255,0,0,0.1);
16 | }
17 |
18 | .highlight-pink .region {
19 | background-color: rgba(92,188,124,0.25);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/appleTest.taro:
--------------------------------------------------------------------------------
1 | {"atomicTaroViewState":{"variants":"# we don't want a variant to be saved unless we plan to keep it\nif @pendingDestruction == false\n if @marker?\n text = @sourceEditor.getTextInBufferRange(@marker.getBufferRange())\n @currentVersion.text = text\n\n # Now, since we can have nested variants that are not in\n # JSON form, put everything in JSON form\n rootVersion: if @rootVersion? then @serializeWalk(@rootVersion) else null\n currentVersion: @currentVersion.id"}}
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/stringMatch.taro:
--------------------------------------------------------------------------------
1 | {"atomicTaroViewState":{"variants":"# we don't want a variant to be saved unless we plan to keep it\nif @pendingDestruction == false\n if @marker?\n text = @sourceEditor.getTextInBufferRange(@marker.getBufferRange())\n @currentVersion.text = text\n\n # Now, since we can have nested variants that are not in\n # JSON form, put everything in JSON form\n rootVersion: if @rootVersion? then @serializeWalk(@rootVersion) else null\n currentVersion: @currentVersion.id"}}
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/stringMatch-Steps.taro:
--------------------------------------------------------------------------------
1 | {"atomicTaroViewState":{"variants":"# we don't want a variant to be saved unless we plan to keep it\nif @pendingDestruction == false\n if @marker?\n text = @sourceEditor.getTextInBufferRange(@marker.getBufferRange())\n @currentVersion.text = text\n\n # Now, since we can have nested variants that are not in\n # JSON form, put everything in JSON form\n rootVersion: if @rootVersion? then @serializeWalk(@rootVersion) else null\n currentVersion: @currentVersion.id"}}
--------------------------------------------------------------------------------
/atomic-taro/lib/output.coffee:
--------------------------------------------------------------------------------
1 | crypto = require 'crypto'
2 |
3 | module.exports =
4 | class Output
5 |
6 | constructor: (command, data) ->
7 | @command = command
8 | @data = data
9 | @commit = null
10 | @element = null
11 | @key = crypto.randomBytes(20).toString('hex')
12 |
13 | getCommand: ->
14 | @command
15 |
16 | getData: ->
17 | @data
18 |
19 | setCommit: (comm) ->
20 | @commit = comm
21 |
22 | getCommit: ->
23 | @commit
24 |
25 | getID: ->
26 | @key
27 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/Driver.taro:
--------------------------------------------------------------------------------
1 | {"atomicTaroViewState":{"variants":"# we don't want a variant to be saved unless we plan to keep it\nif @pendingDestruction == false\n if @marker?\n text = @sourceEditor.getTextInBufferRange(@marker.getBufferRange())\n @currentVersion.text = text\n\n # Now, since we can have nested variants that are not in\n # JSON form, put everything in JSON form\n rootVersion: if @rootVersion? then @serializeWalk(@rootVersion) else null\n currentVersion: @currentVersion.id"}}
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/Trip.taro:
--------------------------------------------------------------------------------
1 | {"atomicTaroViewState":{"variants":"# we don't want a variant to be saved unless we plan to keep it\nif @pendingDestruction == false\n if @marker?\n text = @sourceEditor.getTextInBufferRange(@marker.getBufferRange())\n @currentVersion.text = text\n\n # Now, since we can have nested variants that are not in\n # JSON form, put everything in JSON form\n rootVersion: if @rootVersion? then @serializeWalk(@rootVersion) else null\n currentVersion: @currentVersion.id"}}
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/examples/web_example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/atomic-taro/menus/atomic-taro.cson:
--------------------------------------------------------------------------------
1 | # See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details
2 | 'context-menu':
3 | 'atom-text-editor': [
4 | {
5 | 'label': 'Toggle atomic-taro'
6 | 'command': 'atomic-taro:open'
7 | }
8 | ]
9 | 'atom-pane': [
10 | {
11 | 'label': 'Wrap in Variant'
12 | 'command': 'atomic-taro:taronewvariant'
13 | }
14 | ]
15 | 'menu': [
16 | {
17 | 'label': 'Packages'
18 | 'submenu': [
19 | 'label': 'atomic-taro'
20 | 'submenu': [
21 | {
22 | 'label': 'Toggle'
23 | 'command': 'atomic-taro:open'
24 | }
25 | ]
26 | ]
27 | }
28 | ]
29 |
--------------------------------------------------------------------------------
/atomic-taro/keymaps/atomic-taro.cson:
--------------------------------------------------------------------------------
1 | # Keybindings require three things to be fully defined: A selector that is
2 | # matched against the focused element, the keystroke and the command to
3 | # execute.
4 | #
5 | # Below is a basic keybinding which registers on all platforms by applying to
6 | # the root workspace element.
7 |
8 | # For more detailed documentation see
9 | # https://atom.io/docs/latest/behind-atom-keymaps-in-depth
10 | 'atom-workspace':
11 | 'ctrl-alt-o': 'atomic-taro:toggle'
12 |
13 |
14 | '.platform-darwin .atomic-taro':
15 | 'cmd-/': 'atomic-taro:toggleToolPane'
16 |
17 | '.platform-win32 .atomic-taro, .platform-linux .atomic-taro':
18 | 'ctrl-/': 'atomic-taro:toggleToolPane'
19 |
--------------------------------------------------------------------------------
/atomic-taro/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "atomic-taro",
3 | "main": "./lib/atomic-taro",
4 | "version": "0.0.0",
5 | "description": "A short description of your package",
6 | "keywords": [],
7 | "activationCommands": {
8 | "atom-workspace": "atomic-taro:open"
9 | },
10 | "repository": "https://github.com/atom/atomic-taro",
11 | "license": "MIT",
12 | "engines": {
13 | "atom": ">=1.0.0 <2.0.0"
14 | },
15 | "dependencies": {
16 | "atom-space-pen-views": "^2.0.0",
17 | "diff": "^2.2.3",
18 | "jquery": "^2.1.4",
19 | "jquery-ui-browserify": "^1.0.0",
20 | "autocomplete-python": "^1.0.0",
21 | "autocomplete-plus": "2.31.1",
22 | "crypto": "^1.0.0"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/images/artwork-8.svg:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/tripmatching/README.md:
--------------------------------------------------------------------------------
1 | Trip matching algorithm, very much a work in progress.
2 |
3 | rdp_trip.py - simplifies the (x,y) path using our implementation of the Ramer–Douglas–Peucker algorithm. The program outputs the rdp simplification of a given trip to a csv, and also outputs the trip formatted as a series of angles/distances.
4 |
5 | findMatches.py - Takes 2 trips, and uses rdp and angle/distance formats of each to score similair trip segments.
6 |
7 | matchDriver.py - Runs an experiment on a single driver. This takes 200 trips of a driver and compares their similarity to test consistency of the matching algorithm... it's not yet very good.
8 |
9 |
10 |
11 | The csv's A, B, and C are for testing. A and B are trips that should match when compared and C is a random non-matching trip to compare against.
12 |
13 |
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/plotTest.py:
--------------------------------------------------------------------------------
1 | # from https://github.com/mkery/CS349-roads/blob/master/VisualizeDriver.py
2 |
3 | def plotTrip(filename):
4 | tripName = int(os.path.basename(filename).split(".")[0])
5 | tripPath = np.genfromtxt(filename, delimiter=',', skip_header=1, dtype=(float,float))
6 |
7 | reducedTrip = rdp_trip.rdp(tripPath, epsilon=0.75)
8 | v, distancesum = velocities_and_distance_covered(tripPath)
9 | stops = findStops(v)
10 |
11 | """pyplot.figure(1)
12 | pyplot.subplot(211)"""
13 | startPoint = (tripPath[0][0], tripPath[1][1])
14 | pyplot.plot(tripPath[:,0], tripPath[:,1], 'bx', startPoint[0], startPoint[1], 'bs')
15 | for (x, y) in reducedTrip:
16 | pyplot.plot(x, y, 'ro')
17 | print str((x,y))
18 | for (st,en) in stops:
19 | pyplot.plot(tripPath[st][0], tripPath[st][1], "go")
20 |
21 | pyplot.ylabel('y')
22 | pyplot.xlabel('x')
23 | pyplot.show()
24 | """pyplot.subplot(212)
25 | pyplot.plot(v, label='velocity')
26 | pyplot.show()"""
27 |
--------------------------------------------------------------------------------
/atomic-taro/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 MaryBeth
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/tripmatching/matchDriver.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import sys
3 | import matplotlib.pyplot as pyplot
4 | import rdp_trip as rdp
5 | import findMatches as findMatches
6 |
7 | driver = sys.argv[1]
8 | driverB = 2
9 | """
10 | for i in range(1,201):
11 | print "generating rdp for "+str(driver)+" trip "+str(i)
12 | rdp.generateRDP(str(driver)+"_"+str(i), str(driver), str(i))
13 | """
14 | results = []
15 |
16 | for i in range(1,2):
17 | aa = open("driver"+str(driver)+"/"+str(driver)+"_"+str(i)+"_angle_dist.csv")
18 | tripA = np.genfromtxt(aa, delimiter=',')
19 | aa.close()
20 | ardp = open("driver"+str(driver)+"/"+str(driver)+"_"+str(i)+"_rdp.csv")
21 | tripA_rdp = np.genfromtxt(ardp, delimiter=',')
22 | ardp.close()
23 | for j in range(1,200):
24 | if j != i:
25 | aa = open("driver"+str(driver)+"/"+str(driver)+"_"+str(j)+"_angle_dist.csv")
26 | tripB = np.genfromtxt(aa, delimiter=',')
27 | aa.close()
28 | ardp = open("driver"+str(driver)+"/"+str(driver)+"_"+str(j)+"_rdp.csv")
29 | tripB_rdp = np.genfromtxt(ardp, delimiter=',')
30 | ardp.close()
31 | res = findMatches.matchTrips(tripA, tripA_rdp, tripB, tripB_rdp)
32 | print "trips "+str(i)+" : "+str(j)+" "+str(res)
33 | results.append(findMatches.matchTrips(tripA, tripA_rdp, tripB, tripB_rdp))
34 |
35 |
36 | np.savetxt(str(driver)+"_matchres.csv", results, delimiter=",")
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to Contribute
2 |
3 | ## Pull Requests
4 |
5 | We also accept [pull requests][pull-request]!
6 |
7 | Generally we like to see pull requests that
8 | - Maintain the existing code style
9 | - Are focused on a single change (i.e. avoid large refactoring or style adjustments in untouched code if not the primary goal of the pull request)
10 | - Have [good commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
11 | - Have tests
12 | - Don't decrease the current code coverage (see coverage/lcov-report/index.html)
13 |
14 | ## Building
15 |
16 | ```
17 | npm install
18 | grunt
19 | ````
20 |
21 | The `grunt dev` implements watching for tests within Node and `karma start` may be used for manual testing in browsers.
22 |
23 | If you notice any problems, please report them to the GitHub issue tracker at
24 | [http://github.com/kpdecker/jsdiff/issues](http://github.com/kpdecker/jsdiff/issues).
25 |
26 | ## Releasing
27 |
28 | JsDiff utilizes the [release yeoman generator][generator-release] to perform most release tasks.
29 |
30 | A full release may be completed with the following:
31 |
32 | ```
33 | yo release
34 | npm publish
35 | yo release:publish components jsdiff dist/components/
36 | ```
37 |
38 | [generator-release]: https://github.com/walmartlabs/generator-release
39 | [pull-request]: https://github.com/kpdecker/jsdiff/pull/new/master
40 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/README.md:
--------------------------------------------------------------------------------
1 | # CS349-roads
2 | A final project for CS349: Data Privacy
3 |
4 | In order to run the present code, you need to download the data for the Kaggle Driver Telematics contest and place it in a directory "drivers," which can be found at "../drivers" relative to the directory of our code.
5 |
6 | Important files:
7 | Trip.py - creates a trip object using from a filename and a binary string specifying what features to be included; 1 in position i indicates that the ith feature should be included; the features are numbered as follows:
8 | 0 - total trip distance
9 | 1 - average speed
10 | 2 - maximum speed
11 | 3 - speed
12 | 4 - acceleration
13 | 5 - turning angle over 3s
14 | 6 - turning angle*speed over 3s
15 | 7 - speed*acceleration
16 | 8 - heading/angle with respect to (1,0)
17 | 9 - low speed count
18 | 10 - jerk
19 | 11 - distance up a point
20 | 12 - bee-line distance to the origin
21 | 13 - turning angles for bigger turns (over 50 degrees)
22 | 14 - turning distances for turns over 50 degrees
23 | 15 - average turning speed*angle for turns over 50 degrees
24 |
25 | Driver.py - creates a driver object, and contains methods for creating datasets to be used as training/testing data and executing a classification task.
26 |
27 | experiment.py - carries out an experiment consisting of a given number of trials
28 |
29 | tripmatching - contains code of trip matching and rdp algorithm
30 |
31 |
32 |
--------------------------------------------------------------------------------
/atomic-taro/lib/program-processor.coffee:
--------------------------------------------------------------------------------
1 | {Point, Range, TextBuffer, DisplayMarker, TextEditor} = require 'atom'
2 | {spawn} = require 'child_process'
3 |
4 | module.exports =
5 | class ProgramProcessor
6 |
7 | constructor: (@baseFolder, @file, @fileName, @atomicTaroView) ->
8 | @commandHistory = null
9 |
10 |
11 | getLast: ->
12 | @commandHistory
13 |
14 |
15 | run: (command) ->
16 | console.log "RUN! "+@file
17 | if command?
18 | # do program
19 | #setFolder = spawn 'pwd'
20 | @commandHistory = command
21 |
22 | firstSpace = command.indexOf(" ")
23 | console.log "FIRST SPACE "+firstSpace
24 | secondSpace = command.indexOf(" ", firstSpace + 1)
25 | console.log "SECOND SPACE "+secondSpace
26 | as = command.substring(secondSpace + 1)
27 | pyFile = command.substring(firstSpace + 1, secondSpace)
28 | console.log "args "+as
29 |
30 | py = spawn 'python', [pyFile, as], {cwd: @baseFolder}
31 | console.log "Attempting ", pyFile, " ", as, " ", @baseFolder
32 | else
33 | command = "python "+@fileName
34 | @commandHistory = command
35 | py = spawn 'python', [@file]
36 | # receive all output and process
37 | py.stdout.on 'data', (data) =>
38 | console.log data.toString().trim()
39 | @atomicTaroView.registerOutput(command, data)
40 | # receive error messages and process
41 | py.stderr.on 'data', (data) =>
42 | @atomicTaroView.registerErr(command, data)
43 |
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/lib/diff/character.js:
--------------------------------------------------------------------------------
1 | /*istanbul ignore start*/'use strict';
2 |
3 | exports.__esModule = true;
4 | exports.characterDiff = undefined;
5 | exports. /*istanbul ignore end*/diffChars = diffChars;
6 |
7 | var /*istanbul ignore start*/_base = require('./base') /*istanbul ignore end*/;
8 |
9 | /*istanbul ignore start*/
10 | var _base2 = _interopRequireDefault(_base);
11 |
12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13 |
14 | /*istanbul ignore end*/var characterDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/characterDiff = new /*istanbul ignore start*/_base2.default() /*istanbul ignore end*/;
15 | function diffChars(oldStr, newStr, callback) {
16 | return characterDiff.diff(oldStr, newStr, callback);
17 | }
18 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2NoYXJhY3Rlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O2dDQUdnQjs7QUFIaEI7Ozs7Ozs7dUJBRU8sSUFBTSx5RkFBZ0IscUVBQWhCO0FBQ04sU0FBUyxTQUFULENBQW1CLE1BQW5CLEVBQTJCLE1BQTNCLEVBQW1DLFFBQW5DLEVBQTZDO0FBQUUsU0FBTyxjQUFjLElBQWQsQ0FBbUIsTUFBbkIsRUFBMkIsTUFBM0IsRUFBbUMsUUFBbkMsQ0FBUCxDQUFGO0NBQTdDIiwiZmlsZSI6ImNoYXJhY3Rlci5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cbmV4cG9ydCBjb25zdCBjaGFyYWN0ZXJEaWZmID0gbmV3IERpZmYoKTtcbmV4cG9ydCBmdW5jdGlvbiBkaWZmQ2hhcnMob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKSB7IHJldHVybiBjaGFyYWN0ZXJEaWZmLmRpZmYob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKTsgfVxuIl19
19 |
--------------------------------------------------------------------------------
/atomic-taro/styles/diff-panels.less:
--------------------------------------------------------------------------------
1 | // The ui-variables file is provided by base themes provided by Atom.
2 | //
3 | // See https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less
4 | // for a full listing of what's available.
5 | @import "ui-variables";
6 | @import "syntax-variables";
7 |
8 |
9 | .atomic-taro_diff-panel{
10 | display: inline-block;
11 | margin: 0px;
12 | border: 1px solid @text-color;
13 | font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier;
14 | z-index: 5;
15 | color: @text-color;
16 | min-height: 100px;
17 | position: relative;
18 | }
19 |
20 | .atomic-taro_diff-side-panel{
21 | vertical-align: text-top;
22 | display: inline-block;
23 | margin: 0px;
24 | border: 1px solid @tool-panel-border-color;
25 | }
26 |
27 | .atomic-taro_diff-label{
28 | display: inline-block;
29 | text-align: center;
30 | border-bottom: 1px solid @tool-panel-border-color;
31 | width: 100%;
32 | }
33 |
34 | .atomic-taro_diff-header-box{
35 | z-index: 6;
36 | //display: inline-block;
37 | color: @mono-3;
38 | font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier;
39 | margin: 0px;
40 | margin-top: 2px;
41 | transition: border-width 0.1s ease-in-out;
42 | transition: margin-left 0.5s ease-in-out;
43 | //border: 1px solid @hue-1;
44 | //background-color: //@app-background-color;//@inset-panel-background-color;
45 | border: 1px solid transparent;
46 | border-top: 1px solid @mono-3;
47 | border-bottom: 1px solid @inset-panel-background-color;
48 | margin-bottom: 5px;
49 | }
50 |
--------------------------------------------------------------------------------
/atomic-taro/lib/undo-agent.coffee:
--------------------------------------------------------------------------------
1 | {TextBuffer} = require 'atom'
2 | {Point, Range} = require 'atom'
3 | Variant = require './segment-objects/variant-model'
4 | VariantView = require './segment-objects/variant-view'
5 | AtomicTaroToolPane = require './right-panel/atomic-taro-tool-pane'
6 |
7 |
8 |
9 | module.exports =
10 | class UndoAgent
11 |
12 | constructor: (maxUndo) ->
13 | @undoStack = []
14 | @maxUndoEntries = maxUndo
15 | @buffer = null
16 |
17 | setBuffer: (b) ->
18 | @buffer = b
19 |
20 | pushChange: (params) ->
21 | #checkpointId = @buffer.createCheckpoint()
22 | #@undoStack.push {params: params, bufferCheck: checkpointId}
23 | #@enforceUndoStackSizeLimit()
24 |
25 |
26 | undoNow: ->
27 | # change = @undoStack[@undoStack.length - 1] # get top of stack
28 | # if change?
29 | # bufferCheck = change.bufferCheck
30 | # sinceThen = @buffer.getChangesSinceCheckpoint(bufferCheck)
31 | # console.log sinceThen.length+" operations since then"
32 | # if sinceThen.length == 0
33 | # console.log "undo taro please"
34 | # return true
35 | # false
36 |
37 |
38 | revertChange: () ->
39 | # change = @undoStack.pop()
40 | # if change?
41 | # data = change.params.data
42 | # callback = change.params.callback
43 | # console.log "got change revert"
44 | # console.log data
45 | # console.log callback
46 | # callback(data)
47 |
48 |
49 | enforceUndoStackSizeLimit: ->
50 | # if @undoStack.length > @maxUndoEntries
51 | # @undoStack.splice(0, @undoStack.length - @maxUndoEntries)
52 |
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/lib/util/params.js:
--------------------------------------------------------------------------------
1 | /*istanbul ignore start*/'use strict';
2 |
3 | exports.__esModule = true;
4 | exports. /*istanbul ignore end*/generateOptions = generateOptions;
5 | function generateOptions(options, defaults) {
6 | if (typeof options === 'function') {
7 | defaults.callback = options;
8 | } else if (options) {
9 | for (var name in options) {
10 | /* istanbul ignore else */
11 | if (options.hasOwnProperty(name)) {
12 | defaults[name] = options[name];
13 | }
14 | }
15 | }
16 | return defaults;
17 | }
18 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3BhcmFtcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCO0FBQVQsU0FBUyxlQUFULENBQXlCLE9BQXpCLEVBQWtDLFFBQWxDLEVBQTRDO0FBQ2pELE1BQUksT0FBTyxPQUFQLEtBQW1CLFVBQW5CLEVBQStCO0FBQ2pDLGFBQVMsUUFBVCxHQUFvQixPQUFwQixDQURpQztHQUFuQyxNQUVPLElBQUksT0FBSixFQUFhO0FBQ2xCLFNBQUssSUFBSSxJQUFKLElBQVksT0FBakIsRUFBMEI7O0FBRXhCLFVBQUksUUFBUSxjQUFSLENBQXVCLElBQXZCLENBQUosRUFBa0M7QUFDaEMsaUJBQVMsSUFBVCxJQUFpQixRQUFRLElBQVIsQ0FBakIsQ0FEZ0M7T0FBbEM7S0FGRjtHQURLO0FBUVAsU0FBTyxRQUFQLENBWGlEO0NBQTVDIiwiZmlsZSI6InBhcmFtcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBmdW5jdGlvbiBnZW5lcmF0ZU9wdGlvbnMob3B0aW9ucywgZGVmYXVsdHMpIHtcbiAgaWYgKHR5cGVvZiBvcHRpb25zID09PSAnZnVuY3Rpb24nKSB7XG4gICAgZGVmYXVsdHMuY2FsbGJhY2sgPSBvcHRpb25zO1xuICB9IGVsc2UgaWYgKG9wdGlvbnMpIHtcbiAgICBmb3IgKGxldCBuYW1lIGluIG9wdGlvbnMpIHtcbiAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICBpZiAob3B0aW9ucy5oYXNPd25Qcm9wZXJ0eShuYW1lKSkge1xuICAgICAgICBkZWZhdWx0c1tuYW1lXSA9IG9wdGlvbnNbbmFtZV07XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiBkZWZhdWx0cztcbn1cbiJdfQ==
19 |
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/driverTest.py:
--------------------------------------------------------------------------------
1 | import matplotlib.pyplot as pyplot
2 | import numpy as np
3 | import math
4 |
5 |
6 | def distance(x0, y0, x1, y1):
7 | return math.sqrt((x1-x0)**2 + (y1-y0)**2)
8 |
9 | def computeAngle (p1, p2):
10 | dot = 0
11 | if computeNorm(p2[0], p2[1]) == 0 or computeNorm(p1[0], p1[1])==0:
12 | dot = 0
13 | else:
14 | dot = (p2[0]*p1[0]+p2[1]*p1[1])/float(computeNorm(p1[0], p1[1])*computeNorm(p2[0], p2[1]))
15 | if dot > 1:
16 | dot = 1
17 | elif dot < -1:
18 | dot = -1
19 | return math.acos(dot)*180/math.pi
20 |
21 | def compute_AllAngles (trip):
22 | dV = np.diff(trip, axis = 0) #x1-x0 and y1-y0
23 | angles = np.empty(shape = dV.shape[0])
24 | for i in range(1, trip.shape[0] - 1):
25 | ang = computeAngle(dV[i-1], dV[i])
26 | np.append(angles, [ang, dV[i][2]]) #append angle with timepoint
27 | return angles
28 |
29 | def findStops(speeds):
30 | stops = [] #stops are a start and end time pair
31 | start = -1
32 | end = -1
33 | for i in range(1, len(speeds)):
34 | advS = (speeds[i] + speeds[i-1])/2 #smooth out noise in stop duration
35 | if speeds[i] == 0: #start of stop
36 | end = i
37 | if start == -1:
38 | start = i
39 | elif (start > -1) and (advS > 1):
40 | stops.append([start,end])
41 | start = -1
42 | end = -1
43 | if start > -1:
44 | stops.append([start, len(speeds)])
45 | return stops
46 |
47 |
48 |
49 | def printHist_Feature(hist):
50 | h = ""
51 | for i in range(len(hist)-1):
52 | h += str(hist[i])+","
53 | #to avoid final comma (will mess up input)
54 | h += str(hist[len(hist)-1])
55 | return h
56 |
57 |
58 | def computeNorm(p1, p2):
59 | return p1/(p1 + p2)
60 |
61 |
62 | print "54.0421"
63 |
--------------------------------------------------------------------------------
/scripts/whatinput.js:
--------------------------------------------------------------------------------
1 | (function(a,b){typeof define==="function"&&define.amd?define([],function(){return b()}):typeof exports==="object"?module.exports=b():a.whatInput=b()})(this,function(){function a(a){clearTimeout(p);c(a);i=!0;p=setTimeout(function(){i=!1},1E3)}function b(a){i||c(a)}function c(a){var c=a.keyCode?a.keyCode:a.which,b=a.target||a.srcElement,d=l[a.type];d==="pointer"&&(d=typeof a.pointerType==="number"?q[a.pointerType]:a.pointerType);if(h!==d&&(k||!h||!(d==="keyboard"&&o[c]!=="tab"&&j.indexOf(b.nodeName.toLowerCase())>=
2 | 0)))h=d,f.setAttribute("data-whatinput",h),m.indexOf(h)===-1&&m.push(h);d==="keyboard"&&g.indexOf(o[c])===-1&&o[c]&&g.push(o[c])}function d(a){a=g.indexOf(o[a.keyCode?a.keyCode:a.which]);a!==-1&&g.splice(a,1)}var g=[],f=document.body,i=!1,h=null,j=["input","select","textarea"],k=f.hasAttribute("data-whatinput-formtyping"),l={keydown:"keyboard",mousedown:"mouse",mouseenter:"mouse",touchstart:"touch",pointerdown:"pointer",MSPointerDown:"pointer"},m=[],o={9:"tab",13:"enter",16:"shift",27:"esc",32:"space",
3 | 37:"left",38:"up",39:"right",40:"down"},q={2:"touch",3:"touch",4:"mouse"},p;(function(){var c="mousedown";window.PointerEvent?c="pointerdown":window.MSPointerEvent&&(c="MSPointerDown");f.addEventListener?(f.addEventListener(c,b),f.addEventListener("mouseenter",b),"ontouchstart"in document.documentElement&&f.addEventListener("touchstart",a),f.addEventListener("keydown",b),f.addEventListener("keyup",d)):(f.attachEvent(c,b),f.attachEvent("mouseenter",b),"ontouchstart"in document.documentElement&&f.attachEvent("touchstart",
4 | a),f.attachEvent("keydown",b),f.attachEvent("keyup",d))})();return{ask:function(){return h},keys:function(){return g},types:function(){return m},set:c}});
5 |
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/LICENSE:
--------------------------------------------------------------------------------
1 | Software License Agreement (BSD License)
2 |
3 | Copyright (c) 2009-2015, Kevin Decker
4 |
5 | All rights reserved.
6 |
7 | Redistribution and use of this software in source and binary forms, with or without modification,
8 | are permitted provided that the following conditions are met:
9 |
10 | * Redistributions of source code must retain the above
11 | copyright notice, this list of conditions and the
12 | following disclaimer.
13 |
14 | * Redistributions in binary form must reproduce the above
15 | copyright notice, this list of conditions and the
16 | following disclaimer in the documentation and/or other
17 | materials provided with the distribution.
18 |
19 | * Neither the name of Kevin Decker nor the names of its
20 | contributors may be used to endorse or promote products
21 | derived from this software without specific prior
22 | written permission.
23 |
24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
25 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
26 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
27 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
30 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/images/artwork-6.svg:
--------------------------------------------------------------------------------
1 |
25 |
--------------------------------------------------------------------------------
/sitemap.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | https://mkery.github.io/Variolite/index.html
5 | 2017-01-12
6 | weekly
7 | 0.5
8 |
9 |
10 | https://mkery.github.io/Variolite/images/artwork-6.svg
11 | 2017-01-12
12 | weekly
13 | 0.5
14 |
15 |
16 | https://mkery.github.io/Variolite/images/sample_of_variolite,_olympic_peninsula,_washington_usa.jpg
17 | 2017-01-12
18 | weekly
19 | 0.5
20 |
21 |
22 | https://mkery.github.io/Variolite/assets/variolite-supporting-exploratory-programming.pdf
23 | 2017-01-06
24 | weekly
25 | 0.5
26 |
27 |
28 | https://mkery.github.io/Variolite/images/pasted%20image%20352x179.png
29 | 2017-01-12
30 | weekly
31 | 0.5
32 |
33 |
34 | https://mkery.github.io/Variolite/images/natproglogo.jpg
35 | 2017-01-12
36 | weekly
37 | 0.5
38 |
39 |
40 | https://mkery.github.io/Variolite/images/artwork-8.svg
41 | 2017-01-12
42 | weekly
43 | 0.5
44 |
45 |
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/lib/diff/css.js:
--------------------------------------------------------------------------------
1 | /*istanbul ignore start*/'use strict';
2 |
3 | exports.__esModule = true;
4 | exports.cssDiff = undefined;
5 | exports. /*istanbul ignore end*/diffCss = diffCss;
6 |
7 | var /*istanbul ignore start*/_base = require('./base') /*istanbul ignore end*/;
8 |
9 | /*istanbul ignore start*/
10 | var _base2 = _interopRequireDefault(_base);
11 |
12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13 |
14 | /*istanbul ignore end*/var cssDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/cssDiff = new /*istanbul ignore start*/_base2.default() /*istanbul ignore end*/;
15 | cssDiff.tokenize = function (value) {
16 | return value.split(/([{}:;,]|\s+)/);
17 | };
18 |
19 | function diffCss(oldStr, newStr, callback) {
20 | return cssDiff.diff(oldStr, newStr, callback);
21 | }
22 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Nzcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O2dDQU9nQjs7QUFQaEI7Ozs7Ozs7dUJBRU8sSUFBTSw2RUFBVSxxRUFBVjtBQUNiLFFBQVEsUUFBUixHQUFtQixVQUFTLEtBQVQsRUFBZ0I7QUFDakMsU0FBTyxNQUFNLEtBQU4sQ0FBWSxlQUFaLENBQVAsQ0FEaUM7Q0FBaEI7O0FBSVosU0FBUyxPQUFULENBQWlCLE1BQWpCLEVBQXlCLE1BQXpCLEVBQWlDLFFBQWpDLEVBQTJDO0FBQUUsU0FBTyxRQUFRLElBQVIsQ0FBYSxNQUFiLEVBQXFCLE1BQXJCLEVBQTZCLFFBQTdCLENBQVAsQ0FBRjtDQUEzQyIsImZpbGUiOiJjc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgRGlmZiBmcm9tICcuL2Jhc2UnO1xuXG5leHBvcnQgY29uc3QgY3NzRGlmZiA9IG5ldyBEaWZmKCk7XG5jc3NEaWZmLnRva2VuaXplID0gZnVuY3Rpb24odmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlLnNwbGl0KC8oW3t9OjssXXxcXHMrKS8pO1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIGRpZmZDc3Mob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKSB7IHJldHVybiBjc3NEaWZmLmRpZmYob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKTsgfVxuIl19
23 |
--------------------------------------------------------------------------------
/muse_manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/experiment.py:
--------------------------------------------------------------------------------
1 | #This program carries out an experiment consisting on m trials (each consisting of 5 sample runs) with a specified feature set;
2 | #it takes in the following parameters:
3 | #number m - number of randomly selected drivers on which the model will be tested,
4 | #number n - number of 'other' drivers for each trial, 0 for all drivers,
5 | #binary string of length at most 16 specifying which features to be used (see numbering in readme file)
6 | #file name specifying where the results should be stored.
7 | #Note that the program outputs values for precision, recall, f1 score, and auc for each trial.
8 |
9 | import os
10 | import sys
11 | from Driver import Driver
12 | import random
13 |
14 | #get a list of drivers
15 | drivers = os.listdir("../drivers/")
16 | copy = drivers[1:]
17 | random.shuffle(copy)
18 | drivers[1:]=copy
19 |
20 |
21 | #store input parameters
22 | m = int(sys.argv[1]) #number of drivers in total
23 | n = int(sys.argv[2]) #number of drivers to compare against
24 | feat = sys.argv[3] #binary sequence corresponding to features
25 | g = open (sys.argv[4], "w")
26 | g.write("driver,precision,recall,f1,auc\n")
27 | g.close()
28 |
29 | #run experiment on m randomly chosen drivers
30 | for i in range(1, m+1):
31 | g = open (sys.argv[4], "a") #so we can be able to see the contents as the file is being written
32 | #print drivers[i]
33 |
34 | #execute classification
35 | d = Driver(drivers[i])
36 | d.createDataSets(n, feat)
37 | results = d.classify()
38 |
39 | #output results
40 | for res in results:
41 | f1 = 2*(res[0]*res[1])/(res[0]+res[1])
42 | g.write (drivers[i] + ","+ str(res[0]) + "," + str(res[1]) + "," +str(f1) +"," + str(res[2])+'\n')
43 | #sys.exit()
44 | g.close()
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/atomic-taro/styles/commit-alert.less:
--------------------------------------------------------------------------------
1 | // The ui-variables file is provided by base themes provided by Atom.
2 | //
3 | // See https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less
4 | // for a full listing of what's available.
5 | @import "ui-variables";
6 | @import "syntax-variables";
7 |
8 | .atomic-taro_main-menu_alertBox{
9 | background-color: @text-color-warning;
10 | color: white;
11 | padding: 5px;
12 | }
13 |
14 |
15 |
16 | .atomic-taro_commitAlertLabel{
17 | font-style: italic;
18 | margin-left: 5px;
19 | color: white;//@background-color-highlight;
20 | }
21 |
22 | .atomic-taro_commitLock{
23 | color: black;
24 | }
25 |
26 | .atomic-taro_commitBackButton{
27 | position: relative;
28 | left: -5px;
29 | padding: 10px;
30 | padding-left: 8px;
31 | padding-right: 15px;
32 | margin-right: 10px;
33 | border-right: 1px solid white;
34 | color: white;
35 | }
36 | .atomic-taro_commitBackButton:hover{
37 | background-color: rgba(255, 255, 255, 0.4);
38 | }
39 |
40 |
41 | // For moding the style of other elements of the interface while time traveling
42 |
43 | .atomic-taro_editor-header-box.historical{
44 | border-top: 2px solid @text-color-warning;
45 | //background-color: @text-color-warning;
46 | }
47 | .atomic-taro_editor-header-box.historical:hover, .atomic-taro_editor-header-box.historical.active{
48 | border: 2px solid @text-color-warning;
49 | }
50 |
51 | .atomic-taro_commit-traveler.historical{
52 | border: 1px solid @text-color-warning;
53 | }
54 |
55 | .atomic-taro_editor-footer-box.historical{
56 | border-top: 2px solid @text-color-warning;
57 | }
58 | .atomic-taro_editor-footer-box.historical.active{
59 | border-top: 1px solid @syntax-text-color;
60 | border-bottom: 2px solid @text-color-warning;
61 | }
62 |
--------------------------------------------------------------------------------
/atomic-taro/styles/header-menu.less:
--------------------------------------------------------------------------------
1 | // The ui-variables file is provided by base themes provided by Atom.
2 | //
3 | // See https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less
4 | // for a full listing of what's available.
5 | @import "ui-variables";
6 | @import "syntax-variables";
7 | @import "taro-variables";
8 |
9 |
10 |
11 | .atomic-taro_main-menu{
12 | padding-top: 10px;
13 | padding-bottom: 10px;
14 | padding-left: 10px;
15 | background-color: @base-background-color;//white;
16 | border-bottom: 1px solid @tool-panel-border-color;
17 | font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier;
18 | font-size: @fontDemoSize;
19 | position: relative;
20 | top: 0px;
21 | z-index: 10;
22 | color: @text-color;
23 | display: flex;
24 | flex-direction: row;
25 | width: 100%;
26 | }
27 |
28 | .atomic-taro_main-menu_runIcon{
29 | margin-left: 5px;
30 | border-right: 1px solid @tool-panel-border-color;
31 | padding: 2px;
32 | padding-right: 15px;
33 | //font-size: 200%;
34 | text-align: center;
35 | }
36 | .atomic-taro_main-menu_runIcon:hover{
37 | background-color: @tab-background-color;
38 | }
39 | .atomic-taro_main-menu_runIcon.click{
40 | color: @text-color-success;
41 | background-color: @button-background-color-hover;
42 | }
43 |
44 |
45 | .atomic-taro_main-menu_variantContainer
46 | {
47 | position: absolute;
48 | right: 0px;
49 | }
50 |
51 |
52 | .atomic-taro_main-menu_branchIcon{
53 | margin-left: 10px;
54 | }
55 |
56 | .main-menu_variantButton{
57 | padding-left: 10px;
58 | padding-right: 10px;
59 | color: @syntax-text-color;
60 | //font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier;
61 | float: right;
62 | border-left: 1px solid @tool-panel-border-color;
63 | text-align: center;
64 | }
65 |
--------------------------------------------------------------------------------
/atomic-taro/Z-Examples-Z/driverTest-meta/0/0/M.json:
--------------------------------------------------------------------------------
1 | {"varID":0,"commitID":-1,"branchID":0,"text":[{"text":"import matplotlib.pyplot as pyplot\nimport numpy as np\nimport math\n\n\n"},{"varID":"4e676725d74daa8cba66b4cf8b0f8fb6e394c8ea","commitID":-1,"branchID":0,"text":[{"text":"def distance(x0, y0, x1, y1):\n\treturn math.sqrt((x1-x0)**2 + (y1-y0)**2)"}]},{"text":"\n\ndef computeAngle (p1, p2):\n\tdot = 0\n\tif computeNorm(p2[0], p2[1]) == 0 or computeNorm(p1[0], p1[1])==0:\n\t\tdot = 0\n\telse:\n\t\tdot = (p2[0]*p1[0]+p2[1]*p1[1])/float(computeNorm(p1[0], p1[1])*computeNorm(p2[0], p2[1]))\n\tif dot > 1:\n\t\tdot = 1\n\telif dot < -1:\n\t\tdot = -1\n\treturn math.acos(dot)*180/math.pi\n\ndef compute_AllAngles (trip):\n\tdV = np.diff(trip, axis = 0) #x1-x0 and y1-y0\n"},{"varID":"4f7ba1deacee2005f477a8aa2326059b90905084","commitID":-1,"branchID":0,"text":[{"text":"\tangles = np.empty(shape = dV.shape[0])"}]},{"text":"\n\tfor i in range(1, trip.shape[0] - 1):\n\t\tang = computeAngle(dV[i-1], dV[i])\n\t\tnp.append(angles, [ang, dV[i][2]]) #append angle with timepoint\n\treturn angles\n\ndef findStops(speeds):\n\tstops = [] #stops are a start and end time pair\n\tstart = -1\n\tend = -1\n\tfor i in range(1, len(speeds)):\n\t\tadvS = (speeds[i] + speeds[i-1])/2 #smooth out noise in stop duration\n\t\tif speeds[i] == 0: #start of stop\n\t\t\tend = i\n\t\t\tif start == -1:\n\t\t\t\tstart = i\n\t\telif (start > -1) and (advS > 1):\n\t\t\tstops.append([start,end])\n\t\t\tstart = -1\n\t\t\tend = -1\n\tif start > -1:\n\t\tstops.append([start, len(speeds)])\n\treturn stops\n\n\n\ndef printHist_Feature(hist):\n\th = \"\"\n\tfor i in range(len(hist)-1):\n\t\th += str(hist[i])+\",\"\n\t#to avoid final comma (will mess up input)\n\th += str(hist[len(hist)-1])\n\treturn h\n\n\ndef computeNorm(p1, p2):\n\treturn p1/(p1 + p2)\n\n\nprint \"54.0421\"\n"}]}
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/lib/diff/sentence.js:
--------------------------------------------------------------------------------
1 | /*istanbul ignore start*/'use strict';
2 |
3 | exports.__esModule = true;
4 | exports.sentenceDiff = undefined;
5 | exports. /*istanbul ignore end*/diffSentences = diffSentences;
6 |
7 | var /*istanbul ignore start*/_base = require('./base') /*istanbul ignore end*/;
8 |
9 | /*istanbul ignore start*/
10 | var _base2 = _interopRequireDefault(_base);
11 |
12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13 |
14 | /*istanbul ignore end*/var sentenceDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/sentenceDiff = new /*istanbul ignore start*/_base2.default() /*istanbul ignore end*/;
15 | sentenceDiff.tokenize = function (value) {
16 | return value.split(/(\S.+?[.!?])(?=\s+|$)/);
17 | };
18 |
19 | function diffSentences(oldStr, newStr, callback) {
20 | return sentenceDiff.diff(oldStr, newStr, callback);
21 | }
22 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3NlbnRlbmNlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Z0NBUWdCOztBQVJoQjs7Ozs7Ozt1QkFHTyxJQUFNLHVGQUFlLHFFQUFmO0FBQ2IsYUFBYSxRQUFiLEdBQXdCLFVBQVMsS0FBVCxFQUFnQjtBQUN0QyxTQUFPLE1BQU0sS0FBTixDQUFZLHVCQUFaLENBQVAsQ0FEc0M7Q0FBaEI7O0FBSWpCLFNBQVMsYUFBVCxDQUF1QixNQUF2QixFQUErQixNQUEvQixFQUF1QyxRQUF2QyxFQUFpRDtBQUFFLFNBQU8sYUFBYSxJQUFiLENBQWtCLE1BQWxCLEVBQTBCLE1BQTFCLEVBQWtDLFFBQWxDLENBQVAsQ0FBRjtDQUFqRCIsImZpbGUiOiJzZW50ZW5jZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cblxuZXhwb3J0IGNvbnN0IHNlbnRlbmNlRGlmZiA9IG5ldyBEaWZmKCk7XG5zZW50ZW5jZURpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUuc3BsaXQoLyhcXFMuKz9bLiE/XSkoPz1cXHMrfCQpLyk7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZlNlbnRlbmNlcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHsgcmV0dXJuIHNlbnRlbmNlRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbiJdfQ==
23 |
--------------------------------------------------------------------------------
/scripts/jquery.watch.js:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | jQuery Watch Plugin
4 |
5 | @author Darcy Clarke
6 | @version 2.0
7 |
8 | Copyright (c) 2012 Darcy Clarke
9 | Dual licensed under the MIT and GPL licenses.
10 |
11 | ADDS:
12 |
13 | - $.watch()
14 |
15 | USES:
16 |
17 | - DOMAttrModified event
18 |
19 | FALLBACKS:
20 |
21 | - propertychange event
22 | - setTimeout() with delay
23 |
24 | EXAMPLE:
25 |
26 | $('div').watch('width height', function(){
27 | console.log(this.style.width, this.style.height);
28 | });
29 |
30 | $('div').animate({width:'100px',height:'200px'}, 500);
31 |
32 | */
33 | (function(d){"function"===typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],d):d(jQuery)})(function(d){d.extend(d.fn,{watch:function(b,c,a){var f=document.createElement("div"),j=function(a,b){var a="on"+a,c=a in b;c||(b.setAttribute(a,"return;"),c=typeof b[a]=="function");"onpropertychange"==a&&d.browser.msie&&d.browser.version>=9&&(c=!1);return c};typeof c=="function"&&(a=c,c={});typeof a!="function"&&(a=function(){});c=d.extend({},{throttle:10},c);return this.each(function(){var g=
34 | d(this),i=function(){for(var a=g.data(),b=!1,c,f=0;f array.length) {
16 | return false;
17 | }
18 |
19 | for (var i = 0; i < start.length; i++) {
20 | if (start[i] !== array[i]) {
21 | return false;
22 | }
23 | }
24 |
25 | return true;
26 | }
27 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2FycmF5LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztnQ0FBZ0I7eURBUUE7QUFSVCxTQUFTLFVBQVQsQ0FBb0IsQ0FBcEIsRUFBdUIsQ0FBdkIsRUFBMEI7QUFDL0IsTUFBSSxFQUFFLE1BQUYsS0FBYSxFQUFFLE1BQUYsRUFBVTtBQUN6QixXQUFPLEtBQVAsQ0FEeUI7R0FBM0I7O0FBSUEsU0FBTyxnQkFBZ0IsQ0FBaEIsRUFBbUIsQ0FBbkIsQ0FBUCxDQUwrQjtDQUExQjs7QUFRQSxTQUFTLGVBQVQsQ0FBeUIsS0FBekIsRUFBZ0MsS0FBaEMsRUFBdUM7QUFDNUMsTUFBSSxNQUFNLE1BQU4sR0FBZSxNQUFNLE1BQU4sRUFBYztBQUMvQixXQUFPLEtBQVAsQ0FEK0I7R0FBakM7O0FBSUEsT0FBSyxJQUFJLElBQUksQ0FBSixFQUFPLElBQUksTUFBTSxNQUFOLEVBQWMsR0FBbEMsRUFBdUM7QUFDckMsUUFBSSxNQUFNLENBQU4sTUFBYSxNQUFNLENBQU4sQ0FBYixFQUF1QjtBQUN6QixhQUFPLEtBQVAsQ0FEeUI7S0FBM0I7R0FERjs7QUFNQSxTQUFPLElBQVAsQ0FYNEM7Q0FBdkMiLCJmaWxlIjoiYXJyYXkuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gYXJyYXlFcXVhbChhLCBiKSB7XG4gIGlmIChhLmxlbmd0aCAhPT0gYi5sZW5ndGgpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICByZXR1cm4gYXJyYXlTdGFydHNXaXRoKGEsIGIpO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gYXJyYXlTdGFydHNXaXRoKGFycmF5LCBzdGFydCkge1xuICBpZiAoc3RhcnQubGVuZ3RoID4gYXJyYXkubGVuZ3RoKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBzdGFydC5sZW5ndGg7IGkrKykge1xuICAgIGlmIChzdGFydFtpXSAhPT0gYXJyYXlbaV0pIHtcbiAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gdHJ1ZTtcbn1cbiJdfQ==
28 |
--------------------------------------------------------------------------------
/scripts/museconfig.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2011-2016 Adobe Systems Incorporated. All Rights Reserved.
3 | */
4 | (function(){if(!window.museConfigLoadedAndExecuted){window.museConfigLoadedAndExecuted=!0;var d={waitSeconds:0,paths:{"html5shiv":"scripts/html5shiv.js?crc=4241844378","jquery":"scripts/jquery-1.8.3.min.js?crc=209076791","jquery.musemenu":"scripts/jquery.musemenu.js?crc=3988640741","jquery.museoverlay":"scripts/jquery.museoverlay.js?crc=4067622596","jquery.musepolyfill.bgsize":"scripts/jquery.musepolyfill.bgsize.js?crc=4045269973","jquery.museresponsive":"scripts/jquery.museresponsive.js?crc=501053771","jquery.scrolleffects":"scripts/jquery.scrolleffects.js?crc=3926425104","jquery.watch":"scripts/jquery.watch.js?crc=399457859","musedisclosure":"scripts/musedisclosure.js?crc=472981680","museutils":"scripts/museutils.js?crc=351331393","musewpdisclosure":"scripts/musewpdisclosure.js?crc=504240800","musewpslideshow":"scripts/musewpslideshow.js?crc=4158040266","pie":"scripts/pie.js?crc=3831537696","taketori":"scripts/taketori.js?crc=214255737","touchswipe":"scripts/touchswipe.js?crc=4065839998","webpro":"scripts/webpro.js?crc=526784586","whatinput":"scripts/whatinput.js?crc=86476730"},map:{"*":{jquery:"jquery-private"},"jquery-private":{jquery:"jquery"}}};require.undef("jquery");define("jquery-private",["jquery"],function(b){b=b.noConflict(!0);if("undefined"===typeof $)window.$=window.jQuery=b;return b});if(true&&document.location.protocol!="https:")d.paths.jquery=["http://musecdn2.businesscatalyst.com/scripts/4.0/jquery-1.8.3.min",d.paths.jquery];requirejs.config(d);muse_init()}})();
5 | ;(function(){if(!("undefined"==typeof Muse||"undefined"==typeof Muse.assets)){var a=function(a,b){for(var c=0,d=a.length;c 1:\n\t\tdot = 1\n\telif dot < -1:\n\t\tdot = -1\n\treturn math.acos(dot)*180/math.pi\n\ndef compute_AllAngles (trip):\n\tdV = np.diff(trip, axis = 0) #x1-x0 and y1-y0\n"},{"date":"01/15/2017 8:27pm","text":[{"text":"\tangles = np.empty(shape = dV.shape[0])"}],"varID":"4f7ba1deacee2005f477a8aa2326059b90905084","branchID":0,"commitID":0,"output":["280c26d6fede8cae03fa0593054df5b858b457ab"]},{"text":"\n\tfor i in range(1, trip.shape[0] - 1):\n\t\tang = computeAngle(dV[i-1], dV[i])\n\t\tnp.append(angles, [ang, dV[i][2]]) #append angle with timepoint\n\treturn angles\n\ndef findStops(speeds):\n\tstops = [] #stops are a start and end time pair\n\tstart = -1\n\tend = -1\n\tfor i in range(1, len(speeds)):\n\t\tadvS = (speeds[i] + speeds[i-1])/2 #smooth out noise in stop duration\n\t\tif speeds[i] == 0: #start of stop\n\t\t\tend = i\n\t\t\tif start == -1:\n\t\t\t\tstart = i\n\t\telif (start > -1) and (advS > 1):\n\t\t\tstops.append([start,end])\n\t\t\tstart = -1\n\t\t\tend = -1\n\tif start > -1:\n\t\tstops.append([start, len(speeds)])\n\treturn stops\n\n\n\ndef printHist_Feature(hist):\n\th = \"\"\n\tfor i in range(len(hist)-1):\n\t\th += str(hist[i])+\",\"\n\t#to avoid final comma (will mess up input)\n\th += str(hist[len(hist)-1])\n\treturn h\n\n\ndef computeNorm(p1, p2):\n\treturn p1/(p1 + p2)\n\n\nprint \"54.0421\"\n"}],"varID":0,"branchID":0,"commitID":0,"output":["280c26d6fede8cae03fa0593054df5b858b457ab"]}
--------------------------------------------------------------------------------
/atomic-taro/styles/branch-map.less:
--------------------------------------------------------------------------------
1 | // The ui-variables file is provided by base themes provided by Atom.
2 | //
3 | // See https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less
4 | // for a full listing of what's available.
5 | @import "ui-variables";
6 | @import "syntax-variables";
7 |
8 |
9 | .atomic-taro_branch-map{
10 | //float: left;
11 | display: inline-block;
12 | margin: 0px;
13 | padding-bottom: 0px;
14 | //padding-top: 3px;
15 | background-color: @base-background-color;//white;
16 | border: 1px solid @tool-panel-border-color;
17 | //border-top: 1px solid @text-color;//@tool-panel-border-color;
18 | //border-bottom: 1px solid @text-color;//@tool-panel-border-color;
19 | font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier;
20 | z-index: 5;
21 | color: @text-color;
22 | max-height: 100px;
23 | position: relative;
24 | //overflow: scroll;
25 | }
26 |
27 | .atomic-taro_branch-map-square{
28 | width: 10px;
29 | height: 10px;
30 | background-color: @base-background-color; //white;
31 | border: 2px solid @text-color;
32 | position: absolute;
33 | display: inline-block;
34 | }
35 | .atomic-taro_branch-map-square.active{
36 | background-color: @syntax-selection-color;
37 | border: 2px solid @tool-panel-border-color;
38 | }
39 | .atomic-taro_branch-map-square.current{
40 | background-color: @hue-1;
41 | border: 2px solid @hue-1;
42 | }
43 |
44 | .atomic-taro_branch-map-line{
45 | height: 1px;
46 | background-color: @tool-panel-border-color;
47 | position: absolute;
48 | display: inline-block;
49 | //z-index: 7px;
50 | }
51 |
52 |
53 |
54 | .atomic-taro_commit-branch-button{
55 | margin-right: 5px;
56 | color: @mono-3;
57 | float: right;
58 | min-height: 10px;
59 | min-width: 15px;
60 | padding-top: 2px;
61 | cursor: pointer;
62 | text-align: center;
63 | border: 1px solid transparent;
64 | }
65 | .atomic-taro_commit-branch-button:hover{
66 | color: @hue-1;
67 | border: 1px solid @mono-3;
68 | }
69 | .atomic-taro_commit-branch-button.clicked{
70 | color: @hue-1;
71 | }
72 |
--------------------------------------------------------------------------------
/atomic-taro/lib/commit-travel-agent.coffee:
--------------------------------------------------------------------------------
1 | {Point, Range, TextBuffer} = require 'atom'
2 |
3 |
4 | module.exports =
5 | class CommitTravelAgent
6 |
7 | constructor: (@atomicTaroView) ->
8 | @mainMenuHeader = null
9 | @outputPane = null
10 |
11 |
12 | '''
13 | added later after the master variant initializes
14 | '''
15 | setMasterVariant: (master) ->
16 | @masterVariant = master
17 | @mainMenuHeader = @masterVariant.getHeaderElement()
18 |
19 |
20 | '''
21 | added later after the output pane initializes
22 | '''
23 | setOutputPane: (out) ->
24 | @outputPane = out
25 |
26 |
27 | travelToGlobalCommit: (commit) ->
28 | # check if we are in the current state or in the past
29 | # make sure the editor is not editable
30 | # travel text of master variant and set all nested variants back
31 |
32 | # update all commit lines to show which commit we're on
33 | # update all branch maps to show which branch each variant is on
34 | # show a lock icon that makes it clear that you cannot editor
35 | # have the option to show this past whatever into an editable branch
36 | # compare/diff
37 |
38 | # update the main menu to show the new commit
39 | @mainMenuHeader.showAlertPane(commit)
40 |
41 | @masterVariant.getModel().travelToCommit(commit)
42 | # style all variants so it's clear we're in the past
43 | @masterVariant.travelStyle(commit)
44 | @setEnvToCommit(@masterVariant, commit)
45 |
46 |
47 |
48 | globalBackToFuture: (variant) ->
49 | @masterVariant.getModel().travelToCommit({})
50 | @masterVariant.removeTravelStyle()
51 | @resetEnvToPresent()
52 |
53 |
54 | '''
55 | Any variant can call this method. This is at the global program level so that
56 | we can coordinate multiple components, such as the output pane and diffs.
57 | '''
58 | resetEnvToPresent: ->
59 | @outputPane.resetToPresent()
60 | #@mainMenuHeader.hideAlertPane()
61 |
62 |
63 | setEnvToCommit: (variant, commitData) ->
64 | @outputPane.setToCommit(variant, commitData)
65 | #@mainMenuHeader.showAlertPane(commitData.commitID)
66 | # DO SOMETHING
67 |
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/lib/convert/dmp.js:
--------------------------------------------------------------------------------
1 | /*istanbul ignore start*/"use strict";
2 |
3 | exports.__esModule = true;
4 | exports. /*istanbul ignore end*/convertChangesToDMP = convertChangesToDMP;
5 | // See: http://code.google.com/p/google-diff-match-patch/wiki/API
6 | function convertChangesToDMP(changes) {
7 | var ret = [],
8 | change = /*istanbul ignore start*/void 0 /*istanbul ignore end*/,
9 | operation = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
10 | for (var i = 0; i < changes.length; i++) {
11 | change = changes[i];
12 | if (change.added) {
13 | operation = 1;
14 | } else if (change.removed) {
15 | operation = -1;
16 | } else {
17 | operation = 0;
18 | }
19 |
20 | ret.push([operation, change.value]);
21 | }
22 | return ret;
23 | }
24 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L2RtcC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQ2dCOztBQUFULFNBQVMsbUJBQVQsQ0FBNkIsT0FBN0IsRUFBc0M7QUFDM0MsTUFBSSxNQUFNLEVBQU47TUFDQSxnRUFESjtNQUVJLG1FQUZKLENBRDJDO0FBSTNDLE9BQUssSUFBSSxJQUFJLENBQUosRUFBTyxJQUFJLFFBQVEsTUFBUixFQUFnQixHQUFwQyxFQUF5QztBQUN2QyxhQUFTLFFBQVEsQ0FBUixDQUFULENBRHVDO0FBRXZDLFFBQUksT0FBTyxLQUFQLEVBQWM7QUFDaEIsa0JBQVksQ0FBWixDQURnQjtLQUFsQixNQUVPLElBQUksT0FBTyxPQUFQLEVBQWdCO0FBQ3pCLGtCQUFZLENBQUMsQ0FBRCxDQURhO0tBQXBCLE1BRUE7QUFDTCxrQkFBWSxDQUFaLENBREs7S0FGQTs7QUFNUCxRQUFJLElBQUosQ0FBUyxDQUFDLFNBQUQsRUFBWSxPQUFPLEtBQVAsQ0FBckIsRUFWdUM7R0FBekM7QUFZQSxTQUFPLEdBQVAsQ0FoQjJDO0NBQXRDIiwiZmlsZSI6ImRtcC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIFNlZTogaHR0cDovL2NvZGUuZ29vZ2xlLmNvbS9wL2dvb2dsZS1kaWZmLW1hdGNoLXBhdGNoL3dpa2kvQVBJXG5leHBvcnQgZnVuY3Rpb24gY29udmVydENoYW5nZXNUb0RNUChjaGFuZ2VzKSB7XG4gIGxldCByZXQgPSBbXSxcbiAgICAgIGNoYW5nZSxcbiAgICAgIG9wZXJhdGlvbjtcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGFuZ2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgY2hhbmdlID0gY2hhbmdlc1tpXTtcbiAgICBpZiAoY2hhbmdlLmFkZGVkKSB7XG4gICAgICBvcGVyYXRpb24gPSAxO1xuICAgIH0gZWxzZSBpZiAoY2hhbmdlLnJlbW92ZWQpIHtcbiAgICAgIG9wZXJhdGlvbiA9IC0xO1xuICAgIH0gZWxzZSB7XG4gICAgICBvcGVyYXRpb24gPSAwO1xuICAgIH1cblxuICAgIHJldC5wdXNoKFtvcGVyYXRpb24sIGNoYW5nZS52YWx1ZV0pO1xuICB9XG4gIHJldHVybiByZXQ7XG59XG4iXX0=
25 |
--------------------------------------------------------------------------------
/atomic-taro/styles/variant-explorer.less:
--------------------------------------------------------------------------------
1 | // The ui-variables file is provided by base themes provided by Atom.
2 | //
3 | // See https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less
4 | // for a full listing of what's available.
5 | @import "ui-variables";
6 | @import "syntax-variables";
7 |
8 |
9 | .atomic-taro_tools-pane {
10 | border: 1px solid @tool-panel-border-color;
11 | margin-top: 37px;
12 | margin-right: 5px;
13 | padding-left: 1px;
14 | display: flex;
15 | flex-direction: column;
16 | height: 100%;
17 | //max-width: 40em;
18 | }
19 |
20 | .atomic-taro_tools-resize-handle {
21 | position: absolute;
22 | top: 0;
23 | bottom: 0;
24 | width: 10px;
25 | cursor: col-resize;
26 | z-index: 3;
27 | margin-left: -10px;
28 | //background-color: pink;
29 | }
30 |
31 | .atomic-taro_explore-pane{
32 | //min-width: 20em;//200px;
33 | //overflow-x: hidden;
34 | //word-wrap:break-word;
35 | font-size: @font-size;
36 | flex: 1 1 auto;
37 | display: flex;
38 | flex-direction: column;
39 | //padding-bottom: 10px;
40 | //margin-bottom: 15px;
41 | //border-bottom: 1px solid @text-color-subtle;
42 | }
43 |
44 | .atomic-taro_explore-title-container{
45 | border-bottom: 1px solid @hue-1;
46 | min-height: 20px;
47 | padding-left: 5px;
48 | margin-bottom: 1px;
49 | padding-top: 8px;
50 | }
51 | .atomic-taro_explore-title-container.active{
52 | border: 2px solid @button-background-color-hover;
53 | border-bottom: 1px solid @hue-1;
54 | }
55 | .atomic-taro_explore-title-container.past{
56 | border-bottom: 1px solid @text-color-warning;
57 | }
58 |
59 | .icon-x.atomic-taro_explore{
60 | float: right;
61 | margin-bottom: 5px;
62 | }
63 |
64 | .atomic-taro_explore-lineno{
65 | font-style: italic;
66 | color: @text-color-subtle;
67 | }
68 |
69 |
70 | .atomic-taro_explore_version-label{
71 | z-index: 15;
72 | }
73 | .atomic-taro_explore_version-label.focused{
74 | color: @hue-1;
75 | }
76 |
77 | .atomic-taro_explore_version.selected{
78 |
79 | }
80 |
81 | .atomic-taro_search-icon{
82 | color: @text-color-subtle;
83 | }
84 |
85 | .atomic-taro_search-bar{
86 | width: 100%;
87 | font-style: italic;
88 | }
89 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/VisualizeDriver.py:
--------------------------------------------------------------------------------
1 | import matplotlib.pyplot as pyplot
2 | from math import hypot
3 | import numpy as np
4 | import os
5 | import rdp_trip
6 | import sys
7 |
8 | def distance(x0, y0, x1, y1):
9 | """Computes 2D euclidean distance"""
10 | return hypot((x1 - x0), (y1 - y0))
11 |
12 | def findStops(speeds):
13 | stops = [] #stops are a start and end time pair
14 | start = -1
15 | end = -1
16 | for i in range(1, len(speeds)):
17 | advS = (speeds[i] + speeds[i-1])/2 #smooth out noise in stop duration
18 | if speeds[i] == 0: #start of stop
19 | end = i
20 | if start == -1:
21 | start = i
22 | elif start > -1 and advS > 1:
23 | stops.append([start,end])
24 | start = -1
25 | end = -1
26 | if start > -1:
27 | stops.append([start, len(speeds)])
28 | return stops
29 |
30 | def velocities_and_distance_covered(trip):
31 | """
32 | Returns velocities just using difference in distance between coordinates as well as accumulated distances
33 |
34 | Input: x-coordinates and y-coordinates as lists
35 | Output: list of velocities
36 | """
37 | v = []
38 | distancesum = 0.0
39 | for i in range(1, len(trip)):
40 | dist = distance(trip[i-1][0], trip[i-1][1], trip[i][0], trip[i][1])
41 | v.append(dist)
42 | distancesum += dist
43 | return v, distancesum
44 |
45 | def plotTrip(filename):
46 | tripName = int(os.path.basename(filename).split(".")[0])
47 | tripPath = np.genfromtxt(filename, delimiter=',', skip_header=1, dtype=(float,float))
48 |
49 | reducedTrip = rdp_trip.rdp(tripPath, epsilon=0.75)
50 | v, distancesum = velocities_and_distance_covered(tripPath)
51 | stops = findStops(v)
52 |
53 | """pyplot.figure(1)
54 | pyplot.subplot(211)"""
55 | startPoint = (tripPath[0][0], tripPath[1][1])
56 | pyplot.plot(tripPath[:,0], tripPath[:,1], 'bx', startPoint[0], startPoint[1], 'bs')
57 | for (x, y) in reducedTrip:
58 | pyplot.plot(x, y, 'ro')
59 | print str((x,y))
60 | for (st,en) in stops:
61 | pyplot.plot(tripPath[st][0], tripPath[st][1], "go")
62 |
63 | pyplot.ylabel('y')
64 | pyplot.xlabel('x')
65 | pyplot.show()
66 | """pyplot.subplot(212)
67 | pyplot.plot(v, label='velocity')
68 | pyplot.show()"""
69 |
70 |
71 | doc = sys.argv[1]
72 | plotTrip(doc)
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/plotTurningSpeed.py:
--------------------------------------------------------------------------------
1 | from mpl_toolkits.mplot3d import axes3d
2 | import matplotlib.pyplot as plt
3 | import numpy as np
4 | from pylab import *
5 | import sys
6 | import math
7 |
8 | def computeNorm(x, y):
9 | return math.sqrt (x**2 + y**2)
10 |
11 | def computeAngle (p1, p2):
12 | dot = 0
13 | if computeNorm(p2[0], p2[1]) == 0 or computeNorm(p1[0], p1[1])==0: #may be incorrect
14 | dot = 0
15 | else:
16 | dot = (p2[0]*p1[0]+p2[1]*p1[1])/float(computeNorm(p1[0], p1[1])*computeNorm(p2[0], p2[1]))
17 |
18 | if dot > 1:
19 | dot = 1
20 | elif dot < -1:
21 | dot = -1
22 |
23 | return math.acos(dot)*180/math.pi
24 |
25 |
26 | doc = sys.argv[1]
27 | f = open (sys.argv[1], "r")
28 |
29 | data = f.read().split()
30 |
31 | #print data
32 |
33 | x = []
34 | y = []
35 | z = []
36 | v = []
37 | dV = []
38 | t = [] #angles
39 | sharpTurns = []
40 | angleOrigin = []
41 |
42 | for ind in range (1, len(data)):
43 | location = data[ind].split(",")
44 | x.append(float(location[0]))
45 | y.append(float(location[1]))
46 | z.append(ind-1)
47 |
48 |
49 |
50 | v.append(0)
51 |
52 | maxSp = 0
53 | for ind in range (1, len(z)):
54 | sp = 3.6*computeNorm((x[ind]-x[ind-1]), (y[ind]-y[ind-1]))
55 | v.append(sp)
56 | dV.append(((x[ind]-x[ind-1]),(y[ind]-y[ind-1])))
57 | #angleOrigin.append(computeAngle((1,0), (x[ind], y[ind])))
58 |
59 | #print dV
60 |
61 | t.append(0)
62 |
63 | sharpTurns.append([])
64 | sharpTurns.append([])
65 | sharpTurns.append([])
66 |
67 | for ind in range (1, len(dV)):
68 |
69 | angle = computeAngle(dV[ind-1], dV[ind])
70 | t.append(angle)
71 |
72 | if angle > 60:
73 | sharpTurns[0].append(ind)
74 | sharpTurns[1].append(v[ind])
75 | sharpTurns[2].append(angle)
76 |
77 |
78 |
79 |
80 | plt.subplot (2, 1, 1)
81 | plt.plot(z[1:], t, "b-", sharpTurns[0], sharpTurns[2], "r.") #z[1:], angleOrigin, "k-")
82 | plt.xlabel("Time")
83 | plt.ylabel("Turning Angle")
84 | plt.subplot (2, 1, 2)
85 | plt.plot(t, v[:-1], "bx", sharpTurns[2], sharpTurns[1], "rx")
86 | plt.xlabel("Time")
87 | plt.ylabel("Speed")
88 | plt.xlabel("Turning Angle")
89 |
90 | """
91 | plt.subplot (2, 1, 1)
92 | plt.plot(z, v, "b-", z, a, "r-", [0, len(z)], [0,0], "k-")
93 | plt.xlabel("Time")
94 | plt.ylabel("Speed/Acceleration")
95 |
96 | plt.subplot (2, 1, 2)
97 | plt.plot(v, a, "b-", [0, maxSp], [0,0], "k-")
98 | plt.xlabel("Speed")
99 | plt.ylabel("Acceleration")
100 | """
101 | plt.show()
102 |
103 | f.close()
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/atomic-taro/lib/right-panel/atomic-taro-tool-pane.coffee:
--------------------------------------------------------------------------------
1 | {View, Point, Range, TextBuffer} = require 'atom'
2 | Variant = require '../segment-objects/variant-model'
3 | VariantView = require '../segment-objects/variant-view'
4 | OutputPane = require './output-pane'
5 |
6 |
7 | module.exports =
8 | class AtomicTaroToolPane
9 |
10 | constructor: (@masterVariant, @programProcessor, @travelAgent, @root) ->
11 | @pane = document.createElement('div')
12 | @pane.classList.add('atomic-taro_tools-pane')
13 | $(@pane).width('20em')
14 | $(@pane).css('max-width', '20em')
15 |
16 | @outputExplorer = new OutputPane(@masterVariant, @programProcessor, @travelAgent, @root)
17 |
18 | @resizeRegion = document.createElement('div')
19 | @resizeRegion.classList.add('atomic-taro_tools-resize-handle')
20 |
21 | @initialize()
22 | @addListeners()
23 |
24 | initialize: ->
25 | #@pane.appendChild(@variantExplorer.getElement())
26 | @pane.appendChild(@addSearchBar())
27 | @pane.appendChild(@outputExplorer.getElement())
28 | @pane.appendChild(@resizeRegion)
29 |
30 |
31 | # Gets the root element
32 | getElement: ->
33 | @pane
34 |
35 | getWidth: ->
36 | $(@pane).width()
37 |
38 | addListeners: ->
39 | $(document).on 'mousedown', '.atomic-taro_tools-resize-handle', (e) => @resizeStarted(e)
40 |
41 |
42 | registerOutput: (data, commit) ->
43 | @outputExplorer.registerOutput(data, commit)
44 |
45 |
46 | resizeStarted: =>
47 | $(document).on('mousemove', @resizeToolView)
48 | $(document).on('mouseup', @resizeStopped)
49 |
50 | resizeStopped: =>
51 | $(document).off('mousemove', @resizeToolView)
52 | $(document).off('mouseup', @resizeStopped)
53 |
54 |
55 | resizeToolView: ({pageX, which}) =>
56 | return @resizeStopped() unless which is 1
57 |
58 | width = $(@pane).outerWidth() + $(@pane).offset().left - pageX
59 | $(@pane).width(width)
60 | $(@pane).css('max-width', width)
61 |
62 | addSearchBar: ->
63 | searchContainer = document.createElement('div')
64 | searchContainer.classList.add('atomic-taro_search-bar-container')
65 | searchContainer.classList.add('native-key-bindings')
66 | # searchIcon = document.createElement('span')
67 | # searchIcon.classList.add('icon-search-save')
68 | # searchIcon.classList.add('atomic-taro_search-icon')
69 | searchBar = document.createElement('input')
70 | searchBar.type = "search"
71 | searchBar.placeholder = "search"
72 | searchBar.classList.add('input-search')
73 | searchBar.classList.add('atomic-taro_search-bar')
74 |
75 | #searchContainer.appendChild(searchIcon)
76 | searchContainer.appendChild(searchBar)
77 | searchContainer
78 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/plotTurningSpeed3s.py:
--------------------------------------------------------------------------------
1 | #from mpl_toolkits.mplot3d import axes3d
2 | import matplotlib.pyplot as plt
3 | import numpy as np
4 | #from pylab import *
5 | import sys
6 | import math
7 | import rdp_trip as rdp
8 |
9 | def computeNorm(x, y):
10 | return math.sqrt (x**2 + y**2)
11 |
12 | def computeAngle (p1, p2):
13 | dot = 0
14 | if computeNorm(p2[0], p2[1]) == 0 or computeNorm(p1[0], p1[1])==0: #may be incorrect
15 | dot = 0
16 | else:
17 | dot = (p2[0]*p1[0]+p2[1]*p1[1])/float(computeNorm(p1[0], p1[1])*computeNorm(p2[0], p2[1]))
18 |
19 | if dot > 1:
20 | dot = 1
21 | elif dot < -1:
22 | dot = -1
23 |
24 | return math.acos(dot)*180/math.pi
25 |
26 |
27 | doc = sys.argv[1]
28 | f = open (sys.argv[1], "r")
29 |
30 | data = f.read().split()
31 |
32 | #print data
33 |
34 | x = []
35 | y = []
36 | z = []
37 | v = []
38 | dV = []
39 | t = [] #angles
40 | sharpTurns = []
41 | angleOrigin = []
42 |
43 | for ind in range (1, len(data)):
44 | location = data[ind].split(",")
45 | x.append(float(location[0]))
46 | y.append(float(location[1]))
47 | z.append(ind-1)
48 |
49 |
50 |
51 | v.append(0)
52 |
53 | maxSp = 0
54 | for ind in range (1, len(z)):
55 | sp = 3.6*computeNorm((x[ind]-x[ind-1]), (y[ind]-y[ind-1]))
56 | v.append(sp)
57 | dV.append(((x[ind]-x[ind-1]),(y[ind]-y[ind-1])))
58 | #angleOrigin.append(computeAngle((1,0), (x[ind], y[ind])))
59 |
60 | #print dV
61 |
62 | t.append([])
63 | t.append([])
64 | t.append([])
65 |
66 | sharpTurns.append([])
67 | sharpTurns.append([])
68 | sharpTurns.append([])
69 |
70 | for ind in range (2, len(dV)):
71 |
72 | angle = computeAngle(dV[ind-2], dV[ind])
73 | t[0].append(ind)
74 | t[1].append(angle)
75 | t[2].append((v[ind-2]+v[ind-1]+v[ind])/3)
76 |
77 | """
78 | if angle > 60:
79 | sharpTurns[0].append(ind)
80 | sharpTurns[1].append(v[ind])
81 | sharpTurns[2].append(angle)
82 | """
83 |
84 |
85 |
86 | plt.subplot (2, 1, 1)
87 | plt.plot(t[0], t[1], "b-", t[0], t[2], "r-")#, sharpTurns[0], sharpTurns[2], "r.") #z[1:], angleOrigin, "k-")
88 | plt.xlabel("Time")
89 | plt.ylabel("Turning Angle")
90 | plt.subplot (2, 1, 2)
91 | plt.plot(t[1], t[2], "bx")#, sharpTurns[2], sharpTurns[1], "rx")
92 | plt.xlabel("Time")
93 | plt.ylabel("Speed")
94 | plt.xlabel("Turning Angle")
95 |
96 | """
97 | plt.subplot (2, 1, 1)
98 | plt.plot(z, v, "b-", z, a, "r-", [0, len(z)], [0,0], "k-")
99 | plt.xlabel("Time")
100 | plt.ylabel("Speed/Acceleration")
101 |
102 | plt.subplot (2, 1, 2)
103 | plt.plot(v, a, "b-", [0, maxSp], [0,0], "k-")
104 | plt.xlabel("Speed")
105 | plt.ylabel("Acceleration")
106 | """
107 | plt.show()
108 |
109 | f.close()
110 |
111 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/atomic-taro/spec/atomic-taro-spec.coffee:
--------------------------------------------------------------------------------
1 | AtomicTaro = require '../lib/atomic-taro'
2 |
3 | # Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
4 | #
5 | # To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
6 | # or `fdescribe`). Remove the `f` to unfocus the block.
7 |
8 | describe "AtomicTaro", ->
9 | [workspaceElement, activationPromise] = []
10 |
11 | beforeEach ->
12 | workspaceElement = atom.views.getView(atom.workspace)
13 | activationPromise = atom.packages.activatePackage('atomic-taro')
14 |
15 | describe "when the atomic-taro:toggle event is triggered", ->
16 | it "hides and shows the modal panel", ->
17 | # Before the activation event the view is not on the DOM, and no panel
18 | # has been created
19 | expect(workspaceElement.querySelector('.atomic-taro')).not.toExist()
20 |
21 | # This is an activation event, triggering it will cause the package to be
22 | # activated.
23 | atom.commands.dispatch workspaceElement, 'atomic-taro:toggle'
24 |
25 | waitsForPromise ->
26 | activationPromise
27 |
28 | runs ->
29 | expect(workspaceElement.querySelector('.atomic-taro')).toExist()
30 |
31 | atomicTaroElement = workspaceElement.querySelector('.atomic-taro')
32 | expect(atomicTaroElement).toExist()
33 |
34 | atomicTaroPanel = atom.workspace.panelForItem(atomicTaroElement)
35 | expect(atomicTaroPanel.isVisible()).toBe true
36 | atom.commands.dispatch workspaceElement, 'atomic-taro:toggle'
37 | expect(atomicTaroPanel.isVisible()).toBe false
38 |
39 | it "hides and shows the view", ->
40 | # This test shows you an integration test testing at the view level.
41 |
42 | # Attaching the workspaceElement to the DOM is required to allow the
43 | # `toBeVisible()` matchers to work. Anything testing visibility or focus
44 | # requires that the workspaceElement is on the DOM. Tests that attach the
45 | # workspaceElement to the DOM are generally slower than those off DOM.
46 | jasmine.attachToDOM(workspaceElement)
47 |
48 | expect(workspaceElement.querySelector('.atomic-taro')).not.toExist()
49 |
50 | # This is an activation event, triggering it causes the package to be
51 | # activated.
52 | atom.commands.dispatch workspaceElement, 'atomic-taro:toggle'
53 |
54 | waitsForPromise ->
55 | activationPromise
56 |
57 | runs ->
58 | # Now we can test for view visibility
59 | atomicTaroElement = workspaceElement.querySelector('.atomic-taro')
60 | expect(atomicTaroElement).toBeVisible()
61 | atom.commands.dispatch workspaceElement, 'atomic-taro:toggle'
62 | expect(atomicTaroElement).not.toBeVisible()
63 |
--------------------------------------------------------------------------------
/atomic-taro/styles/commit-line.less:
--------------------------------------------------------------------------------
1 | // The ui-variables file is provided by base themes provided by Atom.
2 | //
3 | // See https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less
4 | // for a full listing of what's available.
5 | @import "ui-variables";
6 | @import "syntax-variables";
7 |
8 |
9 | .atomic-taro_commit-element{
10 | display: flex;
11 | flex-direction: row;
12 | width: 100%;
13 | z-index: 5;
14 | }
15 |
16 | .atomic-taro_commit-traveler{
17 | //float: left;
18 | flex: 1 1 auto;
19 | display: inline-block;
20 | padding: 10px;
21 | padding-bottom: 2px;
22 | padding-top: 3px;
23 | background-color: @base-background-color;//white;
24 | border: 1px solid @text-color;//@tool-panel-border-color;
25 | border-right: 1px solid @tool-panel-border-color;
26 | border-left: 1px solid @tool-panel-border-color;
27 | font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier;
28 | z-index: 5;
29 | color: @text-color;
30 |
31 | }
32 | .atomic-taro_commit-traveler.textOnly{
33 | padding-top: 2px;
34 | padding-bottom: 2px;
35 | border: 1px solid @base-background-color;//white;//@tool-panel-border-color;
36 | border-bottom: 1px solid @text-color;//@tool-panel-border-color;
37 | }
38 |
39 | .atomic-taro_commit-nowBracket{
40 | float: right;
41 | border: 1px solid @tool-panel-border-color;
42 | border-left: 0px;
43 | height: 20px;
44 | min-width: 10px;
45 | }
46 | .atomic-taro_commit-nowBracket:hover{
47 | border: 1px solid @text-color;
48 | border-left: 1px solid @tool-panel-border-color;
49 | }
50 |
51 | .atomic-taro_commit-nowMarker{
52 | //float: left;
53 | display: inline-block;
54 | //border: 1px solid @text-color-warning;
55 | padding: 2px;
56 | z-index: 5;
57 | }
58 |
59 | .atomic-taro_commit-ticks{
60 | position: relative;
61 | //z-index: 5;
62 | background-color: @base-background-color;//white;
63 | float: left;
64 | display: inline-block;
65 | width: 4px;
66 | top: -0.7em;
67 | min-height: 15px;
68 | border: 1px solid @text-color;
69 | }
70 | .atomic-taro_commit-ticks:hover{
71 | background-color: @text-color-warning;
72 | }
73 |
74 | .commit-slider label {
75 | position: absolute;
76 | //width: 20px;
77 | margin-left: -5px;
78 | text-align: center;
79 | //margin-top: 20px;
80 | }
81 |
82 | .atomic-taro_commit-history-button{
83 | margin-right: 5px;
84 | color: @mono-3;
85 | float: right;
86 | min-height: 10px;
87 | min-width: 15px;
88 | padding-top: 2px;
89 | cursor: pointer;
90 | text-align: center;
91 | border: 1px solid transparent;
92 | }
93 | .atomic-taro_commit-history-button:hover{
94 | color: @hue-1;
95 | border: 1px solid @mono-3;
96 | }
97 | .atomic-taro_commit-history-button.clicked{
98 | color: @hue-1;
99 | }
100 |
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/lib/convert/xml.js:
--------------------------------------------------------------------------------
1 | /*istanbul ignore start*/'use strict';
2 |
3 | exports.__esModule = true;
4 | exports. /*istanbul ignore end*/convertChangesToXML = convertChangesToXML;
5 | function convertChangesToXML(changes) {
6 | var ret = [];
7 | for (var i = 0; i < changes.length; i++) {
8 | var change = changes[i];
9 | if (change.added) {
10 | ret.push('');
11 | } else if (change.removed) {
12 | ret.push('');
13 | }
14 |
15 | ret.push(escapeHTML(change.value));
16 |
17 | if (change.added) {
18 | ret.push('');
19 | } else if (change.removed) {
20 | ret.push('');
21 | }
22 | }
23 | return ret.join('');
24 | }
25 |
26 | function escapeHTML(s) {
27 | var n = s;
28 | n = n.replace(/&/g, '&');
29 | n = n.replace(//g, '>');
31 | n = n.replace(/"/g, '"');
32 |
33 | return n;
34 | }
35 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L3htbC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCO0FBQVQsU0FBUyxtQkFBVCxDQUE2QixPQUE3QixFQUFzQztBQUMzQyxNQUFJLE1BQU0sRUFBTixDQUR1QztBQUUzQyxPQUFLLElBQUksSUFBSSxDQUFKLEVBQU8sSUFBSSxRQUFRLE1BQVIsRUFBZ0IsR0FBcEMsRUFBeUM7QUFDdkMsUUFBSSxTQUFTLFFBQVEsQ0FBUixDQUFULENBRG1DO0FBRXZDLFFBQUksT0FBTyxLQUFQLEVBQWM7QUFDaEIsVUFBSSxJQUFKLENBQVMsT0FBVCxFQURnQjtLQUFsQixNQUVPLElBQUksT0FBTyxPQUFQLEVBQWdCO0FBQ3pCLFVBQUksSUFBSixDQUFTLE9BQVQsRUFEeUI7S0FBcEI7O0FBSVAsUUFBSSxJQUFKLENBQVMsV0FBVyxPQUFPLEtBQVAsQ0FBcEIsRUFSdUM7O0FBVXZDLFFBQUksT0FBTyxLQUFQLEVBQWM7QUFDaEIsVUFBSSxJQUFKLENBQVMsUUFBVCxFQURnQjtLQUFsQixNQUVPLElBQUksT0FBTyxPQUFQLEVBQWdCO0FBQ3pCLFVBQUksSUFBSixDQUFTLFFBQVQsRUFEeUI7S0FBcEI7R0FaVDtBQWdCQSxTQUFPLElBQUksSUFBSixDQUFTLEVBQVQsQ0FBUCxDQWxCMkM7Q0FBdEM7O0FBcUJQLFNBQVMsVUFBVCxDQUFvQixDQUFwQixFQUF1QjtBQUNyQixNQUFJLElBQUksQ0FBSixDQURpQjtBQUVyQixNQUFJLEVBQUUsT0FBRixDQUFVLElBQVYsRUFBZ0IsT0FBaEIsQ0FBSixDQUZxQjtBQUdyQixNQUFJLEVBQUUsT0FBRixDQUFVLElBQVYsRUFBZ0IsTUFBaEIsQ0FBSixDQUhxQjtBQUlyQixNQUFJLEVBQUUsT0FBRixDQUFVLElBQVYsRUFBZ0IsTUFBaEIsQ0FBSixDQUpxQjtBQUtyQixNQUFJLEVBQUUsT0FBRixDQUFVLElBQVYsRUFBZ0IsUUFBaEIsQ0FBSixDQUxxQjs7QUFPckIsU0FBTyxDQUFQLENBUHFCO0NBQXZCIiwiZmlsZSI6InhtbC5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBmdW5jdGlvbiBjb252ZXJ0Q2hhbmdlc1RvWE1MKGNoYW5nZXMpIHtcbiAgbGV0IHJldCA9IFtdO1xuICBmb3IgKGxldCBpID0gMDsgaSA8IGNoYW5nZXMubGVuZ3RoOyBpKyspIHtcbiAgICBsZXQgY2hhbmdlID0gY2hhbmdlc1tpXTtcbiAgICBpZiAoY2hhbmdlLmFkZGVkKSB7XG4gICAgICByZXQucHVzaCgnPGlucz4nKTtcbiAgICB9IGVsc2UgaWYgKGNoYW5nZS5yZW1vdmVkKSB7XG4gICAgICByZXQucHVzaCgnPGRlbD4nKTtcbiAgICB9XG5cbiAgICByZXQucHVzaChlc2NhcGVIVE1MKGNoYW5nZS52YWx1ZSkpO1xuXG4gICAgaWYgKGNoYW5nZS5hZGRlZCkge1xuICAgICAgcmV0LnB1c2goJzwvaW5zPicpO1xuICAgIH0gZWxzZSBpZiAoY2hhbmdlLnJlbW92ZWQpIHtcbiAgICAgIHJldC5wdXNoKCc8L2RlbD4nKTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIHJldC5qb2luKCcnKTtcbn1cblxuZnVuY3Rpb24gZXNjYXBlSFRNTChzKSB7XG4gIGxldCBuID0gcztcbiAgbiA9IG4ucmVwbGFjZSgvJi9nLCAnJmFtcDsnKTtcbiAgbiA9IG4ucmVwbGFjZSgvPC9nLCAnJmx0OycpO1xuICBuID0gbi5yZXBsYWNlKC8+L2csICcmZ3Q7Jyk7XG4gIG4gPSBuLnJlcGxhY2UoL1wiL2csICcmcXVvdDsnKTtcblxuICByZXR1cm4gbjtcbn1cbiJdfQ==
36 |
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "diff",
3 | "version": "2.2.3",
4 | "description": "A javascript text diff implementation.",
5 | "keywords": [
6 | "diff",
7 | "javascript"
8 | ],
9 | "maintainers": [
10 | {
11 | "name": "kpdecker",
12 | "email": "kpdecker@gmail.com"
13 | }
14 | ],
15 | "bugs": {
16 | "url": "http://github.com/kpdecker/jsdiff/issues",
17 | "email": "kpdecker@gmail.com"
18 | },
19 | "license": "BSD-3-Clause",
20 | "repository": {
21 | "type": "git",
22 | "url": "git://github.com/kpdecker/jsdiff.git"
23 | },
24 | "engines": {
25 | "node": ">=0.3.1"
26 | },
27 | "main": "./lib",
28 | "scripts": {
29 | "test": "grunt"
30 | },
31 | "dependencies": {},
32 | "devDependencies": {
33 | "async": "^1.4.2",
34 | "babel-core": "^6.0.0",
35 | "babel-loader": "^6.0.0",
36 | "babel-preset-es2015-mod": "^6.3.13",
37 | "chai": "^3.3.0",
38 | "colors": "^1.1.2",
39 | "eslint": "^1.6.0",
40 | "grunt": "^0.4.5",
41 | "grunt-babel": "^6.0.0",
42 | "grunt-clean": "^0.4.0",
43 | "grunt-cli": "^0.1.13",
44 | "grunt-contrib-clean": "^1.0.0",
45 | "grunt-contrib-copy": "^1.0.0",
46 | "grunt-contrib-uglify": "^1.0.0",
47 | "grunt-contrib-watch": "^1.0.0",
48 | "grunt-eslint": "^17.3.1",
49 | "grunt-karma": "^0.12.1",
50 | "grunt-mocha-istanbul": "^3.0.1",
51 | "grunt-mocha-test": "^0.12.7",
52 | "grunt-webpack": "^1.0.11",
53 | "istanbul": "github:kpdecker/istanbul",
54 | "karma": "^0.13.11",
55 | "karma-mocha": "^0.2.0",
56 | "karma-mocha-reporter": "^2.0.0",
57 | "karma-phantomjs-launcher": "^1.0.0",
58 | "karma-sauce-launcher": "^0.3.0",
59 | "karma-sourcemap-loader": "^0.3.6",
60 | "karma-webpack": "^1.7.0",
61 | "mocha": "^2.3.3",
62 | "phantomjs-prebuilt": "^2.1.5",
63 | "semver": "^5.0.3",
64 | "webpack": "^1.12.2",
65 | "webpack-dev-server": "^1.12.0"
66 | },
67 | "optionalDependencies": {},
68 | "babel": {
69 | "sourceMaps": "inline",
70 | "presets": [
71 | "es2015-mod"
72 | ],
73 | "auxiliaryCommentBefore": "istanbul ignore start",
74 | "auxiliaryCommentAfter": "istanbul ignore end"
75 | },
76 | "gitHead": "ec007c364e88c37ccc6b3f94a4cfe163d8389b85",
77 | "homepage": "https://github.com/kpdecker/jsdiff#readme",
78 | "_id": "diff@2.2.3",
79 | "_shasum": "60eafd0d28ee906e4e8ff0a52c1229521033bf99",
80 | "_from": "diff@*",
81 | "_npmVersion": "3.8.5",
82 | "_nodeVersion": "5.1.1",
83 | "_npmUser": {
84 | "name": "kpdecker",
85 | "email": "kpdecker@gmail.com"
86 | },
87 | "dist": {
88 | "shasum": "60eafd0d28ee906e4e8ff0a52c1229521033bf99",
89 | "tarball": "https://registry.npmjs.org/diff/-/diff-2.2.3.tgz"
90 | },
91 | "_npmOperationalInternal": {
92 | "host": "packages-12-west.internal.npmjs.com",
93 | "tmp": "tmp/diff-2.2.3.tgz_1464725207327_0.8068557067308575"
94 | },
95 | "directories": {},
96 | "_resolved": "https://registry.npmjs.org/diff/-/diff-2.2.3.tgz"
97 | }
98 |
--------------------------------------------------------------------------------
/atomic-taro/styles/output-explorer.less:
--------------------------------------------------------------------------------
1 | // The ui-variables file is provided by base themes provided by Atom.
2 | //
3 | // See https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less
4 | // for a full listing of what's available.
5 | @import "ui-variables";
6 | @import "syntax-variables";
7 | @import "taro-variables";
8 |
9 | .atomic-taro_output-list-pane
10 | {
11 | overflow-y: scroll;
12 | //overflow-x: hidden;
13 | word-wrap: break-word;
14 | width: 100%;
15 | //flex: 1 1 auto;
16 | flex-wrap: wrap;
17 | }
18 |
19 |
20 | .atomic-taro_explore-play-button
21 | {
22 | margin-left: 10px;
23 | }
24 | .atomic-taro_explore-play-button:hover
25 | {
26 | color: @text-color-success;
27 | }
28 |
29 | .atomic-taro_output-x
30 | {
31 | float: right;
32 | margin-bottom: 5px;
33 | //z-index: 4;
34 | display: block;
35 | position: absolute;
36 | top: 0px;
37 | right: 0px;
38 | }
39 |
40 |
41 | .atomic-taro_terminal-wrapper{
42 | background-color: @button-background-color-hover;
43 | border: 2px solid @background-color-selected;
44 | flex: 1 1 auto;
45 | }
46 |
47 | .atomic-taro_terminal{
48 | width: 100%;
49 | flex: 1 1 auto;
50 | resize: none;
51 | font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier;
52 | }
53 |
54 |
55 |
56 | .atomic-taro_output_box
57 | {
58 | position: relative;
59 | font-family: monospace;
60 | //z-index: 4;
61 | cursor: default;
62 | margin-top: 2px;
63 | margin-bottom: 2px;
64 | background-color: @button-background-color-hover;
65 | border: 1px solid white;
66 | border-bottom: 1px solid @background-color-selected;
67 | }
68 | .atomic-taro_output_box.selected
69 | {
70 | border: 1px solid @hue-2;
71 | }
72 | .atomic-taro_output_box.travel
73 | {
74 | border: 2px solid @text-color-warning;
75 | }
76 | .atomic-taro_output_box.newest
77 | {
78 | background-color: white;
79 | }
80 |
81 | .atomic-taro_output_date
82 | {
83 | color: @text-color-subtle;
84 | font-style: italic;
85 | }
86 |
87 | .atomic-taro_output_command
88 | {
89 | color: @hue-1;
90 | }
91 |
92 | .atomic-taro_output-rmenu{
93 | cursor: default;
94 | z-index: 6px;
95 | position: absolute;
96 | right: 0px;
97 | border: 1px solid @text-color-subtle;
98 | background-color: white;
99 | font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier;
100 | font-size: @fontDemoSize;
101 | color: @text-color;
102 | width: 150px;
103 | }
104 |
105 | .output-rmemu_itemBox{
106 | cursor: default;
107 | padding: 2px;
108 | border: 1px solid @tool-panel-border-color;
109 | }
110 | .output-rmemu_itemBox:hover{
111 | color: @hue-1;
112 | border: 1px solid @hue-1;
113 | background-color: #E9EFF4;
114 | }
115 |
116 | .icon-dash.atomic-taro_explore{
117 | float: right;
118 | margin-bottom: 5px;
119 | }
120 | .icon-file-add.atomic-taro_explore{
121 | float: right;
122 | margin-bottom: 5px;
123 | }
124 |
125 | .atomic-taro_output_travel-wrapper{
126 | z-index: 5px;
127 | //height: 50%;
128 | width: 100%;
129 | position: absolute;
130 | bottom: 0px;
131 | background-color: rgba(255, 255, 255, 0.85);
132 | border: 1px solid @text-color-warning;
133 | }
134 |
135 | .atomic-taro_output_travel-div{
136 | //min-height: 100px;
137 | // position: absolute;
138 | // bottom: 0px;
139 | }
140 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/tripmatching/C_rdp.csv:
--------------------------------------------------------------------------------
1 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00
2 | 1.050000000000000000e+01,-2.299999999999999822e+00,3.000000000000000000e+00
3 | 1.869999999999999929e+01,-7.799999999999999822e+00,6.000000000000000000e+00
4 | 2.630000000000000071e+01,-1.119999999999999929e+01,8.000000000000000000e+00
5 | 6.559999999999999432e+01,-1.900000000000000000e+01,1.400000000000000000e+01
6 | 7.270000000000000284e+01,-2.139999999999999858e+01,1.500000000000000000e+01
7 | 8.629999999999999716e+01,-2.850000000000000000e+01,1.700000000000000000e+01
8 | 9.620000000000000284e+01,-3.820000000000000284e+01,1.900000000000000000e+01
9 | 1.022999999999999972e+02,-5.279999999999999716e+01,2.100000000000000000e+01
10 | 1.055999999999999943e+02,-7.790000000000000568e+01,2.400000000000000000e+01
11 | 1.034000000000000057e+02,-9.290000000000000568e+01,2.600000000000000000e+01
12 | 9.879999999999999716e+01,-1.075000000000000000e+02,2.900000000000000000e+01
13 | 9.790000000000000568e+01,-1.090000000000000000e+02,3.100000000000000000e+01
14 | 9.720000000000000284e+01,-1.080000000000000000e+02,3.800000000000000000e+01
15 | 9.379999999999999716e+01,-1.092000000000000028e+02,7.100000000000000000e+01
16 | 9.500000000000000000e+01,-1.100000000000000000e+02,9.300000000000000000e+01
17 | 9.529999999999999716e+01,-1.157000000000000028e+02,9.800000000000000000e+01
18 | 9.770000000000000284e+01,-1.185000000000000000e+02,9.900000000000000000e+01
19 | 1.102999999999999972e+02,-1.260000000000000000e+02,1.020000000000000000e+02
20 | 1.860999999999999943e+02,-1.606999999999999886e+02,1.130000000000000000e+02
21 | 1.935999999999999943e+02,-1.629000000000000057e+02,1.140000000000000000e+02
22 | 2.335000000000000000e+02,-1.800999999999999943e+02,1.190000000000000000e+02
23 | 2.821999999999999886e+02,-1.979000000000000057e+02,1.260000000000000000e+02
24 | 2.878000000000000114e+02,-2.019000000000000057e+02,1.280000000000000000e+02
25 | 2.876000000000000227e+02,-2.055999999999999943e+02,1.290000000000000000e+02
26 | 2.598999999999999773e+02,-2.615000000000000000e+02,1.360000000000000000e+02
27 | 2.400000000000000000e+02,-2.981000000000000227e+02,1.400000000000000000e+02
28 | 2.269000000000000057e+02,-3.133000000000000114e+02,1.420000000000000000e+02
29 | 2.091999999999999886e+02,-3.228999999999999773e+02,1.440000000000000000e+02
30 | 1.794000000000000057e+02,-3.341999999999999886e+02,1.470000000000000000e+02
31 | 1.403000000000000114e+02,-3.513000000000000114e+02,1.510000000000000000e+02
32 | 1.252999999999999972e+02,-3.563999999999999773e+02,1.530000000000000000e+02
33 | 1.194000000000000057e+02,-3.571999999999999886e+02,1.540000000000000000e+02
34 | 1.137999999999999972e+02,-3.543999999999999773e+02,1.550000000000000000e+02
35 | 1.102000000000000028e+02,-3.508999999999999773e+02,1.560000000000000000e+02
36 | 1.005999999999999943e+02,-3.291999999999999886e+02,1.600000000000000000e+02
37 | 9.659999999999999432e+01,-3.233999999999999773e+02,1.610000000000000000e+02
38 | 8.670000000000000284e+01,-3.148999999999999773e+02,1.630000000000000000e+02
39 | 7.470000000000000284e+01,-3.083999999999999773e+02,1.650000000000000000e+02
40 | 4.489999999999999858e+01,-2.996000000000000227e+02,1.690000000000000000e+02
41 | 1.939999999999999858e+01,-2.951999999999999886e+02,1.720000000000000000e+02
42 | 2.100000000000000089e+00,-2.940000000000000000e+02,1.740000000000000000e+02
43 | -2.019999999999999929e+01,-2.945000000000000000e+02,1.770000000000000000e+02
44 | -2.980000000000000071e+01,-2.955000000000000000e+02,1.790000000000000000e+02
45 | -3.679999999999999716e+01,-2.978000000000000114e+02,1.840000000000000000e+02
46 | -3.450000000000000000e+01,-2.958000000000000114e+02,2.370000000000000000e+02
47 |
--------------------------------------------------------------------------------
/css/index.css:
--------------------------------------------------------------------------------
1 | .version.index{color:#0000F4;background-color:#88F8D3;}#page{z-index:1;min-height:929px;background-image:none;border-width:0px;border-color:#000000;background-color:transparent;padding-bottom:32px;width:100%;max-width:960px;margin-left:auto;margin-right:auto;}#u142{z-index:15;min-height:50px;background-color:#2A2D35;padding-bottom:8px;}#u142_align_to_page{margin-left:auto;margin-right:auto;position:relative;max-width:960px;}#u173{z-index:23;background-color:transparent;position:relative;margin-right:-10000px;margin-top:9px;width:5.32%;left:2.09%;}#u168{z-index:24;display:block;width:100%;}#u190-4{z-index:27;min-height:24px;background-color:transparent;color:#E8E8E4;font-family:Verdana, Tahoma, Geneva, sans-serif;position:relative;margin-right:-10000px;margin-top:20px;width:18.13%;left:7.5%;}#u145-7{z-index:16;min-height:28px;background-color:transparent;color:#E8E8E8;font-family:Verdana, Tahoma, Geneva, sans-serif;position:relative;margin-right:-10000px;margin-top:20px;width:23.34%;left:74.59%;}#u145,#u145-4{text-decoration:none;}.js body{visibility:hidden;}.js body.initialized{visibility:visible;}#u142-bw{z-index:15;min-height:50px;}#pu110-7{z-index:2;margin-top:25px;width:100%;}#u110-7{z-index:2;min-height:97px;background-color:transparent;text-align:center;position:relative;margin-right:-10000px;margin-top:6px;width:64.48%;left:15.63%;}#u110-2{font-size:36px;line-height:43px;color:#403E47;font-family:Verdana, Tahoma, Geneva, sans-serif;font-weight:normal;}#u110-3{font-size:12px;line-height:14px;color:#000000;font-family:Verdana, Tahoma, Geneva, sans-serif;font-style:normal;}#u110-5{font-size:14px;color:#000000;font-family:open-sans-condensed, sans-serif;font-weight:300;}#u181{z-index:25;background-color:transparent;position:relative;margin-right:-10000px;width:7.3%;left:30.84%;}#u182{z-index:26;display:block;width:100%;}#pppu129{z-index:0;margin-top:46px;width:100%;}#ppu129{z-index:0;padding-bottom:0px;margin-right:-10000px;margin-top:22px;width:16.46%;margin-left:2.92%;}#pu129{z-index:9;width:78.49%;margin-left:21.52%;}#u129{z-index:9;background-color:transparent;position:relative;margin-right:-10000px;width:100%;}#u223{z-index:39;background-color:transparent;position:relative;margin-right:-10000px;margin-top:149px;width:45.17%;left:6.46%;}#u218{z-index:40;display:block;width:100%;}#u215-8{z-index:31;min-height:49px;background-color:transparent;line-height:14px;font-size:12px;font-family:open-sans-condensed, sans-serif;font-weight:300;margin-top:1px;position:relative;width:65.83%;}#pu139-4{z-index:11;padding-bottom:0px;margin-right:-10000px;width:58.34%;margin-left:21.98%;}#u139-4{z-index:11;min-height:43px;background-color:transparent;line-height:16px;font-size:12px;font-family:Verdana, Tahoma, Geneva, sans-serif;position:relative;width:99.47%;margin-left:0.36%;}#u269{z-index:50;min-height:319px;border-width:0px;border-color:transparent;background-color:transparent;margin-top:20px;position:relative;width:100%;}#u281-10{z-index:51;min-height:61px;background-color:transparent;line-height:16px;font-size:12px;font-family:Verdana, Tahoma, Geneva, sans-serif;margin-top:16px;position:relative;width:58.03%;margin-left:22.09%;}#u281-2{color:#484848;font-style:italic;}#u281,#u281-3,#u281-7{color:#484848;}.css_verticalspacer .verticalspacer{height:calc(100vh - 969px);}#u251{z-index:41;border-width:0px;border-color:transparent;background-color:transparent;margin-top:112px;position:relative;width:27.82%;margin-left:36.15%;}#u242{z-index:44;background-color:transparent;position:relative;margin-right:-10000px;width:63.3%;}#u232{z-index:42;background-color:transparent;position:relative;margin-right:-10000px;width:29.22%;left:70.79%;}#u129_img,#u242_img,#u232_img{width:100%;}#u255-4{z-index:46;min-height:22px;background-color:transparent;line-height:14px;text-align:center;font-size:12px;font-family:open-sans-condensed, sans-serif;font-weight:300;margin-top:16px;position:relative;width:41.67%;margin-left:29.17%;}#muse_css_mq,.html{background-color:#FFFFFF;}body{position:relative;min-width:320px;padding-bottom:8px;}
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/rdp_trip.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import sys
3 | import matplotlib.pyplot as pyplot
4 |
5 | """
6 | edited 4/25 to fit trip default numpy format
7 | If you import a trip and then add a 3rd column to the trip that is time,
8 | when this runs the time field is kept... a bit hacky but works.
9 | """
10 |
11 | def distance(x0, y0, x1, y1):
12 | return ((x1-x0)**2 + (y1-y0)**2) ** (.5)
13 |
14 | def unit_vector(v):
15 | v_len = (v[0]**2 + v[1]**2)**0.5
16 | return [v[0]/v_len, v[1]/v_len]
17 |
18 | # get angle between 3 points in radians
19 | def angle_3_points(x1, y1, x2, y2, x3, y3):
20 | v1 = [x2-x1, y2-x1]
21 | v2 = [x2-x3, y2-y3]
22 | v1_unit = unit_vector(v1)
23 | v2_unit = unit_vector(v2)
24 | angle = np.arccos(np.dot(v1_unit, v2_unit))
25 | if np.isnan(angle):
26 | if(v1_unit == v2_unit).all():
27 | return 0.0
28 | else:
29 | return np.pi
30 | return angle
31 |
32 | def dist_point_to_line(x0, x1, x2):
33 | """ Calculates the distance from the point ``x0`` to the line given
34 | by the points ``x1`` and ``x2``, all numpy arrays """
35 |
36 | if x1[0] == x2[0]:
37 | return np.abs(x0[0] - x1[0])
38 |
39 | return np.divide(np.linalg.norm(np.linalg.det([x2 - x1, x1 - x0])),
40 | np.linalg.norm(x2 - x1))
41 |
42 |
43 | def rdp_simplify(trip, epsilon):
44 | # find the point with the maximum distance
45 | dmax = 0
46 | index = 0
47 | for i in range(1, trip.shape[0]): #every point but first and last
48 | d = dist_point_to_line( np.array([trip[i][0], trip[i][1]]),
49 | np.array([trip[0][0], trip[0][1]]),
50 | np.array([trip[-1][0], trip[-1][1]]) )
51 | if (d > dmax):
52 | index = i
53 | dmax = d
54 | # If max distance is greater than epsilon, recursively simplify
55 | if (dmax > epsilon):
56 | #build the result list
57 | res1 = rdp_simplify(trip[:index+1], epsilon)
58 | res2 = rdp_simplify(trip[index:], epsilon)
59 | return np.vstack((res1[:-1], res2)) #not sure why [:-1] works, but it keeps duplicates from happening
60 | else:
61 | return np.vstack((trip[0],trip[-1]))
62 |
63 | #takes an rdp simplified trip and interpolates to evenly fill out time points
64 | #so far.... not helpful
65 | def rdp_format_expand(trip, triplen):
66 | xs = trip[:,0]
67 | ys = trip[:,1]
68 | times = trip[:,2]
69 |
70 | xs_interp = np.interp(range(0,triplen), times, xs)
71 | ys_interp = np.interp(range(0,triplen), times, ys)
72 | return np.append(xs_interp.reshape(xs_interp.shape[0],1), ys_interp.reshape(ys_interp.shape[0],1), 1)
73 |
74 |
75 | def rdp_format_angdist(trip):
76 | angdists = []
77 | for i in range(1, trip.shape[0]-1):
78 | x1 = trip[i-1][0]
79 | y1 = trip[i-1][1]
80 | x2 = trip[i][0]
81 | y2 = trip[i][1]
82 | x3 = trip[i+1][0]
83 | y3 = trip[i+1][1]
84 |
85 | dist = (distance(x1, y1, x3, y3))
86 | ang = (angle_3_points(x1, y1, x2, y2, x3, y3))*180/np.pi #to degrees
87 | angdists.append((ang, dist))
88 | return np.array(angdists)
89 |
90 |
91 |
92 | print "carrots"
93 | filename = sys.argv[1]
94 | tripPath = np.genfromtxt(filename, delimiter=',', skip_header=1)
95 | #add a column for time in seconds (so if we chop data, still have timepoints)
96 | tripPath = np.append(tripPath, np.arange(tripPath.shape[0]).reshape(tripPath.shape[0],1),1)
97 | rdp = rdp_simplify(tripPath, epsilon = 0.75)
98 | print "rdp simplification complete"
99 |
100 | #rdp = tripPath
101 | """angdists = rdp_format_angdist(rdp)
102 |
103 | pyplot.figure(1)
104 | pyplot.subplot(211)
105 | pyplot.scatter(angdists[:,0], angdists[:,1])"""
106 |
107 | pyplot.subplot(212)
108 | pyplot.plot(tripPath[:,0], tripPath[:,1], 'rx')
109 | pyplot.plot(rdp[:,0], rdp[:,1], 'bo')
110 | pyplot.show()
111 |
112 | np.savetxt("rdp_test16.csv", rdp, delimiter=",")
113 |
114 | #pyplot.show()"""
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/lib/util/distance-iterator.js:
--------------------------------------------------------------------------------
1 | /*istanbul ignore start*/"use strict";
2 |
3 | exports.__esModule = true;
4 |
5 | exports.default = /*istanbul ignore end*/function (start, minLine, maxLine) {
6 | var wantForward = true,
7 | backwardExhausted = false,
8 | forwardExhausted = false,
9 | localOffset = 1;
10 |
11 | return function iterator() {
12 | if (wantForward && !forwardExhausted) {
13 | if (backwardExhausted) {
14 | localOffset++;
15 | } else {
16 | wantForward = false;
17 | }
18 |
19 | // Check if trying to fit beyond text length, and if not, check it fits
20 | // after offset location (or desired location on first iteration)
21 | if (start + localOffset <= maxLine) {
22 | return localOffset;
23 | }
24 |
25 | forwardExhausted = true;
26 | }
27 |
28 | if (!backwardExhausted) {
29 | if (!forwardExhausted) {
30 | wantForward = true;
31 | }
32 |
33 | // Check if trying to fit before text beginning, and if not, check it fits
34 | // before offset location
35 | if (minLine <= start - localOffset) {
36 | return - localOffset++;
37 | }
38 |
39 | backwardExhausted = true;
40 | return iterator();
41 | }
42 |
43 | // We tried to fit hunk before text beginning and beyond text lenght, then
44 | // hunk can't fit on the text. Return undefined
45 | };
46 | };
47 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2Rpc3RhbmNlLWl0ZXJhdG9yLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7eUNBR2UsVUFBUyxLQUFULEVBQWdCLE9BQWhCLEVBQXlCLE9BQXpCLEVBQWtDO0FBQy9DLE1BQUksY0FBYyxJQUFkO01BQ0Esb0JBQW9CLEtBQXBCO01BQ0EsbUJBQW1CLEtBQW5CO01BQ0EsY0FBYyxDQUFkLENBSjJDOztBQU0vQyxTQUFPLFNBQVMsUUFBVCxHQUFvQjtBQUN6QixRQUFJLGVBQWUsQ0FBQyxnQkFBRCxFQUFtQjtBQUNwQyxVQUFJLGlCQUFKLEVBQXVCO0FBQ3JCLHNCQURxQjtPQUF2QixNQUVPO0FBQ0wsc0JBQWMsS0FBZCxDQURLO09BRlA7Ozs7QUFEb0MsVUFTaEMsUUFBUSxXQUFSLElBQXVCLE9BQXZCLEVBQWdDO0FBQ2xDLGVBQU8sV0FBUCxDQURrQztPQUFwQzs7QUFJQSx5QkFBbUIsSUFBbkIsQ0Fib0M7S0FBdEM7O0FBZ0JBLFFBQUksQ0FBQyxpQkFBRCxFQUFvQjtBQUN0QixVQUFJLENBQUMsZ0JBQUQsRUFBbUI7QUFDckIsc0JBQWMsSUFBZCxDQURxQjtPQUF2Qjs7OztBQURzQixVQU9sQixXQUFXLFFBQVEsV0FBUixFQUFxQjtBQUNsQyxlQUFPLEVBQUMsYUFBRCxDQUQyQjtPQUFwQzs7QUFJQSwwQkFBb0IsSUFBcEIsQ0FYc0I7QUFZdEIsYUFBTyxVQUFQLENBWnNCO0tBQXhCOzs7O0FBakJ5QixHQUFwQixDQU53QztDQUFsQyIsImZpbGUiOiJkaXN0YW5jZS1pdGVyYXRvci5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIEl0ZXJhdG9yIHRoYXQgdHJhdmVyc2VzIGluIHRoZSByYW5nZSBvZiBbbWluLCBtYXhdLCBzdGVwcGluZ1xuLy8gYnkgZGlzdGFuY2UgZnJvbSBhIGdpdmVuIHN0YXJ0IHBvc2l0aW9uLiBJLmUuIGZvciBbMCwgNF0sIHdpdGhcbi8vIHN0YXJ0IG9mIDIsIHRoaXMgd2lsbCBpdGVyYXRlIDIsIDMsIDEsIDQsIDAuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbihzdGFydCwgbWluTGluZSwgbWF4TGluZSkge1xuICBsZXQgd2FudEZvcndhcmQgPSB0cnVlLFxuICAgICAgYmFja3dhcmRFeGhhdXN0ZWQgPSBmYWxzZSxcbiAgICAgIGZvcndhcmRFeGhhdXN0ZWQgPSBmYWxzZSxcbiAgICAgIGxvY2FsT2Zmc2V0ID0gMTtcblxuICByZXR1cm4gZnVuY3Rpb24gaXRlcmF0b3IoKSB7XG4gICAgaWYgKHdhbnRGb3J3YXJkICYmICFmb3J3YXJkRXhoYXVzdGVkKSB7XG4gICAgICBpZiAoYmFja3dhcmRFeGhhdXN0ZWQpIHtcbiAgICAgICAgbG9jYWxPZmZzZXQrKztcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHdhbnRGb3J3YXJkID0gZmFsc2U7XG4gICAgICB9XG5cbiAgICAgIC8vIENoZWNrIGlmIHRyeWluZyB0byBmaXQgYmV5b25kIHRleHQgbGVuZ3RoLCBhbmQgaWYgbm90LCBjaGVjayBpdCBmaXRzXG4gICAgICAvLyBhZnRlciBvZmZzZXQgbG9jYXRpb24gKG9yIGRlc2lyZWQgbG9jYXRpb24gb24gZmlyc3QgaXRlcmF0aW9uKVxuICAgICAgaWYgKHN0YXJ0ICsgbG9jYWxPZmZzZXQgPD0gbWF4TGluZSkge1xuICAgICAgICByZXR1cm4gbG9jYWxPZmZzZXQ7XG4gICAgICB9XG5cbiAgICAgIGZvcndhcmRFeGhhdXN0ZWQgPSB0cnVlO1xuICAgIH1cblxuICAgIGlmICghYmFja3dhcmRFeGhhdXN0ZWQpIHtcbiAgICAgIGlmICghZm9yd2FyZEV4aGF1c3RlZCkge1xuICAgICAgICB3YW50Rm9yd2FyZCA9IHRydWU7XG4gICAgICB9XG5cbiAgICAgIC8vIENoZWNrIGlmIHRyeWluZyB0byBmaXQgYmVmb3JlIHRleHQgYmVnaW5uaW5nLCBhbmQgaWYgbm90LCBjaGVjayBpdCBmaXRzXG4gICAgICAvLyBiZWZvcmUgb2Zmc2V0IGxvY2F0aW9uXG4gICAgICBpZiAobWluTGluZSA8PSBzdGFydCAtIGxvY2FsT2Zmc2V0KSB7XG4gICAgICAgIHJldHVybiAtbG9jYWxPZmZzZXQrKztcbiAgICAgIH1cblxuICAgICAgYmFja3dhcmRFeGhhdXN0ZWQgPSB0cnVlO1xuICAgICAgcmV0dXJuIGl0ZXJhdG9yKCk7XG4gICAgfVxuXG4gICAgLy8gV2UgdHJpZWQgdG8gZml0IGh1bmsgYmVmb3JlIHRleHQgYmVnaW5uaW5nIGFuZCBiZXlvbmQgdGV4dCBsZW5naHQsIHRoZW5cbiAgICAvLyBodW5rIGNhbid0IGZpdCBvbiB0aGUgdGV4dC4gUmV0dXJuIHVuZGVmaW5lZFxuICB9O1xufVxuIl19
48 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/tripmatching/findMatches.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import sys
3 | import matplotlib.pyplot as pyplot
4 |
5 |
6 | def matchAngles(tripA, tripB, angle_min = 5, dist_min = 5):
7 | matches = []
8 |
9 | for i in range(0, tripA.shape[0]):
10 | angleA = tripA[i][0]
11 | distA = tripA[i][1]
12 |
13 | #find closest match angle to this one, keep track of min's index in B
14 | min_score = angle_min + dist_min
15 | #min_j = -1
16 |
17 | for j in range(0, tripB.shape[0]):
18 | angleB = tripB[j][0]
19 | distB = tripB[j][1]
20 | score = abs(angleA - angleB) + abs(distA - distB) # score close to 0 is best
21 | if(score <= min_score):
22 | #print "match found: angA =" + str(angleA) +", distA =" + str(distA) +", angleB ="+str(angleB) + ", distB =" + str(distB)
23 | #min_score = score
24 | #min_j = j
25 | matches.append((score, i, j))
26 |
27 | #if min_j != -1:
28 | # matches.append((min_score, i, min_j))
29 |
30 | n_matches = np.array(matches)
31 | return n_matches[n_matches[:,0].argsort()] #order matches from best scores to worst
32 |
33 |
34 | def chain_matchforward(chain, tripA, tripB, ai, bj, min_score):
35 | if ai >= tripA.shape[0] or bj >= tripB.shape[0]:
36 | #print "we're run out captain!"
37 | return chain
38 |
39 | angleA = tripA[ai][0]
40 | distA = tripA[ai][1]
41 |
42 | angleB = tripB[bj][0]
43 | distB = tripB[bj][1]
44 | score = abs(angleA - angleB) + abs(distA - distB) # score close to 0 is best
45 | if score <= min_score:
46 | chain.append((ai,bj))
47 | #print "a match! " + str(chain)
48 | return chain_matchforward(chain, tripA, tripB, ai+1, bj+1, min_score)
49 | else:
50 | return chain
51 |
52 | def chain_matchbackwards(chain, tripA, tripB, ai, bj, min_score):
53 | if ai < 0 or bj <0:
54 | #print "we're run out captain!"
55 | return chain
56 |
57 | angleA = tripA[ai][0]
58 | distA = tripA[ai][1]
59 |
60 | angleB = tripB[bj][0]
61 | distB = tripB[bj][1]
62 | score = abs(angleA - angleB) + abs(distA - distB) # score close to 0 is best
63 | if score <= min_score:
64 | chain.insert(0, (ai,bj))
65 | #print "a match! " + str(chain)
66 | return chain_matchbackwards(chain, tripA, tripB, ai-1, bj-1, min_score)
67 | else:
68 | return chain
69 |
70 | def chainMatches(tripA, tripB, matches, angle_min = 5, dist_min = 5):
71 | chains = []
72 | min_score = 20
73 |
74 | i=0
75 | while i2 and ch not in chains:
83 | chains.append(ch)
84 | #print str(ch)
85 |
86 | return chains
87 |
88 |
89 | def matchTrips(tripA, tripA_rdp, tripB, tripB_rdp):
90 | matches = matchAngles(tripA, tripB)
91 | chains = chainMatches(tripA, tripB, matches)
92 | return (len(matches), len(chains))
93 |
94 | """
95 | #to start, just comparing 2 trips at a time
96 | a = sys.argv[1]
97 | tripA = np.genfromtxt(a+"_angle_dist.csv", delimiter=',')
98 | tripA_rdp = np.genfromtxt(a+"_rdp.csv", delimiter=',')
99 |
100 | b = sys.argv[2]
101 | tripB = np.genfromtxt(b+"_angle_dist.csv", delimiter=',')
102 | tripB_rdp = np.genfromtxt(b+"_rdp.csv", delimiter=',')
103 |
104 |
105 | matches = matchAngles(tripA, tripB)
106 | print len(matches)
107 | chains = chainMatches(tripA, tripB, matches)
108 | print len(chains)
109 |
110 | pyplot.figure(1)
111 | pyplot.plot(tripA_rdp[:,0], tripA_rdp[:,1], 'r-')
112 | pyplot.plot(tripB_rdp[:,0], tripB_rdp[:,1], 'b-')
113 |
114 | for ch in chains:
115 | for ai, bj in ch:
116 | angA, distA, t1A, t2A, t3A = tripA[ai]
117 | angB, distB, t1B, t2B, t3B = tripB[bj]
118 | pyplot.plot(tripA_rdp[t1A][0], tripA_rdp[t1A][1], 'ro')
119 | pyplot.plot(tripB_rdp[t1B][0], tripB_rdp[t1B][1], 'bo')
120 | pyplot.plot([tripA_rdp[t1A][0], tripB_rdp[t1B][0]], [tripA_rdp[t1A][1], tripB_rdp[t1B][1]], 'g-')
121 |
122 |
123 | pyplot.plot(tripA_rdp[t2A][0], tripA_rdp[t2A][1], 'ro')
124 | pyplot.plot(tripA_rdp[t3A][0], tripA_rdp[t3A][1], 'ro')
125 | pyplot.plot(tripB_rdp[t1B][0], tripB_rdp[t1B][1], 'bo')
126 | pyplot.plot(tripB_rdp[t2B][0], tripB_rdp[t2B][1], 'bo')
127 | pyplot.plot(tripB_rdp[t3B][0], tripB_rdp[t3B][1], 'bo')
128 |
129 | pyplot.show()"""
130 |
131 |
--------------------------------------------------------------------------------
/atomic-taro/lib/atomic-taro.coffee:
--------------------------------------------------------------------------------
1 | AtomicTaroView = require './atomic-taro-view'
2 | {CompositeDisposable} = require 'atom'
3 | url = require 'url'
4 | path = require 'path'
5 | fs = require 'fs'
6 |
7 |
8 | module.exports = AtomicTaro =
9 | activeViews: null
10 | subscriptions: null
11 | focusedView: null
12 |
13 | activate: (state) ->
14 | @activeViews = [] # no active AtomicTaroView
15 |
16 | # Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable
17 | @subscriptions = new CompositeDisposable
18 |
19 | # Register command that toggles this view
20 | @subscriptions.add atom.commands.add 'atom-workspace', 'atomic-taro:open': => @open()
21 |
22 | @subscriptions.add atom.commands.add 'atom-workspace', 'atomic-taro:taronewvariant', (e) => @taroWrapVariant(e)
23 |
24 | @subscriptions.add atom.commands.add 'atom-workspace', 'core:save', (e) =>
25 | @handleSaveEvent(e)
26 |
27 | @subscriptions.add atom.commands.add 'atom-workspace', 'core:save-as', (e) =>
28 | @handleSaveAsEvent(e)
29 |
30 | atom.workspace.onDidChangeActivePaneItem (e) =>
31 | newActiveID = atom.workspace.getActivePaneItem().id
32 | if @focusedView?.exploratoryEditor.id != newActiveID
33 | changeTo = null
34 | for view in @activeViews
35 | if view.exploratoryEditor.id == newActiveID
36 | changeTo = view
37 | break
38 | @focusedView?.loseTabFocus()
39 | @focusedView = changeTo
40 | if changeTo
41 | @focusedView.gainTabFocus()
42 |
43 | atom.workspace.onDidDestroyPaneItem (e) =>
44 | #console.log "Destroyed! "
45 | destroyed = e.item
46 | @activeViews = @activeViews.filter (view) => view.exploratoryEditor.id != destroyed.id
47 | #console.log @activeViews
48 |
49 | deactivate: ->
50 | @subscriptions.dispose()
51 | for view in @activeViews
52 | view.deactivate()
53 | view.destroy()
54 |
55 |
56 | serialize: ->
57 | for view in @activeViews
58 | atomicTaroViewState: view.serialize()
59 |
60 |
61 | taroWrapVariant: (e) ->
62 | #editor = atom.workspace.getActivePaneItem()
63 | #if editor instanceof AtomicTaroView
64 | #@atomicTaroView = editor
65 | @focusedView.wrapNewVariant(e)
66 |
67 |
68 | open: ->
69 | filePath = atom.workspace.getActiveTextEditor().getPath()
70 | # check if there is a view for this file already
71 | for view in @activeViews
72 | #console.log "active view ", view
73 | if view?.filePath == filePath
74 | return
75 |
76 | @addTaroView(filePath)
77 |
78 |
79 | addTaroView: (filePath) ->
80 | # check if the current file is a python file
81 | #uri = 'tarotaro://file'+atom.workspace.getActiveTextEditor().getPath()
82 | #if uri? #and path.extname(uri) is '.py'
83 | editor = atom.workspace.getActiveTextEditor()
84 |
85 | lastIndex = filePath.lastIndexOf('/')
86 | folder = filePath.substring(0, lastIndex)
87 | fileName = filePath.substring(lastIndex + 1)
88 | [fileBase, fileType] = fileName.split(".")
89 | metaFolder = folder + "/" + fileBase+"-meta"
90 | @mkdirSync(metaFolder) # If folder does not exist, creates a new folder
91 |
92 | atomicTaroView = new AtomicTaroView filePath, folder, fileName, metaFolder, editor
93 |
94 | #editor.taroView = atomicTaroView
95 | @activeViews.push atomicTaroView
96 | @focusedView = atomicTaroView
97 |
98 |
99 | handleSaveEvent: (e) ->
100 | editor = atom.workspace.getActiveTextEditor()
101 | for view in @activeViews
102 | #console.log "looking at taro view ", view, "with editor ", view.exploratoryEditor.id, " against ", editor.id
103 | if view.exploratoryEditor.id == editor.id
104 | #console.log "TARO VIEW FOUND ", editor.taroView
105 | #view = editor.taroView
106 | view.saveVariants(e)
107 | '''cereal = view.serialize()
108 | lastIndex = view.filePath.lastIndexOf('/')
109 | folder = view.filePath.substring(0, lastIndex)
110 | fileName = view.filePath.substring(lastIndex + 1).split(".")[0]
111 | console.log cereal
112 | fs.writeFile (folder+"/"+fileName+".taro"), JSON.stringify(cereal), (error) ->
113 | console.error("Error writing file", error) if error
114 | return'''
115 |
116 | handleSaveAsEvent: (e) ->
117 | console.log "SAVE AS"
118 |
119 |
120 | mkdirSync: (path) ->
121 | try
122 | fs.mkdirSync(path);
123 | catch e
124 | if e.code != 'EEXIST'
125 | #throw e
126 | console.log "Failed to create directory."
127 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/tripmatching/rdp_trip.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import sys
3 | import matplotlib.pyplot as pyplot
4 |
5 | """
6 | edited 4/25 to fit trip default numpy format
7 | If you import a trip and then add a 3rd column to the trip that is time,
8 | when this runs the time field is kept... a bit hacky but works.
9 | """
10 |
11 | def distance(x0, y0, x1, y1):
12 | return ((x1-x0)**2 + (y1-y0)**2) ** (.5)
13 |
14 | def unit_vector(v):
15 | v_len = (v[0]**2 + v[1]**2)**0.5
16 | return [v[0]/v_len, v[1]/v_len]
17 |
18 | # get angle between 3 points in radians
19 | def angle_3_points(x1, y1, x2, y2, x3, y3):
20 | v1 = [x2-x1, y2-x1]
21 | v2 = [x2-x3, y2-y3]
22 | v1_unit = unit_vector(v1)
23 | v2_unit = unit_vector(v2)
24 | angle = np.arccos(np.dot(v1_unit, v2_unit))
25 | if np.isnan(angle):
26 | if(v1_unit == v2_unit).all():
27 | return 0.0
28 | else:
29 | return np.pi
30 | return angle
31 |
32 | def dist_point_to_line(x0, x1, x2):
33 | """ Calculates the distance from the point ``x0`` to the line given
34 | by the points ``x1`` and ``x2``, all numpy arrays """
35 | #print str(x0)+", "+ str(x1)+", "+str(x2)
36 | if x1[0] == x2[0]:
37 | return np.abs(x0[0] - x1[0])
38 |
39 | return np.divide(np.linalg.norm(np.linalg.det([x2 - x1, x1 - x0])),
40 | np.linalg.norm(x2 - x1))
41 |
42 |
43 | def rdp_simplify(trip, epsilon):
44 | # find the point with the maximum distance
45 | dmax = 0
46 | index = 0
47 | for i in range(1, trip.shape[0]): #every point but first and last
48 | d = dist_point_to_line( np.array([trip[i][0], trip[i][1]]),
49 | np.array([trip[0][0], trip[0][1]]),
50 | np.array([trip[-1][0], trip[-1][1]]) )
51 | if (d > dmax):
52 | index = i
53 | dmax = d
54 | # If max distance is greater than epsilon, recursively simplify
55 | if (dmax > epsilon):
56 | #build the result list
57 | res1 = rdp_simplify(trip[:index+1], epsilon)
58 | res2 = rdp_simplify(trip[index:], epsilon)
59 | return np.vstack((res1[:-1], res2)) #not sure why [:-1] works, but it keeps duplicates from happening
60 | else:
61 | return np.vstack((trip[0],trip[-1]))
62 |
63 | #takes an rdp simplified trip and interpolates to evenly fill out time points
64 | #so far.... not helpful
65 | def rdp_format_expand(trip, triplen):
66 | xs = trip[:,0]
67 | ys = trip[:,1]
68 | times = trip[:,2]
69 |
70 | xs_interp = np.interp(range(0,triplen), times, xs)
71 | ys_interp = np.interp(range(0,triplen), times, ys)
72 | return np.append(xs_interp.reshape(xs_interp.shape[0],1), ys_interp.reshape(ys_interp.shape[0],1), 1)
73 |
74 |
75 | def rdp_format_angdist(trip):
76 | angdists = []
77 | for i in range(1, trip.shape[0]-1):
78 | x1 = trip[i-1][0]
79 | y1 = trip[i-1][1]
80 | ind1 = i-1
81 |
82 | x2 = trip[i][0]
83 | y2 = trip[i][1]
84 | ind2 = i
85 |
86 | x3 = trip[i+1][0]
87 | y3 = trip[i+1][1]
88 | ind3 = i+1
89 |
90 | dist = (distance(x1, y1, x3, y3))
91 | ang = (angle_3_points(x1, y1, x2, y2, x3, y3))*180/np.pi #to degrees
92 | angdists.append((ang, dist, ind1, ind2, ind3))
93 | return np.array(angdists)
94 |
95 |
96 | def generateRDP(letter, driverN, tripN):
97 | """letter = sys.argv[1] #ex, A or B or C, testing
98 | driverN = sys.argv[2]
99 | tripN = sys.argv[3]"""
100 |
101 | tripPath = np.genfromtxt("../../drivers/"+driverN+"/"+tripN+".csv", delimiter=',', skip_header=1)
102 | #add a column for time in seconds (so if we chop data, still have timepoints)
103 | tripPath = np.append(tripPath, np.arange(tripPath.shape[0]).reshape(tripPath.shape[0],1),1)
104 | rdp = rdp_simplify(tripPath, epsilon = 0.75)
105 | print "rdp simplification complete"
106 | #print str(rdp)
107 | #rdp = tripPath
108 | angdists = rdp_format_angdist(rdp)
109 | #angdists = angdists[angdists[:,1].argsort()] #sort by distance
110 | #angdists = angdists[::-1,:] #reverse to put in descending order
111 |
112 | """
113 | pyplot.figure(1)
114 | pyplot.subplot(211)
115 | pyplot.scatter(angdists[:,0], angdists[:,1])
116 |
117 | pyplot.subplot(212)
118 | pyplot.plot(tripPath[:,0], tripPath[:,1], 'rx')
119 | pyplot.plot(rdp[:,0], rdp[:,1], 'bo')
120 | pyplot.show()
121 | """
122 |
123 | np.savetxt(letter+"_rdp.csv", rdp, delimiter=",")
124 | np.savetxt(letter+"_angle_dist.csv", angdists, delimiter=",")
125 |
126 | #pyplot.show()"""
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/performance_data.txt:
--------------------------------------------------------------------------------
1 | LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,
2 | intercept_scaling=1, max_iter=100, multi_class='ovr',
3 | penalty='l2', random_state=None, solver='liblinear', tol=0.0001,
4 | verbose=0)
5 | [ 0.]
6 | 0.628125
7 |
8 | LinearSVC(C=1.0, class_weight=None, dual=True, fit_intercept=True,
9 | intercept_scaling=1, loss='squared_hinge', max_iter=1000,
10 | multi_class='ovr', penalty='l2', random_state=None, tol=0.0001,
11 | verbose=0)
12 | [ 1.]
13 | 0.375
14 |
15 | SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3, gamma=0.0,
16 | kernel='rbf', max_iter=-1, probability=False, random_state=None,
17 | shrinking=True, tol=0.001, verbose=False)
18 | [ 1.]
19 | 0.990625
20 |
21 | SGDClassifier(alpha=0.0001, average=False, class_weight=None, epsilon=0.1,
22 | eta0=0.0, fit_intercept=True, l1_ratio=0.15,
23 | learning_rate='optimal', loss='hinge', n_iter=5, n_jobs=1,
24 | penalty='l2', power_t=0.5, random_state=None, shuffle=True,
25 | verbose=0, warm_start=False)
26 | [ 1.]
27 | 0.375
28 |
29 | RandomForestRegressor(bootstrap=True, criterion='mse', max_depth=None,
30 | max_features='auto', max_leaf_nodes=None, min_samples_leaf=1,
31 | min_samples_split=2, min_weight_fraction_leaf=0.0,
32 | n_estimators=10, n_jobs=1, oob_score=False, random_state=None,
33 | verbose=0, warm_start=False)
34 | [ 0.6]
35 | 0.817866666667
36 |
37 | ARDRegression(alpha_1=1e-06, alpha_2=1e-06, compute_score=False, copy_X=True,
38 | fit_intercept=True, lambda_1=1e-06, lambda_2=1e-06, n_iter=300,
39 | normalize=False, threshold_lambda=10000.0, tol=0.001, verbose=False)
40 | [ 0.13837746]
41 | 0.0623000748331
42 |
43 | Features: advSpeed, tripDist-----------
44 | driver10
45 | SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3, gamma=0.0,
46 | kernel='rbf', max_iter=-1, probability=False, random_state=None,
47 | shrinking=True, tol=0.001, verbose=False)
48 | 0.99375 train
49 | 0.825 test
50 |
51 | Features: binnedSpeed-----------
52 | driver 10
53 | SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3, gamma=0.0,
54 | kernel='rbf', max_iter=-1, probability=False, random_state=None,
55 | shrinking=True, tol=0.001, verbose=False)
56 | 0.86875 train
57 |
58 | Features: binnedSpeed, tripDist--------------
59 | driver 10
60 | SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3, gamma=0.0,
61 | kernel='rbf', max_iter=-1, probability=False, random_state=None,
62 | shrinking=True, tol=0.001, verbose=False)
63 | 0.99375 train
64 | 0.825 test
65 | 0.8 test
66 |
67 | Features: advSpeed, binnedAcc------------
68 | SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3, gamma=0.0,
69 | kernel='rbf', max_iter=-1, probability=False, random_state=None,
70 | shrinking=True, tol=0.001, verbose=False)
71 | 0.63125 train
72 | 0.816666666667 test
73 |
74 | Features: advSpeed, binnedAcc, tripDist------------------------
75 | SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3, gamma=0.0,
76 | kernel='rbf', max_iter=-1, probability=False, random_state=None,
77 | shrinking=True, tol=0.001, verbose=False)
78 | 0.965625 train
79 | 0.829166666667 test
80 |
81 | RandomForestClassifier(bootstrap=True, class_weight=None, criterion='gini',
82 | max_depth=None, max_features='auto', max_leaf_nodes=None,
83 | min_samples_leaf=1, min_samples_split=2,
84 | min_weight_fraction_leaf=0.0, n_estimators=10, n_jobs=1,
85 | oob_score=False, random_state=None, verbose=0,
86 | warm_start=False)
87 | 0.975 train
88 | 0.766666666667 test
89 |
90 | Features: binnedSpeed, binnedAcc, fripDist------------
91 |
92 | RandomForestClassifier(bootstrap=True, class_weight=None, criterion='gini',
93 | max_depth=None, max_features='auto', max_leaf_nodes=None,
94 | min_samples_leaf=1, min_samples_split=2,
95 | min_weight_fraction_leaf=0.0, n_estimators=10, n_jobs=1,
96 | oob_score=False, random_state=None, verbose=0,
97 | warm_start=False)
98 | 0.978125 train
99 | 0.75 test
100 |
101 | (with vel 20 bins)
102 | RandomForestClassifier(bootstrap=True, class_weight=None, criterion='gini',
103 | max_depth=None, max_features='auto', max_leaf_nodes=None,
104 | min_samples_leaf=1, min_samples_split=2,
105 | min_weight_fraction_leaf=0.0, n_estimators=10, n_jobs=1,
106 | oob_score=False, random_state=None, verbose=0,
107 | warm_start=False)
108 | 0.984375 train
109 | 0.754166666667 test
110 |
111 |
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/lib/diff/line.js:
--------------------------------------------------------------------------------
1 | /*istanbul ignore start*/'use strict';
2 |
3 | exports.__esModule = true;
4 | exports.lineDiff = undefined;
5 | exports. /*istanbul ignore end*/diffLines = diffLines;
6 | /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = diffTrimmedLines;
7 |
8 | var /*istanbul ignore start*/_base = require('./base') /*istanbul ignore end*/;
9 |
10 | /*istanbul ignore start*/
11 | var _base2 = _interopRequireDefault(_base);
12 |
13 | /*istanbul ignore end*/
14 | var /*istanbul ignore start*/_params = require('../util/params') /*istanbul ignore end*/;
15 |
16 | /*istanbul ignore start*/
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | /*istanbul ignore end*/var lineDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/lineDiff = new /*istanbul ignore start*/_base2.default() /*istanbul ignore end*/;
20 | lineDiff.tokenize = function (value) {
21 | var retLines = [],
22 | linesAndNewlines = value.split(/(\n|\r\n)/);
23 |
24 | // Ignore the final empty token that occurs if the string ends with a new line
25 | if (!linesAndNewlines[linesAndNewlines.length - 1]) {
26 | linesAndNewlines.pop();
27 | }
28 |
29 | // Merge the content and line separators into single tokens
30 | for (var i = 0; i < linesAndNewlines.length; i++) {
31 | var line = linesAndNewlines[i];
32 |
33 | if (i % 2 && !this.options.newlineIsToken) {
34 | retLines[retLines.length - 1] += line;
35 | } else {
36 | if (this.options.ignoreWhitespace) {
37 | line = line.trim();
38 | }
39 | retLines.push(line);
40 | }
41 | }
42 |
43 | return retLines;
44 | };
45 |
46 | function diffLines(oldStr, newStr, callback) {
47 | return lineDiff.diff(oldStr, newStr, callback);
48 | }
49 | function diffTrimmedLines(oldStr, newStr, callback) {
50 | var options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(callback, { ignoreWhitespace: true });
51 | return lineDiff.diff(oldStr, newStr, options);
52 | }
53 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2xpbmUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztnQ0E4QmdCO3lEQUNBOztBQS9CaEI7Ozs7OztBQUNBOzs7Ozt1QkFFTyxJQUFNLCtFQUFXLHFFQUFYO0FBQ2IsU0FBUyxRQUFULEdBQW9CLFVBQVMsS0FBVCxFQUFnQjtBQUNsQyxNQUFJLFdBQVcsRUFBWDtNQUNBLG1CQUFtQixNQUFNLEtBQU4sQ0FBWSxXQUFaLENBQW5COzs7QUFGOEIsTUFLOUIsQ0FBQyxpQkFBaUIsaUJBQWlCLE1BQWpCLEdBQTBCLENBQTFCLENBQWxCLEVBQWdEO0FBQ2xELHFCQUFpQixHQUFqQixHQURrRDtHQUFwRDs7O0FBTGtDLE9BVTdCLElBQUksSUFBSSxDQUFKLEVBQU8sSUFBSSxpQkFBaUIsTUFBakIsRUFBeUIsR0FBN0MsRUFBa0Q7QUFDaEQsUUFBSSxPQUFPLGlCQUFpQixDQUFqQixDQUFQLENBRDRDOztBQUdoRCxRQUFJLElBQUksQ0FBSixJQUFTLENBQUMsS0FBSyxPQUFMLENBQWEsY0FBYixFQUE2QjtBQUN6QyxlQUFTLFNBQVMsTUFBVCxHQUFrQixDQUFsQixDQUFULElBQWlDLElBQWpDLENBRHlDO0tBQTNDLE1BRU87QUFDTCxVQUFJLEtBQUssT0FBTCxDQUFhLGdCQUFiLEVBQStCO0FBQ2pDLGVBQU8sS0FBSyxJQUFMLEVBQVAsQ0FEaUM7T0FBbkM7QUFHQSxlQUFTLElBQVQsQ0FBYyxJQUFkLEVBSks7S0FGUDtHQUhGOztBQWFBLFNBQU8sUUFBUCxDQXZCa0M7Q0FBaEI7O0FBMEJiLFNBQVMsU0FBVCxDQUFtQixNQUFuQixFQUEyQixNQUEzQixFQUFtQyxRQUFuQyxFQUE2QztBQUFFLFNBQU8sU0FBUyxJQUFULENBQWMsTUFBZCxFQUFzQixNQUF0QixFQUE4QixRQUE5QixDQUFQLENBQUY7Q0FBN0M7QUFDQSxTQUFTLGdCQUFULENBQTBCLE1BQTFCLEVBQWtDLE1BQWxDLEVBQTBDLFFBQTFDLEVBQW9EO0FBQ3pELE1BQUksVUFBVSw4RUFBZ0IsUUFBaEIsRUFBMEIsRUFBQyxrQkFBa0IsSUFBbEIsRUFBM0IsQ0FBVixDQURxRDtBQUV6RCxTQUFPLFNBQVMsSUFBVCxDQUFjLE1BQWQsRUFBc0IsTUFBdEIsRUFBOEIsT0FBOUIsQ0FBUCxDQUZ5RDtDQUFwRCIsImZpbGUiOiJsaW5lLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcbmltcG9ydCB7Z2VuZXJhdGVPcHRpb25zfSBmcm9tICcuLi91dGlsL3BhcmFtcyc7XG5cbmV4cG9ydCBjb25zdCBsaW5lRGlmZiA9IG5ldyBEaWZmKCk7XG5saW5lRGlmZi50b2tlbml6ZSA9IGZ1bmN0aW9uKHZhbHVlKSB7XG4gIGxldCByZXRMaW5lcyA9IFtdLFxuICAgICAgbGluZXNBbmROZXdsaW5lcyA9IHZhbHVlLnNwbGl0KC8oXFxufFxcclxcbikvKTtcblxuICAvLyBJZ25vcmUgdGhlIGZpbmFsIGVtcHR5IHRva2VuIHRoYXQgb2NjdXJzIGlmIHRoZSBzdHJpbmcgZW5kcyB3aXRoIGEgbmV3IGxpbmVcbiAgaWYgKCFsaW5lc0FuZE5ld2xpbmVzW2xpbmVzQW5kTmV3bGluZXMubGVuZ3RoIC0gMV0pIHtcbiAgICBsaW5lc0FuZE5ld2xpbmVzLnBvcCgpO1xuICB9XG5cbiAgLy8gTWVyZ2UgdGhlIGNvbnRlbnQgYW5kIGxpbmUgc2VwYXJhdG9ycyBpbnRvIHNpbmdsZSB0b2tlbnNcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBsaW5lc0FuZE5ld2xpbmVzLmxlbmd0aDsgaSsrKSB7XG4gICAgbGV0IGxpbmUgPSBsaW5lc0FuZE5ld2xpbmVzW2ldO1xuXG4gICAgaWYgKGkgJSAyICYmICF0aGlzLm9wdGlvbnMubmV3bGluZUlzVG9rZW4pIHtcbiAgICAgIHJldExpbmVzW3JldExpbmVzLmxlbmd0aCAtIDFdICs9IGxpbmU7XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmICh0aGlzLm9wdGlvbnMuaWdub3JlV2hpdGVzcGFjZSkge1xuICAgICAgICBsaW5lID0gbGluZS50cmltKCk7XG4gICAgICB9XG4gICAgICByZXRMaW5lcy5wdXNoKGxpbmUpO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiByZXRMaW5lcztcbn07XG5cbmV4cG9ydCBmdW5jdGlvbiBkaWZmTGluZXMob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKSB7IHJldHVybiBsaW5lRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbmV4cG9ydCBmdW5jdGlvbiBkaWZmVHJpbW1lZExpbmVzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykge1xuICBsZXQgb3B0aW9ucyA9IGdlbmVyYXRlT3B0aW9ucyhjYWxsYmFjaywge2lnbm9yZVdoaXRlc3BhY2U6IHRydWV9KTtcbiAgcmV0dXJuIGxpbmVEaWZmLmRpZmYob2xkU3RyLCBuZXdTdHIsIG9wdGlvbnMpO1xufVxuIl19
54 |
--------------------------------------------------------------------------------
/atomic-taro/lib/segment-objects/branch-map.coffee:
--------------------------------------------------------------------------------
1 | {Point, Range, TextBuffer} = require 'atom'
2 | {CompositeDisposable} = require 'atom'
3 |
4 |
5 | module.exports =
6 | class BranchMap
7 |
8 | constructor: (@variantView, @variantModel, width) ->
9 | @addBranchMap(width) # initialize commit line
10 | @subscriptions = new CompositeDisposable()
11 |
12 |
13 | getVariantView: ->
14 | @variantView
15 |
16 | getModel: ->
17 | @variantModel
18 |
19 | addBranchMap: (width) ->
20 | @branchMapElem = document.createElement('div')
21 | @branchMapElem.classList.add('atomic-taro_branch-map')
22 | $(@branchMapElem).width(width)
23 | $(@branchMapElem).hide()
24 |
25 |
26 |
27 | getElement: ->
28 | @branchMapElem
29 |
30 |
31 | addClass: ->
32 | $(@branchMapElem).addClass('historical')
33 |
34 | removeClass: ->
35 | $(@branchMapElem).removeClass('historical')
36 |
37 |
38 | updateWidth: (width) ->
39 | $(@branchMapElem).width(width)
40 |
41 |
42 | '''
43 | Show the branch map to view and travel between branches.
44 | '''
45 | toggleBranchMap: ->
46 | if $(@branchMapElem).is(":visible")
47 | #$(@branchMapElem).hide()
48 | $(@branchMapElem).slideUp('fast')
49 | @subscriptions.dispose()
50 | #console.log @subscriptions
51 | return false
52 | else
53 | #$(@branchMapElem).width($(@branchMapElem).parent().width())
54 | $(@branchMapElem).html("")
55 | $(@branchMapElem).show()
56 | @drawBranchMap()
57 | #$(@branchMapElem).slideDown('fast')
58 | return true
59 |
60 |
61 | drawBranchMap: ->
62 | squareWidth = 10
63 | height = @maxSquaresInView(@getModel().getRootVersion(), 4)
64 | $(@branchMapElem).height(height*(squareWidth + 20))
65 | @placeSquares(null, 0, 0, squareWidth)
66 |
67 |
68 | redraw: ->
69 | if $(@branchMapElem).is(":visible")
70 | @subscriptions.dispose()
71 | @subscriptions = new CompositeDisposable()
72 | #console.log @subscriptions
73 | $(@branchMapElem).html("")
74 | @drawBranchMap()
75 |
76 |
77 | maxSquaresInView: (root, absoluteMax) ->
78 | numB = root.getBranches().length
79 | if numB >= absoluteMax
80 | return numB
81 | else
82 | grandchildren = 0
83 | for branch in root.getBranches()
84 | grandchildren += @maxSquaresInView(branch, absoluteMax)
85 | if grandchildren >= absoluteMax
86 | return absoluteMax
87 | return Math.max(grandchildren, numB, 1)
88 |
89 |
90 |
91 | placeSquares: (root, x, y, squareWidth) ->
92 | if not root? # then place the first root square
93 | root = @getModel().getRootVersion()
94 | mapHeight = $(@branchMapElem).height()
95 | mapWidth = $(@branchMapElem).width()
96 | x = 20
97 | y = (mapHeight*.50) - squareWidth/4
98 | square = document.createElement('div')
99 | square.classList.add('atomic-taro_branch-map-square')
100 | #disposable = atom.tooltips.add(square, {title: root.getTitle(), placement: "bottom"})
101 | #@subscriptions.add disposable
102 | #console.log "disposable added"
103 | #console.log @subscriptions
104 | $(square).data("branch", root)
105 | if root.getActive()
106 | square.classList.add('active')
107 | if root.isCurrent()
108 | square.classList.add('current')
109 | $(square).css('left', x+"px")
110 | $(square).css('top', y+"px")
111 | @branchMapElem.appendChild(square)
112 |
113 | branchs = root.getBranches()
114 | numB = branchs.length
115 | yb = y + (numB/2 * (-10 - squareWidth/2))
116 | if numB == 1
117 | yb = y
118 | # if yb < yMin
119 | # yMin = yb
120 | # if (-1 * yb) > yMax
121 | # yMax = (-1 * yb)
122 | xb = x + 100
123 | for branch in branchs
124 | squareB = document.createElement('div')
125 | squareB.classList.add('atomic-taro_branch-map-square')
126 | @subscriptions.add atom.tooltips.add(squareB, {title: branch.getTitle(), placement: "bottom"})
127 | $(squareB).data("branch", branch)
128 | if branch.getActive()
129 | squareB.classList.add('active')
130 | if branch.isCurrent()
131 | squareB.classList.add('current')
132 | $(squareB).css('left', xb+"px")
133 | $(squareB).css('top', yb+"px")
134 | @branchMapElem.appendChild(squareB)
135 | line = @createLine(x + squareWidth, y + squareWidth/2, xb, yb + squareWidth/2)
136 | @branchMapElem.appendChild(line)
137 | @placeSquares(branch, xb, yb, squareWidth)
138 | yb = yb + 10+squareWidth
139 |
140 |
141 |
142 |
143 |
144 | createLine: (x1, y1, x2, y2) ->
145 | if (x2 < x1)
146 | temp = x1
147 | x1 = x2
148 | x2 = temp
149 | temp = y1
150 | y1 = y2
151 | y2 = temp
152 |
153 | line = document.createElement("div")
154 | line.classList.add('atomic-taro_branch-map-line')
155 | length = Math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))
156 | line.style.width = length + "px"
157 |
158 |
159 | angle = Math.atan((y2-y1)/(x2-x1))
160 | line.style.top = y1 + 0.5*length*Math.sin(angle) + "px"
161 | line.style.left = x1 - 0.5*length*(1 - Math.cos(angle)) + "px"
162 | line.style.transform = line.style.MozTransform = line.style.WebkitTransform = line.style.msTransform = line.style.OTransform= "rotate(" + angle + "rad)"
163 |
164 | return line
165 |
--------------------------------------------------------------------------------
/atomic-taro/lib/ui-helpers/jquery.hoverIntent.minified.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * hoverIntent v1.8.0 // 2014.06.29 // jQuery v1.9.1+
3 | * http://cherne.net/brian/resources/jquery.hoverIntent.html
4 | *
5 | * You may use hoverIntent under the terms of the MIT license. Basically that
6 | * means you are free to use hoverIntent as long as this header is left intact.
7 | * Copyright 2007, 2014 Brian Cherne
8 | */
9 |
10 | /* hoverIntent is similar to jQuery's built-in "hover" method except that
11 | * instead of firing the handlerIn function immediately, hoverIntent checks
12 | * to see if the user's mouse has slowed down (beneath the sensitivity
13 | * threshold) before firing the event. The handlerOut function is only
14 | * called after a matching handlerIn.
15 | *
16 | * // basic usage ... just like .hover()
17 | * .hoverIntent( handlerIn, handlerOut )
18 | * .hoverIntent( handlerInOut )
19 | *
20 | * // basic usage ... with event delegation!
21 | * .hoverIntent( handlerIn, handlerOut, selector )
22 | * .hoverIntent( handlerInOut, selector )
23 | *
24 | * // using a basic configuration object
25 | * .hoverIntent( config )
26 | *
27 | * @param handlerIn function OR configuration object
28 | * @param handlerOut function OR selector for delegation OR undefined
29 | * @param selector selector OR undefined
30 | * @author Brian Cherne
31 | */
32 | (function($) {
33 | $.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
34 |
35 | // default configuration values
36 | var cfg = {
37 | interval: 100,
38 | sensitivity: 6,
39 | timeout: 0
40 | };
41 |
42 | if ( typeof handlerIn === "object" ) {
43 | cfg = $.extend(cfg, handlerIn );
44 | } else if ($.isFunction(handlerOut)) {
45 | cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
46 | } else {
47 | cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );
48 | }
49 |
50 | // instantiate variables
51 | // cX, cY = current X and Y position of mouse, updated by mousemove event
52 | // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
53 | var cX, cY, pX, pY;
54 |
55 | // A private function for getting mouse position
56 | var track = function(ev) {
57 | cX = ev.pageX;
58 | cY = ev.pageY;
59 | };
60 |
61 | // A private function for comparing current and previous mouse position
62 | var compare = function(ev,ob) {
63 | ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
64 | // compare mouse positions to see if they've crossed the threshold
65 | if ( Math.sqrt( (pX-cX)*(pX-cX) + (pY-cY)*(pY-cY) ) < cfg.sensitivity ) {
66 | $(ob).off("mousemove.hoverIntent",track);
67 | // set hoverIntent state to true (so mouseOut can be called)
68 | ob.hoverIntent_s = true;
69 | return cfg.over.apply(ob,[ev]);
70 | } else {
71 | // set previous coordinates for next time
72 | pX = cX; pY = cY;
73 | // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
74 | ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
75 | }
76 | };
77 |
78 | // A private function for delaying the mouseOut function
79 | var delay = function(ev,ob) {
80 | ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
81 | ob.hoverIntent_s = false;
82 | return cfg.out.apply(ob,[ev]);
83 | };
84 |
85 | // A private function for handling mouse 'hovering'
86 | var handleHover = function(e) {
87 | // copy objects to be passed into t (required for event object to be passed in IE)
88 | var ev = $.extend({},e);
89 | var ob = this;
90 |
91 | // cancel hoverIntent timer if it exists
92 | if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
93 |
94 | // if e.type === "mouseenter"
95 | if (e.type === "mouseenter") {
96 | // set "previous" X and Y position based on initial entry point
97 | pX = ev.pageX; pY = ev.pageY;
98 | // update "current" X and Y position based on mousemove
99 | $(ob).on("mousemove.hoverIntent",track);
100 | // start polling interval (self-calling timeout) to compare mouse coordinates over time
101 | if (!ob.hoverIntent_s) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
102 |
103 | // else e.type == "mouseleave"
104 | } else {
105 | // unbind expensive mousemove event
106 | $(ob).off("mousemove.hoverIntent",track);
107 | // if hoverIntent state is true, then call the mouseOut function after the specified delay
108 | if (ob.hoverIntent_s) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
109 | }
110 | };
111 |
112 | // listen for mouseenter and mouseleave
113 | return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector);
114 | };
115 | })(jQuery);
116 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/tripmatching/C_angle_dist.csv:
--------------------------------------------------------------------------------
1 | 1.585043495615253164e+02,2.026153992173349039e+01,0.000000000000000000e+00,1.000000000000000000e+00,2.000000000000000000e+00
2 | 1.382387860678839218e+02,1.813422179196008344e+01,1.000000000000000000e+00,2.000000000000000000e+00,3.000000000000000000e+00
3 | 1.154872593298651537e+02,4.821877227802465882e+01,2.000000000000000000e+00,3.000000000000000000e+00,4.000000000000000000e+00
4 | 1.496199638708952193e+02,4.750789408087881327e+01,3.000000000000000000e+00,4.000000000000000000e+00,5.000000000000000000e+00
5 | 1.222327307421057299e+02,2.277586441828279007e+01,4.000000000000000000e+00,5.000000000000000000e+00,6.000000000000000000e+00
6 | 1.420693405818089445e+02,2.888754056682569527e+01,5.000000000000000000e+00,6.000000000000000000e+00,7.000000000000000000e+00
7 | 1.618709103535319684e+02,2.909450119868013473e+01,6.000000000000000000e+00,7.000000000000000000e+00,8.000000000000000000e+00
8 | 1.748544042877251741e+02,4.079767150218257399e+01,7.000000000000000000e+00,8.000000000000000000e+00,9.000000000000000000e+00
9 | 1.706069689036558543e+02,4.011508444463255074e+01,8.000000000000000000e+00,9.000000000000000000e+00,1.000000000000000000e+01
10 | 1.631469928210118780e+02,3.037103883636514112e+01,9.000000000000000000e+00,1.000000000000000000e+01,1.100000000000000000e+01
11 | 1.502857399256686506e+02,1.701352403236906596e+01,1.000000000000000000e+01,1.100000000000000000e+01,1.200000000000000000e+01
12 | 3.524017168620861185e+01,1.676305461424015597e+00,1.100000000000000000e+01,1.200000000000000000e+01,1.300000000000000000e+01
13 | 1.096348230318717185e+02,4.104875150354767577e+00,1.200000000000000000e+01,1.300000000000000000e+01,1.400000000000000000e+01
14 | 1.227463270575112233e+02,2.973213749463702982e+00,1.300000000000000000e+01,1.400000000000000000e+01,1.500000000000000000e+01
15 | 1.773245733439709113e+02,6.670832032063167105e+00,1.400000000000000000e+01,1.500000000000000000e+01,1.600000000000000000e+01
16 | 1.394802844828477646e+02,8.918520056601320078e+00,1.500000000000000000e+01,1.600000000000000000e+01,1.700000000000000000e+01
17 | 1.214058631047140580e+02,1.819587865424475481e+01,1.600000000000000000e+01,1.700000000000000000e+01,1.800000000000000000e+01
18 | 1.178213353037324254e+02,9.795611262192879565e+01,1.700000000000000000e+01,1.800000000000000000e+01,1.900000000000000000e+01
19 | 1.219747325637799662e+02,9.110707985661707653e+01,1.800000000000000000e+01,1.900000000000000000e+01,2.000000000000000000e+01
20 | 1.145508914422184432e+02,5.121640362227712018e+01,1.900000000000000000e+01,2.000000000000000000e+01,2.100000000000000000e+01
21 | 1.161719034989897352e+02,9.526258447050446421e+01,2.000000000000000000e+01,2.100000000000000000e+01,2.200000000000000000e+01
22 | 1.319784318131334828e+02,5.851264820532396271e+01,2.100000000000000000e+01,2.200000000000000000e+01,2.300000000000000000e+01
23 | 1.762431820679408929e+02,9.404786015641194652e+00,2.200000000000000000e+01,2.300000000000000000e+01,2.400000000000000000e+01
24 | 1.536635340393690399e+02,6.580706648985351137e+01,2.300000000000000000e+01,2.400000000000000000e+01,2.500000000000000000e+01
25 | 1.543542791121082018e+02,1.040288902180543715e+02,2.400000000000000000e+01,2.500000000000000000e+01,2.600000000000000000e+01
26 | 1.412863307630044574e+02,6.141856396888483971e+01,2.500000000000000000e+01,2.600000000000000000e+01,2.700000000000000000e+01
27 | 1.198304922629957190e+02,3.954339388570483749e+01,2.600000000000000000e+01,2.700000000000000000e+01,2.800000000000000000e+01
28 | 1.126103747030727504e+02,5.189470107824111267e+01,2.700000000000000000e+01,2.800000000000000000e+01,2.900000000000000000e+01
29 | 1.167606405730780210e+02,7.452362041661690739e+01,2.800000000000000000e+01,2.900000000000000000e+01,3.000000000000000000e+01
30 | 1.129917596200782555e+02,5.847777355542874034e+01,2.900000000000000000e+01,3.000000000000000000e+01,3.100000000000000000e+01
31 | 9.945159340069395171e+01,2.171681376261259899e+01,3.000000000000000000e+01,3.100000000000000000e+01,3.200000000000000000e+01
32 | 6.413552551116863754e+01,1.167261752992875223e+01,3.100000000000000000e+01,3.200000000000000000e+01,3.300000000000000000e+01
33 | 4.648409582419067476e+01,1.115033631779778212e+01,3.200000000000000000e+01,3.300000000000000000e+01,3.400000000000000000e+01
34 | 2.430827955448732069e+01,2.844784701871126842e+01,3.300000000000000000e+01,3.400000000000000000e+01,3.500000000000000000e+01
35 | 3.584388629986381147e+01,3.067914601158253163e+01,3.400000000000000000e+01,3.500000000000000000e+01,3.600000000000000000e+01
36 | 4.989158813870452036e+01,1.994241710525582434e+01,3.500000000000000000e+01,3.600000000000000000e+01,3.700000000000000000e+01
37 | 6.293524590148741282e+01,2.654449095386836888e+01,3.600000000000000000e+01,3.700000000000000000e+01,3.800000000000000000e+01
38 | 7.528767924750285090e+01,4.451213317737085617e+01,3.700000000000000000e+01,3.800000000000000000e+01,3.900000000000000000e+01
39 | 8.476208694170509261e+01,5.685358387999828267e+01,3.800000000000000000e+01,3.900000000000000000e+01,4.000000000000000000e+01
40 | 9.031997875036205414e+01,4.316480047446066948e+01,3.900000000000000000e+01,4.000000000000000000e+01,4.100000000000000000e+01
41 | 9.444402241709060775e+01,3.960618638546255710e+01,4.000000000000000000e+01,4.100000000000000000e+01,4.200000000000000000e+01
42 | 1.002465814460736055e+02,3.193524698511035709e+01,4.100000000000000000e+01,4.200000000000000000e+01,4.300000000000000000e+01
43 | 1.101862004338373424e+02,1.692483382488584454e+01,4.200000000000000000e+01,4.300000000000000000e+01,4.400000000000000000e+01
44 | 4.749472172760052047e+01,4.709564735726647022e+00,4.300000000000000000e+01,4.400000000000000000e+01,4.500000000000000000e+01
45 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/Trip_rdp.py:
--------------------------------------------------------------------------------
1 | import matplotlib.pyplot as pyplot
2 | import numpy as np
3 | import os
4 | import sys
5 | import math
6 | import Pmf
7 |
8 |
9 | def distance(x0, y0, x1, y1):
10 | return math.sqrt((x1-x0)**2 + (y1-y0)**2)
11 |
12 | def computeNorm(x, y):
13 | return math.sqrt (x**2 + y**2)
14 |
15 | def computeAngle (p1, p2):
16 | dot = 0
17 | if computeNorm(p2[0], p2[1]) == 0 or computeNorm(p1[0], p1[1])==0: #may be incorrect
18 | dot = 0
19 | else:
20 | dot = (p2[0]*p1[0]+p2[1]*p1[1])/float(computeNorm(p1[0], p1[1])*computeNorm(p2[0], p2[1]))
21 |
22 | if dot > 1:
23 | dot = 1
24 | elif dot < -1:
25 | dot = -1
26 |
27 | return math.acos(dot)*180/math.pi
28 |
29 | def compute_AllAngles (trip):
30 | dV = np.diff(trip, axis = 0) #x1-x0 and y1-y0
31 | angles = np.empty(shape = dV.shape[0])
32 | for i in range(1, trip.shape[0] - 1):
33 | ang = computeAngle(dV[i-1], dV[i])
34 | np.append(angles, [ang, dV[i][2]]) #append angle with timepoint
35 | return angles
36 |
37 | """def findSpeed_Dist(trip):
38 | v = []
39 | dist = 0
40 | for i in range(1, trip.shape[0]):
41 | d = distance(trip[i-1][0], trip[i-1][1], trip[i][0], trip[i][1])
42 | dist += d
43 | v.append(3.6*d)
44 |
45 | return v,dist"""
46 |
47 |
48 |
49 | def findStops(speeds):
50 | stops = [] #stops are a start and end time pair
51 | start = -1
52 | end = -1
53 | for i in range(1, len(speeds)):
54 | advS = (speeds[i] + speeds[i-1])/2 #smooth out noise in stop duration
55 | if speeds[i] == 0: #start of stop
56 | end = i
57 | if start == -1:
58 | start = i
59 | elif start > -1 and advS > 1:
60 | stops.append([start,end])
61 | start = -1
62 | end = -1
63 | if start > -1:
64 | stops.append([start, len(speeds)])
65 | return stops
66 |
67 | def printHist_Feature(hist):
68 | h = ""
69 | for i in range(len(hist)-1):
70 | h += str(hist[i])+","
71 | #to avoid final comma (will mess up input)
72 | h += str(hist[len(hist)-1])
73 | return h
74 |
75 | class Trip(object):
76 |
77 | def __init__(self, filename):
78 |
79 | #read in trip from file
80 | tripPath = np.genfromtxt(filename, delimiter=',', skip_header=1)
81 | #add a column for time in seconds (so if we chop data, still have timepoints)
82 | self.tripPath = np.append(tripPath, np.arange(tripPath.shape[0]).reshape(tripPath.shape[0],1),1)
83 |
84 | #self.rdp = rdp.rdp_simplify(self.tripPath, epsilon = 0.75)
85 |
86 | #self.angles = compute_AllAngles(self.rdp)
87 | #print self.angles
88 |
89 |
90 | #self.v, self.tripDist = findSpeed_Dist(self.tripPath)
91 | self.findSpeed_Hist(self.tripPath)
92 |
93 | self.tripTime = self.tripPath.shape[0] #length of trip in seconds
94 | self.advSpeed = self.tripDist/self.tripTime #meters per second
95 | self.maxSpeed = max(self.v)
96 |
97 | self.stops = findStops(self.v)#len(findStops(self.v))
98 |
99 |
100 |
101 |
102 | #changed the implementation of this method, which brought the metrics up a bit
103 | #I used km/h, but we can easily change that
104 | def findSpeed_Hist(self, trip):
105 |
106 | speedList = []
107 | speedList.append(0)
108 | accList = []
109 | accList.append(0)
110 |
111 | for i in range (1,len(self.tripPath)):
112 |
113 | speedList.append (round(3.6*distance(self.tripPath[i-1][0], self.tripPath[i-1][1], self.tripPath[i][0], self.tripPath[i][1])))
114 | accList.append(speedList[i]-speedList[i-1])
115 |
116 | mypmf = Pmf.MakePmfFromList(speedList)
117 | self.speed_hist = []
118 | MAX = 220
119 | vals, freqs = mypmf.Render()
120 | val = 0
121 | for i in range(MAX):
122 |
123 | try:
124 | val = freqs[vals.index(i)]
125 | except ValueError:
126 | val = 0
127 |
128 | self.speed_hist.append (val)
129 |
130 | mypmf = Pmf.MakePmfFromList(accList)
131 | self.acc_hist = []
132 | MAX = 50
133 | vals, freqs = mypmf.Render()
134 | val = 0
135 | for i in range(MAX):
136 |
137 | try:
138 | val = freqs[vals.index(i)]
139 | except ValueError:
140 | val = 0
141 |
142 | self.acc_hist.append (val)
143 | #print self.speed_hist
144 |
145 | #mypmf.Items()
146 | #sys.exit()
147 |
148 |
149 | vel = np.diff(trip, axis = 0) #x1-x0 and y1-y0
150 | self.v = (vel[:,0]**2 + vel[:,1]**2)**0.5 #take distance
151 | self.tripDist = np.sum(self.v)
152 | """
153 | self.acc = np.diff(self.v, axis = 0)
154 | self.speed_hist = [np.percentile(self.v, i*5) for i in range(1,20)]
155 | self.acc_hist = [np.percentile(self.acc, i*10) for i in range(1,10)]
156 | """
157 |
158 |
159 | def printFeatures(self):
160 | features = ""
161 | features += printHist_Feature(self.speed_hist)+","
162 | features += str(self.tripDist)
163 |
164 | return features + "\n"
165 |
166 | def plotTrip(self):
167 | #first figure is the xy path
168 | pyplot.figure(1)
169 | #pyplot.subplot(211)
170 | startPoint = (self.tripPath[0])
171 | endPoint = (self.tripPath[self.tripPath.shape[0]-1])
172 | pyplot.plot(self.tripPath[:,0], self.tripPath[:,1], 'rx', startPoint[0], startPoint[1], 'gD', endPoint[0], endPoint[1], 'bD')
173 | pyplot.plot(self.rdp[:,0], self.rdp[:,1], 'bo')
174 | for st,end in self.stops:
175 | pyplot.plot(self.tripPath[st][0], self.tripPath[st][1], 'rs')
176 | #second figure is velocity over time
177 | """pyplot.subplot(212)
178 | pyplot.plot(self.v, 'g-')
179 | for st,end in self.stops:
180 | pyplot.plot(st,self.v[st], 'bs', end, self.v[st], 'rs')
181 | #print end - st
182 | pyplot.plot(self.acc, 'b-')"""
183 | pyplot.show()
184 |
185 |
186 | trip_test = Trip(sys.argv[1])
187 | trip_test.plotTrip()
188 |
189 | print trip_test.rdp
190 |
--------------------------------------------------------------------------------
/atomic-taro/lib/segment-objects/commit-line.coffee:
--------------------------------------------------------------------------------
1 | {Point, Range, TextBuffer} = require 'atom'
2 |
3 |
4 |
5 | module.exports =
6 | class CommitLine
7 |
8 | constructor: (@variantView, @variantModel, width) ->
9 | @initialized = false
10 | @showing = false
11 | @addCommitLine(width) # initialize commit line
12 |
13 | getVariantView: ->
14 | @variantView
15 |
16 | getModel: ->
17 | @variantModel
18 |
19 | addCommitLine: (width) ->
20 | @commitLineElem = document.createElement('div')
21 | @commitLineElem.classList.add('atomic-taro_commit-element')
22 | $(@commitLineElem).width(width)
23 |
24 | @commitTraveler = document.createElement('div')
25 | @commitTraveler.classList.add('atomic-taro_commit-traveler')
26 | paddT = $(@commitTraveler).innerWidth() - $(@commitTraveler).width()
27 | $(@commitTraveler).width($(@commitLineElem).width() - paddT)
28 |
29 | @commitSlider = document.createElement('div')
30 | @commitSlider.classList.add('commit-slider')
31 | @tickMarkers = document.createElement('div')
32 | @commitSlider.appendChild(@tickMarkers)
33 | @commitTraveler.appendChild(@commitSlider)
34 | @noCommits = document.createElement('div')
35 | @commitTraveler.appendChild(@noCommits)
36 | @nowBracket = document.createElement('div')
37 | @nowBracket.classList.add('atomic-taro_commit-nowBracket')
38 | $(@nowBracket).data("commitLine", @)
39 | @commitTraveler.appendChild(@nowBracket)
40 | $(@nowBracket).hide()
41 |
42 | # @nowMarker = document.createElement('div')
43 | # @nowMarker.classList.add('atomic-taro_commit-nowMarker')
44 | # $(@nowMarker).html("now")
45 | # $(@nowMarker).hide()
46 | @commitLineElem.appendChild(@commitTraveler)
47 | #@commitLineElem.appendChild(@nowMarker)
48 | $(@commitLineElem).hide()
49 | @showing = false
50 |
51 |
52 |
53 | getElement: ->
54 | @commitLineElem
55 |
56 |
57 | addClass: ->
58 | $(@commitTraveler).addClass('historical')
59 |
60 | removeClass: ->
61 | $(@commitTraveler).removeClass('historical')
62 |
63 |
64 |
65 | redraw: ->
66 | #console.log "REDRAW!!! "
67 | if @showing == true
68 | #console.log "222 REDRAW 222 !!!"
69 | @drawTimeline()
70 |
71 |
72 | '''
73 | Show the commit timeline to view and travel between commits.
74 | '''
75 | toggleCommitTimeline: ->
76 | #console.log "TOGGLE SHOW COMMIT LINE ", @showing
77 | if @showing == true
78 | #$(@commitLineElem).hide()
79 | $(@commitLineElem).slideUp('fast')
80 | @showing = false
81 | return false
82 | else
83 | @drawTimeline()
84 | @showing = true
85 | return true
86 |
87 |
88 | drawTimeline: ->
89 | @initialized = true
90 | commitNum = @getModel().getCurrentVersion().getNumberOfCommits()
91 | currentCommit = @getModel().getCurrentVersion().getCurrentCommit()
92 | if currentCommit == -1 # no commit
93 | currentCommit = commitNum
94 | #console.log "commit line num ", @getModel().getCurrentVersion(), " num ", commitNum
95 |
96 | if commitNum > 0
97 | $(@commitSlider).show()
98 | $(@nowBracket).show()
99 | $(@commitTraveler).removeClass("textOnly")
100 | $(@noCommits).html("")
101 | if $(@tickMarkers).children('.atomic-taro_commit-ticks').length != commitNum
102 | $(@commitSlider).slider({
103 | max: commitNum,
104 | min: 0,
105 | value: currentCommit,
106 | slide: (event, ui) =>
107 | #console.log @variantView.getTitle(), " SLIDER ", ui.value
108 | if ui.manual != true
109 | if ui.value == @getModel().getCurrentVersion().getNumberOfCommits()
110 | @getModel().travelToCommit({commitID: @getModel().PRESENT, branchID: @getModel().getCurrentVersion().id})
111 | @getVariantView().removeTravelStyle()
112 | @getVariantView().getTravelAgent().resetEnvToPresent()
113 | else
114 | @getModel().travelToCommit({commitID: ui.value, branchID: @getModel().getCurrentVersion().id})
115 | commit = @getModel().getCurrentVersion().getCurrentCommitObject()
116 | @getVariantView().getTravelAgent().setEnvToCommit(@getModel(), commit)
117 | @getVariantView().travelStyle(commit)
118 |
119 | })
120 | #console.log "commit num: "+commitNum+" ticks: "+$(@commitSlider).children('.atomic-taro_commit-ticks').length
121 | #console.log "WIDTH "+$(@commitTraveler).width()
122 | # Add ticks to label the timeline
123 | @addTickMarks(commitNum)
124 | else
125 | $(@commitTraveler).addClass("textOnly")
126 | $(@noCommits).html("No commits to show yet!")
127 | $(@commitSlider).hide()
128 | $(@nowBracket).hide()
129 | $(@commitLineElem).show()
130 | @showing = true
131 | #$(@commitLineElem).slideDown('fast')
132 |
133 |
134 |
135 | slideToPresent: ->
136 | # don't bother if timeline hasn't been constructed
137 | if @initialized
138 | max = @getModel().getCurrentVersion().getNumberOfCommits()
139 | $(@commitSlider).slider('option', 'value',max)
140 | $(@commitSlider).slider('option','slide')
141 | .call($(@commitSlider),null,{ manual: true, handle: $('.ui-slider-handle', $(@commitSlider)), value: max })
142 |
143 |
144 | manualSet: (commitNum) ->
145 | # don't bother if timeline hasn't been constructed
146 | if @initialized
147 | #console.log "MANUAL SET CALLED ", commitNum
148 | $(@commitSlider).slider('option', 'value',commitNum)
149 | $(@commitSlider).slider('option','slide')
150 | .call($(@commitSlider),null,{ manual: true, handle: $('.ui-slider-handle', $(@commitSlider)), value: commitNum })
151 |
152 |
153 |
154 | addTickMarks: (commitNum) ->
155 | $(@tickMarkers).html("")
156 | offset = 0
157 | for i in [0 .. commitNum - 1]
158 | offset -= 4
159 | label = document.createElement('div')
160 | label.classList.add('atomic-taro_commit-ticks')
161 | $(label).css('left',(i/commitNum*$(@commitTraveler).width() + offset))
162 | $(@tickMarkers).append(label)
163 |
--------------------------------------------------------------------------------
/atomic-taro/lib/segment-objects/diff-panels.coffee:
--------------------------------------------------------------------------------
1 | {Point, Range, TextBuffer} = require 'atom'
2 | {CompositeDisposable} = require 'atom'
3 | JsDiff = require 'diff'
4 |
5 |
6 | module.exports =
7 | class DiffPanels
8 |
9 | constructor: (@variantView, @variantModel, width) ->
10 | @addDiffPanels(width) # initialize commit line
11 | @highlightMarkers = []
12 | @diffVers = []
13 |
14 |
15 | isShowing: ->
16 | $(@diffPanelElem).is(":visible")
17 |
18 |
19 | isActive: ->
20 | @currentBuffer != null
21 |
22 |
23 | getV1: ->
24 | @diffVers[0]
25 |
26 |
27 | close: ->
28 | if $(@diffPanelElem).is(":visible")
29 | for v in @diffVers
30 | v.setMultiSelected(false)
31 |
32 | $(@diffPanelElem).hide()
33 |
34 | for marker in @highlightMarkers
35 | marker.destroy()
36 | @rightEditor.getBuffer().setText("")
37 | @leftEditor.getBuffer().setText("")
38 |
39 |
40 | getVariantView: ->
41 | @variantView
42 |
43 |
44 | getModel: ->
45 | @variantModel
46 |
47 |
48 | getElement: ->
49 | @diffPanelElem
50 |
51 |
52 | addClass: ->
53 | $(@diffPanelElem).addClass('historical')
54 |
55 |
56 | removeClass: ->
57 | $(@diffPanelElem).removeClass('historical')
58 |
59 |
60 | updateWidth: (width) ->
61 | $(@diffPanelElem).width(width)
62 | borderWidth = $(@leftPanel).outerWidth() - $(@leftPanel).innerWidth()
63 | $(@leftPanel).width(width/2 - borderWidth)
64 | $(@rightPanel).width(width/2 - borderWidth)
65 |
66 |
67 |
68 | addDiffPanels: (width) ->
69 | @diffPanelElem = document.createElement('table')
70 | @diffPanelElem.classList.add('atomic-taro_diff-panel')
71 | $(@diffPanelElem).width(width)
72 |
73 | row = document.createElement('tr')
74 |
75 | @leftPanel = document.createElement('td')
76 | @leftPanel.classList.add('atomic-taro_diff-side-panel')
77 | @leftLabel = document.createElement('th')
78 | @leftLabel.classList.add('atomic-taro_diff-label')
79 | $(@leftLabel).html("Left")
80 | @leftPanel.appendChild(@leftLabel)
81 |
82 | sourceCode = ""
83 | @leftEditor = atom.workspace.buildTextEditor(buffer: new TextBuffer({text: sourceCode}), grammar: atom.grammars.selectGrammar("file.py"))
84 | atom.textEditors.add(@leftEditor)
85 | @leftPanel.appendChild(@leftEditor.getElement())
86 |
87 | @rightPanel = document.createElement('td')
88 | @rightPanel.classList.add('atomic-taro_diff-side-panel')
89 | @rightLabel = document.createElement('th')
90 | @rightLabel.classList.add('atomic-taro_diff-label')
91 | $(@rightLabel).html("Right")
92 | @rightPanel.appendChild(@rightLabel)
93 |
94 | sourceCode = ""
95 | @rightEditor = atom.workspace.buildTextEditor(buffer: new TextBuffer({text: sourceCode}), grammar: atom.grammars.selectGrammar("file.py"))
96 | atom.textEditors.add(@rightEditor)
97 | @rightPanel.appendChild(@rightEditor.getElement())
98 |
99 | row.appendChild(@leftPanel)
100 | row.appendChild(@rightPanel)
101 | @diffPanelElem.appendChild(row)
102 | $(@diffPanelElem).hide()
103 |
104 |
105 |
106 | diffVersions: (v1, v2) ->
107 | @diffVers.push v1
108 | @diffVers.push v2
109 | v1.setMultiSelected(true)
110 | v2.setMultiSelected(true)
111 | $(@diffPanelElem).show()
112 | #console.log "diffing "
113 | #console.log v1
114 | #console.log v2
115 | $(@rightLabel).html(v1.getTitle())
116 | $(@leftLabel).html(v2.getTitle())
117 |
118 | v2.close()
119 |
120 | @setText(v1, @rightEditor, @rightEditor.getBuffer())
121 | @setText(v2, @leftEditor, @leftEditor.getBuffer())
122 | textA = @rightEditor.getBuffer().getText()
123 | textB = @leftEditor.getBuffer().getText()
124 | @getModel().hideInsides()
125 | @getModel().clearTextInRange()
126 | @decorateDiffLines(textA, textB)
127 |
128 |
129 | setText: (v, editor, buffer) ->
130 | textList = v.getText()
131 | #console.log v.getCurrentState()
132 | for item in textList
133 | if not item.branchID?
134 | buffer.append(item.text)
135 | else
136 | range = buffer.append(item.text[0].text)
137 | # marker = buffer.markRange(range)
138 | # headerElement = document.createElement("div")
139 | # headerElement.classList.add('atomic-taro_diff-header-box')
140 | # $(headerElement).html("nested")
141 | # hRange = [range.start, new Point(range.end.row - 1, range.end.column)]
142 | # hm = buffer.markRange(hRange, reversed: true)
143 | # hdec = editor.decorateMarker(hm, {type: 'block', position: 'before', item: headerElement})
144 | # @highlightMarkers.push hm
145 |
146 |
147 | decorateDiffLines: (textA, textB) ->
148 | diff = JsDiff.diffLines(textA, textB)
149 | range = @getModel().getVariantRange()
150 | startR = new Point(0,0)
151 | startL = new Point(0,0)
152 |
153 | #console.log diff
154 |
155 | for line in diff
156 | text = line.value
157 | lines = text.split("\n")
158 | #console.log "Lines"
159 | #console.log lines
160 | rows = lines.length - 1
161 | cols = lines[lines.length - 1].length
162 | #console.log text + "has r " +rows + " c " + cols
163 |
164 | if line.removed
165 | # then text is in both versions
166 | #console.log "marking remove"
167 | end = new Point(startR.row + rows, startR.column + cols)
168 | #console.log "start: " + startR + ", end: " + end
169 | mark = @rightEditor.markBufferRange([startR, end])
170 | dec = @rightEditor.decorateMarker(mark, type: 'highlight', class: 'highlight-red')
171 | @highlightMarkers.push mark
172 | startR = new Point(end.row, end.col)
173 |
174 | else if line.added
175 | # then text is in both versions
176 | #console.log "marking add"
177 | end = new Point(startL.row + rows, startL.column + cols)
178 | #console.log "start: " + startL + ", end: " + end
179 | mark = @leftEditor.markBufferRange([startL, end])
180 | dec = @leftEditor.decorateMarker(mark, type: 'highlight', class: 'highlight-green')
181 | @highlightMarkers.push mark
182 | startL = new Point(end.row, end.col)
183 |
184 | else
185 | endL = new Point(startL.row + rows, startL.column + cols)
186 | endR = new Point(startR.row + rows, startR.column + cols)
187 | startL = new Point(endL.row, endL.col)
188 | startR = new Point(endR.row, endR.col)
189 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/Driver.py:
--------------------------------------------------------------------------------
1 | #This program creates a driver object, and contains methods for creating datasets
2 | #to be used as training/testing data and executing a classification task.
3 |
4 | import matplotlib.pyplot as pyplot
5 | import numpy as np
6 | import sys
7 | import math
8 | from Trip import Trip
9 | import os
10 | import random
11 | from sklearn.metrics import roc_auc_score
12 | from sklearn.ensemble import RandomForestClassifier
13 | from sklearn.svm import SVC
14 | from sklearn.externals import joblib
15 | from sklearn.svm import SVC
16 | import random
17 |
18 |
19 | num_selfTrips = 160
20 | num_testTrips = 40
21 | num_NOTselfTrips = 160
22 | size = num_testTrips+num_selfTrips
23 | cv = 5 #number of cross-validation trials
24 |
25 |
26 | class Driver(object):
27 |
28 | def __init__(self, driverName):
29 | self.name = driverName
30 |
31 |
32 | #takes arrays corresponding to the predicted and true labels of the dataset
33 | #computes and returns the precision, recall, area under the receiver operating
34 | #characteristic curve (auc), and accuracy
35 | def calculateResults(self,predicted, true):
36 | tp = 0
37 | tn = 0
38 | fp = 0
39 | fn = 0
40 |
41 | for i in range (len(true)):
42 | if (true[i] == 1 and round(predicted[i]) == 1):
43 | tp+=1
44 | if (true[i] == 1 and round(predicted[i]) == 0):
45 | fn+=1
46 | if (true[i] == 0 and round(predicted[i]) == 1):
47 | fp+=1
48 | if (true[i] == 0 and round(predicted[i]) == 0):
49 | tn+=1
50 |
51 | #print tp, tn, fp, fn
52 | prec = float(tp)/(tp+fp)
53 | recall = float(tp)/(tp+fn)
54 | acc = float (tp+tn)/(tp+tn+fp+fn)
55 | #print 'Precision: ', prec
56 | #print 'Recall: ', recall
57 | auc = roc_auc_score(true, predicted)
58 | #auc = 0
59 | return (prec, recall, auc, acc)
60 |
61 |
62 | def splitData(self, data, labels, k):
63 |
64 | traintrips = []
65 | target = []
66 | testtrips = []
67 | testtarget =[]
68 | inc = size/cv
69 | #print len (data)
70 | #print size*2
71 | for i in range (size*2):
72 |
73 | if (i>=(k*inc) and i<(k+1)*inc) or (i>=((k+cv)*inc) and i<((k+(cv+1))*inc)):
74 | testtrips.append(data[i])
75 | testtarget.append(labels[i])
76 | else:
77 | traintrips.append(data[i])
78 | target.append(labels[i])
79 |
80 |
81 | return traintrips, target, testtrips, testtarget
82 |
83 |
84 | #reads in two files containing the dataset and the data labels and executes
85 | #5-fold cross-validation returns the results of the 5 trials in a list
86 | def classify(self):
87 |
88 | #get training trips for this driver
89 | f = open("driver_stats/"+str(self.name)+"_training.csv")
90 | #f.readline() #skip header labels
91 | #traintrips
92 | dataset = np.genfromtxt(f, delimiter=',')
93 | f.close()
94 |
95 | #get list of labels for the trips in traintrips
96 | g = open("driver_stats/trainingLabels.csv")
97 | #target
98 | labels = np.genfromtxt(g, delimiter=',')
99 | g.close()
100 |
101 |
102 |
103 | inc = size/cv
104 | res = []
105 | for k in range(cv):
106 | #divide data
107 | traintrips, target, testtrips, testtarget = self.splitData(dataset, labels, k)
108 |
109 | #set up classifier
110 | clf = RandomForestClassifier(n_estimators=500)
111 | clf.fit(traintrips, target)
112 | predLabels = clf.predict (testtrips)
113 | #print predLabels
114 | #print testtarget
115 |
116 | #save results
117 | res.append(self.calculateResults(predLabels, testtarget))
118 | #print self.calculateResults(predLabels, testtarget)
119 | return res
120 |
121 | #takes a number of trips to be sampled, number of drivers to be sampled from,
122 | #and binary string
123 | #specifying features sample random trips from a given number of random drivers
124 | #returns a list of sample trips
125 | def getRandomDriverTrips(self, numtrips, numNotDrivers, feat):
126 |
127 | #get list of drivers and shuffle
128 | notDrivers = os.listdir("../drivers/")
129 | copy = notDrivers[1:]
130 | random.shuffle(copy)
131 | notDrivers[1:] = copy
132 |
133 | #process number of 'other' drivers
134 | if numNotDrivers == 0 or numNotDrivers >= len(notDrivers):
135 | numNotDrivers = len(notDrivers)-1
136 |
137 | #if we are comparing to only one driver and that driver is the same as
138 | #the original driver
139 | if numNotDrivers == 1:
140 | while notDrivers[1] == self.name:
141 | copy = notDrivers[1:]
142 | random.shuffle(copy)
143 | notDrivers[1:] = copy
144 |
145 | #sample trips and output desired features
146 | tripList = []
147 | for i in range(numtrips):
148 | dnum = notDrivers[random.randint(1, numNotDrivers)] #sample a random driver
149 | #print self.name + " " + dnum
150 | while dnum == self.name: #don't sample from self
151 | dnum = notDrivers[random.randint(1, numNotDrivers)]
152 | tnum = random.randint(1,200)#sample a random trip
153 | t = Trip("../drivers/"+str(dnum)+"/"+str(tnum)+".csv", feat)
154 | tripList.append(t.printFeatures())
155 |
156 | return tripList
157 |
158 | #creates a CSV file containing the full dataset
159 | def writeCSV(self, order, numNotDrivers, feat):
160 | g = open ("driver_stats/"+str(self.name)+"_training.csv", "w")
161 |
162 | #first trips from this driver
163 | for i in range (0,num_selfTrips+num_testTrips):
164 | #print i
165 | t = Trip("../drivers/"+str(self.name)+"/"+str(order[i])+".csv", feat)
166 | g.write(t.printFeatures())
167 |
168 | #trips from other drivers
169 | tripList = self.getRandomDriverTrips(num_NOTselfTrips+num_testTrips, numNotDrivers, feat)
170 | for other in tripList:
171 | g.write(other)
172 | g.close()
173 |
174 | #creates a csv file containing the labels: 1-trip was made by driver in question,
175 | #0-trip was made by one of the 'other' drivers
176 | def writeCSV_labels(self):
177 | #file containing training labels, same for any driver
178 | h = open ("driver_stats/"+"trainingLabels.csv", "w")
179 | for i in range(num_selfTrips+num_testTrips):
180 | h.write(str(1)+"\n")
181 | for i in range(num_NOTselfTrips+num_testTrips):
182 | h.write(str(0)+"\n")
183 | h.close()
184 |
185 | #creates all necessary datasets for a given classification task
186 | def createDataSets(self, numNotDrivers, feat):
187 | order = [i for i in range(1, 201)]
188 | random.shuffle(order)
189 | self.writeCSV(order, numNotDrivers, feat)
190 | self.writeCSV_labels()
191 |
192 |
193 |
194 |
195 | d1 = Driver(sys.argv[1])
196 | d1.createDataSets()
197 | print d1.classify()
198 |
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/lib/index.js:
--------------------------------------------------------------------------------
1 | /*istanbul ignore start*/'use strict';
2 |
3 | exports.__esModule = true;
4 | exports.canonicalize = exports.convertChangesToXML = exports.convertChangesToDMP = exports.parsePatch = exports.applyPatches = exports.applyPatch = exports.createPatch = exports.createTwoFilesPatch = exports.structuredPatch = exports.diffJson = exports.diffCss = exports.diffSentences = exports.diffTrimmedLines = exports.diffLines = exports.diffWordsWithSpace = exports.diffWords = exports.diffChars = exports.Diff = undefined;
5 | /*istanbul ignore end*/
6 | var /*istanbul ignore start*/_base = require('./diff/base') /*istanbul ignore end*/;
7 |
8 | /*istanbul ignore start*/
9 | var _base2 = _interopRequireDefault(_base);
10 |
11 | /*istanbul ignore end*/
12 | var /*istanbul ignore start*/_character = require('./diff/character') /*istanbul ignore end*/;
13 |
14 | var /*istanbul ignore start*/_word = require('./diff/word') /*istanbul ignore end*/;
15 |
16 | var /*istanbul ignore start*/_line = require('./diff/line') /*istanbul ignore end*/;
17 |
18 | var /*istanbul ignore start*/_sentence = require('./diff/sentence') /*istanbul ignore end*/;
19 |
20 | var /*istanbul ignore start*/_css = require('./diff/css') /*istanbul ignore end*/;
21 |
22 | var /*istanbul ignore start*/_json = require('./diff/json') /*istanbul ignore end*/;
23 |
24 | var /*istanbul ignore start*/_apply = require('./patch/apply') /*istanbul ignore end*/;
25 |
26 | var /*istanbul ignore start*/_parse = require('./patch/parse') /*istanbul ignore end*/;
27 |
28 | var /*istanbul ignore start*/_create = require('./patch/create') /*istanbul ignore end*/;
29 |
30 | var /*istanbul ignore start*/_dmp = require('./convert/dmp') /*istanbul ignore end*/;
31 |
32 | var /*istanbul ignore start*/_xml = require('./convert/xml') /*istanbul ignore end*/;
33 |
34 | /*istanbul ignore start*/
35 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
36 |
37 | /* See LICENSE file for terms of use */
38 |
39 | /*
40 | * Text diff implementation.
41 | *
42 | * This library supports the following APIS:
43 | * JsDiff.diffChars: Character by character diff
44 | * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace
45 | * JsDiff.diffLines: Line based diff
46 | *
47 | * JsDiff.diffCss: Diff targeted at CSS content
48 | *
49 | * These methods are based on the implementation proposed in
50 | * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986).
51 | * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927
52 | */
53 | exports. /*istanbul ignore end*/Diff = _base2.default;
54 | /*istanbul ignore start*/exports. /*istanbul ignore end*/diffChars = _character.diffChars;
55 | /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWords = _word.diffWords;
56 | /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = _word.diffWordsWithSpace;
57 | /*istanbul ignore start*/exports. /*istanbul ignore end*/diffLines = _line.diffLines;
58 | /*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = _line.diffTrimmedLines;
59 | /*istanbul ignore start*/exports. /*istanbul ignore end*/diffSentences = _sentence.diffSentences;
60 | /*istanbul ignore start*/exports. /*istanbul ignore end*/diffCss = _css.diffCss;
61 | /*istanbul ignore start*/exports. /*istanbul ignore end*/diffJson = _json.diffJson;
62 | /*istanbul ignore start*/exports. /*istanbul ignore end*/structuredPatch = _create.structuredPatch;
63 | /*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = _create.createTwoFilesPatch;
64 | /*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = _create.createPatch;
65 | /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatch = _apply.applyPatch;
66 | /*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = _apply.applyPatches;
67 | /*istanbul ignore start*/exports. /*istanbul ignore end*/parsePatch = _parse.parsePatch;
68 | /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToDMP = _dmp.convertChangesToDMP;
69 | /*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToXML = _xml.convertChangesToXML;
70 | /*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = _json.canonicalize;
71 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQWdCQTs7Ozs7O0FBQ0E7O0FBQ0E7O0FBQ0E7O0FBQ0E7O0FBRUE7O0FBQ0E7O0FBRUE7O0FBQ0E7O0FBQ0E7O0FBRUE7O0FBQ0E7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztnQ0FHRTt5REFFQTt5REFDQTt5REFDQTt5REFDQTt5REFDQTt5REFDQTt5REFFQTt5REFDQTt5REFFQTt5REFDQTt5REFDQTt5REFDQTt5REFDQTt5REFDQTt5REFDQTt5REFDQTt5REFDQSIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qIFNlZSBMSUNFTlNFIGZpbGUgZm9yIHRlcm1zIG9mIHVzZSAqL1xuXG4vKlxuICogVGV4dCBkaWZmIGltcGxlbWVudGF0aW9uLlxuICpcbiAqIFRoaXMgbGlicmFyeSBzdXBwb3J0cyB0aGUgZm9sbG93aW5nIEFQSVM6XG4gKiBKc0RpZmYuZGlmZkNoYXJzOiBDaGFyYWN0ZXIgYnkgY2hhcmFjdGVyIGRpZmZcbiAqIEpzRGlmZi5kaWZmV29yZHM6IFdvcmQgKGFzIGRlZmluZWQgYnkgXFxiIHJlZ2V4KSBkaWZmIHdoaWNoIGlnbm9yZXMgd2hpdGVzcGFjZVxuICogSnNEaWZmLmRpZmZMaW5lczogTGluZSBiYXNlZCBkaWZmXG4gKlxuICogSnNEaWZmLmRpZmZDc3M6IERpZmYgdGFyZ2V0ZWQgYXQgQ1NTIGNvbnRlbnRcbiAqXG4gKiBUaGVzZSBtZXRob2RzIGFyZSBiYXNlZCBvbiB0aGUgaW1wbGVtZW50YXRpb24gcHJvcG9zZWQgaW5cbiAqIFwiQW4gTyhORCkgRGlmZmVyZW5jZSBBbGdvcml0aG0gYW5kIGl0cyBWYXJpYXRpb25zXCIgKE15ZXJzLCAxOTg2KS5cbiAqIGh0dHA6Ly9jaXRlc2VlcnguaXN0LnBzdS5lZHUvdmlld2RvYy9zdW1tYXJ5P2RvaT0xMC4xLjEuNC42OTI3XG4gKi9cbmltcG9ydCBEaWZmIGZyb20gJy4vZGlmZi9iYXNlJztcbmltcG9ydCB7ZGlmZkNoYXJzfSBmcm9tICcuL2RpZmYvY2hhcmFjdGVyJztcbmltcG9ydCB7ZGlmZldvcmRzLCBkaWZmV29yZHNXaXRoU3BhY2V9IGZyb20gJy4vZGlmZi93b3JkJztcbmltcG9ydCB7ZGlmZkxpbmVzLCBkaWZmVHJpbW1lZExpbmVzfSBmcm9tICcuL2RpZmYvbGluZSc7XG5pbXBvcnQge2RpZmZTZW50ZW5jZXN9IGZyb20gJy4vZGlmZi9zZW50ZW5jZSc7XG5cbmltcG9ydCB7ZGlmZkNzc30gZnJvbSAnLi9kaWZmL2Nzcyc7XG5pbXBvcnQge2RpZmZKc29uLCBjYW5vbmljYWxpemV9IGZyb20gJy4vZGlmZi9qc29uJztcblxuaW1wb3J0IHthcHBseVBhdGNoLCBhcHBseVBhdGNoZXN9IGZyb20gJy4vcGF0Y2gvYXBwbHknO1xuaW1wb3J0IHtwYXJzZVBhdGNofSBmcm9tICcuL3BhdGNoL3BhcnNlJztcbmltcG9ydCB7c3RydWN0dXJlZFBhdGNoLCBjcmVhdGVUd29GaWxlc1BhdGNoLCBjcmVhdGVQYXRjaH0gZnJvbSAnLi9wYXRjaC9jcmVhdGUnO1xuXG5pbXBvcnQge2NvbnZlcnRDaGFuZ2VzVG9ETVB9IGZyb20gJy4vY29udmVydC9kbXAnO1xuaW1wb3J0IHtjb252ZXJ0Q2hhbmdlc1RvWE1MfSBmcm9tICcuL2NvbnZlcnQveG1sJztcblxuZXhwb3J0IHtcbiAgRGlmZixcblxuICBkaWZmQ2hhcnMsXG4gIGRpZmZXb3JkcyxcbiAgZGlmZldvcmRzV2l0aFNwYWNlLFxuICBkaWZmTGluZXMsXG4gIGRpZmZUcmltbWVkTGluZXMsXG4gIGRpZmZTZW50ZW5jZXMsXG5cbiAgZGlmZkNzcyxcbiAgZGlmZkpzb24sXG5cbiAgc3RydWN0dXJlZFBhdGNoLFxuICBjcmVhdGVUd29GaWxlc1BhdGNoLFxuICBjcmVhdGVQYXRjaCxcbiAgYXBwbHlQYXRjaCxcbiAgYXBwbHlQYXRjaGVzLFxuICBwYXJzZVBhdGNoLFxuICBjb252ZXJ0Q2hhbmdlc1RvRE1QLFxuICBjb252ZXJ0Q2hhbmdlc1RvWE1MLFxuICBjYW5vbmljYWxpemVcbn07XG4iXX0=
72 |
--------------------------------------------------------------------------------
/atomic-taro/Z-DrivingTest/CS349-roads-master/Driver.py.annot.taro:
--------------------------------------------------------------------------------
1 | #This program creates a driver object, and contains methods for creating datasets
2 | #to be used as training/testing data and executing a classification task.
3 |
4 | import matplotlib.pyplot as pyplot
5 | import numpy as np
6 | import sys
7 | import math
8 | from Trip import Trip
9 | import os
10 | import random
11 | from sklearn.metrics import roc_auc_score
12 | from sklearn.ensemble import RandomForestClassifier
13 | from sklearn.svm import SVC
14 | from sklearn.externals import joblib
15 | from sklearn.svm import SVC
16 | import random
17 |
18 |
19 | #%%^%%v0
20 | num_selfTrips = 160
21 | num_testTrips = 40
22 | num_NOTselfTrips = 160
23 | size = num_testTrips+num_selfTrips
24 | cv = 5 #number of cross-validation trials
25 | #^^%^^
26 |
27 |
28 | class Driver(object):
29 |
30 | def __init__(self, driverName):
31 | self.name = driverName
32 |
33 |
34 | #takes arrays corresponding to the predicted and true labels of the dataset
35 | #computes and returns the precision, recall, area under the receiver operating
36 | #characteristic curve (auc), and accuracy
37 | def calculateResults(self,predicted, true):
38 | tp = 0
39 | tn = 0
40 | fp = 0
41 | fn = 0
42 |
43 | for i in range (len(true)):
44 | if (true[i] == 1 and round(predicted[i]) == 1):
45 | tp+=1
46 | if (true[i] == 1 and round(predicted[i]) == 0):
47 | fn+=1
48 | if (true[i] == 0 and round(predicted[i]) == 1):
49 | fp+=1
50 | if (true[i] == 0 and round(predicted[i]) == 0):
51 | tn+=1
52 |
53 | #print tp, tn, fp, fn
54 | prec = float(tp)/(tp+fp)
55 | recall = float(tp)/(tp+fn)
56 | acc = float (tp+tn)/(tp+tn+fp+fn)
57 | #print 'Precision: ', prec
58 | #print 'Recall: ', recall
59 | auc = roc_auc_score(true, predicted)
60 | #auc = 0
61 | return (prec, recall, auc, acc)
62 |
63 | #takes two arrays corresponding to the whole dataset and the corresponding labels and a number k,
64 | #corresponding to the current trial number out of the series of 5 cross-validation trials
65 | #returns four lists corresponding to the training data, training labels, testing data, and testing
66 | #labels respectively
67 | def splitData(self, data, labels, k):
68 |
69 | traintrips = []
70 | target = []
71 | testtrips = []
72 | testtarget =[]
73 | inc = size/cv
74 | #print len (data)
75 | #print size*2
76 | for i in range (size*2):
77 |
78 | if (i>=(k*inc) and i<(k+1)*inc) or (i>=((k+cv)*inc) and i<((k+(cv+1))*inc)):
79 | testtrips.append(data[i])
80 | testtarget.append(labels[i])
81 | else:
82 | traintrips.append(data[i])
83 | target.append(labels[i])
84 |
85 |
86 | return traintrips, target, testtrips, testtarget
87 |
88 |
89 | #reads in two files containing the dataset and the data labels and executes
90 | #5-fold cross-validation returns the results of the 5 trials in a list
91 | def classify(self):
92 |
93 | #get training trips for this driver
94 | f = open("driver_stats/"+str(self.name)+"_training.csv")
95 | #f.readline() #skip header labels
96 | #traintrips
97 | dataset = np.genfromtxt(f, delimiter=',')
98 | f.close()
99 |
100 | #get list of labels for the trips in traintrips
101 | g = open("driver_stats/trainingLabels.csv")
102 | #target
103 | labels = np.genfromtxt(g, delimiter=',')
104 | g.close()
105 |
106 |
107 |
108 | inc = size/cv
109 | res = []
110 | for k in range(cv):
111 | #divide data
112 | traintrips, target, testtrips, testtarget = self.splitData(dataset, labels, k)
113 |
114 | #set up classifier
115 | clf = RandomForestClassifier(n_estimators=500)
116 | clf.fit(traintrips, target)
117 | predLabels = clf.predict (testtrips)
118 | #print predLabels
119 | #print testtarget
120 |
121 | #save results
122 | res.append(self.calculateResults(predLabels, testtarget))
123 | #print self.calculateResults(predLabels, testtarget)
124 | return res
125 |
126 | #takes a number of trips to be sampled, number of drivers to be sampled from, and binary string
127 | #specifying features sample random trips from a given number of random drivers
128 | #returns a list of sample trips
129 | def getRandomDriverTrips(self, numtrips, numNotDrivers, feat):
130 |
131 | #get list of drivers and shuffle
132 | notDrivers = os.listdir("../drivers/")
133 | copy = notDrivers[1:]
134 | random.shuffle(copy)
135 | notDrivers[1:] = copy
136 |
137 | #process number of 'other' drivers
138 | if numNotDrivers == 0 or numNotDrivers >= len(notDrivers):
139 | numNotDrivers = len(notDrivers)-1
140 |
141 | #if we are comparing to only one driver and that driver is the same as the original driver
142 | if numNotDrivers == 1:
143 | while notDrivers[1] == self.name:
144 | copy = notDrivers[1:]
145 | random.shuffle(copy)
146 | notDrivers[1:] = copy
147 |
148 | #sample trips and output desired features
149 | tripList = []
150 | for i in range(numtrips):
151 | dnum = notDrivers[random.randint(1, numNotDrivers)] #sample a random driver
152 | #print self.name + " " + dnum
153 | while dnum == self.name: #don't sample from self
154 | dnum = notDrivers[random.randint(1, numNotDrivers)]
155 | tnum = random.randint(1,200)#sample a random trip
156 | t = Trip("../drivers/"+str(dnum)+"/"+str(tnum)+".csv", feat)
157 | tripList.append(t.printFeatures())
158 |
159 | return tripList
160 |
161 | #creates a CSV file containing the full dataset
162 | def writeCSV(self, order, numNotDrivers, feat):
163 | g = open ("driver_stats/"+str(self.name)+"_training.csv", "w")
164 |
165 | #first trips from this driver
166 | for i in range (0,num_selfTrips+num_testTrips):
167 | #print i
168 | t = Trip("../drivers/"+str(self.name)+"/"+str(order[i])+".csv", feat)
169 | g.write(t.printFeatures())
170 |
171 | #trips from other drivers
172 | tripList = self.getRandomDriverTrips(num_NOTselfTrips+num_testTrips, numNotDrivers, feat)
173 | for other in tripList:
174 | g.write(other)
175 | g.close()
176 |
177 | #creates a csv file containing the labels: 1-trip was made by driver in question,
178 | #0-trip was made by one of the 'other' drivers
179 | def writeCSV_labels(self):
180 | #file containing training labels, same for any driver
181 | h = open ("driver_stats/"+"trainingLabels.csv", "w")
182 | for i in range(num_selfTrips+num_testTrips):
183 | h.write(str(1)+"\n")
184 | for i in range(num_NOTselfTrips+num_testTrips):
185 | h.write(str(0)+"\n")
186 | h.close()
187 |
188 | #creates all necessary datasets for a given classification task
189 | def createDataSets(self, numNotDrivers, feat):
190 | order = [i for i in range(1, 201)]
191 | random.shuffle(order)
192 | self.writeCSV(order, numNotDrivers, feat)
193 | self.writeCSV_labels()
194 |
195 |
196 |
197 |
198 | d1 = Driver(sys.argv[1])
199 | d1.createDataSets()
200 | print d1.classify()
201 |
--------------------------------------------------------------------------------
/atomic-taro/lib/segment-objects/main-menu-header.coffee:
--------------------------------------------------------------------------------
1 | {TextEditor} = require 'atom'
2 | {Point, Range} = require 'atom'
3 | HeaderElement = require './header-element'
4 |
5 | module.exports =
6 | class MainMenuHeader extends HeaderElement
7 |
8 |
9 |
10 | buildHeader: (width) ->
11 | @headerBar = document.createElement('div')
12 | @headerBar.classList.add('atomic-taro_main-menu')
13 | $(@headerBar).width(width)
14 |
15 | @variantButtons = document.createElement('div')
16 | @variantButtons.classList.add('atomic-taro_main-menu_variantContainer')
17 |
18 | @addRunButton(@headerBar)
19 |
20 | # add version tabs
21 | nameContainer = document.createElement("div")
22 | nameContainer.classList.add('atomic-taro_editor-header-name-container')
23 | @versionBookmarkBar = document.createElement("div")
24 | @versionBookmarkBar.classList.add('atomic-taro_editor-header-name')
25 | $(@versionBookmarkBar).data("variant", @model)
26 | @addNameBookmarkBar()
27 | nameContainer.appendChild(@versionBookmarkBar)
28 | @headerBar.appendChild(nameContainer)
29 | @headerBar.appendChild(@variantButtons)
30 | @headerWrapper.appendChild(@headerBar)
31 |
32 | @addJqueryListeners()
33 |
34 |
35 |
36 | '''
37 | Specific to main menu, need to connect to atomicTaroView in order
38 | to trigger package-level events, like running the program.
39 | '''
40 | setTaroView: (view) ->
41 | @taroView = view
42 |
43 |
44 | showAlertPane: (commit) ->
45 | $(@commitAlertLabel).text("commit "+commit.commitID+" on "+commit.date)
46 | $(@alertPane).show()
47 |
48 |
49 | hideAlertPane: ->
50 | $(@alertPane).slideUp('fast')
51 |
52 |
53 | getElement: ->
54 | #@headerWrapper = document.createElement('div')
55 | @headerWrapper
56 |
57 |
58 | focus: ->
59 | @addClass('active')
60 | $(@currentVersionName).addClass('focused')
61 | $(@variantsButton).addClass('active')
62 |
63 |
64 | blur: ->
65 | @removeClass('active')
66 | $(@currentVersionName).removeClass('focused')
67 | $(@variantsButton).removeClass('active')
68 | $('.icon-primitive-square').removeClass('highlighted')
69 | $('.atomic-taro_editor-header_version-title').removeClass('highlighted')
70 |
71 |
72 | travelStyle: (commit) ->
73 | @addClass('historical')
74 | @showAlertPane(commit)
75 |
76 |
77 | removeTravelStyle: ->
78 | @removeClass('historical')
79 | @hideAlertPane()
80 |
81 |
82 | buildAlertPane: ->
83 | @alertPane = document.createElement('div')
84 | @alertPane.classList.add('atomic-taro_main-menu_alertBox')
85 | lockIcon = document.createElement('span')
86 | lockIcon.classList.add('icon-lock')
87 | lockIcon.classList.add('atomic-taro_commitLock')
88 |
89 | @commitAlertLabel = document.createElement('span')
90 | @commitAlertLabel.classList.add('atomic-taro_commitAlertLabel')
91 | $(@commitAlertLabel).text("commit N on 9/16/16 10:20pm")
92 |
93 | returnButton = document.createElement('span')
94 | returnButton.classList.add('atomic-taro_commitBackButton')
95 | returnButton.classList.add(@editorID)
96 | clockIcon = document.createElement('span')
97 | clockIcon.classList.add('icon-arrow-left')
98 | returnButton.appendChild(clockIcon)
99 |
100 |
101 | @alertPane.appendChild(returnButton)
102 | @alertPane.appendChild(lockIcon)
103 | @alertPane.appendChild(@commitAlertLabel)
104 | $(@alertPane).hide()
105 | @headerWrapper.appendChild(@alertPane)
106 |
107 |
108 | buildButtons: ->
109 | @addVariantButtons(@variantButtons)
110 | @addHistoryButton(@variantButtons)
111 | @addBranchButton(@variantButtons)
112 | @branchButton.classList.add('atomic-taro_main-menu_branchIcon')
113 | @historyButton.classList.add('atomic-taro_main-menu_branchIcon')
114 | $(@activeButton).show()
115 | $(@historyButton).show()
116 | $(@branchButton).show()
117 | @buildAlertPane()
118 |
119 |
120 |
121 | addRunButton: (header) ->
122 | @runIcon = document.createElement('span')
123 | @runIcon.classList.add('icon-playback-play')
124 | @runIcon.classList.add('atomic-taro_main-menu_runIcon')
125 | @runIcon.classList.add(@editorID)
126 | header.appendChild(@runIcon)
127 |
128 |
129 |
130 | addVariantButtons: (header) ->
131 | variantsButton = document.createElement("span")
132 | variantsButton.classList.add('main-menu_variantButton')
133 | variantsButton.classList.add('variants-button')
134 | $(variantsButton).text("variants")
135 | header.appendChild(variantsButton)
136 |
137 | $(variantsButton).hoverIntent \
138 | (-> $(this).children('.variants-hoverMenu').slideDown('fast')),\
139 | (-> $(this).children('.variants-hoverMenu').slideUp('fast'))
140 |
141 | variantsMenu = document.createElement("div")
142 | variantsMenu.classList.add('variants-hoverMenu')
143 | $(variantsMenu).hide()
144 | variantsButton.appendChild(variantsMenu)
145 |
146 | buttonShow = document.createElement("div")
147 | buttonShow.classList.add('variants-hoverMenu-buttons')
148 | buttonShow.classList.add('showVariantsButton')
149 | $(buttonShow).text("show variant panel")
150 | $(buttonShow).data("variant", @)
151 | $(buttonShow).click (ev) =>
152 | ev.stopPropagation()
153 | @taroView.toggleExplorerView()
154 | $(variantsMenu).hide()
155 | variantsMenu.appendChild(buttonShow)
156 |
157 | buttonAdd = document.createElement("div")
158 | buttonAdd.classList.add('variants-hoverMenu-buttons')
159 | buttonAdd.classList.add('createVariantButton')
160 | $(buttonAdd).html("new version")
161 | $(buttonAdd).click =>
162 | @view.newBranch()
163 | $(variantsMenu).hide()
164 | variantsMenu.appendChild(buttonAdd)
165 |
166 |
167 | addNameBookmarkBar: ->
168 | current = @model.getCurrentVersion()
169 | root = @model.getRootVersion()
170 | singleton = !@model.hasVersions()
171 | if !singleton
172 | @visibleVersions = [] # reset
173 | @addVersionBookmark(root, current, singleton)
174 | if @visibleVersions.length > 1
175 | $(@buttonArchive).show()
176 | else
177 | $(@buttonArchive).hide()
178 | else
179 | $(@buttonArchive).hide()
180 |
181 |
182 | addJqueryListeners: ->
183 | # run icon
184 | $ => $(document).on 'mousedown', '.atomic-taro_main-menu_runIcon'+"."+@editorID, (ev) =>
185 | $(@runIcon).addClass('click')
186 | @taroView.runProgram()
187 | @taroView.showExplorerView()
188 | $ => $(document).on 'mouseup', '.atomic-taro_main-menu_runIcon'+"."+@editorID, (ev) =>
189 | $(@runIcon).removeClass('click')
190 |
191 | # commit back button
192 | $(document).on 'click', '.atomic-taro_commitBackButton', (ev) =>
193 | @taroView.getTravelAgent().globalBackToFuture(@view)
194 | $(@alertPane).slideUp('fast')
195 |
--------------------------------------------------------------------------------
/atomic-taro/node_modules/diff/lib/diff/word.js:
--------------------------------------------------------------------------------
1 | /*istanbul ignore start*/'use strict';
2 |
3 | exports.__esModule = true;
4 | exports.wordDiff = undefined;
5 | exports. /*istanbul ignore end*/diffWords = diffWords;
6 | /*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = diffWordsWithSpace;
7 |
8 | var /*istanbul ignore start*/_base = require('./base') /*istanbul ignore end*/;
9 |
10 | /*istanbul ignore start*/
11 | var _base2 = _interopRequireDefault(_base);
12 |
13 | /*istanbul ignore end*/
14 | var /*istanbul ignore start*/_params = require('../util/params') /*istanbul ignore end*/;
15 |
16 | /*istanbul ignore start*/
17 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18 |
19 | /*istanbul ignore end*/
20 |
21 | // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
22 | //
23 | // Ranges and exceptions:
24 | // Latin-1 Supplement, 0080–00FF
25 | // - U+00D7 × Multiplication sign
26 | // - U+00F7 ÷ Division sign
27 | // Latin Extended-A, 0100–017F
28 | // Latin Extended-B, 0180–024F
29 | // IPA Extensions, 0250–02AF
30 | // Spacing Modifier Letters, 02B0–02FF
31 | // - U+02C7 ˇ ˇ Caron
32 | // - U+02D8 ˘ ˘ Breve
33 | // - U+02D9 ˙ ˙ Dot Above
34 | // - U+02DA ˚ ˚ Ring Above
35 | // - U+02DB ˛ ˛ Ogonek
36 | // - U+02DC ˜ ˜ Small Tilde
37 | // - U+02DD ˝ ˝ Double Acute Accent
38 | // Latin Extended Additional, 1E00–1EFF
39 | var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
40 |
41 | var reWhitespace = /\S/;
42 |
43 | var wordDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/wordDiff = new /*istanbul ignore start*/_base2.default() /*istanbul ignore end*/;
44 | wordDiff.equals = function (left, right) {
45 | return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right);
46 | };
47 | wordDiff.tokenize = function (value) {
48 | var tokens = value.split(/(\s+|\b)/);
49 |
50 | // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.
51 | for (var i = 0; i < tokens.length - 1; i++) {
52 | // If we have an empty string in the next field and we have only word chars before and after, merge
53 | if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) {
54 | tokens[i] += tokens[i + 2];
55 | tokens.splice(i + 1, 2);
56 | i--;
57 | }
58 | }
59 |
60 | return tokens;
61 | };
62 |
63 | function diffWords(oldStr, newStr, callback) {
64 | var options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(callback, { ignoreWhitespace: true });
65 | return wordDiff.diff(oldStr, newStr, options);
66 | }
67 | function diffWordsWithSpace(oldStr, newStr, callback) {
68 | return wordDiff.diff(oldStr, newStr, callback);
69 | }
70 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3dvcmQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztnQ0ErQ2dCO3lEQUlBOztBQW5EaEI7Ozs7OztBQUNBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBb0JBLElBQU0sb0JBQW9CLCtEQUFwQjs7QUFFTixJQUFNLGVBQWUsSUFBZjs7QUFFQyxJQUFNLCtFQUFXLHFFQUFYO0FBQ2IsU0FBUyxNQUFULEdBQWtCLFVBQVMsSUFBVCxFQUFlLEtBQWYsRUFBc0I7QUFDdEMsU0FBTyxTQUFTLEtBQVQsSUFBbUIsS0FBSyxPQUFMLENBQWEsZ0JBQWIsSUFBaUMsQ0FBQyxhQUFhLElBQWIsQ0FBa0IsSUFBbEIsQ0FBRCxJQUE0QixDQUFDLGFBQWEsSUFBYixDQUFrQixLQUFsQixDQUFELENBRGpEO0NBQXRCO0FBR2xCLFNBQVMsUUFBVCxHQUFvQixVQUFTLEtBQVQsRUFBZ0I7QUFDbEMsTUFBSSxTQUFTLE1BQU0sS0FBTixDQUFZLFVBQVosQ0FBVDs7O0FBRDhCLE9BSTdCLElBQUksSUFBSSxDQUFKLEVBQU8sSUFBSSxPQUFPLE1BQVAsR0FBZ0IsQ0FBaEIsRUFBbUIsR0FBdkMsRUFBNEM7O0FBRTFDLFFBQUksQ0FBQyxPQUFPLElBQUksQ0FBSixDQUFSLElBQWtCLE9BQU8sSUFBSSxDQUFKLENBQXpCLElBQ0ssa0JBQWtCLElBQWxCLENBQXVCLE9BQU8sQ0FBUCxDQUF2QixDQURMLElBRUssa0JBQWtCLElBQWxCLENBQXVCLE9BQU8sSUFBSSxDQUFKLENBQTlCLENBRkwsRUFFNEM7QUFDOUMsYUFBTyxDQUFQLEtBQWEsT0FBTyxJQUFJLENBQUosQ0FBcEIsQ0FEOEM7QUFFOUMsYUFBTyxNQUFQLENBQWMsSUFBSSxDQUFKLEVBQU8sQ0FBckIsRUFGOEM7QUFHOUMsVUFIOEM7S0FGaEQ7R0FGRjs7QUFXQSxTQUFPLE1BQVAsQ0Fma0M7Q0FBaEI7O0FBa0JiLFNBQVMsU0FBVCxDQUFtQixNQUFuQixFQUEyQixNQUEzQixFQUFtQyxRQUFuQyxFQUE2QztBQUNsRCxNQUFJLFVBQVUsOEVBQWdCLFFBQWhCLEVBQTBCLEVBQUMsa0JBQWtCLElBQWxCLEVBQTNCLENBQVYsQ0FEOEM7QUFFbEQsU0FBTyxTQUFTLElBQVQsQ0FBYyxNQUFkLEVBQXNCLE1BQXRCLEVBQThCLE9BQTlCLENBQVAsQ0FGa0Q7Q0FBN0M7QUFJQSxTQUFTLGtCQUFULENBQTRCLE1BQTVCLEVBQW9DLE1BQXBDLEVBQTRDLFFBQTVDLEVBQXNEO0FBQzNELFNBQU8sU0FBUyxJQUFULENBQWMsTUFBZCxFQUFzQixNQUF0QixFQUE4QixRQUE5QixDQUFQLENBRDJEO0NBQXREIiwiZmlsZSI6IndvcmQuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgRGlmZiBmcm9tICcuL2Jhc2UnO1xuaW1wb3J0IHtnZW5lcmF0ZU9wdGlvbnN9IGZyb20gJy4uL3V0aWwvcGFyYW1zJztcblxuLy8gQmFzZWQgb24gaHR0cHM6Ly9lbi53aWtpcGVkaWEub3JnL3dpa2kvTGF0aW5fc2NyaXB0X2luX1VuaWNvZGVcbi8vXG4vLyBSYW5nZXMgYW5kIGV4Y2VwdGlvbnM6XG4vLyBMYXRpbi0xIFN1cHBsZW1lbnQsIDAwODDigJMwMEZGXG4vLyAgLSBVKzAwRDcgIMOXIE11bHRpcGxpY2F0aW9uIHNpZ25cbi8vICAtIFUrMDBGNyAgw7cgRGl2aXNpb24gc2lnblxuLy8gTGF0aW4gRXh0ZW5kZWQtQSwgMDEwMOKAkzAxN0Zcbi8vIExhdGluIEV4dGVuZGVkLUIsIDAxODDigJMwMjRGXG4vLyBJUEEgRXh0ZW5zaW9ucywgMDI1MOKAkzAyQUZcbi8vIFNwYWNpbmcgTW9kaWZpZXIgTGV0dGVycywgMDJCMOKAkzAyRkZcbi8vICAtIFUrMDJDNyAgy4cgJiM3MTE7ICBDYXJvblxuLy8gIC0gVSswMkQ4ICDLmCAmIzcyODsgIEJyZXZlXG4vLyAgLSBVKzAyRDkgIMuZICYjNzI5OyAgRG90IEFib3ZlXG4vLyAgLSBVKzAyREEgIMuaICYjNzMwOyAgUmluZyBBYm92ZVxuLy8gIC0gVSswMkRCICDLmyAmIzczMTsgIE9nb25la1xuLy8gIC0gVSswMkRDICDLnCAmIzczMjsgIFNtYWxsIFRpbGRlXG4vLyAgLSBVKzAyREQgIMudICYjNzMzOyAgRG91YmxlIEFjdXRlIEFjY2VudFxuLy8gTGF0aW4gRXh0ZW5kZWQgQWRkaXRpb25hbCwgMUUwMOKAkzFFRkZcbmNvbnN0IGV4dGVuZGVkV29yZENoYXJzID0gL15bYS16QS1aXFx1e0MwfS1cXHV7RkZ9XFx1e0Q4fS1cXHV7RjZ9XFx1e0Y4fS1cXHV7MkM2fVxcdXsyQzh9LVxcdXsyRDd9XFx1ezJERX0tXFx1ezJGRn1cXHV7MUUwMH0tXFx1ezFFRkZ9XSskL3U7XG5cbmNvbnN0IHJlV2hpdGVzcGFjZSA9IC9cXFMvO1xuXG5leHBvcnQgY29uc3Qgd29yZERpZmYgPSBuZXcgRGlmZigpO1xud29yZERpZmYuZXF1YWxzID0gZnVuY3Rpb24obGVmdCwgcmlnaHQpIHtcbiAgcmV0dXJuIGxlZnQgPT09IHJpZ2h0IHx8ICh0aGlzLm9wdGlvbnMuaWdub3JlV2hpdGVzcGFjZSAmJiAhcmVXaGl0ZXNwYWNlLnRlc3QobGVmdCkgJiYgIXJlV2hpdGVzcGFjZS50ZXN0KHJpZ2h0KSk7XG59O1xud29yZERpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICBsZXQgdG9rZW5zID0gdmFsdWUuc3BsaXQoLyhcXHMrfFxcYikvKTtcblxuICAvLyBKb2luIHRoZSBib3VuZGFyeSBzcGxpdHMgdGhhdCB3ZSBkbyBub3QgY29uc2lkZXIgdG8gYmUgYm91bmRhcmllcy4gVGhpcyBpcyBwcmltYXJpbHkgdGhlIGV4dGVuZGVkIExhdGluIGNoYXJhY3RlciBzZXQuXG4gIGZvciAobGV0IGkgPSAwOyBpIDwgdG9rZW5zLmxlbmd0aCAtIDE7IGkrKykge1xuICAgIC8vIElmIHdlIGhhdmUgYW4gZW1wdHkgc3RyaW5nIGluIHRoZSBuZXh0IGZpZWxkIGFuZCB3ZSBoYXZlIG9ubHkgd29yZCBjaGFycyBiZWZvcmUgYW5kIGFmdGVyLCBtZXJnZVxuICAgIGlmICghdG9rZW5zW2kgKyAxXSAmJiB0b2tlbnNbaSArIDJdXG4gICAgICAgICAgJiYgZXh0ZW5kZWRXb3JkQ2hhcnMudGVzdCh0b2tlbnNbaV0pXG4gICAgICAgICAgJiYgZXh0ZW5kZWRXb3JkQ2hhcnMudGVzdCh0b2tlbnNbaSArIDJdKSkge1xuICAgICAgdG9rZW5zW2ldICs9IHRva2Vuc1tpICsgMl07XG4gICAgICB0b2tlbnMuc3BsaWNlKGkgKyAxLCAyKTtcbiAgICAgIGktLTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gdG9rZW5zO1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIGRpZmZXb3JkcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHtcbiAgbGV0IG9wdGlvbnMgPSBnZW5lcmF0ZU9wdGlvbnMoY2FsbGJhY2ssIHtpZ25vcmVXaGl0ZXNwYWNlOiB0cnVlfSk7XG4gIHJldHVybiB3b3JkRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTtcbn1cbmV4cG9ydCBmdW5jdGlvbiBkaWZmV29yZHNXaXRoU3BhY2Uob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKSB7XG4gIHJldHVybiB3b3JkRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7XG59XG4iXX0=
71 |
--------------------------------------------------------------------------------
/css/site_global.css:
--------------------------------------------------------------------------------
1 | html{min-height:100%;min-width:100%;-ms-text-size-adjust:none;}body,div,dl,dt,dd,ul,ol,li,nav,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td,a{margin:0px;padding:0px;border-width:0px;border-style:solid;border-color:transparent;-webkit-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;transform-origin:left top;background-repeat:no-repeat;}button.submit-btn{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}.transition{-webkit-transition-property:background-image,background-position,background-color,border-color,border-radius,color,font-size,font-style,font-weight,letter-spacing,line-height,text-align,box-shadow,text-shadow,opacity;transition-property:background-image,background-position,background-color,border-color,border-radius,color,font-size,font-style,font-weight,letter-spacing,line-height,text-align,box-shadow,text-shadow,opacity;}.transition *{-webkit-transition:inherit;transition:inherit;}table{border-collapse:collapse;border-spacing:0px;}fieldset,img{border:0px;border-style:solid;-webkit-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;transform-origin:left top;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:inherit;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}.form-grp input,.form-grp textarea{-webkit-appearance:none;-webkit-border-radius:0;}body{font-family:Arial, Helvetica Neue, Helvetica, sans-serif;text-align:left;font-size:14px;line-height:17px;word-wrap:break-word;text-rendering:optimizeLegibility;-moz-font-feature-settings:'liga';-ms-font-feature-settings:'liga';-webkit-font-feature-settings:'liga';font-feature-settings:'liga';}a:link{color:#474343;text-decoration:inherit;}a:visited{color:#474343;text-decoration:inherit;}a:hover{color:#474343;text-decoration:underline;}a:active{color:#474343;text-decoration:inherit;}a.nontext{color:black;text-decoration:none;font-style:normal;font-weight:normal;}.HeaderLink a:link{color:#E8E8E3;text-decoration:inherit;}.HeaderLink a:visited{color:#E8E8E3;text-decoration:inherit;}.HeaderLink a:hover{color:#E8E8E3;text-decoration:underline;}.HeaderLink a:active{color:#E7E7E2;text-decoration:inherit;}.paper-Link a:link{color:#3300EB;text-decoration:inherit;}.paper-Link a:visited{color:#7853FF;text-decoration:underline;}.paper-Link a:hover{color:#166CFF;text-decoration:underline;}.paper-Link a:active{color:#087FFF;text-decoration:inherit;}.normal_text{color:#000000;direction:ltr;font-family:Arial, Helvetica Neue, Helvetica, sans-serif;font-size:14px;font-style:normal;font-weight:normal;letter-spacing:0px;line-height:17px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;vertical-align:0px;padding:0px;}.list0 li:before{position:absolute;right:100%;letter-spacing:0px;text-decoration:none;font-weight:normal;font-style:normal;}.rtl-list li:before{right:auto;left:100%;}.nls-None > li:before,.nls-None .list3 > li:before,.nls-None .list6 > li:before{margin-right:6px;content:'•';}.nls-None .list1 > li:before,.nls-None .list4 > li:before,.nls-None .list7 > li:before{margin-right:6px;content:'○';}.nls-None,.nls-None .list1,.nls-None .list2,.nls-None .list3,.nls-None .list4,.nls-None .list5,.nls-None .list6,.nls-None .list7,.nls-None .list8{padding-left:34px;}.nls-None.rtl-list,.nls-None .list1.rtl-list,.nls-None .list2.rtl-list,.nls-None .list3.rtl-list,.nls-None .list4.rtl-list,.nls-None .list5.rtl-list,.nls-None .list6.rtl-list,.nls-None .list7.rtl-list,.nls-None .list8.rtl-list{padding-left:0px;padding-right:34px;}.nls-None .list2 > li:before,.nls-None .list5 > li:before,.nls-None .list8 > li:before{margin-right:6px;content:'-';}.nls-None.rtl-list > li:before,.nls-None .list1.rtl-list > li:before,.nls-None .list2.rtl-list > li:before,.nls-None .list3.rtl-list > li:before,.nls-None .list4.rtl-list > li:before,.nls-None .list5.rtl-list > li:before,.nls-None .list6.rtl-list > li:before,.nls-None .list7.rtl-list > li:before,.nls-None .list8.rtl-list > li:before{margin-right:0px;margin-left:6px;}.TabbedPanelsTab{white-space:nowrap;}.MenuBar .MenuBarView,.MenuBar .SubMenuView{display:block;list-style:none;}.MenuBar .SubMenu{display:none;position:absolute;}.NoWrap{white-space:nowrap;word-wrap:normal;}.rootelem{margin-left:auto;margin-right:auto;}.colelem{display:inline;float:left;clear:both;}.clearfix:after{content:"\0020";visibility:hidden;display:block;height:0px;clear:both;}*:first-child+html .clearfix{zoom:1;}.clip_frame{overflow:hidden;}.popup_anchor{position:relative;width:0px;height:0px;}.popup_element{z-index:100000;}.svg{display:block;vertical-align:top;}span.wrap{content:'';clear:left;display:block;}span.actAsInlineDiv{display:inline-block;}.position_content,.excludeFromNormalFlow{float:left;}.preload_images{position:absolute;overflow:hidden;left:-9999px;top:-9999px;height:1px;width:1px;}.preload{height:1px;width:1px;}.animateStates{-webkit-transition:0.3s ease-in-out;-moz-transition:0.3s ease-in-out;-o-transition:0.3s ease-in-out;transition:0.3s ease-in-out;}[data-whatinput="mouse"] *:focus,[data-whatinput="touch"] *:focus,input:focus,textarea:focus{outline:none;}textarea{resize:none;overflow:auto;}.fld-prompt{pointer-events:none;}.wrapped-input{position:absolute;top:0px;left:0px;background:transparent;border:none;}.submit-btn{z-index:50000;cursor:pointer;}.anchor_item{width:22px;height:18px;}.MenuBar .SubMenuVisible,.MenuBarVertical .SubMenuVisible,.MenuBar .SubMenu .SubMenuVisible,.popup_element.Active,span.actAsPara,.actAsDiv,a.nonblock.nontext,img.block{display:block;}.widget_invisible,.js .invi,.js .mse_pre_init{visibility:hidden;}.ose_ei{visibility:hidden;z-index:0;}.no_vert_scroll{overflow-y:hidden;}.always_vert_scroll{overflow-y:scroll;}.always_horz_scroll{overflow-x:scroll;}.fullscreen{overflow:hidden;left:0px;top:0px;position:fixed;height:100%;width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}.fullwidth{position:absolute;}.borderbox{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}.scroll_wrapper{position:absolute;overflow:auto;left:0px;right:0px;top:0px;bottom:0px;padding-top:0px;padding-bottom:0px;margin-top:0px;margin-bottom:0px;}.browser_width > *{position:absolute;left:0px;right:0px;}.grpelem,.accordion_wrapper{display:inline;float:left;}.fld-checkbox input[type=checkbox],.fld-radiobutton input[type=radio]{position:absolute;overflow:hidden;clip:rect(0px, 0px, 0px, 0px);height:1px;width:1px;margin:-1px;padding:0px;border:0px;}.fld-checkbox input[type=checkbox] + label,.fld-radiobutton input[type=radio] + label{display:inline-block;background-repeat:no-repeat;cursor:pointer;float:left;width:100%;height:100%;}.pointer_cursor,.fld-recaptcha-mode,.fld-recaptcha-refresh,.fld-recaptcha-help{cursor:pointer;}p,h1,h2,h3,h4,h5,h6,ol,ul,span.actAsPara{max-height:1000000px;}.superscript{vertical-align:super;font-size:66%;line-height:0px;}.subscript{vertical-align:sub;font-size:66%;line-height:0px;}.horizontalSlideShow{-ms-touch-action:pan-y;touch-action:pan-y;}.verticalSlideShow{-ms-touch-action:pan-x;touch-action:pan-x;}.colelem100,.verticalspacer{clear:both;}.list0 li,.MenuBar .MenuItemContainer,.SlideShowContentPanel .fullscreen img,.css_verticalspacer .verticalspacer{position:relative;}.popup_element.Inactive,.js .disn,.js .an_invi,.hidden,.breakpoint{display:none;}#muse_css_mq{position:absolute;display:none;background-color:#FFFFFE;}.fluid_height_spacer{width:0.01px;}.muse_check_css{display:none;position:fixed;}@media screen and (-webkit-min-device-pixel-ratio:0){body{text-rendering:auto;}}
--------------------------------------------------------------------------------
/atomic-taro/lib/variant-meta-agent.coffee:
--------------------------------------------------------------------------------
1 | {TextEditor} = require 'atom'
2 | {Point, Range} = require 'atom'
3 | Variant = require './segment-objects/variant-model'
4 | VariantView = require './segment-objects/variant-view'
5 | VariantBranch = require './segment-objects/variant-branch'
6 | MainMenuHeader = require './segment-objects/main-menu-header'
7 | fs = require 'fs'
8 |
9 |
10 | module.exports =
11 | class VariantMetaAgent
12 |
13 | constructor: (@taroView, @undoAgent, @metaFolder, @travelAgent, @editor) ->
14 | # nothing
15 |
16 |
17 | buildMasterVariant: (metaData) ->
18 | # First, wrap the entire file in a variant by default
19 | wholeFile = [new Point(0,0), new Point(10000000, 10000000)]
20 | range = @editor.getBuffer().clipRange(wholeFile)
21 | marker = @editor.markBufferRange(range, invalidate: 'never')
22 |
23 | fileName = @taroView.getFileName()
24 | altHeader = new MainMenuHeader()
25 | altHeader.setTaroView(@taroView)
26 | altFooter = document.createElement('div')
27 | variant = new VariantView({metaData: metaData, id: 0, sourceEditor: @editor, marker: marker, altHeader: altHeader, altFooter: altFooter, title: fileName, taroView: @taroView, undoAgent: @undoAgent, metaFolder: @metaFolder, travelAgent: @travelAgent})
28 | masterVariant = @buildVariant(range.start, range.end, marker, fileName, variant)
29 | masterVariant
30 |
31 |
32 |
33 | buildVariant: (start, end, marker, title, variant) ->
34 | # create variant
35 | if not variant?
36 | variant = new VariantView({sourceEditor: @editor, marker: marker, title: title, taroView: @taroView, undoAgent: @undoAgent, metaFolder: @metaFolder, travelAgent: @travelAgent})
37 | marker.setProperties(myVariant: variant)
38 |
39 | # mark header
40 | headerElement = variant.getHeader()
41 | if end.row != start.row
42 | hRange = [start, new Point(end.row - 1, end.column)]
43 | else
44 | hRange = [start, end]
45 | hm = @editor.markBufferRange(hRange, invalidate: 'never', reversed: true)
46 | #editor.decorateMarker(hm, type: 'highlight', class: 'highlight-pink')
47 | hm.setProperties(myVariant: variant)
48 | variant.getModel().setHeaderMarker(hm)
49 |
50 | # make header decoration
51 | hdec = @editor.decorateMarker(hm, {type: 'block', position: 'before', item: headerElement})
52 | variant.setHeaderMarker(hm)
53 | variant.setHeaderMarkerDecoration(hdec)
54 |
55 | # mark footer
56 | footerElement = variant.getFooter()
57 |
58 | # make footer decoration
59 | fdec = @editor.decorateMarker(marker, {type: 'block', position: 'after', item: footerElement})
60 | variant.setFooterMarkerDecoration(fdec)
61 |
62 | return variant
63 |
64 |
65 |
66 | saveVariants: (variant) ->
67 | # save any changes to any of the other branches/variants that aren't currently showing
68 | # save the current state of each variant showing
69 | variant.getModel().saveVariant()
70 |
71 |
72 |
73 |
74 | unpackMetaData: (variant, metaData) ->
75 | insertPoint = variant.getModel().getVariantRange().start # the top of the file initially
76 | variant.getModel().clearTextInRange() # clear all text. Fix in the future, this will wreck out of tool changes
77 | insertPoint = @unravelInit(variant, insertPoint, metaData.text) # write all code from the metadata
78 | newRange = new Range(variant.getModel().getVariantRange().start, insertPoint)
79 | variant.getModel().setRange(newRange)
80 | @postProcess(variant)
81 |
82 |
83 | unravelInit: (variant, insertPoint, text) ->
84 | start = insertPoint # top of the file initially
85 | model = variant.getModel()
86 | childBuildQueue = []
87 |
88 | for item in text
89 | if item.varID? # OK, this is a nested variant, so let's go look for its data file
90 | before = insertPoint
91 | [insertPoint, childVariant] = @loadVariantBox(variant, item, insertPoint)
92 | newRange = new Range(before, insertPoint)
93 | childVariant.getModel().setRange(newRange)
94 | childBuildQueue.push childVariant
95 | else # plain text, so just insert it.
96 | range = model.insertTextInRange(insertPoint, item.text, 'skip')
97 | insertPoint = range.end
98 |
99 | for child in childBuildQueue
100 | @postProcess(child, variant)
101 |
102 | return insertPoint # where we should next start writing this file
103 |
104 |
105 |
106 | postProcess: (variant, parentVariant) ->
107 | model = variant.getModel()
108 | newRange = model.range
109 | #console.log "New range for "+model.getCurrentVersion().title+" is "
110 | #console.log newRange
111 |
112 | if not model.getMarker()? # no marker set up yet.
113 | marker = @editor.markBufferRange(newRange, invalidate: 'never')
114 | model.setMarker(marker)
115 | @buildVariant(newRange.start, newRange.end, marker, "title", variant)
116 | else
117 | # Now update this variant's range, since we've just changed its internal text
118 | model.setRange(newRange)
119 | model.setHeaderRange(newRange)
120 |
121 | if parentVariant?
122 | parentVariant.getModel().addNested(variant)
123 |
124 |
125 | loadVariantBox: (parentVariant, metaData, insertPoint) ->
126 | varID = metaData.varID
127 | branchID = metaData.branchID
128 | commitID = metaData.commitID
129 | commitFileID = commitID
130 | if commitID == -1
131 | commitFileID = "M"
132 |
133 | # 1. make a new variant box
134 | babyVariant = parentVariant.buildBabyFromDir(metaData)
135 |
136 | # 3. load the commit
137 | commitFile = @metaFolder+"/"+varID.substring(0, 11)+"/"+branchID+"/"+commitFileID+".json"
138 | contents = []
139 | try
140 | data = fs.readFileSync(commitFile, 'utf8')
141 | contents = JSON.parse(data)
142 | #console.log "SUCESS: meta data found for nested variant", contents
143 | catch err
144 | console.log "No meta data found for nested variant!", err
145 |
146 | if commitID != -1
147 | curBranch = babyVariant.getModel().getCurrentVersion()
148 | curBranch.addAndSetCommit(commitID, contents)
149 |
150 | # 4. add this variant's contents into the editor
151 | insertPoint = @unravelInit(babyVariant, insertPoint, contents.text)
152 |
153 | return [insertPoint, babyVariant]
154 |
155 |
156 |
157 | wrapNewVariant: (editor, masterVariant) ->
158 | # first, get range
159 | clickRange = editor.getSelectedBufferRange()
160 | console.log "click range was ", clickRange
161 | range = [new Point(clickRange.start.row, 0), new Point(clickRange.end.row, 100000000000)]
162 | range = editor.getBuffer().clipRange(range)
163 | start = range.start
164 | end = range.end
165 |
166 | # now, see if there are any preexisting variants that overlap
167 | overlap_start = editor.findMarkers(containsBufferPosition: range.start)
168 | overlap_end = editor.findMarkers(containsBufferPosition: range.end)
169 | selected = editor.findMarkers(containsBufferRange: range)
170 | #console.log "found N markers: start "+overlap_start.length+", end: "+overlap_end.length+", "+selected.length
171 |
172 | # cannot allow new variants that partially intersect other variants
173 | if overlap_start.length == overlap_end.length == selected.length
174 | nest_Parent = null
175 | for marker in selected
176 | p = marker.getProperties().myVariant
177 | if p?
178 | nest_Parent = [p.getModel().getCurrentVersion(),p]
179 |
180 | # now initialize everything
181 | marker = editor.markBufferRange(range, invalidate: 'never')
182 | #@editor.decorateMarker(marker, {type: 'highlight', class: 'highlight-green'})
183 |
184 | #finally, make the new variant!
185 | variant = @buildVariant(start, end, marker, "v0")
186 | variant.buildVariantDiv()
187 |
188 | # Either add as a neted variant to a parent, or add as a top-level variant
189 | if nest_Parent != null
190 | nest_Parent[1].addedNestedVariant(variant, nest_Parent[0]) #nest_Parent is an array - second item is the VariantView
191 | else
192 | #console.log "adding variant to manager"
193 | masterVariant.addedNestedVariant(variant, masterVariant.getModel().getCurrentVersion())
194 |
--------------------------------------------------------------------------------