text:
.class public Lcom/baidu/internal/contacts/YellowPhotoManager;
.super Ljava/lang/Object;
.source "YellowPhotoManager.java"

# interfaces
.implements Landroid/os/Handler$Callback;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/baidu/internal/contacts/YellowPhotoManager$Request;,
        Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;,
        Lcom/baidu/internal/contacts/YellowPhotoManager$LoaderThread;
    }
.end annotation

# static fields
.field public static final COLUMN_NUMBER:I = 0x0

.field public static final COLUMN_PHOTO:I = 0x1

.field private static DBG:Z = false

.field private static final EMPTY_STRING_ARRAY:[Ljava/lang/String; = null

.field private static final HOLDER_CACHE_SIZE:I = 0x1f4

.field private static final MESSAGE_PHOTOS_LOADED:I = 0x2

.field private static final MESSAGE_REQUEST_LOADING:I = 0x1

.field private static final PHOTO_COLUMNS:[Ljava/lang/String; = null

.field static final TAG:Ljava/lang/String; = "YellowPhotoManager"

.field private static mPhotoManager:Lcom/baidu/internal/contacts/YellowPhotoManager;

# instance fields
.field private final mBitmapHolderCache:Landroid/util/LruCache;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/util/LruCache",
            "<",
            "Ljava/lang/Object;",
            "Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;",
            ">;"
        }
    .end annotation
.end field

.field private final mContext:Landroid/content/Context;

.field private mLoaderThread:Lcom/baidu/internal/contacts/YellowPhotoManager$LoaderThread;

.field private mLoadingRequested:Z

.field private final mMainThreadHandler:Landroid/os/Handler;

.field private final mPendingRequests:Ljava/util/concurrent/ConcurrentHashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/ConcurrentHashMap",
            "<",
            "Landroid/widget/ImageView;",
            "Lcom/baidu/internal/contacts/YellowPhotoManager$Request;",
            ">;"
        }
    .end annotation
.end field

