text:
/* LayerSlider Rounded Flat Skin */

/*Change hover colors here*/

.ls-roundedflat .ls-nav-prev:hover,
.ls-roundedflat .ls-nav-next:hover {
	background-color: #e74c3c !important;
}

.ls-roundedflat .ls-bottom-slidebuttons a.ls-nav-active,
.ls-roundedflat .ls-bottom-slidebuttons a:hover {
	background: #e74c3c !important;
}
/**/

.ls-roundedflat .ls-button{
  text-decoration: none !important;
  color:#fff;
  background-color: rgba(0,0,0,0.7);
  border-radius: 2px;
  padding:14px 25px;
}

.ls-roundedflat .ls-button:hover{
	background: #e74c3c !important;
}

.ls-roundedflat .ls-playvideo {
  width: 50px;
  height: 50px;
  margin-left: -29px;
  margin-top: -29px;
  background: rgba(0, 0, 0, 0.7) none repeat scroll 0 0;
  border: 4px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
}

.ls-roundedflat .ls-playvideo:before {
  position: absolute;
  top:16px;
  left:20px;
  display: block;
	width: 0;
  height: 0;
  border-style: solid;
  border-width: 9px 0 9px 14px;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  content: "";
}

.ls-roundedflat .ls-playvideo:hover:before{
  border-color: transparent transparent transparent rgba(255, 255, 255, 1);
}

.ls-roundedflat .ls-playvideo:hover {
	background: rgba(0,0,0,1);
	border: 4px solid rgba(255, 255, 255, 1);
}

.ls-roundedflat .ls-nav-prev,
.ls-roundedflat .ls-nav-next {
  transition: background 0.15s !important;
  display:block !importan;
}

.ls-roundedflat .ls-nav-prev {
  transform-origin: 0% 50% 0;
}

.ls-roundedflat .ls-nav-next {
  transform-origin: 100% 50% 0;
}

.ls-roundedflat .ls-nav-prev:hover,
.ls-roundedflat .ls-nav-next:hover {
	background-color: #e74c3c;
}

.ls-roundedflat .ls-nav-prev:before,
.ls-roundedflat .ls-nav-prev:after,
.ls-roundedflat .ls-nav-next:before,
.ls-roundedflat .ls-nav-next:after{
	width: 5px;
  height: 15px;
  border-radius:2px;
  left:32px;
  position: absolute;
  top:16px;
  display: block;
  transform: rotate(-40deg);
  transform-origin: 50% 100% 0;
  transition: transform 0.15s !important;
  -webkit-transform: rotate(-40deg);
  -webkit-transform-origin: 50% 100% 0;
  -webkit-transition: -webkit-transform 0.15s !important;
  content: "";
  background-color: #fff;
}

.ls-roundedflat .ls-nav-prev:before{
  top:29px;
  left:22px;
  transform-origin: 50% 0% 0;
  -webkit-transform-origin: 50% 0% 0;
}

.ls-roundedflat .ls-nav-prev:after{
  left:22px;
  transform-origin: 50% 100% 0;
  transform: rotate(40deg);
  -webkit-transform-origin: 50% 100% 0;
  -webkit-transform: rotate(40deg);
}

.ls-roundedflat .ls-nav-next:after{
  top:29px;
  transform-origin: 50% 0% 0;
  transform: rotate(40deg);
  -webkit-transform-origin: 50% 0% 0;
  -webkit-transform: rotate(40deg);
}

.ls-roundedflat .ls-nav-prev:active:before{
  transform: translateX(-3px) rotate(-60deg);
  -webkit-transform: translateX(-3px) rotate(-60deg);
}

.ls-roundedflat .ls-nav-prev:active:after{
  transform: translateX(-3px) rotate(60deg);
  -webkit-transform: translateX(-3px) rotate(60deg);
}

.ls-roundedflat .ls-nav-next:active:before{
  transform: translateX(3px) rotate(-60deg);
  -webkit-transform: translateX(3px) rotate(-60deg);
}

.ls-roundedflat .ls-nav-next:active:after{
  transform: translateX(3px) rotate(60deg);
  -webkit-transform: translateX(3px) rotate(60deg);
}

.ls-roundedflat .ls-nav-start{
  position: relative;
}

.ls-roundedflat .ls-nav-start:before {
  position: absolute;
  top:5px;
  left:9px;
  display: block;
	width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.7);
  content: "";
}

.ls-roundedflat .ls-nav-start-active:before,
.ls-roundedflat .ls-nav-start:hover:before{
  border-color: transparent transparent transparent rgba(255, 255, 255, 1);
}

.ls-roundedflat .ls-nav-stop {
  position: relative;
}

.ls-roundedflat .ls-nav-stop:before {
  position: absolute;
  top:5px;
  left:9px;
  display: block;
	width: 3px;
  height: 10px;
  border: 2px solid rgba(255,255,255,0.7);
  border-top: none;
  border-bottom: none;
  content: "";
  -webkit-box-sizing: content-box;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
}

.ls-roundedflat .ls-nav-stop:hover:before,
.ls-roundedflat .ls-nav-stop-active:before {
  border-color: rgba(255,255,255,1);
}

.ls-roundedflat .ls-bottom-slidebuttons{
  vertical-align: middle;
}

/* paginators background color*/

.ls-roundedflat .ls-bottom-slidebuttons a {
	background: rgba(0,0,0,0.7);
	margin-right:8px;
  text-align: center;
  text-decoration: none;
  -webkit-border-radius: 50%;
  border-radius:50%;
  -webkit-transition: background-color 1.2s ease;
  transition: background-color 1.2s ease;
}

.ls-roundedflat .ls-bottom-slidebuttons a:before{
  font-family: "Lato";
  font-size: 12px;
  color:#ffffff;
  line-height:10px;
}

.ls-roundedflat .ls-bottom-slidebuttons a.ls-nav-active,
.ls-roundedflat .ls-bottom-slidebuttons a:hover {
	background: #e74c3c;
}

.ls-roundedflat .ls-bottom-slidebuttons a.ls-nav-active:before,
.ls-roundedflat .ls-bottom-slidebuttons a:hover:before{
  color:#000;
}

.ls-roundedflat .ls-nav-prev,
.ls-roundedflat .ls-nav-next {
	width: 60px;
	height: 60px;
	z-index: 10000;
	top: 50%;
	margin-top: -30px;
	background: rgba(0,0,0,0.7);
	position: absolute;
	border-radius:2px;
}

.ls-roundedflat .ls-nav-prev {
	left: 20px;
}

.ls-roundedflat .ls-nav-next {
	right: 20px;
}

.ls-roundedflat .ls-bottom-slidebuttons,
.ls-roundedflat .ls-bottom-slidebuttons a,
.ls-roundedflat .ls-nav-start,
.ls-roundedflat .ls-nav-stop {
	height: 10px;
}

.ls-roundedflat .ls-bottom-slidebuttons,
.ls-roundedflat .ls-bottom-slidebuttons a,
.ls-roundedflat .ls-nav-start,
.ls-roundedflat .ls-nav-stop{
	display: inline-block;
}

.ls-roundedflat .ls-bottom-slidebuttons,
.ls-roundedflat .ls-nav-start,
.ls-roundedflat .ls-nav-stop{
	top: -35px;
}

.ls-roundedflat .ls-nav-start,
.ls-roundedflat .ls-nav-stop {
	width: 25px;
	margin-right:8px;
  top: -33px;
}

.ls-roundedflat .ls-bottom-slidebuttons a {
	width: 10px;
}

.ls-roundedflat .ls-nav-sides {
	width: 0px;
}

.ls-roundedflat .ls-thumbnail-hover {
	bottom: 15px;
	padding: 4px;
	margin-left: 1px;
}

.ls-roundedflat .ls-thumbnail-hover-bg {
	background: rgba(255,255,255,0.7);
	border-radius:2px;
}

.ls-roundedflat .ls-thumbnail-hover span {
	border: 5px solid rgba(255,255,255,0.7);
	margin-left: -5px;
}

.ls-roundedflat .ls-thumbnail {
	top: 10px;
}

.ls-roundedflat .ls-thumbnail-inner {
	padding: 4px;
	margin-left: -2px;
	background: #fff;
}

.ls-roundedflat .ls-thumbnail-slide a {
	margin-right: 2px;
}

.ls-roundedflat .ls-nothumb {
	background: #eee;
}

.ls-roundedflat .ls-loading-container {
  display: inline-block;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  margin-top: -15px;
  position: relative;
  border: 4px solid rgba(0,0,0,0.7);
  top: 50%;
  -webkit-animation: loader 2s infinite ease;
  -moz-animation: loader 2s infinite ease;
  animation: loader 2s infinite ease;
}

.ls-roundedflat .ls-loading-indicator  {
  vertical-align: top;
  display: inline-block;
  width: 100%;
  background-color: rgba(0,0,0,0.7);
  -webkit-animation: loader-inner 2s infinite ease-in;
  -moz-animation: loader-inner 2s infinite ease-in;
  animation: loader-inner 2s infinite ease-in;
}

