text:
**appy** is a full featured boilerplate web app designed as an end to end solution for mvp development. The frontend is built on [Vue.js](https://vuejs.org) and utilizes the [AdminLTE](https://adminlte.io) UI template. The [backend](https://github.com/JKHeadley/appy/tree/master/backend) implements a hapi server (via [rest-hapi](https://github.com/JKHeadley/rest-hapi)) with a MongoDB datastore.

![appy-dashboard](https://user-images.githubusercontent.com/12631935/39155220-f691c77e-4705-11e8-9b83-2129a07c6d35.png)

Just want an API server? Try [appy-backend](https://github.com/JKHeadley/appy-backend)

**Live Demo**: https://appyapp.io/#live_demo

---

appy is being sponsored by the following tool; please help to support us by taking a look and signing up to a free trial!

## Requirements

Just [Docker](https://docs.docker.com/install)

**OR**

You need [Node.js](https://nodejs.org/en/) installed (>=12.14.1) and you'll need [MongoDB](https://docs.mongodb.com/manual/installation/) installed and running.

## Getting Started

Download from GitHub:

```bash
$ git clone https://github.com/JKHeadley/appy.git
$ cd appy
```

## Using Docker

> **NOTE**: Docker commands might take some time on the first build. After the first build they
> should be relatively quick.

Rename `backend/.env-docker-sample` to `backend/.env-docker` and update any secrets or keys as needed (this is not
required, but at minimum providing a valid `IPSTACK_ACCESS_KEY` will allow for proper dashboard
data). **Never commit .env-docker to your repo**

Also, update values in `backend/config/index.js` as needed.

Seed the db with data (only required once):

```bash
$ sh seed_data.sh
```

Once seeding is done, run the app:

```bash
$ sh run_app.sh
```

Point your browser to http://localhost:3000/ to view the app, http://localhost:8080/ to view the swagger API docs, or click on one of the test accounts below to login:

> **NOTE**: Password for all seed users is `root`.

**User**

**Admin**

**Super Admin**

...that's it, have fun!

## Without Docker

Install dependencies:

#### Backend

``` bash
$ cd backend
$ npm install
```

#### Frontend

``` bash
$ cd frontend
$ npm install
```

### Backend Configuration
Rename `.env-sample` to `.env` and update any secrets or keys as needed (this is not
required, but at minimum providing a valid `IPSTACK_ACCESS_KEY` will allow for proper dashboard
data). **Never commit .env to your repo**

Also, update values in `backend/config/index.js` as needed.

### First time setup
**WARNING**: This will clear all data in the MongoDB database defined in ``restHapiConfig.mongo.URI`` (default ``mongodb://localhost/appy``).

To seed your database with some data, run:

```
$ npm run seed
```

> **NOTE**: The password for all seed users is ``root``.

### Running appy

#### Backend

``` bash
$ npm run start
```

Point your browser to http://localhost:8080/ to view the Swagger docs.

#### Frontend

``` bash
$ npm run start
```

Point your browser to http://localhost:3000/ to view the app, or click on one of the test accounts below to login:

**User**

**Admin**

**Super Admin**

## Temporary Docs
Official docs for appy are coming soon, but for now you can find some information in the [appy-backend wiki](https://github.com/JKHeadley/appy-backend/wiki)

License
-------
appy is an open source project by [Justin Headley](http://justinheadley.com) that is licensed under [MIT](http://opensource.org/licenses/MIT).

**This project is undergoing a major update. Complete README and docs coming soon.**


text:
package com.syaku.modules.addon;

import java.util.*;
import java.io.*;

import org.apache.log4j.Logger;
import org.apache.commons.lang.*;
import org.apache.commons.configuration.*;

import com.syaku.core.util.*;

public class AddonObject extends AddonAccess {
  private Logger log = Logger.getLogger( this.getClass() );
  public final Configuration meiConfig = ConfigUtils.getProperties("mei.properties"); // mei 정보
  public final Configuration modConfig = ConfigUtils.getProperties("com/syaku/modules/addon/info.properties");

  public final String MEI_PATH_RELATIVE = meiConfig.getString("mei.path.relative");
  public final String MEI_PATH_ABSOLUTE_RELATIVE = meiConfig.getString("mei.path.absolute_relative");
  public final String MEI_PATH_ADDONS = meiConfig.getString("mei.path.addons");
  public final String MEI_PATH_RESOURCE = meiConfig.getString("mei.path.resource");

  public void propReload() throws Exception {
    PropertiesConfiguration addonConfig = new PropertiesConfiguration(MEI_PATH_RESOURCE + "/mei.config.properties");

    List listProp = addonConfig.getList("mei.addons.load");
    int countProp = listProp.size();

    for (int p = 0; p < countProp; p++ ) {
      String name = (String) listProp.get(p);
      addonConfig.clearProperty("mei.addons.load");
    }
    addonConfig.save();

    Map mapSch = new HashMap();
    mapSch.put("is_use","Y");
    mapSch.put("listorder","first_load");

    List list = sqlAddonList(mapSch);
    int count = list.size();

    for (int i = 0; i < count; i++ ) {
      AddonBean addonbean= (AddonBean) list.get(i);
      String addon = addonbean.getAddon();
      String addon_path = addonbean.getAddon_path();
      addon_path = addon_path + "/addon.html";
      addonConfig.addProperty("mei.addons.load",addon_path);
    }

    addonConfig.save();
  }

  public Map prop2map(String source) {
    /*
    Configuration addonConfig = ConfigUtils.getProperties(source);

    Map mapData = new HashMap();
    mapData.put("version" , addonConfig.getString("mei.addon.version") );
    mapData.put("name",addonConfig.getString("mei.addon.name"));
    mapData.put("type",addonConfig.getString("mei.addon.type"));
    mapData.put("path",addonConfig.getString("mei.addon.path.relative"));
    mapData.put("title",addonConfig.getString("mei.addon.title"));
    mapData.put("site",addonConfig.getString("mei.addon.developer.site"));
    */

    XMLConfiguration addonConfig = ConfigUtils.getXml(source);
    Map mapData = new HashMap();
    mapData.put("version" , addonConfig.getString("version") );
    mapData.put("name",addonConfig.getString("name"));
    mapData.put("type",addonConfig.getString("type"));
    mapData.put("path", "/addons/" + addonConfig.getString("name"));
    mapData.put("title",addonConfig.getString("title"));
    mapData.put("description",addonConfig.getString("description"));
    mapData.put("site",addonConfig.getString("developer.site"));
    return mapData;
  }

  public List getAddonLoader() {
    List listAddonLoad = new ArrayList();

    // 애드온 로드
    /*
    mei.addon.version = 버전
    mei.addon.name = 애드온명
    mei.addon.type = 애드온 종류
    mei.addon.path.relative = 애드온 경로
    */
    String addons_dir = MEI_PATH_ABSOLUTE_RELATIVE + MEI_PATH_ADDONS;

    File dir = new File(addons_dir);
    File dir_arr[] = dir.listFiles();
    int count = dir_arr.length;
    for (int i = 0; i < count; i++) {
      File f = dir_arr[i];

      if (dir_arr[i].isDirectory()) {
        String name = f.getName();

        if ( !StringUtils.equals(name,".svn") && StringUtils.isNotEmpty(name) ) { // SVN 폴더 제외
          String f_path = f.getAbsolutePath();
          String addon_info = f_path + "/addon.xml";

          File check = new File(addon_info);
          if (check.exists()) {
            Map mapData = prop2map(addons_dir + "/" + name + "/addon.xml");
            listAddonLoad.add(mapData);
          }

        }

      }

    }

    return listAddonLoad;
  }

}

redpajama_set_name: RedPajamaGithub


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"/>

        <link rel="SHORTCUT ICON" href="../../../img/clover.ico" />

  <title>EasyMock 3.0</title>

                    Clover Test Report - EasyMock 3.0
Coverage timestamp: sam. mai 8 2010 14:37:27 CEST

                            Overview
                            Package
                            File
                            Test

                            FRAMES
                            NO FRAMES
                            SHOW HELP

    Test
        Unique Coverage
        Status
    Start time
    Time (seconds)
    Message

        testAll

        0%

                          1
    PASS

        8 mai 14:37:27

        0.0

        Target Class
                Unique
                Coverage contributed by testAll.

            org.easymock.internal.ObjenesisClassInstantiator
              org.easymock.internal.ObjenesisClassInstantiator

                                        0.0

            1.0
            100%

            org.easymock.internal.ExpectedInvocationAndResults
              org.easymock.internal.ExpectedInvocationAndResults

                                        0.0

            0.7777778
            77,8%

            org.easymock.internal.ClassProxyFactory
              org.easymock.internal.ClassProxyFactory

                                        0.0

            0.7291667
            72,9%

            org.easymock.internal.Results
              org.easymock.internal.Results

                                        0.0

            0.6557377
            65,6%

            org.easymock.internal.MockInvocationHandler
              org.easymock.internal.MockInvocationHandler

                                        0.0

            0.64285713
            64,3%

            org.easymock.internal.Result.ReturningAnswer
              org.easymock.internal.Result.ReturningAnswer

                                        0.0

            0.5
            50%

            org.easymock.internal.Range
              org.easymock.internal.Range

                                        0.0

            0.43589744
            43,6%

            org.easymock.internal.Result
              org.easymock.internal.Result

                                        0.0

            0.4117647
            41,2%

            org.easymock.internal.ObjectMethodsFilter
              org.easymock.internal.ObjectMethodsFilter

                                        0.0

            0.40384614
            40,4%

            org.easymock.internal.UnorderedBehavior
              org.easymock.internal.UnorderedBehavior

                                        0.0

            0.3898305
            39%

            org.easymock.EasyMockSupport
              org.easymock.EasyMockSupport

                                        0.0

            0.3529412
            35,3%

            org.easymock.internal.ExpectedInvocation
              org.easymock.internal.ExpectedInvocation

                                        0.0

            0.3392857
            33,9%

            org.easymock.internal.MocksBehavior
              org.easymock.internal.MocksBehavior

                                        0.0

            0.32173914
            32,2%

            org.easymock.internal.LastControl
              org.easymock.internal.LastControl

                                        0.0

            0.29577464
            29,6%

            org.easymock.internal.RecordState
              org.easymock.internal.RecordState

                                        0.0

            0.29296875
            29,3%

            org.easymock.internal.ReplayState
              org.easymock.internal.ReplayState

                                        0.0

            0.28787878
            28,8%

            org.easymock.internal.MocksControl
              org.easymock.internal.MocksControl

                                        0.0

            0.275
            27,5%

            org.easymock.internal.ClassProxyFactory.MockMethodInterceptor
              org.easymock.internal.ClassProxyFactory.MockMethodInterceptor

                                        0.0

            0.2264151
            22,6%

            org.easymock.internal.Invocation
              org.easymock.internal.Invocation

                                        0.0

            0.16806723
            16,8%

            org.easymock.internal.ClassInstantiatorFactory
              org.easymock.internal.ClassInstantiatorFactory

                                        0.0

            0.16666667
            16,7%

            org.easymock.internal.EasyMockProperties
              org.easymock.internal.EasyMockProperties

                                        0.0

            0.13043478
            13%

            org.easymock.internal.ClassExtensionHelper
              org.easymock.internal.ClassExtensionHelper

                                        0.0

            0.0952381
            9,5%

            org.easymock.EasyMock
              org.easymock.EasyMock

                                        0.0

            0.021791767
            2,2%

 	Report generated by Clover Code Coverage v3.0.1
sam. mai 8 2010 14:37:33 CEST.
 	 	Clover: Open Source License registered to EasyMock .


text:
.class Lcom/android/internal/widget/OpReorderer;
.super Ljava/lang/Object;
.source "OpReorderer.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/android/internal/widget/OpReorderer$Callback;
    }
.end annotation

# instance fields
.field final mCallback:Lcom/android/internal/widget/OpReorderer$Callback;

# direct methods
.method constructor <init>(Lcom/android/internal/widget/OpReorderer$Callback;)V
    .locals 0

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

    iput-object p1, p0, Lcom/android/internal/widget/OpReorderer;->mCallback:Lcom/android/internal/widget/OpReorderer$Callback;

    return-void
.end method

.method private getLastMoveOutOfOrder(Ljava/util/List;)I
    .locals 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/android/internal/widget/AdapterHelper$UpdateOp;",
            ">;)I"
        }
    .end annotation

    const/4 v0, 0x0

    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v3

    add-int/lit8 v1, v3, -0x1

    :goto_0
    if-ltz v1, :cond_2

    invoke-interface {p1, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/android/internal/widget/AdapterHelper$UpdateOp;

    iget v3, v2, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->cmd:I

    const/16 v4, 0x8

    if-ne v3, v4, :cond_0

    if-eqz v0, :cond_1

    return v1

    :cond_0
    const/4 v0, 0x1

    :cond_1
    add-int/lit8 v1, v1, -0x1

    goto :goto_0

    :cond_2
    const/4 v3, -0x1

    return v3
.end method

.method private swapMoveAdd(Ljava/util/List;ILcom/android/internal/widget/AdapterHelper$UpdateOp;ILcom/android/internal/widget/AdapterHelper$UpdateOp;)V
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/android/internal/widget/AdapterHelper$UpdateOp;",
            ">;I",
            "Lcom/android/internal/widget/AdapterHelper$UpdateOp;",
            "I",
            "Lcom/android/internal/widget/AdapterHelper$UpdateOp;",
            ")V"
        }
    .end annotation

    const/4 v0, 0x0

    iget v1, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v2, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-ge v1, v2, :cond_0

    const/4 v0, -0x1

    :cond_0
    iget v1, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v2, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-ge v1, v2, :cond_1

    add-int/lit8 v0, v0, 0x1

    :cond_1
    iget v1, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v2, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-gt v1, v2, :cond_2

    iget v1, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v2, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    add-int/2addr v1, v2

    iput v1, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    :cond_2
    iget v1, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v2, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    if-gt v1, v2, :cond_3

    iget v1, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v2, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    add-int/2addr v1, v2

    iput v1, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    :cond_3
    iget v1, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    add-int/2addr v1, v0

    iput v1, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    invoke-interface {p1, p2, p5}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;

    invoke-interface {p1, p4, p3}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method private swapMoveOp(Ljava/util/List;II)V
    .locals 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/android/internal/widget/AdapterHelper$UpdateOp;",
            ">;II)V"
        }
    .end annotation

    invoke-interface {p1, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;

    invoke-interface {p1, p3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;

    iget v0, v5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->cmd:I

    packed-switch v0, :pswitch_data_0

    :goto_0
    :pswitch_0
    return-void

    :pswitch_1
    move-object v0, p0

    move-object v1, p1

    move v2, p2

    move v4, p3

    invoke-virtual/range {v0 .. v5}, Lcom/android/internal/widget/OpReorderer;->swapMoveRemove(Ljava/util/List;ILcom/android/internal/widget/AdapterHelper$UpdateOp;ILcom/android/internal/widget/AdapterHelper$UpdateOp;)V

    goto :goto_0

    :pswitch_2
    move-object v0, p0

    move-object v1, p1

    move v2, p2

    move v4, p3

    invoke-direct/range {v0 .. v5}, Lcom/android/internal/widget/OpReorderer;->swapMoveAdd(Ljava/util/List;ILcom/android/internal/widget/AdapterHelper$UpdateOp;ILcom/android/internal/widget/AdapterHelper$UpdateOp;)V

    goto :goto_0

    :pswitch_3
    move-object v0, p0

    move-object v1, p1

    move v2, p2

    move v4, p3

    invoke-virtual/range {v0 .. v5}, Lcom/android/internal/widget/OpReorderer;->swapMoveUpdate(Ljava/util/List;ILcom/android/internal/widget/AdapterHelper$UpdateOp;ILcom/android/internal/widget/AdapterHelper$UpdateOp;)V

    goto :goto_0

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_2
        :pswitch_1
        :pswitch_0
        :pswitch_3
    .end packed-switch
.end method

# virtual methods
.method reorderOps(Ljava/util/List;)V
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/android/internal/widget/AdapterHelper$UpdateOp;",
            ">;)V"
        }
    .end annotation

    :goto_0
    invoke-direct {p0, p1}, Lcom/android/internal/widget/OpReorderer;->getLastMoveOutOfOrder(Ljava/util/List;)I

    move-result v0

    const/4 v1, -0x1

    if-eq v0, v1, :cond_0

    add-int/lit8 v1, v0, 0x1

    invoke-direct {p0, p1, v0, v1}, Lcom/android/internal/widget/OpReorderer;->swapMoveOp(Ljava/util/List;II)V

    goto :goto_0

    :cond_0
    return-void
.end method

.method swapMoveRemove(Ljava/util/List;ILcom/android/internal/widget/AdapterHelper$UpdateOp;ILcom/android/internal/widget/AdapterHelper$UpdateOp;)V
    .locals 9
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/android/internal/widget/AdapterHelper$UpdateOp;",
            ">;I",
            "Lcom/android/internal/widget/AdapterHelper$UpdateOp;",
            "I",
            "Lcom/android/internal/widget/AdapterHelper$UpdateOp;",
            ")V"
        }
    .end annotation

    const/4 v8, 0x2

    const/4 v7, 0x0

    const/4 v0, 0x0

    const/4 v3, 0x0

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    if-ge v4, v5, :cond_3

    const/4 v1, 0x0

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-ne v4, v5, :cond_0

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v5, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v6, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    sub-int/2addr v5, v6

    if-ne v4, v5, :cond_0

    const/4 v3, 0x1

    :cond_0
    :goto_0
    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-ge v4, v5, :cond_4

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    add-int/lit8 v4, v4, -0x1

    iput v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    :cond_1
    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-gt v4, v5, :cond_6

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    add-int/lit8 v4, v4, 0x1

    iput v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    :cond_2
    :goto_1
    if-eqz v3, :cond_7

    invoke-interface {p1, p2, p5}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;

    invoke-interface {p1, p4}, Ljava/util/List;->remove(I)Ljava/lang/Object;

    iget-object v4, p0, Lcom/android/internal/widget/OpReorderer;->mCallback:Lcom/android/internal/widget/OpReorderer$Callback;

    invoke-interface {v4, p3}, Lcom/android/internal/widget/OpReorderer$Callback;->recycleUpdateOp(Lcom/android/internal/widget/AdapterHelper$UpdateOp;)V

    return-void

    :cond_3
    const/4 v1, 0x1

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    add-int/lit8 v5, v5, 0x1

    if-ne v4, v5, :cond_0

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v5, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v6, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    sub-int/2addr v5, v6

    if-ne v4, v5, :cond_0

    const/4 v3, 0x1

    goto :goto_0

    :cond_4
    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v6, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    add-int/2addr v5, v6

    if-ge v4, v5, :cond_1

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    add-int/lit8 v4, v4, -0x1

    iput v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iput v8, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->cmd:I

    const/4 v4, 0x1

    iput v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    if-nez v4, :cond_5

    invoke-interface {p1, p4}, Ljava/util/List;->remove(I)Ljava/lang/Object;

    iget-object v4, p0, Lcom/android/internal/widget/OpReorderer;->mCallback:Lcom/android/internal/widget/OpReorderer$Callback;

    invoke-interface {v4, p5}, Lcom/android/internal/widget/OpReorderer$Callback;->recycleUpdateOp(Lcom/android/internal/widget/AdapterHelper$UpdateOp;)V

    :cond_5
    return-void

    :cond_6
    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v6, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    add-int/2addr v5, v6

    if-ge v4, v5, :cond_2

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    add-int/2addr v4, v5

    iget v5, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    sub-int v2, v4, v5

    iget-object v4, p0, Lcom/android/internal/widget/OpReorderer;->mCallback:Lcom/android/internal/widget/OpReorderer$Callback;

    iget v5, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    add-int/lit8 v5, v5, 0x1

    invoke-interface {v4, v8, v5, v2, v7}, Lcom/android/internal/widget/OpReorderer$Callback;->obtainUpdateOp(IIILjava/lang/Object;)Lcom/android/internal/widget/AdapterHelper$UpdateOp;

    move-result-object v0

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    sub-int/2addr v4, v5

    iput v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    goto :goto_1

    :cond_7
    if-eqz v1, :cond_d

    if-eqz v0, :cond_9

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, v0, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-le v4, v5, :cond_8

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, v0, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    sub-int/2addr v4, v5

    iput v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    :cond_8
    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v5, v0, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-le v4, v5, :cond_9

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v5, v0, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    sub-int/2addr v4, v5

    iput v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    :cond_9
    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-le v4, v5, :cond_a

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    sub-int/2addr v4, v5

    iput v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    :cond_a
    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-le v4, v5, :cond_b

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    sub-int/2addr v4, v5

    iput v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    :cond_b
    :goto_2
    invoke-interface {p1, p2, p5}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    if-eq v4, v5, :cond_11

    invoke-interface {p1, p4, p3}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;

    :goto_3
    if-eqz v0, :cond_c

    invoke-interface {p1, p2, v0}, Ljava/util/List;->add(ILjava/lang/Object;)V

    :cond_c
    return-void

    :cond_d
    if-eqz v0, :cond_f

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, v0, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-lt v4, v5, :cond_e

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, v0, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    sub-int/2addr v4, v5

    iput v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    :cond_e
    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v5, v0, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-lt v4, v5, :cond_f

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v5, v0, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    sub-int/2addr v4, v5

    iput v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    :cond_f
    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-lt v4, v5, :cond_10

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    sub-int/2addr v4, v5

    iput v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    :cond_10
    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-lt v4, v5, :cond_b

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    sub-int/2addr v4, v5

    iput v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    goto :goto_2

    :cond_11
    invoke-interface {p1, p4}, Ljava/util/List;->remove(I)Ljava/lang/Object;

    goto :goto_3
.end method

.method swapMoveUpdate(Ljava/util/List;ILcom/android/internal/widget/AdapterHelper$UpdateOp;ILcom/android/internal/widget/AdapterHelper$UpdateOp;)V
    .locals 8
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/android/internal/widget/AdapterHelper$UpdateOp;",
            ">;I",
            "Lcom/android/internal/widget/AdapterHelper$UpdateOp;",
            "I",
            "Lcom/android/internal/widget/AdapterHelper$UpdateOp;",
            ")V"
        }
    .end annotation

    const/4 v7, 0x4

    const/4 v0, 0x0

    const/4 v1, 0x0

    iget v3, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-ge v3, v4, :cond_4

    iget v3, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    add-int/lit8 v3, v3, -0x1

    iput v3, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    :cond_0
    :goto_0
    iget v3, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    if-gt v3, v4, :cond_5

    iget v3, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    add-int/lit8 v3, v3, 0x1

    iput v3, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    :cond_1
    :goto_1
    invoke-interface {p1, p4, p3}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;

    iget v3, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    if-lez v3, :cond_6

    invoke-interface {p1, p2, p5}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;

    :goto_2
    if-eqz v0, :cond_2

    invoke-interface {p1, p2, v0}, Ljava/util/List;->add(ILjava/lang/Object;)V

    :cond_2
    if-eqz v1, :cond_3

    invoke-interface {p1, p2, v1}, Ljava/util/List;->add(ILjava/lang/Object;)V

    :cond_3
    return-void

    :cond_4
    iget v3, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    add-int/2addr v4, v5

    if-ge v3, v4, :cond_0

    iget v3, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    add-int/lit8 v3, v3, -0x1

    iput v3, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    iget-object v3, p0, Lcom/android/internal/widget/OpReorderer;->mCallback:Lcom/android/internal/widget/OpReorderer$Callback;

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget-object v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;

    const/4 v6, 0x1

    invoke-interface {v3, v7, v4, v6, v5}, Lcom/android/internal/widget/OpReorderer$Callback;->obtainUpdateOp(IIILjava/lang/Object;)Lcom/android/internal/widget/AdapterHelper$UpdateOp;

    move-result-object v0

    goto :goto_0

    :cond_5
    iget v3, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    add-int/2addr v4, v5

    if-ge v3, v4, :cond_1

    iget v3, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    iget v4, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    add-int/2addr v3, v4

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    sub-int v2, v3, v4

    iget-object v3, p0, Lcom/android/internal/widget/OpReorderer;->mCallback:Lcom/android/internal/widget/OpReorderer$Callback;

    iget v4, p3, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->positionStart:I

    add-int/lit8 v4, v4, 0x1

    iget-object v5, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;

    invoke-interface {v3, v7, v4, v2, v5}, Lcom/android/internal/widget/OpReorderer$Callback;->obtainUpdateOp(IIILjava/lang/Object;)Lcom/android/internal/widget/AdapterHelper$UpdateOp;

    move-result-object v1

    iget v3, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    sub-int/2addr v3, v2

    iput v3, p5, Lcom/android/internal/widget/AdapterHelper$UpdateOp;->itemCount:I

    goto :goto_1

    :cond_6
    invoke-interface {p1, p2}, Ljava/util/List;->remove(I)Ljava/lang/Object;

    iget-object v3, p0, Lcom/android/internal/widget/OpReorderer;->mCallback:Lcom/android/internal/widget/OpReorderer$Callback;

    invoke-interface {v3, p5}, Lcom/android/internal/widget/OpReorderer$Callback;->recycleUpdateOp(Lcom/android/internal/widget/AdapterHelper$UpdateOp;)V

    goto :goto_2
.end method


text:
import React from 'react';
import {View} from 'react-native';

import Markdown from '@components/markdown';
import {useTheme} from '@context/theme';
import {getMarkdownBlockStyles, getMarkdownTextStyles} from '@utils/markdown';
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';

const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => {
    return {
        helpTextContainer: {
            marginHorizontal: 15,
            marginTop: 10,
        },
        helpText: {
            fontSize: 12,
            color: changeOpacity(theme.centerChannelColor, 0.5),
        },
        errorTextContainer: {
            marginHorizontal: 15,
            marginVertical: 10,
        },
        errorText: {
            fontSize: 12,
            color: theme.errorTextColor,
        },
    };
});

type Props = {
    disabled: boolean;
    disabledText?: string;
    helpText?: string;
    errorText?: string;
}
function Footer({
    disabled,
    disabledText,
    helpText,
    errorText,
}: Props) {
    const theme = useTheme();
    const style = getStyleSheet(theme);
    const textStyles = getMarkdownTextStyles(theme);
    const blockStyles = getMarkdownBlockStyles(theme);

    return (
        <>
            {disabled && Boolean(disabledText) && (
                <View style={style.helpTextContainer} >
                    <Markdown
                        baseTextStyle={style.helpText}
                        textStyles={textStyles}
                        disableAtMentions={true}
                        location=''
                        blockStyles={blockStyles}
                        value={disabledText}
                        theme={theme}
                    />
                </View>
            )}
            {Boolean(helpText) && (
                <View style={style.helpTextContainer} >
                    <Markdown
                        baseTextStyle={style.helpText}
                        textStyles={textStyles}
                        blockStyles={blockStyles}
                        disableAtMentions={true}
                        location=''
                        value={helpText}
                        theme={theme}
                    />
                </View>
            )}
            {Boolean(errorText) && (
                <View style={style.errorTextContainer} >
                    <Markdown
                        baseTextStyle={style.errorText}
                        textStyles={textStyles}
                        blockStyles={blockStyles}
                        disableAtMentions={true}
                        location=''
                        value={errorText}
                        theme={theme}
                    />
                </View>
            )}
        </>
    );
}

export default Footer;


text:
package models

import (
	"bufio"
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"regexp"
	"strings"
	"sync"
	"time"
)

type BuildBot struct {
	github         *GitHub
	imageNameRegex *regexp.Regexp
	logURLRegex    *regexp.Regexp
}

type BuildbotChangeHook struct {
	Project    string    `json:"project"`
	Revision   string    `json:"revision"`
	Branch     string    `json:"branch"`
	RevLink    string    `json:"revlink"`
	Repository string    `json:"repository"`
	CreatedAt  time.Time `json:"when_timestamp"`
	Author     string    `json:"author"`
	Comments   string    `json:"comments"`
}

var (
	buildbotOnce sync.Once
	buildbotInst *BuildBot
)

type LogChunk struct {
	Content   string `json:"content"`
	FirstLine int    `json:"firstline"`
	LogID     int    `json:"logid"`
}

type LogChunks struct {
	Meta      interface{} `json:"meta"`
	LogChunks []LogChunk  `json:"logchunks"`
}

func NewBuildBot() *BuildBot {
	buildbotOnce.Do(func() {
		buildbotInst = &BuildBot{
			github:         NewCommonGitHub(),
			imageNameRegex: regexp.MustCompile("imageName:(.+)"),
			logURLRegex:    regexp.MustCompile("logURL:(.+)"),
		}
	})
	return buildbotInst
}

func (this *BuildBot) GetLogContent(url string) (string, error) {
	resp, err := http.Get(url)
	if err != nil {
		return "", err
	}
	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)
	if resp.StatusCode < 200 || resp.StatusCode >= 400 {
		return "", fmt.Errorf("failed to get log contents from %s: %v", url, err)
	}

	var logChunks LogChunks
	if err := json.Unmarshal(body, &logChunks); err != nil {
		return "", fmt.Errorf("failed to read log contents from %s: %v", url, err)
	}

	logs := make([]string, len(logChunks.LogChunks))
	for i, lc := range logChunks.LogChunks {
		lcr := bufio.NewScanner(strings.NewReader(lc.Content))
		var lcs []string
		for lcr.Scan() {
			lc := lcr.Text()
			prefix := ""
			switch lc[0] {
			case 'h':
				prefix = "header"
			case 'o':
				prefix = "stdout"
			case 'e':
				prefix = "stderr"
			case 'i':
				prefix = "input"
			}
			lcs = append(lcs, fmt.Sprintf("%s: %s", prefix, lc[1:len(lc)]))
		}
		logs[i] = strings.Join(lcs, "\n")
	}
	return strings.Join(logs, "\n"), nil
}

func (b *BuildBot) GetImageName(description string) (string, error) {
	imageNameSubmatch := b.imageNameRegex.FindStringSubmatch(description)
	if len(imageNameSubmatch) < 2 {
		return "", fmt.Errorf("image name parse failed on description %s", description)
	}
	return strings.TrimSpace(imageNameSubmatch[1]), nil
}

func (b *BuildBot) GetLogURL(description string) (string, error) {
	logURLSubmatch := b.logURLRegex.FindStringSubmatch(description)
	if len(logURLSubmatch) < 2 {
		return "", fmt.Errorf("log URL parse failed on description %s", description)
	}
	return strings.TrimSpace(logURLSubmatch[1]), nil
}

func (b *BuildBot) Build(owner, repo, branch, sha string) error {
	c, err := b.github.GetCommit(owner, repo, sha)
	if err != nil {
		return err
	}

	bch := BuildbotChangeHook{
		Project:    fmt.Sprintf("%s/%s", owner, repo),
		Repository: strings.TrimSuffix(*c.HTMLURL, "/commit/"+sha),
		Branch:     branch,
		Author:     fmt.Sprintf("%s <%s>", *c.Commit.Committer.Name, *c.Commit.Committer.Email),
		CreatedAt:  *c.Commit.Committer.Date,
		RevLink:    *c.HTMLURL,
		Comments:   *c.Commit.Message,
		Revision:   sha,
	}

	client := &http.Client{}
	req, err := http.NewRequest(http.MethodPost, Conf.Buildbot.WebHook, nil)

	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("X-GitHub-Event", "cite")
	body, err := json.Marshal(bch)
	req.Body = ioutil.NopCloser(bytes.NewReader(body))
	resp, err := client.Do(req)
	if err != nil {
		respBody, _ := ioutil.ReadAll(resp.Body)
		defer resp.Body.Close()
		err := fmt.Errorf("failed to send 'cite' event to buildbot: %s", respBody)
		log.Printf(err.Error())
		return err
	}
	return nil
}

func (b *BuildBot) Proxy(method string, header http.Header, body []byte) error {
	req, err := http.NewRequest(method, Conf.Buildbot.WebHook, bytes.NewReader(body))
	if err != nil {
		return fmt.Errorf("failed to create new proxy request: %v", err)
	}
	req.Header = header

	buildbotClient := http.DefaultClient
	resp, err := buildbotClient.Do(req)
	if err != nil {
		return fmt.Errorf("failed to send proxy request: %v", err)
	}
	if resp.StatusCode < 200 || resp.StatusCode > 399 {
		respBody, _ := ioutil.ReadAll(resp.Body)
		defer resp.Body.Close()
		return fmt.Errorf("buildbot error. status:%v, body:%s", resp.Status, respBody)
	}
	return nil
}


text:
{% extends "wooey/base.html" %}
{% load i18n %}
{% load wooey_tags %}

{% block center_content %}

{% endblock center_content %}


text:
JAVA_SOURCES = \
	org/apache/hadoop/fs/gfarmfs/GfarmFileSystem.java \
	org/apache/hadoop/fs/gfarmfs/GfarmFSOutputStream.java \
	org/apache/hadoop/fs/gfarmfs/GfarmFSInputStream.java \
	org/apache/hadoop/fs/gfarmfs/GfarmFSNative.java \
	org/apache/hadoop/fs/gfarmfs/GfarmFSNativeOutputChannel.java \
	org/apache/hadoop/fs/gfarmfs/GfarmFSNativeInputChannel.java
JNI_CLASSES = \
	org.apache.hadoop.fs.gfarmfs.GfarmFSNative \
	org.apache.hadoop.fs.gfarmfs.GfarmFSNativeOutputChannel \
	org.apache.hadoop.fs.gfarmfs.GfarmFSNativeInputChannel

# GCC
CXXFLAGS = -Wall -O2 -g -D_REENTRANT -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux
LDFLAGS  = -lgfarm

all: hadoop-gfarm.jar

hadoop-gfarm.jar: libGfarmFSNative.so
	jar cmf manifest.cf hadoop-gfarm.jar org/apache/hadoop/fs/gfarmfs/*.class libGfarmFSNative.so

libGfarmFSNative.so: org_apache_hadoop_fs_gfarmfs_GfarmFSNative.h GfarmFSNative.cpp
	g++ ${CXXFLAGS} -shared -fPIC GfarmFSNative.cpp -o libGfarmFSNative.so ${LDFLAGS} -L ${GFARM_HOME}/lib

org_apache_hadoop_fs_gfarmfs_GfarmFSNative.h: ${JAVA_SOURCES}
	javac -g -Xlint:deprecation -classpath ${CLASSPATH} ${JAVA_SOURCES}
	javah -classpath ${CLASSPATH} -jni ${JNI_CLASSES}

clean:
	rm -f *.class
	rm -f org/apache/hadoop/fs/gfarmfs/*.class
	rm -f org_apache_hadoop_fs_gfarmfs_GfarmFSNative.h
	rm -f libGfarmFSNative.so
	rm -f hadoop-gfarm.jar
	rm -f org_*.h

test:
	javac -g -Xlint:deprecation -classpath ${CLASSPATH} Test.java
	LD_LIBRARY_PATH=. java -classpath ${CLASSPATH}:hadoop-gfarm.jar Test

wc:
	wc org/apache/hadoop/fs/gfarmfs/*.java *.cpp | sort


text:
package com.ntua.db.jpa;

import java.math.BigDecimal;
import java.util.Date;

import org.springframework.util.StringUtils;

import com.ntua.db.common.Utils;

public class Advertisment {

	private Date publishDate;

	private String propertyRegNo;

	private String newspaperId;

	private BigDecimal cost;

	private Integer duration;

	private String publishDateOp;

	private String propertyRegNoOp;

	private String newspaperIdOp;

	private String costOp;

	private String durationOp;

	public Advertisment(){

	}

	public Advertisment(Advertisment ad){
		publishDate = ad.getPublishDate();
		propertyRegNo = ad.getPropertyRegNo();
		newspaperId = ad.getNewspaperId();
		cost = ad.getCost();
		duration = ad.getDuration();
	}

	public Date getPublishDate() {
		return publishDate;
	}

	public void setPublishDate(Date publishDate) {
		this.publishDate = publishDate;
	}

	public String getPropertyRegNo() {
		return propertyRegNo;
	}

	public void setPropertyRegNo(String propertyRegNo) {
		this.propertyRegNo = propertyRegNo;
	}

	public String getNewspaperId() {
		return newspaperId;
	}

	public void setNewspaperId(String newspaperId) {
		this.newspaperId = newspaperId;
	}

	public BigDecimal getCost() {
		return cost;
	}

	public void setCost(BigDecimal cost) {
		this.cost = cost;
	}

	public Integer getDuration() {
		return duration;
	}

	public void setDuration(Integer duration) {
		this.duration = duration;
	}

	public String getPublishDateOp() {
		return publishDateOp;
	}

	public void setPublishDateOp(String publishDateOp) {
		this.publishDateOp = publishDateOp;
	}

	public String getPropertyRegNoOp() {
		return propertyRegNoOp;
	}

	public void setPropertyRegNoOp(String propertyRegNoOp) {
		this.propertyRegNoOp = propertyRegNoOp;
	}

	public String getNewspaperIdOp() {
		return newspaperIdOp;
	}

	public void setNewspaperIdOp(String newspaperIdOp) {
		this.newspaperIdOp = newspaperIdOp;
	}

	public String getCostOp() {
		return costOp;
	}

	public void setCostOp(String costOp) {
		this.costOp = costOp;
	}

	public String getDurationOp() {
		return durationOp;
	}

	public void setDurationOp(String durationOp) {
		this.durationOp = durationOp;
	}

	public String insertQuery(){
		String query = "INSERT INTO Advertisements VALUES(";
		query = query + (publishDate !=null ? "'" + Utils.getSqlDate(publishDate) + "'," : "null,");
		query = query + (StringUtils.hasText(propertyRegNo) ? propertyRegNo + "," : "null,");
		query = query + (StringUtils.hasText(newspaperId) ? "'" + newspaperId + "'," : "null,");
		query = query + cost + ",";
		query = query + duration + ")";
		return query;
	}

	/**
	 * Update query.
	 *
	 * @param updateNewsId the update news id
	 * @param updatePropRegNo the update prop reg no
	 * @param updateDate the update date
	 * @return the string
	 */
	public String updateQuery(String updateNewsId, String updatePropRegNo, Date updateDate){
		String query = "UPDATE Advertisements SET ";
		query = query + (publishDate !=null ? "DateOfPublish=" + "'" +  Utils.getSqlDate(publishDate) + "'," : "DateOfPublish=null,");
		query = query + (StringUtils.hasText(newspaperId) ? "NewspaperID='" + newspaperId + "'," : "NewspaperID=null,");
		query = query + (StringUtils.hasText(propertyRegNo) ? "PropertyRegistrationNo=" + propertyRegNo + "," : "PropertyRegistrationNo=null,");
		query = query + "Cost=" + cost + ",";
		query = query + "Duration=" + duration + ",";
		if(query.endsWith(","))
			query = query.substring(0, query.length()-1);
		query += " WHERE NewspaperID='"+updateNewsId+"' and PropertyRegistrationNo='" + updatePropRegNo
				+"' and DateOfPublish='" + Utils.getSqlDate(updateDate) + "'";
		return query;
	}

	/**
	 * Search query.
	 *
	 * @return the string
	 */
	public String searchQuery(){
		String query = "SELECT * FROM Advertisements WHERE";
		query = query + (StringUtils.hasText(propertyRegNo) ? " PropertyRegistrationNo"+ propertyRegNoOp+"" + propertyRegNo + " and" : "");
		query = query + (publishDate != null ? " DateOfPublish"+ publishDateOp+"'" + Utils.getSqlDate(publishDate) + "' and" : "");
		query = query + Utils.constructSearchQuery(newspaperIdOp, newspaperId, " NewspaperID");
		query = query + (cost != null ? " Cost"+ costOp+"" + cost + " and" : "");
		query = query + (duration != null ? " Duration"+ durationOp+"" + duration + " and" : "");
		if(query.endsWith("WHERE"))
			query = query.substring(0, query.length()-6);
		else
			query = query.substring(0, query.length()-3);
		return query;
	}

}


text:
package org.neo4art.domain;

import java.net.URL;
import java.util.HashMap;
import java.util.Map;

import org.neo4art.graphdb.Node;
import org.neo4j.graphdb.Label;

/**
 * @author Lorenzo Speranzoni
 * @since 4 Apr 2015
 */
public class Settlement implements Node {

  private static final Label[] LABELS = new Label[] { Neo4ArtLabel.Settlement };

  private Long                 nodeId;

  private String               name;
  private String               officialName;
  private String               nativeName;
  private String               otherName;
  private String               state;
  private String               country;

  private String               type;
  private URL                  website;

  private Coordinates          coordinates;

  public Settlement() {
  }

  public Settlement(String name) {
    this.name = name;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getOfficialName() {
    return officialName;
  }

  public void setOfficialName(String officialName) {
    this.officialName = officialName;
  }

  public String getNativeName() {
    return nativeName;
  }

  public void setNativeName(String nativeName) {
    this.nativeName = nativeName;
  }

  public String getOtherName() {
    return otherName;
  }

  public void setOtherName(String otherName) {
    this.otherName = otherName;
  }

  public String getState() {
    return state;
  }

  public void setState(String state) {
    this.state = state;
  }

  public String getCountry() {
    return country;
  }

  public void setCountry(String country) {
    this.country = country;
  }

  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }

  public URL getWebsite() {
    return website;
  }

  public void setWebsite(URL website) {
    this.website = website;
  }

  public Coordinates getCoordinates() {
    return coordinates;
  }

  public void setCoordinates(Coordinates coordinates) {
    this.coordinates = coordinates;
  }

  @Override
  public Long getNodeId() {
    return this.nodeId;
  }

  @Override
  public void setNodeId(long nodeId) {
    this.nodeId = nodeId;
  }

  @Override
  public Map<String, Object> getProperties() {
    Map<String, Object> properties = new HashMap<String, Object>();

    if (this.name != null) {
      properties.put("name", this.name);
    }
    if (this.officialName != null) {
      properties.put("officialName", this.officialName);
    }
    if (this.nativeName != null) {
      properties.put("nativeName", this.nativeName);
    }
    if (this.otherName != null) {
      properties.put("otherName", this.otherName);
    }
    if (this.type != null) {
      properties.put("type", this.type);
    }
    if (this.website != null) {
      properties.put("website", this.website.toString());
    }
    if (this.coordinates != null && this.getCoordinates().getStatus() == Coordinates.COMPUTED) {
      properties.put("lon", this.getCoordinates().getLongitude());
      properties.put("lat", this.getCoordinates().getLatitude());
    }

    return properties;
  }

  @Override
  public Label[] getLabels() {
    return LABELS;
  }
}


text:
package org.apereo.portal.security.provider;

/**
 * The factory class for the simple security context. Just returns a new instance of the
 * SimpleSecurityContext.
 */
import org.apereo.portal.security.ISecurityContext;
import org.apereo.portal.security.ISecurityContextFactory;

public class SimpleSecurityContextFactory implements ISecurityContextFactory {

    public ISecurityContext getSecurityContext() {
        return new SimpleSecurityContext();
    }
}


text:
This API will allow access to the main models of FantasyStocks: `User`s, `Player`s, `Stock`s, `Floor`s, `Trade`s, and `StockSuggestion`s. They will all allow a set of common actions, and some will have special actions that apply to only that model. To prevent excessive redundancy, this documentation will include just one instance of each common action. For both common and special actions, the URL will be built up as follows:
```
/model_name/action/[id]
```

Not passing an `id` just does the action to all the instances of that model.

So if you want to view the `Player` with key 111, you would use this:

```
fantasystocks.herokuapp.com/api/v1/player/view/111
```

Some models have other models as fields. If those fields were sent as full representations, there would be infinite loops. To counteract this, full model representations will only be sent one level deep. For example, if the server sends a `Player` model to a client, the `floor` field will be an actual JSON object representing a `Floor`, with the `Floor`'s name, its `numStocks`, et cetera, but the array of `Player`s in that `Floor` will instead be an array of `id`s of `Player`s, not actual `Player` objects. Otherwise, since each `Player` has a reference to its `Floor`, and each `Floor` in turn has a list of `Player`s, this would cause an infinite recursion.

Authentication will be handled through the `auth` endpoints. This mechanism will be detaled further below, but put simply, the caller receives a temporary session key, which it passes to the endpoints as a GET parameter. This will be meaningless for some calls, optional for others, and for still others mandatory. POST requests, as a rule, demand a session id. GET requests usually will not, but sometimes the server will be able to supply more information if a session id is passed. Passing an unncessary session id will never cause an error, however, even if the session id is expired.

POST request data is sent as JSON (`content-type: application/json`) in the body of the POST request, not as url-encoded of form data.

### Data Schemas

These schemas detail how each model will be serialized into JSON.

*NB: The descriptions given here will be in a YAML-like format for easy reading, but the actual responses coming across the wire will be in JSON.*

#### User

Note that this differs from a `Player` model in that one `User` maps to one actual human being playing the game. The `Player` model is an instance of a `User` on a particular `Floor`.

```
- id (integer)
- username (string)
- players (array of Players)
```

#### Player

Note that the `isFloor` field tells whether the given `Player` is the "floor player." This is the player that is owned by no actual person but rather holds all the `Stock`s that are available on a `Floor` but that no one currently owns.
Also, `sentTrades` and `receivedTrades` only include `Trade`s that are still alive (ie, have neither been declined or accepted)

```
- id (integer)
- user (User)
- floor (Floor)
- stocks (array of Stocks)
- points (integer)
- isFloor (boolean)
- sentTrades (array of Trades)
- receivedTrades (array of Trades)
- isFloorOwner (boolean)
```

#### Stock

```
- id (integer)
- companyName (string)
- symbol (string)
- lastUpdated (ISO 8601 datetime string)
- price (real)
- change (real)
- StockSuggestions (array of StockSuggestions)
```

#### Floor

Note that `numStocks` is the maximum number of stocks that a `Player` on the floor can have

```
- id (integer)
- name (string)
- stocks (array of Stocks)
- permissiveness (enum: either "Permissive", "Open", or "Closed", as a string)
- owner (User)
- floorPlayer (Player)
- public (boolean)
- numStocks (integer)
```

#### Trade

Note that `recipientStocks` and `senderStocks` are the stocks that those players would give away in the trade

```
- id (integer)
- recipientPlayer (Player)
- recipientStocks (array of Stocks)
- senderPlayer (integer)
- senderStocks (array of Stocks)
- floor (Floor)
- date (ISO 8601 datetime string)
```

#### StockSuggestion

This is the model that indicates to the owner of a `Floor` that someone wants a certain stock added to a floor. This can only happen when a certain floor has a permissiveness of "permissive;" if the floor is "open", stocks will be automatically added whenever a player wants them to, and if it is "closed", they can never be added by anyone.

```
- id (integer)
- stock (Stock)
- requestingPlayer (Player)
- floor (Floor)
- date (ISO 8601 datetime string)
```

### Common Actions

#### `GET /view/`

This will do nothing more than show the requested object's JSON representation. It just returns a JSON object of the model, or if there is nothing, it returns an error object of the form:

```
{"error": "That object could not be found"}
```

Note that, while some objects are available to anyone, there are some that are private (`Trade`s and `StockSuggestion`s, namely). To access these, you will need to pass a session key that maps to someone who is associated with the requested model instance (ie, the owner of the floor, the sender, or the recipient).

#### `POST /create/`

This creates an instance of the given model. Note that no `id` needs to be passed to this. You do need to pass the session key of a user that is allowed to create the desired model in the GET query string, and the POST data should be the JSON representation of the model just as if it were returned from the API, with the exception of `id` and some other fields, depending on the model. Any fields that would contain models in `/view/` responses must hold `id`s or arrays of `id`s to appropirate models in `/create/` calls.
Also, `Stock`s can only be created by the system, so a client cannot call `/stock/create`.

 - `User`s
    - `players` must not be passed
    - `email` can be passed optionally, will default to empty
    - A `password` must be passed
    - NB that no `sessionId` is necessary to create a `User`.
  - `Player`s
    - `stocks` can be passed optionally, will default to empty
    - `points` cannot be passed
    - `isFloor` cannot be passed
    - `sentTrades` cannot be passed
    - `receivedTrades` cannot be passed
    - `isFloorOwner` cannot be passed
 - `Floor`s
    - `stocks` can be passed optionally, defaults to empty if and only if the `Floor` does not have permissiveness "closed," in which case there must be at least one `Stock` on the floor.
    - `owner` is the id of the `User` object who who owns the `Floor`
    - `floorPlayer` cannot be passed
 - `Trade`s
    - `recipientStocks` must be passed, but it can be empty
    - `senderStocks` must be passed, but it can be empty
    - One of `senderStocks` or `recipientStocks` must have something in it.
    - `date` cannot be passed
 - `StockSuggestion`s
    - `date` cannot be passed

This returns the created object as if it had been requested at the `/view/` endpoint.

#### `POST /delete/`

Deletes the given object. This also takes a session key, and will return an authentication error if the given key doesn't have the proper permission to delete the given object. If it is successful, returns an object of the form:

```
{"success": "The object was successfully deleted"}
```

### Special actions

#### `POST /trade/accept/[tradeId]`

Accepts the given trade, automatically moving the stocks where they should go. This needs a session id that belongs to the recipient, or else it will return an auth error. If it is successful, returns an object of the form:

```
{"success": "The trade was successfully accepted"}
```

#### `POST /trade/decline/[tradeId]`

Declines the given trade. This needs a session id that belongs to the recipient, or else it will return an auth error. If it is successful, returns an object of the form:

```
{"success": "The trade was successfully declined"}
```

#### `POST /stockSuggestion/accept/[stockSuggestionId]`

Accepts the given `stockSuggestion`. This needs a session id that belongs to the `Floor` owner, or else it will return an auth error. If it is successful, returns an object of the form:

```
{"success": "The stockSuggestion was successfully accepted"}
```

#### `POST /stockSuggestion/reject/[stockSuggestionId]`

Rejects (ie, deletes) the given `stockSuggestion`. This needs a session id that belongs to the `Floor` owner, or else it will return an auth error. If it is successful, returns an object of the form:

```
{"success": "The stockSuggestion was successfully rejected"}
```

### Auth

The auth system will work based on logins and session ids. Session ids will be tied to a `User` object and will expire after a time. Except when the session id is meaningless, passing an expired session token will cause an error of the form:

```
{"authError": "The session id you passed is either expired or never existed"}
```

Receiving this error means that you should get another session key.

#### `POST /auth/getKey/`

No id is passed to this endpoint; rather, a `username` and a `password` should be passed in the POST body. If they match a `User` in the database, the server will send a response of the form:

```
{
    "sessionId": "1234567890",
    "user": {// This is a user object}
}
```

Otherwise, it will return an error of the form:

```
{"error": "That (username|password) doesn't exist"}
```

### Android App Compatibility

For the Android app, there is also an endpoint to register a Firebase Cloud Messaging registration token with a `User`.

#### `POST /android/register/`

This endpoint only demands the session id (in the GET querystring) and the `registrationToken`, in the POST data payload. If successful, it returns a message of the form:

```
{"success": "Your registration id was successfully registered with [username]"}
```

Note that the `registrationsToken`s are unique, but registering a token twice is not an error.

#### `POST /android/deregister/`

This endpoint takes the same data as the `/register/` endpoint, but it removes the relation between the `registrationToken` and the `User`.


text:
package org.finos.waltz.web.json;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.immutables.value.Value;

@Value.Immutable
@JsonSerialize(as = ImmutableBrowserInfo.class)
@JsonDeserialize(as = ImmutableBrowserInfo.class)
public abstract class BrowserInfo {

    public abstract String operatingSystem();
    public abstract String resolution();

}


text:
package org.gogoup.dddutils.objectsegment;

import java.sql.Connection;
import java.sql.SQLException;

import org.gogoup.dddutils.pool.ParameterPool;

public class JDBCResolver extends OSTransactionalResolver {

    private DBConnectionManager dbConnectionManager;

    public JDBCResolver(DBConnectionManager connManager, String[] connNames) {
        super(connNames);
        // initial connection manager
        this.dbConnectionManager = connManager;

    }

    @Override
    protected Object startNonTransaction(String id) {
        DBConnectionWrapper connection = new DBConnectionWrapper(
                (Connection) this.dbConnectionManager.getConnection(id), false);
        return connection;
    }

    @Override
    protected Object startTransaction(String id) {

        DBConnectionWrapper connection = new DBConnectionWrapper(
                (Connection) this.dbConnectionManager.getConnection(id), true);

        try {
            connection.setAutoCommit(false);
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return connection;
    }

    @Override
    protected void commitTransaction(String id, Object transaction) {

        DBConnectionWrapper connection = (DBConnectionWrapper) transaction;

        try {
            if (!connection.isClosed()) {
                connection.commit();
                connection.close();
            }

        } catch (SQLException e) {
            e.printStackTrace();
        } finally {

        }

    }

    @Override
    protected void rollbackTransaction(String id, Object transaction) {

        DBConnectionWrapper connection = (DBConnectionWrapper) transaction;
        try {

            if (!connection.isClosed()) {
                connection.rollback();
                connection.close();
            }

        } catch (SQLException e) {
            e.printStackTrace();
        } finally {

        }

    }

    @Override
    public String[] getDependences(ParameterPool pool, String name) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public boolean verifyDependence(ParameterPool pool, String name, Object parameter) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public String[] findParameterNames(ParameterPool pool, String query) {
        return null;
    }

}


text:
using System;

using Microsoft.Extensions.DependencyInjection;

using Quartz;
using Quartz.Spi;

namespace BitShuva.Chavah.Services
{
    /// <summary>
    /// Quartz.net job factory that creates jobs using the ASP.NET Core dependency injection container.
    /// </summary>
    /// <remarks>
    /// Courtesy of https://stackoverflow.com/a/42199955/536
    /// </remarks>
    public class QuartzJobFactoryWithIoC : IJobFactory
    {
        private readonly IServiceProvider svcProvider;

        public QuartzJobFactoryWithIoC(IServiceProvider svcProvider)
        {
            this.svcProvider = svcProvider;
        }

        public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler)
        {
            var job = (IJob)svcProvider.GetRequiredService(bundle.JobDetail.JobType) as IJob;
            return job;
        }

        public void ReturnJob(IJob job)
        {
            if (job is IDisposable disposable)
            {
                disposable.Dispose();
            }
        }
    }
}


text:
'use strict';

module.exports = require('../index.js').transform;


text:
{-# LANGUAGE GADTs             #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes        #-}
{-# LANGUAGE ScopedTypeVariables #-}

module HypeStat where

import           Data.ByteString
import           Data.Vector     as V
import           HypeStat.Model
import           HypeStat.Repr   as R
import           HypeStat.Valve as HSV

groupToDoc :: (Foldable t, Applicative t) => HSV.Group Document Document -> t Document
groupToDoc = undefined

valvify :: forall t col p. (Foldable t, Applicative t, Monoid (t Document), col ~ t Document) => SPipeline -> Valve p col col
valvify = V.foldl1' (|=>) . V.map _valvify
  where
    _valvify :: SOp -> Valve p col col
    _valvify (MatchOp dct) = HSV.match (mkMatchFunc dct)
    _valvify (ProjectOp dct) = HSV.project (mkProjectFunc dct)
    _valvify (GroupOp key val) = HSV.groupBy (mkGroupFunc key) |=> HSV.Valve groupToDoc |=> HSV.project (mkProjectFunc val)
    _valvify _ = error "Not implemented yet"

mkGroupFunc :: Dict -> Document -> Document
mkGroupFunc _ = undefined

mkProjectFunc :: Dict -> Document -> Document
mkProjectFunc _ = undefined

mkMatchFunc :: Dict -> Document -> Bool
mkMatchFunc _ = undefined

eitherExec :: (Foldable t, Applicative t, Monoid (t Document), col ~ t Document) => ByteString -> col -> Either String col
eitherExec bs = case parseRepr bs of
  Left err -> const (Left err)
  Right pl -> Right . runValve (valvify pl)

maybeExec :: (Foldable t, Applicative t, Monoid (t Document), col ~ t Document) => ByteString -> col -> Maybe col
maybeExec bs = case parseRepr bs of
  Left _ -> const Nothing
  Right pl -> Just . runValve (valvify pl)


text:
void all_levels::from_partitions_to_frames_no_overlap(int_matrix & short_pt, int_matrix & orig_pt_node) {

	// this function sets contains_these, number_of_nodes and radius if number_of_nodes=1
	// all_level_frames[0] is the node level

	deque<frame> new_frames;

	if(all_level_frames.size()==0) {	// node level
		short_pt.clear();
		for(int i=0; i<original_network.size(); i++) {
			DI first;
			first.push_back(i);
			short_pt.push_back(first);
		}
		orig_pt_node=short_pt;
	}
	// ******************************************

	// setting frames ***************************
	RANGE_loop(i, short_pt) {
		frame F;
		F.number_of_nodes=orig_pt_node[i].size();
		if(F.number_of_nodes==1)
			F.radius=paras.node_radius;
		new_frames.push_back(F);
	}

	all_level_frames.push_back(new_frames);

	RANGE_loop(i, short_pt) {
		all_level_frames[all_level_frames.size()-1][i].contains_these=short_pt[i];
		all_level_frames[all_level_frames.size()-1][i].original_nodes=orig_pt_node[i];
	}
	// setting frames ***************************

}

void all_levels::original_nodes_in_these_frames(DI & these_frames, DI & original_n, deque<frame> & last_frames) {

	set<int> a;
	RANGE_loop(i, these_frames) {
		deque_to_set_app(last_frames[these_frames[i]].original_nodes, a);
	}

	set_to_deque(a, original_n);
}

int all_levels::set_frames(deque<int_matrix> & short_parts, deque<int_matrix> & orig_pts_node_no_overlap ) {

	all_level_frames.clear();

	int_matrix void_matrix;
	int_matrix void_matrix2;
	from_partitions_to_frames_no_overlap(void_matrix, void_matrix2);

	for(UI ii=0; ii<short_parts.size(); ii++)
		from_partitions_to_frames_no_overlap(short_parts[ii], orig_pts_node_no_overlap[ii]);

	return 0;

}


text:
package com.teleca.jamendo.util.download;

import com.teleca.jamendo.api.JamendoGet2Api;
import com.teleca.jamendo.api.PlaylistEntry;

/**
 * Various helper functions
 *
 * @author Lukasz Wisniewski
 */
public class DownloadHelper {

	public static String getFileName(PlaylistEntry playlistEntry, String downloadFormat){
		String pattern = "%02d - %s";

		if(downloadFormat.equals(JamendoGet2Api.ENCODING_MP3)){
			pattern += ".mp3";
		} else {
			pattern += ".ogg";
		}
		return String.format(pattern, playlistEntry.getTrack().getNumAlbum(), playlistEntry.getTrack().getName());
	}

	public static String getRelativePath(PlaylistEntry playlistEntry){
		return String.format("/%s/%s",
				playlistEntry.getAlbum().getArtistName(),
				playlistEntry.getAlbum().getName());
	}

	public static String getAbsolutePath(PlaylistEntry playlistEntry, String destination){
		return destination+getRelativePath(playlistEntry);
	}
}


text:
module Azure::DataMigration::Mgmt::V2018_04_19
  module Models
    #
    # Info for certificate to be exported for TDE enabled databases.
    #
    class SelectedCertificateInput

      include MsRestAzure

      # @return [String] Name of certificate to be exported.
      attr_accessor :certificate_name

      # @return [String] Password to use for encrypting the exported
      # certificate.
      attr_accessor :password

      #
      # Mapper for SelectedCertificateInput class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'SelectedCertificateInput',
          type: {
            name: 'Composite',
            class_name: 'SelectedCertificateInput',
            model_properties: {
              certificate_name: {
                client_side_validation: true,
                required: true,
                serialized_name: 'certificateName',
                type: {
                  name: 'String'
                }
              },
              password: {
                client_side_validation: true,
                required: true,
                serialized_name: 'password',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Igneel.Rendering
{
    class RenderRegistry<TComp, TRender> : RenderRegistry<TComp>
        where TComp : class
        where TRender : Render
    {

        protected override Render CreateRender()
        {
            return Service.Require<TRender>();
        }
    }
}


text:
'use strict';

var _ = require('lodash');
var Promise = require('bluebird');
var npm = Promise.promisifyAll(require('npm'));
var path = require('path');

/**
 * Get a list of all global npm modules.
 *
 * @private
 * @function setup.plugins.~modules
 * @return {Promise}
 */
var modules = function() {
  return Promise.resolve()
  .then(function() { return npm.loadAsync(); })
  .then(function(npm) {
    npm.config.set('spin', false);
    npm.config.set('global', true);
    npm.config.set('depth', 0);
    return Promise.promisify(npm.commands.list)([], true);
  })
  .spread(function(data) { return data; });
};

/**
 * Get all installed plugins by looking at npm's list of globally installed
 * modules and finding those that match `avn-{name}`. The resulting promise
 * resolves to an object with the properties: `name`, `moduleName`, and `path`.
 *
 * @private
 * @function setup.plugins.installed
 * @return {Promise}
 */
module.exports.installed = function() {
  return Promise.resolve()
  .then(function() { return modules(); })
  .then(function(data) {
    return _(data.dependencies)
    .keys()
    .filter(function(module) {
      return module.match(/^avn-/);
    })
    .map(function(module) {
      var name = module.slice('avn-'.length);
      var location = path.join(data.path, 'node_modules', module);
      return { name: name, moduleName: module, path: location };
    })
    .value();
  });
};


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/bigquery/datatransfer/v1/transfer.proto

namespace Google\Cloud\BigQuery\DataTransfer\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Represents a user facing message for a particular data transfer run.
 *
 * Generated from protobuf message google.cloud.bigquery.datatransfer.v1.TransferMessage
 */
class TransferMessage extends \Google\Protobuf\Internal\Message
{
    /**
     * Time when message was logged.
     *
     * Generated from protobuf field .google.protobuf.Timestamp message_time = 1;
     */
    private $message_time = null;
    /**
     * Message severity.
     *
     * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity severity = 2;
     */
    private $severity = 0;
    /**
     * Message text.
     *
     * Generated from protobuf field string message_text = 3;
     */
    private $message_text = '';

    public function __construct() {
        \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Transfer::initOnce();
        parent::__construct();
    }

    /**
     * Time when message was logged.
     *
     * Generated from protobuf field .google.protobuf.Timestamp message_time = 1;
     * @return \Google\Protobuf\Timestamp
     */
    public function getMessageTime()
    {
        return $this->message_time;
    }

    /**
     * Time when message was logged.
     *
     * Generated from protobuf field .google.protobuf.Timestamp message_time = 1;
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setMessageTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->message_time = $var;

        return $this;
    }

    /**
     * Message severity.
     *
     * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity severity = 2;
     * @return int
     */
    public function getSeverity()
    {
        return $this->severity;
    }

    /**
     * Message severity.
     *
     * Generated from protobuf field .google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity severity = 2;
     * @param int $var
     * @return $this
     */
    public function setSeverity($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage_MessageSeverity::class);
        $this->severity = $var;

        return $this;
    }

    /**
     * Message text.
     *
     * Generated from protobuf field string message_text = 3;
     * @return string
     */
    public function getMessageText()
    {
        return $this->message_text;
    }

    /**
     * Message text.
     *
     * Generated from protobuf field string message_text = 3;
     * @param string $var
     * @return $this
     */
    public function setMessageText($var)
    {
        GPBUtil::checkString($var, True);
        $this->message_text = $var;

        return $this;
    }

}


text:
layout: post
title: 5 Ways to be Honest
date: 2012-06-13 19:48
Tags: [ uncategorized, blog ]
permalink: /honest-laundry/
author: Kevin Olega
---
The original title of this post is:

Proudly Washing my Laundry in Public.

I never figured out why washing your laundry in public is such a bad term.

My first reaction is we are all human and we all wear clothes.

And clothes always need washing.

When you wash an item you clean something with the intention of making it useful.

Maybe you don't do your laundry because you don't know how to wash your laundry.

People do gardening or clean their car or porch.

That's a public act.

I mean my clothes are more important than my house or my car.

I mean, imagine if you're faced with the choice of losing your house or losing your clothes.

Both losses are unpleasant.

Kidding aside, I receive the warning "don't wash your laundry in public" whenever I'm being honest.

For the longest time, my life had been filled with lies and I had to pretend to get the results I want.

I lived a life of pleasantries and often found myself in situations that I don't want to be in.

I am always trying to make an effort to unlearn my natural tendency to try to pretend that I'm a good person because I feel that the consequences of dishonesty is far worse than shame.

How to be honest:

**1. Start bit by bit**

If you've been dishonest for a while, you're going to have a difficult time, but fret not.

Just start being honest about one thing.

Let go of pride, ego or reputation.

Wait that's pretty hard.

Forget that for a while.

Just start being honest about one tiny thing then do a bit more as you become more comfortable about telling the truth.

**2. Phrase your honestly in a nice way whenever possible**.

Try to be honest but kind.

See if you can add some humor to soften the blow of your blunt honesty.

Blunt truth hurts like the blunt stair steps hitting your shin when you slip while climbing up a staircase.

I've had people tell me blunt truth but the experience was so bad that despite how good their intentions were it only made matters worse.

I'm also guilty of this.

Learn to walk people through some fine points without stepping on their toes is a good advice I got from a job interview.

**3. Just say it, admit it, and be excited instead of afraid at their reactions**.

In a lot of cases, when I'm honest people cut me some slack for my weakness.

The only time this didn't work was when I was dealing with a crazy boss who felt that I was there to rob him.

**4. Experiment by starting admitting the thing you find hardest to admit**

My life's a mess and I'm just going by counting my blessings.

I want to give up because it feels like shit.

This has gone on for months but I'm really tired of it.

I brainwashed myself to never give up so my hope doesn't die.

But you know what, if people drag you down like that, you should just let go.

Whatever it is, you're holding on to is preparation for the next one so whether things go well or not it's just practice.

If everything is practice then, you should cut yourself some slack.

The future is not set in stone.

If it is, we'll never know now how things will end.

You'll start going out with someone you're excited to see again so keep that great looking smile ready.

**5. Don't expect people to believe you**.

That's the beauty about telling the truth.

People won't believe you sometimes and that's a good thing.

You admit that you didn't finish college and they won't believe you.

You'll tell them that you don't have enough experience and they'll say you're being humble.
And so on..

You probably know this already and I'm tired of typing and all I wanted to do was to encourage you to tell the truth all the time so that's it so if you'll excuse me, I have to get some sleep.

I still owe a few people my first book which I'll have to edit tomorrow.

## From Kevin of April 2020

I found this post in my Evernote. I lightly edited it and published it here.

I feel that I wrote this because I've been trying to unlearn some of the sleazy tactics that I learned in sales.

I'm in the process of cleaning my notes so I'm moving as much of my important stuff outside of cloud services.

Practice telling the truth.

Here's some wisdom I learned later.

The consequence of telling the truth is the best case scenario, no matter how favorable or unfavorable you think it will be.

If you saved something with a lie, you are likely stuck with something that was supposed to die and it will kill you in the end.

See you on the next post.


text:
from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^requestcab/$', views.requestcab, name='requestcab'),
]


text:
<!DOCTYPE html>

<meta charset="utf-8"/>
	<?php echo Asset::css('bootstrap.css'); ?>
	<?php echo Asset::css('jquery-ui.css'); ?>
	<?php echo Asset::js('jquery.js'); ?>
	<?php echo Asset::js('jquery-ui.js'); ?>
	<?php echo Asset::css('bootstrap.css') ?>

Department of Water Supply & Sanitation Punjab

Basic Report - District wise Status of Circle :

Back

			#
			District
			Divisions
			Blocks
			Schemes
			Panchayats
			Villages
			Habitations

			<?php
			$num = 1;
				foreach ($q as $row)

				{

			?>

						<?php echo $num; ?>
						<a href="/village/block/<?php echo $row->district_id; ?>" ><?php echo $row->district_name ; ?>

						<?php echo $row->dis_division_count; ?>
						<?php echo $row->dis_block_count; ?>
						<?php echo $row->dis_scheme_count; ?>
						<?php echo $row->dis_panchayat_count; ?>
						<?php echo $row->dis_village_count; ?>
						<?php echo $row->dis_habitation_count; ?>

				<?php
				$num++;
				}
				   ?>


text:
package org.apache.hadoop.crypto;

import java.io.IOException;
import java.nio.ByteBuffer;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;

@InterfaceAudience.Private
@InterfaceStability.Evolving
public interface Decryptor {

  /**
   * Initialize the decryptor and the internal decryption context.
   * reset.
   * @param key decryption key.
   * @param iv decryption initialization vector
   * @throws IOException if initialization fails
   */
  public void init(byte[] key, byte[] iv) throws IOException;

  /**
   * Indicate whether the decryption context is reset.
   *

   * Certain modes, like CTR, require a different IV depending on the
   * position in the stream. Generally, the decryptor maintains any necessary
   * context for calculating the IV and counter so that no reinit is necessary
   * during the decryption. Reinit before each operation is inefficient.
   * @return boolean whether context is reset.
   */
  public boolean isContextReset();

  /**
   * This presents a direct interface decrypting with direct ByteBuffers.
   *

   * This function does not always decrypt the entire buffer and may potentially
   * need to be called multiple times to process an entire buffer. The object
   * may hold the decryption context internally.
   *

   * Some implementations may require sufficient space in the destination
   * buffer to decrypt the entire input buffer.
   *

   * Upon return, inBuffer.position() will be advanced by the number of bytes
   * read and outBuffer.position() by bytes written. Implementations should
   * not modify inBuffer.limit() and outBuffer.limit().
   *

   * @param inBuffer a direct {@link ByteBuffer} to read from. inBuffer may
   * not be null and inBuffer.remaining() must be {@literal >} 0
   * @param outBuffer a direct {@link ByteBuffer} to write to. outBuffer may
   * not be null and outBuffer.remaining() must be {@literal >} 0
   * @throws IOException if decryption fails
   */
  public void decrypt(ByteBuffer inBuffer, ByteBuffer outBuffer)
      throws IOException;
}