text:
var drawings = [];
var tooltips = [];
var source;
function removeDrawing(counter) {
	source.removeFeature(drawings[counter]);
	tooltips[counter].parentNode.removeChild(tooltips[counter]);

	source.refresh({force:true});
}

function initMeasurements(map, layergroup, popupsEnabled)
{
	var wgs84Sphere = new ol.Sphere(6378137);

	source = new ol.source.Vector();
	var vector = new ol.layer.Vector({
		source: source,
		style: new ol.style.Style({
			fill: new ol.style.Fill({
				color: 'rgba(255, 255, 255, 0.2)'
			}),
			stroke: new ol.style.Stroke({
				color: '#ffcc33',
				width: 2
			}),
			image: new ol.style.Circle({
				radius: 7,
				fill: new ol.style.Fill({
					color: '#ffcc33'
				})
			})
		})
	});
	layergroup.getLayers().push(vector);

	/**
	 * Currently drawn feature.
	 * @type {ol.Feature}
	 */
	var sketch;

	/**
	 * The help tooltip element.
	 * @type {Element}
	 */
	var helpTooltipElement;

	/**
	 * Overlay to show the help messages.
	 * @type {ol.Overlay}
	 */
	var helpTooltip;

	/**
	 * The measure tooltip element.
	 * @type {Element}
	 */
	var measureTooltipElement;

	/**
	 * Overlay to show the measurement.
	 * @type {ol.Overlay}
	 */
	var measureTooltip;

	/**
	 * Handle pointer move.
	 * @param {ol.MapBrowserEvent} evt
	 */
	var pointerMoveHandler = function (evt) {
		if (evt.dragging) {
			return;
		}
		/** @type {string} */
		var helpMsg = 'Click to start drawing';
		/** @type {ol.Coordinate|undefined} */
		var tooltipCoord = evt.coordinate;

		if (sketch) {
			var output;
			var geom = (sketch.getGeometry());
			if (geom instanceof ol.geom.Polygon) {
				output = formatArea(/** @type {ol.geom.Polygon} */ (geom));
				helpMsg = 'Double-click to finish drawing the polygon';
				tooltipCoord = geom.getInteriorPoint().getCoordinates();
			} else if (geom instanceof ol.geom.LineString) {
				output = formatLength(/** @type {ol.geom.LineString} */ (geom));
				helpMsg = 'Double-click to finish drawing the line';
				tooltipCoord = geom.getLastCoordinate();
			}
			measureTooltipElement.innerHTML = output;
			measureTooltip.setPosition(tooltipCoord);
		}

		helpTooltipElement.innerHTML = helpMsg;
		helpTooltip.setPosition(evt.coordinate);
	};

	var typeSelect = document.getElementById('measurement-type');
	var aanuitknop = document.getElementById('measurement-enable');
	var widget = document.getElementById('measurement-tool');

	var draw; // global so we can remove it later
	var drawingCounter = 0;
	function addInteraction() {
		var type = (typeSelect.value == 'area' ? 'Polygon' : 'LineString');
		draw = new ol.interaction.Draw({
			source: source,
			type: /** @type {ol.geom.GeometryType} */ (type),
			style: new ol.style.Style({
				fill: new ol.style.Fill({
					color: 'rgba(255, 255, 255, 0.2)'
				}),
				stroke: new ol.style.Stroke({
					color: 'rgba(0, 0, 0, 0.5)',
					lineDash: [10, 10],
					width: 2
				}),
				image: new ol.style.Circle({
					radius: 5,
					stroke: new ol.style.Stroke({
						color: 'rgba(0, 0, 0, 0.7)'
					}),
					fill: new ol.style.Fill({
						color: 'rgba(255, 255, 255, 0.2)'
					})
				})
			})
		});
		map.addInteraction(draw);

		createMeasureTooltip();
		createHelpTooltip();

		draw.on('drawstart',
			function (evt) {
				// set sketch
				sketch = evt.feature;
			}, this);

		draw.on('drawend',
			function (evt) {
				drawings[drawingCounter] = sketch;
				tooltips[drawingCounter] = measureTooltipElement;
				measureTooltipElement.className = 'tooltip tooltip-static';
				measureTooltipElement.innerHTML += ' ×';
				drawingCounter++;

				measureTooltip.setOffset([0, -7]);
				// unset sketch
				sketch = null;
				// unset tooltip so that a new one can be created
				measureTooltipElement = null;
				createMeasureTooltip();
			}, this);
	}

	/**
	 * Creates a new help tooltip
	 */
	function createHelpTooltip() {
		if (helpTooltipElement) {
			helpTooltipElement.parentNode.removeChild(helpTooltipElement);
		}
		helpTooltipElement = document.createElement('div');
		helpTooltipElement.className = 'tooltip';
		helpTooltip = new ol.Overlay({
			element: helpTooltipElement,
			offset: [15, 0],
			positioning: 'center-left'
		});
		map.addOverlay(helpTooltip);
	}

	function removeHelpTooltip() {
		if (helpTooltipElement) {
			helpTooltipElement.parentNode.removeChild(helpTooltipElement);
		}
		helpTooltipElement = null;
	}

	/**
	 * Creates a new measure tooltip
	 */
	function createMeasureTooltip() {
		if (measureTooltipElement) {
			measureTooltipElement.parentNode.removeChild(measureTooltipElement);
		}
		measureTooltipElement = document.createElement('div');
		measureTooltipElement.className = 'tooltip tooltip-measure';
		measureTooltip = new ol.Overlay({
			element: measureTooltipElement,
			offset: [0, -15],
			positioning: 'bottom-center'
		});
		map.addOverlay(measureTooltip);
	}

	/**
	 * format length output
	 * @param {ol.geom.LineString} line
	 * @return {string}
	 */
	var formatLength = function (line) {
		var coordinates = line.getCoordinates();
		var length = 0;
		var sourceProj = map.getView().getProjection();
		for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {
			var c1 = ol.proj.transform(coordinates[i], sourceProj, 'EPSG:4326');
			var c2 = ol.proj.transform(coordinates[i + 1], sourceProj, 'EPSG:4326');
			length += wgs84Sphere.haversineDistance(c1, c2);
		}
		var output;
		if (length > 100) {
			output = (Math.round(length / 1000 * 100) / 100) +
				' ' + 'km';
		} else {
			output = (Math.round(length * 100) / 100) +
				' ' + 'm';
		}
		return output;
	};

	/**
	 * format length output
	 * @param {ol.geom.Polygon} polygon
	 * @return {string}
	 */
	var formatArea = function (polygon) {
		var sourceProj = map.getView().getProjection();
		var geom = /** @type {ol.geom.Polygon} */(polygon.clone().transform(
			sourceProj, 'EPSG:4326'));
		var coordinates = geom.getLinearRing(0).getCoordinates();
		var area = Math.abs(wgs84Sphere.geodesicArea(coordinates));
		var output;
		if (area > 10000) {
			output = (Math.round(area / 1000000 * 100) / 100) +
				' ' + 'km2';
		} else {
			output = (Math.round(area * 100) / 100) +
				' ' + 'm2';
		}
		return output;
	};

	var pointerMoveEvent;

	function start() {
		addInteraction();
		pointerMoveEvent = map.on('pointermove', pointerMoveHandler);
		popupsEnabled.enabled = false;

		typeSelect.onchange = function (e) {
			map.removeInteraction(draw);
			addInteraction();
		};
	}

	function stop() {
		map.removeInteraction(draw);
		map.unByKey(pointerMoveEvent);
		removeHelpTooltip();
		popupsEnabled.enabled = true;

		typeSelect.onchange = function (e) {};
	}

	function setActivationState() {
		if(aanuitknop.checked) {
			start();
		} else {
			stop();
		}
	}

	aanuitknop.onchange = setActivationState;

	setActivationState();

	var hiddenClasses = "ol-control";
	var shownClasses = hiddenClasses + " shown";

	widget.onmouseover = function() {
		widget.className = shownClasses;
	};
	widget.onmouseout = function() {
		widget.className = hiddenClasses;
	};
}