@-webkit-keyframes loader {
  0% {
    -webkit-transform: rotate(0deg);
  }
  25% {
    -webkit-transform: rotate(180deg);
  }
  50% {
    -webkit-transform: rotate(180deg);
  }
  75% {
    -webkit-transform: rotate(360deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
  }
}

@-moz-keyframes loader {
  0% {
    -moz-transform: rotate(0deg);
  }
  25% {
    -moz-transform: rotate(180deg);
  }
  50% {
    -moz-transform: rotate(180deg);
  }
  75% {
    -moz-transform: rotate(360deg);
  }
  100% {
    -moz-transform: rotate(360deg);
  }
}

@keyframes loader {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(180deg);
  }
  50% {
    transform: rotate(180deg);
  }
  75% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@-webkit-keyframes loader-inner {
  0% {
    height: 0%;
  }
  25% {
    height: 0%;
  }
  50% {
    height: 100%;
  }
  75% {
    height: 100%;
  }
  100% {
    height: 0%;
  }
}

@-moz-keyframes loader-inner {
  0% {
    height: 0%;
  }
  25% {
    height: 0%;
  }
  50% {
    height: 100%;
  }
  75% {
    height: 100%;
  }
  100% {
    height: 0%;
  }
}

@keyframes loader-inner {
  0% {
    height: 0%;
  }
  25% {
    height: 0%;
  }
  50% {
    height: 100%;
  }
  75% {
    height: 100%;
  }
  100% {
    height: 0%;
  }
}

.ls-roundedflat .ls-circle-timer {
  top: 16px;
  right: 16px;
  width: 24px;
  height: 24px;
}

.ls-roundedflat .ls-ct-half,
.ls-roundedflat .ls-ct-center {
  border-width: 2px;
}


text:
package org.apache.carbondata.spark.testsuite.dataload

import org.apache.spark.sql.common.util.QueryTest
import org.scalatest.BeforeAndAfterAll

class TestLoadDataWithFileHeaderException extends QueryTest with BeforeAndAfterAll{
  override def beforeAll {
    sql("DROP TABLE IF EXISTS t3")
    sql("""
           CREATE TABLE IF NOT EXISTS t3
           (ID Int, date Timestamp, country String,
           name String, phonetype String, serialname String, salary Int)
           STORED BY 'carbondata'
           """)
  }

  test("test load data both file and ddl without file header exception") {
    try {
      sql(s"""
           LOAD DATA LOCAL INPATH '$resourcesPath/windows.csv' into table t3
           """)
      assert(false)
    } catch {
      case e: Exception =>
        assert(e.getMessage.contains("CSV header in input file is not proper. Column names in schema and csv header are not the same."))
    }
  }

  test("test load data ddl provided  wrong file header exception") {
    try {
      sql(s"""
           LOAD DATA LOCAL INPATH '$resourcesPath/windows.csv' into table t3
           options('fileheader'='no_column')
           """)
      assert(false)
    } catch {
      case e: Exception =>
        assert(e.getMessage.contains("CSV header in DDL is not proper. Column names in schema and CSV header are not the same"))
    }
  }

  override def afterAll {
    sql("DROP TABLE IF EXISTS t3")
  }
}

redpajama_set_name: RedPajamaGithub


text:
package org.spongepowered.common.mixin.tileentityactivation;

import net.minecraft.tileentity.TileEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.common.mixin.plugin.entityactivation.interfaces.ActivationCapability;

@Mixin(TileEntity.class)
public class TileEntityMixin_Activation implements ActivationCapability {

    private boolean tileActivationImpl$refreshCache = false;
    private boolean tileActivationImpl$defaultActivationState = true;
    private long tileActivationImpl$activatedTick = Integer.MIN_VALUE;
    private int tileActivationImpl$activationRange;
    private int tileActivationImpl$ticksExisted;
    private int tileActivationImpl$tickRate = 1;

    @Override
    public final void activation$incrementSpongeTicksExisted() {
        this.tileActivationImpl$ticksExisted++;
    }

    @Override
    public int activation$getSpongeTicksExisted() {
        return this.tileActivationImpl$ticksExisted;
    }

    @Override
    public void activation$inactiveTick() {
    }

    @Override
    public byte activation$getActivationType() {
        return 0;
    }

    @Override
    public long activation$getActivatedTick() {
        return this.tileActivationImpl$activatedTick;
    }

    @Override
    public boolean activation$getDefaultActivationState() {
        return this.tileActivationImpl$defaultActivationState;
    }

    @Override
    public void activation$setDefaultActivationState(boolean defaultState) {
        this.tileActivationImpl$defaultActivationState = defaultState;
    }

    @Override
    public void activation$setActivatedTick(long tick) {
        this.tileActivationImpl$activatedTick = tick;
    }

    @Override
    public int activation$getSpongeTickRate() {
        return this.tileActivationImpl$tickRate;
    }

    @Override
    public void activation$setSpongeTickRate(int tickRate) {
        this.tileActivationImpl$tickRate = tickRate;
    }

    @Override
    public int activation$getActivationRange() {
        return this.tileActivationImpl$activationRange;
    }

    @Override
    public void activation$setActivationRange(int range) {
        this.tileActivationImpl$activationRange = range;
    }

    @Override
    public void activation$requiresActivationCacheRefresh(boolean flag) {
        this.tileActivationImpl$refreshCache = flag;
    }

    @Override
    public boolean activation$requiresActivationCacheRefresh() {
        return this.tileActivationImpl$refreshCache;
    }
}


text:
using System;
using System.Net.Sockets;

namespace NetworkDiagnostics
{
    internal class PortChecker
    {
        public bool CheckPort(int userPort) // check if port is open
        {
            try
            {
                TcpClient client = new TcpClient("127.0.0.1", userPort); // attempt to connect
                return true;
            }
            catch (Exception ex)
            {
                if (ex is SocketException)
                {
                    return false;
                }

                if (ex is ArgumentOutOfRangeException)
                {
                    Console.WriteLine("Port number out of range.");
                    Console.ReadKey();
                    Environment.Exit(0);
                }

                throw;
            }
        }
    }
}


text:
package com.jetbrains.edu.learning.ui;

import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowFactory;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentManager;
import com.jetbrains.edu.learning.StudySettings;
import com.jetbrains.edu.learning.StudyTaskManager;
import com.jetbrains.edu.learning.StudyUtils;
import com.jetbrains.edu.learning.courseFormat.Course;
import icons.EducationalCoreIcons;
import org.jetbrains.annotations.NotNull;

public class StudyToolWindowFactory implements ToolWindowFactory, DumbAware {
  public static final String STUDY_TOOL_WINDOW = "Task Description";

  @Override
  public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
    toolWindow.setIcon(EducationalCoreIcons.TaskDescription);
    final Course course = StudyTaskManager.getInstance(project).getCourse();
    if (course != null) {
      final StudyToolWindow studyToolWindow;
      if (StudyUtils.hasJavaFx() && StudySettings.getInstance().shouldUseJavaFx()) {
        studyToolWindow = new StudyJavaFxToolWindow();
      }
      else {
        studyToolWindow = new StudySwingToolWindow();
      }
      studyToolWindow.init(project, true);
      final ContentManager contentManager = toolWindow.getContentManager();
      final Content content = contentManager.getFactory().createContent(studyToolWindow, null, false);
      contentManager.addContent(content);
      Disposer.register(project, studyToolWindow);
    }
  }
}


text:
<?php

namespace Zephir\Statements\Let;

use Zephir\CompilationContext;
use Zephir\CompilerException;
use Zephir\Variable as ZephirVariable;
use Zephir\Detectors\ReadDetector;
use Zephir\Expression;
use Zephir\CompiledExpression;
use Zephir\Compiler;
use Zephir\Utils;
use Zephir\Statements\LetStatement;

/**
 * ExportSymbol
 *
 * Exports a symbol to the current PHP symbol table using a variable as parameter
 */
class ExportSymbol
{
    /**
     * Compiles {var} = {expr}
     *
     * @param string $variable
     * @param ZephirVariable $symbolVariable
     * @param CompiledExpression $resolvedExpr
     * @param CompilationContext $compilationContext,
     * @param array $statement
     */
    public function assign($variable, ZephirVariable $symbolVariable, CompiledExpression $resolvedExpr, CompilationContext $compilationContext, $statement)
    {
        $codePrinter = $compilationContext->codePrinter;

        $variable = $compilationContext->symbolTable->getTempVariable('variable', $compilationContext, $statement);
        $variable->setMustInitNull(true);

        $letStatement = new LetStatement(array(
            'type' => 'let',
            'assignments' => array(
                array(
                    'assign-type' => 'variable',
                    'variable' => $variable->getName(),
                    'operator' => 'assign',
                    'expr' => array(
                        'type'  => $resolvedExpr->getType(),
                        'value' => $resolvedExpr->getCode(),
                        'file'  => $statement['file'],
                        'line'  => $statement['line'],
                        'char'  => $statement['char'],
                    ),
                    'file'  => $statement['file'],
                    'line'  => $statement['line'],
                    'char'  => $statement['char'],
                )
            )
        ));
        $letStatement->compile($compilationContext);

        $codePrinter->output('if (zephir_set_symbol(' . $symbolVariable->getName() . ', ' . $variable->getName() . ' TSRMLS_CC) == FAILURE){');
        $codePrinter->output("\t" . 'return;');
        $codePrinter->output('}');
    }
}


text:
import praw
import time
import datetime
import sqlite3

'''USER CONFIGURATION'''

APP_ID = ""
APP_SECRET = ""
APP_URI = ""
APP_REFRESH = ""
# https://www.reddit.com/comments/3cm1p8/how_to_make_your_bot_use_oauth2/
USERAGENT = ""
#This is a short description of what the bot does. For example "/u/GoldenSights' Newsletter Bot".
SUBREDDIT = "GoldTesting"
#This is the sub or list of subs to scan for new posts. For a single sub, use "sub1". For multiple subreddits, use "sub1+sub2+sub3+..."
MAXPOSTS = 30
#This is how many posts you want to retrieve all at once. PRAW can download 100 at a time.
WAIT = 30
#This is how many seconds you will wait between cycles. The bot is completely inactive during this time.
DELAY = 300
#This is the time, IN SECONDS, the user has to make his comment. If he does not have a source by this time, post is removed.
MESSAGE = "You have not made a comment within the timelimit. Your post has been removed. Contact the moderators if you believe this was done in error"
#This is what the bot tells you when your post gets removed. Uses reddit's usual Markdown formatting
IGNOREMODS = False
#Do you want the bot to ignore posts made by moderators? Use True or False (With capitals! No quotations!)
IGNORESELFPOST = True
#Do you want the bot to ignore selfposts?
'''All done!'''

WAITS = str(WAIT)
try:
    import bot
    USERAGENT = bot.getaG()
except ImportError:
    pass

sql = sqlite3.connect('sql.db')
print('Loaded SQL Database')
cur = sql.cursor()
cur.execute('CREATE TABLE IF NOT EXISTS oldposts(id TEXT)')
print('Loaded Oldposts')
sql.commit()

r = praw.Reddit(USERAGENT)
r.set_oauth_app_info(APP_ID, APP_SECRET, APP_URI)
r.refresh_access_information(APP_REFRESH)

