text:
/* ========================================================================== */
/* === CHOLMOD/MATLAB/ldlchol mexFunction =================================== */
/* ========================================================================== */

/* -----------------------------------------------------------------------------
 * CHOLMOD/MATLAB Module.  Copyright (C) 2005-2006, Timothy A. Davis
 * The CHOLMOD/MATLAB Module is licensed under Version 2.0 of the GNU
 * General Public License.  See gpl.txt for a text of the license.
 * CHOLMOD is also available under other licenses; contact authors for details.
 * http://www.suitesparse.com
 * MATLAB(tm) is a Trademark of The MathWorks, Inc.
 * -------------------------------------------------------------------------- */

/* Numeric LDL' factorization.  Note that LL' and LDL' are faster than R'R
 * and use less memory.  The LDL' factorization methods use tril(A).
 * The unit diagonal L can be obtained with tril(LD,-1)+speye(n) and the
 * diagonal D can be obtained with D = diag(diag(LD)) ;
 *
 * LD = ldlchol (A)		return the LDL' factorization of A
 * [LD,p] = ldlchol (A)		like [R,p] = chol(A), except LD is always square
 * [LD,p,q] = ldlchol (A)	factorizes A(q,q) into L*D*L'
 *
 * LD = ldlchol (A,beta)	return the LDL' factorization of A*A'+beta*I
 * [LD,p] = ldlchol (A,beta)	like [R,p] = chol(A*A'+beta+I)
 * [LD,p,q] = ldlchol (A,beta)	factorizes A(q,:)*A(q,:)'+beta*I into L*D*L'
 *
 * Explicit zeros may appear in the LD matrix.  The pattern of LD matches the
 * pattern of L as computed by symbfact2, even if some entries in LD are
 * explicitly zero.  This is to ensure that ldlupdate works properly.  You must
 * NOT modify LD in MATLAB itself and then use ldlupdate if LD contains
 * explicit zero entries; ldlupdate will fail catastrophically in this case.
 *
 * You MAY modify LD in MATLAB if you do not pass it back to ldlupdate.  Just be
 * aware that LD contains explicit zero entries, contrary to the standard
 * practice in MATLAB of removing those entries from all sparse matrices.
 *
 * Note that CHOLMOD uses a supernodal LL' factorization and then converts it
 * to LDL' for large matrices, and a simplicial LDL' factorization otherwise.
 * Two-by-two block pivoting is not performed, in any case.  Thus, ldlchol
 * will not be able to perform an LDL' factorization of an arbitrary indefinite
 * matrix.  The matrix
 *
 *  0 1
 *  1 0
 *
 * will fail, for example.  You can tell CHOLMOD to always use its simplicial
 * LDL' factorization by adding the statement
 *
 *	cm->supernodal = CHOLMOD_SIMPLICIAL ;
 *
 * but ldlchol will be much slower for large matrices.  It still will not be
 * able to handle the above matrix, but it can then handle matrices such as
 *
 *  -2  1
 *   1 -2
 *
 * or any other symmetric matrix for which all leading minors are
 * well-conditioned.
 */

#include "cholmod_matlab.h"

void mexFunction
(
    int	nargout,
    mxArray *pargout [ ],
    int	nargin,
    const mxArray *pargin [ ]
)
{
    double dummy = 0, beta [2], *px ;
    cholmod_sparse Amatrix, *A, *Lsparse ;
    cholmod_factor *L ;
    cholmod_common Common, *cm ;
    Long n, minor ;

    /* ---------------------------------------------------------------------- */
    /* start CHOLMOD and set parameters */
    /* ---------------------------------------------------------------------- */

    cm = &Common ;
    cholmod_l_start (cm) ;
    sputil_config (SPUMONI, cm) ;

    /* convert to packed LDL' when done */
    cm->final_asis = FALSE ;
    cm->final_super = FALSE ;
    cm->final_ll = FALSE ;
    cm->final_pack = TRUE ;
    cm->final_monotonic = TRUE ;

    /* since numerically zero entries are NOT dropped from the symbolic
     * pattern, we DO need to drop entries that result from supernodal
     * amalgamation. */
    cm->final_resymbol = TRUE ;

    cm->quick_return_if_not_posdef = (nargout < 2) ;

    /* This will disable the supernodal LL', which will be slow. */
    /* cm->supernodal = CHOLMOD_SIMPLICIAL ; */

    /* ---------------------------------------------------------------------- */
    /* get inputs */
    /* ---------------------------------------------------------------------- */

    if (nargin < 1 || nargin > 2 || nargout > 3)
    {
	mexErrMsgTxt ("usage: [L,p,q] = ldlchol (A,beta)") ;
    }

    n = mxGetM (pargin [0]) ;

    if (!mxIsSparse (pargin [0]))
    {
    	mexErrMsgTxt ("A must be sparse") ;
    }
    if (nargin == 1 && n != mxGetN (pargin [0]))
    {
    	mexErrMsgTxt ("A must be square") ;
    }

    /* get sparse matrix A, use tril(A)  */
    A = sputil_get_sparse (pargin [0], &Amatrix, &dummy, -1) ;

    if (nargin == 1)
    {
	A->stype = -1 ;	    /* use lower part of A */
	beta [0] = 0 ;
	beta [1] = 0 ;
    }
    else
    {
	A->stype = 0 ;	    /* use all of A, factorizing A*A' */
	beta [0] = mxGetScalar (pargin [1]) ;
	beta [1] = 0 ;
    }

    /* use natural ordering if no q output parameter */
    if (nargout < 3)
    {
	cm->nmethods = 1 ;
	cm->method [0].ordering = CHOLMOD_NATURAL ;
	cm->postorder = FALSE ;
    }

    /* ---------------------------------------------------------------------- */
    /* analyze and factorize */
    /* ---------------------------------------------------------------------- */

    L = cholmod_l_analyze (A, cm) ;
    cholmod_l_factorize_p (A, beta, NULL, 0, L, cm) ;

    if (nargout < 2 && cm->status != CHOLMOD_OK)
    {
	mexErrMsgTxt ("matrix is not positive definite") ;
    }

    /* ---------------------------------------------------------------------- */
    /* convert L to a sparse matrix */
    /* ---------------------------------------------------------------------- */

    /* the conversion sets L->minor back to n, so get a copy of it first */
    minor = L->minor ;
    Lsparse = cholmod_l_factor_to_sparse (L, cm) ;
    if (Lsparse->xtype == CHOLMOD_COMPLEX)
    {
	/* convert Lsparse from complex to zomplex */
	cholmod_l_sparse_xtype (CHOLMOD_ZOMPLEX, Lsparse, cm) ;
    }

    /* ---------------------------------------------------------------------- */
    /* return results to MATLAB */
    /* ---------------------------------------------------------------------- */

    /* return L as a sparse matrix (it may contain numerically zero entries) */
    pargout [0] = sputil_put_sparse (&Lsparse, cm) ;

    /* return minor (translate to MATLAB convention) */
    if (nargout > 1)
    {
	pargout [1] = mxCreateDoubleMatrix (1, 1, mxREAL) ;
	px = mxGetPr (pargout [1]) ;
	px [0] = ((minor == n) ? 0 : (minor+1)) ;
    }

    /* return permutation */
    if (nargout > 2)
    {
	pargout [2] = sputil_put_int (L->Perm, n, 1) ;
    }

    /* ---------------------------------------------------------------------- */
    /* free workspace and the CHOLMOD L, except for what is copied to MATLAB */
    /* ---------------------------------------------------------------------- */

    cholmod_l_free_factor (&L, cm) ;
    cholmod_l_finish (cm) ;
    cholmod_l_print_common (" ", cm) ;
    /*
    if (cm->malloc_count != 3 + mxIsComplex (pargout[0])) mexErrMsgTxt ("!") ;
    */
}


text:
About RPi GoPro Uploader
===
This collection of scripts makes it easy-ish to archive your footage.

For all .mp4 files on the camera, the utility will

1. Transcode the video to 480p

    Shrinks the video to 854x480.  This step is meant to enable faster uploading and less bandwidth usage. The RPi is not the best tool for transcoding and so this can take a while for longer videos.

    This step is implemented as a simple wrapper around ffmpeg and can be easily customized.

2. Upload video to YouTube

    Automatically chooses a title based on the file datetime.  Title, tags, and description can be easily customized.

Provisioning RPi for GoPro file access
===

1. Install required tools

    We use gphotofs for mounting the GoPro.  The utility gphoto2 also provides some handy tools for accessing the camera.

        sudo apt-get install gphoto2 gphotofs -y
        sudo apt-get install ffmpeg -y

2. Fix gphoto2/gphotofs on RPi

    Raspbian ships with version 2.4 of gphoto2/gphotofs.  This version adds some files that block some devices from being mountd appropriately with these utilities.  We must rename these files.

    More information can be found here: https://www.raspberrypi.org/forums/viewtopic.php?t=70049&p=508638

    **Note:** v2.5 does not contain this bug, if you install it directly instead, then you do not need this step.

    Rename files:

        sudo mv /usr/share/gvfs/mounts/gphoto2.mount /usr/share/gvfs/mounts/gphoto2.mount.old
        sudo mv /usr/share/gvfs/remote-volume-monitors/gphoto2.monitor /usr/share/gvfs/remote-volume-monitors/gphoto2.monitor.old
        sudo mv /usr/lib/gvfs/gvfs-gphoto2-volume-monitor /usr/lib/gvfs/gvfs-gphoto2-volume-monitor.old

    **Note:** You may also have to give the `pi` username permissions to use both `gphotofs` and `umount`

    Reboot the RPi.

        sudo reboot