text:
angular.module('myApp.controllers').controller('PasswordUpdateCtrl',
    ['$scope','user','$route','$routeParams','redirection',
        function ($scope,user,$route,$routeParams,redirection) {
			'use strict';

			if($route.current.action === 'forget'){
				user.logByForgetToken($routeParams.username,$routeParams.forgetToken).error(function(data){
					$scope.error = data.msg;
				});
			}

			$scope.bDisplayUpdatePassword = false;

			$scope.updatePassword = function(){

				if($scope.password !== $scope.passwordVerif){
					$scope.error = 'password_not_equal';
				} else {
					user.updatePassword($scope.password).success(function(data){
						$scope.bDisplayUpdatePassword = true;
						redirection.goHome();
					}).error(function(data){
						$scope.error = data.msg;
					});
				}

			};

        }
    ]
);

redpajama_set_name: RedPajamaGithub


text:
using System;
using MongoDB.Bson;
using MongoDB.Driver;

namespace Hangfire.Mongo.Migration.Steps.Version10
{
    /// <summary>
    /// Update the schema collection adding a database identifier
    /// </summary>
    internal class UpdateSchemaCollection : IMongoMigrationStep
    {
        public MongoSchema TargetSchema => MongoSchema.Version10;

        public long Sequence => 0;

