View bench_iter.rs
This file contains 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
use criterion::{black_box, criterion_group, criterion_main, Criterion}; | |
const UPPER: u32 = 10_000; | |
pub fn is_odd(n: u32) -> bool { | |
n % 2 == 1 | |
} | |
pub fn f1(upper: u32) -> u32 { | |
let mut acc = 0; |
View dec_qq_number.rs
This file contains 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://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3a2c2557cb1b7d0a313c1e011ba16844 | |
use rand::prelude::*; | |
fn main() { | |
let mut rng = SmallRng::from_seed([0x56u8; 32]); | |
(0..10).for_each(|_| (rng.next_u32(), ()).1); | |
let key: [u8; 20] = [ | |
70, 121, 148, 150, 158, 158, 73, 14, 197, 164, 232, 30, 239, 6, 112, 10, 130, 30, 55, 173, | |
]; |
View main.cc
This file contains 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 <array> | |
#include <atomic> | |
#include <cstdint> | |
#include <cstdio> | |
#include <memory> | |
#include <thread> | |
#include "sqlite3.h" | |
using std::atomic; |
View ring-build-error.sh
This file contains 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
cargo build -Z build-std=std,panic_abort --target thumbv7a-uwp-windows-msvc | |
Compiling core v0.0.0 (C:\Users\bdbai\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core) | |
Compiling ring v0.16.20 | |
error: failed to run custom build command for `ring v0.16.20` | |
Caused by: | |
process didn't exit successfully: `D:\proj\ytflow\src\Maple\leaf\target\debug\build\ring-3b53a4a0d4ad7221\build-script-build` (exit code: 101) | |
--- stderr | |
thread 'main' panicked at '"C:\\Users\\bdbai\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\ring-0.16.20\\pregenerated\\aesv8-armx-linux32.obj": Os { code: 2, kind: NotFound, message: "系统找不到指定的文件。" }', C:\Users\bdbai\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-0.16.20\build.rs:769:10 | |
stack backtrace: |
View main.cc
This file contains 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 <string> | |
#include <type_traits> | |
// 使用了 https://github.com/irrequietus/typestring (Mozilla Public License 2.0) | |
// https://github.com/irrequietus/typestring/blob/master/typestring.hh | |
#include "typestring.hh" | |
// 事件参数 | |
struct PrivateMessageEvent { |
View main.rs
This file contains 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
use std::cmp::Ordering; | |
use std::collections::BinaryHeap; | |
use std::slice::Iter; | |
struct Item<'a> { | |
iter: Iter<'a, i32>, | |
elem: i32, | |
} | |
impl<'a> PartialEq for Item<'a> { | |
fn eq(&self, other: &Self) -> bool { |
View DeviceList.jsx
This file contains 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
class DeviceList extends Component { | |
initTable() { | |
$(this.refs.tableDom).bootgrid({ | |
formatters:{ | |
"operation":function(column , row){ | |
return 'aaa'; | |
} | |
} | |
}); | |
} |
View server.js
This file contains 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
var express = require('express'); | |
var cheerio = require('cheerio'); | |
var superagent = require('superagent'); | |
var app = express(); | |
app.get('/', (req, res) => { | |
Promise.all(Array.from(Array(42).keys()).map(i => // 从 0 到 41 | |
new Promise((resolve, reject) => { | |
superagent.get('http://ipn.li/kernelpanic/' + (i+1).toString()) | |
.end((err, sres) => { |
View coreclr-debug
This file contains 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
Starting 'dotnet --info' | |
.NET Command Line Tools (1.0.0-preview2-003121) | |
Product Information: | |
Version: 1.0.0-preview2-003121 | |
Commit SHA-1 hash: 1e9d529bc5 | |
Runtime Environment: | |
OS Name: opensuse | |
OS Version: 42.1 |
View youku_speedup.cs
This file contains 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; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
namespace HttpWebRequestDemo | |
{ | |
class Program | |
{ | |
async static Task<int> Run(string user, string pass) { |
NewerOlder