3. Install python requirements

        sudo pip install -r requirements.txt

Configuring scripts for YouTube
===

Get a Google `client_secrets.json` file from

    https://code.google.com/apis/console#access

and put in the root directory where `gp_upload.py` will run.

**Note:** You will need to run the script manually at least once with a web browser available so that the project can download an OAuth token (will show up in `/scripts`).

**Note:** You will also need to enable the YouTube API for this project.

Running the script (once)
===

1. Connect GoPro to RPi (usb) and turn on GoPro

    The screen should display:

        USB Connected
        Camera Files Accessible

2. To execute the script run

        ./gp_upload.py

    You may want to run the script with `sudo` so that the RPi can be appropriately unmounted after the uploading has finished (or add /gopro_files to fstab).

Autodetecting GoPro + RPi connection
===

Customizing transcode wrapper
===
The transcode wrapper can be found at `utilities/transcode.py`.  The script calls subprocess.call(['ffmpeg']) with some stock parameters.

See here for some boilerplate options:

    http://www.labnol.org/internet/useful-ffmpeg-commands/28490/

Acknowledgements
===

Uses `upload_video.py` example from https://code.google.com/p/youtube-api-samples/source/browse/samples/python/upload_video.py

redpajama_set_name: RedPajamaGithub


text:
NFLPredict
November 12
-data.sql will drop then create the league and roster table

October 3
Added new model for team roster and league
created setup files for table league and roster located inside data/setup/ folder
edit database to load from local db named"assignment"
autoload model added league and team


text:
import React from 'react';
import { Alert } from 'apparena-patterns-react';

export default function AlertExample() {
  return (

      <Alert
        type="success"
      >
        Type: success
      </Alert>
      <Alert
        type="info"
      >
        Type: info
      </Alert>
      <Alert
        type="warning"
      >
        Type: warning
      </Alert>
      <Alert
        type="danger"
      >
        Type: danger
      </Alert>

      <Alert
        type="info"
        dismissible
      >
        Dismissable
      </Alert>
      <Alert
        type="success"
      >

Huge Alert!

          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid atque cupiditate delectus dolor doloribus ea exercitationem fugit id labore magnam maxime nisi non, perferendis quas, quo unde ut veniam voluptates.

          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid atque cupiditate delectus dolor doloribus ea exercitationem fugit id labore magnam maxime nisi non, perferendis quas, quo unde ut veniam voluptates.

          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid atque cupiditate delectus dolor doloribus ea exercitationem fugit id labore magnam maxime nisi non, perferendis quas, quo unde ut veniam voluptates.

      </Alert>

  );
}


text:
package by.prominence.alchemy.gui;

import by.prominence.alchemy.core.storage.dao.ElementDao;
import by.prominence.alchemy.core.storage.dao.xml.XmlElementDao;
import by.prominence.alchemy.entity.Element;

import javax.swing.*;
import java.awt.*;
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.Set;

/**
 * Created by zinchenko on 20.04.2016.
 */
public class GameWindow {

    private static final int INITIAL_WIDTH = 800;
    private static final int INITIAL_HEIGHT = 600;

    private JFrame mainFrame;
    private JList list;
    private Container pane;
    private DefaultListModel listModel;

    private ResourceBundle bundle;
    private ElementDao elementDao;

    public GameWindow() {
        initialize(); // for a new game
    }

    private void initialize() {

        bundle = ResourceBundle.getBundle("SystemMessages", Locale.getDefault()); // TODO: implement locale changing & support for russian
        elementDao = new XmlElementDao();

        mainFrame = new JFrame(bundle.getString("window.label"));

        pane = mainFrame.getContentPane();

        listModel = new DefaultListModel();
        Set<Element> elementSet = elementDao.getAll();
        JOptionPane.showMessageDialog(null, elementSet.size());
        for (Element element : elementSet) {
            listModel.addElement(element.getName());
        }
        list = new JList(listModel);

        pane.add(list, BorderLayout.LINE_END);
        list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        list.setLayoutOrientation(JList.HORIZONTAL_WRAP);
        list.setVisibleRowCount(-1);

        mainFrame.setSize(INITIAL_WIDTH, INITIAL_HEIGHT);
        mainFrame.setVisible(true);
    }
}


text:
.class public Landroid/media/MediaFile;
.super Ljava/lang/Object;
.source "MediaFile.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/media/MediaFile$MediaFileType;
    }
.end annotation

# static fields
.field public static final FILE_TYPE_3GPP:I = 0x17

.field public static final FILE_TYPE_3GPP2:I = 0x18

.field public static final FILE_TYPE_AAC:I = 0x8

.field public static final FILE_TYPE_AMR:I = 0x4

.field public static final FILE_TYPE_ASF:I = 0x1a

.field public static final FILE_TYPE_AVI:I = 0x1d

.field public static final FILE_TYPE_AWB:I = 0x5

.field public static final FILE_TYPE_BMP:I = 0x22

.field public static final FILE_TYPE_FL:I = 0x33

.field public static final FILE_TYPE_FLAC:I = 0xa

.field public static final FILE_TYPE_GIF:I = 0x20

.field public static final FILE_TYPE_HTML:I = 0x65

.field public static final FILE_TYPE_HTTPLIVE:I = 0x2c

.field public static final FILE_TYPE_IMY:I = 0xd

.field public static final FILE_TYPE_JPEG:I = 0x1f

.field public static final FILE_TYPE_M3U:I = 0x29

.field public static final FILE_TYPE_M4A:I = 0x2

.field public static final FILE_TYPE_M4V:I = 0x16

.field public static final FILE_TYPE_MID:I = 0xb

.field public static final FILE_TYPE_MKA:I = 0x9

.field public static final FILE_TYPE_MKV:I = 0x1b

.field public static final FILE_TYPE_MP2PS:I = 0xc8

.field public static final FILE_TYPE_MP2TS:I = 0x1c

.field public static final FILE_TYPE_MP3:I = 0x1

.field public static final FILE_TYPE_MP4:I = 0x15

.field public static final FILE_TYPE_MS_EXCEL:I = 0x69

.field public static final FILE_TYPE_MS_POWERPOINT:I = 0x6a

.field public static final FILE_TYPE_MS_WORD:I = 0x68

.field public static final FILE_TYPE_OGG:I = 0x7

.field public static final FILE_TYPE_PDF:I = 0x66

.field public static final FILE_TYPE_PLS:I = 0x2a

.field public static final FILE_TYPE_PNG:I = 0x21

.field public static final FILE_TYPE_SMF:I = 0xc

.field public static final FILE_TYPE_TEXT:I = 0x64

.field public static final FILE_TYPE_WAV:I = 0x3

.field public static final FILE_TYPE_WBMP:I = 0x23

.field public static final FILE_TYPE_WEBM:I = 0x1e

.field public static final FILE_TYPE_WEBP:I = 0x24

.field public static final FILE_TYPE_WMA:I = 0x6

.field public static final FILE_TYPE_WMV:I = 0x19

.field public static final FILE_TYPE_WPL:I = 0x2b

.field public static final FILE_TYPE_XML:I = 0x67

.field public static final FILE_TYPE_ZIP:I = 0x6b

.field private static final FIRST_AUDIO_FILE_TYPE:I = 0x1

.field private static final FIRST_DRM_FILE_TYPE:I = 0x33

.field private static final FIRST_IMAGE_FILE_TYPE:I = 0x1f

.field private static final FIRST_MIDI_FILE_TYPE:I = 0xb

.field private static final FIRST_PLAYLIST_FILE_TYPE:I = 0x29

.field private static final FIRST_VIDEO_FILE_TYPE:I = 0x15

.field private static final FIRST_VIDEO_FILE_TYPE2:I = 0xc8

.field public static final HTC_FILE_TYPE_ADTS:I = 0x2ee2

.field public static final HTC_FILE_TYPE_FLV:I = 0x36b1

.field public static final HTC_FILE_TYPE_INK:I = 0x2711

.field public static final HTC_FILE_TYPE_JPS:I = 0x2712

.field public static final HTC_FILE_TYPE_MP3D:I = 0x32c9

.field public static final HTC_FILE_TYPE_MPO:I = 0x2713

.field public static final HTC_FILE_TYPE_QCP:I = 0x2ee1

.field public static final HTC_FILE_TYPE_WMAD:I = 0x32ca

.field public static final HTC_FILE_TYPE_WMVD:I = 0x3a99

.field public static final HTC_FILE_TYPE_XVID:I = 0x36b2

.field private static final HTC_FIRST_AUDIO_FILE_TYPE:I = 0x2ee1

.field private static final HTC_FIRST_DRM_AUDIO_FILE_TYPE:I = 0x32c9

.field private static final HTC_FIRST_DRM_VIDEO_FILE_TYPE:I = 0x3a99

.field private static final HTC_FIRST_IMAGE_FILE_TYPE:I = 0x2712

.field private static final HTC_FIRST_VIDEO_FILE_TYPE:I = 0x36b1

.field private static final HTC_LAST_AUDIO_FILE_TYPE:I = 0x2ee2

.field private static final HTC_LAST_DRM_AUDIO_FILE_TYPE:I = 0x32ca

.field private static final HTC_LAST_DRM_VIDEO_FILE_TYPE:I = 0x3a99

