duplicates = multiple editions
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
| ### Keybase proof | |
| I hereby claim: | |
| * I am bhatti on github. | |
| * I am bhatti (https://keybase.io/bhatti) on keybase. | |
| * I have a public key ASD3eJLypkDzR9KhunFAlTg_r5qcGMn0xpUQVoRXA0otRgo | |
| To claim this, I am signing this object: |
Author: Chris Lattner
| #[async_trait] | |
| pub trait LockManager { | |
| // Attempts to acquire a lock until it either acquires the lock, or a specified additional_time_to_wait_for_lock_ms is | |
| // reached. This method will poll database based on the refresh_period. If it does not see the lock in database, it | |
| // will immediately return the lock to the caller. If it does see the lock, it will note the lease expiration on the lock. If | |
| // the lock is deemed stale, (that is, there is no heartbeat on it for at least the length of its lease duration) then this | |
| // will acquire and return it. Otherwise, if it waits for as long as additional_time_to_wait_for_lock_ms without acquiring the | |
| // lock, then it will return LockError::NotGranted. | |
| // | |
| async fn acquire_lock(&self, opts: &AcquireLockOptions) -> LockResult<MutexLock>; |
| let config = LocksConfig::new("test_tenant"); | |
| let mutex_repo = factory::build_mutex_repository(RepositoryProvider::Rdb, &config) | |
| .await.expect("failed to build mutex repository"); | |
| let semaphore_repo = factory::build_semaphore_repository( | |
| RepositoryProvider::Rdb, &config) | |
| .await.expect("failed to build semaphore repository"); | |
| let store = Box::new(DefaultLockStore::new(&config, mutex_repo, semaphore_repo)); | |
| let locks_manager = LockManagerImpl::new( | |
| &config, store, &default_registry()).expect("failed to initialize lock manager"); |
| let config = LocksConfig::new("test_tenant"); | |
| let mutex_repo = factory::build_mutex_repository(RepositoryProvider::Rdb, &config) | |
| .await.expect("failed to build mutex repository"); | |
| let semaphore_repo = factory::build_semaphore_repository( | |
| RepositoryProvider::Rdb, &config) | |
| .await.expect("failed to build semaphore repository"); | |
| let store = Box::new(DefaultLockStore::new(&config, mutex_repo, semaphore_repo)); | |
| let locks_manager = LockManagerImpl::new( | |
| &config, store, &default_registry()).expect("failed to initialize lock manager"); |
| let mutex_repo = factory::build_mutex_repository( | |
| RepositoryProvider::Ddb, &config).await.expect("failed to build mutex repository"); | |
| let semaphore_repo = factory::build_semaphore_repository( | |
| RepositoryProvider::Ddb, &config).await.expect("failed to build semaphore repository"); | |
| let store = Box::new(DefaultLockStore::new(&config, mutex_repo, semaphore_repo)); |
| let mutex_repo = factory::build_mutex_repository( | |
| RepositoryProvider::Redis, &config).await.expect("failed to build mutex repository"); | |
| let semaphore_repo = factory::build_semaphore_repository( | |
| RepositoryProvider::Redis, &config).await.expect("failed to build semaphore repository"); | |
| let store = Box::new(DefaultLockStore::new(&config, mutex_repo, semaphore_repo)); |