        public bool Execute(IMongoDatabase database, MongoStorageOptions storageOptions, IMongoMigrationContext migrationContext)
        {
            var name = $@"{storageOptions.Prefix}.schema";

            var filter = Builders<BsonDocument>.Filter.Not(Builders<BsonDocument>.Filter.Exists("Identifier"));
            var update = Builders<BsonDocument>.Update.Set("Identifier", Guid.NewGuid().ToString());

            database
                .GetCollection<BsonDocument>(name)
                .FindOneAndUpdate(filter, update);

            return true;
        }
    }
}


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

  <parent>
    <groupId>org.opennms.twissandra</groupId>
    <artifactId>twissandra-j</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>

  <properties>
    <bundle.symbolicName>org.opennms.twissandra.api</bundle.symbolicName>
    <bundle.namespace>org.opennms.twissandra.api</bundle.namespace>
  </properties>

  <modelVersion>4.0.0</modelVersion>
  <groupId>org.opennms.twissandra</groupId>
  <artifactId>api</artifactId>
  <version>1.0-SNAPSHOT</version>

  <name>Twissandra for Java API</name>

  <packaging>bundle</packaging>

  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.compendium</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>

  </dependencies>

</project>


text:
import uuid

from poppy.manager.default import v1
from tests.functional.transport.pecan import base

class ContextHookTest(base.FunctionalTest):

    def setUp(self):
        super(ContextHookTest, self).setUp()

        self.headers = {'X-Auth-Token': str(uuid.uuid4())}

    def test_project_id_in_header(self):
        self.headers['X-Project-Id'] = '000001'
        response = self.app.get('/v1.0', headers=self.headers)

        self.assertEqual(200, response.status_code)

        # Temporary until actual implementation
        self.assertEqual(v1.JSON_HOME, response.json)

    def test_project_id_in_url(self):
        response = self.app.get('/v1.0/000001', headers=self.headers)

        self.assertEqual(200, response.status_code)
        # Temporary until actual implementation
        self.assertEqual(v1.JSON_HOME, response.json)


text:
#ifndef __INVOKE_APP_H_INCLUDED__
#define __INVOKE_APP_H_INCLUDED__

