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
| using System; | |
| using System.Collections.Generic; | |
| namespace TreeTraversals | |
| { | |
| public static class RT { | |
| public static RoseTree<T> Node<T>(T value) | |
| { | |
| return new RoseTree<T>() |
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
| // http://stackoverflow.com/questions/4631928/convert-utc-epoch-to-local-date-with-javascript | |
| var utcSeconds = 1234567890; | |
| var d = new Date(0); // The 0 there is the key, which sets the date to the epoch | |
| d.setUTCSeconds(utcSeconds); |
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 sympy as s | |
| from sympy.interactive.printing import init_printing | |
| from sympy.matrices import Matrix | |
| init_printing(use_unicode=False, wrap_line=False, no_global=True) | |
| # In [1]: %load_ext autoreload | |
| # | |
| # In [2]: %autoreload 2 |
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 sympy as s | |
| from sympy.interactive.printing import init_printing | |
| from sympy.matrices import Matrix | |
| init_printing(use_unicode=False, wrap_line=False, no_global=True) | |
| # In [1]: %load_ext autoreload | |
| # | |
| # In [2]: %autoreload 2 |
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: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | |
| function MyError(message) { | |
| this.name = 'MyError'; | |
| this.message = message || 'Default Message'; | |
| } | |
| MyError.prototype = Object.create(Error.prototype); | |
| MyError.prototype.constructor = MyError; | |
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 pandas as pd | |
| import numpy as np | |
| # initial data frame | |
| # looks like: | |
| # | |
| # >>> df | |
| # | |
| # A B C D |
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
| // taken from http://stackoverflow.com/questions/1922040/resize-an-image-c-sharp | |
| // user: Mark | |
| /// <summary> | |
| /// Resize the image to the specified width and height. | |
| /// </summary> | |
| /// <param name="image">The image to resize.</param> | |
| /// <param name="width">The width to resize to.</param> | |
| /// <param name="height">The height to resize to.</param> | |
| /// <returns>The resized image.</returns> |
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
| // https://github.com/thrashr888/mathr | |
| /** | |
| * @jsx React.DOM | |
| */ | |
| 'use strict'; | |
| var React = require('react/react.js'); |
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
| # stop | |
| sudo systemctl stop serial-getty@ttyAMA0.service | |
| # disable | |
| sudo systemctl disable serial-getty@ttyAMA0.service | |
| # set baud | |
| stty -F /dev/ttyAMA0 9600 |
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 pika | |
| import sys | |
| import pyCommon.data.serialize as serialize | |
| import pyCommon.net.command as cmd | |
| import pyCommon.net.event as evt | |
| queueName = sys.argv[1] | |
OlderNewer