text stringlengths 9 39.2M | dir stringlengths 26 295 | lang stringclasses 185
values | created_date timestamp[us] | updated_date timestamp[us] | repo_name stringlengths 1 97 | repo_full_name stringlengths 7 106 | star int64 1k 183k | len_tokens int64 1 13.8M |
|---|---|---|---|---|---|---|---|---|
```lua
-- Gatekeeper - DDoS protection system.
--
-- This program is free software: you can redistribute it and/or modify
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or F... | /content/code_sandbox/lua/gatekeeper/policylib.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 2,850 |
```lua
-- Gatekeeper - DDoS protection system.
--
-- This program is free software: you can redistribute it and/or modify
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or F... | /content/code_sandbox/lua/gatekeeper/dylib.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 2,124 |
```lua
require "gatekeeper/staticlib"
local reply_msg = ""
local dyc = staticlib.c.get_dy_conf()
if dyc.gt ~= nil then
local function example()
print("Hello Gatekeeper!")
end
dylib.update_gt_lua_states(dyc.gt)
dylib.update_gt_lua_states_incrementally(dyc.gt, example, false)
return "gt: successfully updated t... | /content/code_sandbox/lua/examples/example_of_dynamic_config_request.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 2,064 |
```lua
local policylib = require("gatekeeper/policylib")
local ffi = require("ffi")
local function dcs_default(policy)
return policylib.decision_granted(policy,
1024, -- tx_rate_kib_sec
300, -- cap_expire_sec
240000, -- next_renewal_ms
3000) -- renewal_step_ms
end
local function dcs_malformed(policy)
return... | /content/code_sandbox/lua/examples/policy.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 2,229 |
```lua
-- Gatekeeper - DDoS protection system.
--
-- This program is free software: you can redistribute it and/or modify
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or F... | /content/code_sandbox/lua/gatekeeper/staticlib.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 4,284 |
```lua
require "gatekeeper/staticlib"
require "gatekeeper/policylib"
local dyc = staticlib.c.get_dy_conf()
if dyc.gt == nil then
return "Gatekeeper: failed to run as Grantor server\n"
end
-- The function assumes that the variable lpm, an IPv4 LPM table,
-- is globally available in the policy as in the policy exampl... | /content/code_sandbox/lua/examples/example_gt_lpm_params_request.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 178 |
```lua
require "gatekeeper/staticlib"
local dyc = staticlib.c.get_dy_conf()
if dyc == nil then
return "No dynamic configuration block available"
end
if dyc.gt == nil then
return "No GT block available; not a Grator server"
end
dylib.update_gt_lua_states(dyc.gt)
return "Successfully reloaded the Lua policy"
``` | /content/code_sandbox/gkctl/scripts/reload_policy.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 78 |
```lua
require "gatekeeper/staticlib"
local dyc = staticlib.c.get_dy_conf()
if dyc == nil then
return "No dynamic configuration block available"
end
if dyc.gk == nil then
return "No GK block available; not a Gatekeeper server"
end
local function print_only_grantor(fib_dump_entry, acc)
if fib_dump_entry.action ~= d... | /content/code_sandbox/gkctl/scripts/show_fib_grantor.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 138 |
```lua
require "gatekeeper/staticlib"
local dyc = staticlib.c.get_dy_conf()
if dyc == nil then
return "No dynamic configuration block available"
end
if dyc.gk == nil then
return "No GK block available; not a Gatekeeper server"
end
return table.concat(dylib.list_gk_fib6(dyc.gk, dylib.print_fib_dump_entry, {}))
``` | /content/code_sandbox/gkctl/scripts/show_fib6.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 86 |
```lua
require "gatekeeper/staticlib"
local dyc = staticlib.c.get_dy_conf()
if dyc == nil then
return "No dynamic configuration block available"
end
if dyc.gk == nil then
return "No GK block available; not a Gatekeeper server"
end
return table.concat(dylib.list_gk_neighbors4(dyc.gk,
dylib.print_neighbor_dump_entry,... | /content/code_sandbox/gkctl/scripts/show_neigh.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 85 |
```lua
require "gatekeeper/staticlib"
local dyc = staticlib.c.get_dy_conf()
if dyc == nil then
return "No dynamic configuration block available"
end
if dyc.gk == nil then
return "No GK block available; not a Gatekeeper server"
end
local function new_summary()
return { dup_fib_ids = {}, present_fib_ids = {} }
end
... | /content/code_sandbox/gkctl/scripts/check_fibs.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 412 |
```lua
require "gatekeeper/staticlib"
local dyc = staticlib.c.get_dy_conf()
if dyc == nil then
return "No dynamic configuration block available"
end
if dyc.gk == nil then
return "No GK block available; not a Gatekeeper server"
end
local function new_summary()
return { actions = {}, prefix_lengths = {} }
end
local... | /content/code_sandbox/gkctl/scripts/summarize_fibs.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 594 |
```lua
require "gatekeeper/staticlib"
local dyc = staticlib.c.get_dy_conf()
if dyc == nil then
return "No dynamic configuration block available"
end
if dyc.gk == nil then
return "No GK block available; not a Gatekeeper server"
end
local function print_only_grantor(fib_dump_entry, acc)
if fib_dump_entry.action ~= d... | /content/code_sandbox/gkctl/scripts/show_fib6_grantor.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 138 |
```lua
require "gatekeeper/staticlib"
local llsc = staticlib.c.get_lls_conf()
if llsc == nil then
return "No link layer support block available"
end
return table.concat(dylib.list_lls_arp(llsc, dylib.print_lls_dump_entry, {}))
``` | /content/code_sandbox/gkctl/scripts/show_arp.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 61 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/gkctl/main.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 2,062 |
```lua
require "gatekeeper/staticlib"
local llsc = staticlib.c.get_lls_conf()
if llsc == nil then
return "No link layer support block available"
end
return table.concat(dylib.list_lls_nd(llsc, dylib.print_lls_dump_entry, {}))
``` | /content/code_sandbox/gkctl/scripts/show_nd.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 60 |
```lua
require "gatekeeper/staticlib"
local dyc = staticlib.c.get_dy_conf()
if dyc == nil then
return "No dynamic configuration block available"
end
if dyc.gk == nil then
return "No GK block available; not a Gatekeeper server"
end
return table.concat(dylib.list_gk_neighbors6(dyc.gk,
dylib.print_neighbor_dump_entry,... | /content/code_sandbox/gkctl/scripts/show_neigh6.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 85 |
```lua
require "gatekeeper/staticlib"
local dyc = staticlib.c.get_dy_conf()
if dyc == nil then
return "No dynamic configuration block available"
end
if dyc.gk == nil then
return "No GK block available; not a Gatekeeper server"
end
return table.concat(dylib.list_gk_fib4(dyc.gk, dylib.print_fib_dump_entry, {}))
``` | /content/code_sandbox/gkctl/scripts/show_fib.lua | lua | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 86 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/config/static.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 3,532 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/config/dynamic.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 6,718 |
```shell
#!/bin/sh
if [ "$#" -eq "0" ]; then
echo "devbind.sh <interface> [<interface> ...]"
fi
for iface in $@; do
/usr/share/gatekeeper/dpdk-devbind.py --bind=vfio-pci $iface
done
``` | /content/code_sandbox/debian/devbind.sh | shell | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 66 |
```objective-c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTA... | /content/code_sandbox/gk/bpf.h | objective-c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 326 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/gk/bpf.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 4,667 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/gk/rt.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 21,753 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/gk/main.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 25,744 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/cps/main.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 10,093 |
```objective-c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTA... | /content/code_sandbox/cps/rd.h | objective-c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 213 |
```objective-c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTA... | /content/code_sandbox/cps/kni.h | objective-c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 380 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/cps/kni.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 3,628 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/cps/rd.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 11,636 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/bpf/declined.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 209 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/bpf/grantedv2.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 378 |
```objective-c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTA... | /content/code_sandbox/bpf/grantedv2.h | objective-c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 1,409 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/bpf/web.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 1,009 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/bpf/granted.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 879 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/bpf/tcp-services.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 2,569 |
```objective-c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTA... | /content/code_sandbox/bpf/libicmp.h | objective-c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 636 |
```c
/*
* Gatekeeper - DDoS protection system.
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or ... | /content/code_sandbox/ggu/main.c | c | 2016-07-06T18:53:45 | 2024-08-15T00:24:19 | gatekeeper | AltraMayor/gatekeeper | 1,280 | 6,883 |
```rust
// Automatically detect tsan in a way that's compatible with both stable (which
// doesn't support sanitizers) and nightly (which does). Works because build
// scripts gets `cfg` info, even if the cfg is unstable.
fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rustc-check-cfg=c... | /content/code_sandbox/core/build.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 133 |
```toml
status = [
"build_tier_one",
"build_other_platforms",
]
``` | /content/code_sandbox/bors.toml | toml | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 20 |
```rust
use parking_lot::RwLock;
struct Lock(RwLock<i32>);
#[test]
fn issue_392() {
let lock = Lock(RwLock::new(0));
let mut rl = lock.0.upgradable_read();
rl.with_upgraded(|_| {
println!("lock upgrade");
});
rl.with_upgraded(|_| {
println!("lock upgrade");
});
}
``` | /content/code_sandbox/tests/issue_392.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 85 |
```rust
use parking_lot::RwLock;
use std::thread;
struct Bar(RwLock<()>);
impl Drop for Bar {
fn drop(&mut self) {
let _n = self.0.write();
}
}
thread_local! {
static B: Bar = Bar(RwLock::new(()));
}
#[test]
fn main() {
thread::spawn(|| {
B.with(|_| ());
let a = RwLock::new(... | /content/code_sandbox/tests/issue_203.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 114 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
// Option::unchecked_unwrap
pub trait UncheckedOptionExt<T> {
unsafe fn unchecked_unwrap(self) -> T;
}
impl<T> UncheckedOptionExt<T>... | /content/code_sandbox/core/src/util.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 173 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::thread_parker;
use core::hint::spin_loop;
// Wastes some CPU time for the given number of iterations,
// using a hint to indi... | /content/code_sandbox/core/src/spinwait.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 471 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
//! This library exposes a low-level API for creating your own efficient
//! synchronization primitives.
//!
//! # The parking lot
//!
//... | /content/code_sandbox/core/src/lib.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 579 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::spinwait::SpinWait;
use crate::thread_parker::{ThreadParker, ThreadParkerT, UnparkHandleT};
use core::{
cell::Cell,
me... | /content/code_sandbox/core/src/word_lock.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 2,341 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use core::sync::atomic::{AtomicBool, Ordering};
use std::time::Instant;
use std::{
io,
os::fortanix_sgx::{
thread::curren... | /content/code_sandbox/core/src/thread_parker/sgx.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 599 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
//! The wasm platform can't park when atomic support is not available.
//! So this ThreadParker just panics on any attempt to park.
use ... | /content/code_sandbox/core/src/thread_parker/wasm.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 304 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use core::{
ptr,
sync::atomic::{AtomicI32, Ordering},
};
use std::thread;
use std::time::Instant;
use syscall::{
call::futex,... | /content/code_sandbox/core/src/thread_parker/redox.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 921 |
```rust
use cfg_if::cfg_if;
use std::time::Instant;
/// Trait for the platform thread parker implementation.
///
/// All unsafe methods are unsafe because the Unix thread parker is based on
/// pthread mutexes and condvars. Those primitives must not be moved and used
/// from any other memory address than the one they... | /content/code_sandbox/core/src/thread_parker/mod.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 766 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use core::{
ptr,
sync::atomic::{AtomicI32, Ordering},
};
use libc;
use std::thread;
use std::time::Instant;
// x32 Linux uses a ... | /content/code_sandbox/core/src/thread_parker/linux.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 1,067 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use core::{
arch::wasm32,
sync::atomic::{AtomicI32, Ordering},
};
use std::time::{Duration, Instant};
use std::{convert::TryFrom,... | /content/code_sandbox/core/src/thread_parker/wasm_atomic.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 700 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
#[cfg(target_vendor = "apple")]
use core::ptr;
use core::{
cell::{Cell, UnsafeCell},
mem::MaybeUninit,
};
use libc;
use std::time... | /content/code_sandbox/core/src/thread_parker/unix.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 2,067 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
//! A simple spin lock based thread parker. Used on platforms without better
//! parking facilities available.
use core::hint::spin_loop... | /content/code_sandbox/core/src/thread_parker/generic.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 447 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use core::{
mem,
sync::atomic::{AtomicUsize, Ordering},
};
use std::{ffi, time::Instant};
use super::bindings::*;
#[allow(non_s... | /content/code_sandbox/core/src/thread_parker/windows/waitaddress.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 936 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use core::{
ptr,
sync::atomic::{AtomicPtr, AtomicUsize, Ordering},
};
use std::time::Instant;
mod bindings;
mod keyed_event;
mod... | /content/code_sandbox/core/src/thread_parker/windows/mod.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 1,332 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::thread_parker::{ThreadParker, ThreadParkerT, UnparkHandleT};
use crate::util::UncheckedOptionExt;
use crate::word_lock::WordLoc... | /content/code_sandbox/core/src/parking_lot.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 13,685 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use core::{
ffi,
mem::{self, MaybeUninit},
ptr,
};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::Instant;
c... | /content/code_sandbox/core/src/thread_parker/windows/keyed_event.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 1,544 |
```rust
//! Manual bindings to the win32 API to avoid dependencies on windows-sys or winapi
//! as these bindings will **never** change and `parking_lot_core` is a foundational
//! dependency for the Rust ecosystem, so the dependencies used by it have an
//! outsize affect
pub const INFINITE: u32 = 4294967295;
pub con... | /content/code_sandbox/core/src/thread_parker/windows/bindings.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 394 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use std::{env, process};
#[derive(Copy, Clone)]
pub struct ArgRange {
current: usize,
limit: usize,
step: usize,
}
impl Arg... | /content/code_sandbox/benchmark/src/args.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 763 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
mod args;
use crate::args::ArgRange;
#[cfg(any(windows, unix))]
use std::cell::UnsafeCell;
use std::{
sync::{
atomic::{Atomi... | /content/code_sandbox/benchmark/src/rwlock.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 2,923 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
mod args;
use crate::args::ArgRange;
#[cfg(any(windows, unix))]
use std::cell::UnsafeCell;
use std::{
sync::{
atomic::{Atomi... | /content/code_sandbox/benchmark/src/mutex.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 2,126 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::raw_mutex::RawMutex;
use lock_api::RawMutexFair;
/// Raw fair mutex type backed by the parking lot.
pub struct RawFairMutex(R... | /content/code_sandbox/src/raw_fair_mutex.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 391 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use std::sync::atomic::AtomicUsize;
// Extension trait to add lock elision primitives to atomic types
pub trait AtomicElisionExt {
t... | /content/code_sandbox/src/elision.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 735 |
```rust
//! \[Experimental\] Deadlock detection
//!
//! This feature is optional and can be enabled via the `deadlock_detection` feature flag.
//!
//! # Example
//!
//! ```
//! #[cfg(feature = "deadlock_detection")]
//! { // only for #[cfg]
//! use std::thread;
//! use std::time::Duration;
//! use parking_lot::deadlock... | /content/code_sandbox/src/deadlock.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 1,564 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use std::time::{Duration, Instant};
// Option::unchecked_unwrap
pub trait UncheckedOptionExt<T> {
unsafe fn unchecked_unwrap(self) -... | /content/code_sandbox/src/util.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 210 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::raw_fair_mutex::RawFairMutex;
/// A mutual exclusive primitive that is always fair, useful for protecting shared data
///
///... | /content/code_sandbox/src/fair_mutex.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 2,193 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::util::UncheckedOptionExt;
use core::{
fmt, mem,
sync::atomic::{fence, AtomicU8, Ordering},
};
use parking_lot_core::{s... | /content/code_sandbox/src/once.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 3,119 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::raw_rwlock::RawRwLock;
/// A reader-writer lock
///
/// This type of lock allows a number of readers or at most one writer at... | /content/code_sandbox/src/rwlock.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 4,689 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::{deadlock, util};
use core::{
sync::atomic::{AtomicU8, Ordering},
time::Duration,
};
use lock_api::RawMutex as RawMute... | /content/code_sandbox/src/raw_mutex.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 2,547 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
//! This library provides implementations of `Mutex`, `RwLock`, `Condvar` and
//! `Once` that are smaller, faster and more flexible than ... | /content/code_sandbox/src/lib.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 520 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::mutex::MutexGuard;
use crate::raw_mutex::{RawMutex, TOKEN_HANDOFF, TOKEN_NORMAL};
use crate::{deadlock, util};
use core::{
... | /content/code_sandbox/src/condvar.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 9,539 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::raw_mutex::RawMutex;
/// A mutual exclusion primitive useful for protecting shared data
///
/// This mutex will block threads... | /content/code_sandbox/src/mutex.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 2,476 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::raw_mutex::RawMutex;
use core::num::NonZeroUsize;
use lock_api::{self, GetThreadId};
/// Implementation of the `GetThreadId` ... | /content/code_sandbox/src/remutex.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 1,324 |
```rust
fn main() {
let cfg = autocfg::new();
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rustc-check-cfg=cfg(has_const_fn_trait_bound)");
if cfg.probe_rustc_version(1, 61) {
println!("cargo:rustc-cfg=has_const_fn_trait_bound");
}
}
``` | /content/code_sandbox/lock_api/build.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 81 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::elision::{have_elision, AtomicElisionExt};
use crate::raw_mutex::{TOKEN_HANDOFF, TOKEN_NORMAL};
use crate::util;
use core::{
... | /content/code_sandbox/src/raw_rwlock.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 8,191 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
//! This library provides type-safe and fully-featured [`Mutex`] and [`RwLock`]
//! types which wrap a simple raw mutex or rwlock type. T... | /content/code_sandbox/lock_api/src/lib.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 997 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use core::cell::UnsafeCell;
use core::fmt;
use core::marker::PhantomData;
use core::mem;
use core::ops::{Deref, DerefMut};
#[cfg(feature... | /content/code_sandbox/lock_api/src/mutex.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 8,238 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use core::cell::UnsafeCell;
use core::fmt;
use core::marker::PhantomData;
use core::mem;
use core::ops::{Deref, DerefMut};
#[cfg(feature... | /content/code_sandbox/lock_api/src/rwlock.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 27,358 |
```rust
//
// path_to_url or the MIT license <LICENSE-MIT or
// path_to_url at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::{
mutex::{RawMutex, RawMutexFair, RawMutexTimed},
GuardNoSend,
};
use core::{
cell::{Cell, UnsafeCell},
fmt,
... | /content/code_sandbox/lock_api/src/remutex.rs | rust | 2016-05-13T10:59:24 | 2024-08-16T17:17:37 | parking_lot | Amanieu/parking_lot | 2,662 | 9,186 |
```qmake
#Use 5 step of optimization
#-optimizationpasses 5
#When not preverifing in a case-insensitive filing system, such as Windows. This tool will unpack your processed jars,(if using windows you should then use):
-dontusemixedcaseclassnames
#Specifies not to ignore non-public library classes. As of version 4.5,... | /content/code_sandbox/app/proguard-rules.pro | qmake | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 1,101 |
```java
package com.example.yanjiang.stockchart;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 +... | /content/code_sandbox/app/src/test/java/com/example/yanjiang/stockchart/ExampleUnitTest.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 74 |
```java
package com.example.yanjiang.stockchart;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class MainActivity extends BaseActivity {
@Bind(R.id.btn)
... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/MainActivity.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 230 |
```java
package com.example.yanjiang.stockchart;
import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.Toast;
import com.example.yanjiang.stockchart.api.ClientApi;
import com.example.yanjiang.stockchart.application.App;
import com.example.yanjiang.stock... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/BaseActivity.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 398 |
```java
package com.example.yanjiang.stockchart;
import android.graphics.Color;
import android.graphics.Matrix;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.NonNull;
import android.util.Log;
import com.example.yanjiang.stockchart.api.ConstantTest;
i... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/KLineActivity.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 3,321 |
```java
package com.example.yanjiang.stockchart;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseArray;
import com.example.yanjiang.stockchart.api.ConstantTest;
import com.example.yanjiang.stockchart.bean.DataParse;
import com.... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/MinutesActivity.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 3,616 |
```java
package com.example.yanjiang.stockchart.application;
import android.app.Application;
import com.example.yanjiang.stockchart.BuildConfig;
import com.example.yanjiang.stockchart.inject.component.AppComponent;
import com.example.yanjiang.stockchart.inject.component.DaggerAppComponent;
import com.example.yanjiang... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/application/App.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 252 |
```java
package com.example.yanjiang.stockchart;
/**
* authorajiang
* mail1025065158@qq.com
* blogpath_to_url
*/
public class Test {
/* private ArrayList<Integer> listA, listB;
private int sum;
public static void main(String[] args) {
Test test=new Test();
test.listA = new ArrayList... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/Test.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 457 |
```java
package com.example.yanjiang.stockchart.bean;
public class MinutesBean {
public String time;
public float cjprice;
public float cjnum;
public float avprice = Float.NaN;
public float per;
public float cha;
public float total;
public int color = 0xff000000;
}
``` | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/bean/MinutesBean.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 69 |
```java
package com.example.yanjiang.stockchart.bean;
/**
* authorajiang
* mail1025065158@qq.com
* blogpath_to_url
*/
public class KLineBean {
public String date;
public float open;
public float close;
public float high;
public float low;
public float vol;
}
``` | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/bean/KLineBean.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 70 |
```java
package com.example.yanjiang.stockchart.service;
import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import android.os.Environment;
import android.util.Log;
import com.example.yanjiang.stockchart.api.Constant;
import com.example.yanjiang.stockchart.api.DownLoadApi;... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/service/DownLoadService.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 830 |
```java
package com.example.yanjiang.stockchart.bean;
import android.util.SparseArray;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.ArrayList;
public class DataParse {
private ArrayList<MinutesBean> datas = new ArrayList<>();
private ArrayList<KLineBean> kDatas = new ArrayList<>()... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/bean/DataParse.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 992 |
```java
package com.example.yanjiang.stockchart.interceptor;
import java.io.IOException;
import okhttp3.Interceptor;
import okhttp3.Response;
public class ProgressInterceptor implements Interceptor
{
// private ProgressListener progressListener;
/* public ProgressInterceptor(ProgressListener progressListen... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/interceptor/ProgressInterceptor.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 116 |
```java
package com.example.yanjiang.stockchart.interceptor;
import java.io.IOException;
import okhttp3.Interceptor;
import okhttp3.MediaType;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import okio.Buffer;
/**
* Created by yanjiang on 2016/3/7.
*/
public class LoggingInterceptor... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/interceptor/LoggingInterceptor.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 723 |
```java
package com.example.yanjiang.stockchart.interceptor;
import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.Nullable;
import android.util.Base64;
import java.io.IOException;
import java.util.Random;
import okhttp3.Interceptor;
import okhttp3.Request;
impor... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/interceptor/HttpInterceptor.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 683 |
```java
package com.example.yanjiang.stockchart.interceptor;
import com.example.yanjiang.stockchart.application.App;
import com.example.yanjiang.stockchart.event.ProgressUpdateEvent;
import java.io.IOException;
import okhttp3.MediaType;
import okhttp3.ResponseBody;
import okio.Buffer;
import okio.BufferedSource;
im... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/interceptor/ProgressResponseBody.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 370 |
```java
package com.example.yanjiang.stockchart.inject.component;
import android.content.Context;
import android.content.SharedPreferences;
import com.example.yanjiang.stockchart.api.ClientApi;
import com.example.yanjiang.stockchart.api.DownLoadApi;
import com.example.yanjiang.stockchart.application.App;
import com.e... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/inject/component/AppComponent.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 144 |
```java
package com.example.yanjiang.stockchart.inject.component;
import android.app.Activity;
import com.example.yanjiang.stockchart.BaseActivity;
import com.example.yanjiang.stockchart.inject.modules.ActivityModule;
import com.example.yanjiang.stockchart.inject.others.PerActivity;
import dagger.Component;
@PerAct... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/inject/component/ActivityComponent.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 96 |
```java
package com.example.yanjiang.stockchart.inject.component;
import android.app.Activity;
import com.example.yanjiang.stockchart.inject.modules.FragmentModule;
import com.example.yanjiang.stockchart.inject.others.PerFragment;
import dagger.Component;
@PerFragment
@Component(modules = FragmentModule.class, depe... | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/inject/component/FragmentComponent.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 86 |
```java
package com.example.yanjiang.stockchart.inject.others;
import java.lang.annotation.Retention;
import javax.inject.Scope;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Scope
@Retention(RUNTIME)
public @interface PerFragment {
}
``` | /content/code_sandbox/app/src/main/java/com/example/yanjiang/stockchart/inject/others/PerFragment.java | java | 2016-05-18T03:51:41 | 2024-08-09T09:00:29 | StockChart | AndroidJiang/StockChart | 1,086 | 51 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.