Here are some external web links:
| /* | |
| * Parallel bitonic sort using CUDA. | |
| * Compile with | |
| * nvcc -arch=sm_11 bitonic_sort.cu | |
| * Based on http://www.tools-of-computing.com/tc/CS/Sorts/bitonic_sort.htm | |
| * License: BSD 3 | |
| */ | |
| #include <stdlib.h> | |
| #include <stdio.h> |
Discussion at: https://fosstodon.org/@ianthetechie/114517520321760826
That's a fair question. What I found is that "types" is a bit of a scapegoat for things that have a proper place yet, similar to "utils", "shared." The types crate tends to become a dumping ground for types that don't have a fixed place yet. Code in those crates is not really "discoverable" as in: I would have to look into the crate to see what's in there and how it relates to the rest of the codebase.
For example, the standard library has a bunch of primitive types, but they all live in their own module in the core crate. The rest lives close to the supporting code, e.g. see the structs in std::process (https://doc.rust-lang.org/std/process/index.html#structs). If these structs were all in the types crate, it would make the code and the documentation a lot harder to navigate in my opinion.
| extern crate chrono; | |
| extern crate libc; | |
| #[macro_use] | |
| extern crate structopt; | |
| use std::fs; | |
| use std::path::PathBuf; | |
| use std::error::Error; | |
| use std::process; | |
| use std::os::unix::fs::PermissionsExt; |
| // This is an algorithm, which creates an ID for a podcast episode. | |
| // It is based on the the podcast's title, episode's title, the episode number, | |
| // the date of the episode and the episode's mp3 file name. | |
| // | |
| // All fields can change over time, but the ID should remain the same. | |
| // Think of it more like a user agent string than a unique ID: it is "unique | |
| // enough" for identifying episodes in most cases. | |
| // | |
| // It's used to identify episodes in the database. |
| from math import log10 | |
| from random import randint | |
| def get_digit(number, base, pos): | |
| return (number // base ** pos) % base | |
| def prefix_sum(array): | |
| for i in range(1, len(array)): | |
| array[i] = array[i] + array[i-1] | |
| return array |
| # Go into the directory of the vendor package that you changed | |
| cd vendor/<owner>/<package> | |
| # Create a new git repository (composer does not check out the full git repo by default. Only a sparse copy) | |
| git init | |
| # Create a new branch for your local changes | |
| git checkout -b branchname | |
| # Commit changes |
| [ | |
| { | |
| "data": { | |
| "search": { | |
| "userCount": 2646, | |
| "edges": [ | |
| { | |
| "node": { | |
| "login": "torvalds", | |
| "followers": { |
| #![feature(generators)] | |
| #![feature(generator_trait)] | |
| use std::ops::{Generator, GeneratorState}; | |
| fn fizzbuzz_println(upto: u64) { | |
| for i in 0..upto { | |
| if i % 3 == 0 && i % 5 == 0 { | |
| println!("FizzBuzz"); | |
| } else if i % 3 == 0 { |