Whether the type is a specialization of template T.
template class T, typename U>| """Simple example on how to log scalars and images to tensorboard without tensor ops. | |
| License: Copyleft | |
| """ | |
| __author__ = "Michael Gygli, Tao He" | |
| import tensorflow as tf | |
| try: | |
| from StringIO import StringIO | |
| except: |
| D:\Open>gcc test.c -Wall -c | |
| test.c: In function 'g': | |
| test.c:8:14: warning: passing argument 1 of 'f' from incompatible pointer type [-Wincompatible-pointer-types] | |
| return f(cp); | |
| ^~ | |
| test.c:1:5: note: expected 'int *' but argument is of type 'char *' | |
| int f(int *a) { | |
| ^ | |
| D:\Open>stack exec -- ghc -c test.c -Wall |
| {-# LANGUAGE BangPatterns #-} | |
| import Criterion.Main | |
| import Weigh | |
| numericEnumFromThen :: (Fractional a) => a -> a -> [a] | |
| numericEnumFromThen n m = n `seq` m `seq` (n : numericEnumFromThen m (m+m-n)) | |
| numericEnumFromThenTo :: (Ord a, Fractional a) => a -> a -> a -> [a] | |
| numericEnumFromThenTo e1 e2 e3 |
Build LLVM/Clang Docset
Modify LLVM/Clang doxygen.config.in
Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma
You can get the list of supported formats with:
ffmpeg -formats
Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| import gc | |
| def list_live_objects(ty=None): | |
| def go(results, elements, bitset): | |
| for elem in elements: | |
| identity = id(elem) |
| use std::env; | |
| use nix::sched; | |
| use nix::sched::CloneFlags; | |
| use nix::sys::signal::Signal; | |
| use nix::sys::wait::waitpid; | |
| use nix::unistd; | |
| use cgroups_rs as cgroup; | |
| use cgroups_rs::{Cgroup}; | |
| use cgroups_rs::cgroup_builder::{CgroupBuilder}; |
| use std; | |
| use std::env; | |
| use std::fs; | |
| use std::io::Write; | |
| use nix::mount; | |
| use nix::sched; | |
| use nix::sched::CloneFlags; | |
| use nix::sys::signal::Signal; | |
| use nix::sys::wait::waitpid; |
COW, short for copy on write, is a way to implement mutable strings so that creating strings and logically copying strings, is reduced to almost nothing; conceptually they become free operations like no-ops.
Basic idea: to share a data buffer among string instances, and only make a copy for a specific instance (the copy on write) when that instance's data is modified. The general cost of this is only an extra indirection for accessing the value of a string, so a COW implementation is highly desirable. And so the original C++ standard, C++98, and its correction C++03, had special support for COW implementations, and e.g. the g++ compiler's std::string implementations used COW.
So why was that support dropped in C++11?
In particular, would the same reason or reasons apply to a reference counted immutable string value class?