#ifdef __cplusplus
extern "C" {
#endif

#include "invoke_app_library.h"

void invoke_app_test(bool verbose);

extern mal_actor_t *provider_actor;
extern mal_actor_t *consumer_actor;

#ifdef __cplusplus
}
#endif

#endif


text:
package de.devsurf.common.lang.di;

import java.security.NoSuchAlgorithmException;

import javax.inject.Provider;
import javax.xml.bind.DatatypeConverter;

import de.devsurf.common.lang.formatter.ExceptionMessage;

public class SecureRandomProvider
    implements Provider<String> {
    private final static java.security.SecureRandom INSTANCE;

    static {
        try {
            INSTANCE = java.security.SecureRandom.getInstance( "SHA1PRNG" );
        }
        catch ( NoSuchAlgorithmException e ) {
            throw new IllegalStateException(
                                             ExceptionMessage.format( "Algorithm doesn't exists." ).addParameter( "algo",
                                                                                "SHA1PRNG" ).build() );
        }
    }

    @Override
    public String get() {
        byte bytes[] = new byte[20];
        INSTANCE.nextBytes( bytes );
        // TODO should we switch to google guava
        return DatatypeConverter.printBase64Binary( bytes );
    }
}


text:
package edu.ucsf.crosslink.processor.iterator;

import java.util.logging.Logger;

import org.apache.jena.query.QuerySolution;

import com.google.inject.Inject;
import com.google.inject.name.Named;

import edu.ucsf.crosslink.io.SparqlPersistance;
import edu.ucsf.crosslink.model.Researcher;
import edu.ucsf.crosslink.processor.BasicResearcherProcessor;
import edu.ucsf.crosslink.processor.ResearcherProcessor;
import edu.ucsf.crosslink.processor.controller.TypedOutputStats.OutputType;
import edu.ucsf.ctsi.r2r.jena.SparqlQueryClient;

public class MarengoListProcessor extends SparqlProcessor {

	private static final Logger LOG = Logger.getLogger(MarengoListProcessor.class.getName());

	private static final String RESEARCHERS_SELECT = "SELECT ?s ?r WHERE { " +
			"?s <http://marengo.info-science.uiowa.edu:2020/resource/vocab/Person_URI> ?r . FILTER (!STRENDS(?r, \"Ext\") %s) }";

	private static final String URI_AVOIDS = "&& !STRSTARTS(?r, \"%s\") ";

	private static final int LIMIT = 1000;
	private static final int RETRY = 5;

	private String[] uriAvoids = null;
	private SparqlPersistance store = null;

	// remove harvester as required item
	@Inject
	public MarengoListProcessor(SparqlPersistance store, @Named("avoids") String avoids) throws Exception {
		super(new SparqlQueryClient("http://marengo.info-science.uiowa.edu:2020/sparql", 60000, 60000), LIMIT, RETRY);
		this.store = store;
		this.uriAvoids = avoids != null ? avoids.split(",") : new String[]{};
	}

	@Override
	protected String getSparqlQuery(int offset, int limit) {
		String avoids = "";
		for (String uriAvoid : uriAvoids) {
			avoids += String.format(URI_AVOIDS, uriAvoid);
		}

		return String.format(RESEARCHERS_SELECT, avoids) +
				(limit > 0 ? String.format(" OFFSET %d LIMIT %d", offset, limit) : "");
	}

	@Override
	protected ResearcherProcessor getResearcherProcessor(QuerySolution qs) {
		return new MarengoListResearcherProcessor(qs.getResource("?s").getURI(), qs.getLiteral("?r").getString());
	}

	private class MarengoListResearcherProcessor extends BasicResearcherProcessor {

		private String marengoURI = null;
		private String affiliation = null;

		public String toString() {
			return super.toString() + (affiliation != null ? " from " + affiliation : "");
		}

		private MarengoListResearcherProcessor(String marengoURI, String researcherURI) {
			super(researcherURI);
			this.marengoURI = marengoURI;
		}