def getTime(bool):
	timeNow = datetime.datetime.now(datetime.timezone.utc)
	timeUnix = timeNow.timestamp()
	if bool is False:
		return timeNow
	else:
		return timeUnix

def scan():
	print('Scanning ' + SUBREDDIT)
	subreddit = r.get_subreddit(SUBREDDIT)
	moderators = subreddit.get_moderators()
	mods = []
	for moderator in moderators:
		mods.append(moderator.name)
	posts = subreddit.get_new(limit=MAXPOSTS)
	for post in posts:
		found = False
		pid = post.id
		try:
			pauthor = post.author.name
		except AttributeError:
			pauthor = '[deleted]'
		ptime = post.created_utc
		curtime = getTime(True)

		cur.execute('SELECT * FROM oldposts WHERE id="%s"' % pid)
		if not cur.fetchone():
			if post.is_self is False or IGNORESELFPOST is False:
				if pauthor not in mods or IGNOREMODS is False:
					difference = curtime - ptime
					if difference > DELAY:
						print(pid + ', ' + pauthor + ': Finding comments')
						comments = praw.helpers.flatten_tree(post.comments)
						for comment in comments:
							try:
								cauthor = comment.author.name
							except AttributeError:
								cauthor = '[deleted]'
							if cauthor == pauthor and found is False:
								print('\tFound comment by OP')
								found = True
						if found is False:
							print('\tComments were empty, or OP was not found. Post will be removed.')
							response = post.add_comment(MESSAGE)
							response.distinguish()
							post.remove(spam=False)
							print('\tPost removed')
							time.sleep(5)

						cur.execute('INSERT INTO oldposts VALUES("%s")' % pid)
					else:
						differences = str('%.0f' % (DELAY - difference))
						print(pid + ', ' + pauthor + ': Still has ' + differences + 's.')

				if pauthor in mods and IGNOREMODS is True:
					print(pid + ', ' + pauthor + ': Ignoring Moderator')
					cur.execute('INSERT INTO oldposts VALUES("%s")' % pid)

			if post.is_self is True and IGNORESELFPOST is True:
				print(pid + ', ' + pauthor + ': Ignoring Selfpost')
				cur.execute('INSERT INTO oldposts VALUES("%s")' % pid)

		sql.commit()

while True:
	try:
		scan()
	except Exception as e:
		print('An error has occured:', e)
	print('Running again in ' + WAITS + ' seconds.\n')
	time.sleep(WAIT)


text:
//
//  MeasurementBar.m
//  Carat
//
//  Created by Jarno Petteri Laitinen on 07/10/15.
//  Copyright © 2015 University of Helsinki. All rights reserved.
//

#import "MeasurementBar.h"
#import "AppColors.h"

@interface MeasurementBar ()
@property (nonatomic, strong) UIView *containerView;
@property (nonatomic, strong) NSMutableArray *customConstraints;
@end

@implementation MeasurementBar{
    UIImage *_measureTopImg;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        [self commonInit];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self commonInit];
    }
    return self;
}

- (void)commonInit
{
    _customConstraints = [[NSMutableArray alloc] init];
    // Initialization code
    UIView *view = nil;
    _measureTopImg = [UIImage imageNamed:@"measurebar_top"];
    [self setBackgroundColor:C_LIGHT_GRAY];

    /*
     NSArray *objects = [[NSBundle mainBundle] loadNibNamed:@"DashboardNavigationButton"
     owner:self
     options:nil];
     for (id object in objects) {
     if ([object isKindOfClass:[UIView class]]) {
     view = object;
     break;
     }
     }
     */
    if (view != nil) {
        _containerView = view;
        view.translatesAutoresizingMaskIntoConstraints = NO;
        [self addSubview:view];
        [self setNeedsUpdateConstraints];
    }

}

- (void)drawRect:(CGRect)rect
{
    //[super drawRect:rect];
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    if(_largerMeasureValue > 0){
        CGRect rectangle = [self getDrawRectangle:_largerMeasureValue];
        CGContextSetFillColor(ctx, CGColorGetComponents([_largerBarColor CGColor]));
        CGContextSetStrokeColor(ctx, CGColorGetComponents([_largerBarColor CGColor]));
        CGContextFillRect(ctx, rectangle);
    }
    if(_smallerMeasureValue > 0){
        CGRect rectangle = [self getDrawRectangle:_smallerMeasureValue];
        CGContextSetFillColor(ctx, CGColorGetComponents([_smallerBarColor CGColor]));
        CGContextSetStrokeColor(ctx, CGColorGetComponents([_smallerBarColor CGColor]));
        CGContextFillRect(ctx, rectangle);
    }

    if(_measureTopImg != nil){
        _measureTopImg = [UIImage imageNamed:@"measurebar_top"];
    }
    CGRect imgRect = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
    [_measureTopImg drawInRect:imgRect];
}

- (void)updateConstraints
{
    [self removeConstraints:self.customConstraints];
    [self.customConstraints removeAllObjects];

    if (self.containerView != nil) {
        UIView *view = self.containerView;
        NSDictionary *views = NSDictionaryOfVariableBindings(view);

        [self.customConstraints addObjectsFromArray:
         [NSLayoutConstraint constraintsWithVisualFormat:
          @"H:|[view]|" options:0 metrics:nil views:views]];
        [self.customConstraints addObjectsFromArray:
         [NSLayoutConstraint constraintsWithVisualFormat:
          @"V:|[view]|" options:0 metrics:nil views:views]];

        [self addConstraints:self.customConstraints];
    }
    [super updateConstraints];
}

-(CGRect) getDrawRectangle:(CGFloat) value{
    CGFloat pros = value/99;
    CGFloat width = self.frame.size.width * pros;
    return CGRectMake(0, 0, width, self.frame.size.height);
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)dealloc {
    [_containerView release];
    [_customConstraints release];
    // UIImage imageNamed is autoreleased
    // [_measureTopImg release];
    [_largerBarColor release];
    [_smallerBarColor release];

    [super dealloc];
}
@end


text:
package com.lpii.evma;

import java.util.ArrayList;
import java.util.List;

import android.R.integer;
import android.app.ActionBar;
import android.app.ActionBar.OnNavigationListener;
import android.app.ActionBar.Tab;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.database.Cursor;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.AsyncTask;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.text.format.Formatter;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.lpii.evma.adapter.TitleNavigationAdapter;
import com.lpii.evma.controller.ConnectionDetector;
import com.lpii.evma.model.Event;
import com.lpii.evma.model.SpinnerNavItem;
import com.lpii.evma.view.EventsUI;
import com.lpii.evma.view.HomeStart;
import com.lpii.evma.view.LoginEv;
import com.lpii.evma.view.MyTicketUpcomingEvents;
import com.lpii.evma.view.NoEventsError;
import com.lpii.evma.view.organizer.Organizer_Events;
import com.lpii.evma.view.organizer.Organizer_event_create;

