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
| import nltk | |
| from summa.keywords import keywords | |
| def get_features(text): | |
| # get the top 80% of the phrases from the text, scored by relevance | |
| return dict(keywords(text, ratio=0.8, split=True, scores=True)) | |
| def train_texts(classified_texts): | |
| # process the training set | |
| features = [] |
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
| import socket | |
| import network | |
| import time | |
| CONTENT = b"""\ | |
| HTTP/1.0 200 OK | |
| <!doctype html> | |
| <html> |
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
| const uncurry = (fn) => (...args) => args.reduce((fn, arg) => fn(arg), fn); | |
| const curry = (fn) => { | |
| const collect = (args, arg) => { | |
| const collected = args.concat([arg]); | |
| return ( | |
| collected.length >= fn.length | |
| ? fn.apply(null, collected) | |
| : collect.bind(null, collected) | |
| ); | |
| }; |
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
| from datetime import datetime | |
| import re | |
| import string | |
| def to_course_code(course_path, creation_date): | |
| """ | |
| Turns a course path into a short course code. | |
| Max 14 characters (but likely under 10). | |
| Not guaranteed to be unique | |
| but has month/year of creation date, and single character hash |
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
| import time | |
| import urllib.parse | |
| import hmac | |
| import hashlib | |
| import base64 | |
| SB_NAME = "ol-events" | |
| EH_NAME = "ol-user-metrics" | |
| SAS_NAME = "collect-user-metric" | |
| SAS_VALUE = "EXAMPLE-TOKEN" |
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
| <html> | |
| <head> | |
| <title>Simple xAPI Example</title> | |
| <script src="tincan-min.js"></script> | |
| </head> | |
| <body> | |
| <p>This is an xAPI Example</p> | |
| <button type="button" id="complete-button">Send Completion Statement</button> | |
| <span id="status"></span> | |
| <script> |
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
| Moved to: https://github.com/dcollien/mp4filechecker/blob/master/src/index.ts |
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
| import React, { useRef, useEffect, useCallback, useState } from "react"; | |
| type UpdateHandler = (dt: number) => void; | |
| type ContextRenderer = (ctx: CanvasRenderingContext2D) => void; | |
| export interface IAnimatedCanvasProps { | |
| width: number; | |
| height: number; | |
| onFrame: UpdateHandler; | |
| render: ContextRenderer; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>xAPI Form Example</title> | |
| <!-- xAPI base functionality, from: https://github.com/RusticiSoftware/TinCanJS/blob/master/build/tincan-min.js --> | |
| <script src="tincan-min.js"></script> | |
| <!-- Setting up the xAPI connection from launch data --> | |
| <script src="xapi-interface.js"></script> |
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
| [ | |
| { | |
| "label": "1850's Daguerrotype", | |
| "value": "Daguerrotype", | |
| "filters": [ | |
| "photography", | |
| "digital art" | |
| ] | |
| }, | |
| { |