text:
package pdms.platform.service.impl;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import pdms.components.dao.MissionDao;
import pdms.components.dao.ProjectDao;
import pdms.components.dao.UserDao;
import pdms.components.pojo.Mission;
import pdms.components.pojo.Project;
import pdms.components.vo.A1300PieVo;
import pdms.components.vo.A1301ColumnVo;
import pdms.components.vo.A1302GAndSVo;
import pdms.platform.configeration.StartUpConfig;
import pdms.platform.core.PdmsException;
import pdms.platform.service.A1300ChartService;
import pdms.platform.util.ChartUtil;
import pdms.platform.util.StringUtil;

/**
 *
 * @author LUSuo(atealxt@gmail.com)
 */
public class A1300ChartServiceImpl implements A1300ChartService {

    private MissionDao missionDao;
    private ProjectDao projectDao;
    private UserDao userDao;
    private static Log logger = LogFactory.getLog(A1300ChartServiceImpl.class);

    @Override
    public String getPieDataFilePath() throws PdmsException {

        //判断是否已有
        StringBuffer dir = null;
        if (StartUpConfig.REALPATH != null) {
            dir = new StringBuffer(StartUpConfig.REALPATH.replace("\\", "/")).append("amcharts/ampie/data/");
        } else {
            dir = new StringBuffer("C:/pdms/amcharts/ampie/data/");
        }

        Date date = new Date();
        dir.append(StringUtil.getDateFormat(date, "yyyyMM"));

        File fDir = new File(dir.toString());
        if (!fDir.exists()) {
            logger.info("新建目录" + fDir.getPath());
            boolean b = fDir.mkdirs();
            if (!b) {
                logger.info("新建目录失败");
                return fDir.getPath();
            }
        }

        dir.append("/ampie_data_");
        dir.append(StringUtil.getDateFormat(date, "ddHH"));
        dir.append(".xml");
        //文件按月份存放文件夹,按日期小时格式存放文件
        String filePath = dir.toString();
        File file = new File(filePath);
        if (file.exists()) {
            logger.info("已有此文件" + file.getPath());
            return filePath;
        } else {
            try {
                boolean b = file.createNewFile();
                if (!b) {
                    logger.info("新建文件失败");
                    return filePath;
                }
            } catch (IOException ex) {
                logger.info("新建文件错误: " + ex);
                return filePath;
            }
        }

        //没有则生成DataFile
        //项目任务量 = 所有已完成任务的花费天数 / 组员人数
        List<A1300PieVo> vos = new ArrayList<A1300PieVo>();
        List<Project> prjs = projectDao.findAll(-1, 1);//排除站务服务区
        for (Project p : prjs) {
            int costDays = 0;
            int developersCnt = userDao.findByProjectId(p.getId()).size();
            int sumMiss = missionDao.Count4Chart(p.getId());
            for (int i = 0; i < sumMiss; i += 20) {
                List<Mission> missions = missionDao.find4ChartByProjectId(p.getId(), 20, i);
                for (Mission m : missions) {
                    long l = m.getSubmitInfo().getSubmitDate().getTime() - m.getCreatetime().getTime();
                    costDays += l / (24 * 60 * 60 * 1000);
                }
            }
            A1300PieVo vo = new A1300PieVo();
            vo.setTitle(p.getName());
            vo.setDescription(p.getSummary());
            vo.setValue(StringUtil.getDecimal(costDays / developersCnt, null));
            vos.add(vo);
        }
        if (vos.size() > 0) {
            vos.get(vos.size() - 1).setPull_out(true);
        }

        String fileContent = ChartUtil.getPieXmlData(vos);
        try {
            BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
            bw.write(fileContent);
            bw.close();
        } catch (Exception ex) {
            logger.info("新建文件错误: " + ex);
            return filePath;
        }

        return filePath;
    }

    @Override
    public String getColumnDataFilePath() throws PdmsException {

        //判断是否已有
        StringBuffer dir = null;
        if (StartUpConfig.REALPATH != null) {
            dir = new StringBuffer(StartUpConfig.REALPATH.replace("\\", "/")).append("amcharts/amcolumn/data/");
        } else {
            dir = new StringBuffer("C:/pdms/amcharts/amcolumn/data/");
        }

        File fDir = new File(dir.toString());
        if (!fDir.exists()) {
            logger.info("新建目录" + fDir.getPath());
            boolean b = fDir.mkdirs();
            if (!b) {
                logger.info("新建目录失败");
                return fDir.getPath();
            }
        }

        Date date = new Date();
        dir.append("amcolumn_data_");
        dir.append(StringUtil.getDateFormat(date, "yyyyMM"));
        dir.append(".xml");
        //文件按年月格式存放文件
        String filePath = dir.toString();
        File file = new File(filePath);
        if (file.exists()) {
            logger.info("已有此文件" + file.getPath());
            return filePath;
        } else {
            try {
                boolean b = file.createNewFile();
                if (!b) {
                    logger.info("新建文件失败");
                    return filePath;
                }
            } catch (IOException ex) {
                logger.info("新建文件错误: " + ex);
                return filePath;
            }
        }

        //没有则生成DataFile
        A1301ColumnVo vo = new A1301ColumnVo();
        List<A1302GAndSVo> series = new ArrayList<A1302GAndSVo>();
        List<A1302GAndSVo> graphComplete = new ArrayList<A1302GAndSVo>();
        List<A1302GAndSVo> graphAll = new ArrayList<A1302GAndSVo>();
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.DAY_OF_MONTH, 1);
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.add(Calendar.MONTH, -12);
        for (int i = 0; i < 12; i++) {
            Date start = cal.getTime();
            cal.add(Calendar.MONTH, 1);
            Date end = cal.getTime();

            int missionAll = missionDao.CountAllByTime4Chart(start, end);
            System.out.println(missionAll);
            int missionComplete = missionDao.CountByTime4Chart(start, end);
            System.out.println(missionComplete);

            A1302GAndSVo voTemp = new A1302GAndSVo();
            voTemp.setValue(StringUtil.getDateFormat(start, "yy年M月"));
            voTemp.setXid(Integer.toString(i));
            series.add(voTemp);

            voTemp = new A1302GAndSVo();
            voTemp.setXid(Integer.toString(i));
            voTemp.setValue(Integer.toString(missionAll));
            graphAll.add(voTemp);

            voTemp = new A1302GAndSVo();
            voTemp.setXid(Integer.toString(i));
            voTemp.setValue(Integer.toString(missionComplete));
            graphComplete.add(voTemp);
        }
        vo.setSVo(series);
        List<List<A1302GAndSVo>> gVos = new ArrayList<List<A1302GAndSVo>>();
        gVos.add(graphAll);
        gVos.add(graphComplete);
        vo.setGVos(gVos);

        String fileContent = ChartUtil.getColumnXmlData(vo);
        try {
            BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
            bw.write(fileContent);
            bw.close();
        } catch (Exception ex) {
            logger.info("新建文件错误: " + ex);
            return filePath;
        }

        return filePath;
    }

    public MissionDao getMissionDao() {
        return missionDao;
    }

    public void setMissionDao(MissionDao missionDao) {
        this.missionDao = missionDao;
    }

    public ProjectDao getProjectDao() {
        return projectDao;
    }

    public void setProjectDao(ProjectDao projectDao) {
        this.projectDao = projectDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
}


text:
.class Lcom/android/server/am/ProcessStatsService$1;
.super Ljava/lang/Object;
.source "ProcessStatsService.java"