# direct methods
.method static constructor <clinit>()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 41
    sput-boolean v2, Lcom/baidu/internal/contacts/YellowPhotoManager;->DBG:Z

    .line 47
    new-array v0, v2, [Ljava/lang/String;

    sput-object v0, Lcom/baidu/internal/contacts/YellowPhotoManager;->EMPTY_STRING_ARRAY:[Ljava/lang/String;

    .line 55
    const/4 v0, 0x2

    new-array v0, v0, [Ljava/lang/String;

    const-string/jumbo v1, "number"

    aput-object v1, v0, v2

    const/4 v1, 0x1

    const-string/jumbo v2, "photo"

    aput-object v2, v0, v1

    sput-object v0, Lcom/baidu/internal/contacts/YellowPhotoManager;->PHOTO_COLUMNS:[Ljava/lang/String;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 3
    .parameter "context"

    .prologue
    .line 86
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 64
    new-instance v1, Landroid/os/Handler;

    invoke-direct {v1, p0}, Landroid/os/Handler;-><init>(Landroid/os/Handler$Callback;)V

    iput-object v1, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mMainThreadHandler:Landroid/os/Handler;

    .line 76
    new-instance v1, Ljava/util/concurrent/ConcurrentHashMap;

    invoke-direct {v1}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V

    iput-object v1, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mPendingRequests:Ljava/util/concurrent/ConcurrentHashMap;

    .line 87
    iput-object p1, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mContext:Landroid/content/Context;

    .line 89
    const/16 v0, 0x1f4

    .line 90
    .local v0, holderCacheSize:I
    new-instance v1, Lcom/baidu/internal/contacts/YellowPhotoManager$1;

    const/16 v2, 0x1f4

    invoke-direct {v1, p0, v2}, Lcom/baidu/internal/contacts/YellowPhotoManager$1;-><init>(Lcom/baidu/internal/contacts/YellowPhotoManager;I)V

    iput-object v1, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mBitmapHolderCache:Landroid/util/LruCache;

    .line 92
    return-void
.end method

.method static synthetic access$200(Lcom/baidu/internal/contacts/YellowPhotoManager;Ljava/util/Set;Ljava/util/Set;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"
    .parameter "x2"

    .prologue
    .line 35
    invoke-direct {p0, p1, p2}, Lcom/baidu/internal/contacts/YellowPhotoManager;->obtainNumbersAndPhotoUris(Ljava/util/Set;Ljava/util/Set;)V

    return-void
.end method

.method static synthetic access$300()[Ljava/lang/String;
    .locals 1

    .prologue
    .line 35
    sget-object v0, Lcom/baidu/internal/contacts/YellowPhotoManager;->PHOTO_COLUMNS:[Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$400()[Ljava/lang/String;
    .locals 1

    .prologue
    .line 35
    sget-object v0, Lcom/baidu/internal/contacts/YellowPhotoManager;->EMPTY_STRING_ARRAY:[Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$500(Lcom/baidu/internal/contacts/YellowPhotoManager;Ljava/lang/Object;[B)V
    .locals 0
    .parameter "x0"
    .parameter "x1"
    .parameter "x2"

    .prologue
    .line 35
    invoke-direct {p0, p1, p2}, Lcom/baidu/internal/contacts/YellowPhotoManager;->cacheBitmap(Ljava/lang/Object;[B)V

    return-void
.end method

.method static synthetic access$600(Lcom/baidu/internal/contacts/YellowPhotoManager;Ljava/lang/Object;Z)V
    .locals 0
    .parameter "x0"
    .parameter "x1"
    .parameter "x2"

    .prologue
    .line 35
    invoke-direct {p0, p1, p2}, Lcom/baidu/internal/contacts/YellowPhotoManager;->cacheBitmap(Ljava/lang/Object;Z)V

    return-void
.end method

.method static synthetic access$700(Lcom/baidu/internal/contacts/YellowPhotoManager;)Landroid/os/Handler;
    .locals 1
    .parameter "x0"

    .prologue
    .line 35
    iget-object v0, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mMainThreadHandler:Landroid/os/Handler;

    return-object v0
.end method

.method private cacheBitmap(Ljava/lang/Object;Z)V
    .locals 2
    .parameter "key"
    .parameter "isYellow"

    .prologue
    .line 216
    new-instance v0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;

    invoke-direct {v0, p2}, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;-><init>(Z)V

    .line 217
    .local v0, holder:Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;
    iget-object v1, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mBitmapHolderCache:Landroid/util/LruCache;

    invoke-virtual {v1, p1, v0}, Landroid/util/LruCache;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 218
    return-void
.end method

.method private cacheBitmap(Ljava/lang/Object;[B)V
    .locals 2
    .parameter "key"
    .parameter "bytes"

    .prologue
    .line 210
    new-instance v0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;

    invoke-direct {v0, p2}, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;-><init>([B)V

    .line 211
    .local v0, holder:Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;
    invoke-static {v0}, Lcom/baidu/internal/contacts/YellowPhotoManager;->inflateBitmap(Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;)V

    .line 212
    iget-object v1, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mBitmapHolderCache:Landroid/util/LruCache;

    invoke-virtual {v1, p1, v0}, Landroid/util/LruCache;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 213
    return-void
.end method

.method public static getInstance(Landroid/content/Context;)Lcom/baidu/internal/contacts/YellowPhotoManager;
    .locals 1
    .parameter "context"

    .prologue
    .line 80
    sget-object v0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mPhotoManager:Lcom/baidu/internal/contacts/YellowPhotoManager;

    if-nez v0, :cond_0

    .line 81
    new-instance v0, Lcom/baidu/internal/contacts/YellowPhotoManager;

    invoke-direct {v0, p0}, Lcom/baidu/internal/contacts/YellowPhotoManager;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mPhotoManager:Lcom/baidu/internal/contacts/YellowPhotoManager;

    .line 83
    :cond_0
    sget-object v0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mPhotoManager:Lcom/baidu/internal/contacts/YellowPhotoManager;

    return-object v0
.end method

.method private static inflateBitmap(Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;)V
    .locals 5
    .parameter "holder"

    .prologue
    .line 221
    iget-object v1, p0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;->bytes:[B

    .line 222
    .local v1, bytes:[B
    if-eqz v1, :cond_0

    array-length v2, v1

    if-nez v2, :cond_1

    .line 240
    :cond_0
    :goto_0
    return-void

    .line 226
    :cond_1
    iget-object v2, p0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;->bitmapRef:Ljava/lang/ref/Reference;

    if-eqz v2, :cond_2

    .line 227
    iget-object v2, p0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;->bitmapRef:Ljava/lang/ref/Reference;

    invoke-virtual {v2}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/graphics/Bitmap;

    iput-object v2, p0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;->bitmap:Landroid/graphics/Bitmap;

    .line 228
    iget-object v2, p0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;->bitmap:Landroid/graphics/Bitmap;

    if-nez v2, :cond_0

    .line 234
    :cond_2
    const/4 v2, 0x0

    :try_start_0
    array-length v3, v1

    const/4 v4, 0x0

    invoke-static {v1, v2, v3, v4}, Landroid/graphics/BitmapFactory;->decodeByteArray([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 235
    .local v0, bitmap:Landroid/graphics/Bitmap;
    iput-object v0, p0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;->bitmap:Landroid/graphics/Bitmap;

    .line 236
    new-instance v2, Ljava/lang/ref/SoftReference;

    invoke-direct {v2, v0}, Ljava/lang/ref/SoftReference;-><init>(Ljava/lang/Object;)V

    iput-object v2, p0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;->bitmapRef:Ljava/lang/ref/Reference;
    :try_end_0
    .catch Ljava/lang/OutOfMemoryError; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 237
    .end local v0           #bitmap:Landroid/graphics/Bitmap;
    :catch_0
    move-exception v2

    goto :goto_0
.end method

.method private loadCachedPhoto(Landroid/widget/ImageView;Lcom/baidu/internal/contacts/YellowPhotoManager$Request;)Z
    .locals 5
    .parameter "view"
    .parameter "request"

    .prologue
    const/4 v1, 0x1

    .line 178
    iget-object v2, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mBitmapHolderCache:Landroid/util/LruCache;

    invoke-virtual {p2}, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->getKey()Ljava/lang/Object;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/util/LruCache;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;

    .line 179
    .local v0, holder:Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;
    if-nez v0, :cond_1

    .line 180
    sget-boolean v1, Lcom/baidu/internal/contacts/YellowPhotoManager;->DBG:Z

    if-eqz v1, :cond_0

    .line 181
    const-string v1, "YellowPhotoManager"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "holder not cached, key = "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p2}, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->getKey()Ljava/lang/Object;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 183
    :cond_0
    invoke-virtual {p2, p1}, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->applyDefaultIcon(Landroid/widget/ImageView;)V

    .line 184
    const/4 v1, 0x0

    .line 206
    :goto_0
    return v1

    .line 187
    :cond_1
    iget-boolean v2, v0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;->isYellow:Z

    if-nez v2, :cond_3

    .line 188
    sget-boolean v2, Lcom/baidu/internal/contacts/YellowPhotoManager;->DBG:Z

    if-eqz v2, :cond_2

    .line 189
    const-string v2, "YellowPhotoManager"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "holder is not yellow, key = "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p2}, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->getKey()Ljava/lang/Object;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 191
    :cond_2
    invoke-virtual {p2, p1}, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->applyDefaultIcon(Landroid/widget/ImageView;)V

    goto :goto_0

    .line 195
    :cond_3
    iget-object v2, v0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;->bytes:[B

    if-nez v2, :cond_5

    .line 196
    sget-boolean v2, Lcom/baidu/internal/contacts/YellowPhotoManager;->DBG:Z

    if-eqz v2, :cond_4

    .line 197
    const-string v2, "YellowPhotoManager"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "holder.bytes is null, key = "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p2}, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->getKey()Ljava/lang/Object;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 199
    :cond_4
    invoke-virtual {p2, p1}, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->applyYellowIcon(Landroid/widget/ImageView;)V

    goto :goto_0

    .line 203
    :cond_5
    invoke-static {v0}, Lcom/baidu/internal/contacts/YellowPhotoManager;->inflateBitmap(Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;)V

    .line 204
    iget-object v2, v0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;->bitmap:Landroid/graphics/Bitmap;

    invoke-virtual {p1, v2}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 205
    const/4 v2, 0x0

    iput-object v2, v0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;->bitmap:Landroid/graphics/Bitmap;

    goto :goto_0
.end method

.method private loadPhoto(Landroid/widget/ImageView;Lcom/baidu/internal/contacts/YellowPhotoManager$Request;)V
    .locals 2
    .parameter "view"
    .parameter "request"

    .prologue
    .line 105
    invoke-direct {p0, p1, p2}, Lcom/baidu/internal/contacts/YellowPhotoManager;->loadCachedPhoto(Landroid/widget/ImageView;Lcom/baidu/internal/contacts/YellowPhotoManager$Request;)Z

    move-result v0

    .line 106
    .local v0, loaded:Z
    if-eqz v0, :cond_0

    .line 107
    iget-object v1, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mPendingRequests:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v1, p1}, Ljava/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 112
    :goto_0
    return-void

    .line 109
    :cond_0
    iget-object v1, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mPendingRequests:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v1, p1, p2}, Ljava/util/concurrent/ConcurrentHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 110
    invoke-direct {p0}, Lcom/baidu/internal/contacts/YellowPhotoManager;->requestLoading()V

    goto :goto_0
.end method

.method private obtainNumbersAndPhotoUris(Ljava/util/Set;Ljava/util/Set;)V
    .locals 5
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;",
            "Ljava/util/Set",
            "<",
            "Landroid/net/Uri;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 249
    .local p1, numbers:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    .local p2, uris:Ljava/util/Set;,"Ljava/util/Set<Landroid/net/Uri;>;"
    invoke-interface {p1}, Ljava/util/Set;->clear()V

    .line 250
    invoke-interface {p2}, Ljava/util/Set;->clear()V

    .line 251
    iget-object v3, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mPendingRequests:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v3}, Ljava/util/concurrent/ConcurrentHashMap;->values()Ljava/util/Collection;

    move-result-object v3

    invoke-interface {v3}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 252
    .local v1, iterator:Ljava/util/Iterator;,"Ljava/util/Iterator<Lcom/baidu/internal/contacts/YellowPhotoManager$Request;>;"
    :cond_0
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_2

    .line 253
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;

    .line 254
    .local v2, request:Lcom/baidu/internal/contacts/YellowPhotoManager$Request;
    iget-object v3, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mBitmapHolderCache:Landroid/util/LruCache;

    invoke-virtual {v2}, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->getKey()Ljava/lang/Object;

    move-result-object v4

    invoke-virtual {v3, v4}, Landroid/util/LruCache;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;

    .line 255
    .local v0, holder:Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;
    if-nez v0, :cond_0

    .line 256
    invoke-virtual {v2}, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->isUriRequest()Z

    move-result v3

    if-eqz v3, :cond_1

    .line 257
    #getter for: Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->mUri:Landroid/net/Uri;
    invoke-static {v2}, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->access$000(Lcom/baidu/internal/contacts/YellowPhotoManager$Request;)Landroid/net/Uri;

    move-result-object v3

    invoke-interface {p2, v3}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 259
    :cond_1
    #getter for: Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->mNumber:Ljava/lang/String;
    invoke-static {v2}, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->access$100(Lcom/baidu/internal/contacts/YellowPhotoManager$Request;)Ljava/lang/String;

    move-result-object v3

    invoke-interface {p1, v3}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 263
    .end local v0           #holder:Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;
    .end local v2           #request:Lcom/baidu/internal/contacts/YellowPhotoManager$Request;
    :cond_2
    return-void
.end method

.method private processLoadedImages()V
    .locals 5

    .prologue
    .line 147
    iget-object v4, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mPendingRequests:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v4}, Ljava/util/concurrent/ConcurrentHashMap;->keySet()Ljava/util/Set;

    move-result-object v4

    invoke-interface {v4}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .line 148
    .local v0, iterator:Ljava/util/Iterator;,"Ljava/util/Iterator<Landroid/widget/ImageView;>;"
    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_1

    .line 149
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroid/widget/ImageView;

    .line 150
    .local v3, view:Landroid/widget/ImageView;
    iget-object v4, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mPendingRequests:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v4, v3}, Ljava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;

    .line 151
    .local v1, key:Lcom/baidu/internal/contacts/YellowPhotoManager$Request;
    invoke-direct {p0, v3, v1}, Lcom/baidu/internal/contacts/YellowPhotoManager;->loadCachedPhoto(Landroid/widget/ImageView;Lcom/baidu/internal/contacts/YellowPhotoManager$Request;)Z

    move-result v2

    .line 152
    .local v2, loaded:Z
    if-eqz v2, :cond_0

    .line 153
    invoke-interface {v0}, Ljava/util/Iterator;->remove()V

    goto :goto_0

    .line 157
    .end local v1           #key:Lcom/baidu/internal/contacts/YellowPhotoManager$Request;
    .end local v2           #loaded:Z
    .end local v3           #view:Landroid/widget/ImageView;
    :cond_1
    invoke-direct {p0}, Lcom/baidu/internal/contacts/YellowPhotoManager;->softenCache()V

    .line 159
    sget-boolean v4, Lcom/baidu/internal/contacts/YellowPhotoManager;->DBG:Z

    if-eqz v4, :cond_2

    .line 160
    invoke-direct {p0}, Lcom/baidu/internal/contacts/YellowPhotoManager;->showRequestsStatus()V

    .line 163
    :cond_2
    iget-object v4, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mPendingRequests:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v4}, Ljava/util/concurrent/ConcurrentHashMap;->isEmpty()Z

    move-result v4

    if-nez v4, :cond_3

    .line 164
    invoke-direct {p0}, Lcom/baidu/internal/contacts/YellowPhotoManager;->requestLoading()V

    .line 166
    :cond_3
    return-void
.end method

.method private requestLoading()V
    .locals 2

    .prologue
    const/4 v1, 0x1

    .line 115
    iget-boolean v0, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mLoadingRequested:Z

    if-nez v0, :cond_0

    .line 116
    iput-boolean v1, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mLoadingRequested:Z

    .line 117
    iget-object v0, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mMainThreadHandler:Landroid/os/Handler;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    .line 119
    :cond_0
    return-void
.end method

.method private showRequestsStatus()V
    .locals 5

    .prologue
    .line 169
    const-string v2, "YellowPhotoManager"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v4, "photo: size of pending requests = "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    iget-object v4, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mPendingRequests:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v4}, Ljava/util/concurrent/ConcurrentHashMap;->size()I

    move-result v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 170
    iget-object v2, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mPendingRequests:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v2}, Ljava/util/concurrent/ConcurrentHashMap;->keySet()Ljava/util/Set;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .line 171
    .local v0, iterator:Ljava/util/Iterator;,"Ljava/util/Iterator<Landroid/widget/ImageView;>;"
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 172
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    .line 173
    .local v1, view:Landroid/widget/ImageView;
    iget-object v2, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mPendingRequests:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v2, v1}, Ljava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;

    goto :goto_0

    .line 175
    .end local v1           #view:Landroid/widget/ImageView;
    :cond_0
    return-void
.end method

.method private softenCache()V
    .locals 3

    .prologue
    .line 243
    iget-object v2, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mBitmapHolderCache:Landroid/util/LruCache;

    invoke-virtual {v2}, Landroid/util/LruCache;->snapshot()Ljava/util/Map;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/Map;->values()Ljava/util/Collection;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;

    .line 244
    .local v0, holder:Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;
    const/4 v2, 0x0

    iput-object v2, v0, Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;->bitmap:Landroid/graphics/Bitmap;

    goto :goto_0

    .line 246
    .end local v0           #holder:Lcom/baidu/internal/contacts/YellowPhotoManager$BitmapHolder;
    :cond_0
    return-void
.end method

# virtual methods
.method public ensureLoaderThread()V
    .locals 2

    .prologue
    .line 140
    iget-object v0, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mLoaderThread:Lcom/baidu/internal/contacts/YellowPhotoManager$LoaderThread;

    if-nez v0, :cond_0

    .line 141
    new-instance v0, Lcom/baidu/internal/contacts/YellowPhotoManager$LoaderThread;

    iget-object v1, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lcom/baidu/internal/contacts/YellowPhotoManager$LoaderThread;-><init>(Lcom/baidu/internal/contacts/YellowPhotoManager;Landroid/content/ContentResolver;)V

    iput-object v0, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mLoaderThread:Lcom/baidu/internal/contacts/YellowPhotoManager$LoaderThread;

    .line 142
    iget-object v0, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mLoaderThread:Lcom/baidu/internal/contacts/YellowPhotoManager$LoaderThread;

    invoke-virtual {v0}, Lcom/baidu/internal/contacts/YellowPhotoManager$LoaderThread;->start()V

    .line 144
    :cond_0
    return-void
.end method

.method public handleMessage(Landroid/os/Message;)Z
    .locals 3
    .parameter "msg"

    .prologue
    const/4 v0, 0x1

    const/4 v1, 0x0

    .line 123
    iget v2, p1, Landroid/os/Message;->what:I

    packed-switch v2, :pswitch_data_0

    move v0, v1

    .line 136
    :goto_0
    return v0

    .line 125
    :pswitch_0
    iput-boolean v1, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mLoadingRequested:Z

    .line 126
    invoke-virtual {p0}, Lcom/baidu/internal/contacts/YellowPhotoManager;->ensureLoaderThread()V

    .line 127
    iget-object v1, p0, Lcom/baidu/internal/contacts/YellowPhotoManager;->mLoaderThread:Lcom/baidu/internal/contacts/YellowPhotoManager$LoaderThread;

    invoke-virtual {v1}, Lcom/baidu/internal/contacts/YellowPhotoManager$LoaderThread;->requestLoading()V

    goto :goto_0

    .line 132
    :pswitch_1
    invoke-direct {p0}, Lcom/baidu/internal/contacts/YellowPhotoManager;->processLoadedImages()V

    goto :goto_0

    .line 123
    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method

.method public loadPhoto(Landroid/widget/ImageView;Ljava/lang/String;I)V
    .locals 2
    .parameter "view"
    .parameter "input"
    .parameter "defaultId"

    .prologue
    .line 95
    invoke-static {p2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 96
    invoke-static {p2}, Lcom/baidu/internal/contacts/YellowInfoHelper;->trimNumber(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 97
    .local v0, number:Ljava/lang/String;
    invoke-static {v0, p3}, Lcom/baidu/internal/contacts/YellowPhotoManager$Request;->createFromNumber(Ljava/lang/String;I)Lcom/baidu/internal/contacts/YellowPhotoManager$Request;

    move-result-object v1

    invoke-direct {p0, p1, v1}, Lcom/baidu/internal/contacts/YellowPhotoManager;->loadPhoto(Landroid/widget/ImageView;Lcom/baidu/internal/contacts/YellowPhotoManager$Request;)V

    .line 102
    .end local v0           #number:Ljava/lang/String;
    :goto_0
    return-void

    .line 100
    :cond_0
    invoke-virtual {p1, p3}, Landroid/widget/ImageView;->setImageResource(I)V

    goto :goto_0
.end method


text:
<TITLE>Review for Air Force One (1997)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Air Force One (1997)

reviewed by
Christopher Null

.                               AIR FORCE ONE
                      A film review by Christopher Null
                       Copyright 1997 Christopher Null

     When one sees Glenn Close portraying the vice-president, one begins
to realize just how much she looks (and can act) like Gerald Ford.

     Frankly, I was shocked to discover how much I liked AIR FORCE ONE.
Yes, it has villainous Russians who can never see our good guy President
(Harrison Ford) when he's hiding right in front of them (much less shoot
him).  Yes, it has Secret Service guys who die at the hand of the enemy
like flies in a bug zapper.  Yes, it has the cheesiest special effects
this side of of a "Tom & Jerry" cartoon.  Yes, it features a rambling
Gary Oldman in one of his clearly improvised looney-tune
terrorist/psychopath roles.  I could go on and on...

     But I won't.  Instead, I'll tell you that AIR FORCE ONE (DIE HARD
on a plane with a President on it, thus distinguishing it from DIE HARD
II, PASSENGER 57, and EXECUTIVE DECISION) is a spellbinding film, one
that grips the viewer from the very start and doesn't let up until 140
minutes later, plot holes or no.  It also may be the funniest movie I've
seen all year -- and I still can't figure out if it was intentional or
not!

     And I don't care.  AIR FORCE ONE has great action, a good story,
and once you get past the melodramatics of his co-stars, one of Harrison
Ford's best performances, ever.  In fact, I'd be so bold as to say that
AF0 is probably the best new film of 1997 to date.

     Or maybe I'm just losing my mind.

RATING:  ****

|------------------------------|
 \ ***** Perfection             \
  \ **** Good, memorable film    \
   \ *** Average, hits and misses \
    \ ** Sub-par on many levels    \
     \ * Unquestionably awful       \
      |------------------------------|

-Christopher Null  /  null@poboxes.com  /  Writer-Producer
-Visit the Movie Emporium at http://www.filmcritic.com
-and Null Set Productions at http://www.filmcritic.com/nullset.htm

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews

redpajama_set_name: RedPajamaGithub


text:
(function() {

    /*!
     * Create export namespace.
     */

    if (!window.phonegap) window.phonegap = {};
    if (!window.phonegap.app) window.phonegap.app = {};

    /*!
     * Configuration.
     */

    if (!window.phonegap.app.config) window.phonegap.app.config = {};

    /**
     * Load Configuration.
     *
     * Options:
     *   - `callback` {Function} is triggered on completion
     *     - `data` {Object} is the configuration data
     */

    window.phonegap.app.config.load = function(callback) {
        readFile('config.json', function(e, text) {
            config = parseAsJSON(text);

            // load defaults
            config.address = config.address || '127.0.0.1:3000';
            config.optIn = config.optIn || false;
            callback(config);
        });
    };

    /**
     * Save Configuration.
     *
     * Options:
     *   - `data` {Object} is the data to save to the config file.
     *   - `callback` {Function} is triggered on completion.
     */

    window.phonegap.app.config.save = function(data, callback) {
        saveFile('config.json', data, function(e) {
            callback();
        });
    };

    /*!
     * Configuration helper functions.
     */

    function readFile(filepath, callback) {
        window.requestFileSystem(
            LocalFileSystem.PERSISTENT,
            0,
            function(fileSystem) {
                fileSystem.root.getFile(
                    filepath,
                    null,
                    function gotFileEntry(fileEntry) {
                        fileEntry.file(
                            function gotFile(file){
                                var reader = new FileReader();
                                reader.onloadend = function(evt) {
                                    // #72 - Fix WP8 loading of config.json
                                    // On WP8, `evt.target.result` is returned as an object instead
                                    // of a string. Since WP8 is using a newer version of the File API
                                    // this may be a platform quirk or an API update.
                                    var text = evt.target.result;
                                    text = (typeof text === 'object') ? JSON.stringify(text) : text;
                                    callback(null, text); // text is a string
                                };
                                reader.readAsText(file);
                            },
                            function(error) {
                                callback(error);
                            }
                        );
                    },
                    function(error) {
                        callback(error);
                    }
                );
            },
            function(error) {
                callback(error);
            }
        );
    }

    function saveFile(filepath, data, callback) {
        data = (typeof data === 'string') ? data : JSON.stringify(data);

        window.requestFileSystem(
            LocalFileSystem.PERSISTENT,
            0,
            function(fileSystem) {
                fileSystem.root.getFile(
                    filepath,
                    { create: true, exclusive: false },
                    function(fileEntry) {
                        fileEntry.createWriter(
                            function(writer) {
                                writer.onwriteend = function(evt) {
                                    callback();
                                };
                                writer.write(data);
                            },
                            function(e) {
                                callback(e);
                            }
                        );
                    },
                    function(e) {
                        callback(e);
                    }
                );
            },
            function(e) {
                callback(e);
            }
        );
    }

    function parseAsJSON(text) {
        try {
            return JSON.parse(text);
        } catch(e) {
            return {};
        }
    }

    /**
     * Download, Extract, and Deploy App.
     *
     * Options:
     *   - `options` {Object}
     *     - `address` {String} is the server address.
     */

    window.phonegap.app.downloadZip = function(options) {
        var uri;
        var sync;
        var theHeaders = options.headers;
        if(options.update === true) {
            uri = encodeURI(options.address + '/__api__/update');
            sync = ContentSync.sync({ src: uri, id: 'phonegapdevapp', type: 'merge', copyCordovaAssets: false, headers: theHeaders });
            sync.on('complete', function(data) {
                window.location.reload();
            });
        } else {
            uri = encodeURI(options.address + '/__api__/appzip');
            sync = ContentSync.sync({ src: uri, id: 'phonegapdevapp', type: 'replace', copyCordovaAssets: true, headers: theHeaders });
            sync.on('complete', function(data) {
                window.location.href = data.localPath + '/www/index.html';
            });
        }

        sync.on('progress', function(data) {
            if(options.onProgress) {
                options.onProgress(data);
            }
        });

        sync.on('error', function(e){
            if (options.onDownloadError) {
                setTimeout(function() {
                    options.onDownloadError(e);
                }, 10);
            }
            console.log("download error " + e);
        });

        document.addEventListener('cancelSync', function(e) {
            sync.cancel();
        });

        sync.on('cancel', function(e) {
            if (options.onCancel) {
                setTimeout(function() {
                    options.onCancel(e);
                }, 10);
            }
            console.log("download cancelled by user");
        });
    };

})();


text:
package controller;
import util.Teclado;
public class Ex_8_Q9 {
	public static void main(String[] args){
		try{
			int a = Teclado.lerInt("Digite um número");
			System.out.println("O número digitado foi: "+a);
		} catch (NumberFormatException nfe){
			try{
				int a = Teclado.lerInt("Digite um número");
				System.out.println("O número digitado foi: "+a);
			} catch (NumberFormatException nfe1){
				try{
					int a = Teclado.lerInt("Digite um número");
					System.out.println("O número digitado foi: "+a);
			} catch(NumberFormatException nfe2){
				System.out.println("Excedeu o número de tentativas");
			}

			}
		}
	}

}


text:
@extends('layouts.master')

@section('content')
    @include('model.consumer_list', ['consumers' => Session::get('consumerSearchResults')])
@stop


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>describe-volumes — AWS CLI 1.0.0 documentation</title>
  <link rel="stylesheet" type="text/css" href="../../_static/bootstrap.min.css" />

    <link rel="stylesheet" href="../../_static/guzzle.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />

    <link rel="top" title="AWS CLI 1.0.0 documentation" href="../../index.html" />
    <link rel="up" title="ec2" href="index.html" />
    <link rel="next" title="describe-vpc-attribute" href="describe-vpc-attribute.html" />
    <link rel="prev" title="describe-volume-status" href="describe-volume-status.html" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" type="text/css" href="../../_static/bootstrap-responsive.min.css" />

        AWS CLI

Home

Documentation

Forum

GitHub

Navigation

          index

          next |

          previous |

AWS CLI 1.0.0 documentation »

aws »

ec2 »

          ← describe-volume-status
          /

describe-vpc-attribute →

Table Of Contents

describe-volumes

Description

Synopsis

Options

Filters

attachment.attach-time

attachment.delete-on-termination

attachment.device

attachment.instance-id

attachment.status

availability-zone

create-time

size

snapshot-id

status

tag-key

tag-value

tag:

volume-id

volume-type

Quick search

    <form class="form-search margin-top-1em" action="../../search.html" method="get">
        <input type="text" name="q" style="width: 105px" class="input-small search-query" />
        <button type="submit" class="btn btn-small">Search</button>
        <input type="hidden" name="check_keywords" value="yes" />
        <input type="hidden" name="area" value="default" />
    </form>

Feedback

Did you find this page useful? Do you have a suggestion? Give us feedback or
  send us a pull request on GitHub.

[ aws . ec2 ]

describe-volumes¶

Description¶

Describes the status of the indicated volume or, in lieu of any specified, all volumes belonging to the caller. Volumes that have been deleted are not described.

Synopsis¶

  describe-volumes
[--dry-run | --no-dry-run]
[--volume-ids <value>]
[--filters <value>]

Options¶

<tt class="docutils literal">--dry-run</tt> | <tt class="docutils literal">--no-dry-run</tt> (boolean)

Checks whether you have the required permissions for the action, without actually making the request. Using this option will result in one of two possible errorresponses. If you have the required permissions, the error response will be <tt class="docutils literal">DryRunOperation</tt>  . Otherwise it will be <tt class="docutils literal">UnauthorizedOperation</tt>  .

<tt class="docutils literal">--volume-ids</tt> (list)

The optional list of EBS volumes to describe.

Syntax:

"string" "string" ...

<tt class="docutils literal">--filters</tt> (list)

A list of filters used to match properties for Volumes. For a complete reference to the available filter keys for this operation, see the Amazon EC2 API reference .

Shorthand Syntax:

  Key value pairs, where values are separated by commas.
--filters Name=string1,Values=string1,string2

JSON Syntax:

[
  {
    "Name": "string",
    "Values": ["string", ...]
  }
  ...
]

Filters¶

attachment.attach-time¶

The time stamp when the attachment initiated.

attachment.delete-on-termination¶

Whether the volume is deleted on instance termination.

attachment.device¶

The device name that is exposed to the instance (for example, /dev/sda1).

attachment.instance-id¶

The ID of the instance the volume is attached to.

attachment.status¶

The attachment state.

Valid Values: attaching|attached|detaching|detached

availability-zone¶

The Availability Zone in which the volume was created.

create-time¶

The time stamp when the volume was created.

size¶

The size of the volume, in GiB (for example, 20 ).

snapshot-id¶

The snapshot from which the volume was created.

status¶

The status of the volume.

Valid Values: creating|available|in-use|deleting|deleted|error

tag-key¶

The key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter " tag-key=Purpose " and the filter " tag-value=X ", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the key filter later in this table.

tag-value¶

The value of a tag assigned to the resource. This filter is independent of the tag-key filter.

tag:¶

--filters the response based on a specific tag/value combination.

volume-id¶

The volume ID.

volume-type¶

The Amazon EBS volume type. If the volume is an io1 volume, the response includes the IOPS as well.

Valid Values: standard|io1

          ← describe-volume-status
          /

describe-vpc-attribute →

Navigation

          index

          next |

          previous |

AWS CLI 1.0.0 documentation »

aws »

ec2 »

    © Copyright 2013, Amazon Web Services. Created using Sphinx.


text:
ActiveRecord::Schema.define(version: 20131204063533) do

  create_table "barber_types", force: true do |t|
    t.integer  "barber_id"
    t.integer  "haircut_type_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "barbers", force: true do |t|
    t.integer  "user_id"
    t.text     "bio"
    t.string   "address1"
    t.string   "address2"
    t.string   "zip"
    t.string   "city"
    t.string   "state"
    t.string   "country"
    t.text     "status"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "customers", force: true do |t|
    t.integer  "user_id"
    t.string   "zip"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "haircut_photos", force: true do |t|
    t.integer  "haircut_id"
    t.boolean  "is_default"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "name_file_name"
    t.string   "name_content_type"
    t.integer  "name_file_size"
    t.datetime "name_updated_at"
  end

  create_table "haircut_tags", force: true do |t|
    t.integer  "haircut_id"
    t.integer  "tag_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "haircut_types", force: true do |t|
    t.string   "title"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "haircuts", force: true do |t|
    t.integer  "barber_id"
    t.string   "title"
    t.integer  "view_count"
    t.integer  "like_count"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "likes", force: true do |t|
    t.integer  "user_id"
    t.integer  "haircut_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "tags", force: true do |t|
    t.string   "title"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "users", force: true do |t|
    t.string   "email",                  default: "", null: false
    t.string   "encrypted_password",     default: "", null: false
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",          default: 0,  null: false
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip"
    t.string   "last_sign_in_ip"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "username"
    t.string   "avatar_file_name"
    t.string   "avatar_content_type"
    t.integer  "avatar_file_size"
    t.datetime "avatar_updated_at"
    t.boolean  "is_barber"
  end

  add_index "users", ["email"], name: "index_users_on_email", unique: true
  add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
  add_index "users", ["username"], name: "index_users_on_username", unique: true

end


text:
.main {
  display: grid;
  width: 800px;
  height: 1200px;
  grid-gap: 4px;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 3fr 10fr 3fr 20px;
  grid-template-areas:"head head"
                      "skill  personal"
                      "notes  notes"
                      "footer footer";
}

.header {
  display: grid;
  grid-gap: 0px;
  grid-template-columns: 3fr 2fr 2fr 2fr 2fr;
  grid-template-rows: 1fr 1fr 1fr;
  grid-template-areas:"generator headline headline headline pool"
                      "logo name name name pool"
                      "logo stress resilience assets pool";
}

/*----------------- GENERAL CSS ------------------*/

textarea {
  width: 90%;
  height: 85%;
  background-color: lightgray;
}

.section {
  padding-top: 15px;
  padding-bottom: 15px;
  padding-left: 11px;
  padding-right: 11px;
  border-style: solid;
  border-color: black;
  border-width: 1px;
  border-radius: 5px 12px 5px 5px;
  box-shadow: inset 0 0 0 10px gray;
}
.section-right {
  padding-top: 15px;
  padding-bottom: 15px;
  padding-left: 11px;
  padding-right: 11px;
  border-style: solid;
  border-color: black;
  border-width: 1px;
  border-radius: 12px 5px 5px 5px;
  box-shadow: inset 0 0 0 10px gray;
}
.subsection {
  padding-top: 15px;
  border-style: solid;
  border-color: gray;
  border-width: 12px 0px 0px 0px;
  border-radius: 0px 12px 0px 0px;
}
.subsection-right {
  padding-top: 15px;
  border-style: solid;
  border-color: gray;
  border-width: 12px 0px 0px 0px;
  border-radius: 12px 0px 0px 0px;
}

.flex-row {
  display: flex;
  flex-flow: row nowrap;
  justify-content: space-between;
  align-items: center;
}

.flex-item {
  flex-grow: 0;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-col-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
}

.flex-col-stretch {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.flex-row-stretch {
  display: flex;
  flex-flow: row wrap;
  justify-content: stretch;
}

.flex-center {
  display: flex;
  justify-content: center;
  margin: auto;
}

/*------------- Section-specific CSS -------------*/

.header {
  grid-area: head;
}

.generator {
  grid-area: generator;
}

.b-generator {
  display: none;
}

.headline {
  grid-area: headline;
}

.pool {
  grid-area: pool;
}

.pool > img{
  object-fit: cover;
  width: 100%;
  max-height: 100%;
}

.logo {
  grid-area: logo;
}

.logo > img{
  object-fit: cover;
  width: 100%;
  max-height: 100%;
}

.name {
  grid-area: name;
}

.stress {
  grid-area: stress;
}

.resilience {
  grid-area: resilience;
}

.assets {
  grid-area: assets;
}

.skill {
  grid-area: skill;
}

.personal {
  grid-area: personal;
}

.notes {
  grid-area: notes;
}

.footer {
  grid-area: footer;
  background-color: gray;
}

.popup-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  opacity: 0.5;
  background-color: black;
}

.popup {
  position: absolute;
  width: 300px;
  height: auto;
  background-color: white;
  border: 2px solid #555;
  border-radius: 8px;
  margin: auto;
  left: calc(50% - 150px);
  top: calc(50% - 100px);
}

.popup-header {
  height: 50px;
  padding-left: 16px;
  line-height: 50px;
  font-size: 20px;
  font-weight: bold;
  background-color: #555;
  color: white;
}

.popup-content {
  padding: 8px 16px;
  font-size: 16px;
}

.hideifzero[value="0"] + div,
.hideifzero[value="0"] + button,
.hideifzero[value="0"] + span {
  display: none;
}


text:
namespace CodeFirst_MigratWithExistDB
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Data.Entity.Spatial;

    public partial class G5RCW
    {
        public G5RCW()
        {
            G5RCNIER = new HashSet<G5RCNIER>();
        }

        public int id { get; set; }

        [Required]
        [StringLength(2)]
        public string typBaz { get; set; }

        [Required]
        [StringLength(30)]
        public string idO { get; set; }

        [Required]
        [StringLength(30)]
        public string idR { get; set; }

        [Required]
        [StringLength(2)]
        public string st_obj { get; set; }

        [Required]
        [StringLength(128)]
        public string G5IRCW { get; set; }

        public long G5ROW { get; set; }

        [Column(TypeName = "date")]
        public DateTime G5DTD { get; set; }

        public long G5FOB { get; set; }

        [Required]
        [StringLength(128)]
        public string G5NRPR { get; set; }

        public long G5CSZ { get; set; }

        public long G5STS { get; set; }

        public long G5STK { get; set; }

        public long G5WRT { get; set; }

        [Column(TypeName = "date")]
        public DateTime G5DTW { get; set; }

        [Column(TypeName = "date")]
        public DateTime G5DTU { get; set; }

        [Required]
        [StringLength(30)]
        public string G5RDOK { get; set; }

        public int? id_G5DOK { get; set; }

        public virtual G5DOK G5DOK { get; set; }

        public virtual ICollection<G5RCNIER> G5RCNIER { get; set; }
    }
}


text:
from pymysql import connect

def getConnection():
    return connect(host='localhost', port=3306,
        user='root', passwd='', db='taproot', charset='utf8')

class Rows(tuple):
    pass

def get_rows(sql, params=[]):
    bible = getConnection()
    cursor = bible.cursor()
    cursor.execute(sql, params)
    result = Rows(cursor.fetchall())
    result.fields = [meta[0] for meta in cursor.description]
    cursor.close()
    bible.close()
    return result

def get_distinct_words(term):
    sql = '''
        select distinct word_usage
        from bible
        where word_usage like concat(%s, '%%')
        order by word_usage
        '''
    params = [term]
    return [word for word, in get_rows(sql, params)]

def get_ref_data(book, chap):
    sql = '''
         select bn.name as book, chapter, verse, phrase, strongs
         from bible b
         join book_name bn
         on bn.book_id = b.book_id
         join book_alias ba
         on ba.book_id = b.book_id
         where ba.alias like %s
         and chapter = %s
         order by verse, phrase_order
        '''
    params = [book, chap]
    return get_rows(sql, params)

def get_strongs_word(strongs):
    sql = '''
        select word
        from strongs
        where strongs = %s
        '''
    params = [strongs]
    return get_rows(sql, params)[0][0]

def get_strongs_jsons(strongs):
    sql = '''
        select json
        from strongs_json
        where strongs = %s
        '''
    params = [strongs]
    return [json for json, in get_rows(sql, params)]

def get_strongs_record(number):
    sql = '''
        select lemma, xlit, pronounce, description, PartOfSpeech, Language
        from Strongs
        where StrongsID = %s
        '''
    params = [number]
    return get_rows(sql, params)[0]

def get_strongs_usage_counts(number):
    sql = '''
        select word_usage, count(*)
        from bible
        where strongs = %s
        group by word_usage
        order by count(*) desc
        '''
    params = [number]
    return get_rows(sql, params)

def get_strongs_usage(number):
    sql = '''
        select phrase, b.word_usage, bn.name, b.book_id, b.chapter, b.verse, v.text, ba.author
        from bible b
        join book_name bn
        on bn.book_id = b.book_id
        join book_author ba
        on ba.book_id = b.book_id
        join verses v
        on v.book_id = b.book_id
        and v.chapter = b.chapter
        and v.verse = b.verse
        where strongs = %s
        '''
    params = [number]
    return get_rows(sql, params)

def get_edit_strongs_data(strongsId):
    sql = '''
        select mi.Word, b.BookName, v.Chapter, v.VerseNum, v.VerseText
        from MainIndex mi
        join StrongsIndex si
        on si.WordID = mi.WordID
        join Books b
        on b.BookID = mi.BookID
        join Verses v
        on v.VerseID = mi.VerseID
        where StrongsID = %s
        '''
    params = [strongsId]
    return get_rows(sql, params)

def get_verse_edit_data(book, chap, verse):
    sql = '''
        select mi.WordId, Word, StrongsId
        from MainIndex mi
        left join StrongsIndex si
        on si.WordId = mi.WordId
        join Books b
        on b.bookid = mi.bookid
        where b.BookName = %s
        and chapter = %s
        and VerseNum = %s
        '''
    params = [book, chap, verse]
    return get_rows(sql, params)

def get_word_meta(word):
    sql = '''
        select s.strongs, s.word,
            count(*) as count, max(json) as json
        from bible b
        join strongs s
        on s.strongs = b.strongs
        join strongs_json sj
        on sj.strongs = s.strongs
        where word_usage = %s
        group by s.strongs, s.word
        order by count(*) desc
        '''
    params = [word]
    return get_rows(sql, params)

def make_edit(wordId, strongsId):
    bible = getConnection()
    cursor = bible.cursor()
    sql = '''
        delete from StrongsIndex
        where WordID = %s
        '''
    params = [wordId]
    cursor.execute(sql, params)
    if strongsId:
        sql = '''
            insert into StrongsIndex (WordID, StrongsID)
            values (%s, %s)
            '''
        params = [wordId, strongsId]
        cursor.execute(sql, params)
    bible.commit()
    cursor.close()
    bible.close()

def is_word(word):
    sql = '''
        select count(*)
        from bible
        where word_usage = %s
        limit 1
        '''
    params = [word]
    return bool(get_rows(sql, params)[0][0])


text:
/*		** NOT MY CODE **
 *
 *      code posted by ConroyP on stackoverflow.com:
 *
 * 		http://stackoverflow.com/questions/122102/what-is-the-most-efficient-way-to-clone-an-object
 */

function clone(obj) {
    if(obj === null || typeof(obj) !== 'object' || 'isActiveClone' in obj)
        return obj;

    var temp = obj.constructor(); // changed

    for(var key in obj) {
        if(Object.prototype.hasOwnProperty.call(obj, key)) {
            obj['isActiveClone'] = null;
            temp[key] = clone(obj[key]);
            delete obj['isActiveClone'];
        }
    }

    return temp;
}


text:
Endure Elements, Communal

**Level** alchemist 3, cleric 2, druid 2, paladin 2, ranger 2, sorcerer/wizard 2

**Target** creatures touched

This spell functions like _ [endure elements](spells/endureElements#_endure-elements)_, except you divide the duration in 1-hour increments among the creatures touched.


text:
[![Build Status](https://travis-ci.org/ecasilla/code-challenge.svg)](https://travis-ci.org/ecasilla/code-challenge)

This is my solution to the **Top Coder** [problem]( http://community.topcoder.com/stat?c=problem_statement&pm=2998&rd=5857) Graphix Mask Implemented Using JavaScript

##Dependencies

###Node.Js
[Node.Js](http://nodejs.org/)

#Installation
Step by step installation process assuming you have git installed if not please read their docs on github

  `$ git clone https://github.com/ecasilla/code-challenge`

  `$ cd code-challenge`

  `$ sudo npm install`

##Testing
	$ npm test

##Checking for the solutions

To execute the program and have the soultions logged out to the console please run this command from the terminal

	$ node index.js

##Documentation

To read the documentaion for the function definitions please visit this path inside the current working directory of the project.

	doc/html/


text:
* Initial release

## 0.0.2

* package.json updated with repository

## 0.0.3

* Bug fix

## 0.0.4

* Tests framework
* JSHint as part of tests
* Travis integration
* README update

## 0.0.5

* README update

## 0.0.6

* Added `editorconfig` file

## 0.0.7

* Remove all trailing whitespace
* Update dev dependencies
* Travis runs tests against node 0.10 and 0.12
* Test code coverage & Travis sends to coveralls
* Run jshint on tests
* Disable Travis dependency cache
* Travis runs on new container infrastructure
* README code examples tagged as Javascript
* Update README badges to use shields.io

## 0.0.8

* README contribution section


text:
<!DOCTYPE html>

		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>My Garden Goddess: Minneapolis, MN garden design company</title>
		<link rel="shortcut icon" type="image/ico" href="images/favicon.ico">
		<meta name="description" content="My Garden Goddess is a Minneapolis garden design company specializing in garden design, installation and care.">
		<meta name="robots" content="noodp">
		<link rel="canonical" href="http://mygardengoddess.com/">
		<meta property="og:locale" content="en_US">
		<meta property="og:type" content="website">
		<meta property="og:title" content="My Garden Goddess in Minneapolis, MN">
		<meta property="og:description" content="My Garden Goddess is a Minneapolis garden design company specializing in garden design, installation and care..">
		<meta property="og:url" content="http://mygardengoddess.com/">
		<meta property="og:site_name" content="My Garden Goddess">
		<meta property="og:image" content="images/logo.jpg">

		<link href="bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">

		<link href="assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
		<link rel="stylesheet" id="production-css" href="css/production.css" type="text/css" media="all">

		<link rel="shortlink" href="http://mygardengoddess.com/">

About

							Dedicated to creating your dream garden.

My Garden Goddess is a Twin Cities garden design company. We believe your garden is a place where you celebrate life. We have a passion for the great outdoors. For sustainable resources. For native plants. And for designing outdoor moments tailored to your personality.

Suzanne Gilbert, owner and Chief Garden Goddess, brings more than 20 years of visual design experience to her unique approach to garden design. Suzanne works one-on-one with you to create gardens that inspire, calm, delight and express your personality. Her personal design philosophy: to honor nature and the joy of living things while helping clients express their personality and design sensibility through their gardens.

Our full-service, sustainable garden design, build and installation firm serves homeowners, realtors and commercial clients in and around the Twin Cities metro area. If you are looking for front yard, back yard or full property gardening and landscaping; cleanup, staging or maintenance services; colorful window boxes or containers; or party or holiday planters and décor, we're here to help.


text:
layout: page
title: About
---

  This blog is maintained by the people behind Talon.

We talk about challenges faced during mechanical design, communication and radio system setup and manufacturing issues and how we overcame the

## Setup

Some fun facts about the setup of this project include:

* Built for [Jekyll](http://jekyllrb.com)
* Developed on GitHub and hosted for free on [GitHub Pages](https://pages.github.com)
* Coded with [Sublime Text 2](http://sublimetext.com), an amazing code editor

Thanks for reading!


text:
def get_grade(average)
    return "A" if average <= 100 && average >= 90

    return "B" if average < 90 && average >= 80

    return "C" if average < 80 && average >= 70

    return "D" if average < 70 && average >= 60

    return "F" if average < 60
end


text:
package org.redisson;

import io.netty.buffer.ByteBufUtil;
import io.netty.util.Timeout;
import io.netty.util.TimerTask;
import org.redisson.api.RFuture;
import org.redisson.api.RPermitExpirableSemaphore;
import org.redisson.client.codec.ByteArrayCodec;
import org.redisson.client.codec.LongCodec;
import org.redisson.client.protocol.RedisCommands;
import org.redisson.command.CommandAsyncExecutor;
import org.redisson.misc.CompletableFutureWrapper;
import org.redisson.pubsub.SemaphorePubSub;

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;

/**
 *
 * @author Nikita Koksharov
 *
 */
public class RedissonPermitExpirableSemaphore extends RedissonExpirable implements RPermitExpirableSemaphore {

    private final SemaphorePubSub semaphorePubSub;

    final CommandAsyncExecutor commandExecutor;

    private final String timeoutName;

    private final long nonExpirableTimeout = 922337203685477L;

    public RedissonPermitExpirableSemaphore(CommandAsyncExecutor commandExecutor, String name) {
        super(commandExecutor, name);
        this.timeoutName = suffixName(name, "timeout");
        this.commandExecutor = commandExecutor;
        this.semaphorePubSub = commandExecutor.getConnectionManager().getSubscribeService().getSemaphorePubSub();
    }

    String getChannelName() {
        return getChannelName(getRawName());
    }

    public static String getChannelName(String name) {
        if (name.contains("{")) {
            return "redisson_sc:" + name;
        }
        return "redisson_sc:{" + name + "}";
    }

    @Override
    public String acquire() throws InterruptedException {
        return acquire(1, -1, TimeUnit.MILLISECONDS);
    }

    @Override
    public String acquire(long leaseTime, TimeUnit timeUnit) throws InterruptedException {
        return acquire(1, leaseTime, timeUnit);
    }

    @Override
    public RFuture<String> acquireAsync(long leaseTime, TimeUnit timeUnit) {
        return acquireAsync(1, leaseTime, timeUnit);
    }

    private String acquire(int permits, long ttl, TimeUnit timeUnit) throws InterruptedException {
        String permitId = tryAcquire(permits, ttl, timeUnit);
        if (permitId != null && !permitId.startsWith(":")) {
            return permitId;
        }

        CompletableFuture<RedissonLockEntry> future = subscribe();
        semaphorePubSub.timeout(future);
        RedissonLockEntry entry = commandExecutor.getInterrupted(future);
        try {
            while (true) {
                Long nearestTimeout;
                permitId = tryAcquire(permits, ttl, timeUnit);
                if (permitId != null) {
                    if (!permitId.startsWith(":")) {
                        return permitId;
                    } else {
                        nearestTimeout = Long.valueOf(permitId.substring(1)) - System.currentTimeMillis();
                    }
                } else {
                    nearestTimeout = null;
                }

                if (nearestTimeout != null) {
                    entry.getLatch().tryAcquire(permits, nearestTimeout, TimeUnit.MILLISECONDS);
                } else {
                    entry.getLatch().acquire(permits);
                }
            }
        } finally {
            unsubscribe(entry);
        }
//        return get(acquireAsync(permits, ttl, timeUnit));
    }

    public RFuture<String> acquireAsync() {
        return acquireAsync(1, -1, TimeUnit.MILLISECONDS);
    }

    private RFuture<String> acquireAsync(int permits, long ttl, TimeUnit timeUnit) {
        long timeoutDate = calcTimeout(ttl, timeUnit);
        RFuture<String> tryAcquireFuture = tryAcquireAsync(permits, timeoutDate);
        CompletionStage<String> f = tryAcquireFuture.thenCompose(permitId -> {
            if (permitId != null && !permitId.startsWith(":")) {
                return CompletableFuture.completedFuture(permitId);
            }

            CompletableFuture<RedissonLockEntry> subscribeFuture = subscribe();
            semaphorePubSub.timeout(subscribeFuture);
            return subscribeFuture.thenCompose(res -> {
                return acquireAsync(permits, res, ttl, timeUnit);
            });
        });
        f.whenComplete((r, e) -> {
            if (f.toCompletableFuture().isCancelled()) {
                tryAcquireFuture.whenComplete((permitId, ex) -> {
                    if (permitId != null && !permitId.startsWith(":")) {
                        releaseAsync(permitId);
                    }
                });
            }
        });
        return new CompletableFutureWrapper<>(f);
    }

    private void tryAcquireAsync(AtomicLong time, int permits, RedissonLockEntry entry, CompletableFuture<String> result, long ttl, TimeUnit timeUnit) {
        if (result.isDone()) {
            unsubscribe(entry);
            return;
        }

        if (time.get() <= 0) {
            unsubscribe(entry);
            result.complete(null);
            return;
        }

        long timeoutDate = calcTimeout(ttl, timeUnit);
        long curr = System.currentTimeMillis();
        RFuture<String> tryAcquireFuture = tryAcquireAsync(permits, timeoutDate);
        tryAcquireFuture.whenComplete((permitId, e) -> {
            if (e != null) {
                unsubscribe(entry);
                result.completeExceptionally(e);
                return;
            }

            Long nearestTimeout;
            if (permitId != null) {
                if (!permitId.startsWith(":")) {
                    unsubscribe(entry);
                    if (!result.complete(permitId)) {
                        releaseAsync(permitId);
                    }
                    return;
                } else {
                    nearestTimeout = Long.valueOf(permitId.substring(1)) - System.currentTimeMillis();
                }
            } else {
                nearestTimeout = null;
            }

            long el = System.currentTimeMillis() - curr;
            time.addAndGet(-el);

            if (time.get() <= 0) {
                unsubscribe(entry);
                result.complete(null);
                return;
            }

            // waiting for message
            long current = System.currentTimeMillis();
            if (entry.getLatch().tryAcquire()) {
                tryAcquireAsync(time, permits, entry, result, ttl, timeUnit);
            } else {
                AtomicReference<Timeout> waitTimeoutFutureRef = new AtomicReference<Timeout>();

                Timeout scheduledFuture;
                if (nearestTimeout != null) {
                    scheduledFuture = commandExecutor.getConnectionManager().newTimeout(new TimerTask() {
                        @Override
                        public void run(Timeout timeout) throws Exception {
                            if (waitTimeoutFutureRef.get() != null && !waitTimeoutFutureRef.get().cancel()) {
                                return;
                            }

                            long elapsed = System.currentTimeMillis() - current;
                            time.addAndGet(-elapsed);

                            tryAcquireAsync(time, permits, entry, result, ttl, timeUnit);
                        }
                    }, nearestTimeout, TimeUnit.MILLISECONDS);
                } else {
                    scheduledFuture = null;
                }

                Runnable listener = () -> {
                    if (waitTimeoutFutureRef.get() != null && !waitTimeoutFutureRef.get().cancel()) {
                        entry.getLatch().release();
                        return;
                    }
                    if (scheduledFuture != null && !scheduledFuture.cancel()) {
                        entry.getLatch().release();
                        return;
                    }

                    long elapsed = System.currentTimeMillis() - current;
                    time.addAndGet(-elapsed);

                    tryAcquireAsync(time, permits, entry, result, ttl, timeUnit);
                };
                entry.addListener(listener);

                long t = time.get();
                Timeout waitTimeoutFuture = commandExecutor.getConnectionManager().newTimeout(new TimerTask() {
                    @Override
                    public void run(Timeout timeout) throws Exception {
                        if (scheduledFuture != null && !scheduledFuture.cancel()) {
                            return;
                        }

                        if (entry.removeListener(listener)) {
                            long elapsed = System.currentTimeMillis() - current;
                            time.addAndGet(-elapsed);

                            tryAcquireAsync(time, permits, entry, result, ttl, timeUnit);
                        }
                    }
                }, t, TimeUnit.MILLISECONDS);
                waitTimeoutFutureRef.set(waitTimeoutFuture);
            }
        });

    }

    private CompletableFuture<String> acquireAsync(int permits, RedissonLockEntry entry, long ttl, TimeUnit timeUnit) {
        long timeoutDate = calcTimeout(ttl, timeUnit);
        CompletableFuture<String> tryAcquireFuture = tryAcquireAsync(permits, timeoutDate).toCompletableFuture();
        return tryAcquireFuture.whenComplete((p, e) -> {
            if (e != null) {
                unsubscribe(entry);
            }
        }).thenCompose(permitId -> {
            Long nearestTimeout;
            if (permitId != null) {
                if (!permitId.startsWith(":")) {
                    unsubscribe(entry);
                    return CompletableFuture.completedFuture(permitId);
                } else {
                    nearestTimeout = Long.valueOf(permitId.substring(1)) - System.currentTimeMillis();
                }
            } else {
                nearestTimeout = null;
            }

            if (entry.getLatch().tryAcquire(permits)) {
                return acquireAsync(permits, entry, ttl, timeUnit);
            }

            CompletableFuture<String> res = new CompletableFuture<>();
            Timeout scheduledFuture;
            if (nearestTimeout != null) {
                scheduledFuture = commandExecutor.getConnectionManager().newTimeout(timeout -> {
                    CompletableFuture<String> r = acquireAsync(permits, entry, ttl, timeUnit);
                    commandExecutor.transfer(r, res);
                }, nearestTimeout, TimeUnit.MILLISECONDS);
            } else {
                scheduledFuture = null;
            }

            Runnable listener = () -> {
                if (scheduledFuture != null && !scheduledFuture.cancel()) {
                    entry.getLatch().release();
                    return;
                }
                CompletableFuture<String> r = acquireAsync(permits, entry, ttl, timeUnit);
                commandExecutor.transfer(r, res);
            };
            entry.addListener(listener);
            return res;
        });
    }

    @Override
    public String tryAcquire() {
        String res = tryAcquire(1, -1, TimeUnit.MILLISECONDS);
        if (res != null && res.startsWith(":")) {
            return null;
        }
        return res;
    }

    private String tryAcquire(int permits, long ttl, TimeUnit timeUnit) {
        long timeoutDate = calcTimeout(ttl, timeUnit);
        return get(tryAcquireAsync(permits, timeoutDate));
    }

    private long calcTimeout(long ttl, TimeUnit timeUnit) {
        if (ttl != -1) {
            return System.currentTimeMillis() + timeUnit.toMillis(ttl);
        }
        return nonExpirableTimeout;
    }

    @Override
    public RFuture<String> tryAcquireAsync() {
        CompletableFuture<String> future = tryAcquireAsync(1, nonExpirableTimeout).toCompletableFuture();
        CompletableFuture<String> f = future.thenApply(permitId -> {
            if (permitId != null && !permitId.startsWith(":")) {
                return permitId;
            }
            return null;
        });

        future.whenComplete((permitId, e) -> {
            if (f.isCancelled() && permitId != null && !permitId.startsWith(":")) {
                releaseAsync(permitId);
            }
        });

        return new CompletableFutureWrapper<>(f);
    }

    protected byte[] generateId() {
        byte[] id = new byte[16];
        ThreadLocalRandom.current().nextBytes(id);
        return id;
    }

    private RFuture<String> tryAcquireAsync(int permits, long timeoutDate) {
        if (permits < 0) {
            throw new IllegalArgumentException("Permits amount can't be negative");
        }

        byte[] id = generateId();
        return commandExecutor.evalWriteAsync(getRawName(), ByteArrayCodec.INSTANCE, RedisCommands.EVAL_PERMIT_DATA,
                  "local expiredIds = redis.call('zrangebyscore', KEYS[2], 0, ARGV[4], 'limit', 0, ARGV[1]); " +
                  "if #expiredIds > 0 then " +
                      "redis.call('zrem', KEYS[2], unpack(expiredIds)); " +
                      "local value = redis.call('incrby', KEYS[1], #expiredIds); " +
                      "if tonumber(value) > 0 then " +
                          "redis.call('publish', KEYS[3], value); " +
                      "end;" +
                  "end; " +
                  "local value = redis.call('get', KEYS[1]); " +
                  "if (value ~= false and tonumber(value) >= tonumber(ARGV[1])) then " +
                      "redis.call('decrby', KEYS[1], ARGV[1]); " +
                      "redis.call('zadd', KEYS[2], ARGV[2], ARGV[3]); " +

                      "local ttl = redis.call('pttl', KEYS[1]); " +
                      "if ttl > 0 then " +
                          "redis.call('pexpire', KEYS[2], ttl); " +
                      "end; " +

                      "return ARGV[3]; " +
                  "end; " +
                  "local v = redis.call('zrange', KEYS[2], 0, 0, 'WITHSCORES'); " +
                  "if v[1] ~= nil and v[2] ~= ARGV[5] then " +
                      "return ':' .. tostring(v[2]); " +
                  "end " +
                  "return nil;",
                  Arrays.asList(getRawName(), timeoutName, getChannelName()),
                permits, timeoutDate, id, System.currentTimeMillis(), nonExpirableTimeout);
    }

    @Override
    public RFuture<String> tryAcquireAsync(long waitTime, TimeUnit unit) {
        return tryAcquireAsync(1, waitTime, -1, unit);
    }

    @Override
    public String tryAcquire(long waitTime, long ttl, TimeUnit unit) throws InterruptedException {
        return tryAcquire(1, waitTime, ttl, unit);
    }

    @Override
    public RFuture<String> tryAcquireAsync(long waitTime, long ttl, TimeUnit unit) {
        return tryAcquireAsync(1, waitTime, ttl, unit);
    }

    private String tryAcquire(int permits, long waitTime, long ttl, TimeUnit unit) throws InterruptedException {
        long time = unit.toMillis(waitTime);
        long current = System.currentTimeMillis();

        String permitId = tryAcquire(permits, ttl, unit);
        if (permitId != null && !permitId.startsWith(":")) {
            return permitId;
        }

        time -= System.currentTimeMillis() - current;
        if (time <= 0) {
            return null;
        }

        current = System.currentTimeMillis();
        CompletableFuture<RedissonLockEntry> future = subscribe();
        RedissonLockEntry entry;
        try {
            entry = future.get(time, TimeUnit.MILLISECONDS);
        } catch (ExecutionException | TimeoutException e) {
            return null;
        }

        try {
            time -= System.currentTimeMillis() - current;
            if (time <= 0) {
                return null;
            }

            while (true) {
                current = System.currentTimeMillis();
                Long nearestTimeout;
                permitId = tryAcquire(permits, ttl, unit);
                if (permitId != null) {
                    if (!permitId.startsWith(":")) {
                        return permitId;
                    } else {
                        nearestTimeout = Long.valueOf(permitId.substring(1)) - System.currentTimeMillis();
                    }
                } else {
                    nearestTimeout = null;
                }

                time -= System.currentTimeMillis() - current;
                if (time <= 0) {
                    return null;
                }

                // waiting for message
                current = System.currentTimeMillis();

                if (nearestTimeout != null) {
                    entry.getLatch().tryAcquire(permits, Math.min(time, nearestTimeout), TimeUnit.MILLISECONDS);
                } else {
                    entry.getLatch().tryAcquire(permits, time, TimeUnit.MILLISECONDS);
                }

                long elapsed = System.currentTimeMillis() - current;
                time -= elapsed;
                if (time <= 0) {
                    return null;
                }
            }
        } finally {
            unsubscribe(entry);
        }
//        return get(tryAcquireAsync(permits, waitTime, ttl, unit));
    }

    private RFuture<String> tryAcquireAsync(int permits, long waitTime, long ttl, TimeUnit timeUnit) {
        CompletableFuture<String> result = new CompletableFuture<>();
        AtomicLong time = new AtomicLong(timeUnit.toMillis(waitTime));
        long curr = System.currentTimeMillis();
        long timeoutDate = calcTimeout(ttl, timeUnit);
        RFuture<String> tryAcquireFuture = tryAcquireAsync(permits, timeoutDate);
        tryAcquireFuture.whenComplete((permitId, e) -> {
            if (e != null) {
                result.completeExceptionally(e);
                return;
            }

            if (permitId != null && !permitId.startsWith(":")) {
                if (!result.complete(permitId)) {
                    releaseAsync(permitId);
                }
                return;
            }

            long el = System.currentTimeMillis() - curr;
            time.addAndGet(-el);

            if (time.get() <= 0) {
                result.complete(null);
                return;
            }

            long current = System.currentTimeMillis();
            AtomicReference<Timeout> futureRef = new AtomicReference<Timeout>();
            CompletableFuture<RedissonLockEntry> subscribeFuture = subscribe();
            subscribeFuture.whenComplete((r, ex) -> {
                if (ex != null) {
                    result.completeExceptionally(ex);
                    return;
                }

                if (futureRef.get() != null) {
                    futureRef.get().cancel();
                }

                long elapsed = System.currentTimeMillis() - current;
                time.addAndGet(-elapsed);

                tryAcquireAsync(time, permits, r, result, ttl, timeUnit);
            });

            if (!subscribeFuture.isDone()) {
                Timeout scheduledFuture = commandExecutor.getConnectionManager().newTimeout(new TimerTask() {
                    @Override
                    public void run(Timeout timeout) throws Exception {
                        if (!subscribeFuture.isDone()) {
                            result.complete(null);
                        }
                    }
                }, time.get(), TimeUnit.MILLISECONDS);
                futureRef.set(scheduledFuture);
            }
        });

        return new CompletableFutureWrapper<>(result);
    }

    private CompletableFuture<RedissonLockEntry> subscribe() {
        return semaphorePubSub.subscribe(getRawName(), getChannelName());
    }

    private void unsubscribe(RedissonLockEntry entry) {
        semaphorePubSub.unsubscribe(entry, getRawName(), getChannelName());
    }

    @Override
    public String tryAcquire(long waitTime, TimeUnit unit) throws InterruptedException {
        String res = tryAcquire(1, waitTime, -1, unit);
        if (res != null && res.startsWith(":")) {
            return null;
        }
        return res;
    }

    @Override
    public void release(String permitId) {
        get(releaseAsync(permitId));
    }

    @Override
    public boolean tryRelease(String permitId) {
        return get(tryReleaseAsync(permitId));
    }

    public RFuture<Boolean> tryReleaseAsync(String permitId) {
        if (permitId == null) {
            throw new IllegalArgumentException("permitId can't be null");
        }

        byte[] id = ByteBufUtil.decodeHexDump(permitId);
        return commandExecutor.evalWriteAsync(getRawName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN,
                  "local expire = redis.call('zscore', KEYS[3], ARGV[1]);" +
                        "local removed = redis.call('zrem', KEYS[3], ARGV[1]);" +
                        "if tonumber(removed) ~= 1 then " +
                            "return 0;" +
                        "end;" +
                        "local value = redis.call('incrby', KEYS[1], ARGV[2]); " +
                        "redis.call('publish', KEYS[2], value); " +
                        "if tonumber(expire) <= tonumber(ARGV[3]) then " +
                            "return 0;" +
                        "end;" +
                        "return 1;",
                Arrays.asList(getRawName(), getChannelName(), timeoutName),
                id, 1, System.currentTimeMillis());
    }

    @Override
    public RFuture<Long> sizeInMemoryAsync() {
        List<Object> keys = Arrays.<Object>asList(getRawName(), timeoutName);
        return super.sizeInMemoryAsync(keys);
    }

    @Override
    public RFuture<Boolean> deleteAsync() {
        return deleteAsync(getRawName(), timeoutName);
    }

    @Override
    public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String param, String... keys) {
        return super.expireAsync(timeToLive, timeUnit, param, getRawName(), timeoutName);
    }

    @Override
    protected RFuture<Boolean> expireAtAsync(long timestamp, String param, String... keys) {
        return super.expireAtAsync(timestamp, param, getRawName(), timeoutName);
    }

    @Override
    public RFuture<Boolean> clearExpireAsync() {
        return clearExpireAsync(getRawName(), timeoutName);
    }

    @Override
    public RFuture<Void> releaseAsync(String permitId) {
        CompletionStage<Void> f = tryReleaseAsync(permitId).handle((res, e) -> {
            if (e != null) {
                throw new CompletionException(e);
            }

            if (res) {
                return null;
            }
            throw new CompletionException(new IllegalArgumentException("Permit with id " + permitId + " has already been released or doesn't exist"));
        });
        return new CompletableFutureWrapper<>(f);
    }

    @Override
    public int availablePermits() {
        return get(availablePermitsAsync());
    }

    @Override
    public RFuture<Integer> availablePermitsAsync() {
        return commandExecutor.evalWriteAsync(getRawName(), LongCodec.INSTANCE, RedisCommands.EVAL_INTEGER,
                "local expiredIds = redis.call('zrangebyscore', KEYS[2], 0, ARGV[1], 'limit', 0, -1); " +
                "if #expiredIds > 0 then " +
                    "redis.call('zrem', KEYS[2], unpack(expiredIds)); " +
                    "local value = redis.call('incrby', KEYS[1], #expiredIds); " +
                    "if tonumber(value) > 0 then " +
                        "redis.call('publish', KEYS[3], value); " +
                    "end;" +
                    "return value; " +
                "end; " +
                "local ret = redis.call('get', KEYS[1]); " +
                "return ret == false and 0 or ret;",
                Arrays.<Object>asList(getRawName(), timeoutName, getChannelName()), System.currentTimeMillis());
    }

    @Override
    public boolean trySetPermits(int permits) {
        return get(trySetPermitsAsync(permits));
    }

    @Override
    public RFuture<Boolean> trySetPermitsAsync(int permits) {
        return commandExecutor.evalWriteAsync(getRawName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN,
                "local value = redis.call('get', KEYS[1]); " +
                "if (value == false) then "
                    + "redis.call('set', KEYS[1], ARGV[1]); "
                    + "redis.call('publish', KEYS[2], ARGV[1]); "
                    + "return 1;"
                + "end;"
                + "return 0;",
                Arrays.<Object>asList(getRawName(), getChannelName()), permits);
    }

    @Override
    public void addPermits(int permits) {
        get(addPermitsAsync(permits));
    }

    @Override
    public RFuture<Void> addPermitsAsync(int permits) {
        return commandExecutor.evalWriteAsync(getRawName(), LongCodec.INSTANCE, RedisCommands.EVAL_VOID,
                "local value = redis.call('get', KEYS[1]); " +
                "if (value == false) then "
                  + "value = 0;"
              + "end;"
              + "redis.call('set', KEYS[1], tonumber(value) + tonumber(ARGV[1])); "
              + "if tonumber(ARGV[1]) > 0 then "
                  + "redis.call('publish', KEYS[2], ARGV[1]); "
              + "end;",
                Arrays.<Object>asList(getRawName(), getChannelName()), permits);
    }

    @Override
    public RFuture<Boolean> updateLeaseTimeAsync(String permitId, long leaseTime, TimeUnit unit) {
        long timeoutDate = calcTimeout(leaseTime, unit);
        byte[] id = ByteBufUtil.decodeHexDump(permitId);
        return commandExecutor.evalWriteAsync(getRawName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN,
                "local expiredIds = redis.call('zrangebyscore', KEYS[2], 0, ARGV[3], 'limit', 0, -1); " +
                "if #expiredIds > 0 then " +
                    "redis.call('zrem', KEYS[2], unpack(expiredIds)); " +
                    "local value = redis.call('incrby', KEYS[1], #expiredIds); " +
                    "if tonumber(value) > 0 then " +
                        "redis.call('publish', KEYS[3], value); " +
                    "end;" +
                "end; " +

                  "local value = redis.call('zscore', KEYS[2], ARGV[1]); " +
                  "if (value ~= false) then "
                    + "redis.call('zadd', KEYS[2], ARGV[2], ARGV[1]); "
                    + "return 1;"
                + "end;"
                + "return 0;",
                Arrays.asList(getRawName(), timeoutName, getChannelName()),
                id, timeoutDate, System.currentTimeMillis());
    }

    @Override
    public boolean updateLeaseTime(String permitId, long leaseTime, TimeUnit unit) {
        return get(updateLeaseTimeAsync(permitId, leaseTime, unit));
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2012 Facebook, Inc. Licensed under the Apache License,
	Version 2.0 (the "License"); you may not use this file except in compliance
	with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
	Unless required by applicable law or agreed to in writing, software distributed
	under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
	OR CONDITIONS OF ANY KIND, either express or implied. See the License for
	the specific language governing permissions and limitations under the License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<groupId>com.facebook.swift</groupId>
	<artifactId>thrift-java-compiler</artifactId>
	<version>0.16.0-SNAPSHOT</version>
	<packaging>pom</packaging>
	<name>${project.artifactId}</name>
	<description>Annotation based Thrift implementation</description>

	<modules>
		<module>thrift-java-compiler-idl-parser</module>
		<module>thrift-java-compiler-codegenerator</module>
	</modules>

	<properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>

		<dep.antlr.version>3.5</dep.antlr.version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.facebook.swift</groupId>
				<artifactId>thrift-java-compiler-idl-parser</artifactId>
				<version>${project.version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.thrift</groupId>
				<artifactId>libthrift</artifactId>
				<version>0.9.1</version>
			</dependency>

			<dependency>
				<groupId>org.ow2.asm</groupId>
				<artifactId>asm-all</artifactId>
				<version>5.0.4</version>
			</dependency>

			<dependency>
				<groupId>com.facebook.nifty</groupId>
				<artifactId>nifty-core</artifactId>
				<version>${dep.fb.nifty.version}</version>
			</dependency>

			<dependency>
				<groupId>com.facebook.nifty</groupId>
				<artifactId>nifty-client</artifactId>
				<version>${dep.fb.nifty.version}</version>
			</dependency>

			<dependency>
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<version>18.0</version>
			</dependency>

			<dependency>
				<groupId>com.google.inject</groupId>
				<artifactId>guice</artifactId>
				<optional>true</optional>
				<version>4.0-beta5</version>
			</dependency>

			<dependency>
				<groupId>com.google.inject.extensions</groupId>
				<artifactId>guice-multibindings</artifactId>
				<optional>true</optional>
				<version>4.0-beta5</version>
			</dependency>

			<dependency>
				<groupId>io.netty</groupId>
				<artifactId>netty</artifactId>
				<version>3.7.0.Final</version>
			</dependency>

			<dependency>
				<groupId>com.thoughtworks.paranamer</groupId>
				<artifactId>paranamer</artifactId>
				<version>2.5.2</version>
			</dependency>

			<dependency>
				<groupId>org.apache.httpcomponents</groupId>
				<artifactId>httpclient</artifactId>
				<version>4.2.5</version>
			</dependency>

			<dependency>
				<groupId>org.apache.httpcomponents</groupId>
				<artifactId>httpcore</artifactId>
				<version>4.2.4</version>
			</dependency>

			<dependency>
				<groupId>org.antlr</groupId>
				<artifactId>antlr-runtime</artifactId>
				<version>${dep.antlr.version}</version>
			</dependency>

			<dependency>
				<groupId>org.antlr</groupId>
				<artifactId>stringtemplate</artifactId>
				<version>4.0.2</version>
			</dependency>

			<!-- maven -->
			<dependency>
				<groupId>org.apache.maven</groupId>
				<artifactId>maven-plugin-api</artifactId>
				<version>${dep.maven-api.version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.maven</groupId>
				<artifactId>maven-model</artifactId>
				<version>${dep.maven-api.version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.maven</groupId>
				<artifactId>maven-artifact</artifactId>
				<version>${dep.maven-api.version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.maven</groupId>
				<artifactId>maven-core</artifactId>
				<version>${dep.maven-api.version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.maven.plugin-tools</groupId>
				<artifactId>maven-plugin-annotations</artifactId>
				<version>3.4</version>
			</dependency>

			<dependency>
				<groupId>com.google.code.findbugs</groupId>
				<artifactId>annotations</artifactId>
				<version>2.0.3</version>
			</dependency>

			<dependency>
				<groupId>org.testng</groupId>
				<artifactId>testng</artifactId>
				<version>6.8.7</version>
			</dependency>

			<dependency>
				<groupId>org.codehaus.plexus</groupId>
				<artifactId>plexus-utils</artifactId>
				<version>3.0.22</version>
			</dependency>

			<dependency>
				<groupId>org.easytesting</groupId>
				<artifactId>fest-assert</artifactId>
				<version>1.4</version>
			</dependency>

			<dependency>
				<groupId>args4j</groupId>
				<artifactId>args4j</artifactId>
				<version>2.0.22</version>
			</dependency>

			<dependency>
				<groupId>com.beust</groupId>
				<artifactId>jcommander</artifactId>
				<version>1.30</version>
			</dependency>

			<dependency>
				<groupId>io.takari.maven.plugins</groupId>
				<artifactId>takari-plugin-testing</artifactId>
				<version>2.2.0</version>
			</dependency>

			<dependency>
				<groupId>io.takari.maven.plugins</groupId>
				<artifactId>takari-plugin-integration-testing</artifactId>
				<version>2.2.0</version>
				<type>pom</type>
			</dependency>

			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>4.12</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.codehaus.plexus</groupId>
										<artifactId>plexus-maven-plugin</artifactId>
										<versionRange>[0,)</versionRange>
										<goals>
											<goal>descriptor</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.antlr</groupId>
					<artifactId>antlr3-maven-plugin</artifactId>
					<version>${dep.antlr.version}</version>
					<executions>
						<execution>
							<id>default</id>
							<phase>generate-sources</phase>
							<goals>
								<goal>antlr</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.codehaus.plexus</groupId>
					<artifactId>plexus-maven-plugin</artifactId>
					<version>1.3.8</version>
					<executions>
						<execution>
							<goals>
								<goal>descriptor</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-plugin-plugin</artifactId>
					<version>3.4</version>
					<executions>
						<execution>
							<id>help-mojo</id>
							<goals>
								<goal>helpmojo</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-shade-plugin</artifactId>
					<version>2.3</version>
					<executions>
						<execution>
							<phase>package</phase>
							<goals>
								<goal>shade</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>io.takari.maven.plugins</groupId>
					<artifactId>takari-lifecycle-plugin</artifactId>
					<version>1.11.3</version>
				</plugin>
			</plugins>
		</pluginManagement>

	</build>
</project>