		public OutputType processResearcher() throws Exception {
			// this should not be necessary
			if (marengoURI.endsWith("Ext") || getResearcherURI().endsWith("Ext")) {
				return OutputType.SKIPPED;
			}
			else {
				Researcher researcher = createResearcher();
				researcher.setAffiliation(store.findAffiliationFor(getResearcherURI()));
				//researcher.setHarvester(MarengoListCrawler.this);
				// set this now that we know it
				String affiliation = researcher.getAffiliation().toString();

				// TODO lame!
//				if (getCrawler() != null) {
//					DELETE {<http://msu.vivo.ctr-in.org/individual/n1793366517> <http://ucsf.edu/ontology/r2r#crawledBy> ?c .
//						?c ?p ?o}
//						WHERE {
//						<http://msu.vivo.ctr-in.org/individual/n1793366517> <http://ucsf.edu/ontology/r2r#crawledBy> ?c .
//						?c <http://www.w3.org/2000/01/rdf-schema#label> "MarengoList"^^<http://www.w3.org/2001/XMLSchema#string>}				}
//				}
				store.startTransaction();
				store.execute(String.format(DELETE_PRIOR_PROCESS_LOG, getResearcherURI(), getCrawler().getURI()));
				store.update(researcher);
				store.endTransaction();
				return OutputType.PROCESSED;
			}
		}
	}
}


text:
<?php

/**
 * UserTable
 *
 * This class has been auto-generated by the Doctrine ORM Framework
 */
class UserTable extends Doctrine_Table
{
    /**
     * Returns an instance of this class.
     *
     * @return object UserTable
     */
    public static function getInstance()
    {
        return Doctrine_Core::getTable('User');
    }

    /**
     * Verifica se um usuário existe pelo seu usuário e senha
     *
     * @param string $login Login do usuário
     * @param string $pass  Senha do usuário
     *
     * @return Mixed[Boolean/Doctrine_Record]
     */
    public function findByLoginPass($login, $pass)
    {
      // cria a consulta dql
      $q = Doctrine_Query::create()
            ->select('*')
            ->from('User')
            ->where('login = ? and pass = ? and active = ?', array($login, md5($pass),'1'));

      // executa a consulta
      $rs = $q->execute();

      // se o registro existir
      if ($rs)
      {
        // rertona o primeiro registro (único)
        $rs = $rs->getFirst();
      }

      return $rs;
    }
}


text:
class MarketingController < ApplicationController

  before_action :authenticate_user!
  after_action :verify_authorized

  def index
    @people = Person.has_email
    authorize @people
  end

end


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/menu_date"
        android:orderInCategory="100"
        android:showAsAction="always"
        android:title="Date and Time" />
    <item
        android:id="@+id/menu_location"
        android:orderInCategory="100"
        android:showAsAction="never"
        android:title="Location" />
    <item
        android:id="@+id/menu_sleep"
        android:orderInCategory="100"
        android:showAsAction="never"
        android:title="Sleep" />
</menu>


text:
.class Landroid/app/Activity$FlymeUpdateStatusBarTintRunnable;
.super Ljava/lang/Object;
.source "Activity.java"

# interfaces
.implements Ljava/lang/Runnable;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/app/Activity;
.end annotation

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

# instance fields
.field final synthetic this$0:Landroid/app/Activity;

# direct methods
.method constructor <init>(Landroid/app/Activity;)V
    .locals 0

    .prologue
    .line 6297
    iput-object p1, p0, Landroid/app/Activity$FlymeUpdateStatusBarTintRunnable;->this$0:Landroid/app/Activity;

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

    return-void
.end method