//ActionBarActivity
public class MainEv extends FragmentActivity implements OnClickListener,
		OnNavigationListener, ActionBar.TabListener {

	// Button btnLogin;

	// action bar
	private ActionBar actionBar;
	ConnectionDetector cd;
    public static int RESULT_LOAD_IMAGE = 99;
    EvmaApp mEvmaApp;

	// Title navigation Spinner data
	private ArrayList<SpinnerNavItem> navSpinner;

	// Navigation adapter
	private TitleNavigationAdapter adapter;

	// Refresh menu item
	public MenuItem refreshMenuItem;

	List<Fragment> fragList = new ArrayList<Fragment>();

	// Test
	private DrawerLayout mDrawerLayout;
	private ActionBarDrawerToggle mDrawerToggle;
	private SwipeRefreshLayout refreshLayout;
	// Test

	public static Context appContext;
	Button btnMyTickets;
	Button btnDiscover;
	Button SignOut;

	TextView tvuserName;
	Boolean isInternetPresent ;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.activity_main_ev);
		appContext = getApplicationContext();
		mEvmaApp =  (EvmaApp) getApplicationContext();
		cd = new ConnectionDetector(getApplicationContext());
		isInternetPresent = cd.isConnectingToInternet();
		btnMyTickets = (Button) findViewById(R.id.drawer_layout_my_tickets);
		btnDiscover = (Button) findViewById(R.id.drawer_layout_find_events);
		SignOut = (Button) findViewById(R.id.SignOut);
		tvuserName = (TextView) findViewById(R.id.userName);
		tvuserName.setText(EvmaApp.CurrentUser.getFull_name());
		btnDiscover.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				System.out.println("cls");
				Drawable d = getResources().getDrawable(
						R.drawable.drawer_item_selected);
				btnDiscover.setBackgroundDrawable(d);

				d = getResources().getDrawable(
						R.drawable.drawer_item_background);
				btnMyTickets.setBackgroundDrawable(d);
				EvmaApp.MyTicketsReq = false;
				CreateDefaulTabs();
				// Intent intUser = new
				// Intent(MainEv.this,user_my_tickets.class);
				// startActivity(intUser);

			}
		});

		btnMyTickets.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				System.out.println("cls");

				Drawable d = getResources().getDrawable(R.drawable.drawer_item_selected);
				btnMyTickets.setBackgroundDrawable(d);

				d = getResources().getDrawable(R.drawable.drawer_item_background);
				btnDiscover.setBackgroundDrawable(d);
				EvmaApp.MyTicketsReq = true;
				CreatemyTicketTab();
				// Intent intUser = new
				// Intent(MainEv.this,user_my_tickets.class);
				// startActivity(intUser);

			}
		});

		SignOut.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				SharedPreferences preferences = getSharedPreferences("Mypref", 0);
				preferences.edit().remove("CurrentUser").commit();
				Intent intx = new Intent(MainEv.this,HomeStart.class);
				startActivity(intx);
				}
		});

		WifiManager wifiMgr = (WifiManager) getSystemService(WIFI_SERVICE);
		WifiInfo wifiInfo = wifiMgr.getConnectionInfo();
		int ip = wifiInfo.getIpAddress();
		String ipAddress = Formatter.formatIpAddress(ip);
		System.out.println("====> " + ipAddress);

		Intent intbillet = getIntent();
		if(intbillet != null){
			if (intbillet.getStringExtra("Action") !=null) {
				Drawable d = getResources().getDrawable(R.drawable.drawer_item_selected);
				btnMyTickets.setBackgroundDrawable(d);

				d = getResources().getDrawable(R.drawable.drawer_item_background);
				btnDiscover.setBackgroundDrawable(d);
				EvmaApp.MyTicketsReq = true;
				CreatemyTicketTab();
			}

		}

		// btnLogin = (Button) findViewById(R.id.btnLogin);
		// btnLogin.setOnClickListener(this);

		actionBar = getActionBar();
		Drawable d = getResources().getDrawable(R.drawable.action_bar_bg_darawable);
		actionBar.setBackgroundDrawable(d);

		// Hide the action bar title
		actionBar.setDisplayShowTitleEnabled(false);

		// Enabling Spinner dropdown navigation
		actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);// NAVIGATION_MODE_LIST
		/*
		 * Tab tab = actionBar.newTab();
		 *
		 * tab.setText("Découvrir "); tab.setTabListener(this);
		 * actionBar.addTab(tab);
		 *
		 * tab = actionBar.newTab(); tab.setText("Mes Plans ");
		 * tab.setTabListener(this); actionBar.addTab(tab);
		 */
		// Spinner title navigation data
		navSpinner = new ArrayList<SpinnerNavItem>();
		navSpinner
				.add(new SpinnerNavItem("Local", R.drawable.ic_action_locate));
		navSpinner.add(new SpinnerNavItem("My Places",
				R.drawable.ic_action_locate));
		navSpinner
				.add(new SpinnerNavItem("Checkins", R.drawable.ic_action_send));
		navSpinner.add(new SpinnerNavItem("Latitude",
				R.drawable.ic_action_video));

		// title drop down adapter
		adapter = new TitleNavigationAdapter(getApplicationContext(),
				navSpinner);

		// assigning the spinner navigation
		actionBar.setListNavigationCallbacks(adapter, this);

		// Changing the action bar icon
		actionBar.setIcon(R.drawable.ic_launcher);

		/*
		 * refreshLayout = (SwipeRefreshLayout)
		 * findViewById(R.id.refresh_layout);
		 * refreshLayout.setOnRefreshListener(new
		 * SwipeRefreshLayout.OnRefreshListener() {
		 *
		 * @Override public void onRefresh() { new Handler().postDelayed(new
		 * Runnable() {
		 *
		 * @Override public void run() { refreshLayout.setRefreshing(false); }
		 * }, 1000); } });
		 */

		//
		mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
		mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
		mDrawerLayout, /* DrawerLayout object */
		R.drawable.ic_drawer, /* nav drawer icon to replace 'Up' caret */
		R.string.drawer_open, /* "open drawer" description */
		R.string.drawer_close /* "close drawer" description */
		);

		mDrawerLayout.setDrawerListener(mDrawerToggle);

		actionBar.setDisplayHomeAsUpEnabled(true);
		actionBar.setHomeButtonEnabled(true);

		actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
		System.out.println("CurrentOrganizer  "  + EvmaApp.CurrentOrganizer.isEmpty()  +"    CurrentUsername"  +EvmaApp.CurrentUsername );
		if (EvmaApp.helperIAMGETTIHPIC) {
			System.out.println("EvmaApp.helperIAMGETTIHPIC  " +  EvmaApp.helperIAMGETTIHPIC);
		}else{
			if (!EvmaApp.CurrentOrganizer.isEmpty()) {
				ActionBar.Tab MyEventsTab = actionBar.newTab()
						.setText("Mes Events").setTabListener(this);
				actionBar.addTab(MyEventsTab);
				ActionBar.Tab NewEventTab = actionBar.newTab().setText("Nv. Event")
						.setTabListener(this);
				actionBar.addTab(NewEventTab);
			} else if (!EvmaApp.CurrentUsername.isEmpty()) {
				ActionBar.Tab EventsTab = actionBar.newTab().setText("Découvrir")
						.setTabListener(this);
				actionBar.addTab(EventsTab);
//				ActionBar.Tab MesPlansTab = actionBar.newTab().setText("Mes plans")
//						.setTabListener(this);
//				actionBar.addTab(MesPlansTab);

			}
		}
//		Boolean isInternetPresent = cd.isConnectingToInternet();
//		if (isInternetPresent) {
//			EventsUI androidversionlist = new EventsUI();
//			getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,androidversionlist).commit();
//		}

	}

	@Override
	protected void onPostCreate(Bundle savedInstanceState) {
		super.onPostCreate(savedInstanceState);
		// Sync the toggle state after onRestoreInstanceState has occurred.
		mDrawerToggle.syncState();
	}

	@Override
	public void onConfigurationChanged(Configuration newConfig) {
		super.onConfigurationChanged(newConfig);
		mDrawerToggle.onConfigurationChanged(newConfig);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main_ev, menu);
		refreshMenuItem = (MenuItem) findViewById(R.id.action_settings);

		System.out.println("sdfsdfd-------------");
		EvmaApp.refreshMenuItemx = refreshMenuItem;
		/*
		 * Associate searchable configuration with the SearchView SearchManager
		 * searchManager = (SearchManager)
		 * getSystemService(Context.SEARCH_SERVICE); SearchView searchView =
		 * (SearchView) menu.findItem(R.id.action_search) .getActionView();
		 * searchView.setSearchableInfo(searchManager
		 * .getSearchableInfo(getComponentName()));
		 */
		return super.onCreateOptionsMenu(menu);

	}

	@Override
	public void onClick(View arg0) {
		Intent i = new Intent(MainEv.this, LoginEv.class);
		startActivity(i);

	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Take appropriate action for each action item click
		System.out.println("item" + item.getItemId());
		System.out.println("object:  " + item);

		if (mDrawerToggle.onOptionsItemSelected(item)) {
			return true;
		}
		switch (item.getItemId()) {
		case R.id.action_search:
			Intent i = new Intent(MainEv.this, LoginEv.class);
			startActivity(i);
			return true;
		case R.id.action_settings:

			refreshMenuItem = item;
			refreshMenuItem.setActionView(R.layout.action_progressbar);
			refreshMenuItem.expandActionView();
			new SyncData().execute();

			return true;
		case R.id.action_refresh:
			// refresh
			refreshMenuItem = item;
			refreshMenuItem.setActionView(R.layout.action_progressbar);
			refreshMenuItem.expandActionView();
			// load the data from server
			new SyncData().execute();
			return true;
		default:
			System.out.println("default");
			return super.onOptionsItemSelected(item);
		}
	}

	@Override
	public boolean onNavigationItemSelected(int itemPosition, long itemId) {
		// Action to be taken after selecting a spinner item
		return false;
	}

	private class SyncData extends AsyncTask<String, Void, String> {
		@Override
		protected void onPreExecute() {
			// set the progress bar view
			refreshMenuItem.setActionView(R.layout.action_progressbar);
			refreshMenuItem.expandActionView();
			System.out.println("refersh calllllled");
			if (isInternetPresent) {
				EventsUI androidversionlist = new EventsUI();
				getSupportFragmentManager()
						.beginTransaction()
						.replace(R.id.fragment_container,
								androidversionlist).commit();
			}

		}

		@Override
		protected String doInBackground(String... params) {
			try {
				Thread.sleep(3000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			return null;
		}

		@Override
		protected void onPostExecute(String result) {
			refreshMenuItem.collapseActionView();
			refreshMenuItem.setActionView(null);
		}
	}

	@Override
	public void onTabReselected(Tab tab, FragmentTransaction ft) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onTabSelected(Tab tab, FragmentTransaction ft) {
		// TODO Auto-generated method stub
		System.out.println(tab.getPosition());

		Boolean isInternetPresent = cd.isConnectingToInternet();
		if (!isInternetPresent) {
			// ft.replace(R.id.fragment_container, fragment);
			System.out.println("Not Connected...");
			NoEventsError mNoEventsError = new NoEventsError();
			getSupportFragmentManager().beginTransaction()
					.replace(R.id.fragment_container, mNoEventsError).commit();

		} else {
			if (!EvmaApp.forceGetEvent) {

			} else {

				// EvmaApp.CurrentUsername = "Ahmedx";// adm1
				// EvmaApp.CurrentUserEmail =
				// "flahweb@gmail.com";//fidaghdour@synergie-media.com
				// EvmaApp.CurrentOrganizer = "";
				// EvmaApp.CurrentUsernameID = 11;
			}
			switch (tab.getPosition()) {
			case 0:
				if (EvmaApp.CurrentOrganizer.isEmpty()
						&& !EvmaApp.MyTicketsReq
						) {
					System.out.println("get all events");
					EventsUI androidversionlist = new EventsUI();
					getSupportFragmentManager()
							.beginTransaction()
							.replace(R.id.fragment_container,
									androidversionlist).commit();
				} else if (EvmaApp.CurrentUsername.isEmpty()
						&& !EvmaApp.CurrentOrganizer.isEmpty()
						&& !EvmaApp.MyTicketsReq) {
					//EvmaApp.GlobaleventList = null;
					Organizer_Events Organizer_Eventslist = new Organizer_Events();
					getSupportFragmentManager()
							.beginTransaction()
							.replace(R.id.fragment_container,
									Organizer_Eventslist).commit();
				} else if (EvmaApp.CurrentUsername.isEmpty()
						&& !EvmaApp.CurrentOrganizer.isEmpty()
						&& EvmaApp.MyTicketsReq
						) {
					EvmaApp.MyTicketPast = false;

					MyTicketUpcomingEvents MyTicket = new MyTicketUpcomingEvents();
					getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, MyTicket).commit();
				}
				break;
			case 1:
				if (EvmaApp.CurrentOrganizer.isEmpty()
						&& !EvmaApp.CurrentUsername.isEmpty()
						&& !EvmaApp.MyTicketsReq) {
					System.out.println("get all events");
					EventsUI androidversionlist = new EventsUI();
					getSupportFragmentManager()
							.beginTransaction()
							.replace(R.id.fragment_container,
									androidversionlist).commit();
				} else if (!EvmaApp.CurrentOrganizer.isEmpty()
						&& EvmaApp.CurrentUsername.isEmpty()
						&& !EvmaApp.MyTicketsReq
						) {
					Organizer_event_create mOrganizer_Event_create = new Organizer_event_create();
//					Bundle b  = new Bundle();
//					b.putParcelable(key, value);
//					mOrganizer_Event_create.setArguments(b);
					//Organizer_Event_create.setmEvmaApp(mEvmaApp);
					getSupportFragmentManager()
							.beginTransaction()
							.replace(R.id.fragment_container,
									mOrganizer_Event_create).commit();
				} else if (!EvmaApp.CurrentUsername.isEmpty()
						&& EvmaApp.CurrentOrganizer.isEmpty()
						&& EvmaApp.MyTicketsReq) {
					System.out.println("paaaast");
					EvmaApp.MyTicketPast = true;
					MyTicketUpcomingEvents MyTicketx = new MyTicketUpcomingEvents();
					getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, MyTicketx).commit();
				}
				break;
			default:
				break;
			}

		}

		// ft.replace(R.id.fragment_container, fragment);

	}

	@Override
	public void onTabUnselected(Tab tab, FragmentTransaction ft) {
		// TODO Auto-generated method stub
		// EventsUI androidversionlist = new EventsUI();
		// getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
		// androidversionlist).commit();
		// ft.replace(R.id.fragment_container, fragment);

	}

	public void CreatemyTicketTab() {
		actionBar.removeAllTabs();
		Boolean isInternetPresent = cd.isConnectingToInternet();
		ActionBar.Tab NewEventTab = actionBar.newTab().setText("Comming Events")
				.setTabListener(this);
		actionBar.addTab(NewEventTab);
		ActionBar.Tab xNewEventTab = actionBar.newTab().setText("Past Events")
				.setTabListener(this);
		actionBar.addTab(xNewEventTab);

		if (!isInternetPresent) {
			System.out.println("Not Connected...");
			NoEventsError mNoEventsError = new NoEventsError();
			getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, mNoEventsError).commit();
		} else {
			MyTicketUpcomingEvents MyTicket = new MyTicketUpcomingEvents();
			getSupportFragmentManager().beginTransaction()
					.replace(R.id.fragment_container, MyTicket)
					.commit();
		}

	}

	public void CreateDefaulTabs() {
		actionBar.removeAllTabs();
		Boolean isInternetPresent = cd.isConnectingToInternet();
		if (!EvmaApp.CurrentOrganizer.isEmpty()) {
			ActionBar.Tab MyEventsTab = actionBar.newTab().setText("Mes Events").setTabListener(this);
			actionBar.addTab(MyEventsTab);
			ActionBar.Tab NewEventTab = actionBar.newTab().setText("Nv. Event").setTabListener(this);
			actionBar.addTab(NewEventTab);
		}else if ( EvmaApp.CurrentOrganizer.isEmpty()) {
			ActionBar.Tab EventsTab = actionBar.newTab().setText("Découvrir")
					.setTabListener(this);
			actionBar.addTab(EventsTab);
//			ActionBar.Tab MesPlansTab = actionBar.newTab().setText("Mes plans")
//					.setTabListener(this);
//			actionBar.addTab(MesPlansTab);
		}
		if (!isInternetPresent) {
			System.out.println("Not Connected...");
			NoEventsError mNoEventsError = new NoEventsError();
			getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, mNoEventsError).commit();

		} else {
			if (!EvmaApp.CurrentOrganizer.isEmpty()) {

				if (isInternetPresent) {
					Organizer_Events Organizer_Eventslist = new Organizer_Events();
					getSupportFragmentManager()
							.beginTransaction()
							.replace(R.id.fragment_container,
									Organizer_Eventslist).commit();
				}

			} else if ( EvmaApp.CurrentOrganizer.isEmpty()) {

				if (isInternetPresent) {
					EventsUI androidversionlist = new EventsUI();
					getSupportFragmentManager()
							.beginTransaction()
							.replace(R.id.fragment_container,
									androidversionlist).commit();
				}

			}
		}

	}

	@Override
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        System.out.println("onActivityResult");
		Organizer_event_create mOrganizer_Event_create = new Organizer_event_create();
		mOrganizer_Event_create.onActivityResult(requestCode, resultCode, data);
         if (requestCode == RESULT_LOAD_IMAGE && resultCode ==  RESULT_OK && null != data) {
//        	String NewEv = data.getExtras().getString("NewEv");
//            System.out.println("onActivityResult Iget it " + NewEv);
            System.out.println("resultCode  "  + resultCode);
        	Uri selectedImage = data.getData();
            String[] filePathColumn = { MediaStore.Images.Media.DATA };

            Cursor cursor =  getContentResolver().query(selectedImage,
                    filePathColumn, null, null, null);
            cursor.moveToFirst();

            int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
            String picturePath = cursor.getString(columnIndex);
            cursor.close();
			//mOrganizer_Event_create = new Organizer_event_create();

			//mEvmaApp =  (EvmaApp) getApplication();
			//mEvmaApp.helperNewEv = mEv;
			EvmaApp.helperpicturePath = picturePath;

            getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,mOrganizer_Event_create).commit();
            //OrgaImg.setImageBitmap(BitmapFactory.decodeFile(picturePath));

        }
	 }
}


