This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func handleSentence(s: [Token]) { | |
| let text = s.map { $0.text }.joined(separator: " ") | |
| tagger.string = text | |
| var charIdx = 0 | |
| var prevDescr = "O" | |
| for tok in s { | |
| let iosTag = tagger.tag(at: charIdx, unit: .word, scheme: .nameType, tokenRange: nil) | |
| let iosDescr = iosTag?.canonical ?? "O" | |
| let outputLine = "\(tok.text) \(tok.goldTag) \(iob(iosDescr, prevDescr))" | |
| output.append(outputLine) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let tagger = NSLinguisticTagger(tagSchemes: [.nameType], options: 0) | |
| let dataset: Dataset = .test | |
| let url = Bundle.main.url(forResource: dataset.rawValue, withExtension: "txt")! | |
| let content = try! String(contentsOf: url, encoding: .utf8).components(separatedBy: ["\n"]) | |
| var output: [String] = [] | |
| /// Map ios nlp tags to canonical tags. | |
| extension NSLinguisticTag { | |
| var canonical: String { | |
| switch self { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Index: web/javascript/transmission.js | |
| =================================================================== | |
| --- web/javascript/transmission.js (revision 14528) | |
| +++ web/javascript/transmission.js (working copy) | |
| @@ -519,43 +519,43 @@ | |
| }, | |
| dragenter: function(ev) { | |
| - if (ev.dataTransfer && ev.dataTransfer.types) { | |
| - var types = ["text/uri-list", "text/plain"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*! jQuery UI - v1.11.4 - 2015-05-01 | |
| * http://jqueryui.com | |
| * Includes: core.js, widget.js, mouse.js, sortable.js | |
| * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ | |
| (function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "1000": { | |
| "Name": "Books", | |
| "Children": [ | |
| { | |
| "BrowseNodeId": 1, | |
| "Name": "Arts & Photography", | |
| "hasChildren": true | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Queue: | |
| def __init__(self): | |
| self.stacks = ([], []) | |
| self.reversed = False | |
| def _reverse(self): | |
| i, j = (0, 1) if self.reversed else (1, 0) | |
| while len(self.stacks[i]): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Queue: | |
| def __init__(self): | |
| self.stack1 = [] | |
| self.stack2 = [] | |
| self.reversed = False | |
| def enqueue(self, item): | |
| if self.reversed is False: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Thu Nov 14 17:47:37.470 [conn2] command reaaad.$cmd command: { mapreduce: "annotations", query: { document: ObjectId('51753af7d228eb21cab1ba1d') }, map: CodeWScope( function() { | |
| var score = 1 + (this.score || 0) + (this.reposters ? this.reposters.length : 0); | |
| emit(this.user, score); | |
| }, {}), reduce: CodeWScope( function(k, values) { | |
| return Array.sum(values); | |
| }, {}), out: { inline: true } } ntoreturn:1 keyUpdates:0 locks(micros) r:41960 reslen:125 125ms | |
| Thu Nov 14 17:47:37.910 [conn2] command reaaad.$cmd command: { mapreduce: "annotations", query: { document: ObjectId('51c8127cd228eb02862c8d38') }, map: CodeWScope( function() { | |
| var score = 1 + (this.score || 0) + (this.reposters ? this.reposters.length : 0); | |
| emit(this.user, score); | |
| }, {}), reduce: CodeWScope( function(k, values) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| Route::post('oauth/token', function() { | |
| $oauth = new OAuth2\Provider(); | |
| return $oauth->tokenRequest(); | |
| }); | |
| Route::filter('oauth', function() { | |
| $oauth = new OAuth2\Provider(); | |
| return $oauth->filter(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if (Config::has('sentry.key')) { | |
| $bufferHandler = new Monolog\Handler\BufferHandler( | |
| new Monolog\Handler\RavenHandler( | |
| new Raven_Client(Config::get('sentry.key')), | |
| Monolog\Logger::WARNING | |
| ) | |
| ); | |