.field private static final HTC_LAST_IMAGE_FILE_TYPE:I = 0x2713

.field private static final HTC_LAST_VIDEO_FILE_TYPE:I = 0x36b2

.field private static final LAST_AUDIO_FILE_TYPE:I = 0xa

.field private static final LAST_DRM_FILE_TYPE:I = 0x33

.field private static final LAST_IMAGE_FILE_TYPE:I = 0x24

.field private static final LAST_MIDI_FILE_TYPE:I = 0xd

.field private static final LAST_PLAYLIST_FILE_TYPE:I = 0x2c

.field private static final LAST_VIDEO_FILE_TYPE:I = 0x1e

.field private static final LAST_VIDEO_FILE_TYPE2:I = 0xc8

.field public static final UNKNOWN_STRING:Ljava/lang/String; = "<unknown>"

.field public static final sFileExtensions:Ljava/lang/String;

.field private static sFileTypeMap:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Landroid/media/MediaFile$MediaFileType;",
            ">;"
        }
    .end annotation
.end field

.field private static sFileTypeToFormatMap:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Integer;",
            ">;"
        }
    .end annotation
.end field

.field private static sFormatToMimeTypeMap:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/Integer;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private static sMimeTypeMap:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Integer;",
            ">;"
        }
    .end annotation
.end field

.field private static sMimeTypeToFormatMap:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Integer;",
            ">;"
        }
    .end annotation
.end field

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

    .prologue
    const/16 v10, 0x15

    const v9, 0xb984

    const/16 v8, 0x2c

    const/16 v7, 0x300b

    const/16 v6, 0xb

    .line 169
    new-instance v2, Ljava/util/HashMap;

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

    sput-object v2, Landroid/media/MediaFile;->sFileTypeMap:Ljava/util/HashMap;

    .line 171
    new-instance v2, Ljava/util/HashMap;

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

    sput-object v2, Landroid/media/MediaFile;->sMimeTypeMap:Ljava/util/HashMap;

    .line 174
    new-instance v2, Ljava/util/HashMap;

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

    sput-object v2, Landroid/media/MediaFile;->sFileTypeToFormatMap:Ljava/util/HashMap;

    .line 177
    new-instance v2, Ljava/util/HashMap;

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

    sput-object v2, Landroid/media/MediaFile;->sMimeTypeToFormatMap:Ljava/util/HashMap;

    .line 180
    new-instance v2, Ljava/util/HashMap;

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

    sput-object v2, Landroid/media/MediaFile;->sFormatToMimeTypeMap:Ljava/util/HashMap;

    .line 220
    const-string v2, "MP3"

    const/4 v3, 0x1

    const-string v4, "audio/mpeg"

    const/16 v5, 0x3009

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 221
    const-string v2, "M4A"

    const/4 v3, 0x2

    const-string v4, "audio/mp4"

    invoke-static {v2, v3, v4, v7}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 222
    const-string v2, "WAV"

    const/4 v3, 0x3

    const-string v4, "audio/x-wav"

    const/16 v5, 0x3008

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 223
    const-string v2, "AMR"

    const/4 v3, 0x4

    const-string v4, "audio/amr"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 224
    const-string v2, "AWB"

    const/4 v3, 0x5

    const-string v4, "audio/amr-wb"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 225
    const-string v2, "MP3D"

    const/16 v3, 0x32c9

    const-string v4, "audio/mpeg"

    const/16 v5, 0x3009

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 227
    invoke-static {}, Landroid/media/MediaFile;->isWMAEnabled()Z

    move-result v2

    if-eqz v2, :cond_1

    .line 228
    const-string v2, "WMA"

    const/4 v3, 0x6

    const-string v4, "audio/x-ms-wma"

    const v5, 0xb901

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 231
    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v3, 0x40

    if-eq v2, v3, :cond_0

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v3, 0x5a

    if-eq v2, v3, :cond_0

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v3, 0x61

    if-eq v2, v3, :cond_0

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v3, 0xaa

    if-ne v2, v3, :cond_1

    .line 235
    :cond_0
    const-string v2, "WMAD"

    const/16 v3, 0x32ca

    const-string v4, "audio/x-wma-drm"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 239
    :cond_1
    const-string v2, "OGG"

    const/4 v3, 0x7

    const-string v4, "application/ogg"

    const v5, 0xb902

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 240
    const-string v2, "OGA"

    const/4 v3, 0x7

    const-string v4, "application/ogg"

    const v5, 0xb902

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 241
    const-string v2, "AAC"

    const/16 v3, 0x8

    const-string v4, "audio/aac"

    const v5, 0xb903

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 242
    const-string v2, "AAC"

    const/16 v3, 0x8

    const-string v4, "audio/aac-adts"

    const v5, 0xb903

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 243
    const-string v2, "MKA"

    const/16 v3, 0x9

    const-string v4, "audio/x-matroska"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 246
    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_PROJECT_flag:S

    const/16 v3, 0xa8

    if-ne v2, v3, :cond_2

    .line 247
    const-string v2, "QCP"

    const/16 v3, 0x2ee1

    const-string v4, "audio/qcelp"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 250
    :cond_2
    const-string v2, "MID"

    const-string v3, "audio/midi"

    invoke-static {v2, v6, v3}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 251
    const-string v2, "MIDI"

    const-string v3, "audio/midi"

    invoke-static {v2, v6, v3}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 252
    const-string v2, "XMF"

    const-string v3, "audio/midi"

    invoke-static {v2, v6, v3}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 253
    const-string v2, "RTTTL"

    const-string v3, "audio/midi"

    invoke-static {v2, v6, v3}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 254
    const-string v2, "SMF"

    const/16 v3, 0xc

    const-string v4, "audio/sp-midi"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 255
    const-string v2, "IMY"

    const/16 v3, 0xd

    const-string v4, "audio/imelody"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 256
    const-string v2, "RTX"

    const-string v3, "audio/midi"

    invoke-static {v2, v6, v3}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 257
    const-string v2, "OTA"

    const-string v3, "audio/midi"

    invoke-static {v2, v6, v3}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 258
    const-string v2, "MXMF"

    const-string v3, "audio/midi"

    invoke-static {v2, v6, v3}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 260
    const-string v2, "MPEG"

    const-string/jumbo v3, "video/mpeg"

    invoke-static {v2, v10, v3, v7}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 261
    const-string v2, "MPG"

    const-string/jumbo v3, "video/mpeg"

    invoke-static {v2, v10, v3, v7}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 262
    const-string v2, "MP4"

    const-string/jumbo v3, "video/mp4"

    invoke-static {v2, v10, v3, v7}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 263
    const-string v2, "M4V"

    const/16 v3, 0x16

    const-string/jumbo v4, "video/mp4"

    invoke-static {v2, v3, v4, v7}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 264
    const-string v2, "3GP"

    const/16 v3, 0x17

    const-string/jumbo v4, "video/3gpp"

    invoke-static {v2, v3, v4, v9}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 265
    const-string v2, "3GPP"

    const/16 v3, 0x17

    const-string/jumbo v4, "video/3gpp"

    invoke-static {v2, v3, v4, v9}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 266
    const-string v2, "3G2"

    const/16 v3, 0x18

    const-string/jumbo v4, "video/3gpp2"

    invoke-static {v2, v3, v4, v9}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 267
    const-string v2, "3GPP2"

    const/16 v3, 0x18

    const-string/jumbo v4, "video/3gpp2"

    invoke-static {v2, v3, v4, v9}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 268
    const-string v2, "MKV"

    const/16 v3, 0x1b

    const-string/jumbo v4, "video/x-matroska"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 269
    const-string v2, "WEBM"

    const/16 v3, 0x1e

    const-string/jumbo v4, "video/webm"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 270
    const-string v2, "TS"

    const/16 v3, 0x1c

    const-string/jumbo v4, "video/mp2ts"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 271
    const-string v2, "AVI"

    const/16 v3, 0x1d

    const-string/jumbo v4, "video/avi"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 272
    const-string v2, "AVI"

    const/16 v3, 0x1d

    const-string/jumbo v4, "video/x-msvideo"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 273
    const-string v2, "FLV"

    const/16 v3, 0x36b1

    const-string/jumbo v4, "video/x-flv"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 275
    invoke-static {}, Landroid/media/MediaFile;->isWMVEnabled()Z

    move-result v2

    if-eqz v2, :cond_4

    .line 276
    const-string v2, "WMV"

    const/16 v3, 0x19

    const-string/jumbo v4, "video/x-ms-wmv"

    const v5, 0xb981

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 277
    const-string v2, "ASF"

    const/16 v3, 0x1a

    const-string/jumbo v4, "video/x-ms-asf"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 280
    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v3, 0x40

    if-eq v2, v3, :cond_3

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v3, 0x5a

    if-eq v2, v3, :cond_3

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v3, 0x91

    if-eq v2, v3, :cond_3

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v3, 0x93

    if-eq v2, v3, :cond_3

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v3, 0x61

    if-eq v2, v3, :cond_3

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v3, 0x28

    if-eq v2, v3, :cond_3

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v3, 0xaa

    if-ne v2, v3, :cond_4

    .line 288
    :cond_3
    const-string v2, "WMVD"

    const/16 v3, 0x3a99

    const-string/jumbo v4, "video/x-wmv-drm"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 293
    :cond_4
    const-string v2, "JPS"

    const/16 v3, 0x2712

    const-string v4, "image/jps"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 294
    const-string v2, "MPO"

    const/16 v3, 0x2713

    const-string v4, "image/mpo"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 298
    sget-boolean v2, Landroid/provider/MediaStore$Images$HtcInk;->HtcInkSupported:Z

    const/4 v3, 0x1

    if-ne v2, v3, :cond_5

    .line 299
    const-string v2, "HTCINK"

    const/16 v3, 0x2711

    const-string v4, "image/htcink"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 302
    :cond_5
    const-string v2, "JPG"

    const/16 v3, 0x1f

    const-string v4, "image/jpeg"

    const/16 v5, 0x3801

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 303
    const-string v2, "JPEG"

    const/16 v3, 0x1f

    const-string v4, "image/jpeg"

    const/16 v5, 0x3801

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 304
    const-string v2, "GIF"

    const/16 v3, 0x20

    const-string v4, "image/gif"

    const/16 v5, 0x3807

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 305
    const-string v2, "PNG"

    const/16 v3, 0x21

    const-string v4, "image/png"

    const/16 v5, 0x380b

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 306
    const-string v2, "BMP"

    const/16 v3, 0x22

    const-string v4, "image/x-ms-bmp"

    const/16 v5, 0x3804

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 307
    const-string v2, "WBMP"

    const/16 v3, 0x23

    const-string v4, "image/vnd.wap.wbmp"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 308
    const-string v2, "WEBP"

    const/16 v3, 0x24

    const-string v4, "image/webp"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 310
    const-string v2, "M3U"

    const/16 v3, 0x29

    const-string v4, "audio/x-mpegurl"

    const v5, 0xba11

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 311
    const-string v2, "M3U"

    const/16 v3, 0x29

    const-string v4, "application/x-mpegurl"

    const v5, 0xba11

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 312
    const-string v2, "PLS"

    const/16 v3, 0x2a

    const-string v4, "audio/x-scpls"

    const v5, 0xba14

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 313
    const-string v2, "WPL"

    const/16 v3, 0x2b

    const-string v4, "application/vnd.ms-wpl"

    const v5, 0xba10

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 314
    const-string v2, "M3U8"

    const-string v3, "application/vnd.apple.mpegurl"

    invoke-static {v2, v8, v3}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 315
    const-string v2, "M3U8"

    const-string v3, "audio/mpegurl"

    invoke-static {v2, v8, v3}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 316
    const-string v2, "M3U8"

    const-string v3, "audio/x-mpegurl"

    invoke-static {v2, v8, v3}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 318
    const-string v2, "FL"

    const/16 v3, 0x33

    const-string v4, "application/x-android-drm-fl"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 320
    const-string v2, "TXT"

    const/16 v3, 0x64

    const-string/jumbo v4, "text/plain"

    const/16 v5, 0x3004

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 321
    const-string v2, "HTM"

    const/16 v3, 0x65

    const-string/jumbo v4, "text/html"

    const/16 v5, 0x3005

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 322
    const-string v2, "HTML"

    const/16 v3, 0x65

    const-string/jumbo v4, "text/html"

    const/16 v5, 0x3005

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 323
    const-string v2, "PDF"

    const/16 v3, 0x66

    const-string v4, "application/pdf"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 324
    const-string v2, "DOC"

    const/16 v3, 0x68

    const-string v4, "application/msword"

    const v5, 0xba83

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 325
    const-string v2, "XLS"

    const/16 v3, 0x69

    const-string v4, "application/vnd.ms-excel"

    const v5, 0xba85

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 326
    const-string v2, "PPT"

    const/16 v3, 0x6a

    const-string v4, "application/mspowerpoint"

    const v5, 0xba86

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 327
    const-string v2, "FLAC"

    const/16 v3, 0xa

    const-string v4, "audio/flac"

    const v5, 0xb906

    invoke-static {v2, v3, v4, v5}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;I)V

    .line 328
    const-string v2, "ZIP"

    const/16 v3, 0x6b

    const-string v4, "application/zip"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 329
    const-string v2, "MPG"

    const/16 v3, 0xc8

    const-string/jumbo v4, "video/mp2p"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 330
    const-string v2, "MPEG"

    const/16 v3, 0xc8

    const-string/jumbo v4, "video/mp2p"

    invoke-static {v2, v3, v4}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 332
    new-instance v0, Ljava/lang/StringBuilder;

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

    .line 333
    .local v0, builder:Ljava/lang/StringBuilder;
    sget-object v2, Landroid/media/MediaFile;->sFileTypeMap:Ljava/util/HashMap;

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

    move-result-object v2

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

    move-result-object v1

    .line 335
    .local v1, iterator:Ljava/util/Iterator;,"Ljava/util/Iterator<Ljava/lang/String;>;"
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_7

    .line 336
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->length()I

    move-result v2

    if-lez v2, :cond_6

    .line 337
    invoke-virtual {v0, v8}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

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

    move-result-object v2

    check-cast v2, Ljava/lang/String;

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

    goto :goto_0

    .line 341
    :cond_7
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    sput-object v2, Landroid/media/MediaFile;->sFileExtensions:Ljava/lang/String;

    .line 342
    return-void