text:
(
cd $(dirname "${BASH_SOURCE[0]}")
cd deps/luajit
if [[ ! -e Makefile ]]
then
	echo "ERROR: LuaJIT submodule not initialized"
	echo "Please run git submodule update --init"
	exit 1
fi
make -j 8 'CFLAGS=-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT'
make install DESTDIR=$(pwd)
cd ../dpdk
make -j 8 install T=x86_64-native-linuxapp-gcc
../../bind-interfaces.sh
cd ../../build
cmake ..
make
)


text:
var Promise = require( "bluebird" );
var fs 		= Promise.promisifyAll( require("fs") );
var path	= require('path');

var Parser 	= require("binary-parser").Parser;

// Define a parser for the board information stored on the controller board's eeprom
var eepromParser = Parser.start()
					.endianess( "little" )
					.uint32( "length" )
					.string( "data",
					{
						encoding: "utf8",
        				length: "length"
					} );

var BoardInterface = function()
{

};

BoardInterface.prototype.Compose = function( platform )
{
	// Temporary container used for cpu detection and info loading
	var board =
	{
		targetBoard: platform.board
	};

	var self = this;

	console.log( "BOARD: Composing RPI board interface..." );

	return self.LoadInfo( board )
			.then( self.LoadPinMap )
			.then( self.LoadInterface );
};

BoardInterface.prototype.LoadInfo = function( board )
{
	board.info = {};

	console.log( "BOARD: Loading board info..." );

	return fs.readFileAsync( path.resolve( "/sys/class/i2c-adapter/i2c-1/1-0054/eeprom" ) )
			.then( function( data )
			{
				return eepromParser.parse( data ).data;
			} )
			.then( JSON.parse )
			.then( function( info )
			{
				console.log( "Board info: " + JSON.stringify( info ) );

				board.info = info;
				return board;
			} );
}

BoardInterface.prototype.LoadPinMap = function( board )
{
	console.log( "BOARD: Loading pinmap..." );

	return fs.readFileAsync( path.resolve( __dirname, "boards/" + board.info.productId + "/pinmap.json" ) )
			.then( JSON.parse )
			.then( function( json )
			{
				var pinmap = json[ board.info.rev ];

				if( pinmap !== undefined )
				{
					board.pinmap = pinmap;
					return board;
				}
			} );
}

BoardInterface.prototype.LoadInterface = function( board )
{
	console.log( "BOARD: Loading board interface..." );

	require( "./boards/" + board.info.productId + "/setup.js" )( board.targetBoard );
	return board;
};

module.exports = new BoardInterface();


text:
// This file was generated by Mendix Studio Pro.
//
// WARNING: Only the following code will be retained when actions are regenerated:
// - the import list
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
// Special characters, e.g., é, ö, à, etc. are supported in comments.

package communitycommons.actions;

import communitycommons.StringUtils;
import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.webui.CustomJavaAction;

/**
 * Generates a random alphanumeric string of the desired length.
 */
public class RandomString extends CustomJavaAction<java.lang.String>
{
	private java.lang.Long length;

	public RandomString(IContext context, java.lang.Long length)
	{
		super(context);
		this.length = length;
	}

	@java.lang.Override
	public java.lang.String executeAction() throws Exception
	{
		// BEGIN USER CODE
		return StringUtils.randomString(length.intValue());
		// END USER CODE
	}

	/**
	 * Returns a string representation of this action
	 */
	@java.lang.Override
	public java.lang.String toString()
	{
		return "RandomString";
	}

	// BEGIN EXTRA CODE
	// END EXTRA CODE
}


text:
package com.planet_ink.coffee_mud.core.threads;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.net.*;
import java.io.*;
import java.nio.*;
import java.nio.channels.*;

import com.planet_ink.coffee_mud.core.collections.SLinkedList;

public class CMThreadFactory implements ThreadFactory
{
	private String 						serverName;
	private final AtomicInteger 		counter		=new AtomicInteger();
	private final SLinkedList<Thread> 	active 		= new SLinkedList<Thread>();
	private final ThreadGroup			threadGroup;

	public CMThreadFactory(final String serverName)
	{
		this.serverName=serverName;
		this.threadGroup=Thread.currentThread().getThreadGroup();
	}

	public void setServerName(final String newName)
	{
		this.serverName=newName;
	}

	@Override
	public Thread newThread(final Runnable r)
	{
		final Thread t = new CMFactoryThread(threadGroup,r,serverName+"#"+counter.addAndGet(1));
		active.add(t);
		return t;
	}