# interfaces
.implements Ljava/lang/Runnable;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/android/server/am/ProcessStatsService;-><init>(Lcom/android/server/am/ActivityManagerService;Ljava/io/File;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/server/am/ProcessStatsService;

# direct methods
.method constructor <init>(Lcom/android/server/am/ProcessStatsService;)V
    .locals 0

    .prologue
    .line 87
    iput-object p1, p0, Lcom/android/server/am/ProcessStatsService$1;->this$0:Lcom/android/server/am/ProcessStatsService;

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

    return-void
.end method

# virtual methods
.method public run()V
    .locals 4

    .prologue
    .line 89
    iget-object v0, p0, Lcom/android/server/am/ProcessStatsService$1;->this$0:Lcom/android/server/am/ProcessStatsService;

    iget-object v1, v0, Lcom/android/server/am/ProcessStatsService;->mAm:Lcom/android/server/am/ActivityManagerService;

    monitor-enter v1

    .line 90
    :try_start_0
    iget-object v0, p0, Lcom/android/server/am/ProcessStatsService$1;->this$0:Lcom/android/server/am/ProcessStatsService;

    iget-object v0, v0, Lcom/android/server/am/ProcessStatsService;->mProcessStats:Lcom/android/internal/app/ProcessStats;

    const/4 v2, 0x0

    invoke-virtual {v0, v2}, Lcom/android/internal/app/ProcessStats;->evaluateSystemProperties(Z)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 91
    iget-object v0, p0, Lcom/android/server/am/ProcessStatsService$1;->this$0:Lcom/android/server/am/ProcessStatsService;

    iget-object v0, v0, Lcom/android/server/am/ProcessStatsService;->mProcessStats:Lcom/android/internal/app/ProcessStats;

    iget v2, v0, Lcom/android/internal/app/ProcessStats;->mFlags:I

    or-int/lit8 v2, v2, 0x4

    iput v2, v0, Lcom/android/internal/app/ProcessStats;->mFlags:I

    .line 92
    iget-object v0, p0, Lcom/android/server/am/ProcessStatsService$1;->this$0:Lcom/android/server/am/ProcessStatsService;

    const/4 v2, 0x1

    const/4 v3, 0x1

    invoke-virtual {v0, v2, v3}, Lcom/android/server/am/ProcessStatsService;->writeStateLocked(ZZ)V

    .line 93
    iget-object v0, p0, Lcom/android/server/am/ProcessStatsService$1;->this$0:Lcom/android/server/am/ProcessStatsService;

    iget-object v0, v0, Lcom/android/server/am/ProcessStatsService;->mProcessStats:Lcom/android/internal/app/ProcessStats;

    const/4 v2, 0x1

    invoke-virtual {v0, v2}, Lcom/android/internal/app/ProcessStats;->evaluateSystemProperties(Z)Z

    .line 95
    :cond_0
    monitor-exit v1

    .line 96
    return-void

    .line 95
    :catchall_0
    move-exception v0

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

redpajama_set_name: RedPajamaGithub


text:
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import { Promise } from '../../Promises';
import * as Util from '../../Util/Util';
import { AudioContextFactory } from './AudioContext';
/**
 * Internal class for producing of AudioInstances
 */
/* istanbul ignore next */
var AudioInstanceFactory = /** @class */ (function () {
    function AudioInstanceFactory() {
    }
    AudioInstanceFactory.create = function (src) {
        if (src instanceof AudioBuffer) {
            return new WebAudioInstance(src);
        }
        return new AudioInstance(src);
    };
    return AudioInstanceFactory;
}());
export { AudioInstanceFactory };
/**
 * Internal class representing base AudioInstance implementation
 */
/* istanbul ignore next */
var AudioInstance = /** @class */ (function () {
    function AudioInstance(_src) {
        this._src = _src;
        this._volume = 1;
        this._duration = undefined;
        this._loop = false;
        this._isPlaying = false;
        this._isPaused = false;
    }
    Object.defineProperty(AudioInstance.prototype, "loop", {
        get: function () {
            return this._loop;
        },
        set: function (value) {
            this._loop = value;
            if (this._instance) {
                this._instance.loop = value;
                this._wireUpOnEnded();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AudioInstance.prototype, "volume", {
        get: function () {
            return this._volume;
        },
        set: function (value) {
            this._volume = Util.clamp(value, 0, 1.0);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AudioInstance.prototype, "duration", {
        /**
         * Duration of the sound, in seconds.
         */
        get: function () {
            return this._duration;
        },
        set: function (value) {
            this._duration = value;
        },
        enumerable: false,
        configurable: true
    });
    AudioInstance.prototype.isPlaying = function () {
        return this._isPlaying;
    };
    AudioInstance.prototype.pause = function () {
        if (!this._isPlaying) {
            return;
        }
        this._isPaused = true;
        this._isPlaying = false;
    };
    AudioInstance.prototype.stop = function () {
        if (!this._isPlaying) {
            return;
        }
        this._isPlaying = false;
        this._isPaused = false;
    };
    AudioInstance.prototype.play = function () {
        if (this._isPaused) {
            this._resumePlayBack();
        }
        if (!this._isPlaying) {
            this._startPlayBack();
        }
        return this._playingPromise;
    };
    AudioInstance.prototype._startPlayBack = function () {
        this._isPlaying = true;
        this._isPaused = false;
        this._playingPromise = new Promise();
    };
    AudioInstance.prototype._resumePlayBack = function () {
        if (!this._isPaused) {
            return;
        }
        this._isPaused = false;
        this._isPlaying = true;
    };
    AudioInstance.prototype._wireUpOnEnded = function () {
        var _this = this;
        if (!this.loop) {
            this._instance.onended = function () { return _this._handleOnEnded(); };
        }
    };
    AudioInstance.prototype._handleOnEnded = function () {
        /**
         * Override me
         */
    };
    return AudioInstance;
}());
export { AudioInstance };
/**
 * Internal class representing a Web Audio AudioBufferSourceNode instance
 * @see https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API
 */
/* istanbul ignore next */
var WebAudioInstance = /** @class */ (function (_super) {
    __extends(WebAudioInstance, _super);
    function WebAudioInstance(_src) {
        var _this = _super.call(this, _src) || this;
        _this._audioContext = AudioContextFactory.create();
        _this._volumeNode = _this._audioContext.createGain();
        /**
         * Current playback offset (in seconds)
         */
        _this._currentOffset = 0;
        _this._createNewBufferSource();
        return _this;
    }
    Object.defineProperty(WebAudioInstance.prototype, "volume", {
        get: function () {
            return this._volume;
        },
        set: function (value) {
            value = Util.clamp(value, 0, 1.0);
            this._volume = value;
            if (this._isPlaying && this._volumeNode.gain.setTargetAtTime) {
                // https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/setTargetAtTime
                // After each .1 seconds timestep, the target value will ~63.2% closer to the target value.
                // This exponential ramp provides a more pleasant transition in gain
                this._volumeNode.gain.setTargetAtTime(value, this._audioContext.currentTime, 0.1);
            }
            else {
                this._volumeNode.gain.value = value;
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(WebAudioInstance.prototype, "_playbackRate", {
        get: function () {
            return this._instance ? 1 / (this._instance.playbackRate.value || 1.0) : null;
        },
        enumerable: false,
        configurable: true
    });
    WebAudioInstance.prototype.pause = function () {
        _super.prototype.pause.call(this);
        this._instance.stop(0);
        // Playback rate will be a scale factor of how fast/slow the audio is being played
        // default is 1.0
        // we need to invert it to get the time scale
        this._setPauseOffset();
    };
    WebAudioInstance.prototype.stop = function () {
        _super.prototype.stop.call(this);
        this._currentOffset = 0;
        this._instance.stop(0);
        // handler will not be wired up if we were looping
        if (!this._instance.onended) {
            this._handleOnEnded();
        }
    };
    WebAudioInstance.prototype._startPlayBack = function () {
        _super.prototype._startPlayBack.call(this);
        if (!this._instance) {
            this._createNewBufferSource();
        }
        this._rememberStartTime();
        this._volumeNode.connect(this._audioContext.destination);
        this._instance.start(0, 0);
        this._currentOffset = 0;
        this._playingPromise = new Promise();
        this._wireUpOnEnded();
    };
    WebAudioInstance.prototype._resumePlayBack = function () {
        _super.prototype._resumePlayBack.call(this);
        // a buffer source can only be started once
        // so we need to dispose of the previous instance before
        // "resuming" the next one
        this._instance.onended = null; // dispose of any previous event handler
        this._createNewBufferSource();
        var duration = this._playbackRate * this._src.duration;
        var restartTime = this._currentOffset % duration;
        this._rememberStartTime(restartTime * -1000);
        this._instance.start(0, restartTime);
        this._wireUpOnEnded();
    };
    WebAudioInstance.prototype._handleOnEnded = function () {
        // pausing calls stop(0) which triggers onended event
        // so we don't "resolve" yet (when we resume we'll try again)
        if (!this._isPaused) {
            this._isPlaying = false;
            this._playingPromise.resolve(true);
        }
    };
    WebAudioInstance.prototype._rememberStartTime = function (amend) {
        this._startTime = new Date().getTime() + (amend | 0);
    };
    WebAudioInstance.prototype._setPauseOffset = function () {
        this._currentOffset = ((new Date().getTime() - this._startTime) * this._playbackRate) / 1000; // in seconds
    };
    WebAudioInstance.prototype._createNewBufferSource = function () {
        this._instance = this._audioContext.createBufferSource();
        this._instance.buffer = this._src;
        this._instance.loop = this.loop;
        this._instance.playbackRate.setValueAtTime(1.0, 0);
        this._instance.connect(this._volumeNode);
    };
    return WebAudioInstance;
}(AudioInstance));
export { WebAudioInstance };
//# sourceMappingURL=AudioInstance.js.map


text:
# no-eq-null

Disallows `null` comparisons without type-checking operators,

Comparing to `null` without a type-checking operator (`==` or `!=`), can have unintended results as the comparison will evaluate to true when comparing to not just a `null`, but also an `undefined` value.

```js
if (foo == null) {
  bar();
}
```

## Rule Details

The `no-eq-null` rule aims reduce potential bug and unwanted behavior by ensuring that comparisons to `null` only match `null`, and not also `undefined`. As such it will flag comparisons to null when using `==` and `!=`.

Examples of **incorrect** code for this rule:

```js
/*eslint no-eq-null: "error"*/

if (foo == null) {
  bar();
}

while (qux != null) {
  baz();
}
```

Examples of **correct** code for this rule:

```js
/*eslint no-eq-null: "error"*/

if (foo === null) {
  bar();
}

while (qux !== null) {
  baz();
}
```

## When Not To Use It

If you want to enforce type-checking operations in general, use the more powerful [eqeqeq](./eqeqeq) instead.

## Compatibility

* **JSHint**: This rule corresponds to `eqnull` rule of JSHint.


text:
<!DOCTYPE html>

<meta charset="utf-8">
<meta name="description" content="The layx layout language demo."/>
<meta name="keywords" content="testing, demo, try, layout, graphic, design, language, web, simple, easy, best, programming"/>
<meta property="og:site_name" content="Layx"/>
<meta property="og:title" content="Layx | Demo"/>
<meta property="og:type" content="website"/>
<meta property="og:image" content="http://www.layx.org/resources/layx-icon-medium3.png"/>
<meta property="og:url" content="http://www.layx.org/demo/"/>
<meta property="og:description" content="The easiest layout language, ever."/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:domain" content="www.layx.org"/>
<meta name="twitter:title" content="Layx | Demo"/>
<meta name="twitter:description" content="The layx layout language demo."/>
<meta name="twitter:image" content="http://www.layx.org/resources/layx-icon-medium3.png"/>
<link rel="shortcut icon" href="http://www.layx.org/resources/layx-favicon.png"/>
<title>Demo | Layx</title>

<meta charset="utf-8">

			www.layx.org

			Layx
Layout Language

<select id="examples" style="height: 40px; border: 1px solid #AAA; margin-bottom: 10px; padding: 0px 10px; font-size: 10pt; background-color: #FAFAFA;"></select>
<textarea id="code" style="height: 60%; width: 100%; padding: 15px; border: 1px solid #AAA; overflow: scroll; font-family: monospace,courier new; font-size: 10pt;" wrap="off"></textarea>

<input id="renderButton" type="button" value="Render (Ctrl + Enter)" style="margin-top: 10px; height: 15%; font-family: sans-serif; font-size: 20px; background-color: #999; color: rgba(255, 255, 255, 0.9);" onclick="render();"/>


text:
<?php
/**
 * @author @jenschude <jens.schulze@commercetools.de>
 */

namespace Commercetools\Core\Request\Carts\Command;

use Commercetools\Core\Model\Common\Context;
use Commercetools\Core\Request\AbstractAction;
use Commercetools\Core\Model\Cart\ExternalLineItemTotalPrice;

/**
 * @package Commercetools\Core\Request\Carts\Command
 * @link https://docs.commercetools.com/http-api-projects-carts.html#set-lineitem-totalprice
 * @method string getAction()
 * @method CartSetLineItemTotalPriceAction setAction(string $action = null)
 * @method ExternalLineItemTotalPrice getExternalTotalPrice()
 * @method CartSetLineItemTotalPriceAction setExternalTotalPrice(ExternalLineItemTotalPrice $externalTotalPrice = null)
 * @method string getLineItemId()
 * @method CartSetLineItemTotalPriceAction setLineItemId(string $lineItemId = null)
 */
class CartSetLineItemTotalPriceAction extends AbstractAction
{
    public function fieldDefinitions()
    {
        return [
            'action' => [static::TYPE => 'string'],
            'lineItemId' => [static::TYPE => 'string'],
            'externalTotalPrice' => [static::TYPE => ExternalLineItemTotalPrice::class],
        ];
    }

    /**
     * @param array $data
     * @param Context|callable $context
     */
    public function __construct(array $data = [], $context = null)
    {
        parent::__construct($data, $context);
        $this->setAction('setLineItemTotalPrice');
    }

    /**
     * @param $lineItemId
     * @param Context|callable $context
     * @return CartSetLineItemTotalPriceAction
     */
    public static function ofLineItemId($lineItemId, $context = null)
    {
        return static::of($context)->setLineItemId($lineItemId);
    }
}


text:
local evdev = require "evdev"

local path = ...

local dev = evdev.Device(path)

local x,y = 0,0
local btn0,btn1,btn2 = 0,0,0

local function stat()
	print(x,y, "buttons:", btn0,btn1,btn2 )
end

while true do
	local timestamp, type, code, value = dev:read()
	if type == evdev.EV_ABS then
		if code == evdev.ABS_X then
			x = value
		elseif code == evdev.ABS_Y then
			y = value
		end
		stat()
	elseif type == evdev.EV_KEY then
		if code == evdev.BTN_TOUCH then
			btn0 = value
		elseif code == evdev.BTN_STYLUS then
			btn1 = value
		elseif code == evdev.BTN_STYLUS2 then
			btn2 = value
		end
		stat()
	end
end


text:
export class Account {
    id: string;
    state: number;
    name: string;
    email: string;
    lastSync: string;
    createTime: string;
    lastLogin: string;
    phoneNumber: string;
    desc: string;
}


text:
Extremely lossy image compression with neural networks

Uses the limited, slow, and inefficient (but super simple and easy-to-use!) feed-forward neural network [Zoltar](https://github.com/matthewsot/zoltar).

*More important note:* There are much better ways of doing this, including with RNNs [as Google is doing](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/45534.pdf). This is a simple example using only  a FFN.

*Note:* While this technique does seem to work rather well for specific photos and with specific configurations, it's mostly meant as a proof of concept. The image compression algorithms that power most JPEG compression will probably give you a better result for most applications and images. Feel free to check this out though! Maybe you can make it even better :)

# Show me the numbers
Original PNG image, **106,638 bytes** uncompressed and 106,795 bytes when compressed with the default Windows "send-to" compression:

![Original PNG image](Images/bliss.png "Original PNG image")

**106,638 bytes**

Original image saved as a JPEG in Paint.net, 53,185 bytes as ``.jpg``, **53,067 bytes** after compressed to ``.zip``:

![Original JPEG image](Images/bliss.jpg "Original JPEG image")

**53,067 bytes**

Using ``nimg.config`` file:
```
inputPixels 3
innerLayers 2
neuronsPerLayer 3
colorIndexBytes 2
writeTolerance 8
colorIndexTolerance 5
trainingRounds 50000
maxTrainingSets 20
trainingSetRandomization 0
```

Compressed into an NIMG file of **48,874 bytes**. The ``.nimg`` file (after being converted losslessly to a PNG):

![Reconstructed NIMG image](Images/reconstructed.png "Reconstructed NIMG image")

**48,874 bytes**

Note that because NIMG is so lossy (see the "Drawbacks" section), the recreated file is **not** the same as the original PNG. NIMG has an option to recreate the NIMG file into a PNG, which is exactly the same image as the compressed NIMG file.

The reconstructed ``.nimg`` file (exactly the same image as the ``.nimg``), when saved as a PNG, has a file size of **62,683 bytes**.
Saving that PNG file as a JPEG in Paint.net creates a ``.jpg`` with file size 58,137 bytes, **58,023 bytes** after zip-compressing in Windows.

All in all:
- **54.2% reduction** from the original PNG
- **7.9% reduction** from the original JPG
- **22% reduction** from the reconstructed image saved as a PNG
- **15.8% reduction** from the reconstructed image saved as a compressed JPEG.

# Why is it so good?

There are a few things contributing to the size reduction:

- There's no metadata, so NIMG gets to cheat a little bit. The ``.nimg`` format is currently very sparse, so 100% of the file size is going towards encoding the image.
- The actual ``.nimg`` file is very lossy when compared to the original (see the "Drawbacks" section), though it's worth noting that even compared to the exact same JPG and PNG files (aka no loss), the NIMG file is consistently smaller.
- It comes bundled with a neural network that took ~2 minutes to train on an i7-4790k. That's partly because the neural network code I used is inefficient, but it's also a built-in issue with the format.

# Why is it so bad?

5-20% size reduction compared to a standard JPEG/PNG file is, admittedly, not that impressive. A few reasons it's not better:

- The neural network used is a super simple feed-forward network. All it does is look at the previous n pixels to the left of the current pixel and attempt to predict the next one. An improved NIMG would implement a more complex neural network and train it longer/more efficiently.
- Neural networks aren't magic, and to get one that fits the image extremely well would probably take more space to store the weights than it would actually save in the file (not unlike a standard compression format's dictionary size).

# Drawbacks & Limitations

First and foremost, NIMG requires that you train a neural network on the image file before compression. This can take anywhere between 20 seconds and a day, depending on the level of compression desired and the resolution of the file.

On top of that, the NIMG file format takes quite a few shortcuts to arrive at a small file size. A few of those:
- By default NIMG uses a color dictionary, which treats all colors within a certain tolerance interval as a single color. Generally this won't get in the way (the demo Bliss image above has a tolerance of just 5 R/G/B units), but for complex images you might need to disable the color dictionary by setting ``colorIndexBytes`` to 0
- The color dictionary's bytes are limited to either 239 or 61440 colors, and a higher limit leads to an almost 2x file size. Again, if you need complex colors you should disable the color dictionary, though that significantly impacts file size.
- NIMG is inherently lossy. Setting both tolerances in ``nimg.config`` to 1 will make the file practically lossless, but it is highly unlikely that the network will output exactly the right 3 values for any of the pixels, basically making NIMG useless.
- And more, check out ``Compressor.cs`` for a better idea of the shortcuts taken

# What's the use case for this?

Because of the mentioned drawbacks, NIMG is *probably not* a great solution for compressing individual files. With that said, a few situations where applying NIMG might make a meaningful difference:

- Video compression. You could theoretically have a small set of network models and color dictionaries for thousands of frames, which would multiply the benefits of NIMG.
- Websites with similar images, like a Flickr search results page for "sky." Similar images should work fairly well with a single network model and color dictionary, so you could compress large numbers of images with one shared network.

Essentially wherever multiple similar images are sent NIMG could be useful.

# Getting Started with NIMG

Before using NIMG it's recommended to create a ``nimg.config`` file in the same directory that ``nimg.exe`` is run from. It should look like:

```
inputPixels [How many pixels back to use when predicting the next pixel]
innerLayers [How many inner layers in the neural network]
neuronsPerLayer [How many neurons per inner layer]
colorIndexBytes [ 0 => Disable the color dictionary, 1 => maximum 239 distinct colors, 2 => maximum 61440 colors. Higher = larger file size ]
writeTolerance [ The maximum difference between the predicted color and the actual color. Lower = large file size, less lossy ]
colorIndexTolerance [ The maximum difference between the pixel color and the color stored in the dictionary. Lower = larger file size, less lossy ]
trainingRounds [ The number of rounds to train the network for. Lower = higher file size, quicker ]
maxTrainingSets [ The number of training sets to create. 0 = Unlimited. Lower = quicker, potentially better-fitted network ]
trainingSetRandomization [ If maxTrainingSets > 0: 0 -> pull sets sequentially from the top left of the image, 1 -> pull sets randomly from the image ]
```

See above for an example ``nimg.config``. Any lines may be removed and will be filled in with default values.

To compress ``image.png`` into ``image.nimg``:
```
nimg compress image.png
```

To convert ``image.nimg`` back into a PNG (which will be named ``image.reconstructed.png``):
```
nimg reconstruct image.nimg
```

To convert ``image.nimg`` back into a PNG with the 'missing' pixels highlighted in red (as ``image.reconstructed.png``):
```
nimg reconstruct image.nimg demo
```


text:
'use strict';

/* Location Controllers */
angular.module("myApp.controllers.location", [])
.config(["$routeProvider", function($routeProvider){
	$routeProvider.when('/location', {templateUrl: 'partials/location.html', controller: 'LocationCtrl'});
}])
.controller("LocationCtrl", ["$scope", function($scope){

    $scope.changeHeaderTitle("Ubicación");
    $scope.addHeaderLeftButton("Menu", "#main-menu", "ui-icon-bars");
}]);


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.sopnopriyo.application</groupId>
    <artifactId>sopnopriyo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>Sopnopriyo</name>

    <repositories>
        <!-- jhipster-needle-maven-repository -->
    </repositories>

    <!-- jhipster-needle-distribution-management -->

    <properties>
        <!-- Build properties -->
        <maven.version>3.0.0</maven.version>
        <java.version>1.8</java.version>
        <scala.version>2.12.6</scala.version>
        <node.version>v8.12.0</node.version>
        <npm.version>6.4.1</npm.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory>
        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <argLine>-Djava.security.egd=file:/dev/./urandom -Xmx256m</argLine>
        <m2e.apt.activation>jdt_apt</m2e.apt.activation>
        <run.addResources>false</run.addResources>
        <!-- These remain empty unless the corresponding profile is active -->
        <profile.no-liquibase />
        <profile.swagger />
        <profile.tls />

        <!-- Dependency versions -->
        <jhipster-dependencies.version>2.0.26</jhipster-dependencies.version>
        <!-- The spring-boot version should match the one managed by
        https://mvnrepository.com/artifact/io.github.jhipster/jhipster-dependencies/${jhipster-dependencies.version} -->
        <spring-boot.version>2.0.5.RELEASE</spring-boot.version>
        <!-- The hibernate version should match the one managed by
        https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} -->
        <hibernate.version>5.2.17.Final</hibernate.version>
        <!-- The javassist version should match the one managed by
        https://mvnrepository.com/artifact/org.hibernate/hibernate-core/${hibernate.version} -->
        <javassist.version>3.22.0-GA</javassist.version>
        <!-- The liquibase version should match the one managed by
        https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} -->
        <liquibase.version>3.5.5</liquibase.version>
        <liquibase-hibernate5.version>3.6</liquibase-hibernate5.version>
        <validation-api.version>2.0.1.Final</validation-api.version>
        <mapstruct.version>1.2.0.Final</mapstruct.version>

        <!-- Plugin versions -->
        <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
        <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
        <maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
        <maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
        <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
        <maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
        <maven-war-plugin.version>3.2.2</maven-war-plugin.version>
        <jib-maven-plugin.version>0.9.11</jib-maven-plugin.version>
        <jacoco-maven-plugin.version>0.8.2</jacoco-maven-plugin.version>
        <scala-maven-plugin.version>3.4.2</scala-maven-plugin.version>
        <sonar-maven-plugin.version>3.5.0.1254</sonar-maven-plugin.version>
        <openapi-generator-maven-plugin.version>3.3.0</openapi-generator-maven-plugin.version>
        <git-commit-id-plugin.version>2.2.5</git-commit-id-plugin.version>

        <!-- Sonar properties -->
        <sonar.host.url>http://localhost:9001</sonar.host.url>
        <sonar.exclusions>src/main/webapp/content/**/*.*, src/main/webapp/i18n/*.js, target/www/**/*.*</sonar.exclusions>
        <sonar.issue.ignore.multicriteria>S3437,S4502,S4684,UndocumentedApi,BoldAndItalicTagsCheck</sonar.issue.ignore.multicriteria>
        <!-- Rule https://sonarcloud.io/coding_rules?open=Web%3ABoldAndItalicTagsCheck&rule_key=Web%3ABoldAndItalicTagsCheck is ignored. Even if we agree that using the "i" tag is an awful practice, this is what is recommended by http://fontawesome.io/examples/ -->
        <sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.resourceKey>src/main/webapp/app/**/*.*</sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.resourceKey>
        <sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.ruleKey>Web:BoldAndItalicTagsCheck</sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.ruleKey>
        <!-- Rule https://sonarcloud.io/coding_rules?open=squid%3AS3437&rule_key=squid%3AS3437 is ignored, as a JPA-managed field cannot be transient -->
        <sonar.issue.ignore.multicriteria.S3437.resourceKey>src/main/java/**/*</sonar.issue.ignore.multicriteria.S3437.resourceKey>
        <sonar.issue.ignore.multicriteria.S3437.ruleKey>squid:S3437</sonar.issue.ignore.multicriteria.S3437.ruleKey>
        <!-- Rule https://sonarcloud.io/coding_rules?open=squid%3AUndocumentedApi&rule_key=squid%3AUndocumentedApi is ignored, as we want to follow "clean code" guidelines and classes, methods and arguments names should be self-explanatory -->
        <sonar.issue.ignore.multicriteria.UndocumentedApi.resourceKey>src/main/java/**/*</sonar.issue.ignore.multicriteria.UndocumentedApi.resourceKey>
        <sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey>squid:UndocumentedApi</sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey>
        <!-- Rule https://sonarcloud.io/coding_rules?open=squid%3AS4502&rule_key=squid%3AS4502 is ignored, as for JWT tokens we are not subject to CSRF attack -->
        <sonar.issue.ignore.multicriteria.S4502.resourceKey>src/main/java/**/*</sonar.issue.ignore.multicriteria.S4502.resourceKey>
        <sonar.issue.ignore.multicriteria.S4502.ruleKey>squid:S4502</sonar.issue.ignore.multicriteria.S4502.ruleKey>
        <!-- Rule https://sonarcloud.io/coding_rules?open=squid%3AS4684&rule_key=squid%3AS4684 -->
        <sonar.issue.ignore.multicriteria.S4684.resourceKey>src/main/java/**/*</sonar.issue.ignore.multicriteria.S4684.resourceKey>
        <sonar.issue.ignore.multicriteria.S4684.ruleKey>squid:S4684</sonar.issue.ignore.multicriteria.S4684.ruleKey>
        <sonar.jacoco.reportPaths>${project.testresult.directory}/coverage/jacoco/jacoco.exec</sonar.jacoco.reportPaths>
        <sonar.java.codeCoveragePlugin>jacoco</sonar.java.codeCoveragePlugin>
        <sonar.typescript.lcov.reportPaths>${project.testresult.directory}/lcov.info</sonar.typescript.lcov.reportPaths>
        <sonar.sources>${project.basedir}/src/main/</sonar.sources>
        <sonar.surefire.reportsPath>${project.testresult.directory}/surefire-reports</sonar.surefire.reportsPath>
        <sonar.tests>${project.basedir}/src/test/</sonar.tests>

        <!-- jhipster-needle-maven-property -->
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.github.jhipster</groupId>
                <artifactId>jhipster-dependencies</artifactId>
                <version>${jhipster-dependencies.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- jhipster-needle-maven-add-dependency-management -->
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>io.github.jhipster</groupId>
            <artifactId>jhipster-framework</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-cache</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-annotation</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-json</artifactId>
        </dependency>
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient</artifactId>
        </dependency>
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient_dropwizard</artifactId>
        </dependency>
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient_servlet</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-jvm</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-servlet</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-servlets</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-hibernate5</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-hppc</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-afterburner</artifactId>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.hazelcast</groupId>
            <artifactId>hazelcast</artifactId>
        </dependency>
        <dependency>
            <groupId>com.hazelcast</groupId>
            <artifactId>hazelcast-hibernate52</artifactId>
        </dependency>
        <dependency>
            <groupId>com.hazelcast</groupId>
            <artifactId>hazelcast-spring</artifactId>
        </dependency>
        <dependency>
            <groupId>com.jayway.jsonpath</groupId>
            <artifactId>json-path</artifactId>
            <scope>test</scope>
            <!-- parent POM declares this dependency in default (compile) scope -->
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-bean-validators</artifactId>
        </dependency>
        <dependency>
            <groupId>com.mattbertolini</groupId>
            <artifactId>liquibase-slf4j</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ryantenney.metrics</groupId>
            <artifactId>metrics-spring</artifactId>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.cache</groupId>
            <artifactId>cache-api</artifactId>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-jpamodelgen</artifactId>
            <version>${hibernate.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-envers</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.validator</groupId>
            <artifactId>hibernate-validator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-core</artifactId>
        </dependency>
        <dependency>
            <groupId>net.logstash.logback</groupId>
            <artifactId>logstash-logback-encoder</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-jdk8</artifactId>
            <version>${mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <version>${mapstruct.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-loader-tools</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.zalando</groupId>
            <artifactId>problem-spring-web</artifactId>
            <version>0.24.0-RC.0</version>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!-- Spring Cloud -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.retry</groupId>
            <artifactId>spring-retry</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-cloud-connectors</artifactId>
        </dependency>
        <!-- Security -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-data</artifactId>
        </dependency>
        <!-- jhipster-needle-maven-add-dependency -->
    </dependencies>

    <build>
        <defaultGoal>spring-boot:run</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${mapstruct.version}</version>
                        </path>
                        <!-- For JPA static metamodel generation -->
                        <path>
                            <groupId>org.hibernate</groupId>
                            <artifactId>hibernate-jpamodelgen</artifactId>
                            <version>${hibernate.version}</version>
                        </path>

                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>${maven-eclipse-plugin.version}</version>
                <configuration>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <rules>
                        <requireMavenVersion>
                            <message>You are running an older version of Maven. JHipster requires at least Maven ${maven.version}</message>
                            <version>[${maven.version},)</version>
                        </requireMavenVersion>
                        <requireJavaVersion>
                            <!-- Until JHipster supports JDK 9 -->
                            <message>You are running an incompatible version of Java. JHipster requires JDK ${java.version}</message>
                            <version>[1.8,1.9)</version>
                        </requireJavaVersion>
                    </rules>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven-resources-plugin.version}</version>
                <executions>
                    <execution>
                        <id>default-resources</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/classes</outputDirectory>
                            <useDefaultDelimiters>false</useDefaultDelimiters>
                            <delimiters>
                                <delimiter>#</delimiter>
                            </delimiters>
                            <resources>
                                <resource>
                                    <directory>src/main/resources/</directory>
                                    <filtering>true</filtering>
                                    <includes>
                                        <include>config/*.yml</include>
                                    </includes>
                                </resource>
                                <resource>
                                    <directory>src/main/resources/</directory>
                                    <filtering>false</filtering>
                                    <excludes>
                                        <exclude>config/*.yml</exclude>
                                    </excludes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>docker-resources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/classes/static/</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>target/www</directory>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <!-- Force alphabetical order to have a reproducible build -->
                    <runOrder>alphabetical</runOrder>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>pre-unit-tests</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the path to the file which contains the execution data. -->
                            <destFile>${project.testresult.directory}/coverage/jacoco/jacoco.exec</destFile>
                        </configuration>
                    </execution>
                    <!-- Ensures that the code coverage report for unit tests is created after unit tests have been run -->
                    <execution>
                        <id>post-unit-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <dataFile>${project.testresult.directory}/coverage/jacoco/jacoco.exec</dataFile>
                            <outputDirectory>${project.testresult.directory}/coverage/jacoco</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>${sonar-maven-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>${liquibase.version}</version>
                <configuration>
                    <changeLogFile>src/main/resources/config/liquibase/master.xml</changeLogFile>
                    <diffChangeLogFile>src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
                    <driver>org.h2.Driver</driver>
                    <url>jdbc:h2:file:./target/h2db/db/sopnopriyo</url>
                    <defaultSchemaName></defaultSchemaName>
                    <username>sopnopriyo</username>
                    <password></password>
                    <referenceUrl>hibernate:spring:com.sopnopriyo.application.domain?dialect=org.hibernate.dialect.H2Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy</referenceUrl>
                    <verbose>true</verbose>
                    <logging>debug</logging>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.javassist</groupId>
                        <artifactId>javassist</artifactId>
                        <version>${javassist.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.liquibase.ext</groupId>
                        <artifactId>liquibase-hibernate5</artifactId>
                        <version>${liquibase-hibernate5.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-data-jpa</artifactId>
                        <version>${spring-boot.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>javax.validation</groupId>
                        <artifactId>validation-api</artifactId>
                        <version>${validation-api.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring-boot.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>${start-class}</mainClass>
                    <executable>true</executable>
                    <fork>true</fork>
                    <!--
                    Enable the line below to have remote debugging of your application on port 5005
                    <jvmArguments>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments>
                    -->
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <version>${jib-maven-plugin.version}</version>
                <configuration>
                    <from>
                        <image>openjdk:8-jre-alpine</image>
                    </from>
                    <to>
                        <image>sopnopriyo:latest</image>
                    </to>
                    <container>
                        <entrypoint>
                            <shell>sh</shell>
                            <option>-c</option>
                            <arg>chmod +x /entrypoint.sh && sync && /entrypoint.sh</arg>
                        </entrypoint>
                        <ports>
                            <port>8080</port>
                            <port>5701/udp</port>
                        </ports>
                        <environment>
                            <SPRING_OUTPUT_ANSI_ENABLED>ALWAYS</SPRING_OUTPUT_ANSI_ENABLED>
                            <JHIPSTER_SLEEP>0</JHIPSTER_SLEEP>
                        </environment>
                        <useCurrentTimestamp>true</useCurrentTimestamp>
                    </container>
                </configuration>
            </plugin>
            <plugin>
                <!--
                    Plugin that provides API-first development using openapi-generator to
                    generate Spring-MVC endpoint stubs at compile time from an OpenAPI definition file
                -->
                <groupId>org.openapitools</groupId>
                <artifactId>openapi-generator-maven-plugin</artifactId>
                <version>${openapi-generator-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.basedir}/src/main/resources/swagger/api.yml</inputSpec>
                            <generatorName>spring</generatorName>
                            <apiPackage>com.sopnopriyo.application.web.api</apiPackage>
                            <modelPackage>com.sopnopriyo.application.web.api.model</modelPackage>
                            <supportingFilesToGenerate>ApiUtil.java</supportingFilesToGenerate>
                            <validateSpec>true</validateSpec>
                            <configOptions>
                                <delegatePattern>true</delegatePattern>
                            </configOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- jhipster-needle-maven-add-plugin -->
        </plugins>
        <pluginManagement>
            <plugins>
                <!--
                    This plugin's configuration is used to store Eclipse m2e settings only.
                    It has no influence on the Maven build itself.
                    Remove when the m2e plugin can correctly bind to Maven lifecycle
                -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.jacoco</groupId>
                                        <artifactId>
                                            jacoco-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            ${jacoco-maven-plugin.version}
                                        </versionRange>
                                        <goals>
                                            <goal>prepare-agent</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore/>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.openapitools</groupId>
                                        <artifactId>openapi-generator-maven-plugin</artifactId>
                                        <versionRange>${openapi-generator-maven-plugin.version}</versionRange>
                                        <goals>
                                            <goal>generate</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <profiles>
        <profile>
            <id>no-liquibase</id>
            <properties>
                <profile.no-liquibase>,no-liquibase</profile.no-liquibase>
            </properties>
        </profile>
        <profile>
            <id>swagger</id>
            <properties>
                <profile.swagger>,swagger</profile.swagger>
            </properties>
        </profile>
        <profile>
            <id>tls</id>
            <properties>
                <profile.tls>,tls</profile.tls>
            </properties>
        </profile>
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-undertow</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-devtools</artifactId>
                    <optional>true</optional>
                </dependency>
                <dependency>
                    <groupId>com.h2database</groupId>
                    <artifactId>h2</artifactId>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>${maven-war-plugin.version}</version>
                        <configuration>
                            <failOnMissingWebXml>false</failOnMissingWebXml>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <!-- default Spring profiles -->
                <spring.profiles.active>dev${profile.tls}${profile.no-liquibase}</spring.profiles.active>
            </properties>
        </profile>
        <profile>
            <id>prod</id>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-undertow</artifactId>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-clean-plugin</artifactId>
                        <version>${maven-clean-plugin.version}</version>
                        <configuration>
                            <filesets>
                                <fileset>
                                    <directory>target/www/</directory>
                                </fileset>
                            </filesets>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>${maven-war-plugin.version}</version>
                        <configuration>
                            <failOnMissingWebXml>false</failOnMissingWebXml>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <version>${spring-boot.version}</version>
                        <configuration>
                            <mainClass>${start-class}</mainClass>
                            <executable>true</executable>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>build-info</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>pl.project13.maven</groupId>
                        <artifactId>git-commit-id-plugin</artifactId>
                        <version>${git-commit-id-plugin.version}</version>
                            <executions>
                                <execution>
                                    <goals>
                                        <goal>revision</goal>
                                    </goals>
                                </execution>
                            </executions>
                            <configuration>
                                <failOnNoGitDirectory>false</failOnNoGitDirectory>
                                <generateGitPropertiesFile>true</generateGitPropertiesFile>
                                <includeOnlyProperties>
                                    <includeOnlyProperty>^git.commit.id.abbrev$</includeOnlyProperty>
                                    <includeOnlyProperty>^git.commit.id.describe$</includeOnlyProperty>
                                    <includeOnlyProperty>^git.branch$</includeOnlyProperty>
                                </includeOnlyProperties>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <!-- default Spring profiles -->
                <spring.profiles.active>prod${profile.swagger}${profile.no-liquibase}</spring.profiles.active>
            </properties>
        </profile>
        <profile>
            <!--
                Profile for doing "continuous compilation" with the Scala Maven plugin.
                It allows automatic compilation of Java classes as soon as they are saved.
                To use it, run in 3 terminals:
                - './mvnw -Pcc scala:cc' for continuous compilation of your classes
                - './mvnw -Pcc -Pdev' for hot reload of Spring boot
                - 'npm start/yarn start' for hot reload of the HTML/JavaScript asset
                Everything should hot reload automatically!
            -->
            <id>cc</id>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-undertow</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-devtools</artifactId>
                    <optional>true</optional>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>${maven-war-plugin.version}</version>
                        <configuration>
                            <failOnMissingWebXml>false</failOnMissingWebXml>
                            <warSourceDirectory>src/main/webapp/</warSourceDirectory>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <version>${spring-boot.version}</version>
                        <configuration>
                            <mainClass>${start-class}</mainClass>
                            <executable>true</executable>
                            <fork>true</fork>
                            <addResources>true</addResources>
                            <!--
                            Enable the line below to have remote debugging of your application on port 5005
                            <jvmArguments>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments>
                            -->
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>${maven-compiler-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>default-compile</id>
                                <phase>none</phase>
                            </execution>
                            <execution>
                                <id>default-testCompile</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.alchim31.maven</groupId>
                        <artifactId>scala-maven-plugin</artifactId>
                        <version>${scala-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>compile</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>add-source</goal>
                                    <goal>compile</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>test-compile</id>
                                <phase>test-compile</phase>
                                <goals>
                                    <goal>add-source</goal>
                                    <goal>testCompile</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <recompileMode>incremental</recompileMode>
                            <verbose>true</verbose>
                            <scalaVersion>${scala.version}</scalaVersion>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <!-- default Spring profiles -->
                <spring.profiles.active>dev,swagger</spring.profiles.active>
            </properties>
        </profile>
        <profile>
            <!--
                Profile for tracing requests with Zipkin.
            -->
            <id>zipkin</id>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-starter-zipkin</artifactId>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <!--
                Profile for applying IDE-specific configuration.
                At the moment it configures MapStruct and Hibernate JPA Metamodel Generator, which you need when working
                with DTOs and entity filtering.
            -->
            <id>IDE</id>
            <dependencies>
                <dependency>
                    <groupId>org.mapstruct</groupId>
                    <artifactId>mapstruct-processor</artifactId>
                    <version>${mapstruct.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-jpamodelgen</artifactId>
                    <version>${hibernate.version}</version>
                </dependency>
            </dependencies>
        </profile>
        <!-- jhipster-needle-maven-add-profile -->
    </profiles>
</project>


text:
<?php
include "conf/config.php";

if(isset($_SESSION["user_id"]))
{
	echo "
";
	$last_log = $_SESSION["last_login"];
	mysql_query("set names 'utf8'");
	$abfrage = "SELECT * FROM movies where add_time > '$last_log' order by add_time desc";
	$ergebnis = mysql_query($abfrage) OR die (mysql_error());;
	$menge = mysql_num_rows($ergebnis);

	if ($menge == 0)
	{
		echo "Leider keine neuen Filme seit ihrem letzten Login hinzugefügt =(";
	}

	while($row = mysql_fetch_object($ergebnis))
		{
			echo "

id' data-ajax='false'>
							cover' />

$row->title

Veröffentlicht am: $row->release_date

 Kategorien:
							";
							$quer = "Select * from categories_main where id IN (Select categorie_id from categories where movie_id = $row->id)";
							$ret = mysql_query($quer);
							while($row2 = mysql_fetch_object($ret))
							{
								echo "$row2->name ";
							}
							echo "
id' data-ajax='false' >
";

		}
	echo "
";
	$id = $_SESSION["user_id"];
	$abfrage = "UPDATE users SET last_login=CURRENT_TIMESTAMP where id=$id";
	$ergebnis = mysql_query($abfrage) OR die (mysql_error());
}
else
{
	echo"";
}
?>


text:
/* $Id$ */

/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.manifoldcf.agents.output.elasticsearch.tests;

import org.junit.After;
import org.junit.Before;

import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;

import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.HttpEntity;
import org.apache.http.util.EntityUtils;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;
import java.io.File;
import java.util.Locale;

/**
 *  Base integration tests class for Elastic Search tested against a CMIS repository
 *  @author Piergiorgio Lucidi
 *
 * */
public class BaseITHSQLDB extends org.apache.manifoldcf.crawler.tests.BaseITHSQLDB
{

  final static boolean isUnix;
  static {
    final String os = System.getProperty("os.name").toLowerCase(Locale.ROOT);
    if (os.contains("win")) {
      isUnix = false;
    } else {
      isUnix = true;
    }
  }

  protected String[] getConnectorNames()
  {
    return new String[]{"CMIS"};
  }

  protected String[] getConnectorClasses()
  {
    return new String[]{"org.apache.manifoldcf.crawler.tests.TestingRepositoryConnector"};
  }

  protected String[] getOutputNames()
  {
    return new String[]{"ElasticSearch"};
  }

  protected String[] getOutputClasses()
  {
    return new String[]{"org.apache.manifoldcf.agents.output.elasticsearch.ElasticSearchConnector"};
  }

  Process esTestProcess = null;

  @Before
  public void setupElasticSearch()
    throws Exception
  {
    final ProcessBuilder pb = new ProcessBuilder();

    if (System.getenv("JAVA_HOME")!= null) {
      pb.environment().put("JAVA_HOME", System.getenv("JAVA_HOME"));
    } else {
      throw new Exception("JAVA_HOME is required to be set for this test");
    }

    final File absFile = new File(".").getAbsoluteFile();
    System.out.println("ES working directory is '"+absFile+"'");
    pb.directory(absFile);

    final String testMaterialsPath = System.getProperty("testMaterialsPath");
    if (testMaterialsPath == null) {
      throw new Exception("Can't find testMaterialsPath argument; test cannot be run");
    }
    if (isUnix) {
      pb.command("bash", "-c", testMaterialsPath + "unix/elasticsearch-7.6.2/bin/elasticsearch -q -Expack.ml.enabled=false");
      System.out.println("Unix process");
    } else {
      pb.command("cmd.exe", "/c", testMaterialsPath.replace("/", "\\") + "windows\\elasticsearch-7.6.2\\bin\\elasticsearch.bat -q -Expack.ml.enabled=false");
      System.out.println("Windows process");
    }

    File log = new File("es.log");
    pb.redirectErrorStream(true);
    pb.redirectOutput(ProcessBuilder.Redirect.appendTo(log));
    esTestProcess = pb.start();
    System.out.println("ElasticSearch is starting...");
    //the default port is 9200

    waitForElasticSearch();

    System.out.println("ElasticSearch is started on port 9200");
  }

  public void waitForElasticSearch() {
    for (int i = 0 ; i < 10000 ; i++) {
      CloseableHttpClient httpclient = HttpClients.createDefault();
      HttpGet httpGet = new HttpGet("http://127.0.0.1:9200");
      try {
        CloseableHttpResponse response1 = httpclient.execute(httpGet);
        try {
          System.out.println("Response from ES: "+response1.getStatusLine());
          HttpEntity entity1 = response1.getEntity();
          // do something useful with the response body
          // and ensure it is fully consumed
          EntityUtils.consume(entity1);
        } finally {
          response1.close();
        }
        System.out.println("ES came up!");
        return;
      } catch (IOException e) {
        // Wait 500ms and try again
        System.out.println("Didn't reach ES; waiting...");
        try {
          Thread.sleep(500);
        } catch (InterruptedException e1) {
          break;
        }
      }
    }
    throw new IllegalStateException("ES didn't come up.");
  }

  @After
  public void cleanUpElasticSearch(){
    if (esTestProcess != null) {
      esTestProcess.destroy();
    }
  }

}


text:
package env

import (
	"encoding/json"
	"fmt"
	"github.com/toolkits/file"
)

//Properties read configuration from file path
type Properties struct {
	data map[string]interface{}
}

func NewProperties(data map[string]interface{}) *Properties {
	return &Properties{data: data}
}

//LoadConfig return a pointer of the configuration from the json file in the path
func LoadConfig(path string) (*Properties, error) {
	if !file.IsExist(path) {
		return nil, fmt.Errorf("file: %s isn't exists", path)
	}

	body, err := file.ToTrimString(path)
	if err != nil {
		return nil, err
	}

	config := NewProperties(map[string]interface{}{})
	err = json.Unmarshal([]byte(body), &config.data)
	if err != nil {
		return nil, err
	} else {
		return config, nil
	}
}

//GetString return string from config
func (p *Properties) GetString(name string, value ...string) string {
	if r := p.data[name]; r != nil {
		return r.(string)
	} else if len(value) > 0 {
		return value[0]
	} else {
		return ""
	}
}

//GetMapString return string from map in the config
func (p *Properties) GetMapString(name string, field string, value ...string) string {
	if r := p.data[name]; r != nil {
		if v := r.(map[string]interface{})[field]; v != nil {
			return v.(string)
		}
	}

	if len(value) > 0 {
		return value[0]
	} else {
		return ""
	}
}

//GetMap return map from the config
func (p *Properties) GetMap(name string) map[string]interface{} {
	if r := p.data[name]; r != nil {
		return r.(map[string]interface{})
	} else {
		return map[string]interface{}{}
	}
}


text:
namespace lslboost { namespace spirit
{
    template <typename T>
    struct use_terminal<karma::domain, T
      , typename enable_if<traits::is_generator<T> >::type> // enables generators
      : mpl::true_ {};

    namespace karma
    {
        template <typename T, typename Modifiers, typename Enable = void>
        struct make_primitive // by default, return it as-is
        {
            typedef T result_type;

            template <typename T_>
            T_& operator()(T_& val, unused_type) const
            {
                return val;
            }

            template <typename T_>
            T_ const& operator()(T_ const& val, unused_type) const
            {
                return val;
            }
        };

        template <typename Tag, typename Elements
          , typename Modifiers, typename Enable = void>
        struct make_composite;

        template <typename Directive, typename Body
          , typename Modifiers, typename Enable = void>
        struct make_directive
        {
            typedef Body result_type;
            result_type operator()(unused_type, Body const& body, unused_type) const
            {
                return body; // By default, a directive simply returns its subject
            }
        };
    }

    // Karma primitive meta-compiler
    template <>
    struct make_component<karma::domain, proto::tag::terminal>
    {
        template <typename Sig>
        struct result;

        template <typename This, typename Elements, typename Modifiers>
        struct result<This(Elements, Modifiers)>
        {
            typedef typename karma::make_primitive<
                typename remove_const<typename Elements::car_type>::type
              , typename remove_reference<Modifiers>::type
            >::result_type type;
        };

        template <typename Elements, typename Modifiers>
        typename result<make_component(Elements, Modifiers)>::type
        operator()(Elements const& elements, Modifiers const& modifiers) const
        {
            typedef typename remove_const<typename Elements::car_type>::type term;
            return karma::make_primitive<term, Modifiers>()(elements.car, modifiers);
        }
    };

    // Karma composite meta-compiler
    template <typename Tag>
    struct make_component<karma::domain, Tag>
    {
        template <typename Sig>
        struct result;

        template <typename This, typename Elements, typename Modifiers>
        struct result<This(Elements, Modifiers)>
        {
            typedef typename
                karma::make_composite<Tag, Elements
                  , typename remove_reference<Modifiers>::type>::result_type
            type;
        };

        template <typename Elements, typename Modifiers>
        typename result<make_component(Elements, Modifiers)>::type
        operator()(Elements const& elements, Modifiers const& modifiers) const
        {
            return karma::make_composite<Tag, Elements, Modifiers>()(
                elements, modifiers);
        }
    };

    // Karma function meta-compiler
    template <>
    struct make_component<karma::domain, proto::tag::function>
    {
        template <typename Sig>
        struct result;

        template <typename This, typename Elements, typename Modifiers>
        struct result<This(Elements, Modifiers)>
        {
            typedef typename
                karma::make_composite<
                    typename remove_const<typename Elements::car_type>::type,
                    typename Elements::cdr_type,
                    typename remove_reference<Modifiers>::type
                >::result_type
            type;
        };

        template <typename Elements, typename Modifiers>
        typename result<make_component(Elements, Modifiers)>::type
        operator()(Elements const& elements, Modifiers const& modifiers) const
        {
            return karma::make_composite<
                typename remove_const<typename Elements::car_type>::type,
                typename Elements::cdr_type,
                Modifiers>()(elements.cdr, modifiers);
        }
    };

    // Karma directive meta-compiler
    template <>
    struct make_component<karma::domain, tag::directive>
    {
        template <typename Sig>
        struct result;

        template <typename This, typename Elements, typename Modifiers>
        struct result<This(Elements, Modifiers)>
        {
            typedef typename
                karma::make_directive<
                    typename remove_const<typename Elements::car_type>::type,
                    typename remove_const<typename Elements::cdr_type::car_type>::type,
                    typename remove_reference<Modifiers>::type
                >::result_type
            type;
        };

        template <typename Elements, typename Modifiers>
        typename result<make_component(Elements, Modifiers)>::type
        operator()(Elements const& elements, Modifiers const& modifiers) const
        {
            return karma::make_directive<
                typename remove_const<typename Elements::car_type>::type,
                typename remove_const<typename Elements::cdr_type::car_type>::type,
                Modifiers>()(elements.car, elements.cdr.car, modifiers);
        }
    };

}}

#endif


text:
package org.onosproject.sdnip;

import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.Service;
import org.onosproject.cluster.ClusterService;
import org.onosproject.cluster.ControllerNode;
import org.onosproject.cluster.LeadershipEvent;
import org.onosproject.cluster.LeadershipEventListener;
import org.onosproject.cluster.LeadershipService;
import org.onosproject.config.NetworkConfigService;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
import org.onosproject.net.host.HostService;
import org.onosproject.net.intent.IntentService;
import org.onosproject.routing.RoutingService;
import org.onosproject.routing.config.RoutingConfigurationService;
import org.slf4j.Logger;

import java.util.Objects;

import static org.slf4j.LoggerFactory.getLogger;

/**
 * Component for the SDN-IP peering application.
 */
@Component(immediate = true)
@Service
public class SdnIp implements SdnIpService {

    private static final String SDN_IP_APP = "org.onosproject.sdnip";
    private final Logger log = getLogger(getClass());

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected CoreService coreService;

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected IntentService intentService;

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected HostService hostService;

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected ClusterService clusterService;

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected LeadershipService leadershipService;

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected RoutingService routingService;

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected RoutingConfigurationService config;

    //
    // NOTE: Unused reference - needed to guarantee that the
    // NetworkConfigReader component is activated and the network configuration
    // is read.
    //
    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected NetworkConfigService networkConfigService;

    private IntentSynchronizer intentSynchronizer;
    private PeerConnectivityManager peerConnectivity;

    private LeadershipEventListener leadershipEventListener =
        new InnerLeadershipEventListener();
    private ApplicationId appId;
    private ControllerNode localControllerNode;

    @Activate
    protected void activate() {
        log.info("SDN-IP started");

        appId = coreService.registerApplication(SDN_IP_APP);

        localControllerNode = clusterService.getLocalNode();

        intentSynchronizer = new IntentSynchronizer(appId, intentService,
                                                    hostService,
                                                    config);
        intentSynchronizer.start();

        peerConnectivity = new PeerConnectivityManager(appId,
                                                       intentSynchronizer,
                                                       config);
        peerConnectivity.start();

        routingService.addFibListener(intentSynchronizer);
        routingService.addIntentRequestListener(intentSynchronizer);
        routingService.start();

        leadershipService.addListener(leadershipEventListener);
        leadershipService.runForLeadership(appId.name());
    }

    @Deactivate
    protected void deactivate() {
        routingService.stop();
        peerConnectivity.stop();
        intentSynchronizer.stop();

        leadershipService.withdraw(appId.name());
        leadershipService.removeListener(leadershipEventListener);

        log.info("SDN-IP Stopped");
    }

    @Override
    public void modifyPrimary(boolean isPrimary) {
        intentSynchronizer.leaderChanged(isPrimary);
    }

    /**
     * Converts DPIDs of the form xx:xx:xx:xx:xx:xx:xx to OpenFlow provider
     * device URIs.
     *
     * @param dpid the DPID string to convert
     * @return the URI string for this device
     */
    static String dpidToUri(String dpid) {
        return "of:" + dpid.replace(":", "");
    }

    /**
     * A listener for Leadership Events.
     */
    private class InnerLeadershipEventListener
        implements LeadershipEventListener {

        @Override
        public void event(LeadershipEvent event) {
            log.debug("Leadership Event: time = {} type = {} event = {}",
                      event.time(), event.type(), event);

            if (!event.subject().topic().equals(appId.name())) {
                return;         // Not our topic: ignore
            }
            if (!Objects.equals(event.subject().leader(), localControllerNode.id())) {
                return;         // The event is not about this instance: ignore
            }

            switch (event.type()) {
            case LEADER_ELECTED:
                log.info("SDN-IP Leader Elected");
                intentSynchronizer.leaderChanged(true);
                break;
            case LEADER_BOOTED:
                log.info("SDN-IP Leader Lost Election");
                intentSynchronizer.leaderChanged(false);
                break;
            case LEADER_REELECTED:
                break;
            default:
                break;
            }
        }
    }
}


text:
namespace ATM.Data.Contracts
{
    using System;
    using Models;

    public interface IAtmData : IDisposable
    {
        IGenericRepository<CardAccount> CardAccounts { get; }

        int SaveChanges();
    }
}


text:
package ru.dionisius.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import ru.dionisius.data.dao.FakeDao;
import ru.dionisius.data.dao.IAdsDao;
import ru.dionisius.data.models.Ad;

import java.util.List;

/**
 * Created by Dionisius on 14.11.2017.
 */
@Service
public class AdService implements IAdService {

    @Autowired
    @Qualifier("adDao")
    private IAdsDao dao;

    @Override
//    @Transactional
    public long addAd(Ad ad) {
        return this.dao.addAd(ad);
    }

    @Override
//    @Transactional
    public void updateAd(Ad ad) {
        this.dao.updateAd(ad);
    }

    @Override
//    @Transactional
    public List<Ad> getAll() {
        return this.dao.getAll();
    }

    @Override
//    @Transactional
    public Ad getAdById(long id) {
        return this.dao.getAdById(id);
    }

    @Override
//    @Transactional
    public void removeAd(long id) {
        this.dao.removeAd(id);
    }
}


text:
from django.apps import AppConfig

class MyCommentsConfig(AppConfig):
    name = 'mycomments'