.method private getInternalDimensionSize(Landroid/content/res/Resources;Ljava/lang/String;)I
    .locals 4
    .param p1, "res"    # Landroid/content/res/Resources;
    .param p2, "key"    # Ljava/lang/String;

    .prologue
    .line 6337
    const/4 v1, 0x0

    .line 6338
    .local v1, "result":I
    const-string v2, "dimen"

    const-string v3, "android"

    invoke-virtual {p1, p2, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

    move-result v0

    .line 6339
    .local v0, "resourceId":I
    if-lez v0, :cond_0

    .line 6340
    invoke-virtual {p1, v0}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result v1

    .line 6343
    :cond_0
    return v1
.end method

.method private setupStatusBarTint()V
    .locals 12

    .prologue
    const/4 v8, 0x1

    const/4 v9, 0x0

    .line 6306
    iget-object v10, p0, Landroid/app/Activity$FlymeUpdateStatusBarTintRunnable;->this$0:Landroid/app/Activity;

    invoke-virtual {v10}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v10

    invoke-virtual {v10}, Landroid/view/Window;->getAttributes()Landroid/view/WindowManager$LayoutParams;

    move-result-object v1

    .line 6307
    .local v1, "attrs":Landroid/view/WindowManager$LayoutParams;
    iget v10, v1, Landroid/view/WindowManager$LayoutParams;->systemUiVisibility:I

    iget v11, v1, Landroid/view/WindowManager$LayoutParams;->subtreeSystemUiVisibility:I

    or-int v6, v10, v11

    .line 6308
    .local v6, "sysUiVisibility":I
    and-int/lit8 v10, v6, 0x4

    if-nez v10, :cond_1

    and-int/lit16 v10, v6, 0x400

    if-nez v10, :cond_1

    const/high16 v10, 0x40000000    # 2.0f

    and-int/2addr v10, v6

    if-nez v10, :cond_1

    iget v10, v1, Landroid/view/WindowManager$LayoutParams;->flags:I

    and-int/lit16 v10, v10, 0x400

    if-nez v10, :cond_1

    iget v10, v1, Landroid/view/WindowManager$LayoutParams;->flags:I

    const/high16 v11, 0x4000000

    and-int/2addr v10, v11

    if-nez v10, :cond_1

    iget v10, v1, Landroid/view/WindowManager$LayoutParams;->flags:I

    const/high16 v11, -0x80000000

    and-int/2addr v10, v11

    if-eqz v10, :cond_1

    move v4, v8

    .line 6315
    .local v4, "show":Z
    :goto_0
    if-nez v4, :cond_2

    .line 6334
    :cond_0
    :goto_1
    return-void

    .end local v4    # "show":Z
    :cond_1
    move v4, v9

    .line 6308
    goto :goto_0

    .line 6318
    .restart local v4    # "show":Z
    :cond_2
    iget-object v10, p0, Landroid/app/Activity$FlymeUpdateStatusBarTintRunnable;->this$0:Landroid/app/Activity;

    invoke-virtual {v10}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;

    move-result-object v10

    invoke-virtual {v10}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v10

    iget v3, v10, Landroid/util/DisplayMetrics;->density:F

    .line 6319
    .local v3, "scale":F
    const-string/jumbo v0, "status_bar_height"

    .line 6320
    .local v0, "STATUS_BAR_HEIGHT_RES_NAME":Ljava/lang/String;
    iget-object v10, p0, Landroid/app/Activity$FlymeUpdateStatusBarTintRunnable;->this$0:Landroid/app/Activity;

    invoke-virtual {v10}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;

    move-result-object v10

    invoke-direct {p0, v10, v0}, Landroid/app/Activity$FlymeUpdateStatusBarTintRunnable;->getInternalDimensionSize(Landroid/content/res/Resources;Ljava/lang/String;)I

    move-result v5

    .line 6321
    .local v5, "statusBarHeight":I
    const/high16 v10, 0x40000000    # 2.0f

    mul-float/2addr v10, v3

    const/high16 v11, 0x3f000000    # 0.5f

    add-float/2addr v10, v11

    float-to-int v10, v10

    add-int v7, v5, v10

    .line 6322
    .local v7, "topShift":I
    iget-object v10, p0, Landroid/app/Activity$FlymeUpdateStatusBarTintRunnable;->this$0:Landroid/app/Activity;

    invoke-virtual {v10}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v10

    invoke-virtual {v10}, Landroid/view/Window;->getDecorView()Landroid/view/View;

    move-result-object v10

    invoke-static {v10, v7}, Landroid/app/Activity$FlymeInject;->getAutomaticColor(Landroid/view/View;I)Ljava/lang/Integer;

    move-result-object v2

    .line 6323
    .local v2, "color":Ljava/lang/Integer;
    if-eqz v2, :cond_4

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

    move-result v10

    invoke-static {v10}, Landroid/graphics/Color;->alpha(I)I

    move-result v10

    const/16 v11, 0xff

    if-ne v10, v11, :cond_0

    .line 6327
    iget-object v10, p0, Landroid/app/Activity$FlymeUpdateStatusBarTintRunnable;->this$0:Landroid/app/Activity;

    invoke-virtual {v10}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v10

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

    move-result v11

    invoke-virtual {v10, v11}, Landroid/view/Window;->setStatusBarColor(I)V

    .line 6329
    iget-object v10, p0, Landroid/app/Activity$FlymeUpdateStatusBarTintRunnable;->this$0:Landroid/app/Activity;

    invoke-virtual {v10}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v10

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

    move-result v11

    invoke-static {v11}, Landroid/app/Activity$FlymeInject;->isDark(I)Z

    move-result v11

    if-nez v11, :cond_3

    :goto_2
    invoke-static {v10, v8}, Landroid/app/Activity$FlymeInject;->setStatusBarDarkIcon(Landroid/view/Window;Z)V

    goto :goto_1

    :cond_3
    move v8, v9

    goto :goto_2

    .line 6332
    :cond_4
    iget-object v8, p0, Landroid/app/Activity$FlymeUpdateStatusBarTintRunnable;->this$0:Landroid/app/Activity;

    invoke-virtual {v8}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v8

    invoke-static {v8, v9}, Landroid/app/Activity$FlymeInject;->setDrawsSystemBarBackgrounds(Landroid/view/Window;Z)V

    goto :goto_1
.end method

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

    .prologue
    .line 6301
    invoke-direct {p0}, Landroid/app/Activity$FlymeUpdateStatusBarTintRunnable;->setupStatusBarTint()V

    .line 6302
    return-void
.end method


text:
package main

import (
	//	"fmt"
	"github.com/julienschmidt/httprouter"
	"github.com/rs/cors"
	"log"
	"moviesapp/controllers"
	"moviesapp/logging"
	"moviesapp/models"

	"net/http"
	"os"
)

func main() {
	models.InitDB()
	router := httprouter.New()
	router.GET("/movies", controllers.GetMovies)
	router.POST("/movie", controllers.NewMovie)
	router.GET("/movie/:id", controllers.GetMovieById)
	router.POST("/movie/:id/edit", controllers.UpdateMovie)
	router.DELETE("/movie/:id", controllers.DeleteMovie)
	router.POST("/login", controllers.Login)
	router.POST("/register", controllers.Register)
	//handler := cors.Default().Handler(router)
	c := cors.New(cors.Options{
		AllowedOrigins:   []string{"*"},
		AllowCredentials: true,
		AllowedMethods:   []string{"GET", "POST", "DELETE"},
		AllowedHeaders:   []string{"Authorization", "Content-Type"},
		//ExposedHeaders:   []string{"*"},
		//	Debug:            true,
	})
	handler := c.Handler(router)
	loggingHandler := logging.NewApacheLoggingHandler(handler, os.Stderr)
	server := &http.Server{
		Addr:    ":8080",
		Handler: loggingHandler,
	}
	//err := http.ListenAndServe(":8080", router)
	err := server.ListenAndServe()
	if err != nil {
		log.Panic("ListenAndServeErr: ", err)
	}

}