	public Collection<Thread> getThreads()
	{
		return active;
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>IBitSet (apache-cassandra API)</title>
<meta name="date" content="2014-09-07">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.apache.cassandra.utils.obs

Interface IBitSet

All Superinterfaces:

java.lang.AutoCloseable, java.io.Closeable

All Known Implementing Classes:

OffHeapBitSet, OpenBitSet

public interface IBitSet
extends java.io.Closeable

Method Summary

Methods

Modifier and Type
Method and Description

long
capacity()

void
clear()

void
clear(long index)

clears the bit.

void
close()

boolean
get(long index)

Returns true or false for the specified bit index.

void
serialize(java.io.DataOutput out)

long
serializedSize(TypeSizes type)

void
set(long index)

Sets the bit at the specified index.

Method Detail

capacity

long capacity()

get

boolean get(long index)

Returns true or false for the specified bit index. The index should be
 less than the capacity.

set

void set(long index)

Sets the bit at the specified index. The index should be less than the
 capacity.

clear

void clear(long index)

clears the bit. The index should be less than the capacity.

serialize

void serialize(java.io.DataOutput out)
               throws java.io.IOException

Throws:

java.io.IOException

serializedSize

long serializedSize(TypeSizes type)

clear

void clear()

close

void close()

Specified by:

close in interface java.lang.AutoCloseable

Specified by:

close in interface java.io.Closeable

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2014 The Apache Software Foundation


text:
Utilities for link-related CSS.
See [other utilities](https://github.com/atomic-css/utils).

Read more about [Atomic framework](https://github.com/atomic-css/atomic).

## Installation

* [__Bower:__](http://bower.io)
  `bower install --save atomic-css-utils-link`
* [__Component(1):__](http://component.io)
  `component install atomic-css/utils-link`
* __Download:__
  [zip](https://github.com/atomic-css/utils-link/zipball/master),
  [tar.gz](https://github.com/atomic-css/utils-link/tarball/master)
* __Git:__ `git clone https://github.com/atomic-css/utils-link.git`

## Available classes

* `u-linkClean` - link without any text-decoration
* `u-linkComplex` - complex link with a specified target that is underlined
* `u-linkBlock` - block-level link
* `u-linkPseudo` - button styled to look like an anchor

## Browser support

* Google Chrome (latest)
* Opera (latest)
* Firefox 4+
* Safari 5+
* Internet Explorer 8+


text:
<form class="calcite-slider" id="example1">
  <label>
   Default Range Slider
    <input type="range" min="0" max="100" value="50" step="1" aria-valuemin="0" aria-valuemax="100" aria-valuenow="50">
  </label>
</form>


text: <folder name="Initialization, general settings"/>


text:
package com.jpattern.core.chain;

/**
 *
 * @author Francesco Cina'
 *
 * 29/gen/2011
 */
public class ChainElementBlocking0010 extends AChainElementBlocking {

	private final int value;
	private final StringBuffer active;
	public static int MIN_VALUE = 0;
	public static int MAX_VALUE = 10;
	public static String NAME = "00_10";

	public ChainElementBlocking0010(int value, StringBuffer active) {
		this( value, active, new NullChainElement() );
	}

	public ChainElementBlocking0010(int value, StringBuffer active, IChainElement chain) {
		super(chain);
		this.value = value;
		this.active = active;
	}

	@Override
	public void execute() {
		active.append(NAME);
	}

	@Override
	public boolean verifyCondition() {
		return ( (value>=MIN_VALUE) && (value<=MAX_VALUE));
	}

}


text:
package example;

import java.util.Date;
import java.util.List;
import java.util.Set;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt;
import ca.uhn.fhir.model.dstu2.composite.CodingDt;
import ca.uhn.fhir.model.dstu2.composite.HumanNameDt;
import ca.uhn.fhir.model.dstu2.composite.IdentifierDt;
import ca.uhn.fhir.model.dstu2.composite.QuantityDt;
import ca.uhn.fhir.model.dstu2.composite.SimpleQuantityDt;
import ca.uhn.fhir.model.dstu2.resource.Observation;
import ca.uhn.fhir.model.dstu2.resource.Patient;
import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum;
import ca.uhn.fhir.model.dstu2.valueset.MaritalStatusCodesEnum;
import ca.uhn.fhir.model.dstu2.valueset.ObservationStatusEnum;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.parser.IParser;
import ca.uhn.fhir.rest.client.IGenericClient;

public class FhirDataModel {

   public static void datatypes() {
      // START SNIPPET: datatypes
      Observation obs = new Observation();

      // These are all equivalent
      obs.setIssued(new InstantDt(new Date()));
      obs.setIssued(new Date(), TemporalPrecisionEnum.MILLI);
      obs.setIssuedWithMillisPrecision(new Date());

      // The InstantDt also lets you work with the instant as a Java Date
      // object or as a FHIR String.
      Date date = obs.getIssuedElement().getValue(); // A date object
      String dateString = obs.getIssuedElement().getValueAsString(); // "2014-03-08T12:59:58.068-05:00"
      // END SNIPPET: datatypes

      System.out.println(date);
      System.out.println(dateString);

   }

   @SuppressWarnings("unused")
   public void nonNull() {
      // START SNIPPET: nonNull
      Observation observation = new Observation();

      // None of these calls will not return null, but instead create their
      // respective
      // child elements.
      List<IdentifierDt> identifierList = observation.getIdentifier();
      CodeableConceptDt code = observation.getCode();
      StringDt textElement = observation.getCode().getTextElement();

      // DateTimeDt is a FHIR primitive however, so the following will return
      // null
      // unless a value has been placed there.
      Date active = observation.addIdentifier().getPeriod().getStartElement().getValue();
      // END SNIPPET: nonNull

   }

   @SuppressWarnings("unused")
   public static void codes() {
      // START SNIPPET: codes
      Patient patient = new Patient();

      // You can set this code using a String if you want. Note that
      // for "closed" valuesets (such as the one used for Patient.gender)
      // you must use one of the strings defined by the FHIR specification.
      // You must not define your own.
      patient.getGenderElement().setValue("male");

      // HAPI also provides Java enumerated types which make it easier to
      // deal with coded values. This code achieves the exact same result
      // as the code above.
      patient.setGender(AdministrativeGenderEnum.MALE);

      // You can also retrieve coded values the same way
      String genderString = patient.getGenderElement().getValueAsString();
      AdministrativeGenderEnum genderEnum = patient.getGenderElement().getValueAsEnum();

      // The following is a shortcut to create
      patient.setMaritalStatus(MaritalStatusCodesEnum.M);
      // END SNIPPET: codes

   }

   @SuppressWarnings("unused")
   public static void codeableConcepts() {
      // START SNIPPET: codeableConcepts
      Patient patient = new Patient();

      // Coded types can naturally be set using plain strings
      CodingDt statusCoding = patient.getMaritalStatus().addCoding();
      statusCoding.setSystem("http://hl7.org/fhir/v3/MaritalStatus");
      statusCoding.setCode("M");
      statusCoding.setDisplay("Married");

      // You could add a second coding to the field if needed too. This
      // can be useful if you want to convey the concept using different
      // codesystems.
      CodingDt secondStatus = patient.getMaritalStatus().addCoding();
      secondStatus.setCode("H");
      secondStatus.setSystem("http://example.com#maritalStatus");
      secondStatus.setDisplay("Happily Married");

      // CodeableConcept also has a text field meant to convey
      // a user readable version of the concepts it conveys.
      patient.getMaritalStatus().setText("Happily Married");

      // There are also accessors for retrieving values
      String firstCode  = patient.getMaritalStatus().getCoding().get(0).getCode();
      String secondCode = patient.getMaritalStatus().getCoding().get(1).getCode();
      // END SNIPPET: codeableConcepts

   }

   @SuppressWarnings("unused")
   public static void codeableConceptEnums() {
      // START SNIPPET: codeableConceptEnums
      Patient patient = new Patient();

      // Set the CodeableConcept's first coding to use the code
      // and codesystem associated with the M value.
      patient.setMaritalStatus(MaritalStatusCodesEnum.M);

      // If you need to set other fields (such as the display name) after
      // using the Enum type, you may still do so.
      patient.getMaritalStatus().getCodingFirstRep().setDisplay("Married");
      patient.getMaritalStatus().getCodingFirstRep().setVersion("1.0");
      patient.getMaritalStatus().getCodingFirstRep().setUserSelected(true);

      // You can use accessors to retrieve values from CodeableConcept fields

      // Returns "M"
      String code = patient.getMaritalStatus().getCodingFirstRep().getCode();

      // Returns "http://hl7.org/fhir/v3/MaritalStatus". This value was also
      // populated via the enum above.
      String codeSystem = patient.getMaritalStatus().getCodingFirstRep().getCode();

      // In many cases, Enum types can be used to retrieve values as well. Note that
      // the setter takes a single type, but the getter returns a Set, because the
      // field can technicaly contain more than one code and codesystem. BE CAREFUL
      // when using this method however, as no Enum will be returned in the case
      // that the field contains only a code other than the ones defined by the Enum.
      Set<MaritalStatusCodesEnum> status = patient.getMaritalStatus().getValueAsEnum();
      // END SNIPPET: codeableConceptEnums

   }

   public static void main(String[] args) {
      tmp();

      datatypes();

      // START SNIPPET: observation
      // Create an Observation instance
      Observation observation = new Observation();

      // Give the observation a status
      observation.setStatus(ObservationStatusEnum.FINAL);

      // Give the observation a code (what kind of observation is this)
      CodingDt coding = observation.getCode().addCoding();
      coding.setCode("29463-7").setSystem("http://loinc.org").setDisplay("Body Weight");

      // Create a quantity datatype
      QuantityDt value = new QuantityDt();
      value.setValue(83.9).setSystem("http://unitsofmeasure.org").setCode("kg");
      observation.setValue(value);

      // Set the reference range
      SimpleQuantityDt low = new SimpleQuantityDt();
      low.setValue(45).setSystem("http://unitsofmeasure.org").setCode("kg");
      observation.getReferenceRangeFirstRep().setLow(low);
      SimpleQuantityDt high = new SimpleQuantityDt();
      low.setValue(90).setSystem("http://unitsofmeasure.org").setCode("kg");
      observation.getReferenceRangeFirstRep().setHigh(high);

      // END SNIPPET: observation

   }

   private static void tmp() {
// Create a FHIR Context
FhirContext ctx = FhirContext.forDstu2();

// Create a client
IGenericClient client = ctx.newRestfulGenericClient("http://fhirtest.uhn.ca/baseDstu2");

// Read a patient with the given ID
Patient patient = client
   .read()
   .resource(Patient.class)
   .withId("952975")
   .execute();

// Print the patient's name
String string = ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient);
System.out.println(string);

   }

   public void namesHard() {
      // START SNIPPET: namesHard
      Patient patient = new Patient();
      HumanNameDt name = patient.addName();
      StringDt family = name.addFamily();
      family.setValue("Smith");
      StringDt firstName = name.addGiven();
      firstName.setValue("Rob");
      StringDt secondName = name.addGiven();
      secondName.setValue("Bruce");
      // END SNIPPET: namesHard
   }

   public void namesEasy() {
      // START SNIPPET: namesEasy
      Patient patient = new Patient();
      patient.addName().addFamily("Smith").addGiven("Rob").addGiven("Bruce");
      // END SNIPPET: namesEasy
   }

}


text:
namespace policy {

FakeDeviceCloudPolicyManager::FakeDeviceCloudPolicyManager(
    std::unique_ptr<DeviceCloudPolicyStoreAsh> store,
    const scoped_refptr<base::SequencedTaskRunner>& task_runner)
    : DeviceCloudPolicyManagerAsh(
          std::move(store),
          std::make_unique<MockCloudExternalDataManager>(),
          task_runner,
          nullptr),
      unregister_result_(true) {}

FakeDeviceCloudPolicyManager::~FakeDeviceCloudPolicyManager() {
  Shutdown();
}

void FakeDeviceCloudPolicyManager::Unregister(UnregisterCallback callback) {
  std::move(callback).Run(unregister_result_);
}

void FakeDeviceCloudPolicyManager::Disconnect() {}

}  // namespace policy


text:
* Author: Kenta Ishii
* License: MIT
* License URL: https://opensource.org/licenses/MIT

**Output/Input**

* GPIO 47 (ACT LED) as Output

* HDMI as VIDEO Output

**Compatibility**

* Raspberry Pi Zero V.1.3 (BCM2835), `make type=zero`

* Raspberry Pi Zero W V.1.1 (BCM2835), `make type=zerow`

* Raspberry Pi 2 B V.1.1 (BCM2836), `make type=2b`

* Raspberry Pi 3 B V.1.2 (BCM2837), `make type=3b`

## Information of this README and comments in this project may be incorrect. This project is not an official document of ARM, Broadcom Ltd., Raspberry Pi Foundation and other holders of any Intellectual Property (IP), and is made of my experience, and even my hypothesis to the architecture of Raspberry Pi. Please don't apply these information in this project to your development. `TEST IT BY YOURSELF AND CONFIRM IT BY AUTHORITY FOR SAFETY` is an important value as a developer.

**Memorandum on Testing**

* Lacking of the first dot occurs at `fb32_draw_image` on a particular situation (check a character in user32.c.alpha), which seems that the little difference between the prior color and the current color on the first dot causes this issue. So far, data memory barriers does not fix this issue. However, this issue occurs only on my Zero W and 3 B, but not my Zero and 2 B. It may be caused by an individual difference or an issue between the HDMI output and the display.

**Memorandum on BCM2835**

* Flagging "shareable" to the address translation table makes speed of accessing memory slower. This affects writing speed to the framebuffer.


text:
package com.stunny.vogel.campusvirtual.Actividades;

import android.app.ActionBar;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;

import com.stunny.vogel.campusvirtual.Actividades.Add.AddEditExam;
import com.stunny.vogel.campusvirtual.Actividades.Add.AddStudent;
import com.stunny.vogel.campusvirtual.Logica.FontManager;
import com.stunny.vogel.campusvirtual.R;

public class MainMenuActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_menu);

        getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);
        getSupportActionBar().setDisplayUseLogoEnabled(true);
        getSupportActionBar().setLogo(R.drawable.logo);

        //--Asignación de iconos--//
        TextView subjectIcon = (TextView) findViewById(R.id.manageSubject_icon),
                studentsIcon = (TextView) findViewById(R.id.manageStudents_icon),
                examsIcon = (TextView) findViewById(R.id.exams_icon),
                logoutIcon = (TextView) findViewById(R.id.logout_icon);

        Typeface fa = FontManager.getTypeface(getApplicationContext(), FontManager.FONT_AWESOME);
        FontManager.markAsIconContainer(studentsIcon, fa);
        FontManager.markAsIconContainer(subjectIcon, fa);
        FontManager.markAsIconContainer(examsIcon, fa);
        FontManager.markAsIconContainer(logoutIcon, fa);

        //--Listeners de las opciones del menu principal--//
        setMenuListeners();

    }

    public void setMenuListeners(){
        findViewById(R.id.manageSubject).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainMenuActivity.this, SubjectsActivity.class);
                startActivity(i);
            }
        });
        findViewById(R.id.manageStudents).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainMenuActivity.this, StudentsActivity.class);
                startActivity(i);
            }
        });
        findViewById(R.id.exams).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainMenuActivity.this, ExamsActivity.class);
                startActivity(i);
            }
        });
        findViewById(R.id.logout).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SharedPreferences prefs = getApplicationContext().getSharedPreferences(getPackageName()+"_preferences", MODE_PRIVATE);
                prefs.edit().putBoolean("logeado", false).commit();
                Intent i = new Intent(MainMenuActivity.this, LoginActivity.class);
                i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
                startActivity(i);
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu){

        MenuInflater mi = getMenuInflater();
        mi.inflate(R.menu.main_menu_action_bar_menu, menu);

        return super.onCreateOptionsMenu(menu);

    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item){

        switch(item.getItemId()){
            case R.id.new_student:
                Intent i = new Intent(MainMenuActivity.this, AddStudent.class);
                startActivity(i);
                return true;

            case R.id.new_subject:
                //Intent ns = new Intent(MainMenuActivity.this, AddSubject.class);
                //startActivity(ns);
                return true;

            case R.id.new_exam:
                Intent ne = new Intent(MainMenuActivity.this, AddEditExam.class);
                ne.putExtra("ADD", true);
                startActivity(ne);
                return true;

            case R.id.quit:
                finish();
                System.exit(0);
                return true;

            default:
                return super.onOptionsItemSelected(item);
        }

    }
}