.end method

.method public constructor <init>()V
    .locals 0

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

    .line 159
    return-void
.end method

.method static addFileType(Ljava/lang/String;ILjava/lang/String;)V
    .locals 2
    .parameter "extension"
    .parameter "fileType"
    .parameter "mimeType"

    .prologue
    .line 184
    sget-object v0, Landroid/media/MediaFile;->sFileTypeMap:Ljava/util/HashMap;

    new-instance v1, Landroid/media/MediaFile$MediaFileType;

    invoke-direct {v1, p1, p2}, Landroid/media/MediaFile$MediaFileType;-><init>(ILjava/lang/String;)V

    invoke-virtual {v0, p0, v1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 185
    sget-object v0, Landroid/media/MediaFile;->sMimeTypeMap:Ljava/util/HashMap;

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v0, p2, v1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 186
    return-void
.end method

.method static addFileType(Ljava/lang/String;ILjava/lang/String;I)V
    .locals 2
    .parameter "extension"
    .parameter "fileType"
    .parameter "mimeType"
    .parameter "mtpFormatCode"

    .prologue
    .line 189
    invoke-static {p0, p1, p2}, Landroid/media/MediaFile;->addFileType(Ljava/lang/String;ILjava/lang/String;)V

    .line 190
    sget-object v0, Landroid/media/MediaFile;->sFileTypeToFormatMap:Ljava/util/HashMap;

    invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v0, p0, v1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 191
    sget-object v0, Landroid/media/MediaFile;->sMimeTypeToFormatMap:Ljava/util/HashMap;

    invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v0, p2, v1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 192
    sget-object v0, Landroid/media/MediaFile;->sFormatToMimeTypeMap:Ljava/util/HashMap;

    invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v0, v1, p2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 193
    return-void
.end method

.method public static getExtensionForMimeType(Ljava/lang/String;)Ljava/lang/String;
    .locals 8
    .parameter "mimeType"

    .prologue
    const/4 v3, 0x0

    const/16 v7, 0xaa

    const/16 v6, 0x61

    const/16 v5, 0x5a

    const/16 v4, 0x40

    .line 499
    if-nez p0, :cond_0

    move-object v0, v3

    .line 577
    :goto_0
    return-object v0

    .line 501
    :cond_0
    const-string v2, "image/bmp"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 502
    const-string v0, "BMP"

    goto :goto_0

    .line 504
    :cond_1
    const-string v2, "audio/wav"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_2

    .line 505
    const-string v0, "WAV"

    goto :goto_0

    .line 507
    :cond_2
    const-string v2, "audio/x-mpeg"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_3

    .line 508
    const-string v0, "MP3"

    goto :goto_0

    .line 510
    :cond_3
    const-string v2, "audio/mp3"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_4

    .line 511
    const-string v0, "MP3"

    goto :goto_0

    .line 513
    :cond_4
    const-string/jumbo v2, "video/3g2"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_5

    .line 514
    const-string v0, "3G2"

    goto :goto_0

    .line 516
    :cond_5
    const-string v2, "audio/3gpp2"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_6

    .line 517
    const-string v0, "3G2"

    goto :goto_0

    .line 519
    :cond_6
    const-string v2, "audio/3gpp"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_7

    .line 520
    const-string v0, "3GPP"

    goto :goto_0

    .line 522
    :cond_7
    const-string v2, "audio/aac"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_8

    .line 523
    const-string v0, "AAC"

    goto :goto_0

    .line 525
    :cond_8
    const-string v2, "audio/x-aac"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_9

    .line 526
    const-string v0, "AAC"

    goto :goto_0

    .line 528
    :cond_9
    const-string v2, "audio/x-midi"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_a

    .line 529
    const-string v0, "MIDI"

    goto :goto_0

    .line 532
    :cond_a
    const-string v2, "audio/mp3d"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_b

    .line 533
    const-string v0, "MP3"

    goto :goto_0

    .line 535
    :cond_b
    const-string v2, "audio/mp4a-latm"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_c

    .line 536
    const-string v0, "M4A"

    goto/16 :goto_0

    .line 540
    :cond_c
    const-string v2, "audio/m4a"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_d

    .line 541
    const-string v0, "M4A"

    goto/16 :goto_0

    .line 546
    :cond_d
    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    if-eq v2, v4, :cond_e

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    if-eq v2, v5, :cond_e

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    if-eq v2, v6, :cond_e

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    if-ne v2, v7, :cond_f

    .line 551
    :cond_e
    const-string v2, "audio/x-wma-drm"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_f

    .line 552
    const-string v0, "WMAD"

    goto/16 :goto_0

    .line 557
    :cond_f
    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    if-eq v2, v4, :cond_10

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    if-eq v2, v5, :cond_10

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v4, 0x91

    if-eq v2, v4, :cond_10

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v4, 0x93

    if-eq v2, v4, :cond_10

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    if-eq v2, v6, :cond_10

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    const/16 v4, 0x28

    if-eq v2, v4, :cond_10

    sget-short v2, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S

    if-ne v2, v7, :cond_11

    .line 564
    :cond_10
    const-string/jumbo v2, "video/x-wmv-drm"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_11

    .line 565
    const-string v0, "WMVD"

    goto/16 :goto_0

    .line 570
    :cond_11
    sget-object v2, Landroid/media/MediaFile;->sFileTypeMap:Ljava/util/HashMap;

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

    move-result-object v2

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

    move-result-object v1

    .line 572
    .local v1, iterator:Ljava/util/Iterator;,"Ljava/util/Iterator<Ljava/lang/String;>;"
    :cond_12
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_13

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

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    .line 574
    .local v0, extension:Ljava/lang/String;
    sget-object v2, Landroid/media/MediaFile;->sFileTypeMap:Ljava/util/HashMap;

    invoke-virtual {v2, v0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/media/MediaFile$MediaFileType;

    iget-object v2, v2, Landroid/media/MediaFile$MediaFileType;->mimeType:Ljava/lang/String;

    invoke-virtual {v2, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_12

    goto/16 :goto_0

    .end local v0           #extension:Ljava/lang/String;
    :cond_13
    move-object v0, v3

    .line 577
    goto/16 :goto_0
.end method

.method public static getFileTitle(Ljava/lang/String;)Ljava/lang/String;
    .locals 3
    .parameter "path"

    .prologue
    .line 459
    const/16 v2, 0x2f

    invoke-virtual {p0, v2}, Ljava/lang/String;->lastIndexOf(I)I

    move-result v1

    .line 460
    .local v1, lastSlash:I
    if-ltz v1, :cond_0

    .line 461
    add-int/lit8 v1, v1, 0x1

    .line 462
    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result v2

    if-ge v1, v2, :cond_0

    .line 463
    invoke-virtual {p0, v1}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object p0

    .line 467
    :cond_0
    const/16 v2, 0x2e

    invoke-virtual {p0, v2}, Ljava/lang/String;->lastIndexOf(I)I

    move-result v0

    .line 468
    .local v0, lastDot:I
    if-lez v0, :cond_1

    .line 469
    const/4 v2, 0x0

    invoke-virtual {p0, v2, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p0

    .line 471
    :cond_1
    return-object p0
.end method

.method public static getFileType(Ljava/lang/String;)Landroid/media/MediaFile$MediaFileType;
    .locals 5
    .parameter "path"

    .prologue
    .line 402
    const-string v1, "."

    invoke-virtual {p0, v1}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v0

    .line 403
    .local v0, lastDot:I
    if-gez v0, :cond_0

    .line 404
    const/4 v1, 0x0

    .line 407
    :goto_0
    return-object v1

    :cond_0
    sget-object v1, Landroid/media/MediaFile;->sFileTypeMap:Ljava/util/HashMap;

    add-int/lit8 v2, v0, 0x1

    invoke-virtual {p0, v2}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v2

    new-instance v3, Ljava/util/Locale;

    const-string v4, "en"

    invoke-direct {v3, v4}, Ljava/util/Locale;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v3}, Ljava/lang/String;->toUpperCase(Ljava/util/Locale;)Ljava/lang/String;

    move-result-object v2

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

    move-result-object v1

    check-cast v1, Landroid/media/MediaFile$MediaFileType;

    goto :goto_0
.end method

.method public static getFileTypeForMimeType(Ljava/lang/String;)I
    .locals 3
    .parameter "mimeType"

    .prologue
    const/4 v1, 0x0

    .line 424
    if-nez p0, :cond_1

    .line 447
    :cond_0
    :goto_0
    return v1

    .line 430
    :cond_1
    const-string v2, "audio/3gpp"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_2

    .line 431
    const/4 v1, 0x2

    goto :goto_0

    .line 442
    :cond_2
    const-string/jumbo v2, "video/mp4-3d"

    invoke-virtual {p0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_3

    .line 443
    const/16 v1, 0x15

    goto :goto_0

    .line 446
    :cond_3
    sget-object v2, Landroid/media/MediaFile;->sMimeTypeMap:Ljava/util/HashMap;

    invoke-virtual {v2, p0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Integer;

    .line 447
    .local v0, value:Ljava/lang/Integer;
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v1

    goto :goto_0
.end method

.method public static getFileTypeValue(Ljava/lang/String;)I
    .locals 2
    .parameter "path"

    .prologue
    .line 413
    invoke-static {p0}, Landroid/media/MediaFile;->getFileType(Ljava/lang/String;)Landroid/media/MediaFile$MediaFileType;

    move-result-object v0

    .line 415
    .local v0, type:Landroid/media/MediaFile$MediaFileType;
    if-nez v0, :cond_0

    .line 416
    const/4 v1, 0x0

    .line 419
    :goto_0
    return v1

    :cond_0
    iget v1, v0, Landroid/media/MediaFile$MediaFileType;->fileType:I

    goto :goto_0
.end method

.method public static getFormatCode(Ljava/lang/String;Ljava/lang/String;)I
    .locals 4
    .parameter "fileName"
    .parameter "mimeType"

    .prologue
    .line 480
    if-eqz p1, :cond_0

    .line 481
    sget-object v3, Landroid/media/MediaFile;->sMimeTypeToFormatMap:Ljava/util/HashMap;

    invoke-virtual {v3, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/Integer;

    .line 482
    .local v2, value:Ljava/lang/Integer;
    if-eqz v2, :cond_0

    .line 483
    invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I

    move-result v3

    .line 494
    .end local v2           #value:Ljava/lang/Integer;
    :goto_0
    return v3

    .line 486
    :cond_0
    const/16 v3, 0x2e

    invoke-virtual {p0, v3}, Ljava/lang/String;->lastIndexOf(I)I

    move-result v1

    .line 487
    .local v1, lastDot:I
    if-lez v1, :cond_1

    .line 488
    add-int/lit8 v3, v1, 0x1

    invoke-virtual {p0, v3}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v0

    .line 489
    .local v0, extension:Ljava/lang/String;
    sget-object v3, Landroid/media/MediaFile;->sFileTypeToFormatMap:Ljava/util/HashMap;

    invoke-virtual {v3, v0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/Integer;

    .line 490
    .restart local v2       #value:Ljava/lang/Integer;
    if-eqz v2, :cond_1

    .line 491
    invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I

    move-result v3

    goto :goto_0

    .line 494
    .end local v0           #extension:Ljava/lang/String;
    .end local v2           #value:Ljava/lang/Integer;
    :cond_1
    const/16 v3, 0x3000

    goto :goto_0
.end method

.method public static getMimeTypeForFile(Ljava/lang/String;)Ljava/lang/String;
    .locals 2
    .parameter "path"

    .prologue
    .line 475
    invoke-static {p0}, Landroid/media/MediaFile;->getFileType(Ljava/lang/String;)Landroid/media/MediaFile$MediaFileType;

    move-result-object v0

    .line 476
    .local v0, mediaFileType:Landroid/media/MediaFile$MediaFileType;
    if-nez v0, :cond_0

    const/4 v1, 0x0

    :goto_0
    return-object v1

    :cond_0
    iget-object v1, v0, Landroid/media/MediaFile$MediaFileType;->mimeType:Ljava/lang/String;

    goto :goto_0
.end method

.method public static getMimeTypeForFormatCode(I)Ljava/lang/String;
    .locals 2
    .parameter "formatCode"

    .prologue
    .line 581
    sget-object v0, Landroid/media/MediaFile;->sFormatToMimeTypeMap:Ljava/util/HashMap;

    invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    return-object v0
.end method

.method public static isAudioFileType(I)Z
    .locals 2
    .parameter "fileType"

    .prologue
    const/4 v0, 0x1

    .line 347
    if-lt p0, v0, :cond_0

    const/16 v1, 0xa

    if-le p0, v1, :cond_3

    :cond_0
    const/16 v1, 0xb

    if-lt p0, v1, :cond_1

    const/16 v1, 0xd

    if-le p0, v1, :cond_3

    :cond_1
    const/16 v1, 0x2ee1

    if-lt p0, v1, :cond_2

    const/16 v1, 0x2ee2

    if-le p0, v1, :cond_3

    :cond_2
    const/16 v1, 0x32c9

    if-lt p0, v1, :cond_4

    const/16 v1, 0x32ca

    if-gt p0, v1, :cond_4

    :cond_3
    :goto_0
    return v0

    :cond_4
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public static isDrmFileType(I)Z
    .locals 1
    .parameter "fileType"

    .prologue
    const/16 v0, 0x33

    .line 397
    if-lt p0, v0, :cond_0

    if-gt p0, v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public static isHtcInkFileType(I)Z
    .locals 2
    .parameter "fileType"

    .prologue
    const/4 v0, 0x0

    .line 378
    sget-boolean v1, Landroid/provider/MediaStore$Images$HtcInk;->HtcInkSupported:Z

    if-nez v1, :cond_1

    .line 386
    :cond_0
    :goto_0
    return v0

    .line 382
    :cond_1
    const/16 v1, 0x2711

    if-ne p0, v1, :cond_0

    .line 383
    const/4 v0, 0x1

    goto :goto_0
.end method

.method public static isImageFileType(I)Z
    .locals 1
    .parameter "fileType"

    .prologue
    .line 369
    const/16 v0, 0x1f

    if-lt p0, v0, :cond_0

    const/16 v0, 0x24

    if-le p0, v0, :cond_1

    :cond_0
    const/16 v0, 0x2712

    if-lt p0, v0, :cond_2

    const/16 v0, 0x2713

    if-gt p0, v0, :cond_2

    :cond_1
    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_2
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public static isMimeTypeMedia(Ljava/lang/String;)Z
    .locals 2
    .parameter "mimeType"

    .prologue
    .line 451
    invoke-static {p0}, Landroid/media/MediaFile;->getFileTypeForMimeType(Ljava/lang/String;)I

    move-result v0

    .line 452
    .local v0, fileType:I
    invoke-static {v0}, Landroid/media/MediaFile;->isAudioFileType(I)Z

    move-result v1

    if-nez v1, :cond_0

    invoke-static {v0}, Landroid/media/MediaFile;->isVideoFileType(I)Z

    move-result v1

    if-nez v1, :cond_0

    invoke-static {v0}, Landroid/media/MediaFile;->isImageFileType(I)Z

    move-result v1

    if-nez v1, :cond_0

    invoke-static {v0}, Landroid/media/MediaFile;->isPlayListFileType(I)Z

    move-result v1

    if-eqz v1, :cond_1

    :cond_0
    const/4 v1, 0x1

    :goto_0
    return v1

    :cond_1
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public static isPlayListFileType(I)Z
    .locals 1
    .parameter "fileType"

    .prologue
    .line 392
    const/16 v0, 0x29

    if-lt p0, v0, :cond_0

    const/16 v0, 0x2c

    if-gt p0, v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public static isVideoFileType(I)Z
    .locals 3
    .parameter "fileType"

    .prologue
    const/16 v2, 0x3a99

    const/16 v1, 0xc8

    .line 358
    const/16 v0, 0x15

    if-lt p0, v0, :cond_0

    const/16 v0, 0x1e

    if-le p0, v0, :cond_3

    :cond_0
    if-lt p0, v1, :cond_1

    if-le p0, v1, :cond_3

    :cond_1
    const/16 v0, 0x36b1

    if-lt p0, v0, :cond_2

    const/16 v0, 0x36b2

    if-le p0, v0, :cond_3

    :cond_2
    if-lt p0, v2, :cond_4

    if-gt p0, v2, :cond_4

    :cond_3
    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_4
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private static isWMAEnabled()Z
    .locals 5

    .prologue
    .line 196
    invoke-static {}, Landroid/media/DecoderCapabilities;->getAudioDecoders()Ljava/util/List;

    move-result-object v2

    .line 197
    .local v2, decoders:Ljava/util/List;,"Ljava/util/List<Landroid/media/DecoderCapabilities$AudioDecoder;>;"
    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v0

    .line 198
    .local v0, count:I
    const/4 v3, 0x0

    .local v3, i:I
    :goto_0
    if-ge v3, v0, :cond_1

    .line 199
    invoke-interface {v2, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/media/DecoderCapabilities$AudioDecoder;

    .line 200
    .local v1, decoder:Landroid/media/DecoderCapabilities$AudioDecoder;
    sget-object v4, Landroid/media/DecoderCapabilities$AudioDecoder;->AUDIO_DECODER_WMA:Landroid/media/DecoderCapabilities$AudioDecoder;

    if-ne v1, v4, :cond_0

    .line 201
    const/4 v4, 0x1

    .line 204
    .end local v1           #decoder:Landroid/media/DecoderCapabilities$AudioDecoder;
    :goto_1
    return v4

    .line 198
    .restart local v1       #decoder:Landroid/media/DecoderCapabilities$AudioDecoder;
    :cond_0
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .line 204
    .end local v1           #decoder:Landroid/media/DecoderCapabilities$AudioDecoder;
    :cond_1
    const/4 v4, 0x0

    goto :goto_1
.end method

.method private static isWMVEnabled()Z
    .locals 5

    .prologue
    .line 208
    invoke-static {}, Landroid/media/DecoderCapabilities;->getVideoDecoders()Ljava/util/List;

    move-result-object v2

    .line 209
    .local v2, decoders:Ljava/util/List;,"Ljava/util/List<Landroid/media/DecoderCapabilities$VideoDecoder;>;"
    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v0

    .line 210
    .local v0, count:I
    const/4 v3, 0x0

    .local v3, i:I
    :goto_0
    if-ge v3, v0, :cond_1

    .line 211
    invoke-interface {v2, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/media/DecoderCapabilities$VideoDecoder;

    .line 212
    .local v1, decoder:Landroid/media/DecoderCapabilities$VideoDecoder;
    sget-object v4, Landroid/media/DecoderCapabilities$VideoDecoder;->VIDEO_DECODER_WMV:Landroid/media/DecoderCapabilities$VideoDecoder;

    if-ne v1, v4, :cond_0

    .line 213
    const/4 v4, 0x1

    .line 216
    .end local v1           #decoder:Landroid/media/DecoderCapabilities$VideoDecoder;
    :goto_1
    return v4

    .line 210
    .restart local v1       #decoder:Landroid/media/DecoderCapabilities$VideoDecoder;
    :cond_0
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .line 216
    .end local v1           #decoder:Landroid/media/DecoderCapabilities$VideoDecoder;
    :cond_1
    const/4 v4, 0x0

    goto :goto_1
.end method


text:
/**
 * Created by kmalikov on 20.7.17.
 */
export class WorkWithImages {
    constructor(){}

    public static upLoadBackground(callback, readerEvt, iconOrBg) {
        let file = readerEvt.target.files[0];
        let reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = function () {
            callback(reader.result, iconOrBg);
        };
        reader.onerror = function (error) {
        };
    }
}


text:
using System;

namespace Corelicious.Extensions {
    public static class DateTimeExtensions {
        public static DateTime WithoutMilliseconds(this DateTime value) {
            return new DateTime(value.Year, value.Month, value.Day, value.Hour, value.Minute, value.Second, value.Kind);
        }
    }
}


text:
import {Controller} from "@hotwired/stimulus"

export default class extends Controller {

    connect() {
        const form = this.element

        Array.from(form).forEach(function (el) {
            el.addEventListener("input", function () {
                form.requestSubmit()
            })
        })
    }
}


text:
"""
An interactive shell.

This file is designed to be launched as a PYTHONSTARTUP script.
"""

import atexit
import os
import platform

import py4j

import pyspark
from pyspark_hbase.sql import HBaseSQLContext, context

print("You are using HSpark !!!")
try:
    context.register(sc)
    hsqlContext = HBaseSQLContext(sc)
except py4j.protocol.Py4JError:
    print("HBaseSQLContext can not be instantiated, falling back to SQLContext now")
    hsqlContext = SQLContext(sc)
except TypeError:
    print("HBaseSQLContext can not be instantiated, falling back to SQLContext now")
    hsqlContext = SQLContext(sc)

print("%s available as hsqlContext." % hsqlContext.__class__.__name__)


text:
package gushici.action;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import gushici.HibernateTool;
import gushici.domain.User;
import org.apache.struts2.ServletActionContext;

import java.io.IOException;

/**
 * 主页
 */
public class UserAction extends ActionSupport {
	private String suser_name;
	private String suser_password;
	private String suser_email;

	public String getSuser_name() {
		return suser_name;
	}

	public void setSuser_name(String suser_name) {
		this.suser_name = suser_name;
	}

	public String getSuser_password() {
		return suser_password;
	}

	public void setSuser_password(String suser_password) {
		this.suser_password = suser_password;
	}

	public String getSuser_email() {
		return suser_email;
	}

	public void setSuser_email(String suser_email) {
		this.suser_email = suser_email;
	}

	public String login(){
		ActionContext actionContext = ActionContext.getContext();
		actionContext.getSession().clear();
		actionContext.put("pageTitle", "一首古诗词");
		return SUCCESS;
	}

	public String loginCheck() throws Exception {
		ActionContext actionContext = ActionContext.getContext();

		if(getSuser_name() == null || getSuser_name().isEmpty()) {
			actionContext.put("error_message", "请输入用户名");
			return ERROR;
		}

		if(getSuser_password() == null || getSuser_password().isEmpty()) {
			actionContext.put("error_message", "请输入密码");
			return ERROR;
		}

		if(getSuser_name().contains("'") || getSuser_password().contains("'")) {
			actionContext.put("error_message", "SQL注入死全家");
			return ERROR;
		}

		if("ysgscTest".equals(getSuser_name()) && "@Gushici".equals(getSuser_password())) {
			actionContext.getSession().put("admin", "admin");
			return "admin";
		}

		HibernateTool hibernateTool = new HibernateTool();
		User user = (User)hibernateTool.get(User.class, getSuser_name());

		if(user == null || !user.getSuser_password().equals(getSuser_password())) {
			actionContext.put("error_message", "用户名或密码错误");
			return ERROR;
		}

		actionContext.getSession().put("user", user);
		actionContext.getSession().put("username", user.getSuesr_name());

		return SUCCESS;
	}

	public String home(){
		ActionContext actionContext = ActionContext.getContext();
		if(actionContext.getSession().get("user") == null){
			return LOGIN;
		}
		actionContext.put("pageTitle", "导航");
		return SUCCESS;
	}

	public String register(){
		ActionContext actionContext = ActionContext.getContext();
		actionContext.put("pageTitle", "用户注册");
		return SUCCESS;
	}

	public String registerCheck(){
		ActionContext actionContext = ActionContext.getContext();

		if(getSuser_name() == null || getSuser_name().isEmpty()) {
			actionContext.put("error_message", "请输入用户名");
			return ERROR;
		}

		if(getSuser_password() == null || getSuser_password().isEmpty()) {
			actionContext.put("error_message", "请输入密码");
			return ERROR;
		}

		if(getSuser_email() == null || getSuser_email().isEmpty()) {
			actionContext.put("error_message", "请输入邮箱");
			return ERROR;
		}

		if(getSuser_name().contains("'") || getSuser_password().contains("'") || getSuser_email().contains("'")) {
			actionContext.put("error_message", "SQL注入死全家");
			return ERROR;
		}

		HibernateTool hibernateTool = new HibernateTool();
		User newUser = new User();
		newUser.setSuesr_name(getSuser_name());
		newUser.setSuser_password(getSuser_password());
		newUser.setSuser_email(getSuser_email());
		hibernateTool.save(newUser);
		return SUCCESS;
	}

	public String usernameCheck() throws Exception {
		ServletActionContext.getResponse().setContentType("text/html;charset=UTF-8");
		if(getSuser_name() == null || getSuser_name().isEmpty()) {
			ServletActionContext.getResponse().getWriter().write("请输入用户名");
			return null;
		}
		if(getSuser_name().contains("'")) {
			ServletActionContext.getResponse().getWriter().write("SQL注入死全家");
			return null;
		}
		HibernateTool hibernateTool = new HibernateTool();
		if(hibernateTool.get(User.class, getSuser_name()) == null){
			ServletActionContext.getResponse().getWriter().write("用户名可用");
			return null;
		}
		ServletActionContext.getResponse().getWriter().write("用户名已被注册");
		return null;
	}
}


text:
require 'spec_helper'

describe 'sample compact arith parser' do

  class CompactArithParser < Neg::Parser

    parser do

      expression  == operation

      operator     == `+` | `-` | `*` | `/`
      operation    == value + (operator + value) * 0
      value        == parentheses | number
      parentheses  == `(` + expression + `)`
      number       == `-` * -1 + _('0-9') * 1
    end

    translator do

      on(:number)    { |n| n.result.to_i }
      on(:operator)  { |n| n.result }
      on(:value)     { |n| n.results.first }

      on(:expression) { |n|
        results = n.results.flatten(2)
        results.size == 1 ? results.first : results
      }
    end
  end

  it 'parses and translates' do

    CompactArithParser.parse('0').should == 0
    CompactArithParser.parse('101').should == 101
    CompactArithParser.parse('(12)').should == 12
    CompactArithParser.parse('1+2+3').should == [ 1, '+', 2, '+', 3 ]
  end

  it 'does not translate if :translate => false' do

    CompactArithParser.parse('0', :translate => false).should ==
      [ :expression, 0, true, nil, [
        [ :value, 0, true, nil, [
          [ :number, 0, true, '0', [] ] ] ],
        [ nil, 1, true, nil, [] ] ] ]
  end
end


text:
<?php

namespace User\Service;

use User\Entity\User;
use Zend\Authentication\AuthenticationService;

class UserServiceImpl implements UserService
{
    /**
     * @var \User\Repository\UserRepository $userRepository
     */
    protected $userRepository;

    /**
     * @param User $user
     *
     * @return void
     */
    public function add(User $user)
    {
        $this->userRepository->add($user);
    }

    /**
     * @return \Zend\Authentication\AuthenticationService
     */
    public function getAuthenticationService()
    {
        $authenticationAdapter = $this->userRepository->getAuthenticationAdapter();
        return new AuthenticationService(null, $authenticationAdapter); // Storage defaults to session
    }

    /**
     * @param string $email
     * @param string $password
     *
     * @return boolean
     */
    public function login($email, $password)
    {
        $authenticationService = $this->getAuthenticationService();

        /**
         * @var \Zend\Authentication\Adapter\DbTable\CallbackCheckAdapter $authenticationAdapter
         */
        $authenticationAdapter = $authenticationService->getAdapter();
        $authenticationAdapter->setIdentity($email);
        $authenticationAdapter->setCredential($password);
        $result = $authenticationService->authenticate();

        if ($result->isValid()) {
            $identityObject = $authenticationAdapter->getResultRowObject(null, array('password'));
            $authenticationService->getStorage()->write($identityObject);

            return true;
        }

        return false;
    }

    /**
     * @param \User\Repository\UserRepository $userRepository
     */
    public function setUserRepository($userRepository)
    {
        $this->userRepository = $userRepository;
    }

    /**
     * @return \User\Repository\UserRepository
     */
    public function getUserRepository()
    {
        return $this->userRepository;
    }
}


text:
<?php

/**
 * @category Mirasvit
 * @package  Mirasvit_Misspell
 */
class Mirasvit_Misspell_Adminhtml_System_ActionController extends Mage_Adminhtml_Controller_Action
{
    public function reindexAction()
    {
        try {
            $cntWords = Mage::getModel('misspell/indexer')->reindexAll();
            $this->getResponse()->setBody('Reindex completed! Total words: '.$cntWords);
        } catch(Exception $e) {
            $this->getResponse()->setBody(nl2br($e->getMessage()));
        }
    }
}


text:
using namespace seqan;

int main()
{
    StringSet<DnaString> stringSet;
    appendValue(stringSet, "ACGTGGATCGGTGACTTACGGACTG");
    appendValue(stringSet, "ACGTGTTGAGTGATTACGGACTG");

    Align<DnaString> align(stringSet);                // Initialize the Align object using a StringSet.

    Score<int> scoreScheme(5, -6, -2, -11);           // Initialize Score object with affine gap costs.
    int score = globalAlignment(align, scoreScheme);  // Computes a global alignment usign the defined scoring scheme.

    std::cout << "Score = " << score << std::endl;
    std::cout << "Alignment:" << std::endl;
    std::cout << align << std::endl;

    return 0;
}


text:
{-# language CPP #-}
-- | = Name
--
-- VK_NV_linear_color_attachment - device extension
--
-- == VK_NV_linear_color_attachment
--
-- [__Name String__]
--     @VK_NV_linear_color_attachment@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     431
--
-- [__Revision__]
--     1
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires support for Vulkan 1.0
--
-- [__Contact__]
--
--     -   sourav parmar
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_NV_linear_color_attachment] @souravpNV%0A*Here describe the issue or question you have about the VK_NV_linear_color_attachment extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2021-12-02
--
-- [__Interactions and External Dependencies__]
--
--     -   This extension requires @VK_KHR_format_feature_flags2@
--
-- [__Contributors__]
--
--     -   Pat Brown, NVIDIA
--
--     -   Piers Daniell, NVIDIA
--
--     -   Sourav Parmar, NVIDIA
--
-- == Description
--
-- This extension expands support for using
-- 'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_LINEAR' images as color
-- attachments when all the color attachments in the render pass instance
-- have 'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_LINEAR' tiling. This
-- extension adds a new flag bit
-- 'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV'
-- that extends the existing
-- 'Vulkan.Extensions.VK_KHR_format_feature_flags2.FormatFeatureFlagBits2KHR'
-- bits. This flag /can/ be set for renderable color formats in the
-- 'Vulkan.Extensions.VK_KHR_format_feature_flags2.FormatProperties3KHR'::@linearTilingFeatures@
-- format properties structure member. Formats with the
-- 'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV'
-- flag /may/ be used as color attachments as long as all the color
-- attachments in the render pass instance have
-- 'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_LINEAR' tiling, and the
-- formats their images views are created with have
-- 'Vulkan.Extensions.VK_KHR_format_feature_flags2.FormatProperties3KHR'::@linearTilingFeatures@
-- which include
-- 'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV'.
-- This extension supports both dynamic rendering and traditional render
-- passes.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceLinearColorAttachmentFeaturesNV'
--
-- == New Enum Constants
--
-- -   'NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME'
--
-- -   'NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_format_feature_flags2 VK_KHR_format_feature_flags2>
-- is supported:
--
-- -   Extending
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FormatFeatureFlagBits2':
--
--     -   'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV'
--
-- == Version History
--
-- -   Revision 1, 2021-11-29 (sourav parmar)
--
--     -   Initial draft
--
-- == See Also
--
-- 'PhysicalDeviceLinearColorAttachmentFeaturesNV'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_NV_linear_color_attachment Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_NV_linear_color_attachment  ( PhysicalDeviceLinearColorAttachmentFeaturesNV(..)
                                                        , NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION
                                                        , pattern NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION
                                                        , NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME
                                                        , pattern NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME
                                                        ) where

import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV))
-- | VkPhysicalDeviceLinearColorAttachmentFeaturesNV - Structure describing
-- whether
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#glossary Linear Color Attachment>
-- rendering is supported by the implementation
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDeviceLinearColorAttachmentFeaturesNV' structure is
-- included in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. 'PhysicalDeviceLinearColorAttachmentFeaturesNV' /can/ also be
-- used in the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to
-- selectively enable these features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_linear_color_attachment VK_NV_linear_color_attachment>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceLinearColorAttachmentFeaturesNV = PhysicalDeviceLinearColorAttachmentFeaturesNV
  { -- | #features-linearColorAttachment# @linearColorAttachment@ indicates
    -- whether the implementation supports renderable
    -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#glossary Linear Color Attachment>
    linearColorAttachment :: Bool }
  deriving (Typeable, Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceLinearColorAttachmentFeaturesNV)
#endif
deriving instance Show PhysicalDeviceLinearColorAttachmentFeaturesNV

instance ToCStruct PhysicalDeviceLinearColorAttachmentFeaturesNV where
  withCStruct x f = allocaBytes 24 $ \p -> pokeCStruct p x (f p)
  pokeCStruct p PhysicalDeviceLinearColorAttachmentFeaturesNV{..} f = do
    poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV)
    poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
    poke ((p `plusPtr` 16 :: Ptr Bool32)) (boolToBool32 (linearColorAttachment))
    f
  cStructSize = 24
  cStructAlignment = 8
  pokeZeroCStruct p f = do
    poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV)
    poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
    poke ((p `plusPtr` 16 :: Ptr Bool32)) (boolToBool32 (zero))
    f

instance FromCStruct PhysicalDeviceLinearColorAttachmentFeaturesNV where
  peekCStruct p = do
    linearColorAttachment <- peek @Bool32 ((p `plusPtr` 16 :: Ptr Bool32))
    pure $ PhysicalDeviceLinearColorAttachmentFeaturesNV
             (bool32ToBool linearColorAttachment)

instance Storable PhysicalDeviceLinearColorAttachmentFeaturesNV where
  sizeOf ~_ = 24
  alignment ~_ = 8
  peek = peekCStruct
  poke ptr poked = pokeCStruct ptr poked (pure ())

instance Zero PhysicalDeviceLinearColorAttachmentFeaturesNV where
  zero = PhysicalDeviceLinearColorAttachmentFeaturesNV
           zero

type NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION"
pattern NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION :: forall a . Integral a => a
pattern NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION = 1

type NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME = "VK_NV_linear_color_attachment"

-- No documentation found for TopLevel "VK_NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME"
pattern NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME = "VK_NV_linear_color_attachment"


text:
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans         http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!--

    Copyright 2005-2014 The Kuali Foundation

    Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php

    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.

-->
<bean id="DocumentType-InquiryView" parent="Uif-InquiryView">
   <property name="title" value="Document Type"/>
   <property name="dataObjectClassName" value="org.kuali.rice.kew.doctype.bo.DocumentType"/>
   <property name="Items">
       <list>
         <bean parent="Uif-Disclosure-GridSection">
           <property name="layoutManager.numberOfColumns" value="2"/>
           <property name="items">
             <list>
              <bean parent="Uif-InputField" p:propertyName="docTypeParentId"/>
              <bean parent="Uif-InputField" p:propertyName="parentDocType.name"/>
              <bean parent="Uif-InputField" p:propertyName="documentTypeId"/>
              <bean parent="Uif-InputField" p:propertyName="name"/>
              <bean parent="Uif-InputField" p:propertyName="label"/>
              <bean parent="Uif-InputField" p:propertyName="description"/>
              <bean parent="Uif-InputField" p:propertyName="displayableUnresolvedDocHandlerUrl"/>
              <bean parent="Uif-InputField" p:propertyName="unresolvedHelpDefinitionUrl"/>
              <bean parent="Uif-InputField" p:propertyName="unresolvedDocSearchHelpUrl"/>
              <bean parent="Uif-InputField" p:propertyName="displayablePostProcessorName"/>
              <bean parent="Uif-InputField" p:propertyName="displayableNotificationFromAddress"/>
              <bean parent="Uif-InputField" p:propertyName="displayableApplicationId"/>
              <bean parent="Uif-InputField" p:propertyName="active"/>
             </list>
           </property>
         </bean>
       	</list>
  	 </property>
</bean>

</beans>


text:
"""
GBDX Catalog Image Interface.
Contact: chris.helm@digitalglobe.com
"""
import warnings

from gbdxtools.images.drivers import WorldViewDriver, RDADaskImageDriver
from gbdxtools.images.base import RDABaseImage
from gbdxtools import IdahoImage
from gbdxtools.images.util import vector_services_query, vendor_id, band_types
from gbdxtools.rda.interface import RDA
from gbdxtools.rda.error import MissingIdahoImages, AcompUnavailable

rda = RDA()

RDA_DTYPES = {
    None: '4',
    'uint8': "0",
    'uint16': "1",
    'int16': "2",
    'int32': "3",
    'float32': "4",
    'float64': "5"
}

class WorldViewImage(RDABaseImage):
    __Driver__ = WorldViewDriver
    _parts = None

    @property
    def cat_id(self):
        return self.__rda_id__

    @property
    def parts(self):
        if self._parts is None:
            self._parts = [IdahoImage(rec['properties']['attributes']['idahoImageId'],
                                      proj=self.options["proj"],
                                      bucket=rec['properties']['attributes']['bucketName'],
                                      gsd=self.options["gsd"],
                                      acomp=self.options["acomp"])
                           for rec in self._find_parts(self.cat_id, self.options["band_type"])]
        return self._parts

    @staticmethod
    def _find_parts(cat_id, band_type):
        query = "item_type:IDAHOImage AND attributes.catalogID:{}".format(cat_id)
        _parts = vector_services_query(query)
        if not len(_parts):
            raise MissingIdahoImages('Unable to find IDAHO imagery in the catalog: {}'.format(query))
        _id = vendor_id(_parts[0])
        return [p for p in _parts if vendor_id(p) == _id]

    @classmethod
    def _build_graph(cls, cat_id, band_type="MS", proj="EPSG:4326", gsd=None, acomp=False, dra=False, dtype="float32",
                     **kwargs):
        bands = band_types[band_type]
        gsd = gsd if not None else ""
        correction = "ACOMP" if acomp else kwargs.get("correctionType", "TOAREFLECTANCE")
        if dra:
            digital_globe_strip = rda.DigitalGlobeStripTemplate(catId=cat_id, crs=proj, gsd=gsd, correctionType=correction,
                                                        bands=bands, fallbackToTOA=True, nodeId="RadiometricDRA")
        else:
            digital_globe_strip = rda.DigitalGlobeStripTemplate(catId=cat_id, crs=proj, gsd=gsd, correctionType=correction,
                                                        bands=bands,
                                                        fallbackToTOA=True)
            try:
                _dtype = RDA_DTYPES[dtype]
            except Exception as e:
                warnings.warn('Unknown dtype {}, Reason: {}'.format(dtype, e))
                _dtype = "4"

            digital_globe_strip = digital_globe_strip(nodeId="Format", dataType=_dtype)

        return digital_globe_strip

    @property
    def _rgb_bands(self):
        return [4, 2, 1]

    @property
    def _ndvi_bands(self):
        return [6, 4]

    @property
    def _ndwi_bands(self):
        return [7, 0]

class WV03_SWIR(WorldViewImage):
    @staticmethod
    def _find_parts(cat_id, band_type):
        query = "item_type:IDAHOImage AND attributes.catalogID:{}".format(cat_id)
        return vector_services_query(query)

    @classmethod
    def _build_graph(cls, cat_id, proj="EPSG:4326", gsd=None, acomp=False, dtype="float32", **kwargs):
        bands = "SWIR"
        gsd = gsd if not None else ""
        correction = "ACOMP" if acomp else kwargs.get("correctionType", "TOAREFLECTANCE")
        digital_globe_strip = rda.DigitalGlobeStripTemplate(catId=cat_id, crs=proj, gsd=gsd, correctionType=correction,
                                                    bands=bands, fallbackToTOA=True)
        try:
            _dtype = RDA_DTYPES[dtype]
        except Exception as e:
            warnings.warn('Unknown dtype, Reason {}'.format(e))
            _dtype = "4"

        digital_globe_strip = digital_globe_strip(nodeId="Format", dataType=_dtype)

        return digital_globe_strip

    @property
    def _rgb_bands(self):
        raise NotImplementedError("RGB bands not available in SWIR spectrum")

    @property
    def _ndvi_bands(self):
        raise NotImplementedError("NDVI bands not available in SWIR spectrum")

    def plot(self, **kwargs):
        bands = kwargs.get("bands")
        if bands is not None:
            assert len(bands) == 1, "SWIR supports plotting only a single band at a time"
        if "cmap" in kwargs:
            cmap = kwargs["cmap"]
            del kwargs["cmap"]
        else:
            cmap = "Greys_r"
        self._plot(tfm=self._single_band, cmap=cmap, **kwargs)

    def _single_band(self, **kwargs):
        if "bands" not in kwargs:
            kwargs["bands"] = [0]
        arr = self._read(self, **kwargs)
        return arr[0,:,:]

class WV03_VNIR(WorldViewImage):
    pass

class WV02(WorldViewImage):
    pass

class WV01(WorldViewImage):
    class WV01Driver(RDADaskImageDriver):
        image_option_support = ["proj", "gsd", "band_type", "correctionType", "dtype"]
        __image_option_defaults__ = {"band_type": "pan", "correctionType": "DN", "dtype": None}

    __Driver__ = WV01Driver

class WV04(WorldViewImage):
    @property
    def _rgb_bands(self):
        return [2,1,0]

    @property
    def _ndvi_bands(self):
        return [2,3]