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
| #include <cassert> | |
| #include <string> | |
| #include <type_traits> | |
| #include <utility> | |
| template <typename T> | |
| class View { | |
| public: | |
| View() = default; |
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
| #include <iostream> | |
| #include <type_traits> | |
| // The C++11 implementation. | |
| namespace cxx11 { | |
| template <typename T> | |
| class ConstView { | |
| public: | |
| ConstView() = default; |
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
| #!/bin/sh | |
| USAGE='usage: replace-audio <orig-videofile> <new-audio> <output-file>' | |
| [ $# -ne 3 ] && { echo "${USAGE}" 2>&1; exit 1; } | |
| ORIG_VIDEO="$1" | |
| NEW_AUDIO="$2" | |
| OUTPUT_FILE="$3" |
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
| #!/bin/sh | |
| USAGE='usage: extract-audio <filename> <streamno>' | |
| [ $# -ne 2 ] && { echo "${USAGE}" 2>&1; exit 1; } | |
| VIDEOFILE="$1" | |
| STREAM_NO="$2" | |
| LAYOUT_7_1='7.1[FL][FR][FC][LFE][BL][BR][FLC][FRC]' |
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
| // Output: | |
| // | |
| // creating A | |
| // using A where A.s = 'valid test value' | |
| // destroying A where A.s = 'valid test value' |
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
| #include <iostream> | |
| // Typical output: | |
| // num_samples (double) = 2.000000e+00 | |
| // num_samples (int) = 1 | |
| // product = 31 | |
| int main() | |
| { | |
| double start = 17.3; | |
| double end = 17.5; |
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
| #!/usr/bin/python | |
| # Finds a combination of a note and musical tempo so that the note | |
| # wave cycle is best aligned with the tempo. | |
| # Input: MIDI note number | |
| # Output: Frequency in Hz | |
| def note_freq(midi_note_number): | |
| return 440 * (2 ** ((midi_note_number - 69)/12.0)) |
This file has been truncated, but you can view the full file.
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
| <?xml version="1.0" encoding="UTF-8" standalone="no" ?> | |
| <NIXML><TraktorSettings><Entry Name="DeviceIO.Config.Controller" Type="3" Value="RElPTQAOIqpESU9JAAAABAAAAAFERVZTAA4ilgAAAAJERVZJAAcZAAAAAAwARwBlAG4AZQByAGkAYwAgAE0ASQBEAElEREFUAAcY3ERESUYAAAAEAAAAAERESVYAAAAaAAAACQAyAC4AMAAuADEAIABEAGUAdgAAACJERElDAAAALAAAABQATgB1AG0AYQByAGsAIABEAEoAMgBHAE8AIABNAGEAcABwAGkAbgBnRERQVAAAAHQAAAAbAE4AdQBtAGEAcgBrACAARABKADIARwBvACAAKABOAHUAbQBhAHIAawAgAEQASgAyAEcAbwApAAAAGwBOAHUAbQBhAHIAawAgAEQASgAyAEcAbwAgACgATgB1AG0AYQByAGsAIABEAEoAMgBHAG8AKUREREMABvfYRERDSQADe+QAABAQRENEVAAAAC4AAAALAEMAaAAwADEALgBDAEMALgAwADAAMAAAAAcAAAAAQv4AAAAAAAH/////RENEVAAAAC4AAAALAEMAaAAwADEALgBDAEMALgAwADAAMQAAAAcAAAAAQv4AAAAAAAH/////RENEVAAAAC4AAAALAEMAaAAwADEALgBDAEMALgAwADAAMgAAAAcAAAAAQv4AAAAAAAH/////RENEVAAAAC4AAAALAEMAaAAwADEALgBDAEMALgAwADAAMwAAAAcAAAAAQv4AAAAAAAH/////RENEVAAAAC4AAAALAEMAaAAwADEALgBDAEMALgAwADAANAAAAAcAAAAAQv4AAAAAAAH/////RENEVAAAAC4AAAALAEMAaAAwADEALgBDAEMALgAwADAANQAAAAcAAAAAQv4AAAAAAAH/////RENEVAAAAC4AAAALAEMAaAAwADEALgB |
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
| // A comparison of 3 standard ways to parse a string into an integer | |
| // in C++. | |
| // | |
| // Requirements: | |
| // - parse into a signed at-least-32-bit 'int' type. | |
| // - communicate errors. | |
| // | |
| // Test results: both atol() and strtol() fail to communicate an | |
| // out-of-range condition in all cases. The istringstream is the most | |
| // robust parser. All implementations stop at the first non-numeric |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This script solves the problem of bidirectional syncing of | |
| // work and personal Google Calendars. | |
| // | |
| // Google Calendar is amazing software, but we often want to book some | |
| // time for personal use (e.g. appointment to a doctor), invite friends | |
| // and relatives (e.g. visiting with a spouse) and have this time booked | |
| // at work calendar too (so that no-one schedules a 1:1 meeting for that | |
| // interval). This is often done by inviting your work account to the | |
| // personal event. | |
| // |
NewerOlder