text:
const dotenv = require("dotenv");
const { BlobServiceClient } = require("@azure/storage-blob");
const pkg = require("./package.json");

dotenv.config({
    path: "../../.env"
});

const SIGNATURES = [
    process.env.CDN_EUNO_SAS,
    process.env.CDN_USWE_SAS
];

const FILES = [
    "adal.min.js",
    "adal-angular.min.js"
];

async function uploadToCdn(sas) {
    const cdn = sas.split("?")[0];

    console.log("Starting uploads to CDN:", cdn);

    const blobServiceClient = new BlobServiceClient(sas);
    const containerClient = blobServiceClient.getContainerClient("");

    return Promise.all(FILES.map(async (file) => {
        const blobName = `lib/${pkg.version}/js/${file}`;

        console.log(cdn, blobName, "Uploading file");

        const blockBlobClient = containerClient.getBlockBlobClient(blobName);

        const fileName = `./build/${file}`;

        try {
            const blobExists = await blockBlobClient.exists();

            if (!blobExists) {
                await blockBlobClient.uploadFile(fileName, {
                    blobHTTPHeaders: {
                        blobContentType: "text/javascript"
                    }
                });

                console.log(cdn, blobName, "Upload complete");
            } else {
                console.warn(cdn, blobName, "File exists");
            }
        } catch (e) {
            console.error(cdn, blobName, "Upload failed");
        }
    }));
}

Promise.all(SIGNATURES.map(sas => uploadToCdn(sas)))
    .then(results => {
        console.log("Uploads complete");
    })
    .catch((error) => {
        console.log("Upload error", error);
    })
    .finally(() => {
        process.exit(0);
    });


text:
package fr.inra.maiage.bibliome.alvisnlp.bibliomefactory.modules.contes;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import fr.inra.maiage.bibliome.alvisnlp.bibliomefactory.library.StringLibrary;
import fr.inra.maiage.bibliome.alvisnlp.bibliomefactory.modules.SectionModule.SectionResolvedObjects;
import fr.inra.maiage.bibliome.alvisnlp.core.corpus.Annotation;
import fr.inra.maiage.bibliome.alvisnlp.core.corpus.Corpus;
import fr.inra.maiage.bibliome.alvisnlp.core.corpus.Layer;
import fr.inra.maiage.bibliome.alvisnlp.core.corpus.Section;
import fr.inra.maiage.bibliome.alvisnlp.core.corpus.expressions.EvaluationContext;
import fr.inra.maiage.bibliome.alvisnlp.core.module.ModuleException;
import fr.inra.maiage.bibliome.alvisnlp.core.module.ProcessingContext;
import fr.inra.maiage.bibliome.util.Iterators;
import fr.inra.maiage.bibliome.util.files.OutputFile;
import fr.inra.maiage.bibliome.util.streams.FileSourceStream;
import fr.inra.maiage.bibliome.util.streams.SourceStream;

class Word2VecExternalHandler extends AbstractContesExternalHandler<SectionResolvedObjects,Word2Vec> {
	Word2VecExternalHandler(ProcessingContext<Corpus> processingContext, Word2Vec module, Corpus annotable) {
		super(processingContext, module, annotable);
	}

	@Override
	protected String getContesModule() {
		return "module_word2vec/main_word2vec.py";
	}

	@Override
	protected void prepare() throws IOException, ModuleException {
		createInputFile();
	}

	private void createInputFile() throws IOException {
		Word2Vec owner = getModule();
		EvaluationContext ctx = new EvaluationContext(getLogger());
		try (PrintStream ps = new PrintStream(getWord2VecInputFile(), "UTF-8")) {
			BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(ps, "UTF-8"));
			for (Section sec : Iterators.loop(owner.sectionIterator(ctx, getAnnotable()))) {
				for (Layer sent : sec.getSentences(owner.getTokenLayerName(), owner.getSentenceLayerName())) {
					for (Annotation tok : sent) {
						String form = StringLibrary.normalizeSpace(tok.getLastFeature(owner.getFormFeatureName()));
						bw.write(form);
						bw.newLine();
					}
					bw.newLine();
				}
			}
		}
	}

	private File getWord2VecInputFile() {
		return getTempFile("input.txt");
	}

	@Override
	protected void collect() throws IOException, ModuleException {
		collectTokenVectors();
	}

	private void collectTokenVectors() throws IOException {
		Word2Vec owner = getModule();
		if (owner.getVectorFeatureName() == null) {
			return;
		}
		EvaluationContext ctx = new EvaluationContext(getLogger());
		Map<String,String> wordVectors = readWordVectors();
		for (Section sec : Iterators.loop(owner.sectionIterator(ctx, getAnnotable()))) {
			for (Layer sent : sec.getSentences(owner.getTokenLayerName(), owner.getSentenceLayerName())) {
				for (Annotation tok : sent) {
					String form = StringLibrary.normalizeSpace(tok.getLastFeature(owner.getFormFeatureName()));
					if (wordVectors.containsKey(form)) {
						String vector = wordVectors.get(form);
						tok.addFeature(owner.getVectorFeatureName(), vector);
					}
					else {
						getLogger().warning("could not find vector for " + form);
					}
				}
			}
		}
	}

	private Map<String,String> readWordVectors() throws IOException {
		Map<String,String> result = new HashMap<String,String>();
		SourceStream source = new FileSourceStream("UTF-8", getEffectiveTxtFile().getAbsolutePath());
		try (BufferedReader r = source.getBufferedReader()) {
			while (true) {
				String line = r.readLine();
				if (line == null) {
					break;
				}
				int tab = line.trim().indexOf('\t');
				String word = line.substring(0, tab);
				String vector = line.substring(tab+1);
				result.put(word, vector);
			}
		}
		return result;
	}

	@Override
	protected String getExecTask() {
		return "word2vec";
	}

	@Override
	protected List<String> getCommandLine() {
		List<String> result = new ArrayList<String>(20);
		Word2Vec owner = getModule();
		result.add(owner.getPython3Executable().getAbsolutePath());
		result.add(getContesCommand());
		addAdditionalArguments(result);
		addOptionalFile(result, "--json", owner.getJsonFile());
		addOptionalFile(result, "--txt", getEffectiveTxtFile());
		addOptionalFile(result, "--bin", owner.getModelFile());
		result.add("--vector-size");
		result.add(owner.getVectorSize().toString());
		result.add("--window-size");
		result.add(owner.getWindowSize().toString());
		result.add("--skip-gram");
		result.add("--min-count");
		result.add(owner.getMinCount().toString());
		result.add("--workers");
		result.add(owner.getWorkers().toString());
		result.add(getWord2VecInputFile().getAbsolutePath());
		return result;
	}

	private File getEffectiveTxtFile() {
		Word2Vec owner = getModule();
		OutputFile txtFile = owner.getTxtFile();
		if (txtFile == null) {
			if (owner.getVectorFeatureName() == null) {
				return null;
			}
			return getTempFile("output.txt");
		}
		return txtFile;
	}
}


text:
<?php
namespace app\components;

use Yii;

class AppComp extends \yii\base\Component
{

    /**
     *
     * @return string
     */
    public static function getStoragePath()
    {
        return Yii::$app->basePath . DIRECTORY_SEPARATOR . 'storage' . DIRECTORY_SEPARATOR;
    }

    /**
     *
     * @return string
     */
    public static function getVendorPath()
    {
        return self::getStoragePath() . 'vendor' . DIRECTORY_SEPARATOR;
    }

    /**
     *
     * @return string
     */
    public static function getDepPath()
    {
        return self::getStoragePath() . 'crack' . DIRECTORY_SEPARATOR . 'dep' . DIRECTORY_SEPARATOR;
    }

    /**
     *
     * @return string
     */
    public static function getPublicPath()
    {
        return self::getStoragePath() . 'public' . DIRECTORY_SEPARATOR;
    }
}


text:
<?php

namespace DigipolisGent\Robo\Task\Deploy\BackupManager\Factory;

interface FilesystemProviderFactoryInterface
{
    /**
     * Creates a FilesystemProvider.
     *
     * @param string|array $filesystemConfig
     *   Config for the FilesystemProvider. A path to a PHP file or an array.
     *
     * @return \BackupManager\Filesystems\FilesystemProvider
     */
    public static function create($filesystemConfig);
}


text:
//
// csvfilter, Copyright (c) 2015, plnu
//

#include "lexToken.h"

#include <assert.h>
#include <stdlib.h>
#include <iostream>

/**
 * @brief Constructor
 *
 * Create a new LexToken.
 *
 * @param type      The type of the token
 * @param position  The position of the token in the expression
 * @param value     The string value of the token
 *
 */
LexToken::LexToken(Type type, Range position, const std::string& value)
    :type_(type), position_(position), value_(value), unary_(false) {

}

/**
 * @brief Destructor
 *
 * Destructor
 *
 */
LexToken::~LexToken() {

}

/**
 * @brief The type of the LexToken
 *
 * @return  The type of this token
 *
 */
LexToken::Type LexToken::type() const {
    return type_;
}

/**
 * @brief The position of this token.
 *
 * @return The position of this token in the expression
 *
 */
Range LexToken::position() const {
    return position_;
}

/**
 * @brief The string value of this token
 *
 * @return  The string value of this token
 *
 */
const std::string& LexToken::value() const {
    return value_;
}

/**
 * @brief The numeric value of this token.
 *
 * Return the numeric value of this token. This can only be called if the type
 * of this token is TYPE_NUMBER.
 *
 * @return  The numeric value of this token.
 */
double LexToken::numberValue() const {
    assert(type_ == TYPE_NUMBER);
    return atof(value_.c_str());
}

/**
 * @brief Is this token an operator?
 *
 * Checks whether this operator is a token. For these purposes an operator is
 * anything that isn't an identifier, string or number, so brackets count as
 * operators, although they aren't strictly treated as operators by the
 * expression parser.
 *
 * @return  true if the token is an operator, false otherwise.
 *
 */
bool LexToken::isOperator() const {
    return (type_ != TYPE_IDENTIFIER &&
            type_ != TYPE_STRING &&
            type_ != TYPE_NUMBER);
}

/**
 * @brief The precedence of the operator
 *
 * Return the precedence of this operator. The higher the return value the
 * higher precedence this operator has when parsing an expression.
 *
 * This function can only be called on tokens that are operators.
 *
 * This precedence order is the same as that implemented by C.
 *
 * @return  The operator precedence.
 *
 */
int LexToken::operatorPrecedence() const {
    assert(isOperator());

    int precedence = 0;
    switch (type_) {
    case TYPE_TIMES:
    case TYPE_DIVIDE:
        precedence = 7;
        break;
    case TYPE_MINUS:
        if (unary_) {
            precedence = 8;
        } else {
            precedence = 6;
        }
        break;
    case TYPE_PLUS:
        precedence = 6;
        break;
    case TYPE_LT:
    case TYPE_LTE:
    case TYPE_GT:
    case TYPE_GTE:
        precedence = 5;
        break;
    case TYPE_EQ:
    case TYPE_NEQ:
        precedence = 4;
        break;
    case TYPE_AND:
        precedence = 3;
        break;
    case TYPE_OR:
        precedence = 2;
        break;
    case TYPE_EOF:
        precedence = 1;
        break;
    case TYPE_OPEN_BRACKET:
        precedence = 0;
        break;
    default:
        std::cerr << "No precedence configured for operator" << std::endl;
        abort();
        break;
    }

    return precedence;
}

/**
 * @brief  Is this a unary operator?
 *
 * Is this operator a unary operator? Currently the only unary operator is '-',
 * which can be either binary (as in "1 - 2") or unary (as in "-5").
 *
 * @see LexToken::setUnary
 *
 * @return  true if this token is a unary operator, or false otherwise
 *
 */
bool LexToken::isUnary() const {
    return unary_;
}

/**
 * @brief  Set whether this token is a unary operator?
 *
 * Set whether this token is a unary operator. This can only be done on a '-'.
 *
 * @see LexToken::isUnary
 *
 * @param newUnary  true if this token is a unary operator, or false otherwise
 *
 */
void LexToken::setUnary(bool newUnary) {
    assert(type_ == TYPE_MINUS);
    unary_ = newUnary;
}

/**
 *
 * @brief Streaming operator for LexToken::Type
 *
 * Streams a LexToken::Type.
 *
 * @param out  The stream to write to
 * @param t    The token to write
 *
 * @return  The stream that was written to
 *
 */
std::ostream& operator<< (std::ostream &out, LexToken::Type t)
{
    const char* label = "UNKNOWN";
    switch (t) {
    case LexToken::TYPE_PLUS:
        label = "TYPE_PLUS";
        break;
    case LexToken::TYPE_MINUS:
        label = "TYPE_MINUS";
        break;
    case LexToken::TYPE_TIMES:
        label = "TYPE_TIMES";
        break;
    case LexToken::TYPE_DIVIDE:
        label = "TYPE_DIVIDE";
        break;
    case LexToken::TYPE_LT:
        label = "TYPE_LT";
        break;
    case LexToken::TYPE_LTE:
        label = "TYPE_LTE";
        break;
    case LexToken::TYPE_EQ:
        label = "TYPE_EQ";
        break;
    case LexToken::TYPE_NEQ:
        label = "TYPE_NEQ";
        break;
    case LexToken::TYPE_GT:
        label = "TYPE_GTE";
        break;
    case LexToken::TYPE_GTE:
        label = "TYPE_GTE";
        break;
    case LexToken::TYPE_AND:
        label = "TYPE_AND";
        break;
    case LexToken::TYPE_OR:
        label = "TYPE_OR";
        break;
    case LexToken::TYPE_EOF:
        label = "TYPE_EOF";
        break;
    case LexToken::TYPE_OPEN_BRACKET:
        label = "TYPE_OPEN_BRACKET";
        break;
    case LexToken::TYPE_CLOSE_BRACKET:
        label = "TYPE_CLOSE_BRACKET";
        break;
    case LexToken::TYPE_IDENTIFIER:
        label = "TYPE_IDENTIFIER";
        break;
    case LexToken::TYPE_STRING:
        label = "TYPE_STRING";
        break;
    case LexToken::TYPE_NUMBER:
        label = "TYPE_NUMBER";
        break;
    }
    out << label;

    return out;
}