If file is large, use https://stackoverflow.com/a/39225039/4126114 instead
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
# Recursively get size of objects | |
# https://stackoverflow.com/a/59228005/4126114 | |
# https://stackoverflow.com/a/38515297/4126114 | |
# Published at https://gist.github.com/shadiakiki1986/6d2b641264b054bc63b224a726a1ead8 | |
def nested_apply(x, func, max_depth, depth_current=0): | |
s1 = func(x) | |
if depth_current >= max_depth: return s1 | |
wrap_napply = lambda v: nested_apply(v, func, max_depth, depth_current+1) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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://github.com/FBerendsen/niftireg/blob/fc526c152fd5eaced271d1d6de7c16661b2abd3e/reg-lib/cuda/checkCudaCard.cpp | |
// | |
// rm test | |
// g++ -I/usr/local/cuda/include -L/usr/local/cuda/lib64 -lcuda test.cpp # undefined reference to cudaGetDeviceCount | |
// PATH=$PATH:/usr/local/cuda/bin/ | |
// nvcc -x cu test.cpp --std=c++11 -lineinfo -o test | |
#include <cuda_runtime.h> | |
//#include <cuda.h> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// Based on https://github.com/redox-os/orbtk/blob/a9653954fed7275328bc8e893c3465506154571e/examples/clear.rs | |
// Modified to add a trait member called "summary" which is either implemented as a Book or a NewsArticle | |
// The summarize button would call the trait function "summarize" (be it from Book or NewsArticle). | |
// I couldn't get this to work yet, with the troubling sections marked with FIXME | |
use orbtk::prelude::*; | |
//--------------------------------------- | |
// https://doc.rust-lang.org/1.30.0/book/second-edition/ch10-02-traits.html | |
pub trait Summary { |
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
+-------------------------+------------------------+---------------------+-----------------+-----------------+-------------+ | |
| . | ImageMagick-6 | NetworkManager | ODBCDataSources | PackageKit | UPower | | |
+-------------------------+------------------------+---------------------+-----------------+-----------------+-------------+ | |
| adduser.conf | coder.xml | NetworkManager.conf | | PackageKit.conf | UPower.conf | | |
| anacrontab | colors.xml | conf.d | | Vendor.conf | | | |
| apg.conf | delegates.xml | dispatcher.d | | | | | |
| appstream.conf | log.xml | dnsmasq* (2) | | | | | |
| bash* (2) | magic.xml | system-connections | | | | | |
| bindresvport.blacklist |
Instructions
cargo new test-rustgym-longestcommonprefix
cd test-rustgym-longestcommonprefix
- copy src/main.rs